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

import java.util.ArrayList;

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

/**
 * <b>Bug description</b>
 * <p>
 * Java based scripting -> getData of ICellInstance does not work properly.
 * <p>
 * <b>Test description:</b>
 * <p>
 * This test makes sure that cellinstance works correctly without exception.
 */

public class Regression_124760 extends EngineCase
{

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

	public void test_Regression_124760( ) throws Exception
	{
		ArrayList errors = runAndRender_HTML( INPUT, OUTPUT );
		assertTrue( errors.size( ) <= 0 );
		Object obj = super.engineTask.getAppContext( ).get( "fontStyle" );
		assertNotNull( obj );
		assertEquals( "italic", obj.toString( ) );
		obj = super.engineTask.getAppContext( ).get( "color" );
		assertNotNull( obj );
		assertEquals( "rgb(255, 0, 0)", obj.toString( ) );
		obj = super.engineTask.getAppContext( ).get( "fontWeight" );
		assertNotNull( obj );
		assertEquals( "bolder", obj.toString( ) );

		obj = super.engineTask.getAppContext( ).get( "column" );
		assertNotNull( obj );
		assertEquals( "1", obj.toString( ) );
		obj = super.engineTask.getAppContext( ).get( "rowSpan" );
		assertNotNull( obj );
		assertEquals( "2", obj.toString( ) );
		obj = super.engineTask.getAppContext( ).get( "colSpan" );
		assertNotNull( obj );
		assertEquals( "2", obj.toString( ) );
		obj = super.engineTask.getAppContext( ).get( "height" );
		assertNotNull( obj );
		assertEquals( "5ex", obj.toString( ) );
		obj = super.engineTask.getAppContext( ).get( "width" );
		assertNotNull( obj );
		assertEquals( "5ex", obj.toString( ) );
	}
}