use of org.pentaho.platform.uifoundation.chart.TimeSeriesCollectionChartComponent in project pentaho-platform by pentaho.
the class ChartIT method runTimeSeriesChartTest.
/*
* public void runPieChartTest(int chartType, String path, String testName) { SimpleUrlFactory urlFactory = new
* SimpleUrlFactory("/testurl?"); //$NON-NLS-1$ ArrayList messages = new ArrayList();
*
* int chartWidth = 400; int chartHeight = 400; PieDatasetChartComponent pieChartComponent = new
* PieDatasetChartComponent(chartType, path, chartWidth, chartHeight, urlFactory, messages);
*
* pieChartComponent.setLoggingLevel(ILogger.ERROR); pieChartComponent.setByRow(true);
*
* pieChartComponent.setDataAction("/test-src/solutions/test/rules/department_stats.xaction", "rule-result");
* //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
*
* OutputStream outputStream = getOutputStream(SOLUTION_PATH, "ChartTest." + testName, ".html");
* //$NON-NLS-1$//$NON-NLS-2$ String contentType = "text/html"; //$NON-NLS-1$
*
* SimpleParameterProvider requestParameters = new SimpleParameterProvider(); SimpleParameterProvider
* sessionParameters = new SimpleParameterProvider();
*
* HashMap parameterProviders = new HashMap(); parameterProviders.put(IParameterProvider.SCOPE_REQUEST,
* requestParameters); parameterProviders.put(IParameterProvider.SCOPE_SESSION, sessionParameters); StandaloneSession
* session = new StandaloneSession(Messages.getInstance().getString("BaseTest.DEBUG_JUNIT_SESSION")); //$NON-NLS-1$
*
* SimpleOutputHandler outputHandler = new SimpleOutputHandler(outputStream, false); BaseRequestHandler requestHandler
* = new BaseRequestHandler(session, null, outputHandler, null, urlFactory);
*
* try { pieChartComponent.validate(session, requestHandler); pieChartComponent.handleRequest(outputStream,
* requestHandler, contentType, parameterProviders); } catch (IOException e) { e.printStackTrace(); }
*
* }
*/
public void runTimeSeriesChartTest(int chartType, String path, String testName) {
// $NON-NLS-1$
SimpleUrlFactory urlFactory = new SimpleUrlFactory("/testurl?");
ArrayList messages = new ArrayList();
int chartWidth = 400;
int chartHeight = 400;
TimeSeriesCollectionChartComponent timeSeriesChartComponent = new TimeSeriesCollectionChartComponent(chartType, path, chartWidth, chartHeight, urlFactory, messages);
timeSeriesChartComponent.setLoggingLevel(ILogger.ERROR);
// $NON-NLS-1$ //$NON-NLS-2$
timeSeriesChartComponent.setDataAction("/test/rules/department_stats.xaction", "rule-result");
// $NON-NLS-1$//$NON-NLS-2$
OutputStream outputStream = getOutputStream("ChartTest." + testName, ".html");
// $NON-NLS-1$
String contentType = "text/html";
SimpleParameterProvider requestParameters = new SimpleParameterProvider();
SimpleParameterProvider sessionParameters = new SimpleParameterProvider();
HashMap parameterProviders = new HashMap();
parameterProviders.put(IParameterProvider.SCOPE_REQUEST, requestParameters);
parameterProviders.put(IParameterProvider.SCOPE_SESSION, sessionParameters);
StandaloneSession session = // $NON-NLS-1$
new StandaloneSession(Messages.getInstance().getString("BaseTest.DEBUG_JUNIT_SESSION"));
SimpleOutputHandler outputHandler = new SimpleOutputHandler(outputStream, false);
BaseRequestHandler requestHandler = new BaseRequestHandler(session, null, outputHandler, null, urlFactory);
try {
timeSeriesChartComponent.validate(session, requestHandler);
timeSeriesChartComponent.handleRequest(outputStream, requestHandler, contentType, parameterProviders);
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations