File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

junit4 suite

 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to have a suite, i've this code:

i also know that one can use older junit to run junit4 tests, using:

but, how can i put both ideas togheter?

TiA
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand the question. What do you want to accomplish?
 
miguel lisboa
Ranch Hand
Posts: 1281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i read elsewhere (scroll down till compatibility title) that one can run junit4 tests with junit 3.8.1 if you add adapter code; i'd like to experiment it

So, i wonder how can i run my suite (written with junit4) with junit 3.8.1, using the adapter code; i dont know how to put it toghether

hope i made myself clear this time
[ September 07, 2006: Message edited by: miguel lisboa ]
 
Elena Shevyakina
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
this post is for newcomers that are looking for an answer at the similar question ;-)

@RunWith(Suite.class)
@Suite.SuiteClasses(
{
TestA.class,
TestB.class
}
)

public class AllTests {

public static Test suite() {
TestSuite suite = new TestSuite("All tests");
suite.addTest(new JUnit4TestAdapter(TestA.class));
suite.addTest(new JUnit4TestAdapter(TestB.class));
return suite;
}
}
 
Rajesh Gottapu
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class AllTests {

public static Test suite() {
TestSuite suite = new TestSuite("All tests");
suite.addTest(new JUnit4TestAdapter(TestA.class));
suite.addTest(new JUnit4TestAdapter(TestB.class));
return suite;
}
}

In the above code we are adding class file to suite.

Is there any way to add mehtods of class file to suite like JUnit3.8.

if anyone know the answer
please reply to me.

thanks in advance,
Rajesh Gottapu
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic