@Test
	public void testSingleConsoleTooManyError() {
		SingleConsole singleConsole = new SingleConsole(getFreePort()) {
			@Override
			public long getCurrentExecutionCount() {
				return 10;
			}

			@Override
			public Map<String, Object> getStatisticsData() {
				Map<String, Object> newMap = new HashMap<String, Object>();
				Map<Object, Object> errorMap = new HashMap<Object, Object>();

				errorMap.put("Errors", errorCount);
				newMap.put("totalStatistics", errorMap);
				return newMap;
			}
		};
		errorCount = 1;
		assertThat(singleConsole.hasTooManyError(), is(false));
		errorCount = 3;
		assertThat(singleConsole.hasTooManyError(), is(true));
	}
Returns a free port number on localhost, or -1 if unable to find a free port.

@return a free port number on localhost, or -1 if unable to find a free port
ngrinder-core/src/test/java/net/grinder/SingleConsoleTest.java