added test case for patch to issue #156

Former-commit-id: 8fa1de0566760a41d65614921f4bb764178151f8
This commit is contained in:
Jeremy Long
2014-10-22 21:43:23 -04:00
parent d1f3105fbd
commit c6f391501d

View File

@@ -86,4 +86,40 @@ public class DependencyBundlingAnalyzerTest extends BaseTest {
assertEquals(expResult, result);
}
@Test
public void testFirstPathIsShortest() {
DependencyBundlingAnalyzer instance = new DependencyBundlingAnalyzer();
String left = "./a/c.jar";
String right = "./d/e/f.jar";
boolean expResult = true;
boolean result = instance.firstPathIsShortest(left, right);
assertEquals(expResult, result);
left = "./a/b/c.jar";
right = "./d/e/f.jar";
expResult = true;
result = instance.firstPathIsShortest(left, right);
assertEquals(expResult, result);
left = "./d/b/c.jar";
right = "./a/e/f.jar";
expResult = false;
result = instance.firstPathIsShortest(left, right);
assertEquals(expResult, result);
left = "./a/b/c.jar";
right = "./d/f.jar";
expResult = false;
result = instance.firstPathIsShortest(left, right);
assertEquals(expResult, result);
left = "./a/b/c.jar";
right = "./a/b/c.jar";
expResult = true;
result = instance.firstPathIsShortest(left, right);
assertEquals(expResult, result);
}
}