public void testDetectMaxTimeout() throws Exception {
ByteArrayInputStream bais = new ByteArrayInputStream(
"Test1\nTest1\nTest1\nTest1\nTest1\nTest2: blah\nTest3: bloo".getBytes());
try {
boolean result = ResponderTask.detect("^TestZ: .*", null, 100, 50, new InputStreamReader(bais),
new PartialLineBuffer());
fail("Should have thrown exception");
} catch (ResponderTask.ThreshholdException e) {
assertNotNull(e);
assertEquals(Long.valueOf(100), e.getValue());
assertEquals(ResponderTask.ThresholdType.milliseconds, e.getType());