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

import org.eclipse.birt.report.engine.api.IGetParameterDefinitionTask;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.tests.engine.EngineCase;

/**
 * <b>Bug description</b>
 * <p>
 * IGetParameterDefinitionTask close issue.
 * <p>
 * <b>Test description</b>
 * <p>
 * This test makes sure that IGetParameterDefinitionTask.close method will not
 * cause NPE.
 * 
 */

public class Regression_151002 extends EngineCase
{

	private final static String INPUT = "regression_151002.rptdesign"; //$NON-NLS-1$
	private final static String OUTPUT = "regression_151002.html"; //$NON-NLS-1$

	/**
	 * @throws Exception
	 */

	public void test_Regression_151002( ) throws Exception
	{
		IReportRunnable reportRunnable = engine
				.openReportDesign( getClassFolder( ) + "/" + INPUT_FOLDER + "/"
						+ INPUT );
		IGetParameterDefinitionTask task = engine
				.createGetParameterDefinitionTask( reportRunnable );
		task.evaluateQuery( "NewCascadingParameterGroup" );
		assertTrue( task.getErrors( ).size( ) == 0 );
		task.close( );
		this
				.removeFile( getClassFolder( ) + "/" + OUTPUT_FOLDER + "/"
						+ OUTPUT );
	}

}
