File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/filter/FilterListTest.java | File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/filter/FilterListTest.java | |||
Method name: void testMoveUp()
|
Method name: void testMoveDown()
|
|||
Number of AST nodes: 16 | Number of AST nodes: 16 | |||
1 | FilterList filterList = new FilterList(new XmlElement());↵ | 1 | FilterList filterList = new FilterList(new XmlElement());↵ | |
2 | IFilter filterOne = createNamedFilter("ONE");↵ | 2 | IFilter filterOne = createNamedFilter("ONE");↵ | |
3 | IFilter filterTwo = createNamedFilter("TWO");↵ | 3 | IFilter filterTwo = createNamedFilter("TWO");↵ | |
4 | IFilter filterThree = createNamedFilter("THREE");↵ | 4 | IFilter filterThree = createNamedFilter("THREE");↵ | |
5 | filterList.add(filterOne);↵ | 5 | filterList.add(filterOne);↵ | |
6 | filterList.add(filterTwo);↵ | 6 | filterList.add(filterTwo);↵ | |
7 | filterList.add(filterThree);↵ | 7 | filterList.add(filterThree);↵ | |
8 | assertEquals("The get(int) method returned the wrong filter.",↵ | 8 | assertEquals("The get(int) method returned the wrong filter.",↵ | |
9 | filterOne, filterList.get(0));↵ | 9 | filterOne, filterList.get(0));↵ | |
10 | assertEquals("The get(int) method returned the wrong filter.",↵ | 10 | assertEquals("The get(int) method returned the wrong filter.",↵ | |
11 | filterThree, filterList.get(2));↵ | 11 | filterThree, filterList.get(2));↵ | |
12 | filterList.moveUp(filterThree);↵ | 12 | filterList.moveDown(filterOne);↵ | |
13 | assertEquals("The get(int) method returned the wrong filter.",↵ | 13 | assertEquals("The get(int) method returned the wrong filter.",↵ | |
14 | filterThree, filterList.get(1));↵ | 14 | filterOne, filterList.get(1));↵ | |
15 | filterList.moveUp(filterThree);↵ | 15 | filterList.moveDown(filterOne);↵ | |
16 | assertEquals("The get(int) method returned the wrong filter.",↵ | 16 | assertEquals("The get(int) method returned the wrong filter.",↵ | |
17 | filterThree, filterList.get(0));↵ | 17 | filterOne, filterList.get(2));↵ | |
18 | assertEquals("The get(int) method returned the wrong filter.",↵ | 18 | assertEquals("The get(int) method returned the wrong filter.",↵ | |
19 | filterOne, filterList.get(1));↵ | 19 | filterThree, filterList.get(1));↵ | |
20 | filterList.moveUp(filterThree);↵ | 20 | filterList.moveDown(filterOne);↵ | |
21 | assertEquals("The get(int) method returned the wrong filter.",↵ | 21 | assertEquals("The get(int) method returned the wrong filter.",↵ | |
22 | filterThree, filterList.get(0)); | 22 | filterOne, filterList.get(2)); | |
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 | 226 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
1 | FilterList filterList = new FilterList(new XmlElement()); | 1 | FilterList filterList = new FilterList(new XmlElement()); | ||||
2 | IFilter filterOne = createNamedFilter("ONE"); | 2 | IFilter filterOne = createNamedFilter("ONE"); | ||||
3 | IFilter filterTwo = createNamedFilter("TWO"); | 3 | IFilter filterTwo = createNamedFilter("TWO"); | ||||
4 | IFilter filterThree = createNamedFilter("THREE"); | 4 | IFilter filterThree = createNamedFilter("THREE"); | ||||
5 | filterList.add(filterOne); | 5 | filterList.add(filterOne); | ||||
6 | filterList.add(filterTwo); | 6 | filterList.add(filterTwo); | ||||
7 | filterList.add(filterThree); | 7 | filterList.add(filterThree); | ||||
8 | assertEquals("The get(int) method returned the wrong filter.", filterOne, filterList.get(0)); | 8 | assertEquals("The get(int) method returned the wrong filter.", filterOne, filterList.get(0)); | ||||
9 | assertEquals("The get(int) method returned the wrong filter.", filterThree, filterList.get(2)); | 9 | assertEquals("The get(int) method returned the wrong filter.", filterThree, filterList.get(2)); | ||||
|
| 10 | filterList.moveDown(filterOne); | ||||
10 | filterList.moveUp(filterThree); |
| | ||||
|
| 12 | filterList.moveDown(filterOne); | ||||
|
| 13 | assertEquals("The get(int) method returned the wrong filter.", filterOne, filterList.get(2)); | ||||
11 | assertEquals("The get(int) method returned the wrong filter.", filterThree, filterList.get(1)); | 14 | assertEquals("The get(int) method returned the wrong filter.", filterThree, filterList.get(1)); | ||||
12 | filterList.moveUp(filterThree); |
| | ||||
13 | assertEquals("The get(int) method returned the wrong filter.", filterThree, filterList.get(0)); |
| | ||||
14 | assertEquals("The get(int) method returned the wrong filter.", filterOne, filterList.get(1)); | 11 | assertEquals("The get(int) method returned the wrong filter.", filterOne, filterList.get(1)); | ||||
|
| 15 | filterList.moveDown(filterOne); | ||||
15 | filterList.moveUp(filterThree); |
| | ||||
|
| 16 | assertEquals("The get(int) method returned the wrong filter.", filterOne, filterList.get(2)); | ||||
16 | assertEquals("The get(int) method returned the wrong filter.", filterThree, filterList.get(0)); |
| |
Row | Violation |
---|---|
1 | Unmatched statement filterList.moveDown(filterOne); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement filterList.moveUp(filterThree); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement filterList.moveDown(filterOne); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement assertEquals("The get(int) method returned the wrong filter.",filterOne,filterList.get(2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement filterList.moveUp(filterThree); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement assertEquals("The get(int) method returned the wrong filter.",filterThree,filterList.get(0)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement filterList.moveDown(filterOne); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement filterList.moveUp(filterThree); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement assertEquals("The get(int) method returned the wrong filter.",filterOne,filterList.get(2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Unmatched statement assertEquals("The get(int) method returned the wrong filter.",filterThree,filterList.get(0)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |