Code example for TestResult

Methods: addListener

0
	} 
	 
	@Test 
	public void generatedErrorTestsMatchUp() { 
		junit.framework.Test shouldFail= fAdapter.getTests().get(0);
		TestResult result= new TestResult();
		ErrorRememberingListener listener= new ErrorRememberingListener();
		result.addListener(listener);
		fAdapter.run(result);
		assertNotNull(listener.getError());
		assertTrue(shouldFail == listener.getError());
	} 
	 
	public static class InitializesWithError extends JUnit4ClassRunner { 
		public InitializesWithError(Class<?> klass) throws Exception {
			super(klass);
			throw new Exception();
		} 
	} 
}