HHH-10373 - Correct test to work for 5.0

This commit is contained in:
Gail Badner 2016-06-01 19:58:22 -07:00
parent a46a17181e
commit 5c9c0c22ce
1 changed files with 7 additions and 8 deletions

View File

@ -8,7 +8,6 @@ package org.hibernate.test.schemaupdate.idbag;
import java.io.File; import java.io.File;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.EnumSet;
import org.hibernate.boot.MetadataSources; import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistry;
@ -16,7 +15,7 @@ import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.spi.MetadataImplementor; import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.tool.hbm2ddl.SchemaUpdate; import org.hibernate.tool.hbm2ddl.SchemaUpdate;
import org.hibernate.tool.schema.TargetType; import org.hibernate.tool.hbm2ddl.Target;
import org.junit.Test; import org.junit.Test;
@ -45,12 +44,12 @@ public class IdBagSequenceTest {
.buildMetadata(); .buildMetadata();
metadata.validate(); metadata.validate();
new SchemaUpdate() final SchemaUpdate schemaUpdate = new SchemaUpdate( metadata );
.setHaltOnError( true ) schemaUpdate.setHaltOnError( true );
.setOutputFile( output.getAbsolutePath() ) schemaUpdate.setOutputFile( output.getAbsolutePath() );
.setDelimiter( ";" ) schemaUpdate.setDelimiter( ";" );
.setFormat( true ) schemaUpdate.setFormat( true );
.execute( EnumSet.of( TargetType.SCRIPT ), metadata ); schemaUpdate.execute( Target.SCRIPT );
String fileContent = new String( Files.readAllBytes( output.toPath() ) ); String fileContent = new String( Files.readAllBytes( output.toPath() ) );
assertThat( fileContent.toLowerCase().contains( "create sequence seq_child_id" ), is( true ) ); assertThat( fileContent.toLowerCase().contains( "create sequence seq_child_id" ), is( true ) );