
package org.eclipse.birt.report.tests.engine.regression;

import org.eclipse.birt.report.tests.engine.EngineCase;

/**
 * <b>Bug description</b>
 * <p>
 * Exception when use report parameter in chart script.
 * <p>
 * <b>Test description</b>
 * <p>
 * This test makes sure that no exception in bug condition.
 * 
 * 
 */
public class Regression_141941 extends EngineCase
{

	private final static String INPUT = "regression_141941.rptdesign"; //$NON-NLS-1$
	private final static String OUTPUT = "regression_141941.html"; //$NON-NLS-1$
	private String inputPath=getClassFolder()+System.getProperty( "file.separator" )+INPUT_FOLDER+System.getProperty( "file.separator" );
	private String outputPath=getClassFolder()+System.getProperty( "file.separator" )+OUTPUT_FOLDER+System.getProperty( "file.separator" );
	private String reportDoc="regression_141941.rptdocument";
	/**
	 * @throws Exception
	 */
	public void test_Regression_141941( ) throws Exception
	{
		/*create report document*/
/*		IReportRunnable reportRunnable=engine.openReportDesign( inputPath+INPUT );
		IRunTask runTask=engine.createRunTask( reportRunnable );
		IDocArchiveWriter archive=new FileArchiveWriter(outputPath+reportDoc);
		runTask.setAppContext( new HashMap() );
		runTask.setLocale( Locale.ENGLISH );
		runTask.run( archive );
		assertTrue("Failed to create report document. ",runTask.getErrors( ).size( )==0);
		runTask.close( );
		removeFile(outputPath+reportDoc);
		
		render output
		IReportDocument reportDocument=engine.openReportDocument( outputPath+reportDoc );
		IRenderTask renderTask=engine.createRenderTask( reportDocument );
		HTMLRenderContext renderContext=new HTMLRenderContext();
		renderContext.setImageDirectory( "image" );
		HashMap appContext=new HashMap();
		appContext.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext );
		IRenderOption options=new HTMLRenderOption();
		options.setOutputFileName( outputPath+OUTPUT );
		options.setOutputFormat( "html" );
		renderTask.render( );
		assertTrue("Exception when render report. ",renderTask.getErrors( ).size( )==0);
		renderTask.close( );
		removeFile(outputPath+OUTPUT);
*/		
		assertTrue(runAndThenRender( INPUT, OUTPUT, "All", "html" ).size( )<=0);
		
	}

}
