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

import java.util.ArrayList;
import java.util.Locale;
import org.eclipse.birt.report.tests.engine.EngineCase;

/**
 * <b>Bug description</b>
 * <p>
 * Java based scripting -> getLocale() and getHttpServletRequest() not working
 * <p>
 * <b>Test description:</b>
 * <p>
 * This test makes sure that getLocale() return Locale instance.
 */

public class Regression_122124 extends EngineCase
{

	private final static String INPUT = "regression_122124.rptdesign";
	private final static String OUTPUT = "regression_122124.html";

	public void test_Regression_1221244( ) throws Exception
	{
		ArrayList errors = runAndRender_HTML( INPUT, OUTPUT );
		assertTrue( errors.size( ) <= 0 );
		// getHttpServletRequest cannot be tested in current framework
		// Object obj = super.engineTask.getAppContext( ).get(
		// "httpServletRequest" );
		// assertNotNull(obj);
		Object obj = super.engineTask.getAppContext( ).get( "locale" );
		assertNotNull( obj );
		assertTrue( obj instanceof Locale );
	}
}