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

import org.apache.cactus.WebRequest;
import org.eclipse.birt.report.servlet.ViewerServlet;
import org.eclipse.birt.report.tests.viewer.BaseViewerTestCase;

import com.meterware.httpunit.WebResponse;

/**
 * <b>Steps to reproduce:</b>
 * <ol>
 * <li>Create a report
 * <li>Set report title as regression_122225
 * <li>Preview in Web Viewer
 * </ol>
 * <b>Actual result:</b>
 * <p>
 * Title shown in browser was not regression_122225
 * <p>
 * <b>Expected result:</b>
 * <p>
 * regression_122225 is displayed as title in browser
 * </p>
 * <b>Test description:</b>
 * <p>
 * Verify that browser can get title from property editor
 * </p>
 */
public class Regression_122225 extends BaseViewerTestCase
{

	private final static String REPORT = "report/regression_122225.rptdesign";

	/**
	 * @param webRequest
	 * @throws Exception
	 */
	public void begin_regression_122225( WebRequest webRequest )
			throws Exception
	{
		webRequest.setURL( null, null, SERVLET_PATH_FRAMESET, null, null );
		webRequest.addParameter( PARAM_REPORT, REPORT );
	}

	/**
	 * test_regression_122225
	 */
	public void test_regression_122225( )
	{
		ViewerServlet servlet = new ViewerServlet( );
		try
		{
			servlet.init( config );
			servlet.doPost( request, response );
		}
		catch ( Exception e )
		{
			e.printStackTrace( );
			fail( e.toString( ) );
		}
	}

	/**
	 * @param webResponse
	 */
	public void end_regression_122225( WebResponse webResponse )
			throws Exception
	{
		String title = "regression_122225";
		assertEquals( title, webResponse.getTitle( ) );
	}

}