File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java | |||
Method name: void testNestedByClassName()
|
Method name: void testSimple()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | executeTarget("nestedbyclassname");↵ | 1 | executeTarget("simple");↵ | |
2 | // get the fileset and its basedir↵ | 2 | // get the fileset and its basedir↵ | |
3 | Project p = getProject();↵ | 3 | Project p = getProject();↵ | |
4 | FileSet fileset = (FileSet) p.getReference("testfileset");↵ | 4 | FileSet fileset = (FileSet) p.getReference("testfileset");↵ | |
5 | File baseDir = fileset.getDir(p);↵ | 5 | File baseDir = fileset.getDir(p);↵ | |
6 | String log = getLog();↵ | 6 | String log = getLog();↵ | |
7 | assertTrue("Expecting attribute value to be printed",↵ | 7 | assertTrue("Expecting attribute value printed",↵ | |
8 | log.indexOf("Attribute attr1 = test") != -1);↵ | 8 | log.indexOf("Attribute attr1 = test") != -1);↵ | |
9 | assertTrue("Expecting nested element value to be printed",↵ | 9 | assertTrue("Expecting nested element value printed",↵ | |
10 | log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1); | 10 |
| |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 25 |
Number of mapped statements | 7 |
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) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | executeTarget("nestedbyclassname"); |
| 1 | executeTarget("simple"); | ||||||||||
2 | Project p = getProject(); | 2 | Project p = getProject(); | |||||||||||
3 | FileSet fileset = (FileSet)p.getReference("testfileset"); | 3 | FileSet fileset = (FileSet)p.getReference("testfileset"); | |||||||||||
4 | File baseDir = fileset.getDir(p); | 4 | File baseDir = fileset.getDir(p); | |||||||||||
5 | String log = getLog(); | 5 | String log = getLog(); | |||||||||||
6 | assertTrue("Expecting attribute value to be printed", log.indexOf("Attribute attr1 = test") != -1); |
| 6 | assertTrue("Expecting attribute value printed", log.indexOf("Attribute attr1 = test") != -1); | ||||||||||
7 | assertTrue("Expecting nested element value to be printed", log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1); |
| 7 | assertTrue("Expecting nested element value printed", log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1); |
Row | Violation |
---|