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/XYBarRendererTests.java | |||
Method name: void testFindDomainBounds()
|
Method name: void testFindDomainBounds()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 10 | |||
1 | TableXYDataset dataset↵ | 1 | XYSeriesCollection dataset↵ | |
2 | = RendererXYPackageTests.createTestTableXYDataset();↵ | 2 | = RendererXYPackageTests.createTestXYSeriesCollection();↵ | |
3 | JFreeChart chart = ChartFactory.createStackedXYAreaChart(↵ | 3 | JFreeChart chart = ChartFactory.create↵ | |
4 | "Test Chart", "X", "Y", dataset,↵ | |||
5 | ↵ | 4 | XYBarChart("Test Chart", "X",↵ | |
6 | PlotOrientation.VERTICAL, false, false,↵ | 5 | false, "Y", dataset, PlotOrientation.VERTICAL, false, false,↵ | |
7 | false);↵ | 6 | false);↵ | |
8 | XYPlot plot = (XYPlot) chart.getPlot();↵ | 7 | XYPlot plot = (XYPlot) chart.getPlot();↵ | |
9 | plot.setRenderer(new StackedXYBarRenderer());↵ | |||
10 | NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();↵ | 8 | NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();↵ | |
11 | domainAxis.setAutoRangeIncludesZero(false);↵ | 9 | domainAxis.setAutoRangeIncludesZero(false);↵ | |
12 | Range bounds = domainAxis.getRange();↵ | 10 | Range bounds = domainAxis.getRange();↵ | |
13 | assertFalse(bounds.contains(0.3));↵ | 11 | assertFalse(bounds.contains(0.3));↵ | |
14 | assertTrue(bounds.contains(0.5));↵ | 12 | assertTrue(bounds.contains(0.5));↵ | |
15 | assertTrue(bounds.contains(2.5));↵ | 13 | assertTrue(bounds.contains(2.5));↵ | |
16 | assertFalse(bounds.contains(2.8)); | 14 |
| |
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 | 76 |
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 | XYSeriesCollection dataset = RendererXYPackageTests.createTestXYSeriesCollection(); | |||||||||||||||||
2 | JFreeChart chart = ChartFactory.createStackedXYAreaChart("Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL, false, false, false); |
| 2 | JFreeChart chart = ChartFactory.createXYBarChart("Test Chart", "X", false, "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 domainAxis = (NumberAxis)plot.getDomainAxis(); | ||||||||||||||||||
6 | domainAxis.setAutoRangeIncludesZero(false); | 5 | domainAxis.setAutoRangeIncludesZero(false); | ||||||||||||||||||
7 | Range bounds = domainAxis.getRange(); | 6 | Range bounds = domainAxis.getRange(); | ||||||||||||||||||
8 | assertFalse(bounds.contains(0.3)); | 7 | assertFalse(bounds.contains(0.3)); | ||||||||||||||||||
9 | assertTrue(bounds.contains(0.5)); | 8 | assertTrue(bounds.contains(0.5)); | ||||||||||||||||||
10 | assertTrue(bounds.contains(2.5)); | 9 | assertTrue(bounds.contains(2.5)); | ||||||||||||||||||
11 | assertFalse(bounds.contains(2.8)); | 10 | assertFalse(bounds.contains(2.8)); |
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.createXYBarChart("Test Chart","X",false,"Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | 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 |
4 | Expression ChartFactory.createXYBarChart("Test Chart","X",false,"Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | 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 |