try {
InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN",
"nap:chemical+brothers");
assertNotNull(result);
assertEquals(toURLString(dtdFile),
result.getSystemId());
} catch (Exception e) {
fail("resolveEntity() failed!" + e.toString());
}
try {
String algo = getAlgoName("java.lang.Object");
fail("Illegal classname used.");
} catch (Exception e) {
assertTrue("Wrong exception type: " + e.getClass().getName(), e instanceof BuildException);
assertEquals("Wrong exception message.",
"Specified class (java.lang.Object) is not an Algorithm.",
e.getMessage());
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
|
Method name: void testAbsolutePath()
|
|
Method name: void testIllegalCustomAlgorithm()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 3
|
|
1 | try {↵ | | 1 | try {↵
|
2 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN",↵ | | 2 | ↵
|
3 | "nap:chemical+brothers");↵ | | |
|
4 | assertNotNull(result↵ | | 3 | String algo = getAlgoName("java.lang.Object");↵
|
| | | 4 | fail("Illegal classname used.");↵
|
| | | 5 | } catch (Exception e) {↵
|
5 | );↵ | | 6 | assertTrue("Wrong exception type: " + e.getClass().getName(), e instanceof BuildException);↵
|
6 | assertEquals(toURLString(dtdFile),↵ | | 7 | assertEquals("Wrong exception message.",↵
|
7 | result.getSystemId());↵ | | 8 | ↵
|
8 | } catch (Exception e) {↵ | | |
|
9 | fail("resolveEntity() failed!" + e.toString↵ | | 9 | "Specified class (java.lang.Object) is not an Algorithm.",↵
|
10 | ());↵ | | 10 | e.getMessage());↵
|
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 1 |