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 | 0 |
Number of non-refactorable cases | 1 |
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 | 16 |
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 | 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.moveUp(filterThree); |
| 10 | filterList.moveDown(filterOne); | |||||||||||||||||||
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); |
| 12 | filterList.moveDown(filterOne); | |||||||||||||||||||
13 | assertEquals("The get(int) method returned the wrong filter.", filterThree, filterList.get(0)); |
| 13 | assertEquals("The get(int) method returned the wrong filter.", filterOne, filterList.get(2)); | |||||||||||||||||||
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.moveUp(filterThree); |
| 15 | filterList.moveDown(filterOne); | |||||||||||||||||||
16 | assertEquals("The get(int) method returned the wrong filter.", filterThree, filterList.get(0)); |
| 16 | assertEquals("The get(int) method returned the wrong filter.", filterOne, filterList.get(2)); |
Row | Violation |
---|---|
1 | Expression filterList.moveUp(filterThree) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression filterList.moveDown(filterOne) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression filterList.moveUp(filterThree) is a void method call, and thus it cannot be parameterized |
4 | Expression filterList.moveDown(filterOne) is a void method call, and thus it cannot be parameterized |
5 | Expression filterThree cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression filterOne cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression filterList.moveUp(filterThree) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression filterList.moveDown(filterOne) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression filterList.moveUp(filterThree) is a void method call, and thus it cannot be parameterized |
10 | Expression filterList.moveDown(filterOne) is a void method call, and thus it cannot be parameterized |
11 | Expression filterThree cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression filterOne cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression filterThree cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression filterOne cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression filterList.moveUp(filterThree) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression filterList.moveDown(filterOne) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression filterList.moveUp(filterThree) is a void method call, and thus it cannot be parameterized |
18 | Expression filterList.moveDown(filterOne) is a void method call, and thus it cannot be parameterized |
19 | Expression filterThree cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Expression filterOne cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Expression filterThree cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Expression filterOne cannot be parameterized, because it has dependencies to/from statements that will be extracted |