}
public void testFindNewRevisions() {
AppContextForTesting.initForTest();
IMocksControl control = EasyMock.createControl();
CommandRunner cmd = control.createMock(CommandRunner.class);
AppContext.RUN.cmd = cmd;
DummyDb db = new DummyDb(false);
// Mock call for findHighestRevision
try {
expect(cmd.runCommand(
"svn",
ImmutableList.of("--no-auth-cache", "log", "--xml", "-l", "1", "-r", "HEAD:1",
"http://foo/svn/trunk/"),
"")).andReturn("<log><logentry revision=\"3\">" +
"<author>uid@google.com</author>" +
"<date>yyyy-mm-dd</date>" +
"<msg>description</msg></logentry></log>");
} catch (CommandException e) {
throw new RuntimeException(e);
}
// revision 3 metadata
try {
expect(cmd.runCommand(
"svn",
ImmutableList.of("--no-auth-cache", "log", "--xml", "-l", "2", "-r", "3:1",
"http://foo/svn/trunk/"),
"")).andReturn("<log><logentry revision=\"3\">" +
"<author>uid@google.com</author>" +
"<date>yyyy-mm-dd</date>" +
"<msg>message</msg></logentry>" +
"<logentry revision =\"2\">" +
"<author>user@google.com</author>" +
"<date>zzzz-nn-ee</date>" +
"<msg>description</msg></logentry></log>");
} catch (CommandException e) {
throw new RuntimeException(e);
}
// revision 2 metadata
try {
expect(cmd.runCommand(
"svn",
ImmutableList.of("--no-auth-cache", "log", "--xml", "-l", "2", "-r", "2:1",
"http://foo/svn/trunk/"),
"")).andReturn("<log><logentry revision=\"2\">" +
"<author>uid@google.com</author>" +