File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/AbstractXSLTLiaisonTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java | |||
Method name: void testTransform()
|
Method name: void testCreatePropertiesCacheDirect()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | File xsl = getFile("/taskdefs/optional/xsltliaison-in.xsl");↵ | 1 | File cachefile = new File(↵ | |
2 | liaison.setStylesheet(xsl↵ | 2 | basedir, "cachefile.properties");↵ | |
3 | PropertiesfileCache cache = new PropertiesfileCache();↵ | |||
3 | );↵ | 4 | cache.setCachefile(cachefile);↵ | |
4 | liaison.addParam("param", "value");↵ | 5 | ↵ | |
5 | File in = getFile("/taskdefs/optional/xsltliaison-in.xml"↵ | 6 | cache.put("key", "value");↵ | |
6 | );↵ | 7 | cache.save();↵ | |
7 | File out = new File("xsltliaison.tmp");↵ | 8 | assertTrue("Cachefile not created.", cachefile.exists());↵ | |
8 | out.deleteOnExit(); // just to be sure↵ | 9 | cache.delete↵ | |
9 | try {↵ | |||
10 | liaison.transform(in, out);↵ | |||
11 | } finally {↵ | |||
12 | out.delete();↵ | |||
13 | } | 10 | ();↵ | |
11 |
| |||
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 40 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | File xsl = getFile("/taskdefs/optional/xsltliaison-in.xsl"); | | ||||||||||||||||||||||||||
2 | liaison.setStylesheet(xsl); |
| 8 | assertFalse("Cachefile not deleted.", cachefile.exists()); | ||||||||||||||||||||||||
3 | liaison.addParam("param", "value"); | | ||||||||||||||||||||||||||
4 | File in = getFile("/taskdefs/optional/xsltliaison-in.xml"); | | ||||||||||||||||||||||||||
5 | File out = new File("xsltliaison.tmp"); |
| 1 | File cachefile = new File(basedir, "cachefile.properties"); | ||||||||||||||||||||||||
| 2 | PropertiesfileCache cache = new PropertiesfileCache(); | ||||||||||||||||||||||||||
| 3 | cache.setCachefile(cachefile); | ||||||||||||||||||||||||||
| 4 | cache.put("key", "value"); | ||||||||||||||||||||||||||
| 5 | cache.save(); | ||||||||||||||||||||||||||
6 | out.deleteOnExit(); |
| 6 | assertTrue("Cachefile not created.", cachefile.exists()); | ||||||||||||||||||||||||
| 7 | cache.delete(); |
Row | Violation |
---|---|
1 | Expression assertFalse("Cachefile not deleted.",cachefile.exists()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression liaison.setStylesheet(xsl) is a void method call, and thus it cannot be parameterized |
3 | Expression assertFalse("Cachefile not deleted.",cachefile.exists()) is a void method call, and thus it cannot be parameterized |
4 | Expression assertFalse("Cachefile not deleted.",cachefile.exists()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression liaison.setStylesheet(xsl) is a void method call, and thus it cannot be parameterized |
6 | Expression assertFalse("Cachefile not deleted.",cachefile.exists()) is a void method call, and thus it cannot be parameterized |
7 | Expression out.deleteOnExit() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression assertTrue("Cachefile not created.",cachefile.exists()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression out.deleteOnExit() is a void method call, and thus it cannot be parameterized |
10 | Expression assertTrue("Cachefile not created.",cachefile.exists()) is a void method call, and thus it cannot be parameterized |
11 | Expression out.deleteOnExit() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression assertTrue("Cachefile not created.",cachefile.exists()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression out.deleteOnExit() is a void method call, and thus it cannot be parameterized |
14 | Expression assertTrue("Cachefile not created.",cachefile.exists()) is a void method call, and thus it cannot be parameterized |