Package bm.javautil
Class RunJunit4
java.lang.Object
bm.javautil.RunJunit4
Provides a way to run Junit4 on a list of classes with logging to blend in with
other BuildMachine logging.
-
Method Summary
-
Method Details
-
main
Runs Junit on classes if their fully qualified name contains a match of a regex given on the command line. If the regex is followed by"#method1,method2,..."only the given listed methods are run in matching classes. While".#specificTest"is possible, it will create a warning for all classes which do not containspecificTest.Test failures are logged with a single line to
System.err, which is to be expected to come out in the console together with other BuildMachine logging. A full failure log is written toSystem.outwith the intention of being captured into a file for closer inspection.Finally, a summary line is logged with failed, run and ignored test counts.
Example
java ... bm.RunJunit4 path/to/testclasses SomeTest OtherTest#someMethod,otherMethod- Parameters:
argv- with argv[0] a classpath like string, i.e. separated byFile.pathSeparatorwhere we look for class names to match. All other arguments have the formclassnameRe[#m[,m...]]as described above.- Throws:
Exception
-