Author: steve.ebersole(a)jboss.com
Date: 2009-10-29 16:44:57 -0400 (Thu, 29 Oct 2009)
New Revision: 17880
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/Basic.hbm.xml
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/BasicForcedTableSequenceTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLo.hbm.xml
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLoForcedTableSequenceTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/Pooled.hbm.xml
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/PooledForcedTableSequenceTest.java
Log:
HHH-4532 - Unit Tests in test/idgen/enhanced/forcedtable need update
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/Basic.hbm.xml
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/Basic.hbm.xml 2009-10-29
18:57:24 UTC (rev 17879)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/Basic.hbm.xml 2009-10-29
20:44:57 UTC (rev 17880)
@@ -19,7 +19,7 @@
<param name="initial_value">1</param>
<param name="increment_size">1</param>
<param name="optimizer">none</param>
- <param name="force_tbl_use">true</param>
+ <param name="force_table_use">true</param>
</generator>
</id>
<property name="name" type="string"/>
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/BasicForcedTableSequenceTest.java
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/BasicForcedTableSequenceTest.java 2009-10-29
18:57:24 UTC (rev 17879)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/BasicForcedTableSequenceTest.java 2009-10-29
20:44:57 UTC (rev 17880)
@@ -6,6 +6,8 @@
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.id.enhanced.SequenceStyleGenerator;
+import org.hibernate.id.enhanced.TableStructure;
+import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.Session;
/**
@@ -28,8 +30,19 @@
public void testNormalBoundary() {
EntityPersister persister = sfi().getEntityPersister( Entity.class.getName() );
- assertClassAssignability( SequenceStyleGenerator.class,
persister.getIdentifierGenerator().getClass() );
+ assertTrue(
+ "sequence style generator was not used",
+ SequenceStyleGenerator.class.isInstance( persister.getIdentifierGenerator() )
+ );
SequenceStyleGenerator generator = ( SequenceStyleGenerator )
persister.getIdentifierGenerator();
+ assertTrue(
+ "table structure was not used",
+ TableStructure.class.isInstance( generator.getDatabaseStructure() )
+ );
+ assertTrue(
+ "no-op optimizer was not used",
+ OptimizerFactory.NoopOptimizer.class.isInstance( generator.getOptimizer() )
+ );
int count = 5;
Entity[] entities = new Entity[count];
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLo.hbm.xml
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLo.hbm.xml 2009-10-29
18:57:24 UTC (rev 17879)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLo.hbm.xml 2009-10-29
20:44:57 UTC (rev 17880)
@@ -18,7 +18,7 @@
<param name="initial_value">1</param>
<param name="increment_size">10</param>
<param name="optimizer">hilo</param>
- <param name="force_tbl_use">true</param>
+ <param name="force_table_use">true</param>
</generator>
</id>
<property name="name" type="string"/>
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLoForcedTableSequenceTest.java
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLoForcedTableSequenceTest.java 2009-10-29
18:57:24 UTC (rev 17879)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLoForcedTableSequenceTest.java 2009-10-29
20:44:57 UTC (rev 17880)
@@ -7,6 +7,7 @@
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;
+import org.hibernate.id.enhanced.TableStructure;
import org.hibernate.Session;
/**
@@ -29,9 +30,19 @@
public void testNormalBoundary() {
EntityPersister persister = sfi().getEntityPersister( Entity.class.getName() );
- assertClassAssignability( SequenceStyleGenerator.class,
persister.getIdentifierGenerator().getClass() );
+ assertTrue(
+ "sequence style generator was not used",
+ SequenceStyleGenerator.class.isInstance( persister.getIdentifierGenerator() )
+ );
SequenceStyleGenerator generator = ( SequenceStyleGenerator )
persister.getIdentifierGenerator();
- assertClassAssignability( OptimizerFactory.HiLoOptimizer.class,
generator.getOptimizer().getClass() );
+ assertTrue(
+ "table structure was not used",
+ TableStructure.class.isInstance( generator.getDatabaseStructure() )
+ );
+ assertTrue(
+ "hilo optimizer was not used",
+ OptimizerFactory.HiLoOptimizer.class.isInstance( generator.getOptimizer() )
+ );
OptimizerFactory.HiLoOptimizer optimizer = ( OptimizerFactory.HiLoOptimizer )
generator.getOptimizer();
int increment = optimizer.getIncrementSize();
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/Pooled.hbm.xml
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/Pooled.hbm.xml 2009-10-29
18:57:24 UTC (rev 17879)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/Pooled.hbm.xml 2009-10-29
20:44:57 UTC (rev 17880)
@@ -18,7 +18,7 @@
<param name="initial_value">1</param>
<param name="increment_size">10</param>
<param name="optimizer">pooled</param>
- <param name="force_tbl_use">true</param>
+ <param name="force_table_use">true</param>
</generator>
</id>
<property name="name" type="string"/>
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/PooledForcedTableSequenceTest.java
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/PooledForcedTableSequenceTest.java 2009-10-29
18:57:24 UTC (rev 17879)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/PooledForcedTableSequenceTest.java 2009-10-29
20:44:57 UTC (rev 17880)
@@ -7,6 +7,7 @@
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;
+import org.hibernate.id.enhanced.TableStructure;
import org.hibernate.Session;
/**
@@ -29,9 +30,19 @@
public void testNormalBoundary() {
EntityPersister persister = sfi().getEntityPersister( Entity.class.getName() );
- assertClassAssignability( SequenceStyleGenerator.class,
persister.getIdentifierGenerator().getClass() );
+ assertTrue(
+ "sequence style generator was not used",
+ SequenceStyleGenerator.class.isInstance( persister.getIdentifierGenerator() )
+ );
SequenceStyleGenerator generator = ( SequenceStyleGenerator )
persister.getIdentifierGenerator();
- assertClassAssignability( OptimizerFactory.PooledOptimizer.class,
generator.getOptimizer().getClass() );
+ assertTrue(
+ "table structure was not used",
+ TableStructure.class.isInstance( generator.getDatabaseStructure() )
+ );
+ assertTrue(
+ "pooled optimizer was not used",
+ OptimizerFactory.PooledOptimizer.class.isInstance( generator.getOptimizer() )
+ );
OptimizerFactory.PooledOptimizer optimizer = ( OptimizerFactory.PooledOptimizer )
generator.getOptimizer();
int increment = optimizer.getIncrementSize();
Show replies by date