File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/LogAxisTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/NumberAxisTests.java | |||
Method name: void testAutoRange3()
|
Method name: void testAutoRange3()
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | DefaultCategoryDataset dataset = new DefaultCategoryDataset();↵ | 1 | DefaultCategoryDataset dataset = new DefaultCategoryDataset();↵ | |
2 | dataset.setValue(100.0, "Row 1", "Column 1");↵ | 2 | dataset.setValue(100.0, "Row 1", "Column 1");↵ | |
3 | dataset.setValue(200.0, "Row 1", "Column 2");↵ | 3 | dataset.setValue(200.0, "Row 1", "Column 2");↵ | |
4 | JFreeChart chart = ChartFactory.createLineChart("Test", "Categories",↵ | 4 | JFreeChart chart = ChartFactory.createLineChart("Test", "Categories",↵ | |
5 | "Value", dataset, PlotOrientation.VERTICAL, false, false,↵ | 5 | "Value", dataset, PlotOrientation.VERTICAL, false, false,↵ | |
6 | false);↵ | 6 | false);↵ | |
7 | CategoryPlot plot = (CategoryPlot) chart.getPlot();↵ | 7 | CategoryPlot plot = (CategoryPlot) chart.getPlot();↵ | |
8 | LogAxis axis = new LogAxis("Log(Y)");↵ | 8 | NumberAxis axis = ↵ | |
9 | plot.setRangeAxis(axis↵ | 9 | (NumberAxis) plot.getRangeAxis();↵ | |
10 | );↵ | 10 | axis.setAutoRangeIncludesZero(false);↵ | |
11 | assertEquals(96.59363289248458, axis.getLowerBound(), EPSILON);↵ | 11 | assertEquals(axis.getLowerBound(), 95.0, EPSILON); ↵ | |
12 | assertEquals(207.0529847682752, axis.getUpperBound(), EPSILON);↵ | 12 | assertEquals(axis.getUpperBound(), 205.0, EPSILON);↵ | |
13 | ↵ | |||
14 | ↵ | |||
13 | // now replacing the dataset should update the axis range...↵ | 15 | // now replacing the dataset should update the axis range...↵ | |
14 | DefaultCategoryDataset dataset2 = new DefaultCategoryDataset();↵ | 16 | DefaultCategoryDataset dataset2 = new DefaultCategoryDataset();↵ | |
15 | dataset2.setValue(900.0, "Row 1", "Column 1");↵ | 17 | dataset2.setValue(900.0, "Row 1", "Column 1");↵ | |
16 | dataset2.setValue(1000.0, "Row 1", "Column 2");↵ | 18 | dataset2.setValue(1000.0, "Row 1", "Column 2");↵ | |
17 | plot.setDataset(dataset2);↵ | 19 | plot.setDataset(dataset2);↵ | |
18 | assertEquals(895.2712433374774, axis.getLowerBound(), EPSILON);↵ | 20 | assertEquals(axis.getLowerBound(), 895.0, EPSILON); ↵ | |
19 | assertEquals(1005.2819262292991, axis.getUpperBound(), EPSILON); | 21 | assertEquals(axis.getUpperBound(), 1005.0, EPSILON); | |
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 in different classes having the same super class |
Number of node comparisons | 88 |
Number of mapped statements | 15 |
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 | DefaultCategoryDataset dataset = new DefaultCategoryDataset(); | 1 | DefaultCategoryDataset dataset = new DefaultCategoryDataset(); | |||||||||||||||||||||||||||||||
2 | dataset.setValue(100.0, "Row 1", "Column 1"); | 2 | dataset.setValue(100.0, "Row 1", "Column 1"); | |||||||||||||||||||||||||||||||
3 | dataset.setValue(200.0, "Row 1", "Column 2"); | 3 | dataset.setValue(200.0, "Row 1", "Column 2"); | |||||||||||||||||||||||||||||||
4 | JFreeChart chart = ChartFactory.createLineChart("Test", "Categories", "Value", dataset, PlotOrientation.VERTICAL, false, false, false); | 4 | JFreeChart chart = ChartFactory.createLineChart("Test", "Categories", "Value", dataset, PlotOrientation.VERTICAL, false, false, false); | |||||||||||||||||||||||||||||||
5 | CategoryPlot plot = (CategoryPlot)chart.getPlot(); | 5 | CategoryPlot plot = (CategoryPlot)chart.getPlot(); | |||||||||||||||||||||||||||||||
6 | LogAxis axis = new LogAxis("Log(Y)"); |
| 10 | DefaultCategoryDataset dataset2 = new DefaultCategoryDataset(); | ||||||||||||||||||||||||||||||
7 | plot.setRangeAxis(axis); |
| 11 | dataset2.setValue(900.0, "Row 1", "Column 1"); | ||||||||||||||||||||||||||||||
8 | assertEquals(96.59363289248458, axis.getLowerBound(), EPSILON); |
| 8 | assertEquals(axis.getLowerBound(), 95.0, EPSILON); | ||||||||||||||||||||||||||||||
9 | assertEquals(207.0529847682752, axis.getUpperBound(), EPSILON); |
| 9 | assertEquals(axis.getUpperBound(), 205.0, EPSILON); | ||||||||||||||||||||||||||||||
10 | DefaultCategoryDataset dataset2 = new DefaultCategoryDataset(); |
| 6 | NumberAxis axis = (NumberAxis)plot.getRangeAxis(); | ||||||||||||||||||||||||||||||
11 | dataset2.setValue(900.0, "Row 1", "Column 1"); |
| 7 | axis.setAutoRangeIncludesZero(false); | ||||||||||||||||||||||||||||||
12 | dataset2.setValue(1000.0, "Row 1", "Column 2"); | 12 | dataset2.setValue(1000.0, "Row 1", "Column 2"); | |||||||||||||||||||||||||||||||
13 | plot.setDataset(dataset2); | 13 | plot.setDataset(dataset2); | |||||||||||||||||||||||||||||||
14 | assertEquals(895.2712433374774, axis.getLowerBound(), EPSILON); |
| 14 | assertEquals(axis.getLowerBound(), 895.0, EPSILON); | ||||||||||||||||||||||||||||||
15 | assertEquals(1005.2819262292991, axis.getUpperBound(), EPSILON); |
| 15 | assertEquals(axis.getUpperBound(), 1005.0, EPSILON); |
Row | Violation |
---|---|
1 | Expression new LogAxis("Log(Y)") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new DefaultCategoryDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new LogAxis("Log(Y)") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new DefaultCategoryDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression plot.setRangeAxis(axis) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression dataset2.setValue(900.0,"Row 1","Column 1") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression plot.setRangeAxis(axis) is a void method call, and thus it cannot be parameterized |
8 | Expression dataset2.setValue(900.0,"Row 1","Column 1") is a void method call, and thus it cannot be parameterized |
9 | Expression plot cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression dataset2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression plot cannot be unified with expression dataset2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void setRangeAxis(org.jfree.chart.axis.ValueAxis) , public void setValue(double, Comparable#RAW, Comparable#RAW) |
12 | Expression plot.setRangeAxis(axis) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression dataset2.setValue(900.0,"Row 1","Column 1") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression plot.setRangeAxis(axis) is a void method call, and thus it cannot be parameterized |
15 | Expression dataset2.setValue(900.0,"Row 1","Column 1") is a void method call, and thus it cannot be parameterized |
16 | Expression axis.getLowerBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression axis.getLowerBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression axis.getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Expression axis.getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Expression new DefaultCategoryDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Expression (NumberAxis)plot.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Expression dataset2.setValue(900.0,"Row 1","Column 1") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | Expression axis.setAutoRangeIncludesZero(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
24 | Expression dataset2.setValue(900.0,"Row 1","Column 1") is a void method call, and thus it cannot be parameterized |
25 | Expression axis.setAutoRangeIncludesZero(false) is a void method call, and thus it cannot be parameterized |
26 | Expression dataset2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
27 | Expression axis cannot be parameterized, because it has dependencies to/from statements that will be extracted |
28 | Expression dataset2 cannot be unified with expression axis , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void setValue(double, Comparable#RAW, Comparable#RAW) , public void setAutoRangeIncludesZero(boolean) |
29 | Expression dataset2.setValue(900.0,"Row 1","Column 1") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
30 | Expression axis.setAutoRangeIncludesZero(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
31 | Expression dataset2.setValue(900.0,"Row 1","Column 1") is a void method call, and thus it cannot be parameterized |
32 | Expression axis.setAutoRangeIncludesZero(false) is a void method call, and thus it cannot be parameterized |
33 | Expression axis.getLowerBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
34 | Expression axis.getLowerBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
35 | Expression axis.getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
36 | Expression axis.getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |