File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/xy/junit/StackedXYBarRendererTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/xy/junit/XYLineAndShapeRendererTests.java | |||
Method name: void testFindDomainBounds()
|
Method name: void testFindRangeBounds()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 10 | |||
1 | TableXYDataset dataset↵ | 1 | TableXYDataset dataset↵ | |
2 | = RendererXYPackageTests.createTestTableXYDataset();↵ | 2 | = RendererXYPackageTests.createTestTableXYDataset();↵ | |
3 | JFreeChart chart = ChartFactory.createStackedXYAreaChart(↵ | 3 | JFreeChart chart = ChartFactory.createXYLineChart(↵ | |
4 | "Test Chart", "X", "Y", dataset,↵ | 4 | "Test Chart", "X", "Y", dataset,↵ | |
5 | PlotOrientation.VERTICAL,↵ | 5 | PlotOrientation.VERTICAL,↵ | |
6 | false, false, false);↵ | 6 | false, false, false);↵ | |
7 | XYPlot plot = (XYPlot) chart.getPlot();↵ | 7 | XYPlot plot = (XYPlot) chart.getPlot();↵ | |
8 | plot.setRenderer(new StackedXYBarRenderer());↵ | |||
9 | NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();↵ | 8 | NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();↵ | |
10 | domainAxis.setAutoRangeIncludesZero(false);↵ | 9 | rangeAxis.setAutoRangeIncludesZero(false);↵ | |
11 | Range bounds = domainAxis.getRange();↵ | 10 | Range bounds = rangeAxis.getRange();↵ | |
12 | assertFalse(bounds.contains(0.3));↵ | 11 | assertFalse(bounds.contains(1.0));↵ | |
13 | assertTrue(bounds.contains(0.5));↵ | 12 | assertTrue(bounds.contains(2.0));↵ | |
14 | assertTrue(bounds.contains(2.5));↵ | 13 | assertTrue(bounds.contains(5.0));↵ | |
15 | assertFalse(bounds.contains(2.8)); | 14 | assertFalse(bounds.contains(6.0)); | |
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 in different classes having the same super class |
Number of node comparisons | 80 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | TableXYDataset dataset = RendererXYPackageTests.createTestTableXYDataset(); | 1 | TableXYDataset dataset = RendererXYPackageTests.createTestTableXYDataset(); | ||||||||||||||||
2 | JFreeChart chart = ChartFactory.createStackedXYAreaChart("Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL, false, false, false); |
| 2 | JFreeChart chart = ChartFactory.createXYLineChart("Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL, false, false, false); | |||||||||||||||
3 | XYPlot plot = (XYPlot)chart.getPlot(); | 3 | XYPlot plot = (XYPlot)chart.getPlot(); | ||||||||||||||||
4 | plot.setRenderer(new StackedXYBarRenderer()); |
| | ||||||||||||||||
5 | NumberAxis domainAxis = (NumberAxis)plot.getDomainAxis(); |
| 4 | NumberAxis rangeAxis = (NumberAxis)plot.getRangeAxis(); | |||||||||||||||
6 | domainAxis.setAutoRangeIncludesZero(false); |
| 5 | rangeAxis.setAutoRangeIncludesZero(false); | |||||||||||||||
7 | Range bounds = domainAxis.getRange(); |
| 6 | Range bounds = rangeAxis.getRange(); | |||||||||||||||
8 | assertFalse(bounds.contains(0.3)); |
| 7 | assertFalse(bounds.contains(1.0)); | |||||||||||||||
9 | assertTrue(bounds.contains(0.5)); |
| 9 | assertTrue(bounds.contains(5.0)); | |||||||||||||||
10 | assertTrue(bounds.contains(2.5)); |
| 8 | assertTrue(bounds.contains(2.0)); | |||||||||||||||
11 | assertFalse(bounds.contains(2.8)); |
| 10 | assertFalse(bounds.contains(6.0)); |
Row | Violation |
---|---|
1 | Expression ChartFactory.createStackedXYAreaChart("Test Chart","X","Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression ChartFactory.createXYLineChart("Test Chart","X","Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement plot.setRenderer(new StackedXYBarRenderer()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Expression plot.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression plot.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted |