@Override public List<CountsGraph> createGraphs(final List<CountSimComparison> ccl, final int iteration) { List<CountsGraph> graphList=new Vector<CountsGraph>(); for (int i=1; i<25; i++) { String fileName="simVsRealVolumesHour"+(i)+"Iteration"+iteration; CountsSimRealPerHourGraph sg=new CountsSimRealPerHourGraph(ccl, iteration, fileName ); sg.createChart(i); graphList.add(sg); this.section.addURL(new MyURL(fileName+".html", "hour: "+(i))); } return graphList; } }
filename.append(PNG); CountsSimRealPerHourGraph graph = new CountsSimRealPerHourGraph(this.countComparisonFilter.getCountsForHour(null), this.iterationNumber, filename.toString()); graph.createChart(timestep);
public void testCreateChart() { CountsFixture fixture = new CountsFixture(); fixture.setUp(); CountsSimRealPerHourGraph eg = new CountsSimRealPerHourGraph(fixture.ceateCountSimCompList(), 1, "testCreateChart"); assertNotNull("No graph is created", eg.createChart(0)); } }
public void testOutputHtml() { CountsFixture fixture = new CountsFixture(); fixture.setUp(); CountsSimRealPerHourGraph sg = null; List<CountSimComparison> countSimCompList=new Vector<CountSimComparison>(); for (int i=0; i<24; i++) { countSimCompList.add(new CountSimComparisonImpl(Id.create(i+1, Link.class), "", 1, 1.0, 1.0)); } sg = new CountsSimRealPerHourGraph(countSimCompList, 1, "testOutPutAll"); new File(getOutputDirectory() + "graphs").mkdir(); OutputDelegate outputDelegate=new OutputDelegate(getOutputDirectory() + "graphs/"); outputDelegate.addSection(new Section("testOutPutAll")); assertNotNull("No graph was created", sg.createChart(0)); outputDelegate.addCountsGraph(sg); outputDelegate.outputHtml(); String filename = getOutputDirectory() + "graphs/png/" + sg.getFilename() +".png"; File fPng = new File(filename); assertTrue("The png output file " + filename + " doesn't exist", fPng.exists()); assertTrue("The png output file " + filename + " is empty", fPng.length()>0.0); } }