Dear Wiki user, You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification.
The "HowTo/CreateUnitTests" page has been changed by Mehdi Houshmand: http://wiki.apache.org/xmlgraphics-fop/HowTo/CreateUnitTests?action=diff&rev1=2&rev2=3 * The {{{junit.framework.TestSuite}}} is no longer used for creating a suite of tests. Instead a test suite should have the follwing annotations: . {{{@org.junit.runner.RunWith(org.junit.runners.Suite.class)}}} . {{{@org.junit.runners.Suite.SuiteClasses({ < list class names that should be run > })}}} - . However, FOP now uses a regular expression ({{{**/*TestCase.java}}}) for adding test classes to a list of tests to run. This does not mean that test cases should not be added to a test suite! Other developers still use the test suites to run a subset of tests and as such it is important to ensure your test case is added the the appropriate test suite. Another consideration is that Abstract test class names should not be suffixed with "TestCase" as this will throw an exception in the JUnit class loader. + . However, FOP now uses a regular expression ({{{**/*TestCase.java}}}) for adding test classes to a list of tests to run. This does not mean that test cases should not be added to a test suite! Other developers still use the test suites to run a subset of tests and as such it is important to ensure your test case is added the the appropriate test suite. + + * As a consequence of the previous point Abstract test class names should not be suffixed with "TestCase" as this will throw an exception in the JUnit class loader. * A test can be parameterized using {{{@RunWith(Parameterized.class)}}} annotation on the class, with a corresponding {{{@Parameters}}} annotation on the method that gets the parameters (which must have a signature of {{{public static Collection<T[]>}}} where {{{T}}} is the parameter type). The parameters are then injected into the constructor of the test, such that {{{T[0]}}} is the first constructor parameter etc. This is how the Layout Engine tests have been implemented. There is an unfortunate consequence that currently Junit4 does not provide a way of name parameterized tests, hopefully this will be addressed in future versions of JUnit. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
