/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation. All rights reserved. This program and
 * the accompanying materials are made available under the terms of the Eclipse
 * Public License v1.0 which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html Contributors: Actuate Corporation -
 * initial API and implementation
 ******************************************************************************/

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.eclipse.birt.report.model.api.DesignFileException;
import org.eclipse.birt.report.model.parser.DesignSchemaConstants;
import org.eclipse.birt.report.tests.model.BaseTestCase;

/**
 * <b>Regression description:</b> Change version after auto convert
 * <p>
 * By the request of 136536, user get warning message to confirm the auto
 * convert. If user select yes, the file convert to newest format, but the
 * version is still old. If user open this file again, he'll get the warning
 * message even the file converted.
 * <p>
 * <b>Test description:</b>
 * <p>
 * Open an old design report thant need convert, open/save it and check that the
 * version is updated.
 * <p>
 */
public class Regression_145724 extends BaseTestCase
{

	private final static String REPORT = "test_version.rptdesign"; //$NON-NLS-1$

	/**
	 * @throws DesignFileException
	 * @throws IOException
	 */

	public void test_regression_145724( ) throws DesignFileException,
			IOException
	{
		openDesign( REPORT );

		saveAs( "test_version.out" ); //$NON-NLS-1$
		BufferedReader br = new BufferedReader( new InputStreamReader( this
				.getClass( )
				.getResourceAsStream( "output/test_version.out" ) ) ); //$NON-NLS-1$
		String line = null;
		while ( ( line = br.readLine( ) ) != null )
		{
			if ( line.startsWith( "<report" ) ) //$NON-NLS-1$
				break;
		}

		int i = line.indexOf( "version=\"" ); //$NON-NLS-1$
		int start = line.indexOf( '"', i );
		int end = line.indexOf( '"', start + 1 );

		String version = line.substring( start + 1, end );
		assertEquals( DesignSchemaConstants.REPORT_VERSION, version );
	}
}

@@ -615,27 +615,26 @@
 java.io.
-IOException
+FileReader
 ;%0Aimport
@@ -643,32 +643,26 @@
 ava.io.I
-nputStreamReader
+OException
 ;%0A%0Aimpor
@@ -1698,16 +1698,17 @@
 -NLS-1$%0A
+%0A
 %09%09Buffer
@@ -1749,19 +1749,12 @@
 new 
-InputStream
+File
 Read
@@ -1779,16 +1779,22 @@
 lass
+Folder
 ( )%0A%09%09%09%09
 .get
@@ -1793,38 +1793,27 @@
 %09%09%09%09
-.getResourceAsStream( %22output/
++ OUTPUT_FOLDER + %22
 test
@@ -1827,18 +1827,16 @@
 n.out%22 )
- )
  ); //$N

Fix a regression automation case