1 6 7 package com.sun.japex; 8 import com.sun.japex.report.*; 9 10 import java.io.File ; 11 import java.util.Date ; 12 import java.util.Calendar ; 13 import java.util.GregorianCalendar ; 14 import java.util.Map ; 15 16 import org.xml.sax.*; 17 import org.xml.sax.helpers.DefaultHandler ; 18 19 import javax.xml.parsers.SAXParserFactory ; 20 import javax.xml.parsers.ParserConfigurationException ; 21 import javax.xml.parsers.SAXParser ; 22 23 import org.jfree.chart.ChartUtilities; 24 import org.jfree.chart.JFreeChart; 25 import org.jfree.data.xy.XYDataset; 26 27 public class TrendReport { 28 29 30 public TrendReport() { 31 } 32 35 public static void main(String [] args) { 36 if (args.length < 4) { 37 displayUsageAndExit(args); 38 } 39 String reportPath = "/projects/fws/WSTest/Java/src/reports"; 40 String separator = System.getProperty("file.separator"); 41 try { 42 45 TrendReportParams params = new TrendReportParams(args); 46 ParseReports testReports = new ParseReports(params); 48 49 TrendDataset dataset = new TrendDataset(params, testReports); 51 JFreeChart chart1 = LineChart.createChart(params.title(), dataset.getDataset()); 52 53 String chartName = null; 55 if (!params.isTestSpecified()) { 56 chartName = "means.jpg"; 57 } else { 58 chartName = params.test()[0]+".jpg"; 59 } 60 System.out.println("chartname: "+chartName); 61 System.out.println("test specified: "+params.isTestSpecified()); 62 63 System.out.println(params.outputPath()+"/"+chartName); 64 ChartUtilities.saveChartAsJPEG(new File (params.outputPath()+"/"+chartName), chart1, 500, 300); 65 new IndexPage(params, chartName).report(); 66 67 } catch (Exception e) { 68 e.printStackTrace(); 69 } 70 71 72 System.exit(0); 73 74 75 } 76 77 private static void displayUsageAndExit(String [] args) { 78 System.err.println("Usage: TrendReport Title reportPath outputPath date offset [driver] [test]"); 79 System.err.println("Arguments passed in: \n"); 80 for (int i=0; i<args.length; i++) { 81 System.err.println(i + " = " + args[i]); 82 } 83 System.exit(1); 84 } 85 86 } 87 | Popular Tags |