Package org.junit.runner

Examples of org.junit.runner.Result.wasSuccessful()


    }

    @Test
    public void runtimeDuringTestShouldReturnTimeSinceStart() {
        Result result = runTest(DurationDuringTestTest.class);
        assertTrue(result.wasSuccessful());
    }

  @Test
    public void runtimeAfterTestShouldReturnRunDuration() {
        Result result = runTest(DurationAfterTestTest.class);
View Full Code Here


    }

  @Test
    public void runtimeAfterTestShouldReturnRunDuration() {
        Result result = runTest(DurationAfterTestTest.class);
        assertTrue(result.wasSuccessful());
    }
}
View Full Code Here

    }

    @Test
    public void testFilterInRunnerConstructor() {
        Result result = JUnitCore.runClasses(FilteredTest.class);
        assertTrue(result.wasSuccessful());
    }
}
View Full Code Here

    @Test
    public void expected() {
        JUnitCore core = new JUnitCore();
        Result result = core.run(Expected.class);
        assertTrue(result.wasSuccessful());
    }

    public static class Unexpected {
        @Test(expected = Exception.class)
        public void expected() throws Exception {
View Full Code Here

    @Test
    public void noneThrown() {
        JUnitCore core = new JUnitCore();
        Result result = core.run(NoneThrown.class);
        assertFalse(result.wasSuccessful());
        String message = result.getFailures().get(0).getMessage();
        assertTrue(message.contains("Expected exception: java.lang.Exception"));
    }

    public static class ExpectSuperclass {
View Full Code Here

  }
 
  @Test public void expected() {
    JUnitCore core= new JUnitCore();
    Result result= core.run(Expected.class);
    assertTrue(result.wasSuccessful());
  }
 
  public static class Unexpected {
    @Test(expected= Exception.class) public void expected() throws Exception {
      throw new Error();
View Full Code Here

    }
  }
  @Test public void noneThrown() {
    JUnitCore core= new JUnitCore();
    Result result= core.run(NoneThrown.class);
    assertFalse(result.wasSuccessful());
    String message= result.getFailures().get(0).getMessage();
    assertTrue(message.contains("Expected exception: java.lang.Exception"));
  }
 
  public static class ExpectSuperclass {
View Full Code Here

        assertThat(computer.classes.size(), is(0));
        assertThat(computer.nestedClasses.size(), is(2));
        assertThat(computer.nestedSuites.size(), is(0));
        assertFalse(computer.splitPool);
        assertThat(computer.poolCapacity, is(4));
        assertTrue(result.wasSuccessful());
        if (Class1.maxConcurrentMethods == 1) {
            assertThat(timeSpent, between(1950, 2250));
        } else if (Class1.maxConcurrentMethods == 2) {
            assertThat(timeSpent, between(1450, 1750));
        } else {
View Full Code Here

        assertThat(computer.classes.size(), is(1));
        assertThat(computer.nestedClasses.size(), is(2));
        assertThat(computer.nestedSuites.size(), is(0));
        assertFalse(computer.splitPool);
        assertThat(computer.poolCapacity, is(5));
        assertTrue(result.wasSuccessful());
        assertThat(Class1.maxConcurrentMethods, is(2));
        assertThat(timeSpent, anyOf(between(1450, 1750), between(1950, 2250), between(2450, 2750)));
    }

    @Test
View Full Code Here

        assertThat(computer.classes.size(), is(1));
        assertThat(computer.nestedClasses.size(), is(2));
        assertThat(computer.nestedSuites.size(), is(0));
        assertFalse(computer.splitPool);
        assertThat(computer.poolCapacity, is(8));
        assertTrue(result.wasSuccessful());
        assertThat(Class1.maxConcurrentMethods, is(4));
        assertThat(timeSpent, between(950, 1250));
    }

    @Test
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.