File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/MarkerTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/MarkerTests.java | |||
Method name: void testGetSetLabelPaint()
|
Method name: void testGetSetLabelAnchor()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | ValueMarker m = new ValueMarker(1.1);↵ | 1 | ValueMarker m = new ValueMarker(1.1);↵ | |
2 | m.addChangeListener(this);↵ | 2 | m.addChangeListener(this);↵ | |
3 | this.lastEvent = null;↵ | 3 | this.lastEvent = null;↵ | |
4 | assertEquals(Color.black, m.getLabelPaint());↵ | 4 | assertEquals(RectangleAnchor.TOP_LEFT, m.getLabelAnchor());↵ | |
5 | m.setLabelPaint(Color.red);↵ | 5 | m.setLabelAnchor(RectangleAnchor.TOP);↵ | |
6 | assertEquals(Color.red, m.getLabelPaint());↵ | 6 | assertEquals(RectangleAnchor.TOP, m.getLabelAnchor());↵ | |
7 | assertEquals(m, this.lastEvent.getMarker());↵ | 7 | assertEquals(m, this.lastEvent.getMarker());↵ | |
8 | ↵ | 8 | ↵ | |
9 | // check null argument...↵ | 9 | // check null argument...↵ | |
10 | try {↵ | 10 | try {↵ | |
11 | m.setLabelPaint(null);↵ | 11 | m.setLabelAnchor(null);↵ | |
12 | fail("Expected an IllegalArgumentException for null.");↵ | 12 | fail("Expected an IllegalArgumentException for null.");↵ | |
13 | }↵ | 13 | }↵ | |
14 | catch (IllegalArgumentException e) {↵ | 14 | catch (IllegalArgumentException e) {↵ | |
15 | assertTrue(true);↵ | 15 | assertTrue(true);↵ | |
16 | } | 16 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 37 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 10.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ValueMarker m = new ValueMarker(1.1); | 1 | ValueMarker m = new ValueMarker(1.1); | |||||||||||||||
2 | m.addChangeListener(this); | 2 | m.addChangeListener(this); | |||||||||||||||
3 | this.lastEvent = null; | 3 | this.lastEvent = null; | |||||||||||||||
|
| 4 | assertEquals(RectangleAnchor.TOP_LEFT, m.getLabelAnchor()); | |||||||||||||||
4 | assertEquals(Color.black, m.getLabelPaint()); |
| | |||||||||||||||
|
| 5 | m.setLabelAnchor(RectangleAnchor.TOP); | |||||||||||||||
5 | m.setLabelPaint(Color.red); |
| | |||||||||||||||
|
| 6 | assertEquals(RectangleAnchor.TOP, m.getLabelAnchor()); | |||||||||||||||
6 | assertEquals(Color.red, m.getLabelPaint()); |
| | |||||||||||||||
7 | assertEquals(m, this.lastEvent.getMarker()); | 7 | assertEquals(m, this.lastEvent.getMarker()); | |||||||||||||||
8 | try | 8 | try | |||||||||||||||
9 | m.setLabelPaint(null); |
| 9 | m.setLabelAnchor(null); | ||||||||||||||
10 | fail("Expected an IllegalArgumentException for null."); | 10 | fail("Expected an IllegalArgumentException for null."); |
Row | Violation |
---|---|
1 | Unmatched statement assertEquals(RectangleAnchor.TOP_LEFT,m.getLabelAnchor()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement assertEquals(Color.black,m.getLabelPaint()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement m.setLabelAnchor(RectangleAnchor.TOP); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement m.setLabelPaint(Color.red); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement assertEquals(RectangleAnchor.TOP,m.getLabelAnchor()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement assertEquals(Color.red,m.getLabelPaint()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Expression m.setLabelPaint(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression m.setLabelAnchor(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression m.setLabelPaint(null) is a void method call, and thus it cannot be parameterized |
10 | Expression m.setLabelAnchor(null) is a void method call, and thus it cannot be parameterized |