FileDocCategorySizeDatePackage
MigrationTest.javaAPI DocHibernate 3.2.51255Tue Dec 12 16:22:26 GMT 2006org.hibernate.test.schemaupdate

MigrationTest

public class MigrationTest extends org.hibernate.junit.UnitTestCase
author
Max Rydahl Andersen

Fields Summary
Constructors Summary
public MigrationTest(String str)

		super( str );
	
Methods Summary
public static junit.framework.Testsuite()

		return new TestSuite( MigrationTest.class );
	
public voidtestSimpleColumnAddition()

		String resource1 = "org/hibernate/test/schemaupdate/1_Version.hbm.xml";
		String resource2 = "org/hibernate/test/schemaupdate/2_Version.hbm.xml";

		Configuration v1cfg = new Configuration();
		v1cfg.addResource( resource1 );
		new SchemaExport( v1cfg ).execute( false, true, true, false );

		SchemaUpdate v1schemaUpdate = new SchemaUpdate( v1cfg );
		v1schemaUpdate.execute( true, true );

		assertEquals( 0, v1schemaUpdate.getExceptions().size() );

		Configuration v2cfg = new Configuration();
		v2cfg.addResource( resource2 );

		SchemaUpdate v2schemaUpdate = new SchemaUpdate( v2cfg );
		v2schemaUpdate.execute( true, true );
		assertEquals( 0, v2schemaUpdate.getExceptions().size() );