Code example for TestResult

Methods: errorCounterrors

		@BeforeClass public void shouldBeStatic() {} 
		@Test public void aTest() {} 
	public void testInvalidMethod() { 
		TestResult result= new TestResult();
		junit.framework.Test adapter= new JUnit4TestAdapter(InvalidMethodTest.class);;
		assertEquals(1, result.errorCount());	
		TestFailure failure= result.errors().nextElement();
		assertTrue(failure.exceptionMessage().contains("Method shouldBeStatic() should be static"));
	private static boolean wasRun= false;
	public static class MarkerRunner extends Runner { 
		public MarkerRunner(Class<?> klass) {
Experience pair programming with AI  Get Codota for Java