Code example for TestResult

0
 
    protected static Object test;
    protected static int failures = 0;
     
    public static void main(String args[]) {
        new TestSuite(SelfTestOneJarArgs.class).run(new TestResult());
    } 
     
    public SelfTestOneJarArgs() throws Exception { 
        if (test == null) {
            // Load Test object from the jar. 
            JarClassLoader loader = new JarClassLoader("");
            Boot.setClassLoader(loader);
            // loader.setVerbose(true); 
            loader.load(null);
            test = loader.loadClass("com.simontuffs.onejar.args.test.Main").newInstance();
        } 
    } 
     
    public void testArgs() throws Exception { 
        Invoker.invoke(test, "testArgs");