CloneSet 8

# CloneSet8

Previous CloneSet | Next CloneSet | Back to Main Report

Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length]
--- | --- | --- | --- | ---
66 | 7 | 0 | 1.000 | class_body_declarations[4]

Clone Abstraction | Parameter Bindings

Clone Instance (Click to see clone) | Line Count | Source Line | Source File
--- | --- | --- | ---

1

67

97

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/ScatterPlotTests.java

2

65

94

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/TimeSeriesChartTests.java

3

65

95

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/XYAreaChartTests.java

4

66

97

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/XYBarChartTests.java

5

65

95

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/XYLineChartTests.java

6

65

95

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/XYStepAreaChartTests.java

7

65

95

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/XYStepChartTests.java

Next
Last

Clone Instance
1

Line Count
67

Source Line
97

Source File

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/ScatterPlotTests.java

    /**
     * Common test setup.
     */
    protected void setUp() {
      this.chart = createChart();
    }

    /**
     * Draws the chart with a null info object to make sure that no exceptions
     * are thrown (a problem that was occurring at one point).
     */
    public void testDrawWithNullInfo() {
      boolean success = false;
      try {
        BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
        g2.dispose();
        success = true;
      }
      catch (Exception
             e) {
        success = false;
        e.printStackTrace();
      }
      assertTrue(success);
    }

    /**
     * Replaces the dataset and checks that it has changed as expected.
     */
    public void testReplaceDataset() {
      // create a dataset...
      XYSeries series1 = new XYSeries("Series 1");
      series1.add(10.0, 10.0);
      series1.add(20.0, 20.0);
      series1.add(30.0, 30.0);
      XYDataset dataset = new XYSeriesCollection(series1);
      LocalListener l = new LocalListener();
      this.chart.addChangeListener(l);
      XYPlot plot = (XYPlot) this.chart.getPlot();
      plot.setDataset(dataset);
      assertEquals(true, l.flag);
      ValueAxis axis = plot.getRangeAxis();
      Range range = axis.getRange();
      assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
      assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
    }

    /**
     * Check that setting a tool tip generator for a series does override the
     * default generator.
     */
    public void testSetSeriesToolTipGenerator() {
      XYPlot plot = (XYPlot) this.chart.getPlot();
      XYItemRenderer renderer = plot.getRenderer();
      StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();
      renderer.setSeriesToolTipGenerator(0, tt);
      XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
      assertTrue(tt2 == tt);
    }

Next
Previous

Clone Instance
2

Line Count
65

Source Line
94

Source File

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/TimeSeriesChartTests.java

    /**
     * Common test setup.
     */
    protected void setUp() {
      this.chart = createChart();
    }

    /**
     * Draws the chart with a null info object to make sure that no exceptions
     * are thrown (a problem that was occurring at one point).
     */
    public void testDrawWithNullInfo() {
      boolean success = false;
      try {
        BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
        g2.dispose();
        success = true;
      }
      catch (Exception
             e) {
        success = false;
        e.printStackTrace();
      }
      assertTrue(success);
    }

    /**
     * Replaces the dataset and checks that it has changed as expected.
     */
    public void testReplaceDataset() {
      // create a dataset...
      XYSeries series1 = new XYSeries("Series 1");
      series1.add(10.0, 10.0);
      series1.add(20.0, 20.0);
      series1.add(30.0, 30.0);
      XYDataset dataset = new XYSeriesCollection(series1);
      LocalListener l = new LocalListener();
      this.chart.addChangeListener(l);
      XYPlot plot = (XYPlot) this.chart.getPlot();
      plot.setDataset(dataset);
      assertEquals(true, l.flag);
      ValueAxis axis = plot.getRangeAxis();
      Range range = axis.getRange();
      assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
      assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
    }

    /**
     * Check that setting a tool tip generator for a series does override the
     * default generator.
     */
    public void testSetSeriesToolTipGenerator() {
      XYPlot plot = (XYPlot) this.chart.getPlot();
      XYItemRenderer renderer = plot.getRenderer();
      StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();
      renderer.setSeriesToolTipGenerator(0, tt);
      XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
      assertTrue(tt2 == tt);
    }

Next
Previous

Clone Instance
3

Line Count
65

Source Line
95

