Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What Is the "@SuiteClasses" Annotation?
What Is the "@SuiteClasses" Annotation?
✍: FYICenter.com QA Team
"@SuiteClasses" is a class annotation defined in JUnit 4.4 in org.junit.runners.Suite.SuiteClasses. It allows you to define a suite class as described in the previous question.
By the way, the API document of JUnit 4.4 has a major typo for the org.junit.runners.Suite class (Suite.html).
Using Suite as a runner allows you to manually build a suite containing tests from many classes. It is the JUnit 4 equivalent of the JUnit 3.8.x static Test suite() method. To use it, annotate a class with @RunWith(Suite.class) and @SuiteClasses(TestClass1.class, ...). When you run this class, it will run all the tests in all the suite classes.
"@SuiteClasses(TestClass1.class, ...)" should be changed to "@Suite.SuiteClasses({TestClass1.class, ...})".
Someone provided wrong information on build test suite in JUnit 4.4. Do not follow this:
JUnit provides tools to define the suite to be run and to display its results. To run tests and see the results on the console, run:
org.junit.runner.TextListener.run(TestClass1.class, ...);
2008-01-31, 6601👍, 0💬
Popular Posts:
What does AddressOf operator do in background ? The AddressOf operator creates a delegate object to ...
What is CodeDom? “CodeDom” is an object model which represents actually a source code. It is designe...
What is the sequence of UML diagrams in project? First let me say some fact about this question, you...
What's the output of the following program? And why? #include main() { typedef union { int a; char b...
How To Run a JUnit Test Class? A JUnit test class usually contains a number of test methods. You can...