saveAs( "OdaDataSetConvertReportParamTest_1_out.xml" ); compareTextFile( "OdaDataSetConvertReportParamTest_1_golden.xml", "OdaDataSetConvertReportParamTest_1_out.xml" );
save( ); compareTextFile( "OdaDataSetConvertReportParamTest_1_golden.xml");
	public void testToROMDataSetParamWithReportParam( ) throws Exception	{		// create oda set handle.		openDesign( "OdaDataSetConvertReportParamTest.xml" ); //$NON-NLS-1$		OdaDataSetHandle setHandle = (OdaDataSetHandle) designHandle				.findDataSet( "myDataSet1" ); //$NON-NLS-1$		// get the latest data set design.		DataSetDesign setDesign = new ModelOdaAdapter( )				.createDataSetDesign( setHandle );		// oda data set design changed, update ROM values. still keep report		// parameter link.		DataSetParameters params = setDesign.getParameters( );		ParameterDefinition param = (ParameterDefinition) params				.getParameterDefinitions( ).get( 0 );		updateParameterDefinition1( param );		new ModelOdaAdapter( )				.updateDataSetHandle( setDesign, setHandle, false );		saveAs( "OdaDataSetConvertReportParamTest_out.xml" ); //$NON-NLS-1$		compareTextFile( "OdaDataSetConvertReportParamTest_golden.xml", //$NON-NLS-1$				"OdaDataSetConvertReportParamTest_out.xml" ); //$NON-NLS-1$		openDesign( "OdaDataSetConvertReportParamTest_1.xml" ); //$NON-NLS-1$		setHandle = (OdaDataSetHandle) designHandle.findDataSet( "myDataSet1" ); //$NON-NLS-1$		// get the latest data set design.		setDesign = new ModelOdaAdapter( ).createDataSetDesign( setHandle );				DesignUtil.validateObject( setDesign );		// oda data set design changed, update ROM values. still keep report		// parameter link.		params = setDesign.getParameters( );		param = (ParameterDefinition) params.getParameterDefinitions( ).get( 0 );		// oda data set design changed, update ROM values. still keep report		// parameter link.		updateParameterDefinition1( param );		new ModelOdaAdapter( )				.updateDataSetHandle( setDesign, setHandle, false );		saveAs( "OdaDataSetConvertReportParamTest_1_out.xml" ); //$NON-NLS-1$		compareTextFile( "OdaDataSetConvertReportParamTest_1_golden.xml", //$NON-NLS-1$				"OdaDataSetConvertReportParamTest_1_out.xml" ); //$NON-NLS-1$		openDesign( "OdaDataSetConvertReportParamTest_1.xml" ); //$NON-NLS-1$		setHandle = (OdaDataSetHandle) designHandle.findDataSet( "myDataSet1" ); //$NON-NLS-1$		// get the latest data set design.		setDesign = new ModelOdaAdapter( ).createDataSetDesign( setHandle );		// oda data set design changed, update ROM values. still keep report		// parameter link.		params = setDesign.getParameters( );		param = (ParameterDefinition) params.getParameterDefinitions( ).get( 0 );		// change the direction of parameter, do not keep report parameter link.		updateParameterDefinition2( param );		new ModelOdaAdapter( )				.updateDataSetHandle( setDesign, setHandle, false );		saveAs( "OdaDataSetConvertReportParamTest_2_out.xml" ); //$NON-NLS-1$		compareTextFile( "OdaDataSetConvertReportParamTest_2_golden.xml", //$NON-NLS-1$				"OdaDataSetConvertReportParamTest_2_out.xml" ); //$NON-NLS-1$		// the oda data set design is not changed. ROM values are changed.		// Should keep rom values.		openDesign( "OdaDataSetConvertReportParamTest_1.xml" ); //$NON-NLS-1$		setHandle = (OdaDataSetHandle) designHandle.findDataSet( "myDataSet1" ); //$NON-NLS-1$		// get the latest data set design.		setDesign = new ModelOdaAdapter( ).createDataSetDesign( setHandle );		Iterator paramHandles = setHandle.parametersIterator( );		OdaDataSetParameterHandle paramHandle = (OdaDataSetParameterHandle) paramHandles				.next( );		paramHandle.setIsOutput( true );		paramHandle.setIsInput( false );		paramHandle.setDefaultValue( "not updated default value" ); //$NON-NLS-1$		String reportParamName = paramHandle.getParamName( );		ScalarParameterHandle reportParam = (ScalarParameterHandle) designHandle				.findParameter( reportParamName );		reportParam.setPromptText( "not updated prompt text" ); //$NON-NLS-1$		reportParam.setDefaultValue( "not updated default value" ); //$NON-NLS-1$		new ModelOdaAdapter( )				.updateDataSetHandle( setDesign, setHandle, false );		saveAs( "OdaDataSetConvertReportParamTest_3_out.xml" ); //$NON-NLS-1$		compareTextFile( "OdaDataSetConvertReportParamTest_3_golden.xml", //$NON-NLS-1$				"OdaDataSetConvertReportParamTest_3_out.xml" ); //$NON-NLS-1$		// when convert data set design to data set handle, report parameters's		// data set should also be updated.		openDesign( "OdaDataSetConvertReportParamTest_2.xml" ); //$NON-NLS-1$		setHandle = (OdaDataSetHandle) designHandle.findDataSet( "sqlSet1" ); //$NON-NLS-1$		// get the latest data set design.		setDesign = new ModelOdaAdapter( ).createDataSetDesign( setHandle );		params = setDesign.getParameters( );		param = (ParameterDefinition) params.getParameterDefinitions( ).get( 0 );		// change the direction of parameter, do not keep report parameter link.		updateParameterDefinition3( param );		new ModelOdaAdapter( )				.updateDataSetHandle( setDesign, setHandle, false );		checkUpdateParameterDefinition3( param );		// when convert data set design to data set handle, report parameters's		// data set should be created if no such data set.		openDesign( "OdaDataSetConvertReportParamTest_2.xml" ); //$NON-NLS-1$		setHandle = (OdaDataSetHandle) designHandle.findDataSet( "sqlSet1" ); //$NON-NLS-1$		// get the latest data set design.		setDesign = new ModelOdaAdapter( ).createDataSetDesign( setHandle );		params = setDesign.getParameters( );		param = (ParameterDefinition) params.getParameterDefinitions( ).get( 0 );		// change the direction of parameter, do not keep report parameter link.		updateParameterDefinition3( param );		// delete the current "Data Set" to test whether a new data set is		// created.		DataSetHandle dataSetToDelete = designHandle.findDataSet( "Data Set" ); //$NON-NLS-1$		dataSetToDelete.drop( );		dataSetToDelete = designHandle.findDataSet( "Data Set" ); //$NON-NLS-1$		assertNull( dataSetToDelete );		new ModelOdaAdapter( )				.updateDataSetHandle( setDesign, setHandle, false );		checkUpdateParameterDefinition3( param );		dataSetToDelete = designHandle.findDataSet( "Data Set" ); //$NON-NLS-1$		assertNotNull( dataSetToDelete );	}