/** * Test basic blame functionality. This test marginally tests blame * correctness, mainly just that the blame APIs link correctly. * @throws Throwable * @since 1.5 */ public void testBasicBlame() throws Throwable { OneTest thisTest = new OneTest(); // Test the old interface to be sure it still works byte[] result = client.blame(thisTest.getWCPath() + "/iota", Revision .getInstance(1), Revision.getInstance(1)); assertEquals(" 1 jrandom This is the file 'iota'.\n", new String(result)); // Test the current interface BlameCallbackImpl callback = new BlameCallbackImpl(); client.blame(thisTest.getWCPath() + "/iota", Revision.getInstance(1), Revision.getInstance(1), callback); assertEquals(1, callback.numberOfLines()); BlameCallbackImpl.BlameLine line = callback.getBlameLine(0); if (line != null) { assertEquals(1, line.getRevision()); assertEquals("jrandom", line.getAuthor()); } }
/** * Test basic blame functionality. This test marginally tests blame * correctness, mainly just that the blame APIs link correctly. * @throws Throwable * @since 1.5 */ public void testBasicBlame() throws Throwable { OneTest thisTest = new OneTest(); // Test the old interface to be sure it still works byte[] result = client.blame(thisTest.getWCPath() + "/iota", Revision .getInstance(1), Revision.getInstance(1)); assertEquals(" 1 jrandom This is the file 'iota'.\n", new String(result)); // Test the current interface BlameCallbackImpl callback = new BlameCallbackImpl(); client.blame(thisTest.getWCPath() + "/iota", Revision.getInstance(1), Revision.getInstance(1), callback); assertEquals(1, callback.numberOfLines()); BlameCallbackImpl.BlameLine line = callback.getBlameLine(0); if (line != null) { assertEquals(1, line.getRevision()); assertEquals("jrandom", line.getAuthor()); } }