Source File

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/XYAreaChartTests.java

    /**
     * Common test setup.
     */
    protected void setUp() {
      this.chart = createChart();
    }

    /**
     * Draws the chart with a null info object to make sure that no exceptions
     * are thrown (a problem that was occurring at one point).
     */
    public void testDrawWithNullInfo() {
      boolean success = false;
      try {
        BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
        g2.dispose();
        success = true;
      }
      catch (Exception
             e) {
        success = false;
        e.printStackTrace();
      }
      assertTrue(success);
    }

    /**
     * Replaces the dataset and checks that it has changed as expected.
     */
    public void testReplaceDataset() {
      // create a dataset...
      XYSeries series1 = new XYSeries("Series 1");
      series1.add(10.0, 10.0);
      series1.add(20.0, 20.0);
      series1.add(30.0, 30.0);
      XYDataset dataset = new XYSeriesCollection(series1);
      LocalListener l = new LocalListener();
      this.chart.addChangeListener(l);
      XYPlot plot = (XYPlot) this.chart.getPlot();
      plot.setDataset(dataset);
      assertEquals(true, l.flag);
      ValueAxis axis = plot.getRangeAxis();
      Range range = axis.getRange();
      assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
      assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
    }

    /**
     * Check that setting a tool tip generator for a series does override the
     * default generator.
     */
    public void testSetSeriesToolTipGenerator() {
      XYPlot plot = (XYPlot) this.chart.getPlot();
      XYItemRenderer renderer = plot.getRenderer();
      StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();
      renderer.setSeriesToolTipGenerator(0, tt);
      XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
      assertTrue(tt2 == tt);
    }

Next
Previous

Clone Instance
4

Line Count
66

Source Line
97

Source File

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/XYBarChartTests.java

    /**
     * Common test setup.
     */
    protected void setUp() {
      this.chart = createChart();
    }

    /**
     * Draws the chart with a null info object to make sure that no exceptions
     * are thrown (a problem that was occurring at one point).
     */
    public void testDrawWithNullInfo() {
      boolean success = false;
      try {
        BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
        g2.dispose();
        success = true;
      }
      catch (Exception
             e) {
        success = false;
        e.printStackTrace();
      }
      assertTrue(success);
    }

    /**
     * Replaces the dataset and checks that it has changed as expected.
     */
    public void testReplaceDataset() {
      // create a dataset...
      XYSeries series1 = new XYSeries("Series 1");
      series1.add(10.0, 10.0);
      series1.add(20.0, 20.0);
      series1.add(30.0, 30.0);
      XYDataset dataset = new XYSeriesCollection(series1);
      LocalListener l = new LocalListener();
      this.chart.addChangeListener(l);
      XYPlot plot = (XYPlot) this.chart.getPlot();
      plot.setDataset(dataset);
      assertEquals(true, l.flag);
      ValueAxis axis = plot.getRangeAxis();
      Range range = axis.getRange();
      assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
      assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
    }

    /**
     * Check that setting a tool tip generator for a series does override the
     * default generator.
     */
    public void testSetSeriesToolTipGenerator() {
      XYPlot plot = (XYPlot) this.chart.getPlot();
      XYItemRenderer renderer = plot.getRenderer();
      StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();
      renderer.setSeriesToolTipGenerator(0, tt);
      XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
      assertTrue(tt2 == tt);
    }

Next
Previous

Clone Instance
5

Line Count
65

Source Line
95

Source File

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/XYLineChartTests.java

    /**
     * Common test setup.
     */
    protected void setUp() {
      this.chart = createChart();
    }

    /**
     * Draws the chart with a null info object to make sure that no exceptions
     * are thrown (a problem that was occurring at one point).
     */
    public void testDrawWithNullInfo() {
      boolean success = false;
      try {
        BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
        g2.dispose();
        success = true;
      }
      catch (Exception
             e) {
        success = false;
        e.printStackTrace();
      }
      assertTrue(success);
    }

    /**
     * Replaces the dataset and checks that it has changed as expected.
     */
    public void testReplaceDataset() {
      // create a dataset...
      XYSeries series1 = new XYSeries("Series 1");
      series1.add(10.0, 10.0);
      series1.add(20.0, 20.0);
      series1.add(30.0, 30.0);
      XYDataset dataset = new XYSeriesCollection(series1);
      LocalListener l = new LocalListener();
      this.chart.addChangeListener(l);
      XYPlot plot = (XYPlot) this.chart.getPlot();
      plot.setDataset(dataset);
      assertEquals(true, l.flag);
      ValueAxis axis = plot.getRangeAxis();
      Range range = axis.getRange();
      assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
      assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
    }

    /**
     * Check that setting a tool tip generator for a series does override the
     * default generator.
     */
    public void testSetSeriesToolTipGenerator() {
      XYPlot plot = (XYPlot) this.chart.getPlot();
      XYItemRenderer renderer = plot.getRenderer();
      StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();
      renderer.setSeriesToolTipGenerator(0, tt);
      XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
      assertTrue(tt2 == tt);
    }

Next
Previous

Clone Instance
6

Line Count
65

Source Line
95

