Author: steve.ebersole(a)jboss.com
Date: 2008-09-10 13:53:46 -0400 (Wed, 10 Sep 2008)
New Revision: 15178
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/SequenceStyleConfigUnitTest.java
core/trunk/testsuite/src/test/resources/log4j.properties
Log:
test suite cleanups
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java 2008-09-10
17:11:17 UTC (rev 15177)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java 2008-09-10
17:53:46 UTC (rev 15178)
@@ -279,7 +279,7 @@
session.enableFilter( "effectiveDate" ).setParameter( "asOfDate",
new Date() );
Product prod = ( Product ) session.createCriteria( Product.class )
- .setResultTransformer( new DistinctRootEntityResultTransformer() )
+ .setResultTransformer( DistinctRootEntityResultTransformer.INSTANCE )
.add( Restrictions.eq( "id", testData.prod1Id ) )
.uniqueResult();
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java 2008-09-10
17:11:17 UTC (rev 15177)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java 2008-09-10
17:53:46 UTC (rev 15178)
@@ -1716,7 +1716,7 @@
session = openSession();
results = session.createQuery( "select a from Animal a, Animal b order by
a.id" )
- .setResultTransformer(new DistinctRootEntityResultTransformer())
+ .setResultTransformer( DistinctRootEntityResultTransformer.INSTANCE )
.list();
assertEquals( "Incorrect result size", 2, results.size());
assertTrue( "Incorrect return type", results.get(0) instanceof Animal );
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/SequenceStyleConfigUnitTest.java
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/SequenceStyleConfigUnitTest.java 2008-09-10
17:11:17 UTC (rev 15177)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/enhanced/SequenceStyleConfigUnitTest.java 2008-09-10
17:53:46 UTC (rev 15178)
@@ -66,15 +66,15 @@
Properties props = new Properties();
props.setProperty( SequenceStyleGenerator.INCREMENT_PARAM, "10" );
- // for dialects which do not support pooled sequences, we default to hilo
+ // for dialects which do not support pooled sequences, we default to pooled+table
Dialect dialect = new SequenceDialect();
SequenceStyleGenerator generator = new SequenceStyleGenerator();
generator.configure( Hibernate.LONG, props, dialect );
- assertClassAssignability( SequenceStructure.class,
generator.getDatabaseStructure().getClass() );
- assertClassAssignability( OptimizerFactory.HiLoOptimizer.class,
generator.getOptimizer().getClass() );
+ assertClassAssignability( TableStructure.class,
generator.getDatabaseStructure().getClass() );
+ assertClassAssignability( OptimizerFactory.PooledOptimizer.class,
generator.getOptimizer().getClass() );
assertEquals( SequenceStyleGenerator.DEF_SEQUENCE_NAME,
generator.getDatabaseStructure().getName() );
- // for dialects which do support pooled sequences, we default to pooled
+ // for dialects which do support pooled sequences, we default to pooled+sequence
dialect = new PooledSequenceDialect();
generator = new SequenceStyleGenerator();
generator.configure( Hibernate.LONG, props, dialect );
@@ -118,7 +118,7 @@
*/
public void testExplicitOptimizerWithExplicitIncrementSize() {
// with sequence ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Dialect dialect = new SequenceDialect();
+ final Dialect dialect = new SequenceDialect();
// optimizer=none w/ increment > 1 => should honor optimizer
Properties props = new Properties();
@@ -134,7 +134,8 @@
// optimizer=hilo w/ increment > 1 => hilo
props = new Properties();
props.setProperty( SequenceStyleGenerator.OPT_PARAM, OptimizerFactory.HILO );
- props.setProperty( SequenceStyleGenerator.INCREMENT_PARAM, "20" );generator =
new SequenceStyleGenerator();
+ props.setProperty( SequenceStyleGenerator.INCREMENT_PARAM, "20" );
+ generator = new SequenceStyleGenerator();
generator.configure( Hibernate.LONG, props, dialect );
assertClassAssignability( SequenceStructure.class,
generator.getDatabaseStructure().getClass() );
assertClassAssignability( OptimizerFactory.HiLoOptimizer.class,
generator.getOptimizer().getClass() );
@@ -147,8 +148,10 @@
props.setProperty( SequenceStyleGenerator.INCREMENT_PARAM, "20" );
generator = new SequenceStyleGenerator();
generator.configure( Hibernate.LONG, props, dialect );
- assertClassAssignability( SequenceStructure.class,
generator.getDatabaseStructure().getClass() );
- assertClassAssignability( OptimizerFactory.HiLoOptimizer.class,
generator.getOptimizer().getClass() );
+ // because the dialect reports to not support pooled seqyences, the expectation is that
we will
+ // use a table for the backing structure...
+ assertClassAssignability( TableStructure.class,
generator.getDatabaseStructure().getClass() );
+ assertClassAssignability( OptimizerFactory.PooledOptimizer.class,
generator.getOptimizer().getClass() );
assertEquals( 20, generator.getOptimizer().getIncrementSize() );
assertEquals( 20, generator.getDatabaseStructure().getIncrementSize() );
Modified: core/trunk/testsuite/src/test/resources/log4j.properties
===================================================================
--- core/trunk/testsuite/src/test/resources/log4j.properties 2008-09-10 17:11:17 UTC (rev
15177)
+++ core/trunk/testsuite/src/test/resources/log4j.properties 2008-09-10 17:53:46 UTC (rev
15178)
@@ -6,4 +6,5 @@
log4j.rootLogger=info, stdout
-log4j.logger.org.hibernate.test=info
\ No newline at end of file
+log4j.logger.org.hibernate.test=info
+log4j.logger.org.hibernate.tool.hbm2ddl=debug