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/XMLCatalogTest.java | |||
Method name: void testAbsolutePath()
|
Method name: void testSimpleEntry()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | ResourceLocation dtd = new ResourceLocation();↵ | 1 | ResourceLocation dtd = new ResourceLocation();↵ | |
2 | dtd.setPublicId("-//stevo//DTD doc 1.0//EN");↵ | 2 | dtd.setPublicId("-//stevo//DTD doc 1.0//EN");↵ | |
3 | String sysid = System.getProperty("root") + File.separator + "src/etc/testcases/taskdefs/optional/xml/doc.dtd";↵ | 3 | String sysid = "src/etc/testcases/taskdefs/optional/xml/doc.dtd";↵ | |
4 | dtd.setLocation(sysid);↵ | 4 | dtd.setLocation(sysid);↵ | |
5 | catalog.addDTD(dtd);↵ | 5 | catalog.addDTD(dtd);↵ | |
6 | File dtdFile = project.resolveFile(sysid);↵ | 6 | File dtdFile = project.resolveFile(sysid);↵ | |
7 | try {↵ | 7 | try {↵ | |
8 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN",↵ | 8 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN",↵ | |
9 | "nap:chemical+brothers");↵ | 9 | "nap:chemical+brothers");↵ | |
10 | assertNotNull(result);↵ | 10 | assertNotNull(result);↵ | |
11 | assertEquals(toURLString(dtdFile),↵ | 11 | assertEquals(toURLString(dtdFile),↵ | |
12 | result.getSystemId());↵ | 12 | result.getSystemId());↵ | |
13 | } catch (Exception e) {↵ | 13 | } catch (Exception e) {↵ | |
14 | fail("resolveEntity() failed!" + e.toString());↵ | 14 | fail("resolveEntity() failed!" + e.toString());↵ | |
15 | } | 15 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 34 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ResourceLocation dtd = new ResourceLocation(); | 1 | ResourceLocation dtd = new ResourceLocation(); | |||||||||||
2 | dtd.setPublicId("-//stevo//DTD doc 1.0//EN"); | 2 | dtd.setPublicId("-//stevo//DTD doc 1.0//EN"); | |||||||||||
3 | String sysid = System.getProperty("root") + File.separator + "src/etc/testcases/taskdefs/optional/xml/doc.dtd"; |
| 3 | String sysid = "src/etc/testcases/taskdefs/optional/xml/doc.dtd"; | ||||||||||
4 | dtd.setLocation(sysid); | 4 | dtd.setLocation(sysid); | |||||||||||
5 | catalog.addDTD(dtd); | 5 | catalog.addDTD(dtd); | |||||||||||
6 | File dtdFile = project.resolveFile(sysid); | 6 | File dtdFile = project.resolveFile(sysid); | |||||||||||
7 | try | 7 | try | |||||||||||
8 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN", "nap:chemical+brothers"); | 8 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN", "nap:chemical+brothers"); | |||||||||||
9 | assertNotNull(result); | 9 | assertNotNull(result); | |||||||||||
10 | assertEquals(toURLString(dtdFile), result.getSystemId()); | 10 | assertEquals(toURLString(dtdFile), result.getSystemId()); |
Row | Violation |
---|