Search in sources :

Example 31 with Result

use of org.junit.runner.Result in project junit4 by junit-team.

the class CategoriesAndParameterizedTest method runsTestMethodWithCategory.

@Test
public void runsTestMethodWithCategory() {
    Result result = new JUnitCore().run(SuiteWithParameterizedTestWithMethodWithCategory.class);
    assertEquals(2, result.getRunCount());
    assertEquals(0, result.getFailureCount());
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Result(org.junit.runner.Result) Test(org.junit.Test)

Example 32 with Result

use of org.junit.runner.Result in project junit4 by junit-team.

the class DisableOnDebugTest method whenRunWithPreJava5DebugArgumentsTestShouldFail.

@Test
public void whenRunWithPreJava5DebugArgumentsTestShouldFail() {
    JUnitCore core = new JUnitCore();
    Result result = core.run(PreJava5DebugArgumentsTest.class);
    assertEquals("Should run the test", 1, result.getRunCount());
    assertEquals("Test should not have failed", 0, result.getFailureCount());
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Result(org.junit.runner.Result) Test(org.junit.Test)

Example 33 with Result

use of org.junit.runner.Result in project junit4 by junit-team.

the class DisableOnDebugTest method whenRunWithPostJava5DebugArgumentsTestShouldFail.

@Test
public void whenRunWithPostJava5DebugArgumentsTestShouldFail() {
    JUnitCore core = new JUnitCore();
    Result result = core.run(PostJava5DebugArgumentsTest.class);
    assertEquals("Should run the test", 1, result.getRunCount());
    assertEquals("Test should not have failed", 0, result.getFailureCount());
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Result(org.junit.runner.Result) Test(org.junit.Test)

Example 34 with Result

use of org.junit.runner.Result in project junit4 by junit-team.

the class DisableOnDebugTest method whenRunWithoutDebugFlagsTestShouldPass.

@Test
public void whenRunWithoutDebugFlagsTestShouldPass() {
    JUnitCore core = new JUnitCore();
    Result result = core.run(WithoutDebugArgumentsTest.class);
    assertEquals("Should run the test", 1, result.getRunCount());
    assertEquals("Test should have failed", 1, result.getFailureCount());
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Result(org.junit.runner.Result) Test(org.junit.Test)

Example 35 with Result

use of org.junit.runner.Result in project junit4 by junit-team.

the class DisableOnDebugTest method whenRunWithPreJava5DebugArgumentsInReverseOrderTestShouldFail.

@Test
public void whenRunWithPreJava5DebugArgumentsInReverseOrderTestShouldFail() {
    JUnitCore core = new JUnitCore();
    Result result = core.run(PreJava5DebugArgumentsReversedTest.class);
    assertEquals("Should run the test", 1, result.getRunCount());
    assertEquals("Test should not have failed", 0, result.getFailureCount());
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Result(org.junit.runner.Result) Test(org.junit.Test)

Aggregations

Result (org.junit.runner.Result)343 Test (org.junit.Test)267 JUnitCore (org.junit.runner.JUnitCore)104 Failure (org.junit.runner.notification.Failure)93 PrintableResult.testResult (org.junit.experimental.results.PrintableResult.testResult)61 UnitTest (org.apache.geode.test.junit.categories.UnitTest)56 Description (org.junit.runner.Description)28 Request (org.junit.runner.Request)23 TestResult (junit.framework.TestResult)21 RunListener (org.junit.runner.notification.RunListener)18 IOException (java.io.IOException)12 SettableCurrentRunningTest (com.google.testing.junit.runner.internal.junit4.SettableCurrentRunningTest)11 CurrentRunningTest (com.google.testing.junit.runner.util.CurrentRunningTest)11 JUnit4TestListener (com.intellij.junit4.JUnit4TestListener)9 ArrayList (java.util.ArrayList)8 Runner (org.junit.runner.Runner)7 ComparisonFailure (org.junit.ComparisonFailure)6 CategoryFilter (org.junit.experimental.categories.Categories.CategoryFilter)5 TextListener (org.junit.internal.TextListener)5 ShardingEnvironment (com.google.testing.junit.runner.sharding.ShardingEnvironment)4