Examples of JUnitCore


Examples of org.junit.runner.JUnitCore

            run = true;
        }
    }

    public void testAnnotatedMethod() throws Exception {
        JUnitCore runner = new JUnitCore();
        runner.run(SimpleTest.class);
        assertTrue(run);
    }
View Full Code Here

Examples of org.junit.runner.JUnitCore

            run = true;
        }
    }

    public void testAnnotatedMethodWithFutureProofExplicitRunner() throws Exception {
        JUnitCore runner = new JUnitCore();
        runner.run(SimpleTestWithFutureProofExplicitRunner.class);
        assertTrue(run);
    }
View Full Code Here

Examples of org.junit.runner.JUnitCore

        public void success() {
        }
    }

    public void testSetup() throws Exception {
        JUnitCore runner = new JUnitCore();
        runner.run(SetupTest.class);
        assertTrue(run);
    }
View Full Code Here

Examples of org.junit.runner.JUnitCore

        public void success() {
        }
    }

    public void testTeardown() throws Exception {
        JUnitCore runner = new JUnitCore();
        runner.run(TeardownTest.class);
        assertTrue(run);
    }
View Full Code Here

Examples of org.junit.runner.JUnitCore

            org.junit.Assert.fail();
        }
    }

    public void testRunFailure() throws Exception {
        JUnitCore runner = new JUnitCore();
        Result result = runner.run(FailureTest.class);
        assertEquals(1, result.getRunCount());
        assertEquals(1, result.getFailureCount());
        assertEquals(AssertionError.class, result.getFailures().get(0).getException().getClass());
    }
View Full Code Here

Examples of org.junit.runner.JUnitCore

            run = true;
        }
    }

    public void testSetupFailure() throws Exception {
        JUnitCore core = new JUnitCore();
        Result runner = core.run(SetupFailureTest.class);
        assertEquals(1, runner.getRunCount());
        assertEquals(1, runner.getFailureCount());
        assertEquals(Error.class, runner.getFailures().get(0).getException().getClass());
        assertFalse(run);
    }
View Full Code Here

Examples of org.junit.runner.JUnitCore

        public void test() {
        }
    }

    public void testTeardownFailure() throws Exception {
        JUnitCore core = new JUnitCore();
        Result runner = core.run(TeardownFailureTest.class);
        assertEquals(1, runner.getRunCount());
        assertEquals(1, runner.getFailureCount());
        assertEquals(Error.class, runner.getFailures().get(0).getException().getClass());
    }
View Full Code Here

Examples of org.junit.runner.JUnitCore

            throw new Exception("inTest");
        }
    }

    public void testTestAndTeardownFailure() throws Exception {
        JUnitCore core = new JUnitCore();
        Result runner = core.run(TestAndTeardownFailureTest.class);
        assertEquals(1, runner.getRunCount());
        assertEquals(2, runner.getFailureCount());
        assertThat(runner.getFailures().toString(), allOf(containsString("hereAfter"), containsString("inTest")));
    }
View Full Code Here

Examples of org.junit.runner.JUnitCore

            throw new Exception();
        }
    }

    public void testTeardownAfterFailure() throws Exception {
        JUnitCore runner = new JUnitCore();
        runner.run(TeardownAfterFailureTest.class);
        assertTrue(run);
    }
View Full Code Here

Examples of org.junit.runner.JUnitCore

    }
   
    public static Result runTheoryClass(Class<?> testClass) throws InitializationError {
        Runner theoryRunner = new Theories(testClass);
        Request request = Request.runner(theoryRunner);
        return new JUnitCore().run(request);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.