PortPattern extends AbstractCliPattern<Integer> { @Override public Integer getValue() { return port; } PortPattern(); @Override Integer getValue(); @Override void notifyNotFound(); @Override boolean notFoundIsFatal();  }
@Test public void testSuccess1() { String line = "Port: 3422"; PortPattern pattern = new PortPattern(); boolean matches = pattern.matchesLine(line); assertTrue("Pattern does not match", matches); assertEquals(Integer.valueOf(3422), pattern.getValue()); }
@Test public void testSuccess2() { String line = " s \t Port: 3422"; PortPattern pattern = new PortPattern(); boolean matches = pattern.matchesLine(line); assertTrue("Pattern does not match", matches); assertEquals(Integer.valueOf(3422), pattern.getValue()); }