@@ -0,0 +1,1497 @@
+package nl.hsac.fitnesse.junit;%0A%0Aimport org.junit.runner.JUnitCore;%0Aimport org.junit.runner.Result;%0Aimport org.junit.runner.notification.RunListener;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0A/**%0A * Runs JUnit tests from the command line, with RunListeners attached.%0A */%0Apublic class JUnitConsoleRunner %7B%0A    protected List%3CRunListener%3E getListeners() %7B%0A        return Arrays.asList(new JUnitXMLPerPageListener(), new ProgressLoggerListener());%0A    %7D%0A%0A    protected List%3CClass%3E getTestClasses(String%5B%5D args) %7B%0A        List%3CClass%3E classes = new ArrayList%3C%3E();%0A        for (String arg : args) %7B%0A            try %7B%0A                classes.add(Class.forName(arg));%0A            %7D catch (ClassNotFoundException e) %7B%0A                throw new RuntimeException(%22Unable to create instance of: %22 + arg);%0A            %7D%0A        %7D%0A        return classes;%0A    %7D%0A%0A    public Result runTests(String... args) %7B%0A        JUnitCore core = new JUnitCore();%0A        for (RunListener r : getListeners()) %7B%0A            core.addListener(r);%0A        %7D%0A        List%3CClass%3E classes = getTestClasses(args);%0A        return core.run(classes.toArray(new Class%5Bclasses.size()%5D));%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        if (args.length == 0) %7B%0A            System.err.println(%22No test class names provided as argument.%22);%0A            System.exit(-1);%0A        %7D%0A        Result r = new JUnitConsoleRunner().runTests(args);%0A        System.exit(r.wasSuccessful()? 0 : 1);%0A    %7D%0A%7D%0A

Add class to allow jUnit tests to be run directly from command line, with our RunListeners attached