File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java | |||
Method name: void testEmptyElementIfIsReference()
|
Method name: void testEmptyElementIfIsReference()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | try {↵ | |||
2 | p.createInclude();↵ | |||
3 | fail("Can add nested include in PatternSet that is a reference.");↵ | |||
4 | } catch (BuildException be) {↵ | |||
5 | assertEquals("You must not specify nested elements when using refid",↵ | |||
6 | be.getMessage());↵ | |||
7 | }↵ | |||
1 | try {↵ | 8 | try {↵ | |
2 | p.createExclude();↵ | 9 | p.createExclude();↵ | |
3 | fail("Can add nested exclude in PatternSet that is a reference.");↵ | 10 | fail("Can add nested exclude in PatternSet that is a reference.");↵ | |
4 | } catch (BuildException be) {↵ | 11 | } catch (BuildException be) {↵ | |
5 | assertEquals("You must not specify nested elements when using refid",↵ | 12 | assertEquals("You must not specify nested elements when using refid",↵ | |
6 | be.getMessage());↵ | 13 | be.getMessage());↵ | |
7 | }↵ | 14 | }↵ | |
8 | try {↵ | 15 | try {↵ | |
9 | p.createIncludesFile();↵ | 16 | p.createIncludesFile();↵ | |
10 | fail("Can add nested includesfile in PatternSet that is a reference.");↵ | 17 | fail("Can add nested includesfile in PatternSet that is a reference.");↵ | |
11 | } catch (BuildException be) {↵ | 18 | } catch (BuildException be) {↵ | |
12 | assertEquals("You must not specify nested elements when using refid",↵ | 19 | assertEquals("You must not specify nested elements when using refid",↵ | |
13 | be.getMessage());↵ | 20 | be.getMessage());↵ | |
14 | }↵ | 21 |
| |
15 | try {↵ | |||
16 | p.createExcludesFile();↵ | |||
17 | fail("Can add nested excludesfile in PatternSet that is a reference.");↵ | |||
18 | } catch (BuildException be) {↵ | |||
19 | assertEquals("You must not specify nested elements when using refid",↵ | |||
20 | be.getMessage());↵ | |||
21 | } | |||
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.7 |
Clones location | Clones are in the same method |
Number of node comparisons | 57 |
Number of mapped statements | 9 |
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.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
25 | try | 25 | try | |||||||||||
26 | p.createExclude(); | 26 | p.createExclude(); | |||||||||||
27 | fail("Can add nested exclude in PatternSet that is a reference."); | 27 | fail("Can add nested exclude in PatternSet that is a reference."); | |||||||||||
28 | try | 28 | try | |||||||||||
29 | p.createIncludesFile(); | 29 | p.createIncludesFile(); | |||||||||||
30 | fail("Can add nested includesfile in PatternSet that is a reference."); | 30 | fail("Can add nested includesfile in PatternSet that is a reference."); | |||||||||||
31 | try | 22 | try | |||||||||||
32 | p.createExcludesFile(); |
| 23 | p.createInclude(); | ||||||||||
33 | fail("Can add nested excludesfile in PatternSet that is a reference."); |
| 24 | fail("Can add nested include in PatternSet that is a reference."); |
Row | Violation |
---|