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=1&rev2=2 * 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. + == Mocking Framework == + As of r1204457 [[http://code.google.com/p/mockito/|mockito]] has been added to the testing library class path. The link provided has plenty of information and a brief tutorial to help developers starting to use mocking in their tests. + == Code Coverage == As of r1203749 FOP uses [[http://www.eclemma.org/jacoco/|Jacoco]] for code-coverage analysis. There are several things that must be done before Jacoco can be run, firstly the developer needs to download Jacoco and specify the directory of the JAR to give build.xml access to it. This is preferably done by adding the {{{$jacocoant.jar}}} property to build-local.properties which will be consumed by jacoco.xml. Then, the {{{ant -f jacoco.xml clean coverage-report}}} command can be used to invoke code coverage analysis. The results are output in HTML format to the build/report_jacoco/ directory. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
