File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes junit4 suite Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "junit4 suite" Watch "junit4 suite" New topic
Author

junit4 suite

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
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


java amateur
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
I'm not sure I understand the question. What do you want to accomplish?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
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

Joined: Nov 24, 2008
Posts: 2
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

Joined: Dec 07, 2008
Posts: 1
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
 
subject: junit4 suite