Source File

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/XYStepAreaChartTests.java

    /**
     * Common test setup.
     */
    protected void setUp() {
      this.chart = createChart();
    }

    /**
     * Draws the chart with a null info object to make sure that no exceptions
     * are thrown (a problem that was occurring at one point).
     */
    public void testDrawWithNullInfo() {
      boolean success = false;
      try {
        BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
        g2.dispose();
        success = true;
      }
      catch (Exception
             e) {
        success = false;
        e.printStackTrace();
      }
      assertTrue(success);
    }

    /**
     * Replaces the dataset and checks that it has changed as expected.
     */
    public void testReplaceDataset() {
      // create a dataset...
      XYSeries series1 = new XYSeries("Series 1");
      series1.add(10.0, 10.0);
      series1.add(20.0, 20.0);
      series1.add(30.0, 30.0);
      XYDataset dataset = new XYSeriesCollection(series1);
      LocalListener l = new LocalListener();
      this.chart.addChangeListener(l);
      XYPlot plot = (XYPlot) this.chart.getPlot();
      plot.setDataset(dataset);
      assertEquals(true, l.flag);
      ValueAxis axis = plot.getRangeAxis();
      Range range = axis.getRange();
      assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
      assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
    }

    /**
     * Check that setting a tool tip generator for a series does override the
     * default generator.
     */
    public void testSetSeriesToolTipGenerator() {
      XYPlot plot = (XYPlot) this.chart.getPlot();
      XYItemRenderer renderer = plot.getRenderer();
      StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();
      renderer.setSeriesToolTipGenerator(0, tt);
      XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
      assertTrue(tt2 == tt);
    }

First
Previous

Clone Instance
7

Line Count
65

Source Line
95

Source File

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/tests/org/jfree/chart/junit/XYStepChartTests.java

    /**
     * Common test setup.
     */
    protected void setUp() {
      this.chart = createChart();
    }

    /**
     * Draws the chart with a null info object to make sure that no exceptions
     * are thrown (a problem that was occurring at one point).
     */
    public void testDrawWithNullInfo() {
      boolean success = false;
      try {
        BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
        g2.dispose();
        success = true;
      }
      catch (Exception
             e) {
        success = false;
        e.printStackTrace();
      }
      assertTrue(success);
    }

    /**
     * Replaces the dataset and checks that it has changed as expected.
     */
    public void testReplaceDataset() {
      // create a dataset...
      XYSeries series1 = new XYSeries("Series 1");
      series1.add(10.0, 10.0);
      series1.add(20.0, 20.0);
      series1.add(30.0, 30.0);
      XYDataset dataset = new XYSeriesCollection(series1);
      LocalListener l = new LocalListener();
      this.chart.addChangeListener(l);
      XYPlot plot = (XYPlot) this.chart.getPlot();
      plot.setDataset(dataset);
      assertEquals(true, l.flag);
      ValueAxis axis = plot.getRangeAxis();
      Range range = axis.getRange();
      assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
      assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
    }

    /**
     * Check that setting a tool tip generator for a series does override the
     * default generator.
     */
    public void testSetSeriesToolTipGenerator() {
      XYPlot plot = (XYPlot) this.chart.getPlot();
      XYItemRenderer renderer = plot.getRenderer();
      StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();
      renderer.setSeriesToolTipGenerator(0, tt);
      XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
      assertTrue(tt2 == tt);
    }

Clone Abstraction | Parameter Count: 0 | Parameter Bindings

    /**
         * Common test setup.
         */
    protected void setUp() {
      this.chart = createChart();
    }

    /**
         * Draws the chart with a null info object to make sure that no exceptions
         * are thrown (a problem that was occurring at one point).
         */
    public void testDrawWithNullInfo() {
      boolean success = false;
      try {
        BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = image.createGraphics();
        this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
        g2.dispose();
        success = true;
      }
      catch (Exception
             e) {
        success = false;
        e.printStackTrace();
      }
      assertTrue(success);
    }

    /**
         * Replaces the dataset and checks that it has changed as expected.
         */
    public void testReplaceDataset() {
      // create a dataset...
      XYSeries series1 = new XYSeries("Series 1");
      series1.add(10.0, 10.0);
      series1.add(20.0, 20.0);
      series1.add(30.0, 30.0);
      XYDataset dataset = new XYSeriesCollection(series1);
      LocalListener l = new LocalListener();
      this.chart.addChangeListener(l);
      XYPlot plot = (XYPlot) this.chart.getPlot();
      plot.setDataset(dataset);
      assertEquals(true, l.flag);
      ValueAxis axis = plot.getRangeAxis();
      Range range = axis.getRange();
      assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
      assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
    }

    /**
         * Check that setting a tool tip generator for a series does override the
         * default generator.
         */
    public void testSetSeriesToolTipGenerator() {
      XYPlot plot = (XYPlot) this.chart.getPlot();
      XYItemRenderer renderer = plot.getRenderer();
      StandardXYToolTipGenerator tt = new StandardXYToolTipGenerator();
      renderer.setSeriesToolTipGenerator(0, tt);
      XYToolTipGenerator tt2 = renderer.getToolTipGenerator(0, 0);
      assertTrue(tt2 == tt);
    }

CloneAbstraction

Parameter Bindings
Parameter Index | Clone Instance | Parameter Name | Value
--- | --- | --- | ---
None