SimpleUrlFactory urlFactory = new SimpleUrlFactory( "/testurl?" ); //$NON-NLS-1$
ArrayList messages = new ArrayList();
int chartWidth = 400;
int chartHeight = 400;
TimeSeriesCollectionChartComponent timeSeriesChartComponent =
new TimeSeriesCollectionChartComponent( chartType, path, chartWidth, chartHeight, urlFactory, messages );
timeSeriesChartComponent.setLoggingLevel( ILogger.ERROR );
timeSeriesChartComponent.setDataAction( "/test/rules/department_stats.xaction", "rule-result" ); //$NON-NLS-1$ //$NON-NLS-2$
OutputStream outputStream = getOutputStream( "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 {
timeSeriesChartComponent.validate( session, requestHandler );
timeSeriesChartComponent.handleRequest( outputStream, requestHandler, contentType, parameterProviders );
} catch ( IOException e ) {
e.printStackTrace();
}
}