SubversionUtils { public static long getUpdateRevision(final List<String> output) { long rev = findRevision(output, UPDATE_REV_NUM_PATTERN); if (rev == -1) { rev = findRevision(output, AT_REV_NUM_PATTERN); } return rev; } private  SubversionUtils(); static long getCheckoutRevision(final List<String> output); static long getCommitRevision(final List<String> output); static long getUpdateRevision(final List<String> output); static long findRevision(final List<String> output, final Pattern pattern);  }
@Test public void testGetUpdateRevision() throws Exception { assertEquals(-1, SubversionUtils.getUpdateRevision(ImmutableList.of( "Some output", "Updated to revision ABC" ))); assertEquals(-1, SubversionUtils.getUpdateRevision(ImmutableList.of( "Some output", "At revision ABC" ))); assertEquals(1588353, SubversionUtils.getUpdateRevision(ImmutableList.of( "Some output", "Updated to revision 1588353." ))); assertEquals(1588353, SubversionUtils.getUpdateRevision(ImmutableList.of( "Some output", "At revision 1588353." ))); }