Code example for TestResult

Methods: errorCount, errors

0
		assertEquals(1, fAdapter.getTests().size());
	} 
	 
	@Test 
	public void initializationErrorsAreThrownAtRuntime() { 
		TestResult result= new TestResult();
		fAdapter.run(result);
		assertEquals(1, result.errorCount());
		assertEquals(CantInitialize.UNIQUE_ERROR_MESSAGE, result.errors()
				.nextElement().exceptionMessage());
	} 
 
	private final class ErrorRememberingListener implements TestListener {
		private junit.framework.Test fError;
 
		public void addError(junit.framework.Test test, Throwable t) {
			fError= test;
		} 
 
		public void addFailure(junit.framework.Test test,
				AssertionFailedError t) {