Hibernate SVN: r15288 - core/branches/Branch_3_2/test/org/hibernate/test.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-08 13:21:15 -0400 (Wed, 08 Oct 2008)
New Revision: 15288
Modified:
core/branches/Branch_3_2/test/org/hibernate/test/AllTests.java
Log:
HHH-3518 : remove testsuite Suite aggregators
Modified: core/branches/Branch_3_2/test/org/hibernate/test/AllTests.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/AllTests.java 2008-10-08 16:42:46 UTC (rev 15287)
+++ core/branches/Branch_3_2/test/org/hibernate/test/AllTests.java 2008-10-08 17:21:15 UTC (rev 15288)
@@ -18,37 +18,87 @@
import org.hibernate.test.batchfetch.BatchFetchTest;
import org.hibernate.test.bidi.AuctionTest;
import org.hibernate.test.bidi.AuctionTest2;
-import org.hibernate.test.bytecode.BytecodeSuite;
import org.hibernate.test.cache.CacheSuite;
-import org.hibernate.test.cascade.CascadeSuite;
+import org.hibernate.test.cascade.BidirectionalOneToManyCascadeTest;
+import org.hibernate.test.cascade.MultiPathCascadeTest;
+import org.hibernate.test.cascade.RefreshTest;
import org.hibernate.test.cfg.ListenerTest;
import org.hibernate.test.cid.CompositeIdTest;
-import org.hibernate.test.collection.CollectionSuite;
-import org.hibernate.test.component.ComponentSuite;
+import org.hibernate.test.collection.bag.PersistentBagTest;
+import org.hibernate.test.collection.idbag.PersistentIdBagTest;
+import org.hibernate.test.collection.list.PersistentListTest;
+import org.hibernate.test.collection.map.PersistentMapTest;
+import org.hibernate.test.collection.original.CollectionTest;
+import org.hibernate.test.collection.set.PersistentSetTest;
+import org.hibernate.test.component.basic.ComponentTest;
+import org.hibernate.test.component.cascading.collection.CascadeToComponentCollectionTest;
+import org.hibernate.test.component.cascading.toone.CascadeToComponentAssociationTest;
import org.hibernate.test.compositeelement.CompositeElementTest;
-import org.hibernate.test.connections.ConnectionsSuite;
+import org.hibernate.test.connections.AggressiveReleaseTest;
+import org.hibernate.test.connections.BasicConnectionProviderTest;
+import org.hibernate.test.connections.CurrentSessionConnectionTest;
+import org.hibernate.test.connections.SuppliedConnectionTest;
import org.hibernate.test.criteria.CriteriaQueryTest;
import org.hibernate.test.cuk.CompositePropertyRefTest;
import org.hibernate.test.cut.CompositeUserTypeTest;
import org.hibernate.test.deletetransient.DeleteTransientEntityTest;
-import org.hibernate.test.dialect.functional.DialectFunctionalTestsSuite;
-import org.hibernate.test.dialect.unit.DialectUnitTestsSuite;
+import org.hibernate.test.dialect.functional.cache.SQLFunctionsInterSystemsTest;
+import org.hibernate.test.dialect.unit.lockhint.SQLServerLockHintsTest;
+import org.hibernate.test.dialect.unit.lockhint.SybaseLockHintsTest;
import org.hibernate.test.discriminator.DiscriminatorTest;
import org.hibernate.test.dynamicentity.interceptor.InterceptorDynamicEntityTest;
import org.hibernate.test.dynamicentity.tuplizer.TuplizerDynamicEntityTest;
+import org.hibernate.test.dynamicentity.tuplizer2.ImprovedTuplizerDynamicEntityTest;
import org.hibernate.test.ecid.EmbeddedCompositeIdTest;
-import org.hibernate.test.entitymode.EntityModeSuite;
-import org.hibernate.test.event.collection.CollectionEventSuite;
+import org.hibernate.test.entitymode.dom4j.accessors.Dom4jAccessorTest;
+import org.hibernate.test.entitymode.dom4j.basic.Dom4jTest;
+import org.hibernate.test.entitymode.dom4j.many2one.Dom4jManyToOneTest;
+import org.hibernate.test.entitymode.map.basic.DynamicClassTest;
+import org.hibernate.test.entitymode.multi.MultiRepresentationTest;
+import org.hibernate.test.event.collection.BrokenCollectionEventTest;
+import org.hibernate.test.event.collection.association.bidirectional.manytomany.BidirectionalManyToManyBagToSetCollectionEventTest;
+import org.hibernate.test.event.collection.association.bidirectional.manytomany.BidirectionalManyToManySetToSetCollectionEventTest;
+import org.hibernate.test.event.collection.association.bidirectional.onetomany.BidirectionalOneToManyBagCollectionEventTest;
+import org.hibernate.test.event.collection.association.bidirectional.onetomany.BidirectionalOneToManySetCollectionEventTest;
+import org.hibernate.test.event.collection.association.unidirectional.manytomany.UnidirectionalManyToManyBagCollectionEventTest;
+import org.hibernate.test.event.collection.association.unidirectional.onetomany.UnidirectionalOneToManyBagCollectionEventTest;
+import org.hibernate.test.event.collection.association.unidirectional.onetomany.UnidirectionalOneToManySetCollectionEventTest;
+import org.hibernate.test.event.collection.values.ValuesBagCollectionEventTest;
import org.hibernate.test.exception.SQLExceptionConversionTest;
import org.hibernate.test.extralazy.ExtraLazyTest;
import org.hibernate.test.filter.DynamicFilterTest;
import org.hibernate.test.formulajoin.FormulaJoinTest;
-import org.hibernate.test.generated.GeneratedPropertySuite;
-import org.hibernate.test.generatedkeys.GeneratedKeysSuite;
-import org.hibernate.test.hql.HQLSuite;
+import org.hibernate.test.generated.PartiallyGeneratedComponentTest;
+import org.hibernate.test.generated.TimestampGeneratedValuesWithCachingTest;
+import org.hibernate.test.generated.TriggerGeneratedValuesWithCachingTest;
+import org.hibernate.test.generated.TriggerGeneratedValuesWithoutCachingTest;
+import org.hibernate.test.generatedkeys.identity.IdentityGeneratedKeysTest;
+import org.hibernate.test.generatedkeys.select.SelectGeneratorTest;
+import org.hibernate.test.generatedkeys.seqidentity.SequenceIdentityTest;
+import org.hibernate.test.hql.ASTParserLoadingTest;
+import org.hibernate.test.hql.BulkManipulationTest;
+import org.hibernate.test.hql.ClassicTranslatorTest;
+import org.hibernate.test.hql.CriteriaClassicAggregationReturnTest;
+import org.hibernate.test.hql.CriteriaHQLAlignmentTest;
+import org.hibernate.test.hql.EJBQLTest;
+import org.hibernate.test.hql.HQLTest;
+import org.hibernate.test.hql.HqlParserTest;
+import org.hibernate.test.hql.ScrollableCollectionFetchingTest;
+import org.hibernate.test.hql.WithClauseTest;
import org.hibernate.test.id.MultipleHiLoPerTableGeneratorTest;
import org.hibernate.test.idbag.IdBagTest;
import org.hibernate.test.idclass.IdClassTest;
+import org.hibernate.test.idgen.enhanced.OptimizerUnitTest;
+import org.hibernate.test.idgen.enhanced.SequenceStyleConfigUnitTest;
+import org.hibernate.test.idgen.enhanced.forcedtable.BasicForcedTableSequenceTest;
+import org.hibernate.test.idgen.enhanced.forcedtable.HiLoForcedTableSequenceTest;
+import org.hibernate.test.idgen.enhanced.forcedtable.PooledForcedTableSequenceTest;
+import org.hibernate.test.idgen.enhanced.sequence.BasicSequenceTest;
+import org.hibernate.test.idgen.enhanced.sequence.HiLoSequenceTest;
+import org.hibernate.test.idgen.enhanced.sequence.PooledSequenceTest;
+import org.hibernate.test.idgen.enhanced.table.BasicTableTest;
+import org.hibernate.test.idgen.enhanced.table.HiLoTableTest;
+import org.hibernate.test.idgen.enhanced.table.PooledTableTest;
import org.hibernate.test.idprops.IdentifierPropertyReferencesTest;
import org.hibernate.test.immutable.ImmutableTest;
import org.hibernate.test.insertordering.InsertOrderingTest;
@@ -58,11 +108,21 @@
import org.hibernate.test.interceptor.InterceptorTest;
import org.hibernate.test.interfaceproxy.InterfaceProxyTest;
import org.hibernate.test.iterate.IterateTest;
-import org.hibernate.test.join.JoinSuite;
+import org.hibernate.test.join.JoinTest;
+import org.hibernate.test.join.OptionalJoinTest;
import org.hibernate.test.joinedsubclass.JoinedSubclassTest;
import org.hibernate.test.joinfetch.JoinFetchTest;
-import org.hibernate.test.jpa.JPAComplianceSuite;
-import org.hibernate.test.keymanytoone.KeyManyToOneSuite;
+import org.hibernate.test.jpa.cascade.CascadeTest;
+import org.hibernate.test.jpa.fetch.FetchingTest;
+import org.hibernate.test.jpa.lock.JPALockTest;
+import org.hibernate.test.jpa.lock.RepeatableReadTest;
+import org.hibernate.test.jpa.proxy.JPAProxyTest;
+import org.hibernate.test.jpa.ql.JPAQLComplianceTest;
+import org.hibernate.test.jpa.ql.NativeQueryTest;
+import org.hibernate.test.jpa.removed.RemovedEntityTest;
+import org.hibernate.test.keymanytoone.bidir.component.EagerKeyManyToOneTest;
+import org.hibernate.test.keymanytoone.bidir.component.LazyKeyManyToOneTest;
+import org.hibernate.test.keymanytoone.bidir.embedded.KeyManyToOneTest;
import org.hibernate.test.lazycache.InstrumentCacheTest;
import org.hibernate.test.lazycache.InstrumentCacheTest2;
import org.hibernate.test.lazyonetoone.LazyOneToOneTest;
@@ -85,9 +145,13 @@
import org.hibernate.test.legacy.SQLFunctionsTest;
import org.hibernate.test.legacy.SQLLoaderTest;
import org.hibernate.test.legacy.StatisticsTest;
-import org.hibernate.test.lob.LobSuite;
+import org.hibernate.test.lob.BlobTest;
+import org.hibernate.test.lob.ClobTest;
+import org.hibernate.test.lob.SerializableTypeTest;
import org.hibernate.test.manytomany.ManyToManyTest;
-import org.hibernate.test.manytomanyassociationclass.ManyToManyAssociationClassSuite;
+import org.hibernate.test.manytomanyassociationclass.compositeid.ManyToManyAssociationClassCompositeIdTest;
+import org.hibernate.test.manytomanyassociationclass.surrogateid.assigned.ManyToManyAssociationClassAssignedIdTest;
+import org.hibernate.test.manytomanyassociationclass.surrogateid.generated.ManyToManyAssociationClassGeneratedIdTest;
import org.hibernate.test.map.MapIndexFormulaTest;
import org.hibernate.test.mapcompelem.MapCompositeElementTest;
import org.hibernate.test.mapelemformula.MapElementFormulaTest;
@@ -95,23 +159,45 @@
import org.hibernate.test.mapping.ValueVisitorTest;
import org.hibernate.test.mappingexception.MappingExceptionTest;
import org.hibernate.test.mixed.MixedTest;
-import org.hibernate.test.naturalid.NaturalIdSuite;
+import org.hibernate.test.naturalid.immutable.ImmutableNaturalIdTest;
+import org.hibernate.test.naturalid.mutable.MutableNaturalIdTest;
import org.hibernate.test.ondelete.OnDeleteTest;
import org.hibernate.test.onetomany.OneToManyTest;
-import org.hibernate.test.onetoone.OneToOneSuite;
-import org.hibernate.test.ops.OpsSuite;
+import org.hibernate.test.onetoone.formula.OneToOneFormulaTest;
+import org.hibernate.test.onetoone.joined.JoinedSubclassOneToOneTest;
+import org.hibernate.test.onetoone.link.OneToOneLinkTest;
+import org.hibernate.test.onetoone.nopojo.DynamicMapOneToOneTest;
+import org.hibernate.test.onetoone.optional.OptionalOneToOneTest;
+import org.hibernate.test.onetoone.singletable.DiscrimSubclassOneToOneTest;
+import org.hibernate.test.ops.CreateTest;
+import org.hibernate.test.ops.DeleteTest;
+import org.hibernate.test.ops.GetLoadTest;
+import org.hibernate.test.ops.MergeTest;
+import org.hibernate.test.ops.SaveOrUpdateTest;
import org.hibernate.test.optlock.OptimisticLockTest;
import org.hibernate.test.ordered.OrderByTest;
-import org.hibernate.test.orphan.OrphanSuite;
+import org.hibernate.test.orphan.OrphanTest;
import org.hibernate.test.pagination.PaginationTest;
-import org.hibernate.test.propertyref.PropertyRefSuite;
+import org.hibernate.test.propertyref.component.complete.CompleteComponentPropertyRefTest;
+import org.hibernate.test.propertyref.component.partial.PartialComponentPropertyRefTest;
+import org.hibernate.test.propertyref.inheritence.discrim.SubclassPropertyRefTest;
+import org.hibernate.test.propertyref.inheritence.joined.JoinedSubclassPropertyRefTest;
+import org.hibernate.test.propertyref.inheritence.union.UnionSubclassPropertyRefTest;
import org.hibernate.test.proxy.ProxyTest;
import org.hibernate.test.querycache.QueryCacheTest;
import org.hibernate.test.readonly.ReadOnlyTest;
-import org.hibernate.test.reattachment.ReattachmentSuite;
+import org.hibernate.test.reattachment.CollectionReattachmentTest;
+import org.hibernate.test.reattachment.ProxyReattachmentTest;
import org.hibernate.test.rowid.RowIdTest;
import org.hibernate.test.sorted.SortTest;
-import org.hibernate.test.sql.NativeSqlSupportSuite;
+import org.hibernate.test.sql.check.OracleCheckStyleTest;
+import org.hibernate.test.sql.hand.custom.datadirect.oracle.DataDirectOracleCustomSQLTest;
+import org.hibernate.test.sql.hand.custom.db2.DB2CustomSQLTest;
+import org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest;
+import org.hibernate.test.sql.hand.custom.oracle.OracleCustomSQLTest;
+import org.hibernate.test.sql.hand.custom.sybase.SybaseCustomSQLTest;
+import org.hibernate.test.sql.hand.identity.CustomInsertSQLWithIdentityColumnTest;
+import org.hibernate.test.sql.hand.query.NativeSQLQueriesTest;
import org.hibernate.test.stats.SessionStatsTest;
import org.hibernate.test.stats.StatsTest;
import org.hibernate.test.subclassfilter.DiscrimSubclassFilterTest;
@@ -128,8 +214,11 @@
import org.hibernate.test.unconstrained.UnconstrainedTest;
import org.hibernate.test.unidir.BackrefTest;
import org.hibernate.test.unionsubclass.UnionSubclassTest;
-import org.hibernate.test.usercollection.UserCollectionTypeSuite;
-import org.hibernate.test.util.UtilSuite;
+import org.hibernate.test.usercollection.basic.UserCollectionTypeTest;
+import org.hibernate.test.usercollection.parameterized.ParameterizedUserCollectionTypeTest;
+import org.hibernate.test.util.PropertiesHelperTest;
+import org.hibernate.test.util.StringHelperTest;
+import org.hibernate.test.util.dtd.EntityResolverTest;
import org.hibernate.test.version.VersionTest;
import org.hibernate.test.version.db.DbVersionTest;
import org.hibernate.test.version.sybase.SybaseTimestampVersioningTest;
@@ -196,9 +285,16 @@
*/
public static Test unfilteredSuite() {
TestSuite suite = new TestSuite("New tests suite");
- suite.addTest( OpsSuite.suite() );
- suite.addTest( NaturalIdSuite.suite() );
- suite.addTest( ComponentSuite.suite() );
+ suite.addTest( CreateTest.suite() );
+ suite.addTest( DeleteTest.suite() );
+ suite.addTest( GetLoadTest.suite() );
+ suite.addTest( MergeTest.suite() );
+ suite.addTest( SaveOrUpdateTest.suite() );
+ suite.addTest( MutableNaturalIdTest.suite() );
+ suite.addTest( ImmutableNaturalIdTest.suite() );
+ suite.addTest( ComponentTest.suite() );
+ suite.addTest( CascadeToComponentCollectionTest.suite() );
+ suite.addTest( CascadeToComponentAssociationTest.suite() );
suite.addTest( ProxyTest.suite() );
suite.addTest( VersionTest.suite() );
suite.addTest( TimestampTest.suite() );
@@ -209,7 +305,12 @@
suite.addTest( IdClassTest.suite() );
suite.addTest( ArrayTest.suite() );
suite.addTest( TernaryTest.suite() );
- suite.addTest( CollectionSuite.suite() );
+ suite.addTest( PersistentBagTest.suite() );
+ suite.addTest( PersistentIdBagTest.suite() );
+ suite.addTest( PersistentListTest.suite() );
+ suite.addTest( PersistentMapTest.suite() );
+ suite.addTest( CollectionTest.suite() );
+ suite.addTest( PersistentSetTest.suite() );
suite.addTest( IdBagTest.suite() );
suite.addTest( MapCompositeElementTest.suite() );
suite.addTest( MapIndexFormulaTest.suite() );
@@ -221,28 +322,62 @@
suite.addTest( CompositePropertyRefTest.suite() );
suite.addTest( FormulaJoinTest.suite() );
suite.addTest( DiscriminatorTest.suite() );
- suite.addTest( EntityModeSuite.suite() );
+ suite.addTest( MultiRepresentationTest.suite() );
+ suite.addTest( Dom4jAccessorTest.suite() );
+ suite.addTest( Dom4jTest.suite() );
+ suite.addTest( Dom4jManyToOneTest.suite() );
+ suite.addTest( DynamicClassTest.suite() );
suite.addTest( DynamicFilterTest.suite() );
suite.addTest( InterfaceProxyTest.suite() );
- suite.addTest( OrphanSuite.suite() );
- suite.addTest( JoinSuite.suite() );
+ suite.addTest( OrphanTest.suite() );
+ suite.addTest( org.hibernate.test.orphan.PropertyRefTest.suite() );
+ suite.addTest( JoinTest.suite() );
+ suite.addTest( OptionalJoinTest.suite() );
suite.addTest( JoinedSubclassTest.suite() );
suite.addTest( org.hibernate.test.unionsubclass2.UnionSubclassTest.suite() );
suite.addTest( MixedTest.suite() );
suite.addTest( OneToManyTest.suite() );
suite.addTest( ManyToManyTest.suite() );
- suite.addTest( ManyToManyAssociationClassSuite.suite() );
- suite.addTest( OneToOneSuite.suite() );
+ suite.addTest( ManyToManyAssociationClassCompositeIdTest.suite() );
+ suite.addTest( ManyToManyAssociationClassAssignedIdTest.suite() );
+ suite.addTest( ManyToManyAssociationClassGeneratedIdTest.suite() );
+ suite.addTest( OneToOneFormulaTest.suite() );
+ suite.addTest( JoinedSubclassOneToOneTest.suite() );
+ suite.addTest( OneToOneLinkTest.suite() );
+ suite.addTest( DynamicMapOneToOneTest.suite() );
+ suite.addTest( OptionalOneToOneTest.suite() );
+ suite.addTest( DiscrimSubclassOneToOneTest.suite() );
suite.addTest( OptimisticLockTest.suite() );
- suite.addTest( PropertyRefSuite.suite() );
- suite.addTest( NativeSqlSupportSuite.suite() );
+ suite.addTest( org.hibernate.test.propertyref.basic.PropertyRefTest.suite() );
+ suite.addTest( CompleteComponentPropertyRefTest.suite() );
+ suite.addTest( PartialComponentPropertyRefTest.suite() );
+ suite.addTest( SubclassPropertyRefTest.suite() );
+ suite.addTest( JoinedSubclassPropertyRefTest.suite() );
+ suite.addTest( UnionSubclassPropertyRefTest.suite() );
+ suite.addTest( DB2CustomSQLTest.suite() );
+ suite.addTest( DataDirectOracleCustomSQLTest.suite() );
+ suite.addTest( OracleCustomSQLTest.suite() );
+ suite.addTest( SybaseCustomSQLTest.suite() );
+ suite.addTest( MySQLCustomSQLTest.suite() );
+ suite.addTest( NativeSQLQueriesTest.suite() );
+ suite.addTest( OracleCheckStyleTest.suite() );
+ suite.addTest( CustomInsertSQLWithIdentityColumnTest.suite() );
suite.addTest( CriteriaQueryTest.suite() );
suite.addTest( SubselectTest.suite() );
suite.addTest( SubselectFetchTest.suite() );
suite.addTest( JoinFetchTest.suite() );
suite.addTest( UnionSubclassTest.suite() );
suite.addTest( ASTIteratorTest.suite() );
- suite.addTest( HQLSuite.suite() );
+ suite.addTest( HQLTest.suite() );
+ suite.addTest( ASTParserLoadingTest.suite() );
+ suite.addTest( BulkManipulationTest.suite() );
+ suite.addTest( WithClauseTest.suite() );
+ suite.addTest( EJBQLTest.suite() );
+ suite.addTest( HqlParserTest.suite() );
+ suite.addTest( ScrollableCollectionFetchingTest.suite() );
+ suite.addTest( ClassicTranslatorTest.suite() );
+ suite.addTest( CriteriaHQLAlignmentTest.suite() );
+ suite.addTest( CriteriaClassicAggregationReturnTest.suite() );
suite.addTest( ASTUtilTest.suite() );
suite.addTest( CacheSuite.suite() );
suite.addTest( QueryCacheTest.suite() );
@@ -262,13 +397,26 @@
suite.addTest( SortTest.suite() );
suite.addTest( WhereTest.suite() );
suite.addTest( IterateTest.suite() );
- suite.addTest( CascadeSuite.suite() );
+ suite.addTest( BidirectionalOneToManyCascadeTest.suite() );
+ suite.addTest( RefreshTest.suite() );
+ suite.addTest( MultiPathCascadeTest.suite() );
suite.addTest( ListenerTest.suite() );
- suite.addTest( CollectionEventSuite.suite() );
+ suite.addTest( BrokenCollectionEventTest.suite() );
+ suite.addTest( BidirectionalManyToManyBagToSetCollectionEventTest.suite() );
+ suite.addTest( BidirectionalManyToManySetToSetCollectionEventTest.suite() );
+ suite.addTest( BidirectionalOneToManyBagCollectionEventTest.suite() );
+ suite.addTest( BidirectionalOneToManySetCollectionEventTest.suite() );
+ suite.addTest( UnidirectionalManyToManyBagCollectionEventTest.suite() );
+ suite.addTest( UnidirectionalOneToManyBagCollectionEventTest.suite() );
+ suite.addTest( UnidirectionalOneToManySetCollectionEventTest.suite() );
+ suite.addTest( ValuesBagCollectionEventTest.suite() );
suite.addTest( ExtraLazyTest.suite() );
suite.addTest( StatsTest.suite() );
suite.addTest( SessionStatsTest.suite() );
- suite.addTest( ConnectionsSuite.suite() );
+ suite.addTest( BasicConnectionProviderTest.suite() );
+ suite.addTest( SuppliedConnectionTest.suite() );
+ suite.addTest( AggressiveReleaseTest.suite() );
+ suite.addTest( CurrentSessionConnectionTest.suite() );
suite.addTest( SQLExceptionConversionTest.suite() );
suite.addTest( ValueVisitorTest.suite() );
suite.addTest( PersistentClassVisitorTest.suite() );
@@ -292,25 +440,62 @@
suite.addTest( JavassistInstrumentationTest.suite() );
suite.addTest( SybaseTimestampVersioningTest.suite() );
suite.addTest( DbVersionTest.suite() );
- suite.addTest( GeneratedPropertySuite.suite() );
- suite.addTest( GeneratedKeysSuite.suite() );
+ suite.addTest( TimestampGeneratedValuesWithCachingTest.suite() );
+ suite.addTest( TriggerGeneratedValuesWithCachingTest.suite() );
+ suite.addTest( TriggerGeneratedValuesWithoutCachingTest.suite() );
+ suite.addTest( PartiallyGeneratedComponentTest.suite() );
+ suite.addTest( IdentityGeneratedKeysTest.suite() );
+ suite.addTest( SelectGeneratorTest.suite() );
+ suite.addTest( SequenceIdentityTest.suite() );
suite.addTest( InterceptorDynamicEntityTest.suite() );
suite.addTest( TuplizerDynamicEntityTest.suite() );
- suite.addTest( BytecodeSuite.suite() );
- suite.addTest( JPAComplianceSuite.suite() );
+ suite.addTest( ImprovedTuplizerDynamicEntityTest.suite() );
+ suite.addTest( org.hibernate.test.bytecode.cglib.ReflectionOptimizerTest.suite() );
+ suite.addTest( org.hibernate.test.bytecode.cglib.InvocationTargetExceptionTest.suite() );
+ suite.addTest( org.hibernate.test.bytecode.cglib.CGLIBThreadLocalTest.suite() );
+ suite.addTest( org.hibernate.test.bytecode.javassist.ReflectionOptimizerTest.suite() );
+ suite.addTest( org.hibernate.test.bytecode.javassist.InvocationTargetExceptionTest.suite() );
+ suite.addTest( CascadeTest.suite() );
+ suite.addTest( FetchingTest.suite() );
+ suite.addTest( JPALockTest.suite() );
+ suite.addTest( RepeatableReadTest.suite() );
+ suite.addTest( JPAProxyTest.suite() );
+ suite.addTest( JPAQLComplianceTest.suite() );
+ suite.addTest( NativeQueryTest.suite() );
+ suite.addTest( RemovedEntityTest.suite() );
suite.addTest( AbstractComponentPropertyRefTest.suite() );
suite.addTest( AbstractCompositeIdTest.suite() );
- suite.addTest( UtilSuite.suite() );
+ suite.addTest( PropertiesHelperTest.suite() );
+ suite.addTest( EntityResolverTest.suite() );
+ suite.addTest( StringHelperTest.suite() );
suite.addTest( AnyTypeTest.suite() );
- suite.addTest( LobSuite.suite() );
+ suite.addTest( SerializableTypeTest.suite() );
+ suite.addTest( BlobTest.suite() );
+ suite.addTest( ClobTest.suite() );
suite.addTest( IdentifierPropertyReferencesTest.suite() );
suite.addTest( DeleteTransientEntityTest.suite() );
- suite.addTest( UserCollectionTypeSuite.suite() );
- suite.addTest( KeyManyToOneSuite.suite() );
- suite.addTest( DialectFunctionalTestsSuite.suite() );
- suite.addTest( DialectUnitTestsSuite.suite() );
+ suite.addTest( UserCollectionTypeTest.suite() );
+ suite.addTest( ParameterizedUserCollectionTypeTest.suite() );
+ suite.addTest( KeyManyToOneTest.suite() );
+ suite.addTest( LazyKeyManyToOneTest.suite() );
+ suite.addTest( EagerKeyManyToOneTest.suite() );
+ suite.addTest( SQLFunctionsInterSystemsTest.suite() );
+ suite.addTest( SybaseLockHintsTest.suite() );
+ suite.addTest( SQLServerLockHintsTest.suite() );
suite.addTest( InsertOrderingTest.suite() );
- suite.addTest( ReattachmentSuite.suite() );
+ suite.addTest( CollectionReattachmentTest.suite() );
+ suite.addTest( ProxyReattachmentTest.suite() );
+ suite.addTest( OptimizerUnitTest.suite() );
+ suite.addTest( SequenceStyleConfigUnitTest.suite() );
+ suite.addTest( BasicForcedTableSequenceTest.suite() );
+ suite.addTest( HiLoForcedTableSequenceTest.suite() );
+ suite.addTest( PooledForcedTableSequenceTest.suite() );
+ suite.addTest( BasicSequenceTest.suite() );
+ suite.addTest( HiLoSequenceTest.suite() );
+ suite.addTest( PooledSequenceTest.suite() );
+ suite.addTest( BasicTableTest.suite() );
+ suite.addTest( HiLoTableTest.suite() );
+ suite.addTest( PooledTableTest.suite() );
return suite;
}
15 years, 6 months
Hibernate SVN: r15287 - in core/branches/Branch_3_3/core/src/main/java/org/hibernate: tuple and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-08 12:42:46 -0400 (Wed, 08 Oct 2008)
New Revision: 15287
Added:
core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/component/ComponentTuplizerFactory.java
core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityTuplizerFactory.java
Modified:
core/branches/Branch_3_3/core/src/main/java/org/hibernate/cfg/Configuration.java
core/branches/Branch_3_3/core/src/main/java/org/hibernate/cfg/Settings.java
core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/EntityModeToTuplizerMapping.java
core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/component/ComponentEntityModeToTuplizerMapping.java
core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityEntityModeToTuplizerMapping.java
core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityTuplizer.java
core/branches/Branch_3_3/core/src/main/java/org/hibernate/util/ReflectHelper.java
Log:
HHH-3517 : default Tuplizer impls
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/cfg/Configuration.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/cfg/Configuration.java 2008-10-08 15:54:11 UTC (rev 15286)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/cfg/Configuration.java 2008-10-08 16:42:46 UTC (rev 15287)
@@ -66,6 +66,7 @@
import org.hibernate.MappingNotFoundException;
import org.hibernate.SessionFactory;
import org.hibernate.SessionFactoryObserver;
+import org.hibernate.tuple.entity.EntityTuplizerFactory;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.function.SQLFunction;
@@ -158,6 +159,10 @@
protected Map sqlFunctions;
protected Map namedQueries;
protected Map namedSqlQueries;
+
+ private EntityTuplizerFactory entityTuplizerFactory;
+// private ComponentTuplizerFactory componentTuplizerFactory; todo : HHH-3517 and HHH-1907
+
/**
* Map<String, SqlResultSetMapping> result set name, result set description
*/
@@ -185,6 +190,17 @@
private SessionFactoryObserver sessionFactoryObserver;
+ private transient Mapping mapping = buildMapping();
+
+ protected Configuration(SettingsFactory settingsFactory) {
+ this.settingsFactory = settingsFactory;
+ reset();
+ }
+
+ public Configuration() {
+ this( new SettingsFactory() );
+ }
+
protected void reset() {
classes = new HashMap();
imports = new HashMap();
@@ -209,21 +225,19 @@
columnNameBindingPerTable = new HashMap();
namingStrategy = DefaultNamingStrategy.INSTANCE;
sqlFunctions = new HashMap();
- }
- private transient Mapping mapping = buildMapping();
-
-
-
- protected Configuration(SettingsFactory settingsFactory) {
- this.settingsFactory = settingsFactory;
- reset();
+ entityTuplizerFactory = new EntityTuplizerFactory();
+// componentTuplizerFactory = new ComponentTuplizerFactory();
}
- public Configuration() {
- this( new SettingsFactory() );
+ public EntityTuplizerFactory getEntityTuplizerFactory() {
+ return entityTuplizerFactory;
}
+// public ComponentTuplizerFactory getComponentTuplizerFactory() {
+// return componentTuplizerFactory;
+// }
+
/**
* Iterate the entity mappings
*
@@ -2094,13 +2108,20 @@
public Settings buildSettings() throws HibernateException {
Properties clone = ( Properties ) properties.clone();
PropertiesHelper.resolvePlaceHolders( clone );
- return settingsFactory.buildSettings( clone );
+ return buildSettingsInternal( clone );
}
public Settings buildSettings(Properties props) throws HibernateException {
- return settingsFactory.buildSettings( props );
+ return buildSettingsInternal( props );
}
+ private Settings buildSettingsInternal(Properties props) {
+ final Settings settings = settingsFactory.buildSettings( props );
+ settings.setEntityTuplizerFactory( this.getEntityTuplizerFactory() );
+// settings.setComponentTuplizerFactory( this.getComponentTuplizerFactory() );
+ return settings;
+ }
+
public Map getNamedSQLQueries() {
return namedSqlQueries;
}
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/cfg/Settings.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/cfg/Settings.java 2008-10-08 15:54:11 UTC (rev 15286)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/cfg/Settings.java 2008-10-08 16:42:46 UTC (rev 15287)
@@ -28,6 +28,7 @@
import org.hibernate.ConnectionReleaseMode;
import org.hibernate.EntityMode;
+import org.hibernate.tuple.entity.EntityTuplizerFactory;
import org.hibernate.cache.QueryCacheFactory;
import org.hibernate.cache.RegionFactory;
import org.hibernate.connection.ConnectionProvider;
@@ -92,6 +93,8 @@
private boolean dataDefinitionInTransactionSupported;
private boolean strictJPAQLCompliance;
private boolean namedQueryStartupCheckingEnabled;
+ private EntityTuplizerFactory entityTuplizerFactory;
+// private ComponentTuplizerFactory componentTuplizerFactory; todo : HHH-3517 and HHH-1907
// private BytecodeProvider bytecodeProvider;
/**
@@ -286,9 +289,17 @@
return namedQueryStartupCheckingEnabled;
}
+ public EntityTuplizerFactory getEntityTuplizerFactory() {
+ return entityTuplizerFactory;
+ }
- // package protected setters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// public ComponentTuplizerFactory getComponentTuplizerFactory() {
+// return componentTuplizerFactory;
+// }
+
+// package protected setters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
// void setShowSqlEnabled(boolean b) {
// showSql = b;
// }
@@ -473,7 +484,15 @@
this.namedQueryStartupCheckingEnabled = namedQueryStartupCheckingEnabled;
}
+ void setEntityTuplizerFactory(EntityTuplizerFactory entityTuplizerFactory) {
+ this.entityTuplizerFactory = entityTuplizerFactory;
+ }
+// void setComponentTuplizerFactory(ComponentTuplizerFactory componentTuplizerFactory) {
+// this.componentTuplizerFactory = componentTuplizerFactory;
+// }
+
+
// public BytecodeProvider getBytecodeProvider() {
// return bytecodeProvider;
// }
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/EntityModeToTuplizerMapping.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/EntityModeToTuplizerMapping.java 2008-10-08 15:54:11 UTC (rev 15286)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/EntityModeToTuplizerMapping.java 2008-10-08 16:42:46 UTC (rev 15287)
@@ -55,6 +55,15 @@
}
/**
+ * Allow iteration over all defined {@link Tuplizer Tuplizers}.
+ *
+ * @return Iterator over defined tuplizers
+ */
+ public Iterator iterateTuplizers() {
+ return tuplizers.values().iterator();
+ }
+
+ /**
* Given a supposed instance of an entity/component, guess its entity mode.
*
* @param object The supposed instance of the entity/component.
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/component/ComponentEntityModeToTuplizerMapping.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/component/ComponentEntityModeToTuplizerMapping.java 2008-10-08 15:54:11 UTC (rev 15286)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/component/ComponentEntityModeToTuplizerMapping.java 2008-10-08 16:42:46 UTC (rev 15287)
@@ -29,8 +29,6 @@
import org.hibernate.mapping.Component;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.EntityMode;
-import org.hibernate.HibernateException;
-import org.hibernate.util.ReflectHelper;
import java.util.Map;
import java.util.HashMap;
@@ -47,7 +45,8 @@
*/
class ComponentEntityModeToTuplizerMapping extends EntityModeToTuplizerMapping implements Serializable {
- private static final Class[] COMPONENT_TUP_CTOR_SIG = new Class[] { Component.class };
+ // todo : move this to SF per HHH-3517; also see HHH-1907 and ComponentMetamodel
+ private ComponentTuplizerFactory componentTuplizerFactory = new ComponentTuplizerFactory();
public ComponentEntityModeToTuplizerMapping(Component component) {
PersistentClass owner = component.getOwner();
@@ -59,24 +58,24 @@
}
// Build the dynamic-map tuplizer...
- Tuplizer dynamicMapTuplizer = null;
- String tuplizerImpl = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.MAP );
- if ( tuplizerImpl == null ) {
- dynamicMapTuplizer = new DynamicMapComponentTuplizer( component );
+ Tuplizer dynamicMapTuplizer;
+ String tuplizerClassName = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.MAP );
+ if ( tuplizerClassName == null ) {
+ dynamicMapTuplizer = componentTuplizerFactory.constructDefaultTuplizer( EntityMode.MAP, component );
}
else {
- dynamicMapTuplizer = buildComponentTuplizer( tuplizerImpl, component );
+ dynamicMapTuplizer = componentTuplizerFactory.constructTuplizer( tuplizerClassName, component );
}
// then the pojo tuplizer, using the dynamic-map tuplizer if no pojo representation is available
- tuplizerImpl = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.POJO );
- Tuplizer pojoTuplizer = null;
+ tuplizerClassName = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.POJO );
+ Tuplizer pojoTuplizer;
if ( owner.hasPojoRepresentation() && component.hasPojoRepresentation() ) {
- if ( tuplizerImpl == null ) {
- pojoTuplizer = new PojoComponentTuplizer( component );
+ if ( tuplizerClassName == null ) {
+ pojoTuplizer = componentTuplizerFactory.constructDefaultTuplizer( EntityMode.POJO, component );
}
else {
- pojoTuplizer = buildComponentTuplizer( tuplizerImpl, component );
+ pojoTuplizer = componentTuplizerFactory.constructTuplizer( tuplizerClassName, component );
}
}
else {
@@ -84,14 +83,14 @@
}
// then dom4j tuplizer, if dom4j representation is available
- Tuplizer dom4jTuplizer = null;
- tuplizerImpl = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.DOM4J );
+ Tuplizer dom4jTuplizer;
+ tuplizerClassName = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.DOM4J );
if ( owner.hasDom4jRepresentation() ) {
- if ( tuplizerImpl == null ) {
- dom4jTuplizer = new Dom4jComponentTuplizer( component );
+ if ( tuplizerClassName == null ) {
+ dom4jTuplizer = componentTuplizerFactory.constructDefaultTuplizer( EntityMode.DOM4J, component );
}
else {
- dom4jTuplizer = buildComponentTuplizer( tuplizerImpl, component );
+ dom4jTuplizer = componentTuplizerFactory.constructTuplizer( tuplizerClassName, component );
}
}
else {
@@ -113,21 +112,12 @@
if ( !userSuppliedTuplizerImpls.isEmpty() ) {
Iterator itr = userSuppliedTuplizerImpls.entrySet().iterator();
while ( itr.hasNext() ) {
- Map.Entry entry = ( Map.Entry ) itr.next();
- EntityMode entityMode = ( EntityMode ) entry.getKey();
- ComponentTuplizer tuplizer = buildComponentTuplizer( ( String ) entry.getValue(), component );
+ final Map.Entry entry = ( Map.Entry ) itr.next();
+ final EntityMode entityMode = ( EntityMode ) entry.getKey();
+ final String userTuplizerClassName = ( String ) entry.getValue();
+ ComponentTuplizer tuplizer = componentTuplizerFactory.constructTuplizer( userTuplizerClassName, component );
addTuplizer( entityMode, tuplizer );
}
}
}
-
- private ComponentTuplizer buildComponentTuplizer(String tuplizerImpl, Component component) {
- try {
- Class implClass = ReflectHelper.classForName( tuplizerImpl );
- return ( ComponentTuplizer ) implClass.getConstructor( COMPONENT_TUP_CTOR_SIG ).newInstance( new Object[] { component } );
- }
- catch( Throwable t ) {
- throw new HibernateException( "Could not build tuplizer [" + tuplizerImpl + "]", t );
- }
- }
}
Added: core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/component/ComponentTuplizerFactory.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/component/ComponentTuplizerFactory.java (rev 0)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/component/ComponentTuplizerFactory.java 2008-10-08 16:42:46 UTC (rev 15287)
@@ -0,0 +1,160 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.tuple.component;
+
+import java.util.Map;
+import java.lang.reflect.Constructor;
+import java.io.Serializable;
+
+import org.hibernate.util.FastHashMap;
+import org.hibernate.util.ReflectHelper;
+import org.hibernate.EntityMode;
+import org.hibernate.HibernateException;
+import org.hibernate.mapping.Component;
+
+/**
+ * A registry allowing users to define the default {@link ComponentTuplizer} class to use per {@link EntityMode}.
+ *
+ * @author Steve Ebersole
+ */
+public class ComponentTuplizerFactory implements Serializable {
+
+ private static final Class[] COMPONENT_TUP_CTOR_SIG = new Class[] { Component.class };
+
+ private Map defaultImplClassByMode = buildBaseMapping();
+
+ /**
+ * Method allowing registration of the tuplizer class to use as default for a particular entity-mode.
+ *
+ * @param entityMode The entity-mode for which to register the tuplizer class
+ * @param tuplizerClass The class to use as the default tuplizer for the given entity-mode.
+ */
+ public void registerDefaultTuplizerClass(EntityMode entityMode, Class tuplizerClass) {
+ assert isComponentTuplizerImplementor( tuplizerClass )
+ : "Specified tuplizer class [" + tuplizerClass.getName() + "] does not implement " + ComponentTuplizer.class.getName();
+ assert hasProperConstructor( tuplizerClass )
+ : "Specified tuplizer class [" + tuplizerClass.getName() + "] is not properly instantiatable";
+
+ defaultImplClassByMode.put( entityMode, tuplizerClass );
+ }
+
+ /**
+ * Construct an instance of the given tuplizer class.
+ *
+ * @param tuplizerClassName The name of the tuplizer class to instantiate
+ * @param metadata The metadata for the component.
+ *
+ * @return The instantiated tuplizer
+ *
+ * @throws HibernateException If class name cannot be resolved to a class reference, or if the
+ * {@link Constructor#newInstance} call fails.
+ */
+ public ComponentTuplizer constructTuplizer(String tuplizerClassName, Component metadata) {
+ try {
+ Class tuplizerClass = ReflectHelper.classForName( tuplizerClassName );
+ return constructTuplizer( tuplizerClass, metadata );
+ }
+ catch ( ClassNotFoundException e ) {
+ throw new HibernateException( "Could not locate specified tuplizer class [" + tuplizerClassName + "]" );
+ }
+ }
+
+ /**
+ * Construct an instance of the given tuplizer class.
+ *
+ * @param tuplizerClass The tuplizer class to instantiate
+ * @param metadata The metadata for the component.
+ *
+ * @return The instantiated tuplizer
+ *
+ * @throws HibernateException if the {@link java.lang.reflect.Constructor#newInstance} call fails.
+ */
+ public ComponentTuplizer constructTuplizer(Class tuplizerClass, Component metadata) {
+ Constructor ctor = getProperConstructor( tuplizerClass );
+ assert ctor != null : "Unable to locate proper constructor for tuplizer [" + tuplizerClass.getName() + "]";
+ try {
+ return ( ComponentTuplizer ) ctor.newInstance( new Object[] { metadata } );
+ }
+ catch ( Throwable t ) {
+ throw new HibernateException( "Unable to instantiate default tuplizer [" + tuplizerClass.getName() + "]", t );
+ }
+ }
+
+ /**
+ * Construct am instance of the default tuplizer for the given entity-mode.
+ *
+ * @param entityMode The entity mode for which to build a default tuplizer.
+ * @param metadata The metadata for the component.
+ *
+ * @return The instantiated tuplizer
+ *
+ * @throws HibernateException If no default tuplizer found for that entity-mode; may be re-thrown from
+ * {@link #constructTuplizer} too.
+ */
+ public ComponentTuplizer constructDefaultTuplizer(EntityMode entityMode, Component metadata) {
+ Class tuplizerClass = ( Class ) defaultImplClassByMode.get( entityMode );
+ if ( tuplizerClass == null ) {
+ throw new HibernateException( "could not determine default tuplizer class to use [" + entityMode + "]" );
+ }
+
+ return constructTuplizer( tuplizerClass, metadata );
+ }
+
+ private boolean isComponentTuplizerImplementor(Class tuplizerClass) {
+ return ReflectHelper.implementsInterface( tuplizerClass, ComponentTuplizer.class );
+ }
+
+ private boolean hasProperConstructor(Class tuplizerClass) {
+ return getProperConstructor( tuplizerClass ) != null;
+ }
+
+ private Constructor getProperConstructor(Class clazz) {
+ Constructor ctor = null;
+ try {
+ ctor = clazz.getDeclaredConstructor( COMPONENT_TUP_CTOR_SIG );
+ if ( ! ReflectHelper.isPublic( ctor ) ) {
+ try {
+ // found a ctor, but it was not publicly accessible so try to request accessibility
+ ctor.setAccessible( true );
+ }
+ catch ( SecurityException e ) {
+ ctor = null;
+ }
+ }
+ }
+ catch ( NoSuchMethodException ignore ) {
+ }
+
+ return ctor;
+ }
+
+ private static Map buildBaseMapping() {
+ Map map = new FastHashMap();
+ map.put( EntityMode.POJO, PojoComponentTuplizer.class );
+ map.put( EntityMode.DOM4J, Dom4jComponentTuplizer.class );
+ map.put( EntityMode.MAP, DynamicMapComponentTuplizer.class );
+ return map;
+ }
+}
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityEntityModeToTuplizerMapping.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityEntityModeToTuplizerMapping.java 2008-10-08 15:54:11 UTC (rev 15286)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityEntityModeToTuplizerMapping.java 2008-10-08 16:42:46 UTC (rev 15287)
@@ -28,8 +28,6 @@
import org.hibernate.tuple.Tuplizer;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.EntityMode;
-import org.hibernate.HibernateException;
-import org.hibernate.util.ReflectHelper;
import java.util.Iterator;
import java.util.Map;
@@ -46,8 +44,6 @@
*/
public class EntityEntityModeToTuplizerMapping extends EntityModeToTuplizerMapping implements Serializable {
- private static final Class[] ENTITY_TUP_CTOR_SIG = new Class[] { EntityMetamodel.class, PersistentClass.class };
-
/**
* Instantiates a EntityEntityModeToTuplizerMapping based on the given
* entity mapping and metamodel definitions.
@@ -56,6 +52,10 @@
* @param em The entity metamodel definition.
*/
public EntityEntityModeToTuplizerMapping(PersistentClass mappedEntity, EntityMetamodel em) {
+ final EntityTuplizerFactory entityTuplizerFactory = em.getSessionFactory()
+ .getSettings()
+ .getEntityTuplizerFactory();
+
// create our own copy of the user-supplied tuplizer impl map
Map userSuppliedTuplizerImpls = new HashMap();
if ( mappedEntity.getTuplizerMap() != null ) {
@@ -63,24 +63,24 @@
}
// Build the dynamic-map tuplizer...
- Tuplizer dynamicMapTuplizer = null;
- String tuplizerImpl = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.MAP );
- if ( tuplizerImpl == null ) {
- dynamicMapTuplizer = new DynamicMapEntityTuplizer( em, mappedEntity );
+ Tuplizer dynamicMapTuplizer;
+ String tuplizerImplClassName = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.MAP );
+ if ( tuplizerImplClassName == null ) {
+ dynamicMapTuplizer = entityTuplizerFactory.constructDefaultTuplizer( EntityMode.MAP, em, mappedEntity );
}
else {
- dynamicMapTuplizer = buildEntityTuplizer( tuplizerImpl, mappedEntity, em );
+ dynamicMapTuplizer = entityTuplizerFactory.constructTuplizer( tuplizerImplClassName, em, mappedEntity );
}
// then the pojo tuplizer, using the dynamic-map tuplizer if no pojo representation is available
- Tuplizer pojoTuplizer = null;
- tuplizerImpl = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.POJO );
+ Tuplizer pojoTuplizer;
+ tuplizerImplClassName = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.POJO );
if ( mappedEntity.hasPojoRepresentation() ) {
- if ( tuplizerImpl == null ) {
- pojoTuplizer = new PojoEntityTuplizer( em, mappedEntity );
+ if ( tuplizerImplClassName == null ) {
+ pojoTuplizer = entityTuplizerFactory.constructDefaultTuplizer( EntityMode.POJO, em, mappedEntity );
}
else {
- pojoTuplizer = buildEntityTuplizer( tuplizerImpl, mappedEntity, em );
+ pojoTuplizer = entityTuplizerFactory.constructTuplizer( tuplizerImplClassName, em, mappedEntity );
}
}
else {
@@ -88,14 +88,14 @@
}
// then dom4j tuplizer, if dom4j representation is available
- Tuplizer dom4jTuplizer = null;
- tuplizerImpl = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.DOM4J );
+ Tuplizer dom4jTuplizer;
+ tuplizerImplClassName = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.DOM4J );
if ( mappedEntity.hasDom4jRepresentation() ) {
- if ( tuplizerImpl == null ) {
- dom4jTuplizer = new Dom4jEntityTuplizer( em, mappedEntity );
+ if ( tuplizerImplClassName == null ) {
+ dom4jTuplizer = entityTuplizerFactory.constructDefaultTuplizer( EntityMode.DOM4J, em, mappedEntity );
}
else {
- dom4jTuplizer = buildEntityTuplizer( tuplizerImpl, mappedEntity, em );
+ dom4jTuplizer = entityTuplizerFactory.constructTuplizer( tuplizerImplClassName, em, mappedEntity );
}
}
else {
@@ -117,21 +117,12 @@
if ( !userSuppliedTuplizerImpls.isEmpty() ) {
Iterator itr = userSuppliedTuplizerImpls.entrySet().iterator();
while ( itr.hasNext() ) {
- Map.Entry entry = ( Map.Entry ) itr.next();
- EntityMode entityMode = ( EntityMode ) entry.getKey();
- EntityTuplizer tuplizer = buildEntityTuplizer( ( String ) entry.getValue(), mappedEntity, em );
+ final Map.Entry entry = ( Map.Entry ) itr.next();
+ final EntityMode entityMode = ( EntityMode ) entry.getKey();
+ final String tuplizerClassName = ( String ) entry.getValue();
+ final EntityTuplizer tuplizer = entityTuplizerFactory.constructTuplizer( tuplizerClassName, em, mappedEntity );
addTuplizer( entityMode, tuplizer );
}
}
}
-
- private static EntityTuplizer buildEntityTuplizer(String className, PersistentClass pc, EntityMetamodel em) {
- try {
- Class implClass = ReflectHelper.classForName( className );
- return ( EntityTuplizer ) implClass.getConstructor( ENTITY_TUP_CTOR_SIG ).newInstance( new Object[] { em, pc } );
- }
- catch( Throwable t ) {
- throw new HibernateException( "Could not build tuplizer [" + className + "]", t );
- }
- }
}
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityTuplizer.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityTuplizer.java 2008-10-08 15:54:11 UTC (rev 15286)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityTuplizer.java 2008-10-08 16:42:46 UTC (rev 15287)
@@ -238,4 +238,4 @@
* @throws HibernateException If we are unable to determine an entity-name within the inheritence hierarchy.
*/
public String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory);
-}
+}
\ No newline at end of file
Added: core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityTuplizerFactory.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityTuplizerFactory.java (rev 0)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/tuple/entity/EntityTuplizerFactory.java 2008-10-08 16:42:46 UTC (rev 15287)
@@ -0,0 +1,173 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
+package org.hibernate.tuple.entity;
+
+import java.util.Map;
+import java.lang.reflect.Constructor;
+import java.io.Serializable;
+
+
+import org.hibernate.util.FastHashMap;
+import org.hibernate.util.ReflectHelper;
+import org.hibernate.EntityMode;
+import org.hibernate.HibernateException;
+import org.hibernate.mapping.PersistentClass;
+
+/**
+ * A registry allowing users to define the default {@link EntityTuplizer} class to use per {@link EntityMode}.
+ *
+ * @author Steve Ebersole
+ */
+public class EntityTuplizerFactory implements Serializable {
+
+ public static final Class[] ENTITY_TUP_CTOR_SIG = new Class[] { EntityMetamodel.class, PersistentClass.class };
+
+ private Map defaultImplClassByMode = buildBaseMapping();
+
+ /**
+ * Method allowing registration of the tuplizer class to use as default for a particular entity-mode.
+ *
+ * @param entityMode The entity-mode for which to register the tuplizer class
+ * @param tuplizerClass The class to use as the default tuplizer for the given entity-mode.
+ */
+ public void registerDefaultTuplizerClass(EntityMode entityMode, Class tuplizerClass) {
+ assert isEntityTuplizerImplementor( tuplizerClass )
+ : "Specified tuplizer class [" + tuplizerClass.getName() + "] does not implement " + EntityTuplizer.class.getName();
+ assert hasProperConstructor( tuplizerClass )
+ : "Specified tuplizer class [" + tuplizerClass.getName() + "] is not properly instantiatable";
+
+ defaultImplClassByMode.put( entityMode, tuplizerClass );
+ }
+
+ /**
+ * Construct an instance of the given tuplizer class.
+ *
+ * @param tuplizerClassName The name of the tuplizer class to instantiate
+ * @param metamodel The metadata for the entity.
+ * @param persistentClass The mapping info for the entity.
+ *
+ * @return The instantiated tuplizer
+ *
+ * @throws HibernateException If class name cannot be resolved to a class reference, or if the
+ * {@link Constructor#newInstance} call fails.
+ */
+ public EntityTuplizer constructTuplizer(
+ String tuplizerClassName,
+ EntityMetamodel metamodel,
+ PersistentClass persistentClass) {
+ try {
+ Class tuplizerClass = ReflectHelper.classForName( tuplizerClassName );
+ return constructTuplizer( tuplizerClass, metamodel, persistentClass );
+ }
+ catch ( ClassNotFoundException e ) {
+ throw new HibernateException( "Could not locate specified tuplizer class [" + tuplizerClassName + "]" );
+ }
+ }
+
+ /**
+ * Construct an instance of the given tuplizer class.
+ *
+ * @param tuplizerClass The tuplizer class to instantiate
+ * @param metamodel The metadata for the entity.
+ * @param persistentClass The mapping info for the entity.
+ *
+ * @return The instantiated tuplizer
+ *
+ * @throws HibernateException if the {@link Constructor#newInstance} call fails.
+ */
+ public EntityTuplizer constructTuplizer(
+ Class tuplizerClass,
+ EntityMetamodel metamodel,
+ PersistentClass persistentClass) {
+ Constructor ctor = getProperConstructor( tuplizerClass );
+ assert ctor != null : "Unable to locate proper constructor for tuplizer [" + tuplizerClass.getName() + "]";
+ try {
+ return ( EntityTuplizer ) ctor.newInstance( new Object[] { metamodel, persistentClass } );
+ }
+ catch ( Throwable t ) {
+ throw new HibernateException( "Unable to instantiate default tuplizer [" + tuplizerClass.getName() + "]", t );
+ }
+ }
+
+ /**
+ * Construct am instance of the default tuplizer for the given entity-mode.
+ *
+ * @param entityMode The entity mode for which to build a default tuplizer.
+ * @param metamodel The entity metadata.
+ * @param persistentClass The entity mapping info.
+ *
+ * @return The instantiated tuplizer
+ *
+ * @throws HibernateException If no default tuplizer found for that entity-mode; may be re-thrown from
+ * {@link #constructTuplizer} too.
+ */
+ public EntityTuplizer constructDefaultTuplizer(
+ EntityMode entityMode,
+ EntityMetamodel metamodel,
+ PersistentClass persistentClass) {
+ Class tuplizerClass = ( Class ) defaultImplClassByMode.get( entityMode );
+ if ( tuplizerClass == null ) {
+ throw new HibernateException( "could not determine default tuplizer class to use [" + entityMode + "]" );
+ }
+
+ return constructTuplizer( tuplizerClass, metamodel, persistentClass );
+ }
+
+ private boolean isEntityTuplizerImplementor(Class tuplizerClass) {
+ return ReflectHelper.implementsInterface( tuplizerClass, EntityTuplizer.class );
+ }
+
+ private boolean hasProperConstructor(Class tuplizerClass) {
+ return getProperConstructor( tuplizerClass ) != null;
+ }
+
+ private Constructor getProperConstructor(Class clazz) {
+ Constructor ctor = null;
+ try {
+ ctor = clazz.getDeclaredConstructor( ENTITY_TUP_CTOR_SIG );
+ if ( ! ReflectHelper.isPublic( ctor ) ) {
+ try {
+ // found a ctor, but it was not publicly accessible so try to request accessibility
+ ctor.setAccessible( true );
+ }
+ catch ( SecurityException e ) {
+ ctor = null;
+ }
+ }
+ }
+ catch ( NoSuchMethodException ignore ) {
+ }
+
+ return ctor;
+ }
+
+ private static Map buildBaseMapping() {
+ Map map = new FastHashMap();
+ map.put( EntityMode.POJO, PojoEntityTuplizer.class );
+ map.put( EntityMode.DOM4J, Dom4jEntityTuplizer.class );
+ map.put( EntityMode.MAP, DynamicMapEntityTuplizer.class );
+ return map;
+ }
+}
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/util/ReflectHelper.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/util/ReflectHelper.java 2008-10-08 15:54:11 UTC (rev 15286)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/util/ReflectHelper.java 2008-10-08 16:42:46 UTC (rev 15287)
@@ -39,78 +39,154 @@
import org.hibernate.type.PrimitiveType;
import org.hibernate.type.Type;
-
+/**
+ * Utility class for various reflection operations.
+ *
+ * @author Gavin King
+ * @author Steve Ebersole
+ */
public final class ReflectHelper {
//TODO: this dependency is kinda Bad
private static final PropertyAccessor BASIC_PROPERTY_ACCESSOR = new BasicPropertyAccessor();
private static final PropertyAccessor DIRECT_PROPERTY_ACCESSOR = new DirectPropertyAccessor();
- private static final Class[] NO_CLASSES = new Class[0];
- private static final Class[] OBJECT = new Class[] { Object.class };
+ public static final Class[] NO_PARAM_SIGNATURE = new Class[0];
+ public static final Object[] NO_PARAMS = new Object[0];
+
+ public static final Class[] SINGLE_OBJECT_PARAM_SIGNATURE = new Class[] { Object.class };
+
private static final Method OBJECT_EQUALS;
- private static final Class[] NO_PARAM = new Class[] { };
+ private static final Method OBJECT_HASHCODE;
- private static final Method OBJECT_HASHCODE;
static {
Method eq;
Method hash;
try {
- eq = Object.class.getMethod("equals", OBJECT);
- hash = Object.class.getMethod("hashCode", NO_PARAM);
+ eq = extractEqualsMethod( Object.class );
+ hash = extractHashCodeMethod( Object.class );
}
- catch (Exception e) {
- throw new AssertionFailure("Could not find Object.equals() or Object.hashCode()", e);
+ catch ( Exception e ) {
+ throw new AssertionFailure( "Could not find Object.equals() or Object.hashCode()", e );
}
OBJECT_EQUALS = eq;
OBJECT_HASHCODE = hash;
}
+ /**
+ * Disallow instantiation of ReflectHelper.
+ */
+ private ReflectHelper() {
+ }
+
+ /**
+ * Encapsulation of getting hold of a class's {@link Object#equals equals} method.
+ *
+ * @param clazz The class from which to extract the equals method.
+ * @return The equals method reference
+ * @throws NoSuchMethodException Should indicate an attempt to extract equals method from interface.
+ */
+ public static Method extractEqualsMethod(Class clazz) throws NoSuchMethodException {
+ return clazz.getMethod( "equals", SINGLE_OBJECT_PARAM_SIGNATURE );
+ }
+
+ /**
+ * Encapsulation of getting hold of a class's {@link Object#hashCode hashCode} method.
+ *
+ * @param clazz The class from which to extract the hashCode method.
+ * @return The hashCode method reference
+ * @throws NoSuchMethodException Should indicate an attempt to extract hashCode method from interface.
+ */
+ public static Method extractHashCodeMethod(Class clazz) throws NoSuchMethodException {
+ return clazz.getMethod( "hashCode", NO_PARAM_SIGNATURE );
+ }
+
+ /**
+ * Determine if the given class defines an {@link Object#equals} override.
+ *
+ * @param clazz The class to check
+ * @return True if clazz defines an equals override.
+ */
public static boolean overridesEquals(Class clazz) {
Method equals;
try {
- equals = clazz.getMethod("equals", OBJECT);
+ equals = extractEqualsMethod( clazz );
}
- catch (NoSuchMethodException nsme) {
+ catch ( NoSuchMethodException nsme ) {
return false; //its an interface so we can't really tell anything...
}
- return !OBJECT_EQUALS.equals(equals);
+ return !OBJECT_EQUALS.equals( equals );
}
+ /**
+ * Determine if the given class defines a {@link Object#hashCode} override.
+ *
+ * @param clazz The class to check
+ * @return True if clazz defines an hashCode override.
+ */
public static boolean overridesHashCode(Class clazz) {
Method hashCode;
try {
- hashCode = clazz.getMethod("hashCode", NO_PARAM);
+ hashCode = extractHashCodeMethod( clazz );
}
- catch (NoSuchMethodException nsme) {
+ catch ( NoSuchMethodException nsme ) {
return false; //its an interface so we can't really tell anything...
}
- return !OBJECT_HASHCODE.equals(hashCode);
+ return !OBJECT_HASHCODE.equals( hashCode );
}
- public static Class reflectedPropertyClass(String className, String name) throws MappingException {
- try {
- Class clazz = ReflectHelper.classForName(className);
- return getter(clazz, name).getReturnType();
+ /**
+ * Determine if the given class implements the given interface.
+ *
+ * @param clazz The class to check
+ * @param intf The interface to check it against.
+ * @return True if the class does implement the interface, false otherwise.
+ */
+ public static boolean implementsInterface(Class clazz, Class intf) {
+ assert intf.isInterface() : "Interface to check was not an interface";
+
+ Class[] interfaces = clazz.getInterfaces();
+ for ( int i = 0; i < interfaces.length; i++ ) {
+ if ( intf.isAssignableFrom( interfaces[i] ) ) {
+ return true;
+ }
}
- catch (ClassNotFoundException cnfe) {
- throw new MappingException("class " + className + " not found while looking for property: " + name, cnfe);
- }
+ return false;
}
- private static Getter getter(Class clazz, String name) throws MappingException {
+ /**
+ * Perform resolution of a class name.
+ * <p/>
+ * Here we first check the context classloader, if one, before delegating to
+ * {@link Class#forName(String, boolean, ClassLoader)} using the caller's classloader
+ *
+ * @param name The class name
+ * @param caller The class from which this call originated (in order to access that class's loader).
+ * @return The class reference.
+ * @throws ClassNotFoundException From {@link Class#forName(String, boolean, ClassLoader)}.
+ */
+ public static Class classForName(String name, Class caller) throws ClassNotFoundException {
try {
- return BASIC_PROPERTY_ACCESSOR.getGetter(clazz, name);
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ if ( contextClassLoader != null ) {
+ return contextClassLoader.loadClass( name );
+ }
}
- catch (PropertyNotFoundException pnfe) {
- return DIRECT_PROPERTY_ACCESSOR.getGetter(clazz, name);
+ catch ( Throwable ignore ) {
}
+ return Class.forName( name, true, caller.getClassLoader() );
}
- public static Getter getGetter(Class theClass, String name) throws MappingException {
- return BASIC_PROPERTY_ACCESSOR.getGetter(theClass, name);
- }
-
+ /**
+ * Perform resolution of a class name.
+ * <p/>
+ * Same as {@link #classForName(String, Class)} except that here we delegate to
+ * {@link Class#forName(String)} if the context classloader lookup is unsuccessful.
+ *
+ * @param name The class name
+ * @return The class reference.
+ * @throws ClassNotFoundException From {@link Class#forName(String)}.
+ */
public static Class classForName(String name) throws ClassNotFoundException {
try {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
@@ -118,27 +194,79 @@
return contextClassLoader.loadClass(name);
}
}
- catch ( Throwable t ) {
+ catch ( Throwable ignore ) {
}
return Class.forName( name );
}
- public static Class classForName(String name, Class caller) throws ClassNotFoundException {
+ /**
+ * Is this member publicly accessible.
+ * <p/>
+ * Short-hand for {@link #isPublic(Class, Member)} passing the member + {@link Member#getDeclaringClass()}
+ *
+ * @param member The member to check
+ * @return True if the member is publicly accessible.
+ */
+ public static boolean isPublic(Member member) {
+ return isPublic( member.getDeclaringClass(), member );
+ }
+
+ /**
+ * Is this member publicly accessible.
+ *
+ * @param clazz The class which defines the member
+ * @param member The memeber.
+ * @return True if the member is publicly accessible, false otherwise.
+ */
+ public static boolean isPublic(Class clazz, Member member) {
+ return Modifier.isPublic( member.getModifiers() ) && Modifier.isPublic( clazz.getModifiers() );
+ }
+
+ /**
+ * Attempt to resolve the specified property type through reflection.
+ *
+ * @param className The name of the class owning the property.
+ * @param name The name of the property.
+ * @return The type of the property.
+ * @throws MappingException Indicates we were unable to locate the property.
+ */
+ public static Class reflectedPropertyClass(String className, String name) throws MappingException {
try {
- ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- if ( contextClassLoader != null ) {
- return contextClassLoader.loadClass( name );
- }
+ Class clazz = ReflectHelper.classForName( className );
+ return getter( clazz, name ).getReturnType();
}
- catch ( Throwable e ) {
+ catch ( ClassNotFoundException cnfe ) {
+ throw new MappingException( "class " + className + " not found while looking for property: " + name, cnfe );
}
- return Class.forName( name, true, caller.getClassLoader() );
}
- public static boolean isPublic(Class clazz, Member member) {
- return Modifier.isPublic( member.getModifiers() ) && Modifier.isPublic( clazz.getModifiers() );
+ private static Getter getter(Class clazz, String name) throws MappingException {
+ try {
+ return BASIC_PROPERTY_ACCESSOR.getGetter( clazz, name );
+ }
+ catch ( PropertyNotFoundException pnfe ) {
+ return DIRECT_PROPERTY_ACCESSOR.getGetter( clazz, name );
+ }
}
+ /**
+ * Directly retrieve the {@link Getter} reference via the {@link BasicPropertyAccessor}.
+ *
+ * @param theClass The class owning the property
+ * @param name The name of the property
+ * @return The getter.
+ * @throws MappingException Indicates we were unable to locate the property.
+ */
+ public static Getter getGetter(Class theClass, String name) throws MappingException {
+ return BASIC_PROPERTY_ACCESSOR.getGetter( theClass, name );
+ }
+
+ /**
+ * Resolve a constant to its actual value.
+ *
+ * @param name The name
+ * @return The value
+ */
public static Object getConstantValue(String name) {
Class clazz;
try {
@@ -148,61 +276,90 @@
return null;
}
try {
- return clazz.getField( StringHelper.unqualify( name ) ).get(null);
+ return clazz.getField( StringHelper.unqualify( name ) ).get( null );
}
catch ( Throwable t ) {
return null;
}
}
+ /**
+ * Retrieve the default (no arg) constructor from the given class.
+ *
+ * @param clazz The class for which to retrieve the default ctor.
+ * @return The default constructor.
+ * @throws PropertyNotFoundException Indicates there was not publicly accessible, no-arg constructor (todo : why PropertyNotFoundException???)
+ */
public static Constructor getDefaultConstructor(Class clazz) throws PropertyNotFoundException {
+ if ( isAbstractClass( clazz ) ) {
+ return null;
+ }
- if ( isAbstractClass(clazz) ) return null;
-
try {
- Constructor constructor = clazz.getDeclaredConstructor(NO_CLASSES);
- if ( !isPublic(clazz, constructor) ) {
- constructor.setAccessible(true);
+ Constructor constructor = clazz.getDeclaredConstructor( NO_PARAM_SIGNATURE );
+ if ( !isPublic( clazz, constructor ) ) {
+ constructor.setAccessible( true );
}
return constructor;
}
- catch (NoSuchMethodException nme) {
+ catch ( NoSuchMethodException nme ) {
throw new PropertyNotFoundException(
- "Object class " + clazz.getName() +
- " must declare a default (no-argument) constructor"
+ "Object class [" + clazz.getName() + "] must declare a default (no-argument) constructor"
);
}
-
}
+ /**
+ * Determine if the given class is declared abstract.
+ *
+ * @param clazz The class to check.
+ * @return True if the class is abstract, false otherwise.
+ */
public static boolean isAbstractClass(Class clazz) {
int modifier = clazz.getModifiers();
return Modifier.isAbstract(modifier) || Modifier.isInterface(modifier);
}
-
+
+ /**
+ * Determine is the given class is declared final.
+ *
+ * @param clazz The class to check.
+ * @return True if the class is final, flase otherwise.
+ */
public static boolean isFinalClass(Class clazz) {
return Modifier.isFinal( clazz.getModifiers() );
}
+ /**
+ * Retrieve a constructor for the given class, with arguments matching the specified Hibernate mapping
+ * {@link Type types}.
+ *
+ * @param clazz The class needing instantiation
+ * @param types The types representing the required ctor param signature
+ * @return The matching constructor.
+ * @throws PropertyNotFoundException Indicates we could not locate an appropriate constructor (todo : again with PropertyNotFoundException???)
+ */
public static Constructor getConstructor(Class clazz, Type[] types) throws PropertyNotFoundException {
final Constructor[] candidates = clazz.getConstructors();
- for ( int i=0; i<candidates.length; i++ ) {
+ for ( int i = 0; i < candidates.length; i++ ) {
final Constructor constructor = candidates[i];
final Class[] params = constructor.getParameterTypes();
- if ( params.length==types.length ) {
+ if ( params.length == types.length ) {
boolean found = true;
- for ( int j=0; j<params.length; j++ ) {
+ for ( int j = 0; j < params.length; j++ ) {
final boolean ok = params[j].isAssignableFrom( types[j].getReturnedClass() ) || (
- types[j] instanceof PrimitiveType &&
- params[j] == ( (PrimitiveType) types[j] ).getPrimitiveClass()
+ types[j] instanceof PrimitiveType &&
+ params[j] == ( ( PrimitiveType ) types[j] ).getPrimitiveClass()
);
- if (!ok) {
+ if ( !ok ) {
found = false;
break;
}
}
- if (found) {
- if ( !isPublic(clazz, constructor) ) constructor.setAccessible(true);
+ if ( found ) {
+ if ( !isPublic( clazz, constructor ) ) {
+ constructor.setAccessible( true );
+ }
return constructor;
}
}
@@ -219,6 +376,4 @@
}
}
- private ReflectHelper() {}
-
}
15 years, 6 months
Hibernate SVN: r15286 - in core/branches/Branch_3_2/test/org/hibernate/test: cascade and 29 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-08 11:54:11 -0400 (Wed, 08 Oct 2008)
New Revision: 15286
Removed:
core/branches/Branch_3_2/test/org/hibernate/test/bytecode/BytecodeSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/cascade/CascadeSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/collection/CollectionSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/component/ComponentSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/connections/ConnectionsSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/dynamicentity/DynamicEntitySuite.java
core/branches/Branch_3_2/test/org/hibernate/test/entitymode/EntityModeSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/entitymode/map/MapSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/event/collection/CollectionEventSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/generated/GeneratedPropertySuite.java
core/branches/Branch_3_2/test/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/hql/HQLSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/idgen/IdGenSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/join/JoinSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/jpa/JPAComplianceSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/lob/LobSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/naturalid/NaturalIdSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/onetoone/OneToOneSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/ops/OpsSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/orphan/OrphanSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/propertyref/PropertyRefSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/reattachment/ReattachmentSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/sql/NativeSqlSupportSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/sql/check/CheckSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/usercollection/UserCollectionTypeSuite.java
core/branches/Branch_3_2/test/org/hibernate/test/util/UtilSuite.java
Log:
HHH-3518 : remove testsuite Suite aggregators
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/bytecode/BytecodeSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/bytecode/BytecodeSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/bytecode/BytecodeSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,21 +0,0 @@
-package org.hibernate.test.bytecode;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * todo: describe BytecodeSuite
- *
- * @author Steve Ebersole
- */
-public class BytecodeSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "BytecodeProvider tests" );
- suite.addTest( org.hibernate.test.bytecode.cglib.ReflectionOptimizerTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.cglib.InvocationTargetExceptionTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.cglib.CGLIBThreadLocalTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.javassist.ReflectionOptimizerTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.javassist.InvocationTargetExceptionTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/cascade/CascadeSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/cascade/CascadeSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/cascade/CascadeSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,18 +0,0 @@
-package org.hibernate.test.cascade;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Implementation of CascadeSuite.
- */
-public class CascadeSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Cascade tests" );
- suite.addTest( BidirectionalOneToManyCascadeTest.suite() );
- suite.addTest( RefreshTest.suite() );
- suite.addTest( MultiPathCascadeTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/collection/CollectionSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/collection/CollectionSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/collection/CollectionSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,33 +0,0 @@
-package org.hibernate.test.collection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.collection.backref.map.compkey.BackrefCompositeMapKeyTest;
-import org.hibernate.test.collection.bag.PersistentBagTest;
-import org.hibernate.test.collection.idbag.PersistentIdBagTest;
-import org.hibernate.test.collection.list.PersistentListTest;
-import org.hibernate.test.collection.map.PersistentMapTest;
-import org.hibernate.test.collection.original.CollectionTest;
-import org.hibernate.test.collection.set.PersistentSetTest;
-
-/**
- * Suite of collection (i.e. PersistentCollection) related tests
- *
- * @author Steve Ebersole
- */
-public class CollectionSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Collection-related tests" );
- suite.addTest( PersistentBagTest.suite() );
- suite.addTest( PersistentIdBagTest.suite() );
- suite.addTest( PersistentListTest.suite() );
- suite.addTest( PersistentMapTest.suite() );
- suite.addTest( CollectionTest.suite() );
- suite.addTest( PersistentSetTest.suite() );
- suite.addTest( BackrefCompositeMapKeyTest.suite() );
- return suite;
- }
-
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/component/ComponentSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/component/ComponentSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/component/ComponentSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,23 +0,0 @@
-package org.hibernate.test.component;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.component.basic.ComponentTest;
-import org.hibernate.test.component.cascading.collection.CascadeToComponentCollectionTest;
-import org.hibernate.test.component.cascading.toone.CascadeToComponentAssociationTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class ComponentSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "component test suite" );
- suite.addTest( ComponentTest.suite() );
- suite.addTest( CascadeToComponentCollectionTest.suite() );
- suite.addTest( CascadeToComponentAssociationTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/connections/ConnectionsSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/connections/ConnectionsSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/connections/ConnectionsSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,23 +0,0 @@
-// $Id$
-package org.hibernate.test.connections;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Implementation of ConnectionsSuite.
- *
- * @author Steve Ebersole
- */
-public class ConnectionsSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Connection-management tests");
- suite.addTest( AggressiveReleaseTest.suite() );
- suite.addTest( BasicConnectionProviderTest.suite() );
- suite.addTest( CurrentSessionConnectionTest.suite() );
- suite.addTest( SuppliedConnectionTest.suite() );
- suite.addTest( ThreadLocalCurrentSessionTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,18 +0,0 @@
-package org.hibernate.test.dialect.functional;
-
-import junit.framework.TestSuite;
-
-import org.hibernate.test.dialect.functional.cache.SQLFunctionsInterSystemsTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class DialectFunctionalTestsSuite {
- public static TestSuite suite() {
- TestSuite suite = new TestSuite( "Dialect tests" );
- suite.addTest( SQLFunctionsInterSystemsTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,20 +0,0 @@
-package org.hibernate.test.dialect.unit;
-
-import junit.framework.TestSuite;
-
-import org.hibernate.test.dialect.unit.lockhint.SybaseLockHintsTest;
-import org.hibernate.test.dialect.unit.lockhint.SQLServerLockHintsTest;
-
-/**
- * Suite of all unit tests of the Dialect(s).
- *
- * @author Steve Ebersole
- */
-public class DialectUnitTestsSuite {
- public static TestSuite suite() {
- TestSuite suite = new TestSuite( "Dialect unit-tests" );
- suite.addTest( SybaseLockHintsTest.suite() );
- suite.addTest( SQLServerLockHintsTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/dynamicentity/DynamicEntitySuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/dynamicentity/DynamicEntitySuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/dynamicentity/DynamicEntitySuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,21 +0,0 @@
-package org.hibernate.test.dynamicentity;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.dynamicentity.interceptor.InterceptorDynamicEntityTest;
-import org.hibernate.test.dynamicentity.tuplizer.TuplizerDynamicEntityTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class DynamicEntitySuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "dynamic entity suite" );
- suite.addTest( InterceptorDynamicEntityTest.suite() );
- suite.addTest( TuplizerDynamicEntityTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/entitymode/EntityModeSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/entitymode/EntityModeSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/entitymode/EntityModeSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,23 +0,0 @@
-package org.hibernate.test.entitymode;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.entitymode.dom4j.Dom4jSuite;
-import org.hibernate.test.entitymode.map.MapSuite;
-import org.hibernate.test.entitymode.multi.MultiRepresentationTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class EntityModeSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "entity-mode tests" );
- suite.addTest( Dom4jSuite.suite() );
- suite.addTest( MapSuite.suite() );
- suite.addTest( MultiRepresentationTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,23 +0,0 @@
-package org.hibernate.test.entitymode.dom4j;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.entitymode.dom4j.accessors.Dom4jAccessorTest;
-import org.hibernate.test.entitymode.dom4j.basic.Dom4jTest;
-import org.hibernate.test.entitymode.dom4j.many2one.Dom4jManyToOneTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class Dom4jSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "dom4j entity-mode suite" );
- suite.addTest( Dom4jAccessorTest.suite() );
- suite.addTest( Dom4jTest.suite() );
- suite.addTest( Dom4jManyToOneTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/entitymode/map/MapSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/entitymode/map/MapSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/entitymode/map/MapSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,19 +0,0 @@
-package org.hibernate.test.entitymode.map;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.entitymode.map.basic.DynamicClassTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class MapSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "map entity-mode suite");
- suite.addTest( DynamicClassTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/event/collection/CollectionEventSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/event/collection/CollectionEventSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/event/collection/CollectionEventSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,54 +0,0 @@
-//$Id: $
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution statements
- * applied by the authors.
- *
- * All third-party contributions are distributed under license by Red Hat
- * Middleware LLC. This copyrighted material is made available to anyone
- * wishing to use, modify, copy, or redistribute it subject to the terms
- * and conditions of the GNU Lesser General Public License, as published by
- * the Free Software Foundation. This program is distributed in the hope
- * that it will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * See the GNU Lesser General Public License for more details. You should
- * have received a copy of the GNU Lesser General Public License along with
- * this distribution; if not, write to: Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA
- */
-package org.hibernate.test.event.collection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.event.collection.association.bidirectional.manytomany.BidirectionalManyToManyBagToSetCollectionEventTest;
-import org.hibernate.test.event.collection.association.bidirectional.manytomany.BidirectionalManyToManySetToSetCollectionEventTest;
-import org.hibernate.test.event.collection.association.bidirectional.onetomany.BidirectionalOneToManyBagCollectionEventTest;
-import org.hibernate.test.event.collection.association.bidirectional.onetomany.BidirectionalOneToManySetCollectionEventTest;
-import org.hibernate.test.event.collection.association.unidirectional.manytomany.UnidirectionalManyToManyBagCollectionEventTest;
-import org.hibernate.test.event.collection.association.unidirectional.onetomany.UnidirectionalOneToManyBagCollectionEventTest;
-import org.hibernate.test.event.collection.association.unidirectional.onetomany.UnidirectionalOneToManySetCollectionEventTest;
-import org.hibernate.test.event.collection.values.ValuesBagCollectionEventTest;
-
-/**
- *
- * @author Gail Badner
- */
-public class CollectionEventSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Collection event test suite" );
- suite.addTest( BrokenCollectionEventTest.suite() );
- suite.addTest( BidirectionalManyToManyBagToSetCollectionEventTest.suite() );
- suite.addTest( BidirectionalManyToManySetToSetCollectionEventTest.suite() );
- suite.addTest( BidirectionalOneToManyBagCollectionEventTest.suite() );
- suite.addTest( BidirectionalOneToManySetCollectionEventTest.suite() );
- suite.addTest( UnidirectionalManyToManyBagCollectionEventTest.suite() );
- suite.addTest( UnidirectionalOneToManyBagCollectionEventTest.suite() );
- suite.addTest( UnidirectionalOneToManySetCollectionEventTest.suite() );
- suite.addTest( ValuesBagCollectionEventTest.suite() );
- return suite;
- }
-}
\ No newline at end of file
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/generated/GeneratedPropertySuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/generated/GeneratedPropertySuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/generated/GeneratedPropertySuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,20 +0,0 @@
-package org.hibernate.test.generated;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class GeneratedPropertySuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "generated property suite" );
- suite.addTest( TimestampGeneratedValuesWithCachingTest.suite() );
- suite.addTest( TriggerGeneratedValuesWithCachingTest.suite() );
- suite.addTest( TriggerGeneratedValuesWithoutCachingTest.suite() );
- suite.addTest( PartiallyGeneratedComponentTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,23 +0,0 @@
-package org.hibernate.test.generatedkeys;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.generatedkeys.identity.IdentityGeneratedKeysTest;
-import org.hibernate.test.generatedkeys.select.SelectGeneratorTest;
-import org.hibernate.test.generatedkeys.seqidentity.SequenceIdentityTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class GeneratedKeysSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "generated keys suite" );
- suite.addTest( IdentityGeneratedKeysTest.suite() );
- suite.addTest( SelectGeneratorTest.suite() );
- suite.addTest( SequenceIdentityTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/hql/HQLSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/hql/HQLSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/hql/HQLSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,29 +0,0 @@
-// $Id$
-package org.hibernate.test.hql;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * The full suite of tests against the Antlr grammar
- *
- * @author Steve Ebersole
- */
-public class HQLSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Antlr HQL grammar tests" );
- suite.addTest( HQLTest.suite() );
- suite.addTest( ASTParserLoadingTest.suite() );
- suite.addTest( BulkManipulationTest.suite() );
- suite.addTest( WithClauseTest.suite() );
-// suite.addTest( ASTQueryTranslatorTest.suite() );
- suite.addTest( EJBQLTest.suite() );
- suite.addTest( HqlParserTest.suite() );
- suite.addTest( ScrollableCollectionFetchingTest.suite() );
- suite.addTest( ClassicTranslatorTest.suite() );
- suite.addTest( CriteriaHQLAlignmentTest.suite() );
- suite.addTest( CriteriaClassicAggregationReturnTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/idgen/IdGenSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/idgen/IdGenSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/idgen/IdGenSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,44 +0,0 @@
-package org.hibernate.test.idgen;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.idgen.enhanced.OptimizerUnitTest;
-import org.hibernate.test.idgen.enhanced.SequenceStyleConfigUnitTest;
-import org.hibernate.test.idgen.enhanced.forcedtable.BasicForcedTableSequenceTest;
-import org.hibernate.test.idgen.enhanced.forcedtable.HiLoForcedTableSequenceTest;
-import org.hibernate.test.idgen.enhanced.forcedtable.PooledForcedTableSequenceTest;
-import org.hibernate.test.idgen.enhanced.sequence.BasicSequenceTest;
-import org.hibernate.test.idgen.enhanced.sequence.HiLoSequenceTest;
-import org.hibernate.test.idgen.enhanced.sequence.PooledSequenceTest;
-import org.hibernate.test.idgen.enhanced.table.BasicTableTest;
-import org.hibernate.test.idgen.enhanced.table.HiLoTableTest;
-import org.hibernate.test.idgen.enhanced.table.PooledTableTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class IdGenSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "enhanced id generators" );
-
- suite.addTest( OptimizerUnitTest.suite() );
- suite.addTest( SequenceStyleConfigUnitTest.suite() );
-
- suite.addTest( BasicForcedTableSequenceTest.suite() );
- suite.addTest( HiLoForcedTableSequenceTest.suite() );
- suite.addTest( PooledForcedTableSequenceTest.suite() );
-
- suite.addTest( BasicSequenceTest.suite() );
- suite.addTest( HiLoSequenceTest.suite() );
- suite.addTest( PooledSequenceTest.suite() );
-
- suite.addTest( BasicTableTest.suite() );
- suite.addTest( HiLoTableTest.suite() );
- suite.addTest( PooledTableTest.suite() );
-
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/join/JoinSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/join/JoinSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/join/JoinSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,22 +0,0 @@
-//$Id: $
-package org.hibernate.test.join;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * @author Gail Badner
- */
-
-/**
- * Implementation of JoinSuite.
- */
-public class JoinSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Join tests");
- suite.addTest( JoinTest.suite() );
- suite.addTest( OptionalJoinTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/jpa/JPAComplianceSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/jpa/JPAComplianceSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/jpa/JPAComplianceSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,30 +0,0 @@
-package org.hibernate.test.jpa;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.hibernate.test.jpa.lock.JPALockTest;
-import org.hibernate.test.jpa.lock.RepeatableReadTest;
-import org.hibernate.test.jpa.removed.RemovedEntityTest;
-import org.hibernate.test.jpa.proxy.JPAProxyTest;
-import org.hibernate.test.jpa.fetch.FetchingTest;
-import org.hibernate.test.jpa.ql.JPAQLComplianceTest;
-import org.hibernate.test.jpa.ql.NativeQueryTest;
-import org.hibernate.test.jpa.cascade.CascadeTest;
-
-/**
- * @author Steve Ebersole
- */
-public class JPAComplianceSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "JPA-compliance tests");
- suite.addTest( CascadeTest.suite() );
- suite.addTest( FetchingTest.suite() );
- suite.addTest( JPALockTest.suite() );
- suite.addTest( RepeatableReadTest.suite() );
- suite.addTest( JPAProxyTest.suite() );
- suite.addTest( JPAQLComplianceTest.suite() );
- suite.addTest( NativeQueryTest.suite() );
- suite.addTest( RemovedEntityTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,23 +0,0 @@
-package org.hibernate.test.keymanytoone;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.keymanytoone.bidir.embedded.KeyManyToOneTest;
-import org.hibernate.test.keymanytoone.bidir.component.LazyKeyManyToOneTest;
-import org.hibernate.test.keymanytoone.bidir.component.EagerKeyManyToOneTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class KeyManyToOneSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "key-many-to-one mappings" );
- suite.addTest( KeyManyToOneTest.suite() );
- suite.addTest( LazyKeyManyToOneTest.suite() );
- suite.addTest( EagerKeyManyToOneTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/lob/LobSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/lob/LobSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/lob/LobSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,19 +0,0 @@
-package org.hibernate.test.lob;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class LobSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "LOB handling tests" );
- suite.addTest( SerializableTypeTest.suite() );
- suite.addTest( BlobTest.suite() );
- suite.addTest( ClobTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,48 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- *
- */
-package org.hibernate.test.manytomanyassociationclass;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.manytomanyassociationclass.compositeid.ManyToManyAssociationClassCompositeIdTest;
-import org.hibernate.test.manytomanyassociationclass.surrogateid.assigned.ManyToManyAssociationClassAssignedIdTest;
-import org.hibernate.test.manytomanyassociationclass.surrogateid.generated.ManyToManyAssociationClassGeneratedIdTest;
-
-/**
- * Tests on many-to-many association using an association class with a composite ID containing
- * the IDs from the associated entities.
- *
- * @author Gail Badner
- */
-public class ManyToManyAssociationClassSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Many-to-many with associaiton class tests" );
- suite.addTest( ManyToManyAssociationClassCompositeIdTest.suite() );
- suite.addTest( ManyToManyAssociationClassAssignedIdTest.suite() );
- suite.addTest( ManyToManyAssociationClassGeneratedIdTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/naturalid/NaturalIdSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/naturalid/NaturalIdSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/naturalid/NaturalIdSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,21 +0,0 @@
-package org.hibernate.test.naturalid;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.naturalid.immutable.ImmutableNaturalIdTest;
-import org.hibernate.test.naturalid.mutable.MutableNaturalIdTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class NaturalIdSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "natural ids" );
- suite.addTest( MutableNaturalIdTest.suite() );
- suite.addTest( ImmutableNaturalIdTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/onetoone/OneToOneSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/onetoone/OneToOneSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/onetoone/OneToOneSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,29 +0,0 @@
-package org.hibernate.test.onetoone;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.onetoone.formula.OneToOneFormulaTest;
-import org.hibernate.test.onetoone.joined.JoinedSubclassOneToOneTest;
-import org.hibernate.test.onetoone.link.OneToOneLinkTest;
-import org.hibernate.test.onetoone.nopojo.DynamicMapOneToOneTest;
-import org.hibernate.test.onetoone.singletable.DiscrimSubclassOneToOneTest;
-import org.hibernate.test.onetoone.optional.OptionalOneToOneTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class OneToOneSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "one-to-one suite" );
- suite.addTest( OneToOneFormulaTest.suite() );
- suite.addTest( JoinedSubclassOneToOneTest.suite() );
- suite.addTest( OneToOneLinkTest.suite() );
- suite.addTest( DynamicMapOneToOneTest.suite() );
- suite.addTest( OptionalOneToOneTest.suite() );
- suite.addTest( DiscrimSubclassOneToOneTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/ops/OpsSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/ops/OpsSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/ops/OpsSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,21 +0,0 @@
-package org.hibernate.test.ops;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class OpsSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Operations tests" );
- suite.addTest( CreateTest.suite() );
- suite.addTest( DeleteTest.suite() );
- suite.addTest( GetLoadTest.suite() );
- suite.addTest( MergeTest.suite() );
- suite.addTest( SaveOrUpdateTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/orphan/OrphanSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/orphan/OrphanSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/orphan/OrphanSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,18 +0,0 @@
-package org.hibernate.test.orphan;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class OrphanSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "orphan delete suite" );
- suite.addTest( OrphanTest.suite() );
- suite.addTest( PropertyRefTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/propertyref/PropertyRefSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/propertyref/PropertyRefSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/propertyref/PropertyRefSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,29 +0,0 @@
-package org.hibernate.test.propertyref;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.propertyref.basic.PropertyRefTest;
-import org.hibernate.test.propertyref.component.complete.CompleteComponentPropertyRefTest;
-import org.hibernate.test.propertyref.component.partial.PartialComponentPropertyRefTest;
-import org.hibernate.test.propertyref.inheritence.discrim.SubclassPropertyRefTest;
-import org.hibernate.test.propertyref.inheritence.joined.JoinedSubclassPropertyRefTest;
-import org.hibernate.test.propertyref.inheritence.union.UnionSubclassPropertyRefTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class PropertyRefSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "property-ref suite" );
- suite.addTest( PropertyRefTest.suite() );
- suite.addTest( CompleteComponentPropertyRefTest.suite() );
- suite.addTest( PartialComponentPropertyRefTest.suite() );
- suite.addTest( SubclassPropertyRefTest.suite() );
- suite.addTest( JoinedSubclassPropertyRefTest.suite() );
- suite.addTest( UnionSubclassPropertyRefTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/reattachment/ReattachmentSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/reattachment/ReattachmentSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/reattachment/ReattachmentSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,18 +0,0 @@
-package org.hibernate.test.reattachment;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Suite of reattachment specific tests.
- *
- * @author Steve Ebersole
- */
-public class ReattachmentSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "reattachment semantics" );
- suite.addTest( CollectionReattachmentTest.suite() );
- suite.addTest( ProxyReattachmentTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/sql/NativeSqlSupportSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/sql/NativeSqlSupportSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/sql/NativeSqlSupportSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,33 +0,0 @@
-package org.hibernate.test.sql;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.sql.check.CheckSuite;
-import org.hibernate.test.sql.hand.custom.datadirect.oracle.DataDirectOracleCustomSQLTest;
-import org.hibernate.test.sql.hand.custom.db2.DB2CustomSQLTest;
-import org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest;
-import org.hibernate.test.sql.hand.custom.oracle.OracleCustomSQLTest;
-import org.hibernate.test.sql.hand.custom.sybase.SybaseCustomSQLTest;
-import org.hibernate.test.sql.hand.query.NativeSQLQueriesTest;
-import org.hibernate.test.sql.hand.identity.CustomInsertSQLWithIdentityColumnTest;
-
-/**
- * Suite for testing aspects of native SQL support.
- *
- * @author Steve Ebersole
- */
-public class NativeSqlSupportSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Native SQL support tests" );
- suite.addTest( DB2CustomSQLTest.suite() );
- suite.addTest( DataDirectOracleCustomSQLTest.suite() );
- suite.addTest( OracleCustomSQLTest.suite() );
- suite.addTest( SybaseCustomSQLTest.suite() );
- suite.addTest( MySQLCustomSQLTest.suite() );
- suite.addTest( NativeSQLQueriesTest.suite() );
- suite.addTest( CheckSuite.suite() );
- suite.addTest( CustomInsertSQLWithIdentityColumnTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/sql/check/CheckSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/sql/check/CheckSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/sql/check/CheckSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,19 +0,0 @@
-package org.hibernate.test.sql.check;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Suite for testing custom SQL result checking strategies.
- * <p/>
- * Yes, currently there is only one actual test...
- *
- * @author Steve Ebersole
- */
-public class CheckSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "native sql result checking" );
- suite.addTest( OracleCheckStyleTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/usercollection/UserCollectionTypeSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/usercollection/UserCollectionTypeSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/usercollection/UserCollectionTypeSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,21 +0,0 @@
-package org.hibernate.test.usercollection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.usercollection.basic.UserCollectionTypeTest;
-import org.hibernate.test.usercollection.parameterized.ParameterizedUserCollectionTypeTest;
-
-/**
- * Suite for testing various aspects of user collection types.
- *
- * @author Steve Ebersole
- */
-public class UserCollectionTypeSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "user collection type tests" );
- suite.addTest( UserCollectionTypeTest.suite() );
- suite.addTest( ParameterizedUserCollectionTypeTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_2/test/org/hibernate/test/util/UtilSuite.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/util/UtilSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
+++ core/branches/Branch_3_2/test/org/hibernate/test/util/UtilSuite.java 2008-10-08 15:54:11 UTC (rev 15286)
@@ -1,20 +0,0 @@
-package org.hibernate.test.util;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.hibernate.test.util.dtd.EntityResolverTest;
-
-/**
- * todo: describe UtilSuite
- *
- * @author Steve Ebersole
- */
-public class UtilSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Utility package tests" );
- suite.addTest( PropertiesHelperTest.suite() );
- suite.addTest( EntityResolverTest.suite() );
- suite.addTest( StringHelperTest.suite() );
- return suite;
- }
-}
15 years, 6 months
Hibernate SVN: r15285 - in core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test: cascade and 29 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-08 09:44:32 -0400 (Wed, 08 Oct 2008)
New Revision: 15285
Removed:
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/bytecode/BytecodeSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/cascade/CascadeSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/collection/CollectionSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/component/ComponentSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/connections/ConnectionsSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dynamicentity/DynamicEntitySuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/EntityModeSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/map/MapSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/event/collection/CollectionEventSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/generated/GeneratedPropertySuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/HQLSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/idgen/IdGenSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/join/JoinSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/jpa/JPAComplianceSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/lob/LobSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/naturalid/NaturalIdSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/onetoone/OneToOneSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/ops/OpsSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/orphan/OrphanSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/propertyref/PropertyRefSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/reattachment/ReattachmentSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/NativeSqlSupportSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/check/CheckSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/usercollection/UserCollectionTypeSuite.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/util/UtilSuite.java
Log:
HHH-3518 : remove testsuite Suite aggregators
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/bytecode/BytecodeSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/bytecode/BytecodeSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/bytecode/BytecodeSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,21 +0,0 @@
-package org.hibernate.test.bytecode;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * todo: describe BytecodeSuite
- *
- * @author Steve Ebersole
- */
-public class BytecodeSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "BytecodeProvider tests" );
- suite.addTest( org.hibernate.test.bytecode.cglib.ReflectionOptimizerTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.cglib.InvocationTargetExceptionTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.cglib.CGLIBThreadLocalTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.javassist.ReflectionOptimizerTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.javassist.InvocationTargetExceptionTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/cascade/CascadeSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/cascade/CascadeSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/cascade/CascadeSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,18 +0,0 @@
-package org.hibernate.test.cascade;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Implementation of CascadeSuite.
- */
-public class CascadeSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Cascade tests" );
- suite.addTest( BidirectionalOneToManyCascadeTest.suite() );
- suite.addTest( RefreshTest.suite() );
- suite.addTest( MultiPathCascadeTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/collection/CollectionSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/collection/CollectionSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/collection/CollectionSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,33 +0,0 @@
-package org.hibernate.test.collection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.collection.bag.PersistentBagTest;
-import org.hibernate.test.collection.idbag.PersistentIdBagTest;
-import org.hibernate.test.collection.list.PersistentListTest;
-import org.hibernate.test.collection.map.PersistentMapTest;
-import org.hibernate.test.collection.original.CollectionTest;
-import org.hibernate.test.collection.set.PersistentSetTest;
-import org.hibernate.test.collection.backref.map.compkey.BackrefCompositeMapKeyTest;
-
-/**
- * Suite of collection (i.e. PersistentCollection) related tests
- *
- * @author Steve Ebersole
- */
-public class CollectionSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Collection-related tests" );
- suite.addTest( PersistentBagTest.suite() );
- suite.addTest( PersistentIdBagTest.suite() );
- suite.addTest( PersistentListTest.suite() );
- suite.addTest( PersistentMapTest.suite() );
- suite.addTest( CollectionTest.suite() );
- suite.addTest( PersistentSetTest.suite() );
- suite.addTest( BackrefCompositeMapKeyTest.suite() );
- return suite;
- }
-
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/component/ComponentSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/component/ComponentSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/component/ComponentSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,23 +0,0 @@
-package org.hibernate.test.component;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.component.basic.ComponentTest;
-import org.hibernate.test.component.cascading.collection.CascadeToComponentCollectionTest;
-import org.hibernate.test.component.cascading.toone.CascadeToComponentAssociationTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class ComponentSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "component test suite" );
- suite.addTest( ComponentTest.suite() );
- suite.addTest( CascadeToComponentCollectionTest.suite() );
- suite.addTest( CascadeToComponentAssociationTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/connections/ConnectionsSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/connections/ConnectionsSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/connections/ConnectionsSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,23 +0,0 @@
-// $Id: ConnectionsSuite.java 10977 2006-12-12 23:28:04Z steve.ebersole(a)jboss.com $
-package org.hibernate.test.connections;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Implementation of ConnectionsSuite.
- *
- * @author Steve Ebersole
- */
-public class ConnectionsSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Connection-management tests");
- suite.addTest( AggressiveReleaseTest.suite() );
- suite.addTest( BasicConnectionProviderTest.suite() );
- suite.addTest( CurrentSessionConnectionTest.suite() );
- suite.addTest( SuppliedConnectionTest.suite() );
- suite.addTest( ThreadLocalCurrentSessionTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,18 +0,0 @@
-package org.hibernate.test.dialect.functional;
-
-import junit.framework.TestSuite;
-
-import org.hibernate.test.dialect.functional.cache.SQLFunctionsInterSystemsTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class DialectFunctionalTestsSuite {
- public static TestSuite suite() {
- TestSuite suite = new TestSuite( "Dialect tests" );
- suite.addTest( SQLFunctionsInterSystemsTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,20 +0,0 @@
-package org.hibernate.test.dialect.unit;
-
-import junit.framework.TestSuite;
-
-import org.hibernate.test.dialect.unit.lockhint.SybaseLockHintsTest;
-import org.hibernate.test.dialect.unit.lockhint.SQLServerLockHintsTest;
-
-/**
- * Suite of all unit tests of the Dialect(s).
- *
- * @author Steve Ebersole
- */
-public class DialectUnitTestsSuite {
- public static TestSuite suite() {
- TestSuite suite = new TestSuite( "Dialect unit-tests" );
- suite.addTest( SybaseLockHintsTest.suite() );
- suite.addTest( SQLServerLockHintsTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dynamicentity/DynamicEntitySuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dynamicentity/DynamicEntitySuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/dynamicentity/DynamicEntitySuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,21 +0,0 @@
-package org.hibernate.test.dynamicentity;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.dynamicentity.interceptor.InterceptorDynamicEntityTest;
-import org.hibernate.test.dynamicentity.tuplizer.TuplizerDynamicEntityTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class DynamicEntitySuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "dynamic entity suite" );
- suite.addTest( InterceptorDynamicEntityTest.suite() );
- suite.addTest( TuplizerDynamicEntityTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/EntityModeSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/EntityModeSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/EntityModeSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,23 +0,0 @@
-package org.hibernate.test.entitymode;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.entitymode.dom4j.Dom4jSuite;
-import org.hibernate.test.entitymode.map.MapSuite;
-import org.hibernate.test.entitymode.multi.MultiRepresentationTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class EntityModeSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "entity-mode tests" );
- suite.addTest( Dom4jSuite.suite() );
- suite.addTest( MapSuite.suite() );
- suite.addTest( MultiRepresentationTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,23 +0,0 @@
-package org.hibernate.test.entitymode.dom4j;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.entitymode.dom4j.accessors.Dom4jAccessorTest;
-import org.hibernate.test.entitymode.dom4j.basic.Dom4jTest;
-import org.hibernate.test.entitymode.dom4j.many2one.Dom4jManyToOneTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class Dom4jSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "dom4j entity-mode suite" );
- suite.addTest( Dom4jAccessorTest.suite() );
- suite.addTest( Dom4jTest.suite() );
- suite.addTest( Dom4jManyToOneTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/map/MapSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/map/MapSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/entitymode/map/MapSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,19 +0,0 @@
-package org.hibernate.test.entitymode.map;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.entitymode.map.basic.DynamicClassTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class MapSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "map entity-mode suite");
- suite.addTest( DynamicClassTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/event/collection/CollectionEventSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/event/collection/CollectionEventSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/event/collection/CollectionEventSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,54 +0,0 @@
-//$Id: $
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution statements
- * applied by the authors.
- *
- * All third-party contributions are distributed under license by Red Hat
- * Middleware LLC. This copyrighted material is made available to anyone
- * wishing to use, modify, copy, or redistribute it subject to the terms
- * and conditions of the GNU Lesser General Public License, as published by
- * the Free Software Foundation. This program is distributed in the hope
- * that it will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * See the GNU Lesser General Public License for more details. You should
- * have received a copy of the GNU Lesser General Public License along with
- * this distribution; if not, write to: Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA
- */
-package org.hibernate.test.event.collection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.event.collection.association.bidirectional.manytomany.BidirectionalManyToManyBagToSetCollectionEventTest;
-import org.hibernate.test.event.collection.association.bidirectional.manytomany.BidirectionalManyToManySetToSetCollectionEventTest;
-import org.hibernate.test.event.collection.association.bidirectional.onetomany.BidirectionalOneToManyBagCollectionEventTest;
-import org.hibernate.test.event.collection.association.bidirectional.onetomany.BidirectionalOneToManySetCollectionEventTest;
-import org.hibernate.test.event.collection.association.unidirectional.manytomany.UnidirectionalManyToManyBagCollectionEventTest;
-import org.hibernate.test.event.collection.association.unidirectional.onetomany.UnidirectionalOneToManyBagCollectionEventTest;
-import org.hibernate.test.event.collection.association.unidirectional.onetomany.UnidirectionalOneToManySetCollectionEventTest;
-import org.hibernate.test.event.collection.values.ValuesBagCollectionEventTest;
-
-/**
- *
- * @author Gail Badner
- */
-public class CollectionEventSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Collection event test suite" );
- suite.addTest( BrokenCollectionEventTest.suite() );
- suite.addTest( BidirectionalManyToManyBagToSetCollectionEventTest.suite() );
- suite.addTest( BidirectionalManyToManySetToSetCollectionEventTest.suite() );
- suite.addTest( BidirectionalOneToManyBagCollectionEventTest.suite() );
- suite.addTest( BidirectionalOneToManySetCollectionEventTest.suite() );
- suite.addTest( UnidirectionalManyToManyBagCollectionEventTest.suite() );
- suite.addTest( UnidirectionalOneToManyBagCollectionEventTest.suite() );
- suite.addTest( UnidirectionalOneToManySetCollectionEventTest.suite() );
- suite.addTest( ValuesBagCollectionEventTest.suite() );
- return suite;
- }
-}
\ No newline at end of file
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/generated/GeneratedPropertySuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/generated/GeneratedPropertySuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/generated/GeneratedPropertySuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,20 +0,0 @@
-package org.hibernate.test.generated;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class GeneratedPropertySuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "generated property suite" );
- suite.addTest( TimestampGeneratedValuesWithCachingTest.suite() );
- suite.addTest( TriggerGeneratedValuesWithCachingTest.suite() );
- suite.addTest( TriggerGeneratedValuesWithoutCachingTest.suite() );
- suite.addTest( PartiallyGeneratedComponentTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,23 +0,0 @@
-package org.hibernate.test.generatedkeys;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.generatedkeys.identity.IdentityGeneratedKeysTest;
-import org.hibernate.test.generatedkeys.select.SelectGeneratorTest;
-import org.hibernate.test.generatedkeys.seqidentity.SequenceIdentityTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class GeneratedKeysSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "generated keys suite" );
- suite.addTest( IdentityGeneratedKeysTest.suite() );
- suite.addTest( SelectGeneratorTest.suite() );
- suite.addTest( SequenceIdentityTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/HQLSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/HQLSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/HQLSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,29 +0,0 @@
-// $Id: HQLSuite.java 10977 2006-12-12 23:28:04Z steve.ebersole(a)jboss.com $
-package org.hibernate.test.hql;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * The full suite of tests against the Antlr grammar
- *
- * @author Steve Ebersole
- */
-public class HQLSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Antlr HQL grammar tests" );
- suite.addTest( HQLTest.suite() );
- suite.addTest( ASTParserLoadingTest.suite() );
- suite.addTest( BulkManipulationTest.suite() );
- suite.addTest( WithClauseTest.suite() );
-// suite.addTest( ASTQueryTranslatorTest.suite() );
- suite.addTest( EJBQLTest.suite() );
- suite.addTest( HqlParserTest.suite() );
- suite.addTest( ScrollableCollectionFetchingTest.suite() );
- suite.addTest( ClassicTranslatorTest.suite() );
- suite.addTest( CriteriaHQLAlignmentTest.suite() );
- suite.addTest( CriteriaClassicAggregationReturnTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/idgen/IdGenSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/idgen/IdGenSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/idgen/IdGenSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,44 +0,0 @@
-package org.hibernate.test.idgen;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.idgen.enhanced.OptimizerUnitTest;
-import org.hibernate.test.idgen.enhanced.SequenceStyleConfigUnitTest;
-import org.hibernate.test.idgen.enhanced.forcedtable.BasicForcedTableSequenceTest;
-import org.hibernate.test.idgen.enhanced.forcedtable.HiLoForcedTableSequenceTest;
-import org.hibernate.test.idgen.enhanced.forcedtable.PooledForcedTableSequenceTest;
-import org.hibernate.test.idgen.enhanced.sequence.BasicSequenceTest;
-import org.hibernate.test.idgen.enhanced.sequence.HiLoSequenceTest;
-import org.hibernate.test.idgen.enhanced.sequence.PooledSequenceTest;
-import org.hibernate.test.idgen.enhanced.table.BasicTableTest;
-import org.hibernate.test.idgen.enhanced.table.HiLoTableTest;
-import org.hibernate.test.idgen.enhanced.table.PooledTableTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class IdGenSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "enhanced id generators" );
-
- suite.addTest( OptimizerUnitTest.suite() );
- suite.addTest( SequenceStyleConfigUnitTest.suite() );
-
- suite.addTest( BasicForcedTableSequenceTest.suite() );
- suite.addTest( HiLoForcedTableSequenceTest.suite() );
- suite.addTest( PooledForcedTableSequenceTest.suite() );
-
- suite.addTest( BasicSequenceTest.suite() );
- suite.addTest( HiLoSequenceTest.suite() );
- suite.addTest( PooledSequenceTest.suite() );
-
- suite.addTest( BasicTableTest.suite() );
- suite.addTest( HiLoTableTest.suite() );
- suite.addTest( PooledTableTest.suite() );
-
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/join/JoinSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/join/JoinSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/join/JoinSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,22 +0,0 @@
-//$Id: $
-package org.hibernate.test.join;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * @author Gail Badner
- */
-
-/**
- * Implementation of JoinSuite.
- */
-public class JoinSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Join tests");
- suite.addTest( JoinTest.suite() );
- suite.addTest( OptionalJoinTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/jpa/JPAComplianceSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/jpa/JPAComplianceSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/jpa/JPAComplianceSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,30 +0,0 @@
-package org.hibernate.test.jpa;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.hibernate.test.jpa.lock.JPALockTest;
-import org.hibernate.test.jpa.lock.RepeatableReadTest;
-import org.hibernate.test.jpa.removed.RemovedEntityTest;
-import org.hibernate.test.jpa.proxy.JPAProxyTest;
-import org.hibernate.test.jpa.fetch.FetchingTest;
-import org.hibernate.test.jpa.ql.JPAQLComplianceTest;
-import org.hibernate.test.jpa.ql.NativeQueryTest;
-import org.hibernate.test.jpa.cascade.CascadeTest;
-
-/**
- * @author Steve Ebersole
- */
-public class JPAComplianceSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "JPA-compliance tests");
- suite.addTest( CascadeTest.suite() );
- suite.addTest( FetchingTest.suite() );
- suite.addTest( JPALockTest.suite() );
- suite.addTest( RepeatableReadTest.suite() );
- suite.addTest( JPAProxyTest.suite() );
- suite.addTest( JPAQLComplianceTest.suite() );
- suite.addTest( NativeQueryTest.suite() );
- suite.addTest( RemovedEntityTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,23 +0,0 @@
-package org.hibernate.test.keymanytoone;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.keymanytoone.bidir.embedded.KeyManyToOneTest;
-import org.hibernate.test.keymanytoone.bidir.component.LazyKeyManyToOneTest;
-import org.hibernate.test.keymanytoone.bidir.component.EagerKeyManyToOneTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class KeyManyToOneSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "key-many-to-one mappings" );
- suite.addTest( KeyManyToOneTest.suite() );
- suite.addTest( LazyKeyManyToOneTest.suite() );
- suite.addTest( EagerKeyManyToOneTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/lob/LobSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/lob/LobSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/lob/LobSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,19 +0,0 @@
-package org.hibernate.test.lob;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class LobSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "LOB handling tests" );
- suite.addTest( SerializableTypeTest.suite() );
- suite.addTest( BlobTest.suite() );
- suite.addTest( ClobTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,48 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- *
- */
-package org.hibernate.test.manytomanyassociationclass;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.manytomanyassociationclass.compositeid.ManyToManyAssociationClassCompositeIdTest;
-import org.hibernate.test.manytomanyassociationclass.surrogateid.assigned.ManyToManyAssociationClassAssignedIdTest;
-import org.hibernate.test.manytomanyassociationclass.surrogateid.generated.ManyToManyAssociationClassGeneratedIdTest;
-
-/**
- * Tests on many-to-many association using an association class with a composite ID containing
- * the IDs from the associated entities.
- *
- * @author Gail Badner
- */
-public class ManyToManyAssociationClassSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Many-to-many with associaiton class tests" );
- suite.addTest( ManyToManyAssociationClassCompositeIdTest.suite() );
- suite.addTest( ManyToManyAssociationClassAssignedIdTest.suite() );
- suite.addTest( ManyToManyAssociationClassGeneratedIdTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/naturalid/NaturalIdSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/naturalid/NaturalIdSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/naturalid/NaturalIdSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,21 +0,0 @@
-package org.hibernate.test.naturalid;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.naturalid.immutable.ImmutableNaturalIdTest;
-import org.hibernate.test.naturalid.mutable.MutableNaturalIdTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class NaturalIdSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "natural ids" );
- suite.addTest( MutableNaturalIdTest.suite() );
- suite.addTest( ImmutableNaturalIdTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/onetoone/OneToOneSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/onetoone/OneToOneSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/onetoone/OneToOneSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,29 +0,0 @@
-package org.hibernate.test.onetoone;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.onetoone.formula.OneToOneFormulaTest;
-import org.hibernate.test.onetoone.joined.JoinedSubclassOneToOneTest;
-import org.hibernate.test.onetoone.link.OneToOneLinkTest;
-import org.hibernate.test.onetoone.nopojo.DynamicMapOneToOneTest;
-import org.hibernate.test.onetoone.optional.OptionalOneToOneTest;
-import org.hibernate.test.onetoone.singletable.DiscrimSubclassOneToOneTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class OneToOneSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "one-to-one suite" );
- suite.addTest( OneToOneFormulaTest.suite() );
- suite.addTest( JoinedSubclassOneToOneTest.suite() );
- suite.addTest( OneToOneLinkTest.suite() );
- suite.addTest( DynamicMapOneToOneTest.suite() );
- suite.addTest( OptionalOneToOneTest.suite() );
- suite.addTest( DiscrimSubclassOneToOneTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/ops/OpsSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/ops/OpsSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/ops/OpsSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,21 +0,0 @@
-package org.hibernate.test.ops;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class OpsSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Operations tests" );
- suite.addTest( CreateTest.suite() );
- suite.addTest( DeleteTest.suite() );
- suite.addTest( GetLoadTest.suite() );
- suite.addTest( MergeTest.suite() );
- suite.addTest( SaveOrUpdateTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/orphan/OrphanSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/orphan/OrphanSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/orphan/OrphanSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,18 +0,0 @@
-package org.hibernate.test.orphan;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class OrphanSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "orphan delete suite" );
- suite.addTest( OrphanTest.suite() );
- suite.addTest( PropertyRefTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/propertyref/PropertyRefSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/propertyref/PropertyRefSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/propertyref/PropertyRefSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,29 +0,0 @@
-package org.hibernate.test.propertyref;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.propertyref.basic.PropertyRefTest;
-import org.hibernate.test.propertyref.component.complete.CompleteComponentPropertyRefTest;
-import org.hibernate.test.propertyref.component.partial.PartialComponentPropertyRefTest;
-import org.hibernate.test.propertyref.inheritence.discrim.SubclassPropertyRefTest;
-import org.hibernate.test.propertyref.inheritence.joined.JoinedSubclassPropertyRefTest;
-import org.hibernate.test.propertyref.inheritence.union.UnionSubclassPropertyRefTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class PropertyRefSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "property-ref suite" );
- suite.addTest( PropertyRefTest.suite() );
- suite.addTest( CompleteComponentPropertyRefTest.suite() );
- suite.addTest( PartialComponentPropertyRefTest.suite() );
- suite.addTest( SubclassPropertyRefTest.suite() );
- suite.addTest( JoinedSubclassPropertyRefTest.suite() );
- suite.addTest( UnionSubclassPropertyRefTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/reattachment/ReattachmentSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/reattachment/ReattachmentSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/reattachment/ReattachmentSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,18 +0,0 @@
-package org.hibernate.test.reattachment;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Suite of reattachment specific tests.
- *
- * @author Steve Ebersole
- */
-public class ReattachmentSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "reattachment semantics" );
- suite.addTest( CollectionReattachmentTest.suite() );
- suite.addTest( ProxyReattachmentTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/NativeSqlSupportSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/NativeSqlSupportSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/NativeSqlSupportSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,33 +0,0 @@
-package org.hibernate.test.sql;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.sql.check.CheckSuite;
-import org.hibernate.test.sql.hand.custom.datadirect.oracle.DataDirectOracleCustomSQLTest;
-import org.hibernate.test.sql.hand.custom.db2.DB2CustomSQLTest;
-import org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest;
-import org.hibernate.test.sql.hand.custom.oracle.OracleCustomSQLTest;
-import org.hibernate.test.sql.hand.custom.sybase.SybaseCustomSQLTest;
-import org.hibernate.test.sql.hand.query.NativeSQLQueriesTest;
-import org.hibernate.test.sql.hand.identity.CustomInsertSQLWithIdentityColumnTest;
-
-/**
- * Suite for testing aspects of native SQL support.
- *
- * @author Steve Ebersole
- */
-public class NativeSqlSupportSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Native SQL support tests" );
- suite.addTest( DB2CustomSQLTest.suite() );
- suite.addTest( DataDirectOracleCustomSQLTest.suite() );
- suite.addTest( OracleCustomSQLTest.suite() );
- suite.addTest( SybaseCustomSQLTest.suite() );
- suite.addTest( MySQLCustomSQLTest.suite() );
- suite.addTest( NativeSQLQueriesTest.suite() );
- suite.addTest( CheckSuite.suite() );
- suite.addTest( CustomInsertSQLWithIdentityColumnTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/check/CheckSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/check/CheckSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/sql/check/CheckSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,19 +0,0 @@
-package org.hibernate.test.sql.check;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Suite for testing custom SQL result checking strategies.
- * <p/>
- * Yes, currently there is only one actual test...
- *
- * @author Steve Ebersole
- */
-public class CheckSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "native sql result checking" );
- suite.addTest( OracleCheckStyleTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/usercollection/UserCollectionTypeSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/usercollection/UserCollectionTypeSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/usercollection/UserCollectionTypeSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,21 +0,0 @@
-package org.hibernate.test.usercollection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.usercollection.basic.UserCollectionTypeTest;
-import org.hibernate.test.usercollection.parameterized.ParameterizedUserCollectionTypeTest;
-
-/**
- * Suite for testing various aspects of user collection types.
- *
- * @author Steve Ebersole
- */
-public class UserCollectionTypeSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "user collection type tests" );
- suite.addTest( UserCollectionTypeTest.suite() );
- suite.addTest( ParameterizedUserCollectionTypeTest.suite() );
- return suite;
- }
-}
Deleted: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/util/UtilSuite.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/util/UtilSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/util/UtilSuite.java 2008-10-08 13:44:32 UTC (rev 15285)
@@ -1,20 +0,0 @@
-package org.hibernate.test.util;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.hibernate.test.util.dtd.EntityResolverTest;
-
-/**
- * todo: describe UtilSuite
- *
- * @author Steve Ebersole
- */
-public class UtilSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Utility package tests" );
- suite.addTest( PropertiesHelperTest.suite() );
- suite.addTest( EntityResolverTest.suite() );
- suite.addTest( StringHelperTest.suite() );
- return suite;
- }
-}
15 years, 6 months
Hibernate SVN: r15284 - in core/trunk/testsuite/src/test/java/org/hibernate/test: cascade and 29 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-08 09:43:29 -0400 (Wed, 08 Oct 2008)
New Revision: 15284
Removed:
core/trunk/testsuite/src/test/java/org/hibernate/test/bytecode/BytecodeSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/cascade/CascadeSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/collection/CollectionSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/component/ComponentSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/connections/ConnectionsSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/dynamicentity/DynamicEntitySuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/EntityModeSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/map/MapSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/event/collection/CollectionEventSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/generated/GeneratedPropertySuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/HQLSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/IdGenSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/join/JoinSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/JPAComplianceSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/lob/LobSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/naturalid/NaturalIdSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/onetoone/OneToOneSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/ops/OpsSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/orphan/OrphanSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/propertyref/PropertyRefSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/reattachment/ReattachmentSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/NativeSqlSupportSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/sql/check/CheckSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/usercollection/UserCollectionTypeSuite.java
core/trunk/testsuite/src/test/java/org/hibernate/test/util/UtilSuite.java
Log:
HHH-3518 : remove testsuite Suite aggregators
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/bytecode/BytecodeSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/bytecode/BytecodeSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/bytecode/BytecodeSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,21 +0,0 @@
-package org.hibernate.test.bytecode;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * todo: describe BytecodeSuite
- *
- * @author Steve Ebersole
- */
-public class BytecodeSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "BytecodeProvider tests" );
- suite.addTest( org.hibernate.test.bytecode.cglib.ReflectionOptimizerTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.cglib.InvocationTargetExceptionTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.cglib.CGLIBThreadLocalTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.javassist.ReflectionOptimizerTest.suite() );
- suite.addTest( org.hibernate.test.bytecode.javassist.InvocationTargetExceptionTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/cascade/CascadeSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/cascade/CascadeSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/cascade/CascadeSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,18 +0,0 @@
-package org.hibernate.test.cascade;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Implementation of CascadeSuite.
- */
-public class CascadeSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Cascade tests" );
- suite.addTest( BidirectionalOneToManyCascadeTest.suite() );
- suite.addTest( RefreshTest.suite() );
- suite.addTest( MultiPathCascadeTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/collection/CollectionSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/collection/CollectionSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/collection/CollectionSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,33 +0,0 @@
-package org.hibernate.test.collection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.collection.bag.PersistentBagTest;
-import org.hibernate.test.collection.idbag.PersistentIdBagTest;
-import org.hibernate.test.collection.list.PersistentListTest;
-import org.hibernate.test.collection.map.PersistentMapTest;
-import org.hibernate.test.collection.original.CollectionTest;
-import org.hibernate.test.collection.set.PersistentSetTest;
-import org.hibernate.test.collection.backref.map.compkey.BackrefCompositeMapKeyTest;
-
-/**
- * Suite of collection (i.e. PersistentCollection) related tests
- *
- * @author Steve Ebersole
- */
-public class CollectionSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Collection-related tests" );
- suite.addTest( PersistentBagTest.suite() );
- suite.addTest( PersistentIdBagTest.suite() );
- suite.addTest( PersistentListTest.suite() );
- suite.addTest( PersistentMapTest.suite() );
- suite.addTest( CollectionTest.suite() );
- suite.addTest( PersistentSetTest.suite() );
- suite.addTest( BackrefCompositeMapKeyTest.suite() );
- return suite;
- }
-
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/component/ComponentSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/component/ComponentSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/component/ComponentSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,23 +0,0 @@
-package org.hibernate.test.component;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.component.basic.ComponentTest;
-import org.hibernate.test.component.cascading.collection.CascadeToComponentCollectionTest;
-import org.hibernate.test.component.cascading.toone.CascadeToComponentAssociationTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class ComponentSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "component test suite" );
- suite.addTest( ComponentTest.suite() );
- suite.addTest( CascadeToComponentCollectionTest.suite() );
- suite.addTest( CascadeToComponentAssociationTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/connections/ConnectionsSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/connections/ConnectionsSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/connections/ConnectionsSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,23 +0,0 @@
-// $Id: ConnectionsSuite.java 10977 2006-12-12 23:28:04Z steve.ebersole(a)jboss.com $
-package org.hibernate.test.connections;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Implementation of ConnectionsSuite.
- *
- * @author Steve Ebersole
- */
-public class ConnectionsSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Connection-management tests");
- suite.addTest( AggressiveReleaseTest.suite() );
- suite.addTest( BasicConnectionProviderTest.suite() );
- suite.addTest( CurrentSessionConnectionTest.suite() );
- suite.addTest( SuppliedConnectionTest.suite() );
- suite.addTest( ThreadLocalCurrentSessionTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/dialect/functional/DialectFunctionalTestsSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,18 +0,0 @@
-package org.hibernate.test.dialect.functional;
-
-import junit.framework.TestSuite;
-
-import org.hibernate.test.dialect.functional.cache.SQLFunctionsInterSystemsTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class DialectFunctionalTestsSuite {
- public static TestSuite suite() {
- TestSuite suite = new TestSuite( "Dialect tests" );
- suite.addTest( SQLFunctionsInterSystemsTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/dialect/unit/DialectUnitTestsSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,20 +0,0 @@
-package org.hibernate.test.dialect.unit;
-
-import junit.framework.TestSuite;
-
-import org.hibernate.test.dialect.unit.lockhint.SybaseLockHintsTest;
-import org.hibernate.test.dialect.unit.lockhint.SQLServerLockHintsTest;
-
-/**
- * Suite of all unit tests of the Dialect(s).
- *
- * @author Steve Ebersole
- */
-public class DialectUnitTestsSuite {
- public static TestSuite suite() {
- TestSuite suite = new TestSuite( "Dialect unit-tests" );
- suite.addTest( SybaseLockHintsTest.suite() );
- suite.addTest( SQLServerLockHintsTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/dynamicentity/DynamicEntitySuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/dynamicentity/DynamicEntitySuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/dynamicentity/DynamicEntitySuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,21 +0,0 @@
-package org.hibernate.test.dynamicentity;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.dynamicentity.interceptor.InterceptorDynamicEntityTest;
-import org.hibernate.test.dynamicentity.tuplizer.TuplizerDynamicEntityTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class DynamicEntitySuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "dynamic entity suite" );
- suite.addTest( InterceptorDynamicEntityTest.suite() );
- suite.addTest( TuplizerDynamicEntityTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/EntityModeSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/EntityModeSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/EntityModeSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,23 +0,0 @@
-package org.hibernate.test.entitymode;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.entitymode.dom4j.Dom4jSuite;
-import org.hibernate.test.entitymode.map.MapSuite;
-import org.hibernate.test.entitymode.multi.MultiRepresentationTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class EntityModeSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "entity-mode tests" );
- suite.addTest( Dom4jSuite.suite() );
- suite.addTest( MapSuite.suite() );
- suite.addTest( MultiRepresentationTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/dom4j/Dom4jSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,23 +0,0 @@
-package org.hibernate.test.entitymode.dom4j;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.entitymode.dom4j.accessors.Dom4jAccessorTest;
-import org.hibernate.test.entitymode.dom4j.basic.Dom4jTest;
-import org.hibernate.test.entitymode.dom4j.many2one.Dom4jManyToOneTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class Dom4jSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "dom4j entity-mode suite" );
- suite.addTest( Dom4jAccessorTest.suite() );
- suite.addTest( Dom4jTest.suite() );
- suite.addTest( Dom4jManyToOneTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/map/MapSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/map/MapSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/entitymode/map/MapSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,19 +0,0 @@
-package org.hibernate.test.entitymode.map;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.entitymode.map.basic.DynamicClassTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class MapSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "map entity-mode suite");
- suite.addTest( DynamicClassTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/event/collection/CollectionEventSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/event/collection/CollectionEventSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/event/collection/CollectionEventSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,54 +0,0 @@
-//$Id: $
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution statements
- * applied by the authors.
- *
- * All third-party contributions are distributed under license by Red Hat
- * Middleware LLC. This copyrighted material is made available to anyone
- * wishing to use, modify, copy, or redistribute it subject to the terms
- * and conditions of the GNU Lesser General Public License, as published by
- * the Free Software Foundation. This program is distributed in the hope
- * that it will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * See the GNU Lesser General Public License for more details. You should
- * have received a copy of the GNU Lesser General Public License along with
- * this distribution; if not, write to: Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA
- */
-package org.hibernate.test.event.collection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.event.collection.association.bidirectional.manytomany.BidirectionalManyToManyBagToSetCollectionEventTest;
-import org.hibernate.test.event.collection.association.bidirectional.manytomany.BidirectionalManyToManySetToSetCollectionEventTest;
-import org.hibernate.test.event.collection.association.bidirectional.onetomany.BidirectionalOneToManyBagCollectionEventTest;
-import org.hibernate.test.event.collection.association.bidirectional.onetomany.BidirectionalOneToManySetCollectionEventTest;
-import org.hibernate.test.event.collection.association.unidirectional.manytomany.UnidirectionalManyToManyBagCollectionEventTest;
-import org.hibernate.test.event.collection.association.unidirectional.onetomany.UnidirectionalOneToManyBagCollectionEventTest;
-import org.hibernate.test.event.collection.association.unidirectional.onetomany.UnidirectionalOneToManySetCollectionEventTest;
-import org.hibernate.test.event.collection.values.ValuesBagCollectionEventTest;
-
-/**
- *
- * @author Gail Badner
- */
-public class CollectionEventSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Collection event test suite" );
- suite.addTest( BrokenCollectionEventTest.suite() );
- suite.addTest( BidirectionalManyToManyBagToSetCollectionEventTest.suite() );
- suite.addTest( BidirectionalManyToManySetToSetCollectionEventTest.suite() );
- suite.addTest( BidirectionalOneToManyBagCollectionEventTest.suite() );
- suite.addTest( BidirectionalOneToManySetCollectionEventTest.suite() );
- suite.addTest( UnidirectionalManyToManyBagCollectionEventTest.suite() );
- suite.addTest( UnidirectionalOneToManyBagCollectionEventTest.suite() );
- suite.addTest( UnidirectionalOneToManySetCollectionEventTest.suite() );
- suite.addTest( ValuesBagCollectionEventTest.suite() );
- return suite;
- }
-}
\ No newline at end of file
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/generated/GeneratedPropertySuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/generated/GeneratedPropertySuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/generated/GeneratedPropertySuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,20 +0,0 @@
-package org.hibernate.test.generated;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class GeneratedPropertySuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "generated property suite" );
- suite.addTest( TimestampGeneratedValuesWithCachingTest.suite() );
- suite.addTest( TriggerGeneratedValuesWithCachingTest.suite() );
- suite.addTest( TriggerGeneratedValuesWithoutCachingTest.suite() );
- suite.addTest( PartiallyGeneratedComponentTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/generatedkeys/GeneratedKeysSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,23 +0,0 @@
-package org.hibernate.test.generatedkeys;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.generatedkeys.identity.IdentityGeneratedKeysTest;
-import org.hibernate.test.generatedkeys.select.SelectGeneratorTest;
-import org.hibernate.test.generatedkeys.seqidentity.SequenceIdentityTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class GeneratedKeysSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "generated keys suite" );
- suite.addTest( IdentityGeneratedKeysTest.suite() );
- suite.addTest( SelectGeneratorTest.suite() );
- suite.addTest( SequenceIdentityTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/hql/HQLSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/hql/HQLSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/hql/HQLSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,29 +0,0 @@
-// $Id: HQLSuite.java 10977 2006-12-12 23:28:04Z steve.ebersole(a)jboss.com $
-package org.hibernate.test.hql;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * The full suite of tests against the Antlr grammar
- *
- * @author Steve Ebersole
- */
-public class HQLSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Antlr HQL grammar tests" );
- suite.addTest( HQLTest.suite() );
- suite.addTest( ASTParserLoadingTest.suite() );
- suite.addTest( BulkManipulationTest.suite() );
- suite.addTest( WithClauseTest.suite() );
-// suite.addTest( ASTQueryTranslatorTest.suite() );
- suite.addTest( EJBQLTest.suite() );
- suite.addTest( HqlParserTest.suite() );
- suite.addTest( ScrollableCollectionFetchingTest.suite() );
- suite.addTest( ClassicTranslatorTest.suite() );
- suite.addTest( CriteriaHQLAlignmentTest.suite() );
- suite.addTest( CriteriaClassicAggregationReturnTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/IdGenSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/IdGenSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/idgen/IdGenSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,44 +0,0 @@
-package org.hibernate.test.idgen;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.idgen.enhanced.OptimizerUnitTest;
-import org.hibernate.test.idgen.enhanced.SequenceStyleConfigUnitTest;
-import org.hibernate.test.idgen.enhanced.forcedtable.BasicForcedTableSequenceTest;
-import org.hibernate.test.idgen.enhanced.forcedtable.HiLoForcedTableSequenceTest;
-import org.hibernate.test.idgen.enhanced.forcedtable.PooledForcedTableSequenceTest;
-import org.hibernate.test.idgen.enhanced.sequence.BasicSequenceTest;
-import org.hibernate.test.idgen.enhanced.sequence.HiLoSequenceTest;
-import org.hibernate.test.idgen.enhanced.sequence.PooledSequenceTest;
-import org.hibernate.test.idgen.enhanced.table.BasicTableTest;
-import org.hibernate.test.idgen.enhanced.table.HiLoTableTest;
-import org.hibernate.test.idgen.enhanced.table.PooledTableTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class IdGenSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "enhanced id generators" );
-
- suite.addTest( OptimizerUnitTest.suite() );
- suite.addTest( SequenceStyleConfigUnitTest.suite() );
-
- suite.addTest( BasicForcedTableSequenceTest.suite() );
- suite.addTest( HiLoForcedTableSequenceTest.suite() );
- suite.addTest( PooledForcedTableSequenceTest.suite() );
-
- suite.addTest( BasicSequenceTest.suite() );
- suite.addTest( HiLoSequenceTest.suite() );
- suite.addTest( PooledSequenceTest.suite() );
-
- suite.addTest( BasicTableTest.suite() );
- suite.addTest( HiLoTableTest.suite() );
- suite.addTest( PooledTableTest.suite() );
-
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/join/JoinSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/join/JoinSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/join/JoinSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,22 +0,0 @@
-//$Id: $
-package org.hibernate.test.join;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * @author Gail Badner
- */
-
-/**
- * Implementation of JoinSuite.
- */
-public class JoinSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite( "Join tests");
- suite.addTest( JoinTest.suite() );
- suite.addTest( OptionalJoinTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/JPAComplianceSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/JPAComplianceSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/jpa/JPAComplianceSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,30 +0,0 @@
-package org.hibernate.test.jpa;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.hibernate.test.jpa.lock.JPALockTest;
-import org.hibernate.test.jpa.lock.RepeatableReadTest;
-import org.hibernate.test.jpa.removed.RemovedEntityTest;
-import org.hibernate.test.jpa.proxy.JPAProxyTest;
-import org.hibernate.test.jpa.fetch.FetchingTest;
-import org.hibernate.test.jpa.ql.JPAQLComplianceTest;
-import org.hibernate.test.jpa.ql.NativeQueryTest;
-import org.hibernate.test.jpa.cascade.CascadeTest;
-
-/**
- * @author Steve Ebersole
- */
-public class JPAComplianceSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "JPA-compliance tests");
- suite.addTest( CascadeTest.suite() );
- suite.addTest( FetchingTest.suite() );
- suite.addTest( JPALockTest.suite() );
- suite.addTest( RepeatableReadTest.suite() );
- suite.addTest( JPAProxyTest.suite() );
- suite.addTest( JPAQLComplianceTest.suite() );
- suite.addTest( NativeQueryTest.suite() );
- suite.addTest( RemovedEntityTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/keymanytoone/KeyManyToOneSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,23 +0,0 @@
-package org.hibernate.test.keymanytoone;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.keymanytoone.bidir.embedded.KeyManyToOneTest;
-import org.hibernate.test.keymanytoone.bidir.component.LazyKeyManyToOneTest;
-import org.hibernate.test.keymanytoone.bidir.component.EagerKeyManyToOneTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class KeyManyToOneSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "key-many-to-one mappings" );
- suite.addTest( KeyManyToOneTest.suite() );
- suite.addTest( LazyKeyManyToOneTest.suite() );
- suite.addTest( EagerKeyManyToOneTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/lob/LobSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/lob/LobSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/lob/LobSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,19 +0,0 @@
-package org.hibernate.test.lob;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class LobSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "LOB handling tests" );
- suite.addTest( SerializableTypeTest.suite() );
- suite.addTest( BlobTest.suite() );
- suite.addTest( ClobTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/manytomanyassociationclass/ManyToManyAssociationClassSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,48 +0,0 @@
-/*
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- *
- */
-package org.hibernate.test.manytomanyassociationclass;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.manytomanyassociationclass.compositeid.ManyToManyAssociationClassCompositeIdTest;
-import org.hibernate.test.manytomanyassociationclass.surrogateid.assigned.ManyToManyAssociationClassAssignedIdTest;
-import org.hibernate.test.manytomanyassociationclass.surrogateid.generated.ManyToManyAssociationClassGeneratedIdTest;
-
-/**
- * Tests on many-to-many association using an association class with a composite ID containing
- * the IDs from the associated entities.
- *
- * @author Gail Badner
- */
-public class ManyToManyAssociationClassSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Many-to-many with associaiton class tests" );
- suite.addTest( ManyToManyAssociationClassCompositeIdTest.suite() );
- suite.addTest( ManyToManyAssociationClassAssignedIdTest.suite() );
- suite.addTest( ManyToManyAssociationClassGeneratedIdTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/naturalid/NaturalIdSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/naturalid/NaturalIdSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/naturalid/NaturalIdSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,21 +0,0 @@
-package org.hibernate.test.naturalid;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.naturalid.immutable.ImmutableNaturalIdTest;
-import org.hibernate.test.naturalid.mutable.MutableNaturalIdTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class NaturalIdSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "natural ids" );
- suite.addTest( MutableNaturalIdTest.suite() );
- suite.addTest( ImmutableNaturalIdTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/onetoone/OneToOneSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/onetoone/OneToOneSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/onetoone/OneToOneSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,29 +0,0 @@
-package org.hibernate.test.onetoone;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.onetoone.formula.OneToOneFormulaTest;
-import org.hibernate.test.onetoone.joined.JoinedSubclassOneToOneTest;
-import org.hibernate.test.onetoone.link.OneToOneLinkTest;
-import org.hibernate.test.onetoone.nopojo.DynamicMapOneToOneTest;
-import org.hibernate.test.onetoone.optional.OptionalOneToOneTest;
-import org.hibernate.test.onetoone.singletable.DiscrimSubclassOneToOneTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class OneToOneSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "one-to-one suite" );
- suite.addTest( OneToOneFormulaTest.suite() );
- suite.addTest( JoinedSubclassOneToOneTest.suite() );
- suite.addTest( OneToOneLinkTest.suite() );
- suite.addTest( DynamicMapOneToOneTest.suite() );
- suite.addTest( OptionalOneToOneTest.suite() );
- suite.addTest( DiscrimSubclassOneToOneTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/ops/OpsSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/ops/OpsSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/ops/OpsSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,21 +0,0 @@
-package org.hibernate.test.ops;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class OpsSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Operations tests" );
- suite.addTest( CreateTest.suite() );
- suite.addTest( DeleteTest.suite() );
- suite.addTest( GetLoadTest.suite() );
- suite.addTest( MergeTest.suite() );
- suite.addTest( SaveOrUpdateTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/orphan/OrphanSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/orphan/OrphanSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/orphan/OrphanSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,18 +0,0 @@
-package org.hibernate.test.orphan;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class OrphanSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "orphan delete suite" );
- suite.addTest( OrphanTest.suite() );
- suite.addTest( PropertyRefTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/propertyref/PropertyRefSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/propertyref/PropertyRefSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/propertyref/PropertyRefSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,29 +0,0 @@
-package org.hibernate.test.propertyref;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.propertyref.basic.PropertyRefTest;
-import org.hibernate.test.propertyref.component.complete.CompleteComponentPropertyRefTest;
-import org.hibernate.test.propertyref.component.partial.PartialComponentPropertyRefTest;
-import org.hibernate.test.propertyref.inheritence.discrim.SubclassPropertyRefTest;
-import org.hibernate.test.propertyref.inheritence.joined.JoinedSubclassPropertyRefTest;
-import org.hibernate.test.propertyref.inheritence.union.UnionSubclassPropertyRefTest;
-
-/**
- * {@inheritDoc}
- *
- * @author Steve Ebersole
- */
-public class PropertyRefSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "property-ref suite" );
- suite.addTest( PropertyRefTest.suite() );
- suite.addTest( CompleteComponentPropertyRefTest.suite() );
- suite.addTest( PartialComponentPropertyRefTest.suite() );
- suite.addTest( SubclassPropertyRefTest.suite() );
- suite.addTest( JoinedSubclassPropertyRefTest.suite() );
- suite.addTest( UnionSubclassPropertyRefTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/reattachment/ReattachmentSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/reattachment/ReattachmentSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/reattachment/ReattachmentSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,18 +0,0 @@
-package org.hibernate.test.reattachment;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Suite of reattachment specific tests.
- *
- * @author Steve Ebersole
- */
-public class ReattachmentSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "reattachment semantics" );
- suite.addTest( CollectionReattachmentTest.suite() );
- suite.addTest( ProxyReattachmentTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/sql/NativeSqlSupportSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/sql/NativeSqlSupportSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/sql/NativeSqlSupportSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,33 +0,0 @@
-package org.hibernate.test.sql;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.sql.check.CheckSuite;
-import org.hibernate.test.sql.hand.custom.datadirect.oracle.DataDirectOracleCustomSQLTest;
-import org.hibernate.test.sql.hand.custom.db2.DB2CustomSQLTest;
-import org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest;
-import org.hibernate.test.sql.hand.custom.oracle.OracleCustomSQLTest;
-import org.hibernate.test.sql.hand.custom.sybase.SybaseCustomSQLTest;
-import org.hibernate.test.sql.hand.query.NativeSQLQueriesTest;
-import org.hibernate.test.sql.hand.identity.CustomInsertSQLWithIdentityColumnTest;
-
-/**
- * Suite for testing aspects of native SQL support.
- *
- * @author Steve Ebersole
- */
-public class NativeSqlSupportSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Native SQL support tests" );
- suite.addTest( DB2CustomSQLTest.suite() );
- suite.addTest( DataDirectOracleCustomSQLTest.suite() );
- suite.addTest( OracleCustomSQLTest.suite() );
- suite.addTest( SybaseCustomSQLTest.suite() );
- suite.addTest( MySQLCustomSQLTest.suite() );
- suite.addTest( NativeSQLQueriesTest.suite() );
- suite.addTest( CheckSuite.suite() );
- suite.addTest( CustomInsertSQLWithIdentityColumnTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/sql/check/CheckSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/sql/check/CheckSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/sql/check/CheckSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,19 +0,0 @@
-package org.hibernate.test.sql.check;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Suite for testing custom SQL result checking strategies.
- * <p/>
- * Yes, currently there is only one actual test...
- *
- * @author Steve Ebersole
- */
-public class CheckSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "native sql result checking" );
- suite.addTest( OracleCheckStyleTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/usercollection/UserCollectionTypeSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/usercollection/UserCollectionTypeSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/usercollection/UserCollectionTypeSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,21 +0,0 @@
-package org.hibernate.test.usercollection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.hibernate.test.usercollection.basic.UserCollectionTypeTest;
-import org.hibernate.test.usercollection.parameterized.ParameterizedUserCollectionTypeTest;
-
-/**
- * Suite for testing various aspects of user collection types.
- *
- * @author Steve Ebersole
- */
-public class UserCollectionTypeSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "user collection type tests" );
- suite.addTest( UserCollectionTypeTest.suite() );
- suite.addTest( ParameterizedUserCollectionTypeTest.suite() );
- return suite;
- }
-}
Deleted: core/trunk/testsuite/src/test/java/org/hibernate/test/util/UtilSuite.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/util/UtilSuite.java 2008-10-08 11:58:24 UTC (rev 15283)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/util/UtilSuite.java 2008-10-08 13:43:29 UTC (rev 15284)
@@ -1,20 +0,0 @@
-package org.hibernate.test.util;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.hibernate.test.util.dtd.EntityResolverTest;
-
-/**
- * todo: describe UtilSuite
- *
- * @author Steve Ebersole
- */
-public class UtilSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite( "Utility package tests" );
- suite.addTest( PropertiesHelperTest.suite() );
- suite.addTest( EntityResolverTest.suite() );
- suite.addTest( StringHelperTest.suite() );
- return suite;
- }
-}
15 years, 6 months
Hibernate SVN: r15283 - in entitymanager/trunk/src/test/org/hibernate/ejb/test: association and 11 other directories.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2008-10-08 07:58:24 -0400 (Wed, 08 Oct 2008)
New Revision: 15283
Modified:
entitymanager/trunk/src/test/org/hibernate/ejb/test/EntityManagerTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/PackagedEntityManagerTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/QueryTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/TestCase.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/association/AssociationTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/callbacks/CallbackAndDirtyTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/callbacks/CallbacksTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/CascadeTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/DeleteOrphanTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/FetchTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/FlushModeTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/FlushTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/GetReferenceTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/MergeTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/RefreshTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/RemoveTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/cascade/CascadePersistTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/exception/ExceptionTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/inheritance/InheritanceTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/lob/BlobTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/lock/LockTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/ops/FindTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/ops/MergeNewTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/transaction/FlushAndTransactionTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/xml/XmlAttributeOverrideTest.java
entitymanager/trunk/src/test/org/hibernate/ejb/test/xml/XmlTest.java
Log:
EJB-393 - Replaced factory.createEntityManager by getEntityManager in the test cases and added exception handling in the parent test case
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/EntityManagerTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/EntityManagerTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/EntityManagerTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -49,7 +49,7 @@
//
// Item item = new Item( "Mouse", "Micro$oft mouse" );
//
-// EntityManager em = factory.createEntityManager();
+// EntityManager em = getEntityManager();
// em.getTransaction().begin();
// em.persist( item );
// assertTrue( em.contains( item ) );
@@ -95,7 +95,7 @@
Item item = new Item( "Mouse", "Micro$oft mouse" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( item );
assertTrue( em.contains( item ) );
@@ -148,7 +148,7 @@
stats.clear();
stats.setStatisticsEnabled( true );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( res );
@@ -161,7 +161,7 @@
assertEquals( 1, stats.getSecondLevelCachePutCount() );
assertEquals( 0, stats.getSecondLevelCacheHitCount() );
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
Item second = em.find( Item.class, item.getName() );
assertEquals( 1, second.getDistributors().size() );
@@ -169,7 +169,7 @@
em.getTransaction().commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
second = em.find( Item.class, item.getName() );
assertEquals( 1, second.getDistributors().size() );
@@ -184,7 +184,7 @@
}
public void testContains() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Integer nonManagedObject = new Integer( 4 );
try {
@@ -198,7 +198,7 @@
finally {
em.close();
}
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
Item item = new Item();
item.setDescr( "Mine" );
@@ -214,7 +214,7 @@
}
public void testClear() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Wallet w = new Wallet();
w.setBrand( "Lacoste" );
@@ -229,7 +229,7 @@
}
public void testFlushMode() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.setFlushMode( FlushModeType.COMMIT );
assertEquals( FlushModeType.COMMIT, em.getFlushMode() );
( (HibernateEntityManager) em ).getSession().setFlushMode( FlushMode.ALWAYS );
@@ -238,7 +238,7 @@
}
public void testPersistNoneGenerator() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Wallet w = new Wallet();
w.setBrand( "Lacoste" );
@@ -255,7 +255,7 @@
}
public void testSerializableException() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
try {
Query query = em.createQuery( "SELECT p FETCH JOIN p.distributors FROM Item p" );
@@ -297,7 +297,7 @@
}
public void testIsOpen() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
assertTrue( em.isOpen() );
em.getTransaction().begin();
assertTrue( em.isOpen() );
@@ -308,7 +308,7 @@
//EJB-9
// public void testGet() throws Exception {
-// EntityManager em = factory.createEntityManager();
+// EntityManager em = getEntityManager();
// em.getTransaction().begin();
// Item item = (Item) em.get(Item.class, "nonexistentone");
// try {
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/PackagedEntityManagerTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/PackagedEntityManagerTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/PackagedEntityManagerTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -233,7 +233,7 @@
Item item = new Item( "Mouse", "Micro$oft mouse" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( item );
assertTrue( em.contains( item ) );
@@ -286,7 +286,7 @@
stats.clear();
stats.setStatisticsEnabled( true );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( res );
@@ -299,7 +299,7 @@
assertEquals( 1, stats.getSecondLevelCachePutCount() );
assertEquals( 0, stats.getSecondLevelCacheHitCount() );
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
Item second = em.find( Item.class, item.getName() );
assertEquals( 1, second.getDistributors().size() );
@@ -307,7 +307,7 @@
em.getTransaction().commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
second = em.find( Item.class, item.getName() );
assertEquals( 1, second.getDistributors().size() );
@@ -324,7 +324,7 @@
}
public void testExternalJar() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
Scooter s = new Scooter();
s.setModel( "Abadah" );
s.setSpeed( 85l );
@@ -332,7 +332,7 @@
em.persist( s );
em.getTransaction().commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
s = em.find( Scooter.class, s.getModel() );
assertEquals( new Long( 85 ), s.getSpeed() );
@@ -342,7 +342,7 @@
}
public void testORMFileOnMainAndExplicitJars() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
Seat seat = new Seat();
seat.setNumber( "3B" );
Airplane plane = new Airplane();
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/QueryTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/QueryTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/QueryTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -17,7 +17,7 @@
public class QueryTest extends TestCase {
public void testPagedQuery() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Item item = new Item( "Mouse", "Micro$oft mouse" );
em.persist( item );
@@ -36,7 +36,7 @@
}
public void testAggregationReturnType() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Item item = new Item( "Mouse", "Micro$oft mouse" );
em.persist( item );
@@ -53,7 +53,7 @@
final Item item = new Item( "Mouse", "Micro$oft mouse" );
final Item item2 = new Item( "Computer", "D�ll computer" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( item );
em.persist( item2 );
@@ -97,7 +97,7 @@
// auchan.setName("Auchan");
// item.addDistributor(auchan);
//
-// EntityManager em = factory.createEntityManager();
+// EntityManager em = getEntityManager();
// em.getTransaction().begin();
// em.persist(fnac);
// em.persist(auchan);
@@ -125,7 +125,7 @@
final Item item = new Item( "Mouse", "Micro_oft mouse" );
final Item item2 = new Item( "Computer", "D�ll computer" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( item );
em.persist( item2 );
@@ -148,7 +148,7 @@
Item item = new Item( "Mouse", "Micro$oft mouse" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( item );
assertTrue( em.contains( item ) );
@@ -169,7 +169,7 @@
Item item = new Item( "Mouse", "Micro$oft mouse" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( item );
assertTrue( em.contains( item ) );
@@ -188,7 +188,7 @@
}
public void testExplicitPositionalParameter() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Wallet w = new Wallet();
w.setBrand( "Lacoste" );
@@ -213,7 +213,7 @@
}
public void testNativeQuestionMarkParameter() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Wallet w = new Wallet();
w.setBrand( "Lacoste" );
@@ -235,7 +235,7 @@
Item item = new Item( "Mouse", "Micro$oft mouse" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( item );
assertTrue( em.contains( item ) );
@@ -260,7 +260,7 @@
}
public void testDistinct() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.createQuery( "delete Item" ).executeUpdate();
em.createQuery( "delete Distributor" ).executeUpdate();
@@ -288,7 +288,7 @@
}
public void testIsNull() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Distributor d1 = new Distributor();
d1.setName( "Fnac" );
@@ -324,7 +324,7 @@
Item item = new Item( "Mouse", "Micro$oft mouse" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( item );
assertTrue( em.contains( item ) );
@@ -349,7 +349,7 @@
public void testUnavailableNamedQuery() throws Exception {
Item item = new Item( "Mouse", "Micro$oft mouse" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( item );
try {
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/TestCase.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/TestCase.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/TestCase.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -7,6 +7,8 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+
+import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
@@ -19,6 +21,7 @@
*/
public abstract class TestCase extends junit.framework.TestCase {
protected EntityManagerFactory factory;
+ protected EntityManager em;
public TestCase() {
super();
@@ -35,7 +38,31 @@
public void tearDown() {
factory.close();
}
+
+ @Override
+ public void runTest() throws Throwable {
+ try {
+ em = getEntityManager();
+ super.runTest();
+ } catch (Throwable t) {
+ if (em.getTransaction().isActive())
+ em.getTransaction().rollback();
+ throw t;
+ }
+ }
+
+ protected EntityManager getEntityManager() {
+ if (em == null || !em.isOpen())
+ em = factory.createEntityManager();
+ return em;
+ }
+ protected EntityManager getEntityManager(Map properties) {
+ if (em == null || !em.isOpen())
+ em = factory.createEntityManager(properties);
+ return em;
+ }
+
public abstract Class[] getAnnotatedClasses();
public String[] getEjb3DD() {
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/association/AssociationTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/association/AssociationTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/association/AssociationTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -10,7 +10,7 @@
*/
public class AssociationTest extends TestCase {
public void testBidirOneToOne() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
String id = "10";
Incident i = em.find( Incident.class, id );
@@ -30,7 +30,7 @@
}
public void testMergeAndBidirOneToOne() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Oven oven = new Oven();
Kitchen kitchen = new Kitchen();
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/callbacks/CallbackAndDirtyTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/callbacks/CallbackAndDirtyTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/callbacks/CallbackAndDirtyTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -13,7 +13,7 @@
public class CallbackAndDirtyTest extends TestCase {
public void testDirtyButNotDirty() throws Exception {
- EntityManager manager = factory.createEntityManager();
+ EntityManager manager = getEntityManager();
manager.getTransaction().begin();
Employee mark = new Employee();
mark.setName( "Mark" );
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/callbacks/CallbacksTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/callbacks/CallbacksTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/callbacks/CallbacksTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -17,7 +17,7 @@
public class CallbacksTest extends TestCase {
public void testCallbackMethod() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
Cat c = new Cat();
c.setName( "Kitty" );
c.setDateOfBirth( new Date( 90, 11, 15 ) );
@@ -39,7 +39,7 @@
}
public void testEntityListener() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
Cat c = new Cat();
c.setName( "Kitty" );
c.setLength( 12 );
@@ -66,7 +66,7 @@
public void testPostPersist() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
Cat c = new Cat();
em.getTransaction().begin();
c.setLength( 23 );
@@ -83,7 +83,7 @@
//Not a test since the spec did not make the proper change on listeners
public void listenerAnnotation() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
Translation tl = new Translation();
em.getTransaction().begin();
tl.setInto( "France" );
@@ -105,7 +105,7 @@
}
public void testPrePersistOnCascade() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Television tv = new Television();
RemoteControl rc = new RemoteControl();
@@ -119,7 +119,7 @@
}
public void testCallBackListenersHierarchy() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Television tv = new Television();
em.persist( tv );
@@ -134,7 +134,7 @@
}
public void testException() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Rythm r = new Rythm();
try {
@@ -157,7 +157,7 @@
public void testIdNullSetByPrePersist() throws Exception {
Plant plant = new Plant();
plant.setName( "Origuna plantula gigantic" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( plant );
em.flush();
@@ -174,7 +174,7 @@
// public void testPostUpdateCollection() throws Exception {
//
// // create a cat
-// EntityManager em = factory.createEntityManager();
+// EntityManager em = getEntityManager();
// Cat cat = new Cat();
// em.getTransaction().begin();
// cat.setLength( 23 );
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/CascadeTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/CascadeTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/CascadeTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -14,7 +14,7 @@
public void testCascade() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Teacher teacher = null;
@@ -33,7 +33,7 @@
em.getTransaction().commit();
System.out.println("***************************");
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
Teacher foundTeacher = (Teacher) em.createQuery( "select t from Teacher as t" ).getSingleResult();
@@ -59,7 +59,7 @@
e1.setAuthor(e2);
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
EntityTransaction tx = em.getTransaction();
tx.begin();
em.persist(e2);
@@ -67,7 +67,7 @@
tx.commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
e1 = em.find(Song.class, e1.getId());
e2 = null;
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/DeleteOrphanTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/DeleteOrphanTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/DeleteOrphanTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -20,7 +20,7 @@
public void testDeleteOrphan() throws Exception {
EntityTransaction tx;
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
tx = em.getTransaction();
tx.begin();
Troop disney = new Troop();
@@ -33,7 +33,7 @@
tx.commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
tx = em.getTransaction();
tx.begin();
Troop troop = em.find( Troop.class, disney.getId() );
@@ -45,14 +45,14 @@
troop.getSoldiers().remove( soldier );
troop = (Troop) unserialize( serialize( troop ) );
- em = factory.createEntityManager();
+ em = getEntityManager();
tx = em.getTransaction();
tx.begin();
em.merge( troop );
tx.commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
tx = em.getTransaction();
tx.begin();
soldier = em.find( Soldier.class, mickey.getId() );
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/FetchTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/FetchTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/cascade/FetchTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -17,7 +17,7 @@
public class FetchTest extends TestCase {
public void testCascadeAndFetchCollection() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Troop disney = new Troop();
disney.setName( "Disney" );
@@ -28,7 +28,7 @@
em.getTransaction().commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
Troop troop = em.find( Troop.class, disney.getId() );
assertFalse( Hibernate.isInitialized( troop.getSoldiers() ) );
@@ -36,7 +36,7 @@
assertFalse( Hibernate.isInitialized( troop.getSoldiers() ) );
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
troop = em.find( Troop.class, disney.getId() );
em.remove( troop );
@@ -46,7 +46,7 @@
}
public void testCascadeAndFetchEntity() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Troop disney = new Troop();
disney.setName( "Disney" );
@@ -57,14 +57,14 @@
em.getTransaction().commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
Soldier soldier = em.find( Soldier.class, mickey.getId() );
assertFalse( Hibernate.isInitialized( soldier.getTroop() ) );
em.getTransaction().commit();
assertFalse( Hibernate.isInitialized( soldier.getTroop() ) );
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
Troop troop = em.find( Troop.class, disney.getId() );
em.remove( troop );
@@ -76,7 +76,7 @@
public void testTwoLevelDeepPersist() throws Exception {
EntityTransaction tx;
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
tx = em.getTransaction();
tx.begin();
Conference jbwBarcelona = new Conference();
@@ -94,7 +94,7 @@
tx.commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
tx = em.getTransaction();
tx.begin();
jbwBarcelona = em.find( Conference.class, jbwBarcelona.getId() );
@@ -112,7 +112,7 @@
public void testTwoLevelDeepPersistOnManyToOne() throws Exception {
EntityTransaction tx;
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
tx = em.getTransaction();
tx.begin();
Grandson gs = new Grandson();
@@ -121,7 +121,7 @@
em.persist( gs );
tx.commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
tx = em.getTransaction();
tx.begin();
gs = em.find( Grandson.class, gs.getId() );
@@ -134,7 +134,7 @@
}
public void testPerfCascadeAndFetchEntity() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
//init data
em.getTransaction().begin();
int loop = 50;
@@ -150,7 +150,7 @@
em.close();
//Warm up loop
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
for ( int i = 0; i < loop ; i++ ) {
//Soldier soldier = em.find( Soldier.class, new Integer(i) );
@@ -167,7 +167,7 @@
//do not evict
for ( int j = 0; j < 10 ; j++ ) {
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
for ( int i = 0; i < loop ; i++ ) {
Troop troop = em.find( Troop.class, new Integer( i ) );
@@ -182,7 +182,7 @@
em.close();
//evict
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
for ( int i = 0; i < loop ; i++ ) {
//Soldier soldier = em.find( Soldier.class, new Integer(i) );
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/FlushModeTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/FlushModeTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/FlushModeTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -15,7 +15,7 @@
public void testCreateEMFlushMode() throws Exception {
Map properties = new HashMap();
properties.put( "org.hibernate.flushMode", "manual" );
- EntityManager em = factory.createEntityManager( properties );
+ EntityManager em = getEntityManager( properties );
em.getTransaction().begin();
Dress dress = new Dress();
dress.name = "long dress";
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/FlushTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/FlushTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/FlushTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -26,7 +26,7 @@
//Test for EJBTHREE-722
public void testFlushOnDetached() throws Exception {
- EntityManager manager = factory.createEntityManager( );
+ EntityManager manager = getEntityManager( );
manager.getTransaction().begin();
Pet p1 = createCat("Toonses", 15.0, 9, manager);
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/GetReferenceTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/GetReferenceTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/GetReferenceTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -12,7 +12,7 @@
public class GetReferenceTest extends TestCase {
public void testWrongIdType() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
try {
Competitor c = em.getReference( Competitor.class, new String("30") );
fail("Expected IllegalArgumentException");
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/MergeTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/MergeTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/MergeTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -16,7 +16,7 @@
race.competitors.add( new Competitor("Name") );
race.competitors.add( new Competitor() );
race.competitors.add( new Competitor() );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( race );
em.flush();
@@ -40,7 +40,7 @@
competition.getCompetitors().add( new Competitor("Name") );
competition.getCompetitors().add( new Competitor() );
competition.getCompetitors().add( new Competitor() );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( competition );
em.flush();
@@ -64,7 +64,7 @@
competition.getCompetitors().add( new Competitor("Name") );
competition.getCompetitors().add( new Competitor() );
competition.getCompetitors().add( new Competitor() );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( competition );
em.flush();
@@ -86,7 +86,7 @@
public void testRemoveAndMerge() {
Race race = new Race();
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( race );
em.flush();
@@ -111,7 +111,7 @@
public void testConcurrentMerge() {
Race race = new Race();
race.name = "Derby";
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( race );
em.flush();
@@ -120,7 +120,7 @@
race.name = "Magnicourt";
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
Race race2 = em.find(Race.class, race.id );
race2.name = "Mans";
@@ -130,7 +130,7 @@
em.getTransaction().commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
race2 = em.find(Race.class, race.id );
assertEquals( "Last commit win in merge", "Magnicourt", race2.name );
@@ -141,7 +141,7 @@
}
public void testMergeUnidirectionalOneToMany() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Empire roman = new Empire();
em.persist( roman );
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/RefreshTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/RefreshTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/RefreshTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -11,7 +11,7 @@
public class RefreshTest extends TestCase {
public void testRefreshNonManaged() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Race race = new Race();
em.persist( race );
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/RemoveTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/RemoveTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/RemoveTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -16,7 +16,7 @@
race.competitors.add( new Competitor() );
race.competitors.add( new Competitor() );
race.competitors.add( new Competitor() );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( race );
em.flush();
@@ -28,7 +28,7 @@
public void testRemoveAndFind() {
Race race = new Race();
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( race );
em.remove( race );
@@ -37,24 +37,30 @@
em.close();
}
- public void testUpdatedAndRemove() {
+ public void testUpdatedAndRemove() throws Exception {
Music music = new Music();
music.setName( "Classical" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( music );
em.getTransaction().commit();
em.clear();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
+
EntityManager em2 = factory.createEntityManager();
- em2.getTransaction().begin();
+ try {
+ em2.getTransaction().begin();
+ //read music from 2nd EM
+ music = em2.find( Music.class, music.getId() );
+ } catch (Exception e) {
+ em2.getTransaction().rollback();
+ em2.close();
+ throw e;
+ }
- //read music from 2nd EM
- music = em2.find( Music.class, music.getId() );
-
//change music
em.find( Music.class, music.getId() ).setName( "Rap" );
em.getTransaction().commit();
@@ -69,13 +75,13 @@
}
finally {
em2.getTransaction().rollback();
+ em2.close();
}
//clean
em.remove( em.find( Music.class, music.getId() ) );
em.close();
- em2.close();
}
public Class[] getAnnotatedClasses() {
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/cascade/CascadePersistTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/cascade/CascadePersistTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/emops/cascade/CascadePersistTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -13,7 +13,7 @@
public class CascadePersistTest extends TestCase {
public void testLazyCollectionsStayLazyOnPersist() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
//initialize
A a = new A();
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/exception/ExceptionTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/exception/ExceptionTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/exception/ExceptionTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -1,4 +1,4 @@
-// $Id:$
+// $Id$
package org.hibernate.ejb.test.exception;
import java.util.Map;
@@ -23,7 +23,7 @@
private final Logger log = LoggerFactory.getLogger(ExceptionTest.class);
public void testOptimisticLockingException() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
EntityManager em2 = factory.createEntityManager();
em.getTransaction().begin();
Music music = new Music();
@@ -31,11 +31,17 @@
em.persist( music );
em.getTransaction().commit();
- em2.getTransaction().begin();
- Music music2 = em2.find( Music.class, music.getId() );
- music2.setName( "HouseMusic" );
- em2.getTransaction().commit();
- em2.close();
+ try {
+ em2.getTransaction().begin();
+ Music music2 = em2.find( Music.class, music.getId() );
+ music2.setName( "HouseMusic" );
+ em2.getTransaction().commit();
+ } catch (Exception e){
+ em2.getTransaction().rollback();
+ throw e;
+ } finally {
+ em2.close();
+ }
em.getTransaction().begin();
music.setName( "Rock" );
@@ -58,7 +64,7 @@
}
public void testEntityNotFoundException() throws Exception {
- EntityManager em = factory.createEntityManager( );
+ EntityManager em = getEntityManager( );
Music music = em.getReference( Music.class, new Integer(-1) );
try {
music.getName();
@@ -73,7 +79,7 @@
}
public void testConstraintViolationException() throws Exception {
- EntityManager em = factory.createEntityManager( );
+ EntityManager em = getEntityManager( );
em.getTransaction().begin();
Music music = new Music();
music.setName( "Jazz" );
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/inheritance/InheritanceTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/inheritance/InheritanceTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/inheritance/InheritanceTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -11,7 +11,7 @@
public class InheritanceTest extends TestCase {
public void testFind() throws Exception {
- EntityManager firstSession = factory.createEntityManager( );
+ EntityManager firstSession = getEntityManager( );
Strawberry u = new Strawberry();
u.setSize( 12l );
firstSession.getTransaction().begin();
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/lob/BlobTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/lob/BlobTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/lob/BlobTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -18,7 +18,7 @@
public class BlobTest extends TestCase {
public void testBlobSerialization() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Map image = new HashMap();
image.put( "meta", "metadata" );
@@ -31,7 +31,7 @@
em.persist( reader );
em.getTransaction().commit();
em.close(); //useless but y'a know
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
reader = em.find( ImageReader.class, reader.getId() );
ObjectInputStream ois = new ObjectInputStream( reader.getImage().getBinaryStream() );
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/lock/LockTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/lock/LockTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/lock/LockTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -14,7 +14,7 @@
public void testLockRead() throws Exception {
Lock lock = new Lock();
lock.setName( "name" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( lock );
em.getTransaction().commit();
@@ -35,7 +35,7 @@
public void testLockWrite() throws Exception {
Lock lock = new Lock();
lock.setName( "second" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( lock );
em.getTransaction().commit();
@@ -61,7 +61,7 @@
public void testLockWriteOnUnversioned() throws Exception {
UnversionedLock lock = new UnversionedLock();
lock.setName( "second" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( lock );
em.getTransaction().commit();
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/ops/FindTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/ops/FindTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/ops/FindTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -14,7 +14,7 @@
Mammal mammal = new Mammal();
mammal.setMamalNbr( 2 );
mammal.setName( "Human" );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( mammal );
em.flush();
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/ops/MergeNewTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/ops/MergeNewTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/ops/MergeNewTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -14,7 +14,7 @@
Workload load = new Workload();
load.name = "Cleaning";
load.load = 10;
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
load = em.merge( load );
assertNotNull( load.id );
@@ -28,20 +28,20 @@
Workload load = new Workload();
load.name = "Cleaning";
load.load = 10;
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
load = em.merge( load );
em.flush();
em.getTransaction().commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
load = em.find( Workload.class, load.id );
em.remove( load );
em.flush();
em.getTransaction().commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
em.merge( load );
em.flush();
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/transaction/FlushAndTransactionTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/transaction/FlushAndTransactionTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/transaction/FlushAndTransactionTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -21,7 +21,7 @@
public void testAlwaysTransactionalOperations() throws Exception {
Book book = new Book();
book.name = "Le petit prince";
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( book );
em.getTransaction().commit();
@@ -47,7 +47,7 @@
// public void testTransactionalOperationsWhenTransactional() throws Exception {
// Book book = new Book();
// book.name = "Le petit prince";
-// EntityManager em = factory.createEntityManager( PersistenceContextType.TRANSACTION );
+// EntityManager em = getEntityManager( PersistenceContextType.TRANSACTION );
// try {
// em.persist( book );
// fail("flush has to be inside a Tx");
@@ -75,7 +75,7 @@
public void testTransactionalOperationsWhenExtended() throws Exception {
Book book = new Book();
book.name = "Le petit prince";
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
Statistics stats = ( (HibernateEntityManagerFactory) factory ).getSessionFactory().getStatistics();
stats.clear();
stats.setStatisticsEnabled( true );
@@ -118,7 +118,7 @@
public void testMergeWhenExtended() throws Exception {
Book book = new Book();
book.name = "Le petit prince";
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
Statistics stats = ( (HibernateEntityManagerFactory) factory ).getSessionFactory().getStatistics();
em.getTransaction().begin();
@@ -159,7 +159,7 @@
}
public void testCloseAndTransaction() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Book book = new Book();
book.name = "Java for Dummies";
@@ -176,7 +176,7 @@
}
em.getTransaction().commit();
assertFalse( em.isOpen() );
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
book = em.find( Book.class, book.id );
assertEquals( "C# for Dummies", book.name );
@@ -186,14 +186,14 @@
}
public void testTransactionCommitDoesNotFlush() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Book book = new Book();
book.name = "Java for Dummies";
em.persist( book );
em.getTransaction().commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
List result = em.createQuery("select book from Book book where book.name = :title").
setParameter( "title", book.name ).getResultList();
@@ -203,14 +203,14 @@
}
public void testTransactionAndContains() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Book book = new Book();
book.name = "Java for Dummies";
em.persist( book );
em.getTransaction().commit();
em.close();
- em = factory.createEntityManager();
+ em = getEntityManager();
em.getTransaction().begin();
List result = em.createQuery("select book from Book book where book.name = :title").
setParameter( "title", book.name ).getResultList();
@@ -225,7 +225,7 @@
Book book = new Book();
book.name = "Stolen keys";
book.id = null; //new Integer( 50 );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
try {
em.persist( book );
@@ -260,7 +260,7 @@
Book book = new Book();
book.name = "Stolen keys";
book.id = null; //new Integer( 50 );
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( book );
em.flush();
@@ -287,7 +287,7 @@
public void testRollbackClearPC() throws Exception {
Book book = new Book();
book.name = "Stolen keys";
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist( book );
em.getTransaction().commit();
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/xml/XmlAttributeOverrideTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/xml/XmlAttributeOverrideTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/xml/XmlAttributeOverrideTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -11,7 +11,7 @@
public class XmlAttributeOverrideTest extends TestCase {
public void testAttributeOverriding() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
Employee e = new Employee();
@@ -29,7 +29,7 @@
}
public void testDefaultEventListener() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.getTransaction().begin();
CounterListener.reset();
Modified: entitymanager/trunk/src/test/org/hibernate/ejb/test/xml/XmlTest.java
===================================================================
--- entitymanager/trunk/src/test/org/hibernate/ejb/test/xml/XmlTest.java 2008-10-08 11:44:18 UTC (rev 15282)
+++ entitymanager/trunk/src/test/org/hibernate/ejb/test/xml/XmlTest.java 2008-10-08 11:58:24 UTC (rev 15283)
@@ -10,7 +10,7 @@
*/
public class XmlTest extends TestCase {
public void testXmlMappingCorrectness() throws Exception {
- EntityManager em = factory.createEntityManager();
+ EntityManager em = getEntityManager();
em.close();
}
15 years, 6 months
Hibernate SVN: r15282 - core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/criterion.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-08 07:44:18 -0400 (Wed, 08 Oct 2008)
New Revision: 15282
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/criterion/Projection.java
Log:
javadoc
Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/criterion/Projection.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/criterion/Projection.java 2008-10-08 11:44:03 UTC (rev 15281)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/criterion/Projection.java 2008-10-08 11:44:18 UTC (rev 15282)
@@ -1,4 +1,27 @@
-//$Id$
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ *
+ */
package org.hibernate.criterion;
@@ -9,73 +32,106 @@
import org.hibernate.type.Type;
/**
- * An object-oriented representation of a query result set projection
- * in a <tt>Criteria</tt> query. Built-in projection types are provided
- * by the <tt>Projections</tt> factory class.
- * This interface might be implemented by application classes that
- * define custom projections.
+ * An object-oriented representation of a query result set projection in a {@link Criteria} query.
+ * Built-in projection types are provided by the {@link Projections} factory class. This interface might be
+ * implemented by application classes that define custom projections.
*
+ * @author Gavin King
+ * @author Steve Ebersole
* @see Projections
- * @see org.hibernate.Criteria
- * @author Gavin King
+ * @see Criteria
*/
public interface Projection extends Serializable {
/**
- * Render the SQL fragment
- * @param criteriaQuery
- * @param columnAlias
- * @return String
- * @throws HibernateException
+ * Render the SQL fragment to be used in the <tt>SELECT</tt> clause.
+ *
+ * @param criteria The local criteria to which this project is attached (for resolution).
+ * @param position The number of columns rendered in the <tt>SELECT</tt> clause before this projection. Generally
+ * speaking this is useful to ensure uniqueness of the individual columns aliases.
+ * @param criteriaQuery The overall criteria query instance.
+ * @return The SQL fragment to plug into the <tt>SELECT</tt>
+ * @throws HibernateException Indicates a problem performing the rendering
*/
- public String toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery)
- throws HibernateException;
-
+ public String toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery)
+ throws HibernateException;
+
/**
- * Render the SQL fragment to be used in the group by clause
- * @param criteriaQuery
- * @param columnAlias
- * @return String
- * @throws HibernateException
+ * Render the SQL fragment to be used in the <tt>GROUP BY</tt> clause
+ *
+ * @param criteria The local criteria to which this project is attached (for resolution).
+ * @param criteriaQuery The overall criteria query instance.
+ * @return The SQL fragment to plug into the <tt>GROUP BY</tt>
+ * @throws HibernateException Indicates a problem performing the rendering
*/
- public String toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
- throws HibernateException;
-
+ public String toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
+ throws HibernateException;
+
/**
- * Return types returned by the rendered SQL fragment
- * @param criteria
- * @param criteriaQuery
- * @return Type[]
- * @throws HibernateException
+ * Types returned by the rendered SQL {@link #toSqlString fragment}. In other words what are the types
+ * that would represent the values this projection asked to be pulled into the result set?
+ *
+ * @param criteria The local criteria to which this project is attached (for resolution).
+ * @param criteriaQuery The overall criteria query instance.
+ * @return The return types.
+ * @throws HibernateException Indicates a problem resolving the types
*/
- public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery)
- throws HibernateException;
+ public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery)
+ throws HibernateException;
+
/**
- * Return types for a particular user-visible alias
+ * Get the return types for a particular user-visible alias.
+ * <p/>
+ * Differs from {@link #getTypes(org.hibernate.Criteria, CriteriaQuery)} in that here we are only interested in
+ * the types related to the given criteria-level alias.
+ *
+ * @param alias The criteria-level alias for which to find types.
+ * @param criteria The local criteria to which this project is attached (for resolution).
+ * @param criteriaQuery The overall criteria query instance.
+ * @return The return types; expected to return null if this projection does not understand this alias.
+ * @throws HibernateException Indicates a problem resolving the types
*/
- public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery)
- throws HibernateException;
-
+ public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery)
+ throws HibernateException;
+
+
/**
- * Get the SQL select clause column aliases
+ * Get the SQL column aliases used by this projection for the columns it writes for inclusion into the
+ * <tt>SELECT</tt> clause ({@link #toSqlString}. Hibernate always uses column aliases to extract data from the
+ * JDBC {@link java.sql.ResultSet}, so it is important that these be implemented correctly in order for
+ * Hibernate to be able to extract these val;ues correctly.
+ *
+ * @param position Just as in {@link #toSqlString}, represents the number of <b>columns</b> rendered
+ * prior to this projection.
+ * @return The columns aliases.
*/
- public String[] getColumnAliases(int loc);
+ public String[] getColumnAliases(int position);
+
/**
- * Get the SQL select clause column aliases for a particular
- * user-visible alias
+ * Get the SQL column aliases used by this projection for the columns it writes for inclusion into the
+ * <tt>SELECT</tt> clause ({@link #toSqlString} <i>for a particular criteria-level alias</i>.
+ *
+ * @param alias The criteria-level alias
+ * @param position Just as in {@link #toSqlString}, represents the number of <b>columns</b> rendered
+ * prior to this projection.
+ * @return The columns aliases pertaining to a particular criteria-level alias; expected to return null if
+ * this projection does not understand this alias.
*/
- public String[] getColumnAliases(String alias, int loc);
-
+ public String[] getColumnAliases(String alias, int position);
+
/**
- * Get the user-visible aliases for this projection
- * (ie. the ones that will be passed to the
- * <tt>ResultTransformer</tt>)
+ * Get the criteria-level aliases for this projection (ie. the ones that will be passed to the
+ * {@link org.hibernate.transform.ResultTransformer})
+ *
+ * @return The aliases
*/
public String[] getAliases();
-
+
/**
- * Does this projection specify grouping attributes?
+ * Is this projection fragment (<tt>SELECT</tt> clause) also part of the <tt>GROUP BY</tt>
+ *
+ * @return True if the projection is also part of the <tt>GROUP BY</tt>; false otherwise.
*/
public boolean isGrouped();
-
+
}
15 years, 6 months
Hibernate SVN: r15281 - core/trunk/core/src/main/java/org/hibernate/criterion.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-08 07:44:03 -0400 (Wed, 08 Oct 2008)
New Revision: 15281
Modified:
core/trunk/core/src/main/java/org/hibernate/criterion/Projection.java
Log:
javadoc
Modified: core/trunk/core/src/main/java/org/hibernate/criterion/Projection.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/Projection.java 2008-10-08 11:43:20 UTC (rev 15280)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/Projection.java 2008-10-08 11:44:03 UTC (rev 15281)
@@ -32,73 +32,106 @@
import org.hibernate.type.Type;
/**
- * An object-oriented representation of a query result set projection
- * in a <tt>Criteria</tt> query. Built-in projection types are provided
- * by the <tt>Projections</tt> factory class.
- * This interface might be implemented by application classes that
- * define custom projections.
+ * An object-oriented representation of a query result set projection in a {@link Criteria} query.
+ * Built-in projection types are provided by the {@link Projections} factory class. This interface might be
+ * implemented by application classes that define custom projections.
*
+ * @author Gavin King
+ * @author Steve Ebersole
* @see Projections
- * @see org.hibernate.Criteria
- * @author Gavin King
+ * @see Criteria
*/
public interface Projection extends Serializable {
/**
- * Render the SQL fragment
- * @param criteriaQuery
- * @param columnAlias
- * @return String
- * @throws HibernateException
+ * Render the SQL fragment to be used in the <tt>SELECT</tt> clause.
+ *
+ * @param criteria The local criteria to which this project is attached (for resolution).
+ * @param position The number of columns rendered in the <tt>SELECT</tt> clause before this projection. Generally
+ * speaking this is useful to ensure uniqueness of the individual columns aliases.
+ * @param criteriaQuery The overall criteria query instance.
+ * @return The SQL fragment to plug into the <tt>SELECT</tt>
+ * @throws HibernateException Indicates a problem performing the rendering
*/
- public String toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery)
- throws HibernateException;
-
+ public String toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery)
+ throws HibernateException;
+
/**
- * Render the SQL fragment to be used in the group by clause
- * @param criteriaQuery
- * @param columnAlias
- * @return String
- * @throws HibernateException
+ * Render the SQL fragment to be used in the <tt>GROUP BY</tt> clause
+ *
+ * @param criteria The local criteria to which this project is attached (for resolution).
+ * @param criteriaQuery The overall criteria query instance.
+ * @return The SQL fragment to plug into the <tt>GROUP BY</tt>
+ * @throws HibernateException Indicates a problem performing the rendering
*/
- public String toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
- throws HibernateException;
-
+ public String toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
+ throws HibernateException;
+
/**
- * Return types returned by the rendered SQL fragment
- * @param criteria
- * @param criteriaQuery
- * @return Type[]
- * @throws HibernateException
+ * Types returned by the rendered SQL {@link #toSqlString fragment}. In other words what are the types
+ * that would represent the values this projection asked to be pulled into the result set?
+ *
+ * @param criteria The local criteria to which this project is attached (for resolution).
+ * @param criteriaQuery The overall criteria query instance.
+ * @return The return types.
+ * @throws HibernateException Indicates a problem resolving the types
*/
- public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery)
- throws HibernateException;
+ public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery)
+ throws HibernateException;
+
/**
- * Return types for a particular user-visible alias
+ * Get the return types for a particular user-visible alias.
+ * <p/>
+ * Differs from {@link #getTypes(org.hibernate.Criteria, CriteriaQuery)} in that here we are only interested in
+ * the types related to the given criteria-level alias.
+ *
+ * @param alias The criteria-level alias for which to find types.
+ * @param criteria The local criteria to which this project is attached (for resolution).
+ * @param criteriaQuery The overall criteria query instance.
+ * @return The return types; expected to return null if this projection does not understand this alias.
+ * @throws HibernateException Indicates a problem resolving the types
*/
- public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery)
- throws HibernateException;
-
+ public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery)
+ throws HibernateException;
+
+
/**
- * Get the SQL select clause column aliases
+ * Get the SQL column aliases used by this projection for the columns it writes for inclusion into the
+ * <tt>SELECT</tt> clause ({@link #toSqlString}. Hibernate always uses column aliases to extract data from the
+ * JDBC {@link java.sql.ResultSet}, so it is important that these be implemented correctly in order for
+ * Hibernate to be able to extract these val;ues correctly.
+ *
+ * @param position Just as in {@link #toSqlString}, represents the number of <b>columns</b> rendered
+ * prior to this projection.
+ * @return The columns aliases.
*/
- public String[] getColumnAliases(int loc);
+ public String[] getColumnAliases(int position);
+
/**
- * Get the SQL select clause column aliases for a particular
- * user-visible alias
+ * Get the SQL column aliases used by this projection for the columns it writes for inclusion into the
+ * <tt>SELECT</tt> clause ({@link #toSqlString} <i>for a particular criteria-level alias</i>.
+ *
+ * @param alias The criteria-level alias
+ * @param position Just as in {@link #toSqlString}, represents the number of <b>columns</b> rendered
+ * prior to this projection.
+ * @return The columns aliases pertaining to a particular criteria-level alias; expected to return null if
+ * this projection does not understand this alias.
*/
- public String[] getColumnAliases(String alias, int loc);
-
+ public String[] getColumnAliases(String alias, int position);
+
/**
- * Get the user-visible aliases for this projection
- * (ie. the ones that will be passed to the
- * <tt>ResultTransformer</tt>)
+ * Get the criteria-level aliases for this projection (ie. the ones that will be passed to the
+ * {@link org.hibernate.transform.ResultTransformer})
+ *
+ * @return The aliases
*/
public String[] getAliases();
-
+
/**
- * Does this projection specify grouping attributes?
+ * Is this projection fragment (<tt>SELECT</tt> clause) also part of the <tt>GROUP BY</tt>
+ *
+ * @return True if the projection is also part of the <tt>GROUP BY</tt>; false otherwise.
*/
public boolean isGrouped();
-
+
}
15 years, 6 months
Hibernate SVN: r15280 - in core/branches/Branch_3_2: src/org/hibernate/hql/ast and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-10-08 07:43:20 -0400 (Wed, 08 Oct 2008)
New Revision: 15280
Modified:
core/branches/Branch_3_2/src/org/hibernate/dialect/Dialect.java
core/branches/Branch_3_2/src/org/hibernate/hql/ast/HqlSqlWalker.java
core/branches/Branch_3_2/test/org/hibernate/test/hql/BulkManipulationTest.java
Log:
HHH-3519 : VM-based timestamps are not generated for DB2
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/Dialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/Dialect.java 2008-10-08 11:34:28 UTC (rev 15279)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/Dialect.java 2008-10-08 11:43:20 UTC (rev 15280)
@@ -1585,7 +1585,7 @@
/**
* Does this dialect support parameters within the select clause of
- * INSERT ... SELECT ... statements?
+ * INSERT ... SELECT ... ? ... statements?
*
* @return True if this is supported; false otherwise.
* @since 3.2
@@ -1595,6 +1595,17 @@
}
/**
+ * Does this dialect support casted parameters within the select clause of
+ * INSERT ... SELECT ... cast( ? as <type> ) statements?
+ *
+ * @return True if this is supported; false otherwise.
+ * @since 3.2
+ */
+ public boolean supportsCastedParametersInInsertSelect() {
+ return true;
+ }
+
+ /**
* Does this dialect support asking the result set its positioning
* information on forward only cursors. Specifically, in the case of
* scrolling fetches, Hibernate needs to use
Modified: core/branches/Branch_3_2/src/org/hibernate/hql/ast/HqlSqlWalker.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/hql/ast/HqlSqlWalker.java 2008-10-08 11:34:28 UTC (rev 15279)
+++ core/branches/Branch_3_2/src/org/hibernate/hql/ast/HqlSqlWalker.java 2008-10-08 11:43:20 UTC (rev 15280)
@@ -15,6 +15,7 @@
import org.apache.commons.logging.LogFactory;
import org.hibernate.QueryException;
import org.hibernate.HibernateException;
+import org.hibernate.AssertionFailure;
import org.hibernate.engine.JoinSequence;
import org.hibernate.engine.ParameterBinder;
import org.hibernate.engine.SessionFactoryImplementor;
@@ -666,6 +667,34 @@
( ( ParameterNode ) versionValueNode ).setHqlParameterSpecification( paramSpec );
parameters.add( 0, paramSpec );
}
+ else if ( sessionFactoryHelper.getFactory().getDialect().supportsCastedParametersInInsertSelect() ) {
+ int sqlTypes[] = versionType.sqlTypes( sessionFactoryHelper.getFactory() );
+ if ( sqlTypes == null || sqlTypes.length == 0 ) {
+ throw new AssertionFailure( versionType.getClass() + "sqlTypes() returns null or empty array" );
+ }
+ if ( sqlTypes.length > 1 ) {
+ throw new UnsupportedOperationException( versionType.getClass() +
+ ".sqlTypes() returns > 1 element; only single-valued versions are allowed." );
+ }
+ MethodNode versionMethodNode = ( MethodNode ) getASTFactory().create( HqlSqlTokenTypes.METHOD_CALL, "(" );
+ AST methodIdentNode = getASTFactory().create( HqlSqlTokenTypes.IDENT, "cast" );
+ versionMethodNode.initializeMethodNode(methodIdentNode, true );
+ versionMethodNode.addChild( methodIdentNode );
+ AST castExprListNode = getASTFactory().create( HqlSqlTokenTypes.EXPR_LIST, "exprList" );
+ methodIdentNode.setNextSibling( castExprListNode );
+ AST paramNode = getASTFactory().create( HqlSqlTokenTypes.PARAM, "?" );
+ ParameterSpecification paramSpec = new VersionTypeSeedParameterSpecification( versionType );
+ ( ( ParameterNode ) paramNode ).setHqlParameterSpecification( paramSpec );
+ castExprListNode.addChild( paramNode );
+ paramNode.setNextSibling(
+ getASTFactory().create(
+ HqlSqlTokenTypes.IDENT,
+ sessionFactoryHelper.getFactory().getDialect().getTypeName( sqlTypes[0] ) )
+ );
+ processFunction( versionMethodNode, true );
+ versionValueNode = versionMethodNode;
+ parameters.add( 0, paramSpec );
+ }
else {
if ( isIntegral( versionType ) ) {
try {
Modified: core/branches/Branch_3_2/test/org/hibernate/test/hql/BulkManipulationTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/hql/BulkManipulationTest.java 2008-10-08 11:34:28 UTC (rev 15279)
+++ core/branches/Branch_3_2/test/org/hibernate/test/hql/BulkManipulationTest.java 2008-10-08 11:43:20 UTC (rev 15280)
@@ -415,11 +415,14 @@
reportSkip( "bulk id generation not supported", "test bulk inserts with generated id and generated timestamp");
return;
}
+
// dialects which do not allow a parameter in the select portion of an INSERT ... SELECT statement
// will also be problematic for this test because the timestamp here is vm-based as opposed to
// db-based.
- if ( !getDialect().supportsParametersInInsertSelect() ) {
- reportSkip( "dialect does not support parameter in INSERT ... SELECT", "test bulk inserts with generated id and generated timestamp");
+ if ( !getDialect().supportsParametersInInsertSelect() &&
+ !getDialect().supportsCastedParametersInInsertSelect() ) {
+ reportSkip( "dialect does not support parameter in INSERT ... SELECT",
+ "test bulk inserts with generated id and generated timestamp");
return;
}
@@ -471,7 +474,6 @@
s.close();
}
-
// UPDATES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public void testIncorrectSyntax() {
15 years, 6 months
Hibernate SVN: r15279 - in core/branches/Branch_3_2_4_SP1_CP: src/org/hibernate/hql/ast and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-10-08 07:34:28 -0400 (Wed, 08 Oct 2008)
New Revision: 15279
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/dialect/Dialect.java
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/HqlSqlWalker.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/BulkManipulationTest.java
Log:
JBPAPP-949 HHH-3519 : VM-based timestamps are not generated for DB2
Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/dialect/Dialect.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/dialect/Dialect.java 2008-10-08 09:13:49 UTC (rev 15278)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/dialect/Dialect.java 2008-10-08 11:34:28 UTC (rev 15279)
@@ -1595,7 +1595,7 @@
/**
* Does this dialect support parameters within the select clause of
- * INSERT ... SELECT ... statements?
+ * INSERT ... SELECT ... ? ... statements?
*
* @return True if this is supported; false otherwise.
* @since 3.2
@@ -1605,6 +1605,17 @@
}
/**
+ * Does this dialect support casted parameters within the select clause of
+ * INSERT ... SELECT ... cast( ? as <type> ) statements?
+ *
+ * @return True if this is supported; false otherwise.
+ * @since 3.2
+ */
+ public boolean supportsCastedParametersInInsertSelect() {
+ return true;
+ }
+
+ /**
* Does this dialect support asking the result set its positioning
* information on forward only cursors. Specifically, in the case of
* scrolling fetches, Hibernate needs to use
Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/HqlSqlWalker.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/HqlSqlWalker.java 2008-10-08 09:13:49 UTC (rev 15278)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/hql/ast/HqlSqlWalker.java 2008-10-08 11:34:28 UTC (rev 15279)
@@ -10,11 +10,13 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.Arrays;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.QueryException;
import org.hibernate.HibernateException;
+import org.hibernate.AssertionFailure;
import org.hibernate.engine.JoinSequence;
import org.hibernate.engine.ParameterBinder;
import org.hibernate.engine.SessionFactoryImplementor;
@@ -654,6 +656,34 @@
( ( ParameterNode ) versionValueNode ).setHqlParameterSpecification( paramSpec );
parameters.add( 0, paramSpec );
}
+ else if ( sessionFactoryHelper.getFactory().getDialect().supportsCastedParametersInInsertSelect() ) {
+ int sqlTypes[] = versionType.sqlTypes( sessionFactoryHelper.getFactory() );
+ if ( sqlTypes == null || sqlTypes.length == 0 ) {
+ throw new AssertionFailure( versionType.getClass() + "sqlTypes() returns null or empty array" );
+ }
+ if ( sqlTypes.length > 1 ) {
+ throw new UnsupportedOperationException( versionType.getClass() +
+ ".sqlTypes() returns > 1 element; only single-valued versions are allowed." );
+ }
+ MethodNode versionMethodNode = ( MethodNode ) getASTFactory().create( HqlSqlTokenTypes.METHOD_CALL, "(" );
+ AST methodIdentNode = getASTFactory().create( HqlSqlTokenTypes.IDENT, "cast" );
+ versionMethodNode.initializeMethodNode(methodIdentNode, true );
+ versionMethodNode.addChild( methodIdentNode );
+ AST castExprListNode = getASTFactory().create( HqlSqlTokenTypes.EXPR_LIST, "exprList" );
+ methodIdentNode.setNextSibling( castExprListNode );
+ AST paramNode = getASTFactory().create( HqlSqlTokenTypes.PARAM, "?" );
+ ParameterSpecification paramSpec = new VersionTypeSeedParameterSpecification( versionType );
+ ( ( ParameterNode ) paramNode ).setHqlParameterSpecification( paramSpec );
+ castExprListNode.addChild( paramNode );
+ paramNode.setNextSibling(
+ getASTFactory().create(
+ HqlSqlTokenTypes.IDENT,
+ sessionFactoryHelper.getFactory().getDialect().getTypeName( sqlTypes[0] ) )
+ );
+ processFunction( versionMethodNode, true );
+ versionValueNode = versionMethodNode;
+ parameters.add( 0, paramSpec );
+ }
else {
if ( isIntegral( versionType ) ) {
try {
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/BulkManipulationTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/BulkManipulationTest.java 2008-10-08 09:13:49 UTC (rev 15278)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/BulkManipulationTest.java 2008-10-08 11:34:28 UTC (rev 15279)
@@ -416,7 +416,8 @@
// dialects which do not allow a parameter in the select portion of an INSERT ... SELECT statement
// will also be problematic for this test because the timestamp here is vm-based as opposed to
// db-based.
- if ( !getDialect().supportsParametersInInsertSelect() ) {
+ if ( !getDialect().supportsParametersInInsertSelect() &&
+ !getDialect().supportsCastedParametersInInsertSelect() ) {
reportSkip( "dialect does not support parameter in INSERT ... SELECT",
"test bulk inserts with generated id and generated timestamp");
return;
15 years, 6 months