Skip to content

Commit

Permalink
Remove duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
dgageot committed May 12, 2015
1 parent 7d5701e commit e51d430
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@
import java.io.IOException;

public class DistributionBarChartTest extends AbstractChartTest {
DistributionBarChart chart = new DistributionBarChart();

@Test
public void simpleSample() throws IOException {
DistributionBarChart chart = new DistributionBarChart();
BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2"));
assertChartSizeGreaterThan(image, 1000);
saveChart(image, "DistributionBarChartTest/simpleSample.png");
}

@Test
public void addXSuffix() throws IOException {
DistributionBarChart chart = new DistributionBarChart();
// should suffix x labels with +
BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2&xsuf=%2B"));
assertChartSizeGreaterThan(image, 1000);
Expand All @@ -46,7 +45,6 @@ public void addXSuffix() throws IOException {

@Test
public void addYSuffix() throws IOException {
DistributionBarChart chart = new DistributionBarChart();
// should suffix y labels with %
BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2&ysuf=%25"));
assertChartSizeGreaterThan(image, 1000);
Expand All @@ -55,15 +53,13 @@ public void addYSuffix() throws IOException {

@Test
public void manySeries() throws IOException {
DistributionBarChart chart = new DistributionBarChart();
BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2|0%3D7%3B1%3D15%3B2%3D4"));
assertChartSizeGreaterThan(image, 1000);
saveChart(image, "DistributionBarChartTest/manySeries.png");
}

@Test
public void manySeriesIncludingAnEmptySerie() throws IOException {
DistributionBarChart chart = new DistributionBarChart();
// the third serie should not have the second default color, but the third one !
BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2||0%3D7%3B1%3D15%3B2%3D4"));
assertChartSizeGreaterThan(image, 1000);
Expand All @@ -72,23 +68,20 @@ public void manySeriesIncludingAnEmptySerie() throws IOException {

@Test
public void overridenSize() throws IOException {
DistributionBarChart chart = new DistributionBarChart();
BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2|0%3D7%3B1%3D15%3B2%3D4&w=500&h=200"));
assertChartSizeGreaterThan(image, 1000);
saveChart(image, "DistributionBarChartTest/overridenSize.png");
}

@Test
public void changeColor() throws IOException {
DistributionBarChart chart = new DistributionBarChart();
BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2&c=777777&bgc=777777"));
assertChartSizeGreaterThan(image, 1000);
saveChart(image, "DistributionBarChartTest/changeColor.png");
}

@Test
public void smallSize() throws IOException {
DistributionBarChart chart = new DistributionBarChart();
BufferedImage image = chart.generateImage(new ChartParameters("v=0%3D5%3B1%3D22%3B2%3D2%3B4%3D22%3B5%3D22%3B6%3D22&c=777777&w=120&h=80&fs=8"));
assertChartSizeGreaterThan(image, 500);
saveChart(image, "DistributionBarChartTest/smallSize.png");
Expand Down

0 comments on commit e51d430

Please sign in to comment.