From d7c4128826db40017b91e61b72aaba9ed0eba89e Mon Sep 17 00:00:00 2001 From: John Verhaeg Date: Thu, 26 Jul 2012 15:32:19 -0500 Subject: [PATCH] HHH-7474: Added @FailureExpectedWithNewMetamodel annotation to all remaining tests that fail with the new metamodel, but still a couple of strange failures happening with some Envers tests. --- .../xml/ejb3/OrmVersion1SupportedTest.java | 6 +- .../org/hibernate/test/any/AnyTypeTest.java | 2 + .../org/hibernate/test/array/ArrayTest.java | 2 + .../test/batchfetch/BatchFetchTest.java | 2 + .../org/hibernate/test/bidi/AuctionTest.java | 3 + .../test/cache/InsertedDataTest.java | 7 + .../test/cascade/MultiPathCascadeTest.java | 2 + .../hibernate/test/cascade/RefreshTest.java | 2 + .../cid/CompositeIdWithGeneratorTest.java | 126 ++++++++-------- .../compkey/BackrefCompositeMapKeyTest.java | 2 + .../collection/bag/PersistentBagTest.java | 2 + ...rCollectionTypeAnnotationsVariantTest.java | 3 + .../UserCollectionTypeHbmVariantTest.java | 3 + ...rCollectionTypeAnnotationsVariantTest.java | 3 + ...rizedUserCollectionTypeHbmVariantTest.java | 4 + .../collection/idbag/PersistentIdBagTest.java | 2 + .../collection/list/PersistentListTest.java | 2 + .../collection/map/PersistentMapTest.java | 2 + .../OrderCollectionOfJoinedHierarchyTest.java | 2 + .../collection/original/CollectionTest.java | 2 + .../set/PersistentSetNonLazyTest.java | 3 + .../collection/set/PersistentSetTest.java | 2 + .../component/basic2/ComponentJoinsTest.java | 2 + .../CascadeToComponentCollectionTest.java | 3 + .../CascadeToComponentAssociationTest.java | 2 + .../CompositeElementTest.java | 4 +- .../connections/AggressiveReleaseTest.java | 2 + .../BasicConnectionProviderTest.java | 2 + .../CurrentSessionConnectionTest.java | 2 + .../HibernateCreateBlobFailedCase.java | 2 + .../connections/SuppliedConnectionTest.java | 2 + .../ThreadLocalCurrentSessionTest.java | 2 + .../test/criteria/ComplexJoinAliasTest.java | 2 + .../test/criteria/CriteriaQueryTest.java | 34 ++--- .../test/cuk/CompositePropertyRefTest.java | 20 +-- .../test/cut/CompositeUserTypeTest.java | 26 ++-- .../DeleteTransientEntityTest.java | 3 + .../CustomDirtinessStrategyTest.java | 2 + .../test/discriminator/DiscriminatorTest.java | 3 +- .../InterceptorDynamicEntityTest.java | 2 + .../tuplizer/TuplizerDynamicEntityTest.java | 2 + .../ImprovedTuplizerDynamicEntityTest.java | 4 + .../test/ecid/EmbeddedCompositeIdTest.java | 16 ++- .../map/basic/DynamicClassTest.java | 10 +- .../map/subclass/SubclassDynamicMapTest.java | 2 + .../EntityNameFromSubClassTest.java | 5 +- ...ManyToManyBagToSetCollectionEventTest.java | 2 + ...ManyToManySetToSetCollectionEventTest.java | 2 + ...ionalManyToManyBagCollectionEventTest.java | 2 + .../values/ValuesBagCollectionEventTest.java | 2 + .../hibernate/test/events/CallbackTest.java | 2 + .../exception/SQLExceptionConversionTest.java | 3 + .../test/extralazy/ExtraLazyTest.java | 16 ++- .../join/JoinFetchProfileTest.java | 9 ++ .../test/filter/DynamicFilterTest.java | 2 + .../BasicFilteredBulkManipulationTest.java | 2 + .../JoinedFilteredBulkManipulationTest.java | 3 + .../TestAutoFlushBeforeQueryExecution.java | 4 +- ...TestCollectionInitializingDuringFlush.java | 2 + .../test/formulajoin/FormulaJoinTest.java | 15 +- .../identity/IdentityGeneratedKeysTest.java | 4 + .../test/hql/ASTParserLoadingOrderByTest.java | 6 +- .../test/hql/ASTParserLoadingTest.java | 2 + .../test/hql/BulkManipulationTest.java | 9 +- .../test/hql/ClassicTranslatorTest.java | 2 + .../CriteriaClassicAggregationReturnTest.java | 2 + .../test/hql/CriteriaHQLAlignmentTest.java | 62 ++++---- .../org/hibernate/test/hql/EJBQLTest.java | 2 + .../java/org/hibernate/test/hql/HQLTest.java | 18 +-- .../hql/ScrollableCollectionFetchingTest.java | 9 +- .../hibernate/test/hql/WithClauseTest.java | 3 + .../JoinedSubclassBulkManipTest.java | 2 + .../id/MultipleHiLoPerTableGeneratorTest.java | 9 +- .../org/hibernate/test/idbag/IdBagTest.java | 18 +-- .../hibernate/test/idclass/IdClassTest.java | 11 +- .../BigIntegerSequenceGeneratorTest.java | 3 + .../BasicForcedTableSequenceTest.java | 3 + .../HiLoForcedTableSequenceTest.java | 3 + .../PooledForcedTableSequenceTest.java | 3 + .../enhanced/sequence/BasicSequenceTest.java | 2 + .../enhanced/sequence/HiLoSequenceTest.java | 3 + .../enhanced/sequence/PooledSequenceTest.java | 2 + .../idgen/enhanced/table/BasicTableTest.java | 2 + .../idgen/enhanced/table/HiLoTableTest.java | 2 + .../idgen/enhanced/table/PooledTableTest.java | 2 + .../IdentifierPropertyReferencesTest.java | 2 + .../test/immutable/ImmutableTest.java | 10 +- .../EntityWithInverseManyToManyTest.java | 2 + .../EntityWithInverseOneToManyJoinTest.java | 3 + .../EntityWithInverseOneToManyTest.java | 3 + ...sionedEntityWithInverseManyToManyTest.java | 2 + ...thInverseOneToManyFailureExpectedTest.java | 3 + ...verseOneToManyJoinFailureExpectedTest.java | 3 + ...nedEntityWithInverseOneToManyJoinTest.java | 5 + ...rsionedEntityWithInverseOneToManyTest.java | 5 + .../EntityWithNonInverseManyToManyTest.java | 2 + ...ityWithNonInverseManyToManyUnidirTest.java | 2 + ...EntityWithNonInverseOneToManyJoinTest.java | 3 + .../EntityWithNonInverseOneToManyTest.java | 3 + ...tityWithNonInverseOneToManyUnidirTest.java | 3 + ...nedEntityWithNonInverseManyToManyTest.java | 2 + ...EntityWithNonInverseOneToManyJoinTest.java | 3 + ...onedEntityWithNonInverseOneToManyTest.java | 3 + .../test/interceptor/InterceptorTest.java | 5 + .../interfaceproxy/InterfaceProxyTest.java | 20 +-- .../hibernate/test/iterate/IterateTest.java | 4 + .../org/hibernate/test/join/JoinTest.java | 46 +++--- .../hibernate/test/join/OptionalJoinTest.java | 4 +- .../joinedsubclass/JoinedSubclassTest.java | 18 +-- .../test/joinfetch/JoinFetchTest.java | 22 +-- .../jpa/naturalid/MutableNaturalIdTest.java | 2 + .../test/jpa/proxy/JPAProxyTest.java | 2 + .../test/jpa/ql/FunctionKeywordTest.java | 2 + .../test/jpa/ql/JPAQLComplianceTest.java | 4 +- .../test/jpa/ql/NativeQueryTest.java | 2 + .../hibernate/test/jpa/ql/OnKeywordTest.java | 2 + .../test/jpa/removed/RemovedEntityTest.java | 2 + .../test/jpa/txn/TransactionJoiningTest.java | 2 + .../component/EagerKeyManyToOneTest.java | 2 + .../bidir/component/LazyKeyManyToOneTest.java | 2 + .../bidir/embedded/KeyManyToOneTest.java | 2 + .../test/lazyonetoone/LazyOneToOneTest.java | 6 +- .../hibernate/test/legacy/ABCProxyTest.java | 2 + .../org/hibernate/test/legacy/ABCTest.java | 11 +- .../test/legacy/ComponentNotNullTest.java | 2 + .../hibernate/test/legacy/CustomSQLTest.java | 2 + .../org/hibernate/test/legacy/FooBarTest.java | 2 + .../org/hibernate/test/legacy/FumTest.java | 12 +- .../org/hibernate/test/legacy/IJ2Test.java | 3 + .../org/hibernate/test/legacy/MapTest.java | 2 + .../test/legacy/MasterDetailTest.java | 4 +- .../hibernate/test/legacy/MultiTableTest.java | 2 + .../test/legacy/OneToOneCacheTest.java | 2 + .../test/legacy/ParentChildTest.java | 24 ++-- .../test/legacy/QueryByExampleTest.java | 2 + .../test/legacy/SQLFunctionsTest.java | 2 + .../hibernate/test/legacy/SQLLoaderTest.java | 24 ++-- .../hibernate/test/legacy/StatisticsTest.java | 4 +- .../hibernate/test/locking/LockModeTest.java | 5 +- .../test/manytomany/ManyToManyTest.java | 8 +- .../batchload/BatchedManyToManyTest.java | 3 + .../ordered/OrderedManyToManyTest.java | 2 + ...ToManyAssociationClassCompositeIdTest.java | 2 + ...yToManyAssociationClassAssignedIdTest.java | 2 + ...ToManyAssociationClassGeneratedIdTest.java | 5 + .../test/map/MapIndexFormulaTest.java | 7 +- .../mapcompelem/MapCompositeElementTest.java | 17 ++- .../mapelemformula/MapElementFormulaTest.java | 5 +- .../org/hibernate/test/mixed/MixedTest.java | 6 +- .../namingstrategy/NamingStrategyTest.java | 2 + .../ImmutableEntityNaturalIdTest.java | 23 +-- .../inheritance/InheritedNaturalIdTest.java | 2 + .../mutable/MutableNaturalIdTest.java | 13 +- .../cached/CachedMutableNaturalIdTest.java | 65 +++++---- .../nullable/NullableNaturalIdTest.java | 2 + .../test/nonflushedchanges/CreateTest.java | 2 + .../test/nonflushedchanges/DeleteTest.java | 2 + .../test/nonflushedchanges/GetLoadTest.java | 3 + .../test/nonflushedchanges/MergeTest.java | 3 + .../hibernate/test/ondelete/OnDeleteTest.java | 20 +-- .../test/onetomany/OneToManyTest.java | 15 +- .../onetoone/formula/OneToOneFormulaTest.java | 34 +++-- .../joined/JoinedSubclassOneToOneTest.java | 36 ++--- .../test/onetoone/link/OneToOneLinkTest.java | 16 ++- .../nopojo/DynamicMapOneToOneTest.java | 2 + .../optional/OptionalOneToOneTest.java | 2 + .../DiscrimSubclassOneToOneTest.java | 36 ++--- .../org/hibernate/test/ops/CreateTest.java | 2 + .../org/hibernate/test/ops/DeleteTest.java | 2 + .../org/hibernate/test/ops/GetLoadTest.java | 12 +- .../org/hibernate/test/ops/MergeTest.java | 2 + .../hibernate/test/ops/SaveOrUpdateTest.java | 2 + .../test/optlock/OptimisticLockTest.java | 4 +- .../hibernate/test/ordered/OrderByTest.java | 15 +- .../test/orphan/PropertyRefTest.java | 4 +- .../DeleteOneToOneOrphansTest.java | 2 + .../composite/DeleteOneToOneOrphansTest.java | 2 + .../DeleteOneToOneOrphansTest.java | 3 + .../DeleteOneToOneOrphansTest.java | 3 + .../DeleteOneToOneOrphansTest.java | 2 + .../DeleteOneToOneOrphansTest.java | 2 + .../test/pagination/DistinctSelectTest.java | 5 +- .../propertyref/basic/PropertyRefTest.java | 30 ++-- .../CachedPropertyRefCollectionTest.java | 2 + .../CompleteComponentPropertyRefTest.java | 2 + .../PartialComponentPropertyRefTest.java | 11 +- .../discrim/SubclassPropertyRefTest.java | 2 + .../joined/JoinedSubclassPropertyRefTest.java | 3 + .../union/UnionSubclassPropertyRefTest.java | 2 + .../org/hibernate/test/proxy/ProxyTest.java | 2 + ...QueryCacheIgnoreResultTransformerTest.java | 2 + ...QueryCacheNormalResultTransformerTest.java | 2 + ...riaQueryCachePutResultTransformerTest.java | 2 + ...QueryCacheIgnoreResultTransformerTest.java | 2 + ...QueryCacheNormalResultTransformerTest.java | 2 + ...HqlQueryCachePutResultTransformerTest.java | 2 + .../test/querycache/QueryCacheTest.java | 2 + .../test/queryplan/GetHqlQueryPlanTest.java | 3 + .../readonly/ReadOnlyCriteriaQueryTest.java | 6 +- .../test/readonly/ReadOnlyProxyTest.java | 10 +- .../ReadOnlySessionLazyNonLazyTest.java | 26 ++-- .../test/readonly/ReadOnlySessionTest.java | 10 +- .../hibernate/test/readonly/ReadOnlyTest.java | 10 +- .../CollectionReattachmentTest.java | 3 + .../reattachment/ProxyReattachmentTest.java | 8 ++ .../ResultTransformerTest.java | 22 +-- .../org/hibernate/test/sorted/SortTest.java | 13 +- .../sql/autodiscovery/AutoDiscoveryTest.java | 2 + .../sql/hand/query/NativeSQLQueriesTest.java | 3 + .../NativeSqlAndQuotedIdentifiersTest.java | 3 + .../org/hibernate/test/stats/StatsTest.java | 5 + .../DiscrimSubclassFilterTest.java | 3 + .../JoinedSubclassFilterTest.java | 3 + .../UnionSubclassFilterTest.java | 3 + .../test/subselect/SubselectTest.java | 22 +-- .../subselectfetch/SubselectFetchTest.java | 136 +++++++++--------- .../hibernate/test/ternary/TernaryTest.java | 6 +- .../java/org/hibernate/test/tm/CMTTest.java | 2 + .../test/typedescriptor/ByteTest.java | 2 + .../typedescriptor/CharInNativeQueryTest.java | 2 + .../typedmanytoone/TypedManyToOneTest.java | 21 +-- .../test/typedonetoone/TypedOneToOneTest.java | 18 +-- .../typeparameters/TypeParameterTest.java | 7 +- .../test/unconstrained/UnconstrainedTest.java | 16 ++- .../test/unionsubclass/UnionSubclassTest.java | 106 +++++++------- .../test/unionsubclass/alias/SellCarTest.java | 5 +- .../unionsubclass2/UnionSubclassTest.java | 49 ++++--- .../test/version/db/DbVersionTest.java | 2 + .../ehcache/EhCacheRegionFactoryImpl.java | 2 + .../test/cache/ehcache/EhCacheRegionTest.java | 2 + .../test/integration/merge/AddDelTest.java | 4 + .../proxy/QueryingWithProxyObjectTest.java | 5 +- .../integration/tools/SchemaExportTest.java | 4 + 233 files changed, 1245 insertions(+), 665 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/xml/ejb3/OrmVersion1SupportedTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/xml/ejb3/OrmVersion1SupportedTest.java index 0281adfa3e..1a40ef56c7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/xml/ejb3/OrmVersion1SupportedTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/xml/ejb3/OrmVersion1SupportedTest.java @@ -55,8 +55,12 @@ public class OrmVersion1SupportedTest extends BaseCoreFunctionalTestCase { action = "countInvocation()", name = "testOrm1Support") }) - @FailureExpectedWithNewMetamodel + @FailureExpectedWithNewMetamodel // This doesn't actually work since this test class requires BMUnitRunner instead of + // CustomRunner. Thus, the if block below skips the test if the new metamodel is being used. public void testOrm1Support() { + if ( Boolean.getBoolean( USE_NEW_METADATA_MAPPINGS ) ) { + return; + } // need to call buildSessionFactory, because this test is not using org.hibernate.testing.junit4.CustomRunner buildSessionFactory(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/any/AnyTypeTest.java b/hibernate-core/src/test/java/org/hibernate/test/any/AnyTypeTest.java index 3c7a4966de..5d853018b2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/any/AnyTypeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/any/AnyTypeTest.java @@ -26,6 +26,7 @@ package org.hibernate.test.any; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -33,6 +34,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; * @author Steve Ebersole */ @TestForIssue( jiraKey = "HHH-1663" ) +@FailureExpectedWithNewMetamodel public class AnyTypeTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/array/ArrayTest.java b/hibernate-core/src/test/java/org/hibernate/test/array/ArrayTest.java index 8134750ebe..0112cf5cc9 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/array/ArrayTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/array/ArrayTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -43,6 +44,7 @@ public class ArrayTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testArrayJoinFetch() throws Exception { Session s; Transaction tx; diff --git a/hibernate-core/src/test/java/org/hibernate/test/batchfetch/BatchFetchTest.java b/hibernate-core/src/test/java/org/hibernate/test/batchfetch/BatchFetchTest.java index b0071d0394..806d9951a4 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/batchfetch/BatchFetchTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/batchfetch/BatchFetchTest.java @@ -31,6 +31,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -48,6 +49,7 @@ public class BatchFetchTest extends BaseCoreFunctionalTestCase { @SuppressWarnings( {"unchecked"}) @Test + @FailureExpectedWithNewMetamodel public void testBatchFetch() { Session s = openSession(); Transaction t = s.beginTransaction(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/bidi/AuctionTest.java b/hibernate-core/src/test/java/org/hibernate/test/bidi/AuctionTest.java index b4e32a3876..0234b14727 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/bidi/AuctionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/bidi/AuctionTest.java @@ -32,6 +32,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.dialect.PostgreSQL81Dialect; import org.hibernate.dialect.PostgreSQLDialect; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -42,7 +43,9 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class AuctionTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "bidi/Auction.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/cache/InsertedDataTest.java b/hibernate-core/src/test/java/org/hibernate/test/cache/InsertedDataTest.java index 33c04393b2..4145c2fe27 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/cache/InsertedDataTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/cache/InsertedDataTest.java @@ -30,6 +30,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -43,6 +44,7 @@ import static org.junit.Assert.assertNull; * @author Steve Ebersole */ public class InsertedDataTest extends BaseCoreFunctionalTestCase { + @Override protected Class[] getAnnotatedClasses() { return new Class[] { CacheableItem.class }; @@ -56,6 +58,7 @@ public class InsertedDataTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testInsert() { sessionFactory().getCache().evictEntityRegions(); sessionFactory().getStatistics().clear(); @@ -95,6 +98,7 @@ public class InsertedDataTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testInsertThenUpdate() { sessionFactory().getCache().evictEntityRegions(); sessionFactory().getStatistics().clear(); @@ -119,6 +123,7 @@ public class InsertedDataTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testInsertThenUpdateThenRollback() { sessionFactory().getCache().evictEntityRegions(); sessionFactory().getStatistics().clear(); @@ -143,6 +148,7 @@ public class InsertedDataTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testInsertWithRefresh() { sessionFactory().getCache().evictEntityRegions(); sessionFactory().getStatistics().clear(); @@ -193,6 +199,7 @@ public class InsertedDataTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testInsertWithClear() { sessionFactory().getCache().evictEntityRegions(); sessionFactory().getStatistics().clear(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/cascade/MultiPathCascadeTest.java b/hibernate-core/src/test/java/org/hibernate/test/cascade/MultiPathCascadeTest.java index f426c030bc..607ed3fdac 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/cascade/MultiPathCascadeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/cascade/MultiPathCascadeTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.TransientObjectException; import org.hibernate.proxy.HibernateProxy; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -40,6 +41,7 @@ import static org.junit.Assert.fail; * @author Ovidiu Feodorov * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class MultiPathCascadeTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/cascade/RefreshTest.java b/hibernate-core/src/test/java/org/hibernate/test/cascade/RefreshTest.java index 3e065ce576..68725db045 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/cascade/RefreshTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/cascade/RefreshTest.java @@ -33,6 +33,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.jdbc.Work; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -42,6 +43,7 @@ import static org.junit.Assert.assertEquals; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class RefreshTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/cid/CompositeIdWithGeneratorTest.java b/hibernate-core/src/test/java/org/hibernate/test/cid/CompositeIdWithGeneratorTest.java index c681eafd42..528e4a5b84 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/cid/CompositeIdWithGeneratorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/cid/CompositeIdWithGeneratorTest.java @@ -31,6 +31,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -42,15 +43,16 @@ import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; /** - * Tests the use of composite-id with a generator. - * Test this behavior in all the various entity states (transient, managed, detached) + * Tests the use of composite-id with a generator. + * Test this behavior in all the various entity states (transient, managed, detached) * and the different state transitions. - * + * * For HHH-2060. - * + * * @author Jacob Robertson */ @TestForIssue( jiraKey = "HHH-2060" ) +@FailureExpectedWithNewMetamodel public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { private DateFormat df = SimpleDateFormat.getDateTimeInstance( DateFormat.LONG, DateFormat.LONG ); @@ -77,10 +79,10 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { assertNotNull(generatedId); assertNotNull( generatedId.getPurchaseSequence() ); assertTrue(generatedId.getPurchaseNumber() > 0); - + s = openSession(); t = s.beginTransaction(); - + // find the record, and see that the ids match PurchaseRecord find = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId); assertNotNull(find); @@ -92,11 +94,11 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { s = openSession(); t = s.beginTransaction(); - + // generate another new record PurchaseRecord record2 = new PurchaseRecord(); s.persist(record2); - + t.commit(); s.close(); @@ -105,12 +107,12 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { s = openSession(); t = s.beginTransaction(); - + PurchaseRecord find2 = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId2); - + t.commit(); s.close(); - + // test that the ids are different PurchaseRecord.Id id1 = find.getId(); PurchaseRecord.Id id2 = find2.getId(); @@ -118,7 +120,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { String seq2 = id2.getPurchaseSequence(); int num1 = id1.getPurchaseNumber(); int num2 = id2.getPurchaseNumber(); - + assertEquals( df.format(timestamp2), df.format(find2.getTimestamp()) ); assertFalse( id1.equals(id2) ); assertFalse( seq1.equals(seq2) ); @@ -133,7 +135,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { // persist the record PurchaseRecord record = new PurchaseRecord(); s.persist(record); - + // close session so we know the record is detached t.commit(); s.close(); @@ -144,34 +146,34 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { Date persistedTimestamp = record.getTimestamp(); Date newTimestamp = new Date(persistedTimestamp.getTime() + 1); record.setTimestamp(newTimestamp); - + s = openSession(); t = s.beginTransaction(); PurchaseRecord find = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId); - + t.commit(); s.close(); // see that we get the original id, and the original timestamp assertEquals( generatedId, find.getId() ); assertEquals( df.format(persistedTimestamp), df.format(find.getTimestamp()) ); - + s = openSession(); t = s.beginTransaction(); // update with the new timestamp s.update(record); - + t.commit(); s.close(); - + // find the newly updated record s = openSession(); t = s.beginTransaction(); - + PurchaseRecord find2 = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId); - + t.commit(); s.close(); @@ -195,27 +197,27 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { record2.setTimestamp(timestamp2); s.persist(record1); s.persist(record2); - + // close session so we know the records are detached t.commit(); s.close(); PurchaseRecord.Id generatedId1 = record1.getId(); PurchaseRecord.Id generatedId2 = record2.getId(); - + // change the ids around - effectively making record1 have the same id as record2 // do not persist yet PurchaseRecord.Id toChangeId1 = new PurchaseRecord.Id(); toChangeId1.setPurchaseNumber( record2.getId().getPurchaseNumber() ); toChangeId1.setPurchaseSequence( record2.getId().getPurchaseSequence() ); record1.setId(toChangeId1); - + s = openSession(); t = s.beginTransaction(); PurchaseRecord find1 = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId1); PurchaseRecord find2 = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId2); - + t.commit(); s.close(); @@ -225,13 +227,13 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { assertEquals( df.format(timestamp1), df.format(find1.getTimestamp()) ); assertEquals( generatedId2, find2.getId() ); assertEquals( df.format(timestamp2), df.format(find2.getTimestamp()) ); - + s = openSession(); t = s.beginTransaction(); // update with the new changed record id s.update(record1); - + t.commit(); s.close(); @@ -240,13 +242,13 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { assertSame(toChangeId1, foundId1); assertEquals( toChangeId1.getPurchaseNumber(), foundId1.getPurchaseNumber() ); assertEquals( toChangeId1.getPurchaseSequence(), foundId1.getPurchaseSequence() ); - + // find record 2 and see that it has the timestamp originally found in record 1 s = openSession(); t = s.beginTransaction(); - + find2 = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId2); - + t.commit(); s.close(); @@ -267,7 +269,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { PurchaseRecord record = new PurchaseRecord(); record.setTimestamp(timestamp1); s.saveOrUpdate(record); - + t.commit(); s.close(); @@ -275,15 +277,15 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { PurchaseRecord.Id generatedId = record.getId(); assertNotNull(generatedId); assertNotNull( generatedId.getPurchaseSequence() ); - + // change the timestamp record.setTimestamp(timestamp2); - + s = openSession(); t = s.beginTransaction(); s.saveOrUpdate(record); - + t.commit(); s.close(); @@ -300,24 +302,24 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { // persist the record, then get the id and timestamp back PurchaseRecord record = new PurchaseRecord(); s.persist(record); - + t.commit(); s.close(); PurchaseRecord.Id id = record.getId(); Date timestamp = record.getTimestamp(); - + // using the given id, load a transient record PurchaseRecord toLoad = new PurchaseRecord(); - + s = openSession(); t = s.beginTransaction(); s.load(toLoad, id); - + t.commit(); s.close(); - + // show that the correct timestamp and ids were loaded assertEquals( id, toLoad.getId() ); assertEquals( df.format(timestamp), df.format(toLoad.getTimestamp()) ); @@ -330,34 +332,34 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { Date timestamp1 = new Date(); Date timestamp2 = new Date(timestamp1.getTime() + 1); - + // persist the record, then evict it, then make changes to it ("within" the session) PurchaseRecord record = new PurchaseRecord(); record.setTimestamp(timestamp1); s.persist(record); s.flush(); s.evict(record); - + record.setTimestamp(timestamp2); - + t.commit(); s.close(); PurchaseRecord.Id generatedId = record.getId(); - + // now, re-fetch the record and show that the timestamp change wasn't persisted s = openSession(); t = s.beginTransaction(); PurchaseRecord persistent = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId); - + t.commit(); s.close(); - + assertEquals( generatedId, persistent.getId() ); assertEquals( df.format(timestamp1), df.format(persistent.getTimestamp()) ); } - + @Test public void testMerge() { Session s = openSession(); @@ -369,7 +371,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { // persist the record PurchaseRecord record = new PurchaseRecord(); s.persist(record); - + t.commit(); s.close(); @@ -377,7 +379,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { PurchaseRecord.Id generatedId = record.getId(); assertNotNull(generatedId); assertNotNull( generatedId.getPurchaseSequence() ); - + s = openSession(); t = s.beginTransaction(); @@ -385,18 +387,18 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { PurchaseRecord detached = record; detached.setTimestamp(timestamp2); PurchaseRecord persistent = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId); - + // show that the timestamp hasn't changed assertEquals( df.format(timestamp1), df.format(persistent.getTimestamp()) ); - + s.merge(detached); - + t.commit(); s.close(); // show that the persistent object was changed only after the session flush assertEquals( timestamp2, persistent.getTimestamp() ); - + // show that the persistent store was updated - not just the in-memory object s = openSession(); t = s.beginTransaction(); @@ -405,7 +407,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { t.commit(); s.close(); - + assertEquals( df.format(timestamp2), df.format(persistent.getTimestamp()) ); } @@ -417,12 +419,12 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { // persist the record PurchaseRecord record = new PurchaseRecord(); s.saveOrUpdate(record); - + t.commit(); s.close(); PurchaseRecord.Id generatedId = record.getId(); - + // re-fetch, then delete the record s = openSession(); t = s.beginTransaction(); @@ -430,7 +432,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { PurchaseRecord find = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId); s.delete(find); assertFalse( s.contains(find) ); - + t.commit(); s.close(); @@ -442,13 +444,13 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { t.commit(); s.close(); - + assertNull(find); } - + @Test public void testGeneratedIdsWithChildren() { - + Session s = openSession(); Transaction t = s.beginTransaction(); @@ -459,17 +461,17 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { details.add( new PurchaseDetail(record, "p@2", 2) ); s.persist(record); - + t.commit(); s.close(); - + // show that the ids were generated (non-zero) and come out the same int foundPurchaseNumber = record.getId().getPurchaseNumber(); String foundPurchaseSequence = record.getId().getPurchaseSequence(); assertNotNull( record.getId() ); assertTrue(foundPurchaseNumber > 0); assertNotNull(foundPurchaseSequence); - + // search on detail1 by itself and show it got the parent's id s = openSession(); t = s.beginTransaction(); @@ -478,7 +480,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase { PurchaseRecord foundRecord = (PurchaseRecord) s.get(PurchaseRecord.class, new PurchaseRecord.Id(foundPurchaseNumber, foundPurchaseSequence) ); - + t.commit(); s.close(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/backref/map/compkey/BackrefCompositeMapKeyTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/backref/map/compkey/BackrefCompositeMapKeyTest.java index 4d2a140b74..533e944cc1 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/backref/map/compkey/BackrefCompositeMapKeyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/backref/map/compkey/BackrefCompositeMapKeyTest.java @@ -30,6 +30,7 @@ import org.hibernate.LockMode; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.internal.util.SerializationHelper; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertNotNull; @@ -42,6 +43,7 @@ import static org.junit.Assert.assertTrue; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class BackrefCompositeMapKeyTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/bag/PersistentBagTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/bag/PersistentBagTest.java index 6c2c06bcff..7e493039f6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/bag/PersistentBagTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/bag/PersistentBagTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.collection.internal.PersistentBag; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertFalse; @@ -45,6 +46,7 @@ public class PersistentBagTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testWriteMethodDirtying() { BagOwner parent = new BagOwner( "root" ); BagOwner child = new BagOwner( "c1" ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/custom/basic/UserCollectionTypeAnnotationsVariantTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/custom/basic/UserCollectionTypeAnnotationsVariantTest.java index 51a0d326ad..ad3c63e07f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/custom/basic/UserCollectionTypeAnnotationsVariantTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/custom/basic/UserCollectionTypeAnnotationsVariantTest.java @@ -23,9 +23,12 @@ */ package org.hibernate.test.collection.custom.basic; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; + /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class UserCollectionTypeAnnotationsVariantTest extends UserCollectionTypeTest { @Override protected Class[] getAnnotatedClasses() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/custom/basic/UserCollectionTypeHbmVariantTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/custom/basic/UserCollectionTypeHbmVariantTest.java index 4b9b51d698..f03a7b4701 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/custom/basic/UserCollectionTypeHbmVariantTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/custom/basic/UserCollectionTypeHbmVariantTest.java @@ -23,9 +23,12 @@ */ package org.hibernate.test.collection.custom.basic; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; + /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class UserCollectionTypeHbmVariantTest extends UserCollectionTypeTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/custom/parameterized/ParameterizedUserCollectionTypeAnnotationsVariantTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/custom/parameterized/ParameterizedUserCollectionTypeAnnotationsVariantTest.java index 5130064a7a..9ac6b109ac 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/custom/parameterized/ParameterizedUserCollectionTypeAnnotationsVariantTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/custom/parameterized/ParameterizedUserCollectionTypeAnnotationsVariantTest.java @@ -23,9 +23,12 @@ */ package org.hibernate.test.collection.custom.parameterized; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; + /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class ParameterizedUserCollectionTypeAnnotationsVariantTest extends ParameterizedUserCollectionTypeTest { @Override protected Class[] getAnnotatedClasses() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/custom/parameterized/ParameterizedUserCollectionTypeHbmVariantTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/custom/parameterized/ParameterizedUserCollectionTypeHbmVariantTest.java index fb3650c5fd..88dad17538 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/custom/parameterized/ParameterizedUserCollectionTypeHbmVariantTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/custom/parameterized/ParameterizedUserCollectionTypeHbmVariantTest.java @@ -23,10 +23,14 @@ */ package org.hibernate.test.collection.custom.parameterized; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; + /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class ParameterizedUserCollectionTypeHbmVariantTest extends ParameterizedUserCollectionTypeTest { + @Override public String[] getMappings() { return new String[] { "collection/custom/parameterized/Mapping.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/idbag/PersistentIdBagTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/idbag/PersistentIdBagTest.java index 7a35590a8d..a1e00d5249 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/idbag/PersistentIdBagTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/idbag/PersistentIdBagTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.collection.internal.PersistentIdentifierBag; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertFalse; @@ -45,6 +46,7 @@ public class PersistentIdBagTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testWriteMethodDirtying() { IdbagOwner parent = new IdbagOwner( "root" ); IdbagOwner child = new IdbagOwner( "c1" ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/list/PersistentListTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/list/PersistentListTest.java index 70447ed22a..96cd22ef62 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/list/PersistentListTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/list/PersistentListTest.java @@ -40,6 +40,7 @@ import org.hibernate.persister.collection.CollectionPersister; import org.hibernate.persister.collection.QueryableCollection; import org.hibernate.sql.SimpleSelect; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -121,6 +122,7 @@ public class PersistentListTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testWriteMethodDirtying() { ListOwner parent = new ListOwner( "root" ); ListOwner child = new ListOwner( "c1" ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/map/PersistentMapTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/map/PersistentMapTest.java index 5d228b7500..44bd66506f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/map/PersistentMapTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/map/PersistentMapTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.collection.internal.PersistentMap; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -41,6 +42,7 @@ import static org.junit.Assert.assertTrue; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class PersistentMapTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/ordered/joinedInheritence/OrderCollectionOfJoinedHierarchyTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/ordered/joinedInheritence/OrderCollectionOfJoinedHierarchyTest.java index 73de9d29a5..32929b6ca3 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/ordered/joinedInheritence/OrderCollectionOfJoinedHierarchyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/ordered/joinedInheritence/OrderCollectionOfJoinedHierarchyTest.java @@ -27,11 +27,13 @@ import org.hibernate.Session; import org.junit.Test; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class OrderCollectionOfJoinedHierarchyTest extends BaseCoreFunctionalTestCase { @Override protected Class[] getAnnotatedClasses() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/original/CollectionTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/original/CollectionTest.java index dbd503b391..1fbb8779d5 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/original/CollectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/original/CollectionTest.java @@ -30,6 +30,7 @@ import org.hibernate.Hibernate; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -42,6 +43,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class CollectionTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/set/PersistentSetNonLazyTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/set/PersistentSetNonLazyTest.java index cfa42457aa..216b9cd17e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/set/PersistentSetNonLazyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/set/PersistentSetNonLazyTest.java @@ -26,11 +26,14 @@ package org.hibernate.test.collection.set; import org.junit.Test; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class PersistentSetNonLazyTest extends PersistentSetTest { + @Override public String[] getMappings() { return new String[] { "collection/set/MappingsNonLazy.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/collection/set/PersistentSetTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/set/PersistentSetTest.java index 88b1076629..ee606112d6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/collection/set/PersistentSetTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/collection/set/PersistentSetTest.java @@ -35,6 +35,7 @@ import org.hibernate.collection.internal.PersistentSet; import org.hibernate.criterion.Restrictions; import org.hibernate.stat.CollectionStatistics; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -44,6 +45,7 @@ import static org.junit.Assert.assertTrue; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class PersistentSetTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/component/basic2/ComponentJoinsTest.java b/hibernate-core/src/test/java/org/hibernate/test/component/basic2/ComponentJoinsTest.java index c1010be4fb..54eeeec554 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/component/basic2/ComponentJoinsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/component/basic2/ComponentJoinsTest.java @@ -26,6 +26,7 @@ package org.hibernate.test.component.basic2; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; /** @@ -33,6 +34,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class ComponentJoinsTest extends BaseCoreFunctionalTestCase { @Override public Class[] getAnnotatedClasses() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/component/cascading/collection/CascadeToComponentCollectionTest.java b/hibernate-core/src/test/java/org/hibernate/test/component/cascading/collection/CascadeToComponentCollectionTest.java index c374ba7d52..fdbc47e159 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/component/cascading/collection/CascadeToComponentCollectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/component/cascading/collection/CascadeToComponentCollectionTest.java @@ -28,6 +28,7 @@ import java.util.Locale; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -35,7 +36,9 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class CascadeToComponentCollectionTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "component/cascading/collection/Mappings.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/component/cascading/toone/CascadeToComponentAssociationTest.java b/hibernate-core/src/test/java/org/hibernate/test/component/cascading/toone/CascadeToComponentAssociationTest.java index 1286ef4b26..dd31f6b0b1 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/component/cascading/toone/CascadeToComponentAssociationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/component/cascading/toone/CascadeToComponentAssociationTest.java @@ -26,6 +26,7 @@ package org.hibernate.test.component.cascading.toone; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertNotNull; @@ -41,6 +42,7 @@ public class CascadeToComponentAssociationTest extends BaseCoreFunctionalTestCas } @Test + @FailureExpectedWithNewMetamodel public void testMerging() { // step1, we create a document with owner Session session = openSession(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/compositeelement/CompositeElementTest.java b/hibernate-core/src/test/java/org/hibernate/test/compositeelement/CompositeElementTest.java index 7a330a1043..4eaaafaf67 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/compositeelement/CompositeElementTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/compositeelement/CompositeElementTest.java @@ -35,6 +35,7 @@ import org.hibernate.dialect.function.SQLFunction; import org.hibernate.mapping.Collection; import org.hibernate.mapping.Component; import org.hibernate.mapping.Formula; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.type.StandardBasicTypes; @@ -43,6 +44,7 @@ import static org.junit.Assert.assertEquals; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class CompositeElementTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -56,7 +58,7 @@ public class CompositeElementTest extends BaseCoreFunctionalTestCase { Component childComponents = ( Component ) children.getElement(); Formula f = ( Formula ) childComponents.getProperty( "bioLength" ).getValue().getColumnIterator().next(); - SQLFunction lengthFunction = ( SQLFunction ) dialect.getFunctions().get( "length" ); + SQLFunction lengthFunction = dialect.getFunctions().get( "length" ); if ( lengthFunction != null ) { ArrayList args = new ArrayList(); args.add( "bio" ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/AggressiveReleaseTest.java b/hibernate-core/src/test/java/org/hibernate/test/connections/AggressiveReleaseTest.java index 6de8f89e25..bef4ba7922 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/AggressiveReleaseTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/connections/AggressiveReleaseTest.java @@ -17,6 +17,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory; import org.hibernate.internal.util.SerializationHelper; import org.hibernate.service.jdbc.connections.spi.ConnectionProvider; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.jta.TestingJtaBootstrap; import org.hibernate.testing.jta.TestingJtaPlatformImpl; @@ -29,6 +30,7 @@ import static org.junit.Assert.fail; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class AggressiveReleaseTest extends ConnectionManagementTestCase { @Override public void configure(Configuration cfg) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/BasicConnectionProviderTest.java b/hibernate-core/src/test/java/org/hibernate/test/connections/BasicConnectionProviderTest.java index c297fd862d..bf71403844 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/BasicConnectionProviderTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/connections/BasicConnectionProviderTest.java @@ -27,12 +27,14 @@ import org.hibernate.ConnectionReleaseMode; import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * Implementation of BasicConnectionProviderTest. * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class BasicConnectionProviderTest extends ConnectionManagementTestCase { @Override protected Session getSessionUnderTest() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/CurrentSessionConnectionTest.java b/hibernate-core/src/test/java/org/hibernate/test/connections/CurrentSessionConnectionTest.java index 7caa8d8ecb..4ba4c49633 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/CurrentSessionConnectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/connections/CurrentSessionConnectionTest.java @@ -24,12 +24,14 @@ package org.hibernate.test.connections; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * Implementation of CurrentSessionConnectionTest. * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class CurrentSessionConnectionTest extends AggressiveReleaseTest { @Override protected Session getSessionUnderTest() throws Throwable { diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/HibernateCreateBlobFailedCase.java b/hibernate-core/src/test/java/org/hibernate/test/connections/HibernateCreateBlobFailedCase.java index 4e1967f655..f51c0f2276 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/HibernateCreateBlobFailedCase.java +++ b/hibernate-core/src/test/java/org/hibernate/test/connections/HibernateCreateBlobFailedCase.java @@ -33,6 +33,7 @@ import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertFalse; @@ -42,6 +43,7 @@ import static org.junit.Assert.assertFalse; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class HibernateCreateBlobFailedCase extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/SuppliedConnectionTest.java b/hibernate-core/src/test/java/org/hibernate/test/connections/SuppliedConnectionTest.java index 103665315a..4ef7cf6ad8 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/SuppliedConnectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/connections/SuppliedConnectionTest.java @@ -36,6 +36,7 @@ import org.hibernate.service.jdbc.connections.spi.ConnectionProvider; import org.hibernate.service.spi.Stoppable; import org.hibernate.testing.AfterClassOnce; import org.hibernate.testing.BeforeClassOnce; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.env.ConnectionProviderBuilder; import org.hibernate.tool.hbm2ddl.SchemaExport; @@ -44,6 +45,7 @@ import org.hibernate.tool.hbm2ddl.SchemaExport; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class SuppliedConnectionTest extends ConnectionManagementTestCase { private ConnectionProvider cp = ConnectionProviderBuilder.buildConnectionProvider(); private Connection connectionUnderTest; diff --git a/hibernate-core/src/test/java/org/hibernate/test/connections/ThreadLocalCurrentSessionTest.java b/hibernate-core/src/test/java/org/hibernate/test/connections/ThreadLocalCurrentSessionTest.java index fdb09dee3a..e17caa8b5d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/connections/ThreadLocalCurrentSessionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/connections/ThreadLocalCurrentSessionTest.java @@ -32,6 +32,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.context.internal.ThreadLocalSessionContext; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.transaction.spi.LocalStatus; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -41,6 +42,7 @@ import static org.junit.Assert.fail; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class ThreadLocalCurrentSessionTest extends ConnectionManagementTestCase { @Override public void configure(Configuration cfg) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/criteria/ComplexJoinAliasTest.java b/hibernate-core/src/test/java/org/hibernate/test/criteria/ComplexJoinAliasTest.java index 43e4a43c15..89d9b7ae0f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/criteria/ComplexJoinAliasTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/criteria/ComplexJoinAliasTest.java @@ -31,6 +31,7 @@ import org.junit.Test; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -94,6 +95,7 @@ import static org.junit.Assert.assertEquals; * @link https://hibernate.onjira.com/browse/HHH-4630 */ +@FailureExpectedWithNewMetamodel public class ComplexJoinAliasTest extends BaseCoreFunctionalTestCase { @Override diff --git a/hibernate-core/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java b/hibernate-core/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java index 03ba24a86f..f0487563d8 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java @@ -61,6 +61,7 @@ import org.hibernate.internal.util.SerializationHelper; import org.hibernate.test.hql.Animal; import org.hibernate.test.hql.Reptile; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; @@ -81,6 +82,7 @@ import static org.junit.Assert.fail; * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ @RequiresDialectFeature(DialectChecks.SupportsSequences.class) +@FailureExpectedWithNewMetamodel public class CriteriaQueryTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -1811,7 +1813,7 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase { assertEquals( 1, result.size() ); assertEquals( kinga, result.get( 0 ) ); } - + tx.commit(); session.close(); @@ -1906,13 +1908,13 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase { session.close(); } - + @Test @TestForIssue(jiraKey = "HHH-7194") public void testNestedCorrelatedSubquery() throws Exception { Session session = openSession(); Transaction t = session.beginTransaction(); - + Course course = new Course(); course.setCourseCode("HIB"); course.setDescription("Hibernate Training"); @@ -1922,7 +1924,7 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase { gavin.setName("Gavin King"); gavin.setStudentNumber(232); gavin.setPreferredCourse(course); - + Enrolment enrolment = new Enrolment(); enrolment.setCourse( course ); enrolment.setCourseCode( course.getCourseCode() ); @@ -1934,13 +1936,13 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase { session.persist(course); session.persist(gavin); session.persist(enrolment); - + session.flush(); session.clear(); - + //execute a nested subquery DetachedCriteria mainCriteria = DetachedCriteria.forClass(Student.class, "student"); - + DetachedCriteria nestedSubQuery = DetachedCriteria.forClass( Enrolment.class, "maxStudentEnrolment" ); nestedSubQuery.add(Restrictions.eqProperty("student.preferredCourse", "maxStudentEnrolment.course")); nestedSubQuery.setProjection(Projections.max("maxStudentEnrolment.year")); @@ -1948,14 +1950,14 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase { DetachedCriteria subQuery = DetachedCriteria.forClass( Enrolment.class, "enrolment" ); subQuery.add(Subqueries.propertyEq("enrolment.year", nestedSubQuery)); subQuery.setProjection(Projections.property("student")); - + mainCriteria.add(Subqueries.exists(subQuery)); //query should complete and return gavin in the list List results = mainCriteria.getExecutableCriteria(session).list(); assertEquals(1, results.size()); assertEquals(gavin.getStudentNumber(), ((Student) results.get(0)).getStudentNumber()); - + t.rollback(); session.close(); } @@ -1968,7 +1970,7 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase { Student gavin = new Student(); gavin.setName("Gavin King"); gavin.setStudentNumber(232); - + Country gb = new Country("GB", "United Kingdom"); Country fr = new Country("FR", "France"); session.persist(gb); @@ -1980,21 +1982,21 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase { studyAbroads.add(sa1); studyAbroads.add(sa2); gavin.setStudyAbroads(studyAbroads); - + session.persist(gavin); session.flush(); session.clear(); - + List results = session.createCriteria(Student.class) .setFetchMode("studyAbroads", FetchMode.JOIN) .setFetchMode("studyAbroads.country", FetchMode.JOIN) .list(); - + assertEquals(results.size(), 2); Student st = (Student)results.get(0); - + assertNotNull(st.getStudyAbroads()); assertTrue(Hibernate.isInitialized(st.getStudyAbroads())); assertEquals(st.getStudyAbroads().size(), 2); @@ -2006,10 +2008,10 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase { session.delete(st); session.delete(c1); session.delete(c2); - + t.commit(); session.close(); - + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/cuk/CompositePropertyRefTest.java b/hibernate-core/src/test/java/org/hibernate/test/cuk/CompositePropertyRefTest.java index 0bf8f0d0f0..61279641f2 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/cuk/CompositePropertyRefTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/cuk/CompositePropertyRefTest.java @@ -32,6 +32,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -44,11 +45,14 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "cuk/Person.hbm.xml" }; } + @Override public void configure(Configuration cfg) { cfg.setProperty(Environment.DEFAULT_BATCH_FETCH_SIZE, "1"); } @@ -78,7 +82,7 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase { s.save(act); s.flush(); s.clear(); - + p = (Person) s.get( Person.class, p.getId() ); //get address reference by outer join p2 = (Person) s.get( Person.class, p2.getId() ); //get null address reference by outer join assertNull( p2.getAddress() ); @@ -87,13 +91,13 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase { assertEquals( l.size(), 2 ); assertTrue( l.contains(p) && l.contains(p2) ); s.clear(); - + l = s.createQuery("from Person p order by p.name").list(); //get address references by sequential selects assertEquals( l.size(), 2 ); assertNull( ( (Person) l.get(0) ).getAddress() ); assertNotNull( ( (Person) l.get(1) ).getAddress() ); s.clear(); - + l = s.createQuery("from Person p left join fetch p.address a order by a.country").list(); //get em by outer join assertEquals( l.size(), 2 ); if ( ( (Person) l.get(0) ).getName().equals("Max") ) { @@ -105,7 +109,7 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase { assertNotNull( ( (Person) l.get(0) ).getAddress() ); } s.clear(); - + l = s.createQuery("from Person p left join p.accounts").list(); for ( int i=0; i<2; i++ ) { Object[] row = (Object[]) l.get(i); @@ -125,13 +129,13 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase { assertTrue( Hibernate.isInitialized( p1.getAccounts() ) ); assertEquals( p1.getAccounts().size(), 0 ); s.clear(); - + l = s.createQuery("from Account a join fetch a.user").list(); - + s.clear(); - + l = s.createQuery("from Person p left join fetch p.address").list(); - + s.clear(); s.createQuery( "delete Address" ).executeUpdate(); s.createQuery( "delete Account" ).executeUpdate(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/cut/CompositeUserTypeTest.java b/hibernate-core/src/test/java/org/hibernate/test/cut/CompositeUserTypeTest.java index 4a7e59d357..1aecb079dd 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/cut/CompositeUserTypeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/cut/CompositeUserTypeTest.java @@ -33,6 +33,7 @@ import org.hibernate.criterion.Restrictions; import org.hibernate.dialect.DB2Dialect; import org.hibernate.dialect.HSQLDialect; import org.hibernate.dialect.SybaseASE15Dialect; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -41,6 +42,7 @@ import static org.junit.Assert.assertEquals; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -51,32 +53,32 @@ public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase { public void testCompositeUserType() { Session s = openSession(); org.hibernate.Transaction t = s.beginTransaction(); - + Transaction tran = new Transaction(); tran.setDescription("a small transaction"); tran.setValue( new MonetoryAmount( new BigDecimal(1.5), Currency.getInstance("USD") ) ); s.persist(tran); - + List result = s.createQuery("from Transaction tran where tran.value.amount > 1.0 and tran.value.currency = 'USD'").list(); assertEquals( result.size(), 1 ); tran.getValue().setCurrency( Currency.getInstance("AUD") ); result = s.createQuery("from Transaction tran where tran.value.amount > 1.0 and tran.value.currency = 'AUD'").list(); assertEquals( result.size(), 1 ); - + if ( !(getDialect() instanceof HSQLDialect) ) { - + result = s.createQuery("from Transaction txn where txn.value = (1.5, 'AUD')").list(); assertEquals( result.size(), 1 ); result = s.createQuery("from Transaction where value = (1.5, 'AUD')").list(); assertEquals( result.size(), 1 ); - + } - + s.delete(tran); t.commit(); s.close(); } - + @Test @SkipForDialect( value = {SybaseASE15Dialect.class, DB2Dialect.class}, jiraKey = "HHH-6788,HHH-6867") public void testCustomColumnReadAndWrite() { @@ -92,29 +94,29 @@ public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase { // Test value conversion during insert BigDecimal amountViaSql = (BigDecimal)s.createSQLQuery("select amount_millions from MutualFund").uniqueResult(); assertEquals(AMOUNT_MILLIONS.doubleValue(), amountViaSql.doubleValue(), 0.01d); - + // Test projection BigDecimal amountViaHql = (BigDecimal)s.createQuery("select f.holdings.amount from MutualFund f").uniqueResult(); assertEquals(AMOUNT.doubleValue(), amountViaHql.doubleValue(), 0.01d); - + // Test restriction and entity load via criteria BigDecimal one = new BigDecimal(1); f = (MutualFund)s.createCriteria(MutualFund.class) .add(Restrictions.between("holdings.amount", AMOUNT.subtract(one), AMOUNT.add(one))) .uniqueResult(); assertEquals(AMOUNT.doubleValue(), f.getHoldings().getAmount().doubleValue(), 0.01d); - + // Test predicate and entity load via HQL f = (MutualFund)s.createQuery("from MutualFund f where f.holdings.amount between ? and ?") .setBigDecimal(0, AMOUNT.subtract(one)) .setBigDecimal(1, AMOUNT.add(one)) .uniqueResult(); assertEquals(AMOUNT.doubleValue(), f.getHoldings().getAmount().doubleValue(), 0.01d); - + s.delete(f); t.commit(); s.close(); - + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/deletetransient/DeleteTransientEntityTest.java b/hibernate-core/src/test/java/org/hibernate/test/deletetransient/DeleteTransientEntityTest.java index d86efcd5fc..59b2f36555 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/deletetransient/DeleteTransientEntityTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/deletetransient/DeleteTransientEntityTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -34,7 +35,9 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class DeleteTransientEntityTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "deletetransient/Person.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/dirtiness/CustomDirtinessStrategyTest.java b/hibernate-core/src/test/java/org/hibernate/test/dirtiness/CustomDirtinessStrategyTest.java index bfc0cbea84..ea678eacdd 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/dirtiness/CustomDirtinessStrategyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/dirtiness/CustomDirtinessStrategyTest.java @@ -30,6 +30,7 @@ import org.hibernate.Session; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Configuration; import org.hibernate.persister.entity.EntityPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -39,6 +40,7 @@ import static org.junit.Assert.assertTrue; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class CustomDirtinessStrategyTest extends BaseCoreFunctionalTestCase { private static final String INITIAL_NAME = "thing 1"; private static final String SUBSEQUENT_NAME = "thing 2"; diff --git a/hibernate-core/src/test/java/org/hibernate/test/discriminator/DiscriminatorTest.java b/hibernate-core/src/test/java/org/hibernate/test/discriminator/DiscriminatorTest.java index 0cafa29391..8778d11c8f 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/discriminator/DiscriminatorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/discriminator/DiscriminatorTest.java @@ -30,10 +30,10 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; -import org.hibernate.cfg.Configuration; import org.hibernate.criterion.Property; import org.hibernate.criterion.Restrictions; import org.hibernate.proxy.HibernateProxy; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -53,6 +53,7 @@ public class DiscriminatorTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testDiscriminatorSubclass() { Session s = openSession(); Transaction t = s.beginTransaction(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/interceptor/InterceptorDynamicEntityTest.java b/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/interceptor/InterceptorDynamicEntityTest.java index ae9abb1d34..4b2a275be5 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/interceptor/InterceptorDynamicEntityTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/interceptor/InterceptorDynamicEntityTest.java @@ -31,6 +31,7 @@ import org.hibernate.cfg.Configuration; import org.hibernate.test.dynamicentity.Company; import org.hibernate.test.dynamicentity.Customer; import org.hibernate.test.dynamicentity.ProxyHelper; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -65,6 +66,7 @@ public class InterceptorDynamicEntityTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testIt() { // Test saving these dyna-proxies Session session = openSession(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/tuplizer/TuplizerDynamicEntityTest.java b/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/tuplizer/TuplizerDynamicEntityTest.java index 14acf9ccd7..e73bc2a657 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/tuplizer/TuplizerDynamicEntityTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/tuplizer/TuplizerDynamicEntityTest.java @@ -35,6 +35,7 @@ import org.hibernate.test.dynamicentity.Company; import org.hibernate.test.dynamicentity.Customer; import org.hibernate.test.dynamicentity.Person; import org.hibernate.test.dynamicentity.ProxyHelper; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -53,6 +54,7 @@ import static org.junit.Assert.assertNotNull; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class TuplizerDynamicEntityTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/tuplizer2/ImprovedTuplizerDynamicEntityTest.java b/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/tuplizer2/ImprovedTuplizerDynamicEntityTest.java index 362e7d6006..3b72846e4f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/tuplizer2/ImprovedTuplizerDynamicEntityTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/dynamicentity/tuplizer2/ImprovedTuplizerDynamicEntityTest.java @@ -36,6 +36,7 @@ import org.hibernate.test.dynamicentity.Company; import org.hibernate.test.dynamicentity.Customer; import org.hibernate.test.dynamicentity.Person; import org.hibernate.test.dynamicentity.ProxyHelper; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -54,10 +55,12 @@ import static org.junit.Assert.assertNotNull; * @author Steve Ebersole */ public class ImprovedTuplizerDynamicEntityTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "dynamicentity/tuplizer2/Customer.hbm.xml" }; } + @Override public void configure(Configuration cfg) { super.configure( cfg ); cfg.getEntityTuplizerFactory().registerDefaultTuplizerClass( EntityMode.POJO, MyEntityTuplizer.class ); @@ -65,6 +68,7 @@ public class ImprovedTuplizerDynamicEntityTest extends BaseCoreFunctionalTestCas @Test @SuppressWarnings( {"unchecked"}) + @FailureExpectedWithNewMetamodel public void testIt() { // Test saving these dyna-proxies Session session = openSession(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/ecid/EmbeddedCompositeIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/ecid/EmbeddedCompositeIdTest.java index 16ee7ae376..e10c5bb272 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/ecid/EmbeddedCompositeIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/ecid/EmbeddedCompositeIdTest.java @@ -30,6 +30,7 @@ import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.proxy.HibernateProxy; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -41,6 +42,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class EmbeddedCompositeIdTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -57,17 +59,17 @@ public class EmbeddedCompositeIdTest extends BaseCoreFunctionalTestCase { s.persist(c); t.commit(); s.close(); - + c.setDescription("Grade 5 English"); uc.setDescription("Second year mathematics"); - + s = openSession(); t = s.beginTransaction(); s.merge(c); s.merge(uc); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); s.delete(c); @@ -116,7 +118,7 @@ public class EmbeddedCompositeIdTest extends BaseCoreFunctionalTestCase { s.persist(c); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); Course ucid = new Course("mat2000", "Monash", null); @@ -160,17 +162,17 @@ public class EmbeddedCompositeIdTest extends BaseCoreFunctionalTestCase { assertEquals( uc.getCourseCode(), "mat2000" ); t.commit(); s.close(); - + c.setDescription("Grade 5 English"); uc.setDescription("Second year mathematics"); - + s = openSession(); t = s.beginTransaction(); s.saveOrUpdate(c); s.saveOrUpdate(uc); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); s.delete(c); diff --git a/hibernate-core/src/test/java/org/hibernate/test/entitymode/map/basic/DynamicClassTest.java b/hibernate-core/src/test/java/org/hibernate/test/entitymode/map/basic/DynamicClassTest.java index 29a0582eb4..ce002daf52 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/entitymode/map/basic/DynamicClassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/entitymode/map/basic/DynamicClassTest.java @@ -36,6 +36,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -45,6 +46,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class DynamicClassTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -81,15 +83,15 @@ public class DynamicClassTest extends BaseCoreFunctionalTestCase { s = openSession(); t = s.beginTransaction(); - + cars = (Map) s.createQuery("from ProductLine pl order by pl.description").uniqueResult(); models = (List) cars.get("models"); assertFalse( Hibernate.isInitialized(models) ); assertEquals( models.size(), 2); assertTrue( Hibernate.isInitialized(models) ); - + s.clear(); - + List list = s.createQuery("from Model m").list(); for ( Iterator i=list.iterator(); i.hasNext(); ) { assertFalse( Hibernate.isInitialized( ( (Map) i.next() ).get("productLine") ) ); @@ -97,7 +99,7 @@ public class DynamicClassTest extends BaseCoreFunctionalTestCase { Map model = (Map) list.get(0); assertTrue( ( (List) ( (Map) model.get("productLine") ).get("models") ).contains(model) ); s.clear(); - + t.commit(); s.close(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/entitymode/map/subclass/SubclassDynamicMapTest.java b/hibernate-core/src/test/java/org/hibernate/test/entitymode/map/subclass/SubclassDynamicMapTest.java index 4345555f3a..4573447b00 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/entitymode/map/subclass/SubclassDynamicMapTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/entitymode/map/subclass/SubclassDynamicMapTest.java @@ -28,11 +28,13 @@ import java.util.HashMap; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class SubclassDynamicMapTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/entityname/EntityNameFromSubClassTest.java b/hibernate-core/src/test/java/org/hibernate/test/entityname/EntityNameFromSubClassTest.java index babd79c624..29eee65ca5 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/entityname/EntityNameFromSubClassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/entityname/EntityNameFromSubClassTest.java @@ -25,6 +25,7 @@ package org.hibernate.test.entityname; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -32,7 +33,9 @@ import static org.junit.Assert.assertEquals; /** * @author stliu */ +@FailureExpectedWithNewMetamodel public class EntityNameFromSubClassTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "entityname/Vehicle.hbm.xml" }; } @@ -50,7 +53,7 @@ public class EntityNameFromSubClassTest extends BaseCoreFunctionalTestCase { s.save(stliu); s.getTransaction().commit(); s.close(); - + s=openSession(); s.beginTransaction(); Person p = (Person)s.get(Person.class, stliu.getId()); diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetCollectionEventTest.java index 7ba70b6e2b..297e7c554f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManyBagToSetCollectionEventTest.java @@ -27,11 +27,13 @@ import java.util.Collection; import org.hibernate.test.event.collection.ParentWithCollection; import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class BidirectionalManyToManyBagToSetCollectionEventTest extends AbstractAssociationCollectionEventTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetCollectionEventTest.java index cde49a11a1..3c583cbce6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/bidirectional/manytomany/BidirectionalManyToManySetToSetCollectionEventTest.java @@ -27,11 +27,13 @@ import java.util.HashSet; import org.hibernate.test.event.collection.ParentWithCollection; import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class BidirectionalManyToManySetToSetCollectionEventTest extends AbstractAssociationCollectionEventTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagCollectionEventTest.java index 86a5f0b313..ae8b19dec6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/event/collection/association/unidirectional/manytomany/UnidirectionalManyToManyBagCollectionEventTest.java @@ -31,10 +31,12 @@ import org.hibernate.test.event.collection.ChildEntity; import org.hibernate.test.event.collection.ParentWithCollection; import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class UnidirectionalManyToManyBagCollectionEventTest extends AbstractAssociationCollectionEventTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ValuesBagCollectionEventTest.java b/hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ValuesBagCollectionEventTest.java index 6bffe26300..7548880cbc 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ValuesBagCollectionEventTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/event/collection/values/ValuesBagCollectionEventTest.java @@ -28,11 +28,13 @@ import java.util.Collection; import org.hibernate.test.event.collection.AbstractCollectionEventTest; import org.hibernate.test.event.collection.ParentWithCollection; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class ValuesBagCollectionEventTest extends AbstractCollectionEventTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/events/CallbackTest.java b/hibernate-core/src/test/java/org/hibernate/test/events/CallbackTest.java index 7d43c08d64..513dec3254 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/events/CallbackTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/events/CallbackTest.java @@ -40,6 +40,7 @@ import org.hibernate.integrator.spi.Integrator; import org.hibernate.metamodel.spi.source.MetadataImplementor; import org.hibernate.service.BootstrapServiceRegistryBuilder; import org.hibernate.service.spi.SessionFactoryServiceRegistry; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -100,6 +101,7 @@ public class CallbackTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testCallbacks() { assertEquals( "observer not notified of creation", 1, observer.creationCount ); assertEquals( "listener not notified of creation", 1, listener.initCount ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/exception/SQLExceptionConversionTest.java b/hibernate-core/src/test/java/org/hibernate/test/exception/SQLExceptionConversionTest.java index b953dc9ec7..93e2a5ba47 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/exception/SQLExceptionConversionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/exception/SQLExceptionConversionTest.java @@ -34,6 +34,7 @@ import org.hibernate.dialect.MySQLMyISAMDialect; import org.hibernate.exception.ConstraintViolationException; import org.hibernate.exception.SQLGrammarException; import org.hibernate.jdbc.Work; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -44,7 +45,9 @@ import static org.junit.Assert.fail; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class SQLExceptionConversionTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] {"exception/User.hbm.xml", "exception/Group.hbm.xml"}; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/extralazy/ExtraLazyTest.java b/hibernate-core/src/test/java/org/hibernate/test/extralazy/ExtraLazyTest.java index 3412356a52..d6e78c07de 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/extralazy/ExtraLazyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/extralazy/ExtraLazyTest.java @@ -30,6 +30,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -41,6 +42,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class ExtraLazyTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -57,7 +59,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase { s.persist(gavin); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); gavin = (User) s.get(User.class, "gavin"); @@ -84,7 +86,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase { t.commit(); s.close(); } - + @Test public void testGet() { Session s = openSession(); @@ -119,7 +121,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase { t.commit(); s.close(); } - + @Test public void testRemoveClear() { Session s = openSession(); @@ -162,7 +164,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase { t.commit(); s.close(); } - + @Test public void testIndexFormulaMap() { Session s = openSession(); @@ -177,7 +179,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase { gavin.getSession().put( "bar", new SessionAttribute("bar", "foo bar baz 2") ); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); g = (Group) s.get(Group.class, "developers"); @@ -215,7 +217,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase { t.commit(); s.close(); } - + @Test public void testSQLQuery() { Session s = openSession(); @@ -237,7 +239,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase { s.createQuery("delete User").executeUpdate(); t.commit(); s.close(); - + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/fetchprofiles/join/JoinFetchProfileTest.java b/hibernate-core/src/test/java/org/hibernate/test/fetchprofiles/join/JoinFetchProfileTest.java index 116eea5c72..c71f1d0dc6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/fetchprofiles/join/JoinFetchProfileTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/fetchprofiles/join/JoinFetchProfileTest.java @@ -32,6 +32,7 @@ import org.hibernate.UnknownProfileException; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -45,14 +46,17 @@ import static org.junit.Assert.fail; * @author Steve Ebersole */ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "fetchprofiles/join/Mappings.hbm.xml" }; } + @Override public String getCacheConcurrencyStrategy() { return null; } + @Override public void configure(Configuration cfg) { cfg.setProperty( Environment.GENERATE_STATISTICS, "true" ); } @@ -170,6 +174,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testBasicFetchProfileOperation() { assertTrue( "fetch profile not parsed properly", sessionFactory().containsFetchProfileDefinition( "enrollment.details" ) ); assertTrue( "fetch profile not parsed properly", sessionFactory().containsFetchProfileDefinition( "offering.details" ) ); @@ -232,6 +237,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testLoadOneToManyFetchProfile() { performWithStandardData( new TestCode() { @@ -251,6 +257,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testLoadDeepFetchProfile() { performWithStandardData( new TestCode() { @@ -274,6 +281,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testLoadComponentDerefFetchProfile() { performWithStandardData( new TestCode() { @@ -298,6 +306,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase { * TODO : this is actually not strictly true. what we should have happen is to subsequently load those fetches */ @Test + @FailureExpectedWithNewMetamodel public void testHQL() { performWithStandardData( new TestCode() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java b/hibernate-core/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java index 5c86aaf220..b0596e8116 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/filter/DynamicFilterTest.java @@ -51,6 +51,7 @@ import org.hibernate.dialect.IngresDialect; import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.persister.collection.CollectionPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.transform.DistinctRootEntityResultTransformer; @@ -66,6 +67,7 @@ import static org.junit.Assert.assertTrue; * @author Steve Ebersole */ @SkipForDialect( value = SybaseASE15Dialect.class, jiraKey = "HHH-3637") +@FailureExpectedWithNewMetamodel public class DynamicFilterTest extends BaseCoreFunctionalTestCase { private static final Logger log = Logger.getLogger( DynamicFilterTest.class ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/filter/hql/BasicFilteredBulkManipulationTest.java b/hibernate-core/src/test/java/org/hibernate/test/filter/hql/BasicFilteredBulkManipulationTest.java index 1d98bf7799..45cc6c2ccb 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/filter/hql/BasicFilteredBulkManipulationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/filter/hql/BasicFilteredBulkManipulationTest.java @@ -26,6 +26,7 @@ package org.hibernate.test.filter.hql; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -35,6 +36,7 @@ import static org.junit.Assert.assertEquals; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class BasicFilteredBulkManipulationTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/filter/hql/JoinedFilteredBulkManipulationTest.java b/hibernate-core/src/test/java/org/hibernate/test/filter/hql/JoinedFilteredBulkManipulationTest.java index f468515057..4e4a2e4f9b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/filter/hql/JoinedFilteredBulkManipulationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/filter/hql/JoinedFilteredBulkManipulationTest.java @@ -27,6 +27,7 @@ import java.util.Date; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -34,7 +35,9 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class JoinedFilteredBulkManipulationTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "filter/hql/filter-defs.hbm.xml", diff --git a/hibernate-core/src/test/java/org/hibernate/test/flush/TestAutoFlushBeforeQueryExecution.java b/hibernate-core/src/test/java/org/hibernate/test/flush/TestAutoFlushBeforeQueryExecution.java index 12028c803b..b29ac4e031 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/flush/TestAutoFlushBeforeQueryExecution.java +++ b/hibernate-core/src/test/java/org/hibernate/test/flush/TestAutoFlushBeforeQueryExecution.java @@ -33,7 +33,6 @@ import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; -import org.hibernate.collection.internal.PersistentSet; import org.hibernate.engine.spi.ActionQueue; import org.hibernate.engine.spi.PersistenceContext; import org.hibernate.engine.spi.SessionFactoryImplementor; @@ -47,17 +46,18 @@ import org.hibernate.internal.SessionImpl; import org.hibernate.metamodel.spi.source.MetadataImplementor; import org.hibernate.service.BootstrapServiceRegistryBuilder; import org.hibernate.service.spi.SessionFactoryServiceRegistry; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * @author Gail Badner */ @TestForIssue( jiraKey = "HHH-6960" ) +@FailureExpectedWithNewMetamodel public class TestAutoFlushBeforeQueryExecution extends BaseCoreFunctionalTestCase { @Test diff --git a/hibernate-core/src/test/java/org/hibernate/test/flush/TestCollectionInitializingDuringFlush.java b/hibernate-core/src/test/java/org/hibernate/test/flush/TestCollectionInitializingDuringFlush.java index 4f1ebca81e..28c6f4455c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/flush/TestCollectionInitializingDuringFlush.java +++ b/hibernate-core/src/test/java/org/hibernate/test/flush/TestCollectionInitializingDuringFlush.java @@ -37,6 +37,7 @@ import org.hibernate.integrator.spi.Integrator; import org.hibernate.metamodel.spi.source.MetadataImplementor; import org.hibernate.service.BootstrapServiceRegistryBuilder; import org.hibernate.service.spi.SessionFactoryServiceRegistry; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -47,6 +48,7 @@ import static org.junit.Assert.assertTrue; * @author Steve Ebersole */ @TestForIssue( jiraKey = "HHH-2763" ) +@FailureExpectedWithNewMetamodel public class TestCollectionInitializingDuringFlush extends BaseCoreFunctionalTestCase { @Test public void testInitializationDuringFlush() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/formulajoin/FormulaJoinTest.java b/hibernate-core/src/test/java/org/hibernate/test/formulajoin/FormulaJoinTest.java index 6f95c2eb91..6e4c22d384 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/formulajoin/FormulaJoinTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/formulajoin/FormulaJoinTest.java @@ -30,6 +30,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.dialect.PostgreSQL81Dialect; import org.hibernate.dialect.PostgreSQLDialect; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -38,7 +39,9 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class FormulaJoinTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "formulajoin/Master.hbm.xml" }; } @@ -65,7 +68,7 @@ public class FormulaJoinTest extends BaseCoreFunctionalTestCase { s.persist(current); tx.commit(); s.close(); - + if ( getDialect() instanceof PostgreSQLDialect || getDialect() instanceof PostgreSQL81Dialect ) return; s = openSession(); @@ -74,7 +77,7 @@ public class FormulaJoinTest extends BaseCoreFunctionalTestCase { assertEquals( l.size(), 1 ); tx.commit(); s.close(); - + s = openSession(); tx = s.beginTransaction(); l = s.createQuery("from Master m left join fetch m.detail").list(); @@ -84,14 +87,14 @@ public class FormulaJoinTest extends BaseCoreFunctionalTestCase { assertTrue( m==m.getDetail().getMaster() ); tx.commit(); s.close(); - + s = openSession(); tx = s.beginTransaction(); l = s.createQuery("from Master m join fetch m.detail").list(); assertEquals( l.size(), 1 ); tx.commit(); s.close(); - + s = openSession(); tx = s.beginTransaction(); l = s.createQuery("from Detail d join fetch d.currentMaster.master").list(); @@ -103,10 +106,10 @@ public class FormulaJoinTest extends BaseCoreFunctionalTestCase { tx = s.beginTransaction(); l = s.createQuery("from Detail d join fetch d.currentMaster.master m join fetch m.detail").list(); assertEquals( l.size(), 2 ); - + s.createQuery("delete from Detail").executeUpdate(); s.createQuery("delete from Master").executeUpdate(); - + tx.commit(); s.close(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/generatedkeys/identity/IdentityGeneratedKeysTest.java b/hibernate-core/src/test/java/org/hibernate/test/generatedkeys/identity/IdentityGeneratedKeysTest.java index 4febd27212..2bf9720687 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/generatedkeys/identity/IdentityGeneratedKeysTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/generatedkeys/identity/IdentityGeneratedKeysTest.java @@ -6,6 +6,7 @@ import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -17,12 +18,15 @@ import static org.junit.Assert.assertNull; * @author Steve Ebersole */ @RequiresDialectFeature( DialectChecks.SupportsIdentityColumns.class ) +@FailureExpectedWithNewMetamodel public class IdentityGeneratedKeysTest extends BaseCoreFunctionalTestCase { + @Override public void configure(Configuration cfg) { super.configure( cfg ); cfg.setProperty( Environment.GENERATE_STATISTICS, "true" ); } + @Override public String[] getMappings() { return new String[] { "generatedkeys/identity/MyEntity.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingOrderByTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingOrderByTest.java index da291a03d4..e41e59292c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingOrderByTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingOrderByTest.java @@ -36,6 +36,7 @@ import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -46,6 +47,7 @@ import static org.junit.Assert.assertTrue; * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase { StateProvince stateProvince; private Zoo zoo1; @@ -108,7 +110,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase { zoo2Director2 = new Human(); zoo2Director2.setName( new Name( "Fat", 'A', "Cat" ) ); zoo2.getDirectors().put( "Head Honcho", zoo2Director1 ); - zoo2.getDirectors().put( "Asst. Head Honcho", zoo2Director2 ); + zoo2.getDirectors().put( "Asst. Head Honcho", zoo2Director2 ); zoo3 = new Zoo(); zoo3.setName( "Zoo" ); @@ -183,7 +185,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase { } if ( zoo2Director2 != null ) { s.delete( zoo2Director2 ); - zoo2Director2 = null; + zoo2Director2 = null; } if ( stateProvince != null ) { s.delete( stateProvince ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java index 20d16e1f0a..1f478d3be2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java @@ -76,6 +76,7 @@ import org.hibernate.test.cid.Order; import org.hibernate.test.cid.Product; import org.hibernate.testing.DialectChecks; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; @@ -105,6 +106,7 @@ import static org.junit.Assert.fail; * * @author Steve */ +@FailureExpectedWithNewMetamodel public class ASTParserLoadingTest extends BaseCoreFunctionalTestCase { private static final Logger log = Logger.getLogger( ASTParserLoadingTest.class ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java index 64c8514c3e..01ce5c0374 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/BulkManipulationTest.java @@ -39,6 +39,7 @@ import org.hibernate.id.BulkInsertionCapableIdentifierGenerator; import org.hibernate.id.IdentifierGenerator; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.SkipLog; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -53,7 +54,9 @@ import static org.junit.Assert.fail; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class BulkManipulationTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "hql/Animal.hbm.xml", @@ -239,7 +242,7 @@ public class BulkManipulationTest extends BaseCoreFunctionalTestCase { data.cleanup(); } - + @Test public void testInsertWithManyToOne() { TestData data = new TestData(); @@ -506,7 +509,7 @@ public class BulkManipulationTest extends BaseCoreFunctionalTestCase { s.createQuery( "insert into CompositeIdEntity (key2, someProperty, key1) select a.key2, 'COPY', a.key1 from CompositeIdEntity a" ).executeUpdate(); s.createQuery( "delete from CompositeIdEntity" ).executeUpdate(); s.getTransaction().commit(); - s.close(); + s.close(); } @Test @@ -1082,7 +1085,7 @@ public class BulkManipulationTest extends BaseCoreFunctionalTestCase { data.cleanup(); } - + @Test public void testDeleteUnionSubclassAbstractRoot() { TestData data = new TestData(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/ClassicTranslatorTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/ClassicTranslatorTest.java index bc00e31e45..1e27e322b4 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/ClassicTranslatorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/ClassicTranslatorTest.java @@ -29,6 +29,7 @@ import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * Some simple test queries using the classic translator explicitly @@ -38,6 +39,7 @@ import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class ClassicTranslatorTest extends QueryTranslatorTestCase { @Override public void configure(Configuration cfg) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaClassicAggregationReturnTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaClassicAggregationReturnTest.java index 9190688ece..21c0109923 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaClassicAggregationReturnTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaClassicAggregationReturnTest.java @@ -34,6 +34,7 @@ import org.hibernate.hql.internal.ast.QueryTranslatorImpl; import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory; import org.hibernate.hql.spi.QueryTranslator; import org.hibernate.hql.spi.QueryTranslatorFactory; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.type.BigDecimalType; import org.hibernate.type.BigIntegerType; import org.hibernate.type.DoubleType; @@ -46,6 +47,7 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class CriteriaClassicAggregationReturnTest extends QueryTranslatorTestCase { @Override public void configure(Configuration cfg) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaHQLAlignmentTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaHQLAlignmentTest.java index e9014442bd..cf74dfe62a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaHQLAlignmentTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/CriteriaHQLAlignmentTest.java @@ -40,6 +40,7 @@ import org.hibernate.hql.internal.ast.tree.SelectClause; import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory; import org.hibernate.hql.spi.QueryTranslator; import org.hibernate.hql.spi.QueryTranslatorFactory; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.type.BigDecimalType; import org.hibernate.type.BigIntegerType; @@ -51,10 +52,11 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; /** - * Tests cases for ensuring alignment between HQL and Criteria behavior. + * Tests cases for ensuring alignment between HQL and Criteria behavior. * * @author Max Rydahl Andersen */ +@FailureExpectedWithNewMetamodel public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase { private boolean initialVersion2SqlFlagValue; @@ -92,43 +94,43 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase { QueryTranslatorImpl translator = createNewQueryTranslator( "select count(*) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] ); - + translator = createNewQueryTranslator( "select count(h.heightInches) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] ); - - // MAX, MIN return the type of the state-field to which they are applied. + + // MAX, MIN return the type of the state-field to which they are applied. translator = createNewQueryTranslator( "select max(h.heightInches) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); - + translator = createNewQueryTranslator( "select max(h.id) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] ); - + // AVG returns Double. translator = createNewQueryTranslator( "select avg(h.heightInches) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); - + translator = createNewQueryTranslator( "select avg(h.id) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); - + translator = createNewQueryTranslator( "select avg(h.bigIntegerValue) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); - + // SUM returns Long when applied to state-fields of integral types (other than BigInteger); translator = createNewQueryTranslator( "select sum(h.id) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] ); - + translator = createNewQueryTranslator( "select sum(h.intValue) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] ); - - // SUM returns Double when applied to state-fields of floating point types; + + // SUM returns Double when applied to state-fields of floating point types; translator = createNewQueryTranslator( "select sum(h.heightInches) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); @@ -136,12 +138,12 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase { translator = createNewQueryTranslator( "select sum(h.floatValue) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); - - // SUM returns BigInteger when applied to state-fields of type BigInteger + + // SUM returns BigInteger when applied to state-fields of type BigInteger translator = createNewQueryTranslator( "select sum(h.bigIntegerValue) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type", BigIntegerType.INSTANCE, translator.getReturnTypes()[0] ); - + // SUM and BigDecimal when applied to state-fields of type BigDecimal. translator = createNewQueryTranslator( "select sum(h.bigDecimalValue) from Human h" ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); @@ -173,46 +175,46 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase { assertEquals(longValue, new Long(1)); longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.count("heightInches")).uniqueResult(); assertEquals(longValue, new Long(1)); - - // MAX, MIN return the type of the state-field to which they are applied. + + // MAX, MIN return the type of the state-field to which they are applied. Double dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.max( "heightInches" )).uniqueResult(); assertNotNull(dblValue); - + longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.max( "id" )).uniqueResult(); assertNotNull(longValue); - + // AVG returns Double. dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "heightInches" )).uniqueResult(); assertNotNull(dblValue); - + dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "id" )).uniqueResult(); assertNotNull(dblValue); - + dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "bigIntegerValue" )).uniqueResult(); assertNotNull(dblValue); - + // SUM returns Long when applied to state-fields of integral types (other than BigInteger); longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.sum( "id" )).uniqueResult(); assertNotNull(longValue); - + longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.sum( "intValue" )).uniqueResult(); assertNotNull(longValue); - - // SUM returns Double when applied to state-fields of floating point types; + + // SUM returns Double when applied to state-fields of floating point types; dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.sum( "heightInches" )).uniqueResult(); assertNotNull(dblValue); - + dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.sum( "floatValue" )).uniqueResult(); assertNotNull(dblValue); - - // SUM returns BigInteger when applied to state-fields of type BigInteger + + // SUM returns BigInteger when applied to state-fields of type BigInteger BigInteger bigIValue = (BigInteger) s.createCriteria( Human.class ).setProjection( Projections.sum( "bigIntegerValue" )).uniqueResult(); assertNotNull(bigIValue); - + // SUM and BigDecimal when applied to state-fields of type BigDecimal. BigDecimal bigDValue = (BigDecimal) s.createCriteria( Human.class ).setProjection( Projections.sum( "bigDecimalValue" )).uniqueResult(); assertNotNull(bigDValue); - + s.delete( human ); s.flush(); s.getTransaction().commit(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/EJBQLTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/EJBQLTest.java index 78222d82df..73d070eddb 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/EJBQLTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/EJBQLTest.java @@ -39,6 +39,7 @@ import org.hibernate.hql.internal.ast.QueryTranslatorImpl; import org.hibernate.hql.internal.ast.util.ASTUtil; import org.hibernate.hql.spi.QueryTranslator; import org.hibernate.hql.spi.QueryTranslatorFactory; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static junit.framework.Assert.assertEquals; @@ -47,6 +48,7 @@ import static junit.framework.Assert.assertTrue; /** * @author Alexey Loubyansky */ +@FailureExpectedWithNewMetamodel public class EJBQLTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/HQLTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/HQLTest.java index ddda76c903..cfca6d679d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/HQLTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/HQLTest.java @@ -69,6 +69,7 @@ import org.hibernate.hql.spi.QueryTranslator; import org.hibernate.hql.spi.QueryTranslatorFactory; import org.hibernate.testing.DialectChecks; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; @@ -87,6 +88,7 @@ import static org.junit.Assert.assertTrue; * * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class HQLTest extends QueryTranslatorTestCase { @Override public boolean createSchema() { @@ -131,7 +133,7 @@ public class HQLTest extends QueryTranslatorTestCase { assertTranslation( "from Animal a where a.offspring.description = 'xyz'" ); assertTranslation( "from Animal a where a.offspring.father.description = 'xyz'" ); } - + @Test @FailureExpected( jiraKey = "N/A", message = "Lacking ClassicQueryTranslatorFactory support" ) public void testRowValueConstructorSyntaxInInList2() { @@ -180,7 +182,7 @@ public class HQLTest extends QueryTranslatorTestCase { AST inNode = whereNode.getFirstChild(); assertEquals( message, expected, inNode != null && inNode.getType() == HqlTokenTypes.IN ); } - + @Test public void testSubComponentReferences() { assertTranslation( "select c.address.zip.code from ComponentContainer c" ); @@ -198,7 +200,7 @@ public class HQLTest extends QueryTranslatorTestCase { public void testJoinFetchCollectionOfValues() { assertTranslation( "select h from Human as h join fetch h.nickNames" ); } - + @Test public void testCollectionMemberDeclarations2() { assertTranslation( "from Customer c, in(c.orders) o" ); @@ -211,9 +213,9 @@ public class HQLTest extends QueryTranslatorTestCase { public void testCollectionMemberDeclarations(){ // both these two query translators throw exeptions for this HQL since // IN asks an alias, but the difference is that the error message from AST - // contains the error token location (by lines and columns), which is hardly + // contains the error token location (by lines and columns), which is hardly // to get from Classic query translator --stliu - assertTranslation( "from Customer c, in(c.orders)" ); + assertTranslation( "from Customer c, in(c.orders)" ); } @Test @@ -346,7 +348,7 @@ public class HQLTest extends QueryTranslatorTestCase { assertTranslation("from Animal where abs(:x - :y) < 2.0"); assertTranslation("from Animal where lower(upper(:foo)) like 'f%'"); if ( ! ( getDialect() instanceof SybaseDialect ) && ! ( getDialect() instanceof Sybase11Dialect ) && ! ( getDialect() instanceof SybaseASE15Dialect ) && ! ( getDialect() instanceof SQLServerDialect ) ) { - // Transact-SQL dialects (except SybaseAnywhereDialect) map the length function -> len; + // Transact-SQL dialects (except SybaseAnywhereDialect) map the length function -> len; // classic translator does not consider that *when nested*; // SybaseAnywhereDialect supports the length function @@ -744,13 +746,13 @@ public class HQLTest extends QueryTranslatorTestCase { || getDialect() instanceof Sybase11Dialect || getDialect() instanceof SybaseASE15Dialect || getDialect() instanceof SybaseAnywhereDialect - || getDialect() instanceof SQLServerDialect + || getDialect() instanceof SQLServerDialect || getDialect() instanceof IngresDialect) { // SybaseASE15Dialect and SybaseAnywhereDialect support '||' // MySQL uses concat(x, y, z) // SQL Server replaces '||' with '+' // - // this is syntax checked in {@link ASTParserLoadingTest#testConcatenation} + // this is syntax checked in {@link ASTParserLoadingTest#testConcatenation} // Ingres supports both "||" and '+' but IngresDialect originally // uses '+' operator; updated Ingres9Dialect to use "||". return; diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java index 9599978aa7..aae68ae40d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java @@ -32,6 +32,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -48,7 +49,9 @@ import static org.junit.Assert.fail; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "hql/Animal.hbm.xml" }; } @@ -173,7 +176,7 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase assertFalse( results.isFirst() ); assertFalse( results.isLast() ); - assertFalse( results.previous() ); + assertFalse( results.previous() ); assertTrue( results.next() ); assertTrue( results.isFirst() ); @@ -217,7 +220,7 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase assertTrue( results.first() ); assertTrue( results.isFirst() ); - assertTrue( results.isLast() ); + assertTrue( results.isLast() ); for ( int i=1; i<3; i++ ) { assertTrue( results.setRowNumber( 1 ) ); @@ -424,7 +427,7 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase private void cleanup() { Session s = openSession(); Transaction txn = s.beginTransaction(); - + s.createQuery( "delete Animal where description like 'grand%'" ).executeUpdate(); s.createQuery( "delete Animal where not description like 'root%'" ).executeUpdate(); s.createQuery( "delete Animal" ).executeUpdate(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/WithClauseTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/WithClauseTest.java index 49663294b2..d2a6d53052 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/WithClauseTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/WithClauseTest.java @@ -31,6 +31,7 @@ import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.hql.internal.ast.InvalidWithClauseException; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertTrue; @@ -41,7 +42,9 @@ import static org.junit.Assert.fail; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class WithClauseTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "hql/Animal.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/hql/joinedSubclass/JoinedSubclassBulkManipTest.java b/hibernate-core/src/test/java/org/hibernate/test/hql/joinedSubclass/JoinedSubclassBulkManipTest.java index 7500acd798..b3b1328ee2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/hql/joinedSubclass/JoinedSubclassBulkManipTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/hql/joinedSubclass/JoinedSubclassBulkManipTest.java @@ -26,12 +26,14 @@ package org.hibernate.test.hql.joinedSubclass; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class JoinedSubclassBulkManipTest extends BaseCoreFunctionalTestCase { @Override protected Class[] getAnnotatedClasses() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/id/MultipleHiLoPerTableGeneratorTest.java b/hibernate-core/src/test/java/org/hibernate/test/id/MultipleHiLoPerTableGeneratorTest.java index c402b5af52..c2e7a518f4 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/id/MultipleHiLoPerTableGeneratorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/id/MultipleHiLoPerTableGeneratorTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -35,11 +36,13 @@ import static org.junit.Assert.assertEquals; * @author Emmanuel Bernard */ public class MultipleHiLoPerTableGeneratorTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[]{ "id/Car.hbm.xml", "id/Plane.hbm.xml", "id/Radio.hbm.xml" }; } @Test + @FailureExpectedWithNewMetamodel public void testDistinctId() throws Exception { Session s = openSession(); Transaction tx = s.beginTransaction(); @@ -60,7 +63,7 @@ public class MultipleHiLoPerTableGeneratorTest extends BaseCoreFunctionalTestCas assertEquals(i+1, cars[i].getId().intValue()); //assertEquals(i+1, planes[i].getId().intValue()); } - + s = openSession(); tx = s.beginTransaction(); s.createQuery( "delete from Car" ).executeUpdate(); @@ -69,6 +72,7 @@ public class MultipleHiLoPerTableGeneratorTest extends BaseCoreFunctionalTestCas } @Test + @FailureExpectedWithNewMetamodel public void testRollingBack() throws Throwable { Session s = openSession(); Transaction tx = s.beginTransaction(); @@ -102,6 +106,7 @@ public class MultipleHiLoPerTableGeneratorTest extends BaseCoreFunctionalTestCas } @Test + @FailureExpectedWithNewMetamodel public void testAllParams() throws Exception { Session s = openSession(); Transaction tx = s.beginTransaction(); @@ -115,7 +120,7 @@ public class MultipleHiLoPerTableGeneratorTest extends BaseCoreFunctionalTestCas assertEquals( new Integer(2), radio.getId() ); tx.commit(); s.close(); - + s = openSession(); tx = s.beginTransaction(); s.createQuery( "delete from Radio" ).executeUpdate(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/idbag/IdBagTest.java b/hibernate-core/src/test/java/org/hibernate/test/idbag/IdBagTest.java index 27e89ab67e..e345492432 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/idbag/IdBagTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idbag/IdBagTest.java @@ -31,6 +31,7 @@ import org.hibernate.Hibernate; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -63,7 +64,7 @@ public class IdBagTest extends BaseCoreFunctionalTestCase { s.persist(banned); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); gavin = (User) s.createCriteria(User.class).uniqueResult(); @@ -79,12 +80,13 @@ public class IdBagTest extends BaseCoreFunctionalTestCase { s.delete(moderators); s.delete(admins); s.delete(gavin); - + t.commit(); - s.close(); + s.close(); } @Test + @FailureExpectedWithNewMetamodel public void testJoin() throws HibernateException, SQLException { Session s = openSession(); Transaction t = s.beginTransaction(); @@ -96,22 +98,22 @@ public class IdBagTest extends BaseCoreFunctionalTestCase { s.persist(gavin); s.persist(plebs); s.persist(admins); - + List l = s.createQuery("from User u join u.groups g").list(); assertEquals( l.size(), 2 ); s.clear(); - + gavin = (User) s.createQuery("from User u join fetch u.groups").uniqueResult(); assertTrue( Hibernate.isInitialized( gavin.getGroups() ) ); assertEquals( gavin.getGroups().size(), 2 ); assertEquals( ( (Group) gavin.getGroups().get(0) ).getName(), "admins" ); - + s.delete( gavin.getGroups().get(0) ); s.delete( gavin.getGroups().get(1) ); s.delete(gavin); - + t.commit(); - s.close(); + s.close(); } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/idclass/IdClassTest.java b/hibernate-core/src/test/java/org/hibernate/test/idclass/IdClassTest.java index c40d50edce..55a18dc89f 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/idclass/IdClassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idclass/IdClassTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -34,7 +35,9 @@ import static org.junit.Assert.assertEquals; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class IdClassTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "idclass/Customer.hbm.xml" }; } @@ -47,7 +50,7 @@ public class IdClassTest extends BaseCoreFunctionalTestCase { s.persist(cust); t.commit(); s.close(); - + s = openSession(); CustomerId custId = new CustomerId("JBoss", "RouteOne"); t = s.beginTransaction(); @@ -56,7 +59,7 @@ public class IdClassTest extends BaseCoreFunctionalTestCase { assertEquals( cust.getCustomerName(), custId.getCustomerName() ); assertEquals( cust.getOrgName(), custId.getOrgName() ); t.commit(); - s.close(); + s.close(); s = openSession(); t = s.beginTransaction(); @@ -73,9 +76,9 @@ public class IdClassTest extends BaseCoreFunctionalTestCase { assertEquals( "Detroit", cust.getAddress() ); assertEquals( cust.getCustomerName(), custId.getCustomerName() ); assertEquals( cust.getOrgName(), custId.getOrgName() ); - + s.createQuery( "delete from Customer" ).executeUpdate(); - + t.commit(); s.close(); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/idgen/biginteger/sequence/BigIntegerSequenceGeneratorTest.java b/hibernate-core/src/test/java/org/hibernate/test/idgen/biginteger/sequence/BigIntegerSequenceGeneratorTest.java index 7d2d99342e..5f3665f08e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idgen/biginteger/sequence/BigIntegerSequenceGeneratorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idgen/biginteger/sequence/BigIntegerSequenceGeneratorTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -35,11 +36,13 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; */ @RequiresDialectFeature( value = DialectChecks.SupportsSequences.class ) public class BigIntegerSequenceGeneratorTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "idgen/biginteger/sequence/Mapping.hbm.xml" }; } @Test + @FailureExpectedWithNewMetamodel public void testBasics() { Session s = openSession(); s.beginTransaction(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/BasicForcedTableSequenceTest.java b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/BasicForcedTableSequenceTest.java index fc949a72fd..22b9bfbeac 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/BasicForcedTableSequenceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/BasicForcedTableSequenceTest.java @@ -31,6 +31,7 @@ import org.hibernate.id.enhanced.OptimizerFactory; import org.hibernate.id.enhanced.SequenceStyleGenerator; import org.hibernate.id.enhanced.TableStructure; import org.hibernate.persister.entity.EntityPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -41,11 +42,13 @@ import static org.junit.Assert.assertTrue; * @author Steve Ebersole */ public class BasicForcedTableSequenceTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "idgen/enhanced/forcedtable/Basic.hbm.xml" }; } @Test + @FailureExpectedWithNewMetamodel public void testNormalBoundary() { EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() ); assertTrue( diff --git a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLoForcedTableSequenceTest.java b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLoForcedTableSequenceTest.java index 4eecf262a5..4cc1eade0d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLoForcedTableSequenceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/HiLoForcedTableSequenceTest.java @@ -31,6 +31,7 @@ import org.hibernate.id.enhanced.OptimizerFactory; import org.hibernate.id.enhanced.SequenceStyleGenerator; import org.hibernate.id.enhanced.TableStructure; import org.hibernate.persister.entity.EntityPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -42,11 +43,13 @@ import static org.junit.Assert.assertTrue; * @author Steve Ebersole */ public class HiLoForcedTableSequenceTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "idgen/enhanced/forcedtable/HiLo.hbm.xml" }; } @Test + @FailureExpectedWithNewMetamodel public void testNormalBoundary() { EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() ); assertTrue( diff --git a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/PooledForcedTableSequenceTest.java b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/PooledForcedTableSequenceTest.java index 5e808b792d..b089d0e8b2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/PooledForcedTableSequenceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/forcedtable/PooledForcedTableSequenceTest.java @@ -31,6 +31,7 @@ import org.hibernate.id.enhanced.OptimizerFactory; import org.hibernate.id.enhanced.SequenceStyleGenerator; import org.hibernate.id.enhanced.TableStructure; import org.hibernate.persister.entity.EntityPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -40,11 +41,13 @@ import static org.junit.Assert.assertTrue; * @author Steve Ebersole */ public class PooledForcedTableSequenceTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "idgen/enhanced/forcedtable/Pooled.hbm.xml" }; } @Test + @FailureExpectedWithNewMetamodel public void testNormalBoundary() { EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() ); assertTrue( diff --git a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/BasicSequenceTest.java b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/BasicSequenceTest.java index 4973ac1111..be97a227f6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/BasicSequenceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/BasicSequenceTest.java @@ -29,6 +29,7 @@ import org.hibernate.Session; import org.hibernate.id.IdentifierGeneratorHelper.BasicHolder; import org.hibernate.id.enhanced.SequenceStyleGenerator; import org.hibernate.persister.entity.EntityPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -39,6 +40,7 @@ import static org.junit.Assert.assertEquals; * @author Steve Ebersole * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ +@FailureExpectedWithNewMetamodel public class BasicSequenceTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/HiLoSequenceTest.java b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/HiLoSequenceTest.java index 888b56bdf6..d444a6eb18 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/HiLoSequenceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/HiLoSequenceTest.java @@ -31,6 +31,7 @@ import org.hibernate.id.IdentifierGeneratorHelper.BasicHolder; import org.hibernate.id.enhanced.OptimizerFactory; import org.hibernate.id.enhanced.SequenceStyleGenerator; import org.hibernate.persister.entity.EntityPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.hibernate.testing.junit4.ExtraAssertions.assertClassAssignability; @@ -40,11 +41,13 @@ import static org.junit.Assert.assertEquals; * @author Steve Ebersole */ public class HiLoSequenceTest extends BaseCoreFunctionalTestCase { + @Override protected String[] getMappings() { return new String[] { "idgen/enhanced/sequence/HiLo.hbm.xml" }; } @Test + @FailureExpectedWithNewMetamodel public void testNormalBoundary() { EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() ); assertClassAssignability( SequenceStyleGenerator.class, persister.getIdentifierGenerator().getClass() ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/PooledSequenceTest.java b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/PooledSequenceTest.java index 9216f8952c..166a9cfd65 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/PooledSequenceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/sequence/PooledSequenceTest.java @@ -29,6 +29,7 @@ import org.hibernate.Session; import org.hibernate.id.enhanced.OptimizerFactory; import org.hibernate.id.enhanced.SequenceStyleGenerator; import org.hibernate.persister.entity.EntityPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.hibernate.id.IdentifierGeneratorHelper.BasicHolder; @@ -45,6 +46,7 @@ public class PooledSequenceTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testNormalBoundary() { EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() ); assertClassAssignability( SequenceStyleGenerator.class, persister.getIdentifierGenerator().getClass() ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/BasicTableTest.java b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/BasicTableTest.java index 3fe0f8350b..347d19454c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/BasicTableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/BasicTableTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.id.enhanced.TableGenerator; import org.hibernate.persister.entity.EntityPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.hibernate.id.IdentifierGeneratorHelper.BasicHolder; @@ -37,6 +38,7 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class BasicTableTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/HiLoTableTest.java b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/HiLoTableTest.java index a540971d50..9f9fb53a62 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/HiLoTableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/HiLoTableTest.java @@ -29,6 +29,7 @@ import org.hibernate.Session; import org.hibernate.id.enhanced.OptimizerFactory; import org.hibernate.id.enhanced.TableGenerator; import org.hibernate.persister.entity.EntityPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.hibernate.id.IdentifierGeneratorHelper.BasicHolder; @@ -38,6 +39,7 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class HiLoTableTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/PooledTableTest.java b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/PooledTableTest.java index adf2d84a82..57503dd070 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/PooledTableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idgen/enhanced/table/PooledTableTest.java @@ -29,6 +29,7 @@ import org.hibernate.Session; import org.hibernate.id.enhanced.OptimizerFactory; import org.hibernate.id.enhanced.TableGenerator; import org.hibernate.persister.entity.EntityPersister; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.hibernate.id.IdentifierGeneratorHelper.BasicHolder; @@ -45,6 +46,7 @@ public class PooledTableTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testNormalBoundary() { EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() ); assertClassAssignability( TableGenerator.class, persister.getIdentifierGenerator().getClass() ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/idprops/IdentifierPropertyReferencesTest.java b/hibernate-core/src/test/java/org/hibernate/test/idprops/IdentifierPropertyReferencesTest.java index 37af55a267..f003468dd3 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/idprops/IdentifierPropertyReferencesTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/idprops/IdentifierPropertyReferencesTest.java @@ -30,6 +30,7 @@ import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -37,6 +38,7 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class IdentifierPropertyReferencesTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/ImmutableTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/ImmutableTest.java index 838204dc5d..e1395a55a3 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/ImmutableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/ImmutableTest.java @@ -35,6 +35,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.criterion.Projections; import org.hibernate.dialect.Oracle8iDialect; import org.hibernate.proxy.HibernateProxy; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.TextType; @@ -51,6 +52,7 @@ import static org.junit.Assert.fail; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class ImmutableTest extends BaseCoreFunctionalTestCase { private static class TextAsMaterializedClobType extends AbstractSingleColumnStandardBasicType { public final static TextAsMaterializedClobType INSTANCE = new TextAsMaterializedClobType(); @@ -69,7 +71,7 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase { } cfg.setProperty( Environment.GENERATE_STATISTICS, "true"); cfg.setProperty( Environment.STATEMENT_BATCH_SIZE, "0" ); - } + } @Override public String[] getMappings() { @@ -733,7 +735,7 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase { s.close(); assertUpdateCount( 0 ); - assertDeleteCount( 3 ); + assertDeleteCount( 3 ); } @@ -1124,7 +1126,7 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase { s.close(); assertUpdateCount( 0 ); - assertDeleteCount( 3 ); + assertDeleteCount( 3 ); } @Test @@ -1396,7 +1398,7 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase { assertUpdateCount( 0 ); assertDeleteCount( 4 ); } - + @Test public void testImmutableEntityRemoveImmutableFromInverseMutableCollection() { clearCounts(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseManyToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseManyToManyTest.java index fd6c41fd34..acd0108dd8 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseManyToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseManyToManyTest.java @@ -24,10 +24,12 @@ package org.hibernate.test.immutable.entitywithmutablecollection.inverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithManyToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class EntityWithInverseManyToManyTest extends AbstractEntityWithManyToManyTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseOneToManyJoinTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseOneToManyJoinTest.java index a96dd678cd..43af64d78d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseOneToManyJoinTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseOneToManyJoinTest.java @@ -24,11 +24,14 @@ package org.hibernate.test.immutable.entitywithmutablecollection.inverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class EntityWithInverseOneToManyJoinTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariationOneToManyJoin.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseOneToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseOneToManyTest.java index 722b590bf7..4529646ea0 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseOneToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/EntityWithInverseOneToManyTest.java @@ -24,11 +24,14 @@ package org.hibernate.test.immutable.entitywithmutablecollection.inverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class EntityWithInverseOneToManyTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariation.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseManyToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseManyToManyTest.java index 8dffa3b6be..faae1b34d6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseManyToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseManyToManyTest.java @@ -24,10 +24,12 @@ package org.hibernate.test.immutable.entitywithmutablecollection.inverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithManyToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class VersionedEntityWithInverseManyToManyTest extends AbstractEntityWithManyToManyTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyFailureExpectedTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyFailureExpectedTest.java index 0379ae0854..deb84c9500 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyFailureExpectedTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyFailureExpectedTest.java @@ -27,13 +27,16 @@ import org.junit.Test; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner * * These tests reproduce HHH-4992. */ +@FailureExpectedWithNewMetamodel public class VersionedEntityWithInverseOneToManyFailureExpectedTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariationVersioned.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyJoinFailureExpectedTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyJoinFailureExpectedTest.java index d2d60a0a75..50cb262296 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyJoinFailureExpectedTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyJoinFailureExpectedTest.java @@ -27,11 +27,14 @@ import org.junit.Test; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class VersionedEntityWithInverseOneToManyJoinFailureExpectedTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariationVersionedOneToManyJoin.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyJoinTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyJoinTest.java index cf7bda64e9..6c226a7349 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyJoinTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyJoinTest.java @@ -24,6 +24,7 @@ package org.hibernate.test.immutable.entitywithmutablecollection.inverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; @@ -31,15 +32,19 @@ import org.hibernate.testing.TestForIssue; * @author Gail Badner */ @TestForIssue( jiraKey = "HHH-4992" ) +@FailureExpectedWithNewMetamodel public class VersionedEntityWithInverseOneToManyJoinTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariationVersionedOneToManyJoin.hbm.xml" }; } + @Override protected boolean checkUpdateCountsAfterAddingExistingElement() { return false; } + @Override protected boolean checkUpdateCountsAfterRemovingElementWithoutDelete() { return false; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyTest.java index a0e01ebbc1..93812ff57e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/inverse/VersionedEntityWithInverseOneToManyTest.java @@ -24,19 +24,24 @@ package org.hibernate.test.immutable.entitywithmutablecollection.inverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class VersionedEntityWithInverseOneToManyTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariationVersioned.hbm.xml" }; } + @Override protected boolean checkUpdateCountsAfterAddingExistingElement() { return false; } + @Override protected boolean checkUpdateCountsAfterRemovingElementWithoutDelete() { return false; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseManyToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseManyToManyTest.java index 729745d13b..020449cbac 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseManyToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseManyToManyTest.java @@ -24,10 +24,12 @@ package org.hibernate.test.immutable.entitywithmutablecollection.noninverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithManyToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class EntityWithNonInverseManyToManyTest extends AbstractEntityWithManyToManyTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseManyToManyUnidirTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseManyToManyUnidirTest.java index 68f8f236ee..9c569bc328 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseManyToManyUnidirTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseManyToManyUnidirTest.java @@ -24,10 +24,12 @@ package org.hibernate.test.immutable.entitywithmutablecollection.noninverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithManyToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class EntityWithNonInverseManyToManyUnidirTest extends AbstractEntityWithManyToManyTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyJoinTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyJoinTest.java index c99d427e32..10b1951bdf 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyJoinTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyJoinTest.java @@ -24,11 +24,14 @@ package org.hibernate.test.immutable.entitywithmutablecollection.noninverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class EntityWithNonInverseOneToManyJoinTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/noninverse/ContractVariationOneToManyJoin.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyTest.java index bf2ede12d8..58c6a88117 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyTest.java @@ -24,11 +24,14 @@ package org.hibernate.test.immutable.entitywithmutablecollection.noninverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class EntityWithNonInverseOneToManyTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/noninverse/ContractVariation.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyUnidirTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyUnidirTest.java index a9c2cbb44b..1414153a54 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyUnidirTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/EntityWithNonInverseOneToManyUnidirTest.java @@ -24,11 +24,14 @@ package org.hibernate.test.immutable.entitywithmutablecollection.noninverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class EntityWithNonInverseOneToManyUnidirTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/noninverse/ContractVariationUnidir.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseManyToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseManyToManyTest.java index 02ff97e3ad..8592ff45bc 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseManyToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseManyToManyTest.java @@ -24,10 +24,12 @@ package org.hibernate.test.immutable.entitywithmutablecollection.noninverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithManyToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class VersionedEntityWithNonInverseManyToManyTest extends AbstractEntityWithManyToManyTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseOneToManyJoinTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseOneToManyJoinTest.java index dd5d21e2a3..24fb8e8e09 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseOneToManyJoinTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseOneToManyJoinTest.java @@ -24,11 +24,14 @@ package org.hibernate.test.immutable.entitywithmutablecollection.noninverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class VersionedEntityWithNonInverseOneToManyJoinTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/noninverse/ContractVariationVersionedOneToManyJoin.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseOneToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseOneToManyTest.java index 02ed983266..191b5b34a0 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseOneToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/entitywithmutablecollection/noninverse/VersionedEntityWithNonInverseOneToManyTest.java @@ -24,11 +24,14 @@ package org.hibernate.test.immutable.entitywithmutablecollection.noninverse; import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class VersionedEntityWithNonInverseOneToManyTest extends AbstractEntityWithOneToManyTest { + @Override public String[] getMappings() { return new String[] { "immutable/entitywithmutablecollection/noninverse/ContractVariationVersioned.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java b/hibernate-core/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java index c8cd78ad28..f4d4d1cf24 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java @@ -34,6 +34,7 @@ import org.hibernate.EmptyInterceptor; import org.hibernate.Interceptor; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.type.Type; @@ -74,6 +75,7 @@ public class InterceptorTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testPropertyIntercept() { Session s = openSession( new PropertyInterceptor() ); Transaction t = s.beginTransaction(); @@ -100,6 +102,7 @@ public class InterceptorTest extends BaseCoreFunctionalTestCase { */ @Test @TestForIssue( jiraKey = "HHH-1921" ) + @FailureExpectedWithNewMetamodel public void testPropertyIntercept2() { Session s = openSession(); Transaction t = s.beginTransaction(); @@ -110,6 +113,7 @@ public class InterceptorTest extends BaseCoreFunctionalTestCase { s = openSession( new EmptyInterceptor() { + @Override public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) { currentState[0] = "test"; return true; @@ -139,6 +143,7 @@ public class InterceptorTest extends BaseCoreFunctionalTestCase { Session s = openSession( new EmptyInterceptor() { + @Override public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { if ( state[0] == null ) { Image.Details detail = new Image.Details(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java b/hibernate-core/src/test/java/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java index cfb74ad1f8..aab79d9ced 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -39,6 +40,7 @@ import static org.junit.Assert.assertNotNull; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class InterfaceProxyTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -65,8 +67,8 @@ public class InterfaceProxyTest extends BaseCoreFunctionalTestCase { SecureDocument d2 = new SecureDocumentImpl(); d2.setName("Secret"); d2.setContent( s.getLobHelper().createBlob( "wxyz wxyz".getBytes() ) ); - // SybaseASE15Dialect only allows 7-bits in a byte to be inserted into a tinyint - // column (0 <= val < 128) + // SybaseASE15Dialect only allows 7-bits in a byte to be inserted into a tinyint + // column (0 <= val < 128) d2.setPermissionBits( (byte) 127 ); d2.setOwner("gavin"); Long d2id = (Long) s.save(d2); @@ -79,32 +81,32 @@ public class InterfaceProxyTest extends BaseCoreFunctionalTestCase { assertEquals( did, d.getId() ); assertEquals( "Hibernate in Action", d.getName() ); assertNotNull( d.getContent() ); - + d2 = (SecureDocument) s.load(ItemImpl.class, d2id); assertEquals( d2id, d2.getId() ); assertEquals( "Secret", d2.getName() ); assertNotNull( d2.getContent() ); - + s.clear(); - + d = (Document) s.load(DocumentImpl.class, did); assertEquals( did, d.getId() ); assertEquals( "Hibernate in Action", d.getName() ); assertNotNull( d.getContent() ); - + d2 = (SecureDocument) s.load(SecureDocumentImpl.class, d2id); assertEquals( d2id, d2.getId() ); assertEquals( "Secret", d2.getName() ); assertNotNull( d2.getContent() ); assertEquals( "gavin", d2.getOwner() ); - + //s.clear(); - + d2 = (SecureDocument) s.load(SecureDocumentImpl.class, did); assertEquals( did, d2.getId() ); assertEquals( "Hibernate in Action", d2.getName() ); assertNotNull( d2.getContent() ); - + try { d2.getOwner(); //CCE assertFalse(true); diff --git a/hibernate-core/src/test/java/org/hibernate/test/iterate/IterateTest.java b/hibernate-core/src/test/java/org/hibernate/test/iterate/IterateTest.java index 09307f9dcc..69b691d824 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/iterate/IterateTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/iterate/IterateTest.java @@ -32,6 +32,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -41,11 +42,14 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class IterateTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "iterate/Item.hbm.xml" }; } + @Override public void configure(Configuration cfg) { super.configure( cfg ); cfg.setProperty( Environment.USE_QUERY_CACHE, "true" ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/join/JoinTest.java b/hibernate-core/src/test/java/org/hibernate/test/join/JoinTest.java index 84d9ed3a84..8ed1a8e557 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/join/JoinTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/join/JoinTest.java @@ -35,6 +35,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Restrictions; import org.hibernate.jdbc.AbstractWork; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -44,6 +45,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class JoinTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -54,7 +56,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase { public void testSequentialSelects() { Session s = openSession(); Transaction t = s.beginTransaction(); - + Employee mark = new Employee(); mark.setName("Mark"); mark.setTitle("internal sales"); @@ -62,7 +64,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase { mark.setAddress("buckhead"); mark.setZip("30305"); mark.setCountry("USA"); - + Customer joe = new Customer(); joe.setName("Joe"); joe.setAddress("San Francisco"); @@ -71,17 +73,17 @@ public class JoinTest extends BaseCoreFunctionalTestCase { joe.setComments("Very demanding"); joe.setSex('M'); joe.setSalesperson(mark); - + Person yomomma = new Person(); yomomma.setName("mum"); yomomma.setSex('F'); - + s.save(yomomma); s.save(mark); - s.save(joe); - + s.save(joe); + assertEquals( s.createQuery("from java.io.Serializable").list().size(), 0 ); - + assertEquals( s.createQuery("from Person").list().size(), 3 ); assertEquals( s.createQuery("from Person p where p.class is null").list().size(), 1 ); assertEquals( s.createQuery("from Person p where p.class = Customer").list().size(), 1 ); @@ -96,7 +98,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase { } assertEquals( customers.size(), 1 ); s.clear(); - + customers = s.createQuery("from Customer").list(); for ( Iterator iter = customers.iterator(); iter.hasNext(); ) { Customer c = (Customer) iter.next(); @@ -105,11 +107,11 @@ public class JoinTest extends BaseCoreFunctionalTestCase { } assertEquals( customers.size(), 1 ); s.clear(); - + mark = (Employee) s.get( Employee.class, new Long( mark.getId() ) ); joe = (Customer) s.get( Customer.class, new Long( joe.getId() ) ); - + mark.setZip("30306"); assertEquals( s.createQuery("from Person p where p.zip = '30306'").list().size(), 1 ); s.delete(mark); @@ -132,7 +134,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase { s.save(jesus); assertEquals( s.createQuery("from java.io.Serializable").list().size(), 0 ); - + assertEquals( s.createQuery("from Person").list().size(), 1 ); assertEquals( s.createQuery("from Person p where p.class is null").list().size(), 0 ); assertEquals( s.createQuery("from Person p where p.class = User").list().size(), 1 ); @@ -160,7 +162,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase { t.commit(); s.close(); } - + @Test public void testCustomColumnReadAndWrite() { Session s = openSession(); @@ -180,7 +182,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase { u.setPasswordExpiryDays(PASSWORD_EXPIRY_DAYS); s.persist(u); s.flush(); - + // Test value conversion during insert // Oracle returns BigDecimaal while other dialects return Double; // casting to Number so it works on all dialects @@ -190,13 +192,13 @@ public class JoinTest extends BaseCoreFunctionalTestCase { .setLong(0, u.getId()) .uniqueResult(); assertEquals(PASSWORD_EXPIRY_WEEKS, expiryViaSql.doubleValue(), 0.01d); - + // Test projection Double heightViaHql = (Double)s.createQuery("select p.heightInches from Person p where p.name = 'Emmanuel'").uniqueResult(); assertEquals(HEIGHT_INCHES, heightViaHql, 0.01d); Double expiryViaHql = (Double)s.createQuery("select u.passwordExpiryDays from User u where u.name = 'Steve'").uniqueResult(); assertEquals(PASSWORD_EXPIRY_DAYS, expiryViaHql, 0.01d); - + // Test restriction and entity load via criteria p = (Person)s.createCriteria(Person.class) .add(Restrictions.between("heightInches", HEIGHT_INCHES - 0.01d, HEIGHT_INCHES + 0.01d)) @@ -206,7 +208,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase { .add(Restrictions.between("passwordExpiryDays", PASSWORD_EXPIRY_DAYS - 0.01d, PASSWORD_EXPIRY_DAYS + 0.01d)) .uniqueResult(); assertEquals(PASSWORD_EXPIRY_DAYS, u.getPasswordExpiryDays(), 0.01d); - + // Test predicate and entity load via HQL p = (Person)s.createQuery("from Person p where p.heightInches between ? and ?") .setDouble(0, HEIGHT_INCHES - 0.01d) @@ -218,7 +220,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase { .setDouble(1, PASSWORD_EXPIRY_DAYS + 0.01d) .uniqueResult(); assertEquals(PASSWORD_EXPIRY_DAYS, u.getPasswordExpiryDays(), 0.01d); - + // Test update p.setHeightInches(1); u.setPasswordExpiryDays(7d); @@ -229,16 +231,16 @@ public class JoinTest extends BaseCoreFunctionalTestCase { .setLong(0, u.getId()) .uniqueResult(); assertEquals(1d, expiryViaSql.doubleValue(), 0.01d); - + s.delete(p); s.delete(u); - assertTrue( s.createQuery("from Person").list().isEmpty() ); - + assertTrue( s.createQuery("from Person").list().isEmpty() ); + t.commit(); s.close(); - + } - + } diff --git a/hibernate-core/src/test/java/org/hibernate/test/join/OptionalJoinTest.java b/hibernate-core/src/test/java/org/hibernate/test/join/OptionalJoinTest.java index 27303a7df1..0c4a06df1d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/join/OptionalJoinTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/join/OptionalJoinTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -37,6 +38,7 @@ import static org.junit.Assert.assertNull; /** * @author Chris Jones and Gail Badner */ +@FailureExpectedWithNewMetamodel public class OptionalJoinTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -98,7 +100,7 @@ public class OptionalJoinTest extends BaseCoreFunctionalTestCase { assertEquals("one", thing.getName()); t.commit(); s.close(); - + // change detached thing name to a new non-null name and save it thing.setName("one_changed"); diff --git a/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java b/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java index 6056af2d28..747516b818 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java @@ -34,6 +34,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Property; import org.hibernate.criterion.Restrictions; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -46,6 +47,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class JoinedSubclassTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -217,11 +219,11 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase { Employee e = new Employee(); e.setName("Steve"); e.setSex('M'); - e.setTitle("Mr"); + e.setTitle("Mr"); e.setPasswordExpiryDays(PASSWORD_EXPIRY_DAYS); s.persist(e); s.flush(); - + // Test value conversion during insert // Value returned by Oracle native query is a Types.NUMERIC, which is mapped to a BigDecimalType; // Cast returned value to Number then call Number.doubleValue() so it works on all dialects. @@ -235,13 +237,13 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase { .uniqueResult() ).doubleValue(); assertEquals(PASSWORD_EXPIRY_WEEKS, expiryViaSql, 0.01d); - + // Test projection Double heightViaHql = (Double)s.createQuery("select p.heightInches from Person p where p.name = 'Emmanuel'").uniqueResult(); assertEquals(HEIGHT_INCHES, heightViaHql, 0.01d); Double expiryViaHql = (Double)s.createQuery("select e.passwordExpiryDays from Employee e where e.name = 'Steve'").uniqueResult(); assertEquals(PASSWORD_EXPIRY_DAYS, expiryViaHql, 0.01d); - + // Test restriction and entity load via criteria p = (Person)s.createCriteria(Person.class) .add(Restrictions.between("heightInches", HEIGHT_INCHES - 0.01d, HEIGHT_INCHES + 0.01d)) @@ -251,7 +253,7 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase { .add(Restrictions.between("passwordExpiryDays", PASSWORD_EXPIRY_DAYS - 0.01d, PASSWORD_EXPIRY_DAYS + 0.01d)) .uniqueResult(); assertEquals(PASSWORD_EXPIRY_DAYS, e.getPasswordExpiryDays(), 0.01d); - + // Test predicate and entity load via HQL p = (Person)s.createQuery("from Person p where p.heightInches between ? and ?") .setDouble(0, HEIGHT_INCHES - 0.01d) @@ -263,7 +265,7 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase { .setDouble(1, PASSWORD_EXPIRY_DAYS + 0.01d) .uniqueResult(); assertEquals(PASSWORD_EXPIRY_DAYS, e.getPasswordExpiryDays(), 0.01d); - + // Test update p.setHeightInches(1); e.setPasswordExpiryDays(7); @@ -279,10 +281,10 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase { ).doubleValue(); assertEquals(1d, expiryViaSql, 0.01d); s.delete(p); - s.delete(e); + s.delete(e); t.commit(); s.close(); - + } @Test diff --git a/hibernate-core/src/test/java/org/hibernate/test/joinfetch/JoinFetchTest.java b/hibernate-core/src/test/java/org/hibernate/test/joinfetch/JoinFetchTest.java index e5f67fc73c..55e2351449 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/joinfetch/JoinFetchTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/joinfetch/JoinFetchTest.java @@ -34,6 +34,7 @@ import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -43,6 +44,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class JoinFetchTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -74,7 +76,7 @@ public class JoinFetchTest extends BaseCoreFunctionalTestCase { s.createQuery( "delete from Item" ).executeUpdate(); t.commit(); s.close(); - + Category cat = new Category("Photography"); Item i = new Item(cat, "Camera"); Bid b = new Bid(i, 100.0f); @@ -83,14 +85,14 @@ public class JoinFetchTest extends BaseCoreFunctionalTestCase { new Comment(i, "Is it the latest version?"); new Comment(i, ""); System.out.println( b.getTimestamp() ); - + s = openSession(); t = s.beginTransaction(); s.persist(cat); s.persist(i); t.commit(); s.close(); - + sessionFactory().evict(Item.class); s = openSession(); @@ -116,7 +118,7 @@ public class JoinFetchTest extends BaseCoreFunctionalTestCase { s.close(); sessionFactory().evictCollection(Item.class.getName() + ".bids"); - + s = openSession(); t = s.beginTransaction(); i = (Item) s.createCriteria( Item.class ) @@ -129,7 +131,7 @@ public class JoinFetchTest extends BaseCoreFunctionalTestCase { assertTrue( Hibernate.isInitialized( b.getItem() ) ); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); i = (Item) s.createQuery("from Item i left join fetch i.bids left join fetch i.comments").uniqueResult(); @@ -204,7 +206,7 @@ public class JoinFetchTest extends BaseCoreFunctionalTestCase { s.close(); } - + @Test public void testCollectionFilter() { Session s = openSession(); @@ -219,7 +221,7 @@ public class JoinFetchTest extends BaseCoreFunctionalTestCase { s.persist(hb); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); hb = (Group) s.createCriteria(Group.class) @@ -234,9 +236,9 @@ public class JoinFetchTest extends BaseCoreFunctionalTestCase { s.delete(hb); t.commit(); s.close(); - + } - + @Test public void testJoinFetchManyToMany() { Session s = openSession(); @@ -251,7 +253,7 @@ public class JoinFetchTest extends BaseCoreFunctionalTestCase { s.persist(hb); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); hb = (Group) s.get(Group.class, "hibernate"); diff --git a/hibernate-core/src/test/java/org/hibernate/test/jpa/naturalid/MutableNaturalIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/jpa/naturalid/MutableNaturalIdTest.java index 2196d464f6..3ff47e142c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jpa/naturalid/MutableNaturalIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jpa/naturalid/MutableNaturalIdTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.test.jpa.AbstractJPATest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -34,6 +35,7 @@ import static org.junit.Assert.assertTrue; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class MutableNaturalIdTest extends AbstractJPATest { @Override protected Class[] getAnnotatedClasses() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/jpa/proxy/JPAProxyTest.java b/hibernate-core/src/test/java/org/hibernate/test/jpa/proxy/JPAProxyTest.java index d03bc50fe1..eb27d85f46 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jpa/proxy/JPAProxyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jpa/proxy/JPAProxyTest.java @@ -33,6 +33,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.test.jpa.AbstractJPATest; import org.hibernate.test.jpa.Item; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; @@ -44,6 +45,7 @@ import static org.junit.Assert.fail; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class JPAProxyTest extends AbstractJPATest { @Test public void testEjb3ProxyUsage() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/FunctionKeywordTest.java b/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/FunctionKeywordTest.java index d3e3053ea1..ea6b6af580 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/FunctionKeywordTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/FunctionKeywordTest.java @@ -28,12 +28,14 @@ import org.hibernate.Session; import org.junit.Test; import org.hibernate.test.jpa.AbstractJPATest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * Test use of the JPA 2.1 FUNCTION keyword. * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class FunctionKeywordTest extends AbstractJPATest { @Test diff --git a/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java b/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java index 9542ae2e64..df4a3b6a95 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/JPAQLComplianceTest.java @@ -27,12 +27,14 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.test.jpa.AbstractJPATest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * Tests for various JPAQL compliance issues * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class JPAQLComplianceTest extends AbstractJPATest { @Test public void testAliasNameSameAsUnqualifiedEntityName() { @@ -77,5 +79,5 @@ public class JPAQLComplianceTest extends AbstractJPATest { s.createQuery( "select c.name as myname FROM Item c ORDER BY myname" ).list(); s.createQuery( "select p.name as name, p.stockNumber as stockNo, p.unitPrice as uPrice FROM Part p ORDER BY name, abs( p.unitPrice ), stockNo" ).list(); s.close(); - } + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/NativeQueryTest.java b/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/NativeQueryTest.java index 7bc2c42a41..6d507002e2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/NativeQueryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/NativeQueryTest.java @@ -27,10 +27,12 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.test.jpa.AbstractJPATest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class NativeQueryTest extends AbstractJPATest { @Test public void testJpaStylePositionalParametersInNativeSql() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/OnKeywordTest.java b/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/OnKeywordTest.java index b397dfd945..f9ad1e41cc 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/OnKeywordTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jpa/ql/OnKeywordTest.java @@ -30,12 +30,14 @@ import org.hibernate.Session; import org.junit.Test; import org.hibernate.test.jpa.AbstractJPATest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * Tests of the JPA decision (ugh) to use ON as a keyword for what Hibernate/HQL termed WITH. * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class OnKeywordTest extends AbstractJPATest { @Test public void basicTest() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/jpa/removed/RemovedEntityTest.java b/hibernate-core/src/test/java/org/hibernate/test/jpa/removed/RemovedEntityTest.java index 3fecf9781b..8d4b4ca06a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jpa/removed/RemovedEntityTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jpa/removed/RemovedEntityTest.java @@ -31,6 +31,7 @@ import org.hibernate.Session; import org.hibernate.test.jpa.AbstractJPATest; import org.hibernate.test.jpa.Item; import org.hibernate.test.jpa.Part; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -41,6 +42,7 @@ import static org.junit.Assert.assertTrue; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class RemovedEntityTest extends AbstractJPATest { @Test public void testRemoveThenContains() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/jpa/txn/TransactionJoiningTest.java b/hibernate-core/src/test/java/org/hibernate/test/jpa/txn/TransactionJoiningTest.java index db6bb0675b..12075d9e1d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jpa/txn/TransactionJoiningTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jpa/txn/TransactionJoiningTest.java @@ -33,6 +33,7 @@ import org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory; import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper; import org.hibernate.engine.transaction.spi.TransactionImplementor; import org.hibernate.test.jpa.AbstractJPATest; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.jta.TestingJtaBootstrap; import org.hibernate.testing.jta.TestingJtaPlatformImpl; @@ -42,6 +43,7 @@ import static org.junit.Assert.assertTrue; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class TransactionJoiningTest extends AbstractJPATest { @Override public void configure(Configuration cfg) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/component/EagerKeyManyToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/component/EagerKeyManyToOneTest.java index d4191c145a..fc574f31a7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/component/EagerKeyManyToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/component/EagerKeyManyToOneTest.java @@ -39,6 +39,7 @@ import org.hibernate.integrator.spi.Integrator; import org.hibernate.metamodel.spi.source.MetadataImplementor; import org.hibernate.service.BootstrapServiceRegistryBuilder; import org.hibernate.service.spi.SessionFactoryServiceRegistry; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -49,6 +50,7 @@ import static org.junit.Assert.fail; * @author Steve Ebersole */ @SuppressWarnings( {"unchecked"}) +@FailureExpectedWithNewMetamodel public class EagerKeyManyToOneTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/component/LazyKeyManyToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/component/LazyKeyManyToOneTest.java index 3d73a4e692..c0bbdd78e2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/component/LazyKeyManyToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/component/LazyKeyManyToOneTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -36,6 +37,7 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class LazyKeyManyToOneTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/embedded/KeyManyToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/embedded/KeyManyToOneTest.java index 1e9e6d539f..350b3e302c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/embedded/KeyManyToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/keymanytoone/bidir/embedded/KeyManyToOneTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -36,6 +37,7 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class KeyManyToOneTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/lazyonetoone/LazyOneToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/lazyonetoone/LazyOneToOneTest.java index e70c47e126..c18e858d54 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/lazyonetoone/LazyOneToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/lazyonetoone/LazyOneToOneTest.java @@ -32,6 +32,7 @@ import org.hibernate.Transaction; import org.hibernate.bytecode.instrumentation.internal.FieldInterceptionHelper; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.Skip; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -47,11 +48,14 @@ import static org.junit.Assert.assertTrue; condition = LazyOneToOneTest.DomainClassesInstrumentedMatcher.class, message = "Test domain classes were not instrumented" ) +@FailureExpectedWithNewMetamodel public class LazyOneToOneTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "lazyonetoone/Person.hbm.xml" }; } + @Override public void configure(Configuration cfg) { cfg.setProperty(Environment.MAX_FETCH_DEPTH, "2"); cfg.setProperty(Environment.USE_SECOND_LEVEL_CACHE, "false"); @@ -71,7 +75,7 @@ public class LazyOneToOneTest extends BaseCoreFunctionalTestCase { s.persist(p2); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); p = (Person) s.createQuery("from Person where name='Gavin'").uniqueResult(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/ABCProxyTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/ABCProxyTest.java index 1da6ce9fc0..a0b77e1509 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/ABCProxyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/ABCProxyTest.java @@ -35,11 +35,13 @@ import org.hibernate.LockMode; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.dialect.HSQLDialect; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +@FailureExpectedWithNewMetamodel public class ABCProxyTest extends LegacyTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/ABCTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/ABCTest.java index ec14b03f73..976c61e35d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/ABCTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/ABCTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -36,7 +37,9 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @SuppressWarnings( {"UnnecessaryBoxing"}) +@FailureExpectedWithNewMetamodel public class ABCTest extends LegacyTestCase { + @Override public String[] getMappings() { return new String[] { "legacy/ABC.hbm.xml", "legacy/ABCExtends.hbm.xml" }; } @@ -55,7 +58,7 @@ public class ABCTest extends LegacyTestCase { d.inverse = a; t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); d = (D) s.get(D.class, did); @@ -110,7 +113,7 @@ public class ABCTest extends LegacyTestCase { s.close(); sessionFactory().getCache().evictEntityRegion( A.class ); - + s = openSession(); t = s.beginTransaction(); c1 = (C1) s.get( A.class, c1.getId() ); @@ -123,7 +126,7 @@ public class ABCTest extends LegacyTestCase { assertEquals( "a funny name", c1.getBName() ); t.commit(); s.close(); - + sessionFactory().getCache().evictEntityRegion( A.class ); s = openSession(); @@ -162,7 +165,7 @@ public class ABCTest extends LegacyTestCase { t.commit(); s.close(); } - + @Test public void testGetSave() throws Exception { Session s = openSession(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/ComponentNotNullTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/ComponentNotNullTest.java index 95eddbb564..8969794ac8 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/ComponentNotNullTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/ComponentNotNullTest.java @@ -31,6 +31,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.fail; @@ -39,6 +40,7 @@ import static org.junit.Assert.fail; * * @author Emmanuel Bernard */ +@FailureExpectedWithNewMetamodel public class ComponentNotNullTest extends LegacyTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/CustomSQLTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/CustomSQLTest.java index a62a6a3d6a..12e57971f6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/CustomSQLTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/CustomSQLTest.java @@ -14,6 +14,7 @@ import org.hibernate.dialect.PostgreSQL81Dialect; import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.id.PostInsertIdentifierGenerator; import org.hibernate.testing.DialectCheck; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.SkipForDialect; @@ -25,6 +26,7 @@ import static org.junit.Assert.assertTrue; * @author MAX * */ +@FailureExpectedWithNewMetamodel public class CustomSQLTest extends LegacyTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java index 121cb08d82..673f6c4ef6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/FooBarTest.java @@ -86,6 +86,7 @@ import org.hibernate.jdbc.AbstractWork; import org.hibernate.proxy.HibernateProxy; import org.hibernate.service.jdbc.connections.spi.ConnectionProvider; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.env.ConnectionProviderBuilder; @@ -98,6 +99,7 @@ import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +@FailureExpectedWithNewMetamodel public class FooBarTest extends LegacyTestCase { private static final Logger log = Logger.getLogger( FooBarTest.class ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/FumTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/FumTest.java index f4dda667fc..6aac90caf6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/FumTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/FumTest.java @@ -38,6 +38,7 @@ import org.hibernate.dialect.MySQLDialect; import org.hibernate.dialect.PointbaseDialect; import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.dialect.TimesTenDialect; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipForDialect; import org.hibernate.transform.Transformers; import org.hibernate.type.DateType; @@ -51,6 +52,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +@FailureExpectedWithNewMetamodel public class FumTest extends LegacyTestCase { private static short fumKeyShort = 1; @@ -248,14 +250,14 @@ public class FumTest extends LegacyTestCase { s.save(fr2); s.save( fum.getFo() ); s.save(fum); - + Criteria test = s.createCriteria(Fum.class, "xam") .createCriteria("fo", "fo") .setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP); - + Map fc = (Map) test.list().get(0); assertNotNull(fc.get("xam")); - + Criteria base = s.createCriteria(Fum.class, "fum") .add( Restrictions.like("fum", "f%") ) .setResultTransformer(Transformers.aliasToBean(ABean.class)) @@ -267,7 +269,7 @@ public class FumTest extends LegacyTestCase { assertTrue( map.getFum()==fum && map.getFo()==fum.getFo() ); - + s.delete(fr); s.delete(fr2); s.delete(fum); @@ -862,7 +864,7 @@ public class FumTest extends LegacyTestCase { s.getTransaction().commit(); s2 = spoofSerialization(s); s.close(); - + s = s2; s.beginTransaction(); s.flush(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/IJ2Test.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/IJ2Test.java index 59a49ee5ec..1904b7e67f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/IJ2Test.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/IJ2Test.java @@ -28,14 +28,17 @@ import org.junit.Test; import org.hibernate.LockMode; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class IJ2Test extends LegacyTestCase { + @Override public String[] getMappings() { return new String[] { "legacy/IJ2.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/MapTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/MapTest.java index 103d05eb01..8ab1495ce6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/MapTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/MapTest.java @@ -35,9 +35,11 @@ import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.criterion.Example; import org.hibernate.criterion.Restrictions; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertTrue; +@FailureExpectedWithNewMetamodel public class MapTest extends LegacyTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/MasterDetailTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/MasterDetailTest.java index fd155405d7..0eaa992d93 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/MasterDetailTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/MasterDetailTest.java @@ -49,6 +49,7 @@ import org.hibernate.dialect.SAPDBDialect; import org.hibernate.jdbc.AbstractWork; import org.hibernate.mapping.MetaAttribute; import org.hibernate.mapping.PersistentClass; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipLog; import static org.junit.Assert.assertEquals; @@ -56,6 +57,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +@FailureExpectedWithNewMetamodel public class MasterDetailTest extends LegacyTestCase { @Override public String[] getMappings() { @@ -925,7 +927,7 @@ public class MasterDetailTest extends LegacyTestCase { c.getSubcategories().size(); //force load and cache s.getTransaction().commit(); s.close(); - + s = openSession(); if ( (getDialect() instanceof MySQLDialect) ) { s.doWork( diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/MultiTableTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/MultiTableTest.java index 1c28533370..b3f8623ca4 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/MultiTableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/MultiTableTest.java @@ -21,12 +21,14 @@ import org.hibernate.Transaction; import org.hibernate.criterion.Restrictions; import org.hibernate.dialect.MySQLDialect; import org.hibernate.jdbc.Work; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; +@FailureExpectedWithNewMetamodel public class MultiTableTest extends LegacyTestCase { @Override protected boolean isCleanupTestDataRequired() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/OneToOneCacheTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/OneToOneCacheTest.java index 016a9fe46b..6e336dc4e5 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/OneToOneCacheTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/OneToOneCacheTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertNotNull; @@ -46,6 +47,7 @@ public class OneToOneCacheTest extends LegacyTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testOneToOneCache() throws HibernateException { //create a new MainObject diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/ParentChildTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/ParentChildTest.java index 96c8fc2482..620e11fada 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/ParentChildTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/ParentChildTest.java @@ -54,6 +54,7 @@ import org.hibernate.internal.SessionImpl; import org.hibernate.jdbc.AbstractWork; import org.hibernate.proxy.HibernateProxy; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.type.StandardBasicTypes; import static org.junit.Assert.assertEquals; @@ -65,6 +66,7 @@ import static org.junit.Assert.fail; @SuppressWarnings( {"UnnecessaryBoxing"}) +@FailureExpectedWithNewMetamodel public class ParentChildTest extends LegacyTestCase { @Override public String[] getMappings() { @@ -199,7 +201,7 @@ public class ParentChildTest extends LegacyTestCase { assertEquals( foo.getKey(), "xyzid" ); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); foo = (FooProxy) s.load(Foo.class, id); @@ -214,13 +216,13 @@ public class ParentChildTest extends LegacyTestCase { assertEquals( 2, doDelete( s, "from java.lang.Object" ) ); t.commit(); s.close(); - + //to account for new id rollback shit foo.setKey(fookey); foo.getDependent().setKey( feekey ); foo.getComponent().setGlarch( null ); foo.getComponent().setSubcomponent(null); - + s = openSession(); t = s.beginTransaction(); //foo.getComponent().setGlarch(null); //no id property! @@ -284,17 +286,17 @@ public class ParentChildTest extends LegacyTestCase { List list = crit.list(); assertTrue( list.size()==2 ); - + s.createCriteria(Glarch.class).setLockMode(LockMode.UPGRADE).list(); s.createCriteria(Glarch.class).setLockMode(Criteria.ROOT_ALIAS, LockMode.UPGRADE).list(); - + g2.setName(null); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); - + list = s.createCriteria(Baz.class).add( Restrictions.isEmpty("fooSet") ).list(); assertEquals( list.size(), 0 ); @@ -303,7 +305,7 @@ public class ParentChildTest extends LegacyTestCase { list = s.createCriteria(Baz.class).add( Restrictions.sizeEq("fooSet", 2) ).list(); assertEquals( new HashSet(list).size(), 1 ); - + t.commit(); s.close(); @@ -358,7 +360,7 @@ public class ParentChildTest extends LegacyTestCase { baz = (Baz) crit.uniqueResult(); assertTrue( Hibernate.isInitialized(baz.getTopGlarchez()) ); //cos it is nonlazy assertTrue( !Hibernate.isInitialized(baz.getFooSet()) ); - + s.createCriteria(Child.class).setFetchMode("parent", FetchMode.JOIN).list(); doDelete( s, "from Glarch g" ); @@ -923,7 +925,7 @@ public class ParentChildTest extends LegacyTestCase { s.save(c); s.getTransaction().commit(); s.close(); - + s=openSession(); s.beginTransaction(); c = (Container) s.createQuery( "from ContainerX c" ).iterate().next(); @@ -946,7 +948,7 @@ public class ParentChildTest extends LegacyTestCase { list.add(cic); s.getTransaction().commit(); s.close(); - + s=openSession(); s.beginTransaction(); c = (Container) s.createQuery( "from ContainerX c" ).iterate().next(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/QueryByExampleTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/QueryByExampleTest.java index 836b513033..7e779b6bee 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/QueryByExampleTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/QueryByExampleTest.java @@ -32,6 +32,7 @@ import org.hibernate.Transaction; import org.hibernate.criterion.Example; import org.hibernate.criterion.Restrictions; import org.hibernate.dialect.SybaseASE15Dialect; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipForDialect; import static org.junit.Assert.assertEquals; @@ -42,6 +43,7 @@ import static org.junit.Assert.assertNotNull; * * @author Emmanuel Bernard */ +@FailureExpectedWithNewMetamodel public class QueryByExampleTest extends LegacyTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java index ace0447683..e2c87aae8d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java @@ -51,6 +51,7 @@ import org.hibernate.dialect.SybaseAnywhereDialect; import org.hibernate.dialect.SybaseDialect; import org.hibernate.dialect.TimesTenDialect; import org.hibernate.dialect.function.SQLFunction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -58,6 +59,7 @@ import static org.junit.Assert.assertTrue; @SuppressWarnings( {"UnnecessaryUnboxing", "UnnecessaryBoxing"}) +@FailureExpectedWithNewMetamodel public class SQLFunctionsTest extends LegacyTestCase { private static final Logger log = Logger.getLogger( SQLFunctionsTest.class ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/SQLLoaderTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/SQLLoaderTest.java index 40f222989b..8167de00e5 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/SQLLoaderTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/SQLLoaderTest.java @@ -19,6 +19,7 @@ import org.hibernate.dialect.PostgreSQL81Dialect; import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.TimesTenDialect; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; @@ -28,6 +29,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; +@FailureExpectedWithNewMetamodel public class SQLLoaderTest extends LegacyTestCase { static int nextInt = 1; static long nextLong = 1; @@ -179,7 +181,7 @@ public class SQLLoaderTest extends LegacyTestCase { list.get(0); s.getTransaction().commit(); s.close(); - + if ( getDialect() instanceof MySQLDialect ) { return; } @@ -191,7 +193,7 @@ public class SQLLoaderTest extends LegacyTestCase { assertNotNull(query); list = query.list(); assertNotNull(list); - + Object[] values = (Object[]) list.get(0); assertNotNull(values[0]); assertNotNull(values[1]); @@ -399,7 +401,7 @@ public class SQLLoaderTest extends LegacyTestCase { Query query; if( getDialect() instanceof TimesTenDialect) { // TimesTen does not permit general expressions (like UPPER) in the second part of a LIKE expression, - // so we execute a similar test + // so we execute a similar test query = session.createSQLQuery("select identifier_column as {a.id}, clazz_discriminata as {a.class}, count_ as {a.count}, name as {a.name} from TA where {fn ucase(name)} like 'MAX'" ) .addEntity( "a", A.class ); } @@ -505,26 +507,26 @@ public class SQLLoaderTest extends LegacyTestCase { public void testReturnPropertyComponentRename() throws HibernateException, SQLException { // failure expected because this was a regression introduced previously which needs to get tracked down. Componentizable componentizable = setupComponentData(); - + Session session = openSession(); session.beginTransaction(); Query namedQuery = session.getNamedQuery("queryComponentWithOtherColumn"); List list = namedQuery.list(); - + assertEquals(1, list.size()); assertEquals( "flakky comp", ( (Componentizable) list.get(0) ).getComponent().getName() ); - + session.clear(); session.delete(componentizable); session.getTransaction().commit(); session.close(); } - + @Test public void testComponentStar() throws HibernateException, SQLException { componentTest("select {comp.*} from Componentizable comp"); } - + @Test public void testComponentNoStar() throws HibernateException, SQLException { componentTest("select comp.id as {comp.id}, comp.nickName as {comp.nickName}, comp.name as {comp.component.name}, comp.subName as {comp.component.subComponent.subName}, comp.subName1 as {comp.component.subComponent.subName1} from Componentizable comp"); @@ -560,9 +562,9 @@ public class SQLLoaderTest extends LegacyTestCase { SubComponent subComponent = new SubComponent(); subComponent.setSubName("subway"); component.setSubComponent(subComponent); - + c.setComponent(component); - + session.save(c); session.getTransaction().commit(); session.clear(); @@ -662,7 +664,7 @@ public class SQLLoaderTest extends LegacyTestCase { session.clear(); List list2 = session.getNamedQuery("propertyResultDiscriminator").list(); assertEquals(2, list2.size()); - + session.getTransaction().commit(); session.close(); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/legacy/StatisticsTest.java b/hibernate-core/src/test/java/org/hibernate/test/legacy/StatisticsTest.java index 772eb20e36..49e1c9d9c2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/legacy/StatisticsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/legacy/StatisticsTest.java @@ -30,12 +30,14 @@ import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.stat.Statistics; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; /** * @author Emmanuel Bernard */ +@FailureExpectedWithNewMetamodel public class StatisticsTest extends LegacyTestCase { @Override public String[] getMappings() { @@ -71,7 +73,7 @@ public class StatisticsTest extends LegacyTestCase { s.close(); assertEquals(1, stats.getQueryExecutionCount() ); assertEquals(1, stats.getQueryStatistics(hql).getExecutionCount() ); - + stats.setStatisticsEnabled(isStats); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/locking/LockModeTest.java b/hibernate-core/src/test/java/org/hibernate/test/locking/LockModeTest.java index 25aa8acd36..f867ea9007 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/locking/LockModeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/locking/LockModeTest.java @@ -25,8 +25,6 @@ package org.hibernate.test.locking; import java.util.concurrent.TimeoutException; -import org.junit.After; -import org.junit.Before; import org.junit.Test; import org.hibernate.LockMode; @@ -36,6 +34,7 @@ import org.hibernate.Session; import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.exception.GenericJDBCException; import org.hibernate.exception.LockAcquisitionException; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.async.Executable; @@ -138,6 +137,7 @@ public class LockModeTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testQuery() { // open a session, begin a transaction and lock row Session s1 = sessionFactory().openSession(); @@ -160,6 +160,7 @@ public class LockModeTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testQueryUsingLockOptions() { // todo : need an association here to make sure the alias-specific lock modes are applied correctly Session s1 = sessionFactory().openSession(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/manytomany/ManyToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/manytomany/ManyToManyTest.java index 33b6ef3151..bdc12f317e 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/manytomany/ManyToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/manytomany/ManyToManyTest.java @@ -31,6 +31,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -40,6 +41,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class ManyToManyTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -67,7 +69,7 @@ public class ManyToManyTest extends BaseCoreFunctionalTestCase { s.persist(hb); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); gavin = (User) s.get(User.class, gavin); @@ -91,7 +93,7 @@ public class ManyToManyTest extends BaseCoreFunctionalTestCase { assertEquals( 1, group.getUsers().size() ); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); gavin = (User) s.createCriteria(User.class) @@ -105,7 +107,7 @@ public class ManyToManyTest extends BaseCoreFunctionalTestCase { assertEquals( 1, group.getUsers().size() ); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); gavin = (User) s.createQuery("from User u join fetch u.groups g join fetch g.users").uniqueResult(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/manytomany/batchload/BatchedManyToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/manytomany/batchload/BatchedManyToManyTest.java index 262bf68454..43e64364d9 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/manytomany/batchload/BatchedManyToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/manytomany/batchload/BatchedManyToManyTest.java @@ -42,6 +42,7 @@ import org.hibernate.engine.jdbc.spi.JdbcCoordinator; import org.hibernate.loader.collection.BatchingCollectionInitializer; import org.hibernate.persister.collection.AbstractCollectionPersister; import org.hibernate.stat.CollectionStatistics; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.hibernate.testing.junit4.ExtraAssertions.assertClassAssignability; @@ -54,6 +55,7 @@ import static org.junit.Assert.assertTrue; * * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class BatchedManyToManyTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -161,6 +163,7 @@ public class BatchedManyToManyTest extends BaseCoreFunctionalTestCase { s.close(); } + @Override protected void cleanupTestData() { // clean up the test data Session s = openSession(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/manytomany/ordered/OrderedManyToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/manytomany/ordered/OrderedManyToManyTest.java index 2adb68bb72..85a8b58740 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/manytomany/ordered/OrderedManyToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/manytomany/ordered/OrderedManyToManyTest.java @@ -33,6 +33,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -42,6 +43,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class OrderedManyToManyTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/compositeid/ManyToManyAssociationClassCompositeIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/compositeid/ManyToManyAssociationClassCompositeIdTest.java index 0b686dd976..a3f56338ec 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/compositeid/ManyToManyAssociationClassCompositeIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/compositeid/ManyToManyAssociationClassCompositeIdTest.java @@ -25,6 +25,7 @@ package org.hibernate.test.manytomanyassociationclass.compositeid; import org.hibernate.test.manytomanyassociationclass.AbstractManyToManyAssociationClassTest; import org.hibernate.test.manytomanyassociationclass.Membership; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * Tests on many-to-many association using an association class with a composite ID containing @@ -32,6 +33,7 @@ import org.hibernate.test.manytomanyassociationclass.Membership; * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class ManyToManyAssociationClassCompositeIdTest extends AbstractManyToManyAssociationClassTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/surrogateid/assigned/ManyToManyAssociationClassAssignedIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/surrogateid/assigned/ManyToManyAssociationClassAssignedIdTest.java index 8808908f29..dadc48824e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/surrogateid/assigned/ManyToManyAssociationClassAssignedIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/surrogateid/assigned/ManyToManyAssociationClassAssignedIdTest.java @@ -25,12 +25,14 @@ package org.hibernate.test.manytomanyassociationclass.surrogateid.assigned; import org.hibernate.test.manytomanyassociationclass.AbstractManyToManyAssociationClassTest; import org.hibernate.test.manytomanyassociationclass.Membership; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * Tests on many-to-many association using an association class with a surrogate ID that is assigned. * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class ManyToManyAssociationClassAssignedIdTest extends AbstractManyToManyAssociationClassTest { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/surrogateid/generated/ManyToManyAssociationClassGeneratedIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/surrogateid/generated/ManyToManyAssociationClassGeneratedIdTest.java index a6bb8491ba..c72151aa1b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/surrogateid/generated/ManyToManyAssociationClassGeneratedIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/manytomanyassociationclass/surrogateid/generated/ManyToManyAssociationClassGeneratedIdTest.java @@ -30,6 +30,7 @@ import org.hibernate.Session; import org.hibernate.exception.ConstraintViolationException; import org.hibernate.test.manytomanyassociationclass.AbstractManyToManyAssociationClassTest; import org.hibernate.test.manytomanyassociationclass.Membership; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.fail; @@ -38,6 +39,7 @@ import static org.junit.Assert.fail; * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class ManyToManyAssociationClassGeneratedIdTest extends AbstractManyToManyAssociationClassTest { @Override public String[] getMappings() { @@ -49,6 +51,7 @@ public class ManyToManyAssociationClassGeneratedIdTest extends AbstractManyToMan return new Membership( name ); } + @Override @Test public void testRemoveAndAddEqualElement() { deleteMembership( getUser(), getGroup(), getMembership() ); @@ -75,6 +78,7 @@ public class ManyToManyAssociationClassGeneratedIdTest extends AbstractManyToMan } } + @Override @Test public void testRemoveAndAddEqualCollection() { deleteMembership( getUser(), getGroup(), getMembership() ); @@ -103,6 +107,7 @@ public class ManyToManyAssociationClassGeneratedIdTest extends AbstractManyToMan } } + @Override @Test public void testRemoveAndAddEqualElementNonKeyModified() { deleteMembership( getUser(), getGroup(), getMembership() ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/map/MapIndexFormulaTest.java b/hibernate-core/src/test/java/org/hibernate/test/map/MapIndexFormulaTest.java index 73e4b4554a..5758e959e1 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/map/MapIndexFormulaTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/map/MapIndexFormulaTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -36,7 +37,9 @@ import static org.junit.Assert.assertEquals; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class MapIndexFormulaTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "map/UserGroup.hbm.xml" }; } @@ -70,7 +73,7 @@ public class MapIndexFormulaTest extends BaseCoreFunctionalTestCase { gavin.getSession().put( "bar", new SessionAttribute("bar", "foo bar baz 2") ); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); g = (Group) s.get(Group.class, "developers"); @@ -108,7 +111,7 @@ public class MapIndexFormulaTest extends BaseCoreFunctionalTestCase { t.commit(); s.close(); } - + @Test @SuppressWarnings( {"unchecked"}) public void testSQLQuery() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/mapcompelem/MapCompositeElementTest.java b/hibernate-core/src/test/java/org/hibernate/test/mapcompelem/MapCompositeElementTest.java index 99a5f14dd1..1f450bb459 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/mapcompelem/MapCompositeElementTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/mapcompelem/MapCompositeElementTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -38,7 +39,9 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class MapCompositeElementTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "mapcompelem/ProductPart.hbm.xml" }; } @@ -56,7 +59,7 @@ public class MapCompositeElementTest extends BaseCoreFunctionalTestCase { s.persist(prod); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); prod = (Product) s.get(Product.class, "Some Thing"); @@ -95,7 +98,7 @@ public class MapCompositeElementTest extends BaseCoreFunctionalTestCase { prod.getParts().put("Top", top); prod.getParts().put("Bottom", bottom); s.persist(prod); - + Item item = new Item("123456", prod); s.persist(item); @@ -106,26 +109,26 @@ public class MapCompositeElementTest extends BaseCoreFunctionalTestCase { Part part = (Part) list.get(0); assertEquals( part.getName(), "top" ); assertEquals( part.getDescription(), "The top part" ); - + list = s.createQuery("select new Part( part.name, part.description ) from Product prod join prod.parts part where index(part) = 'Top'").list(); assertEquals( list.size(), 1 ); assertTrue( list.get(0) instanceof Part ); part = (Part) list.get(0); assertEquals( part.getName(), "top" ); assertEquals( part.getDescription(), "The top part" ); - + list = s.createQuery("from Product p where 'Top' in indices(p.parts)").list(); assertEquals( list.size(), 1 ); assertSame( list.get(0), prod ); - + list = s.createQuery("select i from Item i join i.product p where 'Top' in indices(p.parts)").list(); assertEquals( list.size(), 1 ); assertSame( list.get(0), item ); - + list = s.createQuery("from Item i where 'Top' in indices(i.product.parts)").list(); assertEquals( list.size(), 1 ); assertSame( list.get(0), item ); - + s.delete(item); s.delete(prod); t.commit(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/mapelemformula/MapElementFormulaTest.java b/hibernate-core/src/test/java/org/hibernate/test/mapelemformula/MapElementFormulaTest.java index 2f4d2b839d..f59bbc6824 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/mapelemformula/MapElementFormulaTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/mapelemformula/MapElementFormulaTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -34,7 +35,9 @@ import static org.junit.Assert.assertEquals; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class MapElementFormulaTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "mapelemformula/UserGroup.hbm.xml" }; } @@ -52,7 +55,7 @@ public class MapElementFormulaTest extends BaseCoreFunctionalTestCase { s.persist(g); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); g = (Group) s.get(Group.class, "users"); diff --git a/hibernate-core/src/test/java/org/hibernate/test/mixed/MixedTest.java b/hibernate-core/src/test/java/org/hibernate/test/mixed/MixedTest.java index 387b65c308..c6665d2a47 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/mixed/MixedTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/mixed/MixedTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.dialect.SybaseASE15Dialect; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipLog; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -51,6 +52,7 @@ public class MixedTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testMixedInheritance() { Session s = openSession( new DocumentInterceptor() ); Transaction t = s.beginTransaction(); @@ -67,7 +69,7 @@ public class MixedTest extends BaseCoreFunctionalTestCase { SecureDocument d2 = new SecureDocument(); d2.setName( "Secret" ); d2.setContent( s.getLobHelper().createBlob( "wxyz wxyz".getBytes() ) ); - // SybaseASE15Dialect only allows 7-bits in a byte to be inserted into a tinyint + // SybaseASE15Dialect only allows 7-bits in a byte to be inserted into a tinyint // column (0 <= val < 128) d2.setPermissionBits( (byte) 127 ); d2.setOwner( "gavin" ); @@ -117,7 +119,7 @@ public class MixedTest extends BaseCoreFunctionalTestCase { assertNotNull( d2.getContent() ); assertEquals( "max", d2.getOwner() ); assertEquals( "/", d2.getParent().getName() ); - // SybaseASE15Dialect only allows 7-bits in a byte to be inserted into a tinyint + // SybaseASE15Dialect only allows 7-bits in a byte to be inserted into a tinyint // column (0 <= val < 128) assertEquals( (byte) 127, d2.getPermissionBits() ); assertNotNull( d2.getCreated() ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/namingstrategy/NamingStrategyTest.java b/hibernate-core/src/test/java/org/hibernate/test/namingstrategy/NamingStrategyTest.java index 2b63545666..4e5071e1bc 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/namingstrategy/NamingStrategyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/namingstrategy/NamingStrategyTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.cfg.Configuration; import org.hibernate.mapping.Column; import org.hibernate.mapping.PersistentClass; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -37,6 +38,7 @@ import static org.junit.Assert.assertEquals; * @author Emmanuel Bernard * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) */ +@FailureExpectedWithNewMetamodel public class NamingStrategyTest extends BaseCoreFunctionalTestCase { @Override public void configure(Configuration cfg) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/naturalid/immutableentity/ImmutableEntityNaturalIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/naturalid/immutableentity/ImmutableEntityNaturalIdTest.java index cc79c28a3b..7a017614e7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/naturalid/immutableentity/ImmutableEntityNaturalIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/naturalid/immutableentity/ImmutableEntityNaturalIdTest.java @@ -28,10 +28,10 @@ import org.junit.Test; import org.hibernate.NaturalIdLoadAccess; import org.hibernate.Session; import org.hibernate.Transaction; -import org.hibernate.annotations.Immutable; import org.hibernate.cfg.Configuration; import org.hibernate.metadata.ClassMetadata; import org.hibernate.stat.Statistics; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -62,6 +62,7 @@ public class ImmutableEntityNaturalIdTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testImmutableNaturalIdLifecycle() { Statistics stats = sessionFactory().getStatistics(); stats.setStatisticsEnabled( true ); @@ -71,7 +72,7 @@ public class ImmutableEntityNaturalIdTest extends BaseCoreFunctionalTestCase { assertEquals( "Cache misses should be empty", 0, stats.getNaturalIdCacheMissCount() ); assertEquals( "Cache put should be empty", 0, stats.getNaturalIdCachePutCount() ); assertEquals( "Query count should be empty", 0, stats.getNaturalIdQueryExecutionCount() ); - + Building b1 = new Building(); b1.setName( "Computer Science" ); b1.setAddress( "1210 W. Dayton St." ); @@ -88,14 +89,14 @@ public class ImmutableEntityNaturalIdTest extends BaseCoreFunctionalTestCase { assertEquals( "Cache misses should be empty", 0, stats.getNaturalIdCacheMissCount() ); assertEquals( "Cache put should be one after insert", 1, stats.getNaturalIdCachePutCount() ); assertEquals( "Query count should be empty", 0, stats.getNaturalIdQueryExecutionCount() ); - + s = openSession(); tx = s.beginTransaction(); - + //Clear caches and reset cache stats s.getSessionFactory().getCache().evictNaturalIdRegions(); stats.clear(); - + NaturalIdLoadAccess naturalIdLoader = s.byNaturalId( Building.class ); naturalIdLoader.using( "address", "1210 W. Dayton St." ).using( "city", "Madison" ).using( "state", "WI" ); @@ -110,9 +111,9 @@ public class ImmutableEntityNaturalIdTest extends BaseCoreFunctionalTestCase { // cleanup tx.rollback(); s.close(); - + //Try two, should be a cache hit - + s = openSession(); tx = s.beginTransaction(); naturalIdLoader = s.byNaturalId( Building.class ); @@ -125,10 +126,10 @@ public class ImmutableEntityNaturalIdTest extends BaseCoreFunctionalTestCase { assertEquals( "Cache misses should be one after second query", 1, stats.getNaturalIdCacheMissCount() ); assertEquals( "Cache put should be one after second query", 1, stats.getNaturalIdCachePutCount() ); assertEquals( "Query count should be one after second query", 1, stats.getNaturalIdQueryExecutionCount() ); - + // Try Deleting s.delete( building ); - + // third query building = (Building) naturalIdLoader.load(); assertNull( building ); @@ -140,9 +141,9 @@ public class ImmutableEntityNaturalIdTest extends BaseCoreFunctionalTestCase { // cleanup tx.commit(); s.close(); - + //Try three, should be db lookup and miss - + s = openSession(); tx = s.beginTransaction(); naturalIdLoader = s.byNaturalId( Building.class ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/naturalid/inheritance/InheritedNaturalIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/naturalid/inheritance/InheritedNaturalIdTest.java index a32e2bcfd0..20cc6ddc05 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/naturalid/inheritance/InheritedNaturalIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/naturalid/inheritance/InheritedNaturalIdTest.java @@ -26,6 +26,7 @@ package org.hibernate.test.naturalid.inheritance; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertNotNull; @@ -35,6 +36,7 @@ import static org.junit.Assert.assertSame; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class InheritedNaturalIdTest extends BaseCoreFunctionalTestCase { @Override protected Class[] getAnnotatedClasses() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/naturalid/mutable/MutableNaturalIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/naturalid/mutable/MutableNaturalIdTest.java index a62b69061a..d3ff172adc 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/naturalid/mutable/MutableNaturalIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/naturalid/mutable/MutableNaturalIdTest.java @@ -34,6 +34,7 @@ import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.criterion.Restrictions; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -123,8 +124,8 @@ public class MutableNaturalIdTest extends BaseCoreFunctionalTestCase { s.getTransaction().commit(); s.close(); } - - + + @Test public void testReattachmentUnmodifiedNaturalIdCheck() throws Throwable { Session s = openSession(); @@ -134,7 +135,7 @@ public class MutableNaturalIdTest extends BaseCoreFunctionalTestCase { s.getTransaction().commit(); s.close(); - + s = openSession(); s.beginTransaction(); try { @@ -166,7 +167,7 @@ public class MutableNaturalIdTest extends BaseCoreFunctionalTestCase { s.getTransaction().commit(); s.close(); } - + @Test public void testNonexistentNaturalIdCache() { @@ -267,6 +268,7 @@ public class MutableNaturalIdTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testNaturalIdCache() { Session s = openSession(); Transaction t = s.beginTransaction(); @@ -430,7 +432,7 @@ public class MutableNaturalIdTest extends BaseCoreFunctionalTestCase { sessionFactory().getStatistics().clear(); s.getTransaction().commit(); s.close(); - + s = openSession(); s.beginTransaction(); u = ( User ) s.createCriteria( User.class ) @@ -451,6 +453,7 @@ public class MutableNaturalIdTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testQuerying() throws Exception { Session s = openSession(); Transaction t = s.beginTransaction(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/naturalid/mutable/cached/CachedMutableNaturalIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/naturalid/mutable/cached/CachedMutableNaturalIdTest.java index bb8dda0fa5..0657dd9c49 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/naturalid/mutable/cached/CachedMutableNaturalIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/naturalid/mutable/cached/CachedMutableNaturalIdTest.java @@ -31,6 +31,7 @@ import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import static org.junit.Assert.assertEquals; @@ -39,7 +40,7 @@ import static org.junit.Assert.assertNull; /** * Tests of mutable natural ids stored in second level cache - * + * * @author Guenther Demetz * @author Steve Ebersole */ @@ -56,6 +57,7 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testNaturalIdChangedWhileAttached() { Session session = openSession(); session.beginTransaction(); @@ -85,6 +87,7 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testNaturalIdChangedWhileDetached() { Session session = openSession(); session.beginTransaction(); @@ -118,11 +121,12 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { session.getTransaction().commit(); session.close(); } - + @Test @TestForIssue( jiraKey = "HHH-7278" ) + @FailureExpectedWithNewMetamodel public void testInsertedNaturalIdCachedAfterTransactionSuccess() { - + Session session = openSession(); session.getSessionFactory().getStatistics().clear(); session.beginTransaction(); @@ -131,7 +135,7 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { session.flush(); session.getTransaction().commit(); session.close(); - + session = openSession(); session.beginTransaction(); it = (Another) session.bySimpleNaturalId(Another.class).load("it"); @@ -140,11 +144,11 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { session.getTransaction().commit(); assertEquals(1, session.getSessionFactory().getStatistics().getNaturalIdCacheHitCount()); } - + @Test @TestForIssue( jiraKey = "HHH-7278" ) public void testInsertedNaturalIdNotCachedAfterTransactionFailure() { - + Session session = openSession(); session.getSessionFactory().getStatistics().clear(); session.beginTransaction(); @@ -153,16 +157,17 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { session.flush(); session.getTransaction().rollback(); session.close(); - + session = openSession(); session.beginTransaction(); it = (Another) session.bySimpleNaturalId(Another.class).load("it"); assertNull(it); assertEquals(0, session.getSessionFactory().getStatistics().getNaturalIdCacheHitCount()); } - + @Test @TestForIssue( jiraKey = "HHH-7278" ) + @FailureExpectedWithNewMetamodel public void testChangedNaturalIdCachedAfterTransactionSuccess() { Session session = openSession(); session.beginTransaction(); @@ -170,30 +175,30 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { session.save( it ); session.getTransaction().commit(); session.close(); - + session = openSession(); session.beginTransaction(); it = (Another) session.bySimpleNaturalId(Another.class).load("it"); assertNotNull(it); - + it.setName("modified"); session.flush(); - session.getTransaction().commit(); + session.getTransaction().commit(); session.close(); - + session.getSessionFactory().getStatistics().clear(); - + session = openSession(); session.beginTransaction(); it = (Another) session.bySimpleNaturalId(Another.class).load("modified"); assertNotNull(it); session.delete(it); - session.getTransaction().commit(); + session.getTransaction().commit(); session.close(); - + assertEquals(1, session.getSessionFactory().getStatistics().getNaturalIdCacheHitCount()); } - + @Test @TestForIssue( jiraKey = "HHH-7278" ) public void testChangedNaturalIdNotCachedAfterTransactionFailure() { @@ -203,32 +208,33 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { session.save( it ); session.getTransaction().commit(); session.close(); - + session = openSession(); session.beginTransaction(); it = (Another) session.bySimpleNaturalId(Another.class).load("it"); assertNotNull(it); - + it.setName("modified"); session.flush(); - session.getTransaction().rollback(); + session.getTransaction().rollback(); session.close(); - + session.getSessionFactory().getStatistics().clear(); - + session = openSession(); session.beginTransaction(); it = (Another) session.bySimpleNaturalId(Another.class).load("modified"); assertNull(it); it = (Another) session.bySimpleNaturalId(Another.class).load("it"); session.delete(it); - session.getTransaction().commit(); + session.getTransaction().commit(); session.close(); - + assertEquals(0, session.getSessionFactory().getStatistics().getNaturalIdCacheHitCount()); } - + @Test + @FailureExpectedWithNewMetamodel public void testNaturalIdRecachingWhenNeeded() { Session session = openSession(); session.getSessionFactory().getStatistics().clear(); @@ -238,7 +244,7 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { Serializable id = it.getId(); session.getTransaction().commit(); session.close(); - + session = openSession(); for (int i=0; i < 10; i++) { session.beginTransaction(); @@ -249,7 +255,7 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { it.setSurname("surname" + i); // changing something but not the natural-id's session.getTransaction().commit(); } - + session = openSession(); session.beginTransaction(); it = (Another) session.bySimpleNaturalId(Another.class).load("it"); @@ -258,18 +264,19 @@ public class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestCase { it = (Another) session.byId(Another.class).load(id); session.delete(it); session.getTransaction().commit(); - + // finally there should be only 2 NaturalIdCache puts : 1. insertion, 2. when updating natural-id from 'it' to 'name9' assertEquals(2, session.getSessionFactory().getStatistics().getNaturalIdCachePutCount()); } - + @Test @TestForIssue( jiraKey = "HHH-7245" ) + @FailureExpectedWithNewMetamodel public void testNaturalIdChangeAfterResolveEntityFrom2LCache() { Session session = openSession(); session.beginTransaction(); AllCached it = new AllCached( "it" ); - + session.save( it ); Serializable id = it.getId(); session.getTransaction().commit(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/naturalid/nullable/NullableNaturalIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/naturalid/nullable/NullableNaturalIdTest.java index 1fd2cf8f40..a2d3e15daf 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/naturalid/nullable/NullableNaturalIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/naturalid/nullable/NullableNaturalIdTest.java @@ -26,6 +26,7 @@ package org.hibernate.test.naturalid.nullable; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertNotNull; @@ -34,6 +35,7 @@ import static org.junit.Assert.assertNull; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class NullableNaturalIdTest extends BaseCoreFunctionalTestCase { @Override protected Class[] getAnnotatedClasses() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/CreateTest.java b/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/CreateTest.java index 4f41193be4..fa393a1662 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/CreateTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/CreateTest.java @@ -35,6 +35,7 @@ import org.hibernate.PersistentObjectException; import org.hibernate.Session; import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper; import org.hibernate.exception.ConstraintViolationException; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.jta.TestingJtaPlatformImpl; import static org.junit.Assert.assertEquals; @@ -44,6 +45,7 @@ import static org.junit.Assert.assertNotNull; /** * @author Gavin King, Gail Badner (adapted this from "ops" tests version) */ +@FailureExpectedWithNewMetamodel public class CreateTest extends AbstractOperationTestCase { @Test @SuppressWarnings( {"unchecked"}) diff --git a/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/DeleteTest.java b/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/DeleteTest.java index 4fa18ebe19..a32728da5f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/DeleteTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/DeleteTest.java @@ -26,6 +26,7 @@ package org.hibernate.test.nonflushedchanges; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.jta.TestingJtaPlatformImpl; /** @@ -34,6 +35,7 @@ import org.hibernate.testing.jta.TestingJtaPlatformImpl; * @author Gail Badner * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class DeleteTest extends AbstractOperationTestCase { @Test @SuppressWarnings( {"unchecked"}) diff --git a/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/GetLoadTest.java b/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/GetLoadTest.java index b801da382f..0385cdc5a4 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/GetLoadTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/GetLoadTest.java @@ -31,6 +31,7 @@ import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.jta.TestingJtaPlatformImpl; import static org.junit.Assert.assertEquals; @@ -44,7 +45,9 @@ import static org.junit.Assert.assertTrue; * @author Gail Badner * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class GetLoadTest extends AbstractOperationTestCase { + @Override public void configure(Configuration cfg) { super.configure( cfg ); cfg.setProperty( Environment.GENERATE_STATISTICS, "true" ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/MergeTest.java b/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/MergeTest.java index c17f5444fc..b3a45c7492 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/MergeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/nonflushedchanges/MergeTest.java @@ -12,6 +12,7 @@ import org.hibernate.NonUniqueObjectException; import org.hibernate.Session; import org.hibernate.StaleObjectStateException; import org.hibernate.criterion.Projections; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.jta.TestingJtaPlatformImpl; import static org.junit.Assert.assertEquals; @@ -27,6 +28,7 @@ import static org.junit.Assert.fail; * @author Gail Badner * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class MergeTest extends AbstractOperationTestCase { @Test @@ -852,6 +854,7 @@ public class MergeTest extends AbstractOperationTestCase { } + @Override @SuppressWarnings( {"unchecked"}) protected void cleanupTestData() throws Exception { TestingJtaPlatformImpl.INSTANCE.getTransactionManager().begin(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/ondelete/OnDeleteTest.java b/hibernate-core/src/test/java/org/hibernate/test/ondelete/OnDeleteTest.java index 82b8ec2de5..06d40ae285 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/ondelete/OnDeleteTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/ondelete/OnDeleteTest.java @@ -33,6 +33,7 @@ import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.stat.Statistics; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -43,6 +44,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class OnDeleteTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -62,10 +64,10 @@ public class OnDeleteTest extends BaseCoreFunctionalTestCase { public void testJoinedSubclass() { Statistics statistics = sessionFactory().getStatistics(); statistics.clear(); - + Session s = openSession(); Transaction t = s.beginTransaction(); - + Salesperson mark = new Salesperson(); mark.setName("Mark"); mark.setTitle("internal sales"); @@ -73,7 +75,7 @@ public class OnDeleteTest extends BaseCoreFunctionalTestCase { mark.setAddress("buckhead"); mark.setZip("30305"); mark.setCountry("USA"); - + Person joe = new Person(); joe.setName("Joe"); joe.setAddress("San Francisco"); @@ -82,16 +84,16 @@ public class OnDeleteTest extends BaseCoreFunctionalTestCase { joe.setSex('M'); joe.setSalesperson(mark); mark.getCustomers().add(joe); - + s.save(mark); - + t.commit(); - + assertEquals( statistics.getEntityInsertCount(), 2 ); assertEquals( statistics.getPrepareStatementCount(), 5 ); - + statistics.clear(); - + t = s.beginTransaction(); s.delete(mark); t.commit(); @@ -100,7 +102,7 @@ public class OnDeleteTest extends BaseCoreFunctionalTestCase { if ( getDialect().supportsCascadeDelete() ) { assertEquals( statistics.getPrepareStatementCount(), 1 ); } - + t = s.beginTransaction(); List names = s.createQuery("select name from Person").list(); assertTrue( names.isEmpty() ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/onetomany/OneToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/onetomany/OneToManyTest.java index b8c59e7c48..83504d7987 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/onetomany/OneToManyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/onetomany/OneToManyTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -34,7 +35,9 @@ import static org.junit.Assert.assertEquals; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class OneToManyTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "onetomany/Parent.hbm.xml" }; } @@ -52,16 +55,16 @@ public class OneToManyTest extends BaseCoreFunctionalTestCase { c.setParent(p); s.save(p); s.flush(); - + p.getChildren().remove(c); c.setParent(null); s.flush(); - + p.getChildren().add(c); c.setParent(p); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); c.setParent(null); @@ -76,7 +79,7 @@ public class OneToManyTest extends BaseCoreFunctionalTestCase { t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); c = (Child) s.createQuery("from Child").uniqueResult(); @@ -86,11 +89,11 @@ public class OneToManyTest extends BaseCoreFunctionalTestCase { p = (Parent) s.createQuery("from Parent p left join fetch p.children").uniqueResult(); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); s.createQuery("delete from Child").executeUpdate(); - s.createQuery("delete from Parent").executeUpdate(); + s.createQuery("delete from Parent").executeUpdate(); t.commit(); s.close(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java b/hibernate-core/src/test/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java index d4f97be72e..4f3b3095a5 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java @@ -33,6 +33,7 @@ import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.criterion.Property; import org.hibernate.dialect.Oracle8iDialect; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.TextType; @@ -48,6 +49,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase { private static class TextAsMaterializedClobType extends AbstractSingleColumnStandardBasicType { public final static TextAsMaterializedClobType INSTANCE = new TextAsMaterializedClobType(); @@ -59,10 +61,12 @@ public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase { } } + @Override public String[] getMappings() { return new String[] { "onetoone/formula/Person.hbm.xml" }; } + @Override public void configure(Configuration cfg) { if ( Oracle8iDialect.class.isInstance( getDialect() ) ) { cfg.registerTypeOverride( TextAsMaterializedClobType.INSTANCE ); @@ -83,17 +87,17 @@ public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase { a.setState("VIC"); a.setStreet("Karbarook Ave"); p.setAddress(a); - + Session s = openSession(); Transaction t = s.beginTransaction(); s.persist(p); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); p = (Person) s.createQuery("from Person").uniqueResult(); - + assertNotNull( p.getAddress() ); assertTrue( Hibernate.isInitialized( p.getAddress() ) ); assertNull( p.getMailingAddress() ); @@ -121,7 +125,7 @@ public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase { .add( Property.forName("zip").eq("3181") ) .uniqueResult(); assertNotNull(p); - + s.clear(); p = (Person) s.createCriteria(Person.class) @@ -131,7 +135,7 @@ public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase { assertNotNull( p.getAddress() ); assertTrue( Hibernate.isInitialized( p.getAddress() ) ); assertNull( p.getMailingAddress() ); - + s.clear(); p = (Person) s.createCriteria(Person.class) @@ -141,9 +145,9 @@ public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase { assertNotNull( p.getAddress() ); assertTrue( Hibernate.isInitialized( p.getAddress() ) ); assertNull( p.getMailingAddress() ); - + s.delete(p); - + t.commit(); s.close(); } @@ -159,16 +163,16 @@ public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase { a.setState("VIC"); a.setStreet("Karbarook Ave"); p.setAddress(a); - + Session s = openSession(); Transaction t = s.beginTransaction(); s.persist(p); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); - + a = new Address(); a.setType("HOME"); a.setPerson(p); @@ -178,9 +182,9 @@ public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase { a.getType(); assertFalse( Hibernate.isInitialized(a) ); assertEquals(a.getZip(), "3181"); - + s.clear(); - + a = new Address(); a.setType("HOME"); a.setPerson(p); @@ -189,13 +193,13 @@ public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase { assertSame(a2, a); assertSame(a2.getPerson(), p); //this is a little bit desirable assertEquals(a.getZip(), "3181"); - + s.delete(a2); s.delete( s.get( Person.class, p.getName() ) ); //this is certainly undesirable! oh well... - + t.commit(); s.close(); - + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/onetoone/joined/JoinedSubclassOneToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/onetoone/joined/JoinedSubclassOneToOneTest.java index 98904d66d0..a222f3c126 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/onetoone/joined/JoinedSubclassOneToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/onetoone/joined/JoinedSubclassOneToOneTest.java @@ -32,6 +32,7 @@ import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.stat.EntityStatistics; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -41,11 +42,14 @@ import static org.junit.Assert.assertNull; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class JoinedSubclassOneToOneTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "onetoone/joined/Person.hbm.xml" }; } + @Override public void configure(Configuration cfg) { cfg.setProperty(Environment.USE_SECOND_LEVEL_CACHE, "false"); cfg.setProperty(Environment.GENERATE_STATISTICS, "true"); @@ -61,16 +65,16 @@ public class JoinedSubclassOneToOneTest extends BaseCoreFunctionalTestCase { a.state = "VIC"; a.street = "Karbarook Ave"; p.address = a; - + Session s = openSession(); Transaction t = s.beginTransaction(); s.persist(p); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); - + EntityStatistics addressStats = sessionFactory().getStatistics().getEntityStatistics( Address.class.getName() ); EntityStatistics mailingAddressStats = sessionFactory().getStatistics().getEntityStatistics("MailingAddress"); @@ -90,25 +94,25 @@ public class JoinedSubclassOneToOneTest extends BaseCoreFunctionalTestCase { assertEquals( addressStats.getFetchCount(), 0 ); assertEquals( mailingAddressStats.getFetchCount(), 0 ); - + p = (Person) s.createQuery("from Person p join fetch p.address").uniqueResult(); assertNotNull(p.address); assertNull(p.mailingAddress); s.clear(); - + assertEquals( addressStats.getFetchCount(), 0 ); assertEquals( mailingAddressStats.getFetchCount(), 1 ); p = (Person) s.createQuery("from Person").uniqueResult(); assertNotNull(p.address); assertNull(p.mailingAddress); s.clear(); - + assertEquals( addressStats.getFetchCount(), 0 ); assertEquals( mailingAddressStats.getFetchCount(), 2 ); p = (Person) s.createQuery("from Entity").uniqueResult(); assertNotNull(p.address); assertNull(p.mailingAddress); s.clear(); - + assertEquals( addressStats.getFetchCount(), 0 ); assertEquals( mailingAddressStats.getFetchCount(), 3 ); @@ -117,20 +121,20 @@ public class JoinedSubclassOneToOneTest extends BaseCoreFunctionalTestCase { p = (Person) s.get(Person.class, "Gavin"); assertNotNull(p.address); assertNull(p.mailingAddress); s.clear(); - + assertEquals( addressStats.getFetchCount(), 0 ); assertEquals( mailingAddressStats.getFetchCount(), 3 ); p = (Person) s.get(Entity.class, "Gavin"); assertNotNull(p.address); assertNull(p.mailingAddress); s.clear(); - + assertEquals( addressStats.getFetchCount(), 0 ); assertEquals( mailingAddressStats.getFetchCount(), 3 ); - + t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); Org org = new Org(); @@ -144,23 +148,23 @@ public class JoinedSubclassOneToOneTest extends BaseCoreFunctionalTestCase { s.persist(a2); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); s.get(Entity.class, "IFA"); s.clear(); - + List list = s.createQuery("from Entity e order by e.name").list(); p = (Person) list.get(0); assertNotNull(p.address); assertNull(p.mailingAddress); list.get(1); s.clear(); - + list = s.createQuery("from Entity e left join fetch e.address left join fetch e.mailingAddress order by e.name").list(); p = (Person) list.get(0); org = (Org) list.get(1); assertNotNull(p.address); assertNull(p.mailingAddress); - + s.clear(); s.delete(p); s.delete( p.address ); @@ -169,7 +173,7 @@ public class JoinedSubclassOneToOneTest extends BaseCoreFunctionalTestCase { s.flush(); t.commit(); s.close(); - + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/onetoone/link/OneToOneLinkTest.java b/hibernate-core/src/test/java/org/hibernate/test/onetoone/link/OneToOneLinkTest.java index 4a2f2b02ba..4e64b2b27a 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/onetoone/link/OneToOneLinkTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/onetoone/link/OneToOneLinkTest.java @@ -30,6 +30,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -48,6 +49,7 @@ public class OneToOneLinkTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testOneToOneViaAssociationTable() { Person p = new Person(); p.setName("Gavin King"); @@ -55,13 +57,13 @@ public class OneToOneLinkTest extends BaseCoreFunctionalTestCase { Employee e = new Employee(); p.setEmployee(e); e.setPerson(p); - + Session s = openSession(); Transaction t = s.beginTransaction(); s.persist(p); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); e = (Employee) s.createQuery("from Employee e where e.person.name like 'Gavin%'").uniqueResult(); @@ -77,10 +79,10 @@ public class OneToOneLinkTest extends BaseCoreFunctionalTestCase { assertFalse( Hibernate.isInitialized( e.getPerson() ) ); assertNull( e.getPerson().getCustomer() ); s.clear(); - + t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); @@ -90,10 +92,10 @@ public class OneToOneLinkTest extends BaseCoreFunctionalTestCase { Customer c = new Customer(); e.getPerson().setCustomer(c); c.setPerson( e.getPerson() ); - + t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); @@ -104,7 +106,7 @@ public class OneToOneLinkTest extends BaseCoreFunctionalTestCase { s.delete(e); t.commit(); s.close(); - + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/onetoone/nopojo/DynamicMapOneToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/onetoone/nopojo/DynamicMapOneToOneTest.java index 215c0886c1..79918f6493 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/onetoone/nopojo/DynamicMapOneToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/onetoone/nopojo/DynamicMapOneToOneTest.java @@ -11,6 +11,7 @@ import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.stat.EntityStatistics; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -19,6 +20,7 @@ import static org.junit.Assert.assertNotNull; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class DynamicMapOneToOneTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/onetoone/optional/OptionalOneToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/onetoone/optional/OptionalOneToOneTest.java index 3661494b94..3b22cc7acd 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/onetoone/optional/OptionalOneToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/onetoone/optional/OptionalOneToOneTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertNull; @@ -35,6 +36,7 @@ import static org.junit.Assert.assertNull; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class OptionalOneToOneTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/onetoone/singletable/DiscrimSubclassOneToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/onetoone/singletable/DiscrimSubclassOneToOneTest.java index c0dd3b97e0..4da2e93642 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/onetoone/singletable/DiscrimSubclassOneToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/onetoone/singletable/DiscrimSubclassOneToOneTest.java @@ -32,6 +32,7 @@ import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.stat.EntityStatistics; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -41,6 +42,7 @@ import static org.junit.Assert.assertNull; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class DiscrimSubclassOneToOneTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -63,16 +65,16 @@ public class DiscrimSubclassOneToOneTest extends BaseCoreFunctionalTestCase { a.state = "VIC"; a.street = "Karbarook Ave"; p.address = a; - + Session s = openSession(); Transaction t = s.beginTransaction(); s.persist(p); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); - + EntityStatistics addressStats = sessionFactory().getStatistics().getEntityStatistics( Address.class.getName() ); EntityStatistics mailingAddressStats = sessionFactory().getStatistics().getEntityStatistics("MailingAddress"); @@ -82,25 +84,25 @@ public class DiscrimSubclassOneToOneTest extends BaseCoreFunctionalTestCase { assertEquals( addressStats.getFetchCount(), 0 ); assertEquals( mailingAddressStats.getFetchCount(), 0 ); - + p = (Person) s.createQuery("from Person p join fetch p.address").uniqueResult(); assertNotNull(p.address); assertNull(p.mailingAddress); s.clear(); - + assertEquals( addressStats.getFetchCount(), 0 ); assertEquals( mailingAddressStats.getFetchCount(), 1 ); p = (Person) s.createQuery("from Person").uniqueResult(); assertNotNull(p.address); assertNull(p.mailingAddress); s.clear(); - + assertEquals( addressStats.getFetchCount(), 1 ); assertEquals( mailingAddressStats.getFetchCount(), 2 ); p = (Person) s.createQuery("from Entity").uniqueResult(); assertNotNull(p.address); assertNull(p.mailingAddress); s.clear(); - + assertEquals( addressStats.getFetchCount(), 2 ); assertEquals( mailingAddressStats.getFetchCount(), 3 ); @@ -109,20 +111,20 @@ public class DiscrimSubclassOneToOneTest extends BaseCoreFunctionalTestCase { p = (Person) s.get(Person.class, "Gavin"); assertNotNull(p.address); assertNull(p.mailingAddress); s.clear(); - + assertEquals( addressStats.getFetchCount(), 2 ); assertEquals( mailingAddressStats.getFetchCount(), 3 ); p = (Person) s.get(Entity.class, "Gavin"); assertNotNull(p.address); assertNull(p.mailingAddress); s.clear(); - + assertEquals( addressStats.getFetchCount(), 2 ); assertEquals( mailingAddressStats.getFetchCount(), 3 ); - + t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); Org org = new Org(); @@ -136,31 +138,31 @@ public class DiscrimSubclassOneToOneTest extends BaseCoreFunctionalTestCase { s.persist(org); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); org = (Org) s.get(Entity.class, "IFA"); s.clear(); - + List list = s.createQuery("from Entity e order by e.name").list(); p = (Person) list.get(0); assertNotNull(p.address); assertNull(p.mailingAddress); org = (Org) list.get(1); assertEquals( org.addresses.size(), 1 ); s.clear(); - + list = s.createQuery("from Entity e left join fetch e.address left join fetch e.mailingAddress order by e.name").list(); p = (Person) list.get(0); org = (Org) list.get(1); assertNotNull(p.address); assertNull(p.mailingAddress); assertEquals( org.addresses.size(), 1 ); - + s.delete(p); s.delete(org); - + t.commit(); s.close(); - + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/ops/CreateTest.java b/hibernate-core/src/test/java/org/hibernate/test/ops/CreateTest.java index f35a0956dc..9ce75c3e31 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/ops/CreateTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/ops/CreateTest.java @@ -32,6 +32,7 @@ import org.hibernate.PersistentObjectException; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.exception.ConstraintViolationException; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -41,6 +42,7 @@ import static org.junit.Assert.fail; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class CreateTest extends AbstractOperationTestCase { @Test @SuppressWarnings( {"unchecked"}) diff --git a/hibernate-core/src/test/java/org/hibernate/test/ops/DeleteTest.java b/hibernate-core/src/test/java/org/hibernate/test/ops/DeleteTest.java index 4e9e55250a..d7cf2f2e42 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/ops/DeleteTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/ops/DeleteTest.java @@ -26,10 +26,12 @@ package org.hibernate.test.ops; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class DeleteTest extends AbstractOperationTestCase { @Test @SuppressWarnings( {"unchecked"}) diff --git a/hibernate-core/src/test/java/org/hibernate/test/ops/GetLoadTest.java b/hibernate-core/src/test/java/org/hibernate/test/ops/GetLoadTest.java index 8d3658757c..d71984d842 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/ops/GetLoadTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/ops/GetLoadTest.java @@ -30,6 +30,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -41,6 +42,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class GetLoadTest extends BaseCoreFunctionalTestCase { @Override public void configure(Configuration cfg) { @@ -61,7 +63,7 @@ public class GetLoadTest extends BaseCoreFunctionalTestCase { @Test public void testGetLoad() { clearCounts(); - + Session s = openSession(); Transaction tx = s.beginTransaction(); Employer emp = new Employer(); @@ -72,7 +74,7 @@ public class GetLoadTest extends BaseCoreFunctionalTestCase { s.persist(parent); tx.commit(); s.close(); - + s = openSession(); tx = s.beginTransaction(); emp = (Employer) s.get(Employer.class, emp.getId()); @@ -96,7 +98,7 @@ public class GetLoadTest extends BaseCoreFunctionalTestCase { assertFalse( Hibernate.isInitialized(node) ); tx.commit(); s.close(); - + s = openSession(); tx = s.beginTransaction(); emp = (Employer) s.get("org.hibernate.test.ops.Employer", emp.getId()); @@ -116,7 +118,7 @@ public class GetLoadTest extends BaseCoreFunctionalTestCase { assertFalse( Hibernate.isInitialized(node) ); tx.commit(); s.close(); - + assertFetchCount(0); } @@ -144,7 +146,7 @@ public class GetLoadTest extends BaseCoreFunctionalTestCase { private void clearCounts() { sessionFactory().getStatistics().clear(); } - + private void assertFetchCount(int count) { int fetches = (int) sessionFactory().getStatistics().getEntityFetchCount(); assertEquals(count, fetches); diff --git a/hibernate-core/src/test/java/org/hibernate/test/ops/MergeTest.java b/hibernate-core/src/test/java/org/hibernate/test/ops/MergeTest.java index f3a01eb033..dda37a6dd5 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/ops/MergeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/ops/MergeTest.java @@ -35,6 +35,7 @@ import org.hibernate.Session; import org.hibernate.StaleObjectStateException; import org.hibernate.Transaction; import org.hibernate.criterion.Projections; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -46,6 +47,7 @@ import static org.junit.Assert.fail; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class MergeTest extends AbstractOperationTestCase { @Test public void testMergeStaleVersionFails() throws Exception { diff --git a/hibernate-core/src/test/java/org/hibernate/test/ops/SaveOrUpdateTest.java b/hibernate-core/src/test/java/org/hibernate/test/ops/SaveOrUpdateTest.java index 8bd1ffd0fe..c27e2fc7b4 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/ops/SaveOrUpdateTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/ops/SaveOrUpdateTest.java @@ -33,6 +33,7 @@ import org.hibernate.bytecode.instrumentation.internal.FieldInterceptionHelper; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.criterion.Projections; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -355,6 +356,7 @@ public class SaveOrUpdateTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testSaveOrUpdateGotWithMutableProp() { clearCounts(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/optlock/OptimisticLockTest.java b/hibernate-core/src/test/java/org/hibernate/test/optlock/OptimisticLockTest.java index d4abb8e636..38eedc1fad 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/optlock/OptimisticLockTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/optlock/OptimisticLockTest.java @@ -32,6 +32,7 @@ import org.hibernate.StaleObjectStateException; import org.hibernate.StaleStateException; import org.hibernate.dialect.SQLServerDialect; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -47,12 +48,13 @@ import static org.junit.Assert.fail; value = DialectChecks.DoesRepeatableReadNotCauseReadersToBlockWritersCheck.class, comment = "potential deadlock" ) +@FailureExpectedWithNewMetamodel public class OptimisticLockTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { return new String[] { "optlock/Document.hbm.xml" }; } - + @Test public void testOptimisticLockDirty() { testUpdateOptimisticLockFailure( "LockDirty" ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/ordered/OrderByTest.java b/hibernate-core/src/test/java/org/hibernate/test/ordered/OrderByTest.java index a72f4231a0..1e7fd734c7 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/ordered/OrderByTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/ordered/OrderByTest.java @@ -31,6 +31,7 @@ import org.hibernate.FetchMode; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -41,23 +42,25 @@ import static org.junit.Assert.assertTrue; * @author Gavin King */ public class OrderByTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "ordered/Search.hbm.xml" }; } @Test @SuppressWarnings( {"unchecked"}) + @FailureExpectedWithNewMetamodel public void testOrderBy() { Search s = new Search("Hibernate"); s.getSearchResults().add("jboss.com"); s.getSearchResults().add("hibernate.org"); s.getSearchResults().add("HiA"); - + Session sess = openSession(); Transaction tx = sess.beginTransaction(); sess.persist(s); sess.flush(); - + sess.clear(); s = (Search) sess.createCriteria(Search.class).uniqueResult(); assertFalse( Hibernate.isInitialized( s.getSearchResults() ) ); @@ -66,7 +69,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase { assertEquals( iter.next(), "hibernate.org" ); assertEquals( iter.next(), "jboss.com" ); assertFalse( iter.hasNext() ); - + sess.clear(); s = (Search) sess.createCriteria(Search.class) .setFetchMode("searchResults", FetchMode.JOIN) @@ -77,7 +80,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase { assertEquals( iter.next(), "hibernate.org" ); assertEquals( iter.next(), "jboss.com" ); assertFalse( iter.hasNext() ); - + sess.clear(); s = (Search) sess.createQuery("from Search s left join fetch s.searchResults") .uniqueResult(); @@ -87,7 +90,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase { assertEquals( iter.next(), "hibernate.org" ); assertEquals( iter.next(), "jboss.com" ); assertFalse( iter.hasNext() ); - + /*sess.clear(); s = (Search) sess.createCriteria(Search.class).uniqueResult(); assertFalse( Hibernate.isInitialized( s.getSearchResults() ) ); @@ -96,7 +99,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase { assertEquals( iter.next(), "hibernate.org" ); assertEquals( iter.next(), "jboss.com" ); assertFalse( iter.hasNext() );*/ - + sess.delete(s); tx.commit(); sess.close(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/orphan/PropertyRefTest.java b/hibernate-core/src/test/java/org/hibernate/test/orphan/PropertyRefTest.java index af2d20431a..6ef7915fd8 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/orphan/PropertyRefTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/orphan/PropertyRefTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -35,6 +36,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; * @author Steve Ebersole */ @TestForIssue( jiraKey = "HHH-565" ) +@FailureExpectedWithNewMetamodel public class PropertyRefTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -66,5 +68,5 @@ public class PropertyRefTest extends BaseCoreFunctionalTestCase { txn.commit(); session.close(); } - + } diff --git a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/bidirectional/DeleteOneToOneOrphansTest.java b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/bidirectional/DeleteOneToOneOrphansTest.java index 18a8cf33a4..6b7270841f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/bidirectional/DeleteOneToOneOrphansTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/bidirectional/DeleteOneToOneOrphansTest.java @@ -28,6 +28,7 @@ import java.util.List; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -63,6 +64,7 @@ public class DeleteOneToOneOrphansTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testOrphanedWhileManaged() { createData(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/composite/DeleteOneToOneOrphansTest.java b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/composite/DeleteOneToOneOrphansTest.java index eff8102af5..580203829b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/composite/DeleteOneToOneOrphansTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/composite/DeleteOneToOneOrphansTest.java @@ -28,6 +28,7 @@ import java.util.List; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -37,6 +38,7 @@ import static org.junit.Assert.assertNull; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class DeleteOneToOneOrphansTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/reversed/bidirectional/DeleteOneToOneOrphansTest.java b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/reversed/bidirectional/DeleteOneToOneOrphansTest.java index 516fae7382..3085ceb6ff 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/reversed/bidirectional/DeleteOneToOneOrphansTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/reversed/bidirectional/DeleteOneToOneOrphansTest.java @@ -28,6 +28,7 @@ import java.util.List; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -38,6 +39,7 @@ import static org.junit.Assert.assertNull; * @author Steve Ebersole */ public class DeleteOneToOneOrphansTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "orphan/one2one/fk/reversed/bidirectional/Mapping.hbm.xml" }; } @@ -62,6 +64,7 @@ public class DeleteOneToOneOrphansTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testOrphanedWhileManaged() { createData(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/reversed/unidirectional/DeleteOneToOneOrphansTest.java b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/reversed/unidirectional/DeleteOneToOneOrphansTest.java index cb7de17296..3545a8baec 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/reversed/unidirectional/DeleteOneToOneOrphansTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/fk/reversed/unidirectional/DeleteOneToOneOrphansTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -39,6 +40,7 @@ import static org.junit.Assert.assertNull; * @author Steve Ebersole */ public class DeleteOneToOneOrphansTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "orphan/one2one/fk/reversed/unidirectional/Mapping.hbm.xml" }; } @@ -63,6 +65,7 @@ public class DeleteOneToOneOrphansTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testOrphanedWhileManaged() { createData(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/pk/bidirectional/DeleteOneToOneOrphansTest.java b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/pk/bidirectional/DeleteOneToOneOrphansTest.java index 6750f4cafa..ea59938390 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/pk/bidirectional/DeleteOneToOneOrphansTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/pk/bidirectional/DeleteOneToOneOrphansTest.java @@ -28,6 +28,7 @@ import java.util.List; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -63,6 +64,7 @@ public class DeleteOneToOneOrphansTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testOrphanedWhileManaged() { createData(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/pk/unidirectional/DeleteOneToOneOrphansTest.java b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/pk/unidirectional/DeleteOneToOneOrphansTest.java index d60246cea6..fb28b35522 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/pk/unidirectional/DeleteOneToOneOrphansTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/orphan/one2one/pk/unidirectional/DeleteOneToOneOrphansTest.java @@ -28,6 +28,7 @@ import java.util.List; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -64,6 +65,7 @@ public class DeleteOneToOneOrphansTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testOrphanedWhileManaged() { createData(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/pagination/DistinctSelectTest.java b/hibernate-core/src/test/java/org/hibernate/test/pagination/DistinctSelectTest.java index f37e7c655e..0365b76471 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/pagination/DistinctSelectTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/pagination/DistinctSelectTest.java @@ -31,7 +31,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; -import org.hibernate.dialect.SQLServerDialect; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -40,10 +40,11 @@ import static org.junit.Assert.assertFalse; /** * HHH-5715 bug test case: Duplicated entries when using select distinct with join and pagination. The bug has to do * with new {@link SQLServerDialect} that uses row_number function for pagination - * + * * @author Valotasios Yoryos */ @TestForIssue( jiraKey = "HHH-5715" ) +@FailureExpectedWithNewMetamodel public class DistinctSelectTest extends BaseCoreFunctionalTestCase { private static final int NUM_OF_USERS = 30; diff --git a/hibernate-core/src/test/java/org/hibernate/test/propertyref/basic/PropertyRefTest.java b/hibernate-core/src/test/java/org/hibernate/test/propertyref/basic/PropertyRefTest.java index 35750de714..ee82b58f67 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/propertyref/basic/PropertyRefTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/propertyref/basic/PropertyRefTest.java @@ -37,6 +37,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.mapping.Column; import org.hibernate.mapping.ForeignKey; import org.hibernate.mapping.PersistentClass; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -49,6 +50,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class PropertyRefTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -139,7 +141,7 @@ public class PropertyRefTest extends BaseCoreFunctionalTestCase { t.commit(); s.close(); } - + @Test public void testOneToOnePropertyRef() { Session s = openSession(); @@ -164,7 +166,7 @@ public class PropertyRefTest extends BaseCoreFunctionalTestCase { s.save(act); s.flush(); s.clear(); - + p = (Person) s.get( Person.class, p.getId() ); //get address reference by outer join p2 = (Person) s.get( Person.class, p2.getId() ); //get null address reference by outer join assertNull( p2.getAddress() ); @@ -173,13 +175,13 @@ public class PropertyRefTest extends BaseCoreFunctionalTestCase { assertEquals( l.size(), 2 ); assertTrue( l.contains(p) && l.contains(p2) ); s.clear(); - + l = s.createQuery("from Person p order by p.name").list(); //get address references by sequential selects assertEquals( l.size(), 2 ); assertNull( ( (Person) l.get(0) ).getAddress() ); assertNotNull( ( (Person) l.get(1) ).getAddress() ); s.clear(); - + l = s.createQuery("from Person p left join fetch p.address a order by a.country").list(); //get em by outer join assertEquals( l.size(), 2 ); if ( ( (Person) l.get(0) ).getName().equals("Max") ) { @@ -191,7 +193,7 @@ public class PropertyRefTest extends BaseCoreFunctionalTestCase { assertNotNull( ( (Person) l.get(0) ).getAddress() ); } s.clear(); - + l = s.createQuery("from Person p left join p.accounts a").list(); for ( int i=0; i<2; i++ ) { Object[] row = (Object[]) l.get(i); @@ -214,11 +216,11 @@ public class PropertyRefTest extends BaseCoreFunctionalTestCase { assertTrue( Hibernate.isInitialized(acc.getUser()) ); assertNotNull(acc.getUser()); assertTrue( acc.getUser().getAccounts().contains(acc) ); - + s.createQuery("delete from Address").executeUpdate(); s.createQuery("delete from Account").executeUpdate(); // to not break constraint violation between Person and Account s.createQuery("delete from Person").executeUpdate(); - + t.commit(); s.close(); } @@ -243,7 +245,7 @@ public class PropertyRefTest extends BaseCoreFunctionalTestCase { sessionFactory().getStatistics().clear(); p = (Person) s.get( Person.class, p.getId() ); //get address reference by outer join - + assertTrue( Hibernate.isInitialized( p.getAddress() ) ); assertNotNull( p.getAddress() ); assertEquals( sessionFactory().getStatistics().getPrepareStatementCount(), 1 ); @@ -256,7 +258,7 @@ public class PropertyRefTest extends BaseCoreFunctionalTestCase { p = (Person) s.createCriteria(Person.class) .setFetchMode("address", FetchMode.SELECT) .uniqueResult(); //get address reference by select - + assertTrue( Hibernate.isInitialized( p.getAddress() ) ); assertNotNull( p.getAddress() ); assertEquals( sessionFactory().getStatistics().getPrepareStatementCount(), 2 ); @@ -264,7 +266,7 @@ public class PropertyRefTest extends BaseCoreFunctionalTestCase { s.createQuery("delete from Address").executeUpdate(); s.createQuery("delete from Person").executeUpdate(); - + t.commit(); s.close(); } @@ -272,23 +274,23 @@ public class PropertyRefTest extends BaseCoreFunctionalTestCase { @Test public void testForeignKeyCreation() { PersistentClass classMapping = configuration().getClassMapping("org.hibernate.test.propertyref.basic.Account"); - + Iterator foreignKeyIterator = classMapping.getTable().getForeignKeyIterator(); boolean found = false; while ( foreignKeyIterator.hasNext() ) { ForeignKey element = (ForeignKey) foreignKeyIterator.next(); if(element.getReferencedEntityName().equals(Person.class.getName() ) ) { - + if(!element.isReferenceToPrimaryKey() ) { List referencedColumns = element.getReferencedColumns(); Column column = (Column) referencedColumns.get(0); if(column.getName().equals("person_userid") ) { found = true; // extend test to include the columns - } + } } } } - + assertTrue("Property ref foreign key not found",found); } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/propertyref/cachedcollections/CachedPropertyRefCollectionTest.java b/hibernate-core/src/test/java/org/hibernate/test/propertyref/cachedcollections/CachedPropertyRefCollectionTest.java index e301632214..ec2c7cf2bd 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/propertyref/cachedcollections/CachedPropertyRefCollectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/propertyref/cachedcollections/CachedPropertyRefCollectionTest.java @@ -30,6 +30,7 @@ import org.hibernate.FetchMode; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -49,6 +50,7 @@ public class CachedPropertyRefCollectionTest extends BaseCoreFunctionalTestCase } @Test + @FailureExpectedWithNewMetamodel public void testRetrievalOfCachedCollectionWithPropertyRefKey() { // create the test data... Session session = openSession(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/propertyref/component/complete/CompleteComponentPropertyRefTest.java b/hibernate-core/src/test/java/org/hibernate/test/propertyref/component/complete/CompleteComponentPropertyRefTest.java index b6831a207b..75eb1ae73f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/propertyref/component/complete/CompleteComponentPropertyRefTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/propertyref/component/complete/CompleteComponentPropertyRefTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -38,6 +39,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class CompleteComponentPropertyRefTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/propertyref/component/partial/PartialComponentPropertyRefTest.java b/hibernate-core/src/test/java/org/hibernate/test/propertyref/component/partial/PartialComponentPropertyRefTest.java index 0cc13332cf..6a81a215ce 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/propertyref/component/partial/PartialComponentPropertyRefTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/propertyref/component/partial/PartialComponentPropertyRefTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -38,7 +39,9 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class PartialComponentPropertyRefTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "propertyref/component/partial/Mapping.hbm.xml" }; } @@ -71,24 +74,24 @@ public class PartialComponentPropertyRefTest extends BaseCoreFunctionalTestCase assertNotNull( a.getOwner() ); assertEquals( "Gavin", a.getOwner().getIdentity().getName() ); s.clear(); - + a = (Account) s.get(Account.class, "123-12345-1236"); assertFalse( Hibernate.isInitialized( a.getOwner() ) ); assertNotNull( a.getOwner() ); assertEquals( "Gavin", a.getOwner().getIdentity().getName() ); assertTrue( Hibernate.isInitialized( a.getOwner() ) ); - + s.clear(); sessionFactory().getCache().evictEntityRegion( Account.class ); sessionFactory().getCache().evictEntityRegion( Person.class ); - + a = (Account) s.get(Account.class, "123-12345-1236"); assertTrue( Hibernate.isInitialized( a.getOwner() ) ); assertNotNull( a.getOwner() ); assertEquals( "Gavin", a.getOwner().getIdentity().getName() ); assertTrue( Hibernate.isInitialized( a.getOwner() ) ); - + s.delete( a ); s.delete( a.getOwner() ); s.getTransaction().commit(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/discrim/SubclassPropertyRefTest.java b/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/discrim/SubclassPropertyRefTest.java index 91a7c9d79c..fa768438dc 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/discrim/SubclassPropertyRefTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/discrim/SubclassPropertyRefTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertNotNull; @@ -37,6 +38,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class SubclassPropertyRefTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/joined/JoinedSubclassPropertyRefTest.java b/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/joined/JoinedSubclassPropertyRefTest.java index 1b717c1e0c..7c7752e265 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/joined/JoinedSubclassPropertyRefTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/joined/JoinedSubclassPropertyRefTest.java @@ -29,6 +29,7 @@ import org.hibernate.FetchMode; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertNotNull; @@ -37,7 +38,9 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class JoinedSubclassPropertyRefTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "propertyref/inheritence/joined/Person.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/union/UnionSubclassPropertyRefTest.java b/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/union/UnionSubclassPropertyRefTest.java index d899e96dc1..ab3177decb 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/union/UnionSubclassPropertyRefTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/propertyref/inheritence/union/UnionSubclassPropertyRefTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertNotNull; @@ -37,6 +38,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class UnionSubclassPropertyRefTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/proxy/ProxyTest.java b/hibernate-core/src/test/java/org/hibernate/test/proxy/ProxyTest.java index d9acf165bf..0e55737829 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/proxy/ProxyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/proxy/ProxyTest.java @@ -42,6 +42,7 @@ import org.hibernate.internal.SessionImpl; import org.hibernate.internal.util.SerializationHelper; import org.hibernate.proxy.HibernateProxy; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -310,6 +311,7 @@ public class ProxyTest extends BaseCoreFunctionalTestCase { @SuppressWarnings( {"unchecked"}) @Test + @FailureExpectedWithNewMetamodel public void testProxyEviction() { Session s = openSession(); Transaction t = s.beginTransaction(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCacheIgnoreResultTransformerTest.java b/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCacheIgnoreResultTransformerTest.java index 82b46a42e0..16d81f62e7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCacheIgnoreResultTransformerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCacheIgnoreResultTransformerTest.java @@ -24,10 +24,12 @@ package org.hibernate.test.querycache; import org.hibernate.CacheMode; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class CriteriaQueryCacheIgnoreResultTransformerTest extends AbstractQueryCacheResultTransformerTest { @Override protected CacheMode getQueryCacheMode() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCacheNormalResultTransformerTest.java b/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCacheNormalResultTransformerTest.java index c72c98f27c..1943751159 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCacheNormalResultTransformerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCacheNormalResultTransformerTest.java @@ -24,10 +24,12 @@ package org.hibernate.test.querycache; import org.hibernate.CacheMode; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class CriteriaQueryCacheNormalResultTransformerTest extends CriteriaQueryCachePutResultTransformerTest { @Override protected CacheMode getQueryCacheMode() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCachePutResultTransformerTest.java b/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCachePutResultTransformerTest.java index d5801651fd..aa58e27d33 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCachePutResultTransformerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/querycache/CriteriaQueryCachePutResultTransformerTest.java @@ -24,10 +24,12 @@ package org.hibernate.test.querycache; import org.hibernate.CacheMode; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class CriteriaQueryCachePutResultTransformerTest extends CriteriaQueryCacheIgnoreResultTransformerTest { @Override protected CacheMode getQueryCacheMode() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCacheIgnoreResultTransformerTest.java b/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCacheIgnoreResultTransformerTest.java index 74a63826e8..1d0cce5610 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCacheIgnoreResultTransformerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCacheIgnoreResultTransformerTest.java @@ -27,10 +27,12 @@ import org.junit.Test; import org.hibernate.CacheMode; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class HqlQueryCacheIgnoreResultTransformerTest extends AbstractQueryCacheResultTransformerTest { @Override protected CacheMode getQueryCacheMode() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCacheNormalResultTransformerTest.java b/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCacheNormalResultTransformerTest.java index 8b7b3241f7..dff2123d46 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCacheNormalResultTransformerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCacheNormalResultTransformerTest.java @@ -24,10 +24,12 @@ package org.hibernate.test.querycache; import org.hibernate.CacheMode; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class HqlQueryCacheNormalResultTransformerTest extends HqlQueryCachePutResultTransformerTest { @Override protected CacheMode getQueryCacheMode() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCachePutResultTransformerTest.java b/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCachePutResultTransformerTest.java index a9ed5e1a40..695793184f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCachePutResultTransformerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/querycache/HqlQueryCachePutResultTransformerTest.java @@ -24,10 +24,12 @@ package org.hibernate.test.querycache; import org.hibernate.CacheMode; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class HqlQueryCachePutResultTransformerTest extends HqlQueryCacheIgnoreResultTransformerTest { @Override protected CacheMode getQueryCacheMode() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/querycache/QueryCacheTest.java b/hibernate-core/src/test/java/org/hibernate/test/querycache/QueryCacheTest.java index a64051dde7..b2898e3749 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/querycache/QueryCacheTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/querycache/QueryCacheTest.java @@ -37,6 +37,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.stat.EntityStatistics; import org.hibernate.stat.QueryStatistics; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -159,6 +160,7 @@ public class QueryCacheTest extends BaseCoreFunctionalTestCase { private static final String queryString = "from Item i where i.name='widget'"; @Test + @FailureExpectedWithNewMetamodel public void testQueryCacheInvalidation() throws Exception { sessionFactory().evictQueries(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/queryplan/GetHqlQueryPlanTest.java b/hibernate-core/src/test/java/org/hibernate/test/queryplan/GetHqlQueryPlanTest.java index 3efdefd681..cf1d39d1a0 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/queryplan/GetHqlQueryPlanTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/queryplan/GetHqlQueryPlanTest.java @@ -31,6 +31,7 @@ import org.hibernate.Session; import org.hibernate.engine.query.spi.HQLQueryPlan; import org.hibernate.engine.query.spi.QueryPlanCache; import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertNotSame; @@ -42,7 +43,9 @@ import static org.junit.Assert.assertTrue; * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class GetHqlQueryPlanTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[]{ "queryplan/filter-defs.hbm.xml", diff --git a/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyCriteriaQueryTest.java b/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyCriteriaQueryTest.java index 1f4db7acf4..eac8f39317 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyCriteriaQueryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyCriteriaQueryTest.java @@ -43,6 +43,7 @@ import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.internal.util.SerializationHelper; import org.hibernate.proxy.HibernateProxy; import org.hibernate.proxy.LazyInitializer; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.SkipForDialect; import static org.junit.Assert.assertEquals; @@ -57,6 +58,7 @@ import static org.junit.Assert.fail; * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class ReadOnlyCriteriaQueryTest extends AbstractReadOnlyTest { @Override public String[] getMappings() { @@ -923,7 +925,7 @@ public class ReadOnlyCriteriaQueryTest extends AbstractReadOnlyTest { t.commit(); s.close(); } - + @Test public void testScrollCriteria() { Session session = openSession(); @@ -946,7 +948,7 @@ public class ReadOnlyCriteriaQueryTest extends AbstractReadOnlyTest { t.commit(); session.close(); } - + @Test @SkipForDialect( value = SybaseASE15Dialect.class, jiraKey = "HHH-3032", strictMatching = true) public void testSubselect() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyProxyTest.java b/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyProxyTest.java index d790170f5a..3463b3ca7b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyProxyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyProxyTest.java @@ -38,6 +38,7 @@ import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.proxy.HibernateProxy; import org.hibernate.proxy.LazyInitializer; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -48,9 +49,10 @@ import static org.junit.Assert.fail; /** * Tests making initialized and uninitialized proxies read-only/modifiable - * + * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class ReadOnlyProxyTest extends AbstractReadOnlyTest { @Override public String[] getMappings() { @@ -625,7 +627,7 @@ public class ReadOnlyProxyTest extends AbstractReadOnlyTest { s.getTransaction().rollback(); s.close(); s = openSession(); - s.beginTransaction(); + s.beginTransaction(); s.delete( dp ); s.getTransaction().commit(); s.close(); @@ -713,7 +715,7 @@ public class ReadOnlyProxyTest extends AbstractReadOnlyTest { s.delete( dp ); s.getTransaction().commit(); s.close(); - } + } @Test public void testReadOnlyToModifiableInitWhenModifiedIsUpdated() { @@ -1614,7 +1616,7 @@ public class ReadOnlyProxyTest extends AbstractReadOnlyTest { assertNull( ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getSession() ); assertTrue( ( (SessionImplementor) s ).isClosed() ); try { - ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().setSession( ( SessionImplementor ) s ); + ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().setSession( ( SessionImplementor ) s ); fail( "should have failed because session was closed" ); } catch ( SessionException ex) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlySessionLazyNonLazyTest.java b/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlySessionLazyNonLazyTest.java index d197b0a0ae..113e3d616a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlySessionLazyNonLazyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlySessionLazyNonLazyTest.java @@ -37,6 +37,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.proxy.HibernateProxy; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -66,6 +67,7 @@ import static org.junit.Assert.assertTrue; * * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class ReadOnlySessionLazyNonLazyTest extends AbstractReadOnlyTest { @Override public String[] getMappings() { @@ -1063,19 +1065,19 @@ public class ReadOnlySessionLazyNonLazyTest extends AbstractReadOnlyTest { c.getNonLazySelectDataPoints().iterator().next() ) ); - List list = ( List ) s.createFilter( c.getLazyDataPoints(), "" ) + List list = s.createFilter( c.getLazyDataPoints(), "" ) .setMaxResults(1) .setReadOnly( false ) .list(); assertEquals( 1, list.size() ); assertFalse( s.isReadOnly( list.get( 0 ) ) ); - list = ( List ) s.createFilter( c.getNonLazyJoinDataPoints(), "" ) + list = s.createFilter( c.getNonLazyJoinDataPoints(), "" ) .setMaxResults(1) .setReadOnly( false ) .list(); assertEquals( 1, list.size() ); assertTrue( s.isReadOnly( list.get( 0 ) ) ); - list = ( List ) s.createFilter( c.getNonLazySelectDataPoints(), "" ) + list = s.createFilter( c.getNonLazySelectDataPoints(), "" ) .setMaxResults(1) .setReadOnly( false ) .list(); @@ -1141,19 +1143,19 @@ public class ReadOnlySessionLazyNonLazyTest extends AbstractReadOnlyTest { ) ); expectedReadOnlyObjects = new HashSet(); - List list = ( List ) s.createFilter( c.getLazyDataPoints(), "" ) + List list = s.createFilter( c.getLazyDataPoints(), "" ) .setMaxResults(1) .setReadOnly( true ) .list(); assertEquals( 1, list.size() ); assertTrue( s.isReadOnly( list.get( 0 ) ) ); - list = ( List ) s.createFilter( c.getNonLazyJoinDataPoints(), "" ) + list = s.createFilter( c.getNonLazyJoinDataPoints(), "" ) .setMaxResults(1) .setReadOnly( true ) .list(); assertEquals( 1, list.size() ); assertFalse( s.isReadOnly( list.get( 0 ) ) ); - list = ( List ) s.createFilter( c.getNonLazySelectDataPoints(), "" ) + list = s.createFilter( c.getNonLazySelectDataPoints(), "" ) .setMaxResults(1) .setReadOnly( true ) .list(); @@ -1233,17 +1235,17 @@ public class ReadOnlySessionLazyNonLazyTest extends AbstractReadOnlyTest { c.getNonLazySelectDataPoints().iterator().next() ) ); - List list = ( List ) s.createFilter( c.getLazyDataPoints(), "" ) + List list = s.createFilter( c.getLazyDataPoints(), "" ) .setMaxResults( 1 ) .list(); assertEquals( 1, list.size() ); assertTrue( s.isReadOnly( list.get( 0 ) ) ); - list = ( List ) s.createFilter( c.getNonLazyJoinDataPoints(), "" ) + list = s.createFilter( c.getNonLazyJoinDataPoints(), "" ) .setMaxResults( 1 ) .list(); assertEquals( 1, list.size() ); assertTrue( s.isReadOnly( list.get( 0 ) ) ); - list = ( List ) s.createFilter( c.getNonLazySelectDataPoints(), "" ) + list = s.createFilter( c.getNonLazySelectDataPoints(), "" ) .setMaxResults( 1 ) .list(); assertEquals( 1, list.size() ); @@ -1308,17 +1310,17 @@ public class ReadOnlySessionLazyNonLazyTest extends AbstractReadOnlyTest { ) ); expectedReadOnlyObjects = new HashSet(); - List list = ( List ) s.createFilter( c.getLazyDataPoints(), "" ) + List list = s.createFilter( c.getLazyDataPoints(), "" ) .setMaxResults( 1 ) .list(); assertEquals( 1, list.size() ); assertFalse( s.isReadOnly( list.get( 0 ) ) ); - list = ( List ) s.createFilter( c.getNonLazyJoinDataPoints(), "" ) + list = s.createFilter( c.getNonLazyJoinDataPoints(), "" ) .setMaxResults( 1 ) .list(); assertEquals( 1, list.size() ); assertFalse( s.isReadOnly( list.get( 0 ) ) ); - list = ( List ) s.createFilter( c.getNonLazySelectDataPoints(), "" ) + list = s.createFilter( c.getNonLazySelectDataPoints(), "" ) .setMaxResults( 1 ) .list(); assertEquals( 1, list.size() ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlySessionTest.java b/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlySessionTest.java index 898fa5ba98..c84ace0bf2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlySessionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlySessionTest.java @@ -37,6 +37,7 @@ import org.hibernate.ScrollableResults; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.proxy.HibernateProxy; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -47,6 +48,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class ReadOnlySessionTest extends AbstractReadOnlyTest { @Override public String[] getMappings() { @@ -293,7 +295,7 @@ public class ReadOnlySessionTest extends AbstractReadOnlyTest { ScrollableResults sr = query.scroll(ScrollMode.FORWARD_ONLY); assertFalse( s.isDefaultReadOnly() ); assertTrue( query.isReadOnly() ); - DataPoint dpLast = ( DataPoint ) s.get( DataPoint.class, dp.getId() ); + DataPoint dpLast = ( DataPoint ) s.get( DataPoint.class, dp.getId() ); assertFalse( s.isReadOnly( dpLast ) ); query.setReadOnly( false ); assertFalse( query.isReadOnly() ); @@ -607,7 +609,7 @@ public class ReadOnlySessionTest extends AbstractReadOnlyTest { int nExpectedChanges = 0; assertFalse( s.isDefaultReadOnly() ); while ( it.hasNext() ) { - assertFalse( s.isDefaultReadOnly() ); + assertFalse( s.isDefaultReadOnly() ); dp = (DataPoint) it.next(); assertFalse( s.isDefaultReadOnly() ); if ( dp.getId() == dpLast.getId() ) { @@ -903,7 +905,7 @@ public class ReadOnlySessionTest extends AbstractReadOnlyTest { s.refresh( dp ); assertEquals( "original", dp.getDescription() ); assertTrue( s.isReadOnly( dp ) ); - assertTrue( s.isReadOnly( ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getImplementation() ) ); + assertTrue( s.isReadOnly( ( ( HibernateProxy ) dp ).getHibernateLazyInitializer().getImplementation() ) ); dp.setDescription( "changed" ); assertEquals( "changed", dp.getDescription() ); t.commit(); @@ -1188,7 +1190,7 @@ public class ReadOnlySessionTest extends AbstractReadOnlyTest { dpProxy = ( DataPoint ) s.merge( dp ); assertTrue( s.isReadOnly( dpProxy ) ); assertTrue( Hibernate.isInitialized( dpProxy ) ); - assertEquals( "description", dpProxy.getDescription() ); + assertEquals( "description", dpProxy.getDescription() ); t.commit(); s.close(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java b/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java index 1fed5715dd..2440f005f5 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java @@ -33,6 +33,7 @@ import org.hibernate.ScrollMode; import org.hibernate.ScrollableResults; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -41,10 +42,11 @@ import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; /** - * + * * @author Gavin King * @author Gail Badner */ +@FailureExpectedWithNewMetamodel public class ReadOnlyTest extends AbstractReadOnlyTest { @Override public String[] getMappings() { @@ -92,7 +94,7 @@ public class ReadOnlyTest extends AbstractReadOnlyTest { assertEquals( 1, s.createQuery("delete from DataPoint").executeUpdate() ); s.getTransaction().commit(); s.close(); - + assertUpdateCount( 0 ); //deletes from Query.executeUpdate() are not tracked //assertDeleteCount( 1 ); @@ -464,7 +466,7 @@ public class ReadOnlyTest extends AbstractReadOnlyTest { t.commit(); s.close(); - assertUpdateCount( 0 ); + assertUpdateCount( 0 ); } @Test @@ -530,7 +532,7 @@ public class ReadOnlyTest extends AbstractReadOnlyTest { t.commit(); s.close(); - assertUpdateCount( 0 ); + assertUpdateCount( 0 ); } @Test diff --git a/hibernate-core/src/test/java/org/hibernate/test/reattachment/CollectionReattachmentTest.java b/hibernate-core/src/test/java/org/hibernate/test/reattachment/CollectionReattachmentTest.java index 1439e8ef07..fe61ba4a2e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/reattachment/CollectionReattachmentTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/reattachment/CollectionReattachmentTest.java @@ -26,6 +26,7 @@ package org.hibernate.test.reattachment; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; /** @@ -40,6 +41,7 @@ public class CollectionReattachmentTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testUpdateOwnerAfterClear() { Session s = openSession(); s.beginTransaction(); @@ -67,6 +69,7 @@ public class CollectionReattachmentTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testUpdateOwnerAfterEvict() { Session s = openSession(); s.beginTransaction(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/reattachment/ProxyReattachmentTest.java b/hibernate-core/src/test/java/org/hibernate/test/reattachment/ProxyReattachmentTest.java index 27c520629c..41d997bd67 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/reattachment/ProxyReattachmentTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/reattachment/ProxyReattachmentTest.java @@ -30,6 +30,7 @@ import java.util.Set; import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -40,11 +41,13 @@ import static org.junit.Assert.assertEquals; * @author Steve Ebersole */ public class ProxyReattachmentTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "reattachment/Mappings.hbm.xml" }; } @Test + @FailureExpectedWithNewMetamodel public void testUpdateAfterEvict() { Session s = openSession(); s.beginTransaction(); @@ -71,6 +74,7 @@ public class ProxyReattachmentTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testUpdateAfterClear() { Session s = openSession(); s.beginTransaction(); @@ -98,6 +102,7 @@ public class ProxyReattachmentTest extends BaseCoreFunctionalTestCase { @Test @SuppressWarnings( {"unchecked"}) + @FailureExpectedWithNewMetamodel public void testIterateWithClearTopOfLoop() { Session s = openSession(); s.beginTransaction(); @@ -139,6 +144,7 @@ public class ProxyReattachmentTest extends BaseCoreFunctionalTestCase { @Test @SuppressWarnings( {"unchecked"}) + @FailureExpectedWithNewMetamodel public void testIterateWithClearBottomOfLoop() { Session s = openSession(); s.beginTransaction(); @@ -180,6 +186,7 @@ public class ProxyReattachmentTest extends BaseCoreFunctionalTestCase { @Test @SuppressWarnings( {"unchecked"}) + @FailureExpectedWithNewMetamodel public void testIterateWithEvictTopOfLoop() { Session s = openSession(); s.beginTransaction(); @@ -217,6 +224,7 @@ public class ProxyReattachmentTest extends BaseCoreFunctionalTestCase { @Test @SuppressWarnings( {"unchecked"}) + @FailureExpectedWithNewMetamodel public void testIterateWithEvictBottomOfLoop() { Session s = openSession(); s.beginTransaction(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/resulttransformer/ResultTransformerTest.java b/hibernate-core/src/test/java/org/hibernate/test/resulttransformer/ResultTransformerTest.java index f5d89cd270..b45c9c9996 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/resulttransformer/ResultTransformerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/resulttransformer/ResultTransformerTest.java @@ -2,24 +2,24 @@ * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates 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 + * 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, Inc. * - * 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 + * 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 + * 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 + * 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 @@ -34,6 +34,7 @@ import org.hibernate.Query; import org.hibernate.ScrollableResults; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.transform.ResultTransformer; @@ -44,6 +45,7 @@ import static org.junit.Assert.assertTrue; /** * @author Sharath Reddy */ +@FailureExpectedWithNewMetamodel public class ResultTransformerTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/sorted/SortTest.java b/hibernate-core/src/test/java/org/hibernate/test/sorted/SortTest.java index c78277ccb3..7990cd1adb 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/sorted/SortTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/sorted/SortTest.java @@ -31,6 +31,7 @@ import org.hibernate.FetchMode; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -40,7 +41,9 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class SortTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "sorted/Search.hbm.xml" }; } @@ -52,12 +55,12 @@ public class SortTest extends BaseCoreFunctionalTestCase { s.getSearchResults().add("jboss.com"); s.getSearchResults().add("hibernate.org"); s.getSearchResults().add("HiA"); - + Session sess = openSession(); Transaction tx = sess.beginTransaction(); sess.persist(s); sess.flush(); - + sess.clear(); s = (Search) sess.createCriteria(Search.class).uniqueResult(); assertFalse( Hibernate.isInitialized( s.getSearchResults() ) ); @@ -66,7 +69,7 @@ public class SortTest extends BaseCoreFunctionalTestCase { assertEquals( iter.next(), "hibernate.org" ); assertEquals( iter.next(), "jboss.com" ); assertFalse( iter.hasNext() ); - + sess.clear(); s = (Search) sess.createCriteria(Search.class) .setFetchMode("searchResults", FetchMode.JOIN) @@ -77,7 +80,7 @@ public class SortTest extends BaseCoreFunctionalTestCase { assertEquals( iter.next(), "hibernate.org" ); assertEquals( iter.next(), "jboss.com" ); assertFalse( iter.hasNext() ); - + sess.clear(); s = (Search) sess.createQuery("from Search s left join fetch s.searchResults") .uniqueResult(); @@ -87,7 +90,7 @@ public class SortTest extends BaseCoreFunctionalTestCase { assertEquals( iter.next(), "hibernate.org" ); assertEquals( iter.next(), "jboss.com" ); assertFalse( iter.hasNext() ); - + sess.delete(s); tx.commit(); sess.close(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/sql/autodiscovery/AutoDiscoveryTest.java b/hibernate-core/src/test/java/org/hibernate/test/sql/autodiscovery/AutoDiscoveryTest.java index 531ebe00cc..542eb3c003 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/sql/autodiscovery/AutoDiscoveryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/sql/autodiscovery/AutoDiscoveryTest.java @@ -36,6 +36,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.jdbc.Work; import org.hibernate.loader.custom.NonUniqueDiscoveredSqlAliasException; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -43,6 +44,7 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class AutoDiscoveryTest extends BaseCoreFunctionalTestCase { private static final String QUERY_STRING = "select u.name as username, g.name as groupname, m.joindate " + diff --git a/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java b/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java index 344749567a..dc76f69637 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java @@ -34,6 +34,7 @@ import org.hibernate.test.sql.hand.SpaceShip; import org.hibernate.test.sql.hand.Speech; import org.hibernate.test.sql.hand.TextHolder; import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -58,7 +59,9 @@ import static org.junit.Assert.fail; * @author Steve Ebersole */ @SuppressWarnings({ "UnnecessaryBoxing", "UnnecessaryUnboxing" }) +@FailureExpectedWithNewMetamodel public class NativeSQLQueriesTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "sql/hand/query/NativeSQLQueries.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/NativeSqlAndQuotedIdentifiersTest.java b/hibernate-core/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/NativeSqlAndQuotedIdentifiersTest.java index 4f8363feb8..85a2f35103 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/NativeSqlAndQuotedIdentifiersTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/sql/hand/quotedidentifiers/NativeSqlAndQuotedIdentifiersTest.java @@ -29,6 +29,7 @@ import org.hibernate.SQLQuery; import org.hibernate.Session; import org.hibernate.dialect.Dialect; import org.hibernate.testing.DialectCheck; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -38,7 +39,9 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; * @author Steve Ebersole */ @RequiresDialectFeature( value = NativeSqlAndQuotedIdentifiersTest.LocalDialectCheck.class ) +@FailureExpectedWithNewMetamodel public class NativeSqlAndQuotedIdentifiersTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "sql/hand/quotedidentifiers/Mappings.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/stats/StatsTest.java b/hibernate-core/src/test/java/org/hibernate/test/stats/StatsTest.java index 3d9c6c253d..45bf54eb9a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/stats/StatsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/stats/StatsTest.java @@ -39,6 +39,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.mapping.Collection; import org.hibernate.stat.QueryStatistics; import org.hibernate.stat.Statistics; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -51,10 +52,12 @@ import static org.junit.Assert.assertNotNull; * @author Emmanuel Bernard */ public class StatsTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "stats/Continent.hbm.xml" }; } + @Override public void configure(Configuration cfg) { super.configure( cfg ); cfg.setProperty( Environment.GENERATE_STATISTICS, "true" ); @@ -62,6 +65,7 @@ public class StatsTest extends BaseCoreFunctionalTestCase { @Test @SuppressWarnings( {"UnusedAssignment"}) + @FailureExpectedWithNewMetamodel public void testCollectionFetchVsLoad() throws Exception { Statistics stats = sessionFactory().getStatistics(); stats.clear(); @@ -152,6 +156,7 @@ public class StatsTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testQueryStatGathering() { Statistics stats = sessionFactory().getStatistics(); stats.clear(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java b/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java index 1101da6a72..2815a79426 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java @@ -32,6 +32,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -39,7 +40,9 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class DiscrimSubclassFilterTest extends BaseCoreFunctionalTestCase { + @Override public final String[] getMappings() { return new String[] { "subclassfilter/discrim-subclass.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/JoinedSubclassFilterTest.java b/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/JoinedSubclassFilterTest.java index 5bfb4f0234..32af56d829 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/JoinedSubclassFilterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/JoinedSubclassFilterTest.java @@ -32,6 +32,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -39,7 +40,9 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class JoinedSubclassFilterTest extends BaseCoreFunctionalTestCase { + @Override public final String[] getMappings() { return new String[] { "subclassfilter/joined-subclass.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/UnionSubclassFilterTest.java b/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/UnionSubclassFilterTest.java index d79bf7aefb..0a224d890d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/UnionSubclassFilterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/subclassfilter/UnionSubclassFilterTest.java @@ -32,6 +32,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -39,7 +40,9 @@ import static org.junit.Assert.assertEquals; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class UnionSubclassFilterTest extends BaseCoreFunctionalTestCase { + @Override public final String[] getMappings() { return new String[] { "subclassfilter/union-subclass.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/subselect/SubselectTest.java b/hibernate-core/src/test/java/org/hibernate/test/subselect/SubselectTest.java index b35ede4292..aa897b2ddc 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/subselect/SubselectTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/subselect/SubselectTest.java @@ -30,6 +30,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Restrictions; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -40,12 +41,14 @@ import static org.junit.Assert.assertTrue; * @author Gavin King */ public class SubselectTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "subselect/Beings.hbm.xml" }; } @Test @SuppressWarnings( {"unchecked"}) + @FailureExpectedWithNewMetamodel public void testEntitySubselect() { Session s = openSession(); Transaction t = s.beginTransaction(); @@ -60,7 +63,7 @@ public class SubselectTest extends BaseCoreFunctionalTestCase { s.save(gavin); s.save(x23y4); s.flush(); - List beings = ( List) s.createQuery("from Being").list(); + List beings = s.createQuery("from Being").list(); for ( Being being : beings ) { assertNotNull( being.getLocation() ); assertNotNull( being.getIdentity() ); @@ -86,13 +89,14 @@ public class SubselectTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testCustomColumnReadAndWrite() { Session s = openSession(); Transaction t = s.beginTransaction(); final double HUMAN_INCHES = 73; final double ALIEN_INCHES = 931; - final double HUMAN_CENTIMETERS = HUMAN_INCHES * 2.54d; - final double ALIEN_CENTIMETERS = ALIEN_INCHES * 2.54d; + final double HUMAN_CENTIMETERS = HUMAN_INCHES * 2.54d; + final double ALIEN_CENTIMETERS = ALIEN_INCHES * 2.54d; Human gavin = new Human(); gavin.setName( "gavin" ); gavin.setSex( 'M' ); @@ -106,7 +110,7 @@ public class SubselectTest extends BaseCoreFunctionalTestCase { s.save(gavin); s.save(x23y4); s.flush(); - + // Test value conversion during insert // Value returned by Oracle native query is a Types.NUMERIC, which is mapped to a BigDecimalType; // Cast returned value to Number then call Number.doubleValue() so it works on all dialects. @@ -117,17 +121,17 @@ public class SubselectTest extends BaseCoreFunctionalTestCase { ( (Number)s.createSQLQuery("select height_centimeters from aliens").uniqueResult() ).doubleValue(); assertEquals(ALIEN_CENTIMETERS, alienHeightViaSql, 0.01d); s.clear(); - + // Test projection Double heightViaHql = (Double)s.createQuery("select heightInches from Being b where b.identity = 'gavin'").uniqueResult(); assertEquals(HUMAN_INCHES, heightViaHql, 0.01d); - + // Test restriction and entity load via criteria Being b = (Being)s.createCriteria(Being.class) .add(Restrictions.between("heightInches", HUMAN_INCHES - 0.01d, HUMAN_INCHES + 0.01d)) .uniqueResult(); assertEquals(HUMAN_INCHES, b.getHeightInches(), 0.01d); - + // Test predicate and entity load via HQL b = (Being)s.createQuery("from Being b where b.heightInches between ? and ?") .setDouble(0, ALIEN_INCHES - 0.01d) @@ -135,10 +139,10 @@ public class SubselectTest extends BaseCoreFunctionalTestCase { .uniqueResult(); assertEquals(ALIEN_INCHES, b.getHeightInches(), 0.01d); s.delete(gavin); - s.delete(x23y4); + s.delete(x23y4); t.commit(); s.close(); - + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/subselectfetch/SubselectFetchTest.java b/hibernate-core/src/test/java/org/hibernate/test/subselectfetch/SubselectFetchTest.java index 7d64b312e2..a72b7cdd03 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/subselectfetch/SubselectFetchTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/subselectfetch/SubselectFetchTest.java @@ -35,6 +35,7 @@ import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.criterion.Order; import org.hibernate.criterion.Property; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -44,6 +45,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class SubselectFetchTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -71,16 +73,16 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { q.getChildren().add( new Child("bar1") ); q.getChildren().add( new Child("bar2") ); q.getMoreChildren().addAll( p.getChildren() ); - s.persist(p); + s.persist(p); s.persist(q); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); - + sessionFactory().getStatistics().clear(); - + List parents = s.createQuery("from Parent where name between 'bar' and 'foo' order by name desc") .list(); p = (Parent) parents.get(0); @@ -90,33 +92,33 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { assertFalse( Hibernate.isInitialized( q.getChildren() ) ); assertEquals( p.getChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( p.getChildren().iterator().next() ) ); - + assertTrue( Hibernate.isInitialized( q.getChildren() ) ); - + assertEquals( q.getChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( q.getChildren().iterator().next() ) ); - + assertFalse( Hibernate.isInitialized( p.getMoreChildren() ) ); assertFalse( Hibernate.isInitialized( q.getMoreChildren() ) ); assertEquals( p.getMoreChildren().size(), 0 ); - + assertTrue( Hibernate.isInitialized( q.getMoreChildren() ) ); - + assertEquals( q.getMoreChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( q.getMoreChildren().iterator().next() ) ); - + assertEquals( 3, sessionFactory().getStatistics().getPrepareStatementCount() ); Child c = (Child) p.getChildren().get(0); c.getFriends().size(); s.delete(p); - s.delete(q); + s.delete(q); t.commit(); s.close(); @@ -133,16 +135,16 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { q.getChildren().add( new Child("bar1") ); q.getChildren().add( new Child("bar2") ); q.getMoreChildren().addAll( p.getChildren() ); - s.persist(p); + s.persist(p); s.persist(q); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); - + sessionFactory().getStatistics().clear(); - + List parents = s.createQuery("from Parent where name between :bar and :foo order by name desc") .setParameter("bar", "bar") .setParameter("foo", "foo") @@ -154,33 +156,33 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { assertFalse( Hibernate.isInitialized( q.getChildren() ) ); assertEquals( p.getChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( p.getChildren().iterator().next() ) ); - + assertTrue( Hibernate.isInitialized( q.getChildren() ) ); - + assertEquals( q.getChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( q.getChildren().iterator().next() ) ); - + assertFalse( Hibernate.isInitialized( p.getMoreChildren() ) ); assertFalse( Hibernate.isInitialized( q.getMoreChildren() ) ); assertEquals( p.getMoreChildren().size(), 0 ); - + assertTrue( Hibernate.isInitialized( q.getMoreChildren() ) ); - + assertEquals( q.getMoreChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( q.getMoreChildren().iterator().next() ) ); - + assertEquals( 3, sessionFactory().getStatistics().getPrepareStatementCount() ); Child c = (Child) p.getChildren().get(0); c.getFriends().size(); s.delete(p); - s.delete(q); + s.delete(q); t.commit(); s.close(); @@ -197,16 +199,16 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { q.getChildren().add( new Child("bar1") ); q.getChildren().add( new Child("bar2") ); q.getMoreChildren().addAll( p.getChildren() ); - s.persist(p); + s.persist(p); s.persist(q); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); - + sessionFactory().getStatistics().clear(); - + List parents = s.createQuery("from Parent where name between ? and ? order by name desc") .setParameter(0, "bar") .setParameter(1, "foo") @@ -218,33 +220,33 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { assertFalse( Hibernate.isInitialized( q.getChildren() ) ); assertEquals( p.getChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( p.getChildren().iterator().next() ) ); - + assertTrue( Hibernate.isInitialized( q.getChildren() ) ); - + assertEquals( q.getChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( q.getChildren().iterator().next() ) ); - + assertFalse( Hibernate.isInitialized( p.getMoreChildren() ) ); assertFalse( Hibernate.isInitialized( q.getMoreChildren() ) ); assertEquals( p.getMoreChildren().size(), 0 ); - + assertTrue( Hibernate.isInitialized( q.getMoreChildren() ) ); - + assertEquals( q.getMoreChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( q.getMoreChildren().iterator().next() ) ); - + assertEquals( 3, sessionFactory().getStatistics().getPrepareStatementCount() ); Child c = (Child) p.getChildren().get(0); c.getFriends().size(); s.delete(p); - s.delete(q); + s.delete(q); t.commit(); s.close(); @@ -262,17 +264,17 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { q.getChildren().add( new Child("bar2") ); Parent r = new Parent("aaa"); r.getChildren().add( new Child("aaa1") ); - s.persist(p); + s.persist(p); s.persist(q); s.persist(r); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); - + sessionFactory().getStatistics().clear(); - + List parents = s.createQuery("from Parent order by name desc") .setMaxResults(2) .list(); @@ -286,9 +288,9 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { assertEquals( p.getChildren().size(), 2 ); assertTrue( Hibernate.isInitialized( q.getChildren() ) ); assertTrue( Hibernate.isInitialized( q.getMoreChildren() ) ); - + assertEquals( 3, sessionFactory().getStatistics().getPrepareStatementCount() ); - + r = (Parent) s.get( Parent.class, r.getName() ); assertTrue( Hibernate.isInitialized( r.getChildren() ) ); assertFalse( Hibernate.isInitialized( r.getMoreChildren() ) ); @@ -296,9 +298,9 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { assertEquals( r.getMoreChildren().size(), 0 ); s.delete(p); - s.delete(q); + s.delete(q); s.delete(r); - + t.commit(); s.close(); } @@ -314,14 +316,14 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { q.getChildren().add( new Child("bar1") ); q.getChildren().add( new Child("bar2") ); q.getMoreChildren().addAll( p.getChildren() ); - s.persist(p); + s.persist(p); s.persist(q); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); - + List parents = s.createCriteria(Parent.class) .createCriteria("moreChildren") .createCriteria("friends") @@ -352,16 +354,16 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { q.getChildren().add( new Child("bar1") ); q.getChildren().add( new Child("bar2") ); q.getMoreChildren().addAll( p.getChildren() ); - s.persist(p); + s.persist(p); s.persist(q); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); - + sessionFactory().getStatistics().clear(); - + List parents = s.createCriteria(Parent.class) .add( Property.forName("name").between("bar", "foo") ) .addOrder( Order.desc("name") ) @@ -373,33 +375,33 @@ public class SubselectFetchTest extends BaseCoreFunctionalTestCase { assertFalse( Hibernate.isInitialized( q.getChildren() ) ); assertEquals( p.getChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( p.getChildren().iterator().next() ) ); - + assertTrue( Hibernate.isInitialized( q.getChildren() ) ); - + assertEquals( q.getChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( q.getChildren().iterator().next() ) ); - + assertFalse( Hibernate.isInitialized( p.getMoreChildren() ) ); assertFalse( Hibernate.isInitialized( q.getMoreChildren() ) ); assertEquals( p.getMoreChildren().size(), 0 ); - + assertTrue( Hibernate.isInitialized( q.getMoreChildren() ) ); - + assertEquals( q.getMoreChildren().size(), 2 ); - + assertTrue( Hibernate.isInitialized( q.getMoreChildren().iterator().next() ) ); - + assertEquals( 3, sessionFactory().getStatistics().getPrepareStatementCount() ); Child c = (Child) p.getChildren().get(0); c.getFriends().size(); s.delete(p); - s.delete(q); + s.delete(q); t.commit(); s.close(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/ternary/TernaryTest.java b/hibernate-core/src/test/java/org/hibernate/test/ternary/TernaryTest.java index d850a4f4f7..c7f49ec17f 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/ternary/TernaryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/ternary/TernaryTest.java @@ -35,6 +35,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -45,6 +46,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class TernaryTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -77,7 +79,7 @@ public class TernaryTest extends BaseCoreFunctionalTestCase { tim.getManagerBySite().put(melb, tom); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); tom = (Employee) s.get(Employee.class, "Tom"); @@ -91,7 +93,7 @@ public class TernaryTest extends BaseCoreFunctionalTestCase { assertTrue( melb.getEmployees().contains(bob) ); assertTrue( melb.getManagers().contains(tom) ); t.commit(); - s.close(); + s.close(); s = openSession(); t = s.beginTransaction(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/tm/CMTTest.java b/hibernate-core/src/test/java/org/hibernate/test/tm/CMTTest.java index 168c7e456f..7da313fe8a 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/tm/CMTTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/tm/CMTTest.java @@ -40,6 +40,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.criterion.Order; import org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory; import org.hibernate.testing.DialectChecks; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.jta.TestingJtaBootstrap; import org.hibernate.testing.jta.TestingJtaPlatformImpl; @@ -54,6 +55,7 @@ import static org.junit.Assert.fail; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class CMTTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-core/src/test/java/org/hibernate/test/typedescriptor/ByteTest.java b/hibernate-core/src/test/java/org/hibernate/test/typedescriptor/ByteTest.java index b2a467b369..ef54175bff 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/typedescriptor/ByteTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/typedescriptor/ByteTest.java @@ -28,6 +28,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -46,6 +47,7 @@ public class ByteTest extends BaseCoreFunctionalTestCase { @Test @TestForIssue( jiraKey = "HHH-6533" ) + @FailureExpectedWithNewMetamodel public void testByteDataPersistenceAndRetrieval() { Session session = openSession(); Transaction transaction = session.beginTransaction(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/typedescriptor/CharInNativeQueryTest.java b/hibernate-core/src/test/java/org/hibernate/test/typedescriptor/CharInNativeQueryTest.java index 1a8548af7b..ccdbc45924 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/typedescriptor/CharInNativeQueryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/typedescriptor/CharInNativeQueryTest.java @@ -26,6 +26,7 @@ import org.junit.Test; import org.hibernate.Session; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -45,6 +46,7 @@ public class CharInNativeQueryTest extends BaseCoreFunctionalTestCase { } @Test @TestForIssue(jiraKey = "HHH-2304") + @FailureExpectedWithNewMetamodel public void testNativeQuery() { Issue issue = new Issue(); issue.setIssueNumber( "HHH-2304" ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/typedmanytoone/TypedManyToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/typedmanytoone/TypedManyToOneTest.java index 8ecd2d3ab0..44bf8eab75 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/typedmanytoone/TypedManyToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/typedmanytoone/TypedManyToOneTest.java @@ -30,6 +30,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -40,7 +41,9 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class TypedManyToOneTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "typedmanytoone/Customer.hbm.xml" }; } @@ -50,7 +53,7 @@ public class TypedManyToOneTest extends BaseCoreFunctionalTestCase { Customer cust = new Customer(); cust.setCustomerId("abc123"); cust.setName("Matt"); - + Address ship = new Address(); ship.setStreet("peachtree rd"); ship.setState("GA"); @@ -58,7 +61,7 @@ public class TypedManyToOneTest extends BaseCoreFunctionalTestCase { ship.setZip("30326"); ship.setAddressId( new AddressId("SHIPPING", "xyz123") ); ship.setCustomer(cust); - + Address bill = new Address(); bill.setStreet("peachtree rd"); bill.setState("GA"); @@ -66,16 +69,16 @@ public class TypedManyToOneTest extends BaseCoreFunctionalTestCase { bill.setZip("30326"); bill.setAddressId( new AddressId("BILLING", "xyz123") ); bill.setCustomer(cust); - + cust.setBillingAddress(bill); cust.setShippingAddress(ship); - + Session s = openSession(); Transaction t = s.beginTransaction(); s.persist(cust); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); List results = s.createQuery("from Customer cust left join fetch cust.billingAddress where cust.customerId='abc123'").list(); @@ -89,7 +92,7 @@ public class TypedManyToOneTest extends BaseCoreFunctionalTestCase { assertEquals( "SHIPPING", cust.getShippingAddress().getAddressId().getType() ); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); s.saveOrUpdate(cust); @@ -108,13 +111,13 @@ public class TypedManyToOneTest extends BaseCoreFunctionalTestCase { Customer cust = new Customer(); cust.setCustomerId("xyz123"); cust.setName("Matt"); - + Session s = openSession(); Transaction t = s.beginTransaction(); s.persist(cust); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); List results = s.createQuery("from Customer cust left join fetch cust.billingAddress where cust.customerId='xyz123'").list(); @@ -125,7 +128,7 @@ public class TypedManyToOneTest extends BaseCoreFunctionalTestCase { s.delete( cust ); t.commit(); s.close(); - + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/typedonetoone/TypedOneToOneTest.java b/hibernate-core/src/test/java/org/hibernate/test/typedonetoone/TypedOneToOneTest.java index 9c23cd3df1..097ed22ef0 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/typedonetoone/TypedOneToOneTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/typedonetoone/TypedOneToOneTest.java @@ -30,6 +30,7 @@ import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -39,6 +40,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class TypedOneToOneTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -50,7 +52,7 @@ public class TypedOneToOneTest extends BaseCoreFunctionalTestCase { Customer cust = new Customer(); cust.setCustomerId("abc123"); cust.setName("Matt"); - + Address ship = new Address(); ship.setStreet("peachtree rd"); ship.setState("GA"); @@ -58,7 +60,7 @@ public class TypedOneToOneTest extends BaseCoreFunctionalTestCase { ship.setZip("30326"); ship.setAddressId( new AddressId("SHIPPING", "abc123") ); ship.setCustomer(cust); - + Address bill = new Address(); bill.setStreet("peachtree rd"); bill.setState("GA"); @@ -66,16 +68,16 @@ public class TypedOneToOneTest extends BaseCoreFunctionalTestCase { bill.setZip("30326"); bill.setAddressId( new AddressId("BILLING", "abc123") ); bill.setCustomer(cust); - + cust.setBillingAddress(bill); cust.setShippingAddress(ship); - + Session s = openSession(); Transaction t = s.beginTransaction(); s.persist(cust); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); List results = s.createQuery("from Customer cust left join fetch cust.billingAddress where cust.customerId='abc123'").list(); @@ -97,13 +99,13 @@ public class TypedOneToOneTest extends BaseCoreFunctionalTestCase { Customer cust = new Customer(); cust.setCustomerId("xyz123"); cust.setName("Matt"); - + Session s = openSession(); Transaction t = s.beginTransaction(); s.persist(cust); t.commit(); s.close(); - + s = openSession(); t = s.beginTransaction(); List results = s.createQuery("from Customer cust left join fetch cust.billingAddress where cust.customerId='xyz123'").list(); @@ -114,7 +116,7 @@ public class TypedOneToOneTest extends BaseCoreFunctionalTestCase { s.delete(cust); t.commit(); s.close(); - + } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/typeparameters/TypeParameterTest.java b/hibernate-core/src/test/java/org/hibernate/test/typeparameters/TypeParameterTest.java index b05e926f06..8a13e5a52f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/typeparameters/TypeParameterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/typeparameters/TypeParameterTest.java @@ -33,6 +33,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.jdbc.Work; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -40,10 +41,12 @@ import static org.junit.Assert.assertTrue; /** * Test for parameterizable types. - * + * * @author Michael Gloegl */ +@FailureExpectedWithNewMetamodel public class TypeParameterTest extends BaseCoreFunctionalTestCase { + @Override public String[] getMappings() { return new String[] { "typeparameters/Typedef.hbm.xml", @@ -109,7 +112,7 @@ public class TypeParameterTest extends BaseCoreFunctionalTestCase { assertEquals("Default value incorrectly loaded", obj.getValueThree(), -1); assertEquals("Default value incorrectly loaded", obj.getValueFour(), -5); - + t.commit(); s.close(); deleteData(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/unconstrained/UnconstrainedTest.java b/hibernate-core/src/test/java/org/hibernate/test/unconstrained/UnconstrainedTest.java index da743cba94..78c4e65d2b 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/unconstrained/UnconstrainedTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/unconstrained/UnconstrainedTest.java @@ -30,6 +30,7 @@ import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Restrictions; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertNotNull; @@ -39,6 +40,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class UnconstrainedTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -54,9 +56,9 @@ public class UnconstrainedTest extends BaseCoreFunctionalTestCase { session.persist(p); tx.commit(); session.close(); - + sessionFactory().getCache().evictEntityRegion( Person.class ); - + session = openSession(); tx = session.beginTransaction(); p = (Person) session.get(Person.class, "gavin"); @@ -66,7 +68,7 @@ public class UnconstrainedTest extends BaseCoreFunctionalTestCase { session.close(); sessionFactory().getCache().evictEntityRegion( Person.class ); - + session = openSession(); tx = session.beginTransaction(); p = (Person) session.get(Person.class, "gavin"); @@ -86,9 +88,9 @@ public class UnconstrainedTest extends BaseCoreFunctionalTestCase { session.persist(p); tx.commit(); session.close(); - + sessionFactory().getCache().evictEntityRegion( Person.class ); - + session = openSession(); tx = session.beginTransaction(); p = (Person) session.createCriteria(Person.class) @@ -101,7 +103,7 @@ public class UnconstrainedTest extends BaseCoreFunctionalTestCase { session.close(); sessionFactory().getCache().evictEntityRegion( Person.class ); - + session = openSession(); tx = session.beginTransaction(); p = (Person) session.createCriteria(Person.class) @@ -124,7 +126,7 @@ public class UnconstrainedTest extends BaseCoreFunctionalTestCase { session.persist(p); tx.commit(); session.close(); - + session = openSession(); tx = session.beginTransaction(); p = (Person) session.get(Person.class, "gavin"); diff --git a/hibernate-core/src/test/java/org/hibernate/test/unionsubclass/UnionSubclassTest.java b/hibernate-core/src/test/java/org/hibernate/test/unionsubclass/UnionSubclassTest.java index 1708acbe90..92c69abce3 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/unionsubclass/UnionSubclassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/unionsubclass/UnionSubclassTest.java @@ -34,6 +34,7 @@ import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Order; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -45,6 +46,7 @@ import static org.junit.Assert.assertTrue; /** * @author Gavin King */ +@FailureExpectedWithNewMetamodel public class UnionSubclassTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { @@ -57,16 +59,16 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { Transaction t = s.beginTransaction(); Location mel = new Location("Earth"); s.save(mel); - + Human gavin = new Human(); gavin.setIdentity("gavin"); gavin.setSex('M'); gavin.setLocation(mel); mel.addBeing(gavin); - + gavin.getInfo().put("foo", "bar"); gavin.getInfo().put("x", "y"); - + t.commit(); s.close(); @@ -86,7 +88,7 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { Transaction t = s.beginTransaction(); Location mel = new Location("Earth"); s.save(mel); - + Human gavin = new Human(); gavin.setIdentity("gavin"); gavin.setSex('M'); @@ -97,15 +99,15 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { max.setSex('M'); max.setLocation(mel); mel.addBeing(gavin); - + s.flush(); s.clear(); - + List list = s.createCriteria(Human.class) .setFetchMode("location", FetchMode.JOIN) .setFetchMode("location.beings", FetchMode.JOIN) .list(); - + for (int i=0; i */ @TestForIssue( jiraKey = "HHH-4825" ) +@FailureExpectedWithNewMetamodel public class SellCarTest extends BaseCoreFunctionalTestCase { - public String[] getMappings() { + @Override + public String[] getMappings() { return new String[] { "unionsubclass/alias/mapping.hbm.xml" }; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/unionsubclass2/UnionSubclassTest.java b/hibernate-core/src/test/java/org/hibernate/test/unionsubclass2/UnionSubclassTest.java index 813cc134f8..a4e9121624 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/unionsubclass2/UnionSubclassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/unionsubclass2/UnionSubclassTest.java @@ -34,6 +34,7 @@ import org.hibernate.Transaction; import org.hibernate.criterion.Property; import org.hibernate.criterion.Restrictions; import org.hibernate.dialect.HSQLDialect; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -45,7 +46,9 @@ import static org.junit.Assert.assertTrue; * @author Gavin King */ @SuppressWarnings( {"UnnecessaryBoxing"}) +@FailureExpectedWithNewMetamodel public class UnionSubclassTest extends BaseCoreFunctionalTestCase { + @Override protected String[] getMappings() { return new String[] { "unionsubclass2/Person.hbm.xml" }; } @@ -54,7 +57,7 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { public void testUnionSubclass() { Session s = openSession(); Transaction t = s.beginTransaction(); - + Employee mark = new Employee(); mark.setName("Mark"); mark.setTitle("internal sales"); @@ -62,7 +65,7 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { mark.setAddress("buckhead"); mark.setZip("30305"); mark.setCountry("USA"); - + Customer joe = new Customer(); joe.setName("Joe"); joe.setAddress("San Francisco"); @@ -71,17 +74,17 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { joe.setComments("Very demanding"); joe.setSex('M'); joe.setSalesperson(mark); - + Person yomomma = new Person(); yomomma.setName("mum"); yomomma.setSex('F'); - + s.save(yomomma); s.save(mark); s.save(joe); - + assertEquals( s.createQuery("from java.io.Serializable").list().size(), 0 ); - + assertEquals( s.createQuery("from Person").list().size(), 3 ); assertEquals( s.createQuery("from Person p where p.class = Customer").list().size(), 1 ); assertEquals( s.createQuery("from Person p where p.class = Person").list().size(), 1 ); @@ -97,7 +100,7 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { } assertEquals( customers.size(), 1 ); s.clear(); - + customers = s.createQuery("from Customer").list(); for ( Object customer : customers ) { Customer c = (Customer) customer; @@ -106,18 +109,18 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { } assertEquals( customers.size(), 1 ); s.clear(); - + mark = (Employee) s.get( Employee.class, Long.valueOf( mark.getId() ) ); joe = (Customer) s.get( Customer.class, Long.valueOf( joe.getId() ) ); - + mark.setZip("30306"); assertEquals( s.createQuery("from Person p where p.address.zip = '30306'").list().size(), 1 ); s.createCriteria( Person.class ).add( Restrictions.in( "address", new Address[] { mark.getAddress(), joe.getAddress() } ) ).list(); - + s.delete(mark); s.delete(joe); s.delete(yomomma); @@ -131,7 +134,7 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { if ( getDialect() instanceof HSQLDialect ) { return; // TODO : why?? } - + Session s = openSession(); Transaction t = s.beginTransaction(); Person p = new Person(); @@ -148,9 +151,9 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { List result = s.createQuery("from Person where salary > 100").list(); assertEquals( result.size(), 1 ); assertSame( result.get(0), q ); - + result = s.createQuery("from Person where salary > 100 or name like 'E%'").list(); - assertEquals( result.size(), 2 ); + assertEquals( result.size(), 2 ); result = s.createCriteria(Person.class) .add( Property.forName("salary").gt( new BigDecimal(100) ) ) @@ -161,7 +164,7 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { result = s.createQuery("select salary from Person where salary > 100").list(); assertEquals( result.size(), 1 ); assertEquals( ( (BigDecimal) result.get(0) ).intValue(), 1000 ); - + s.delete(p); s.delete(q); t.commit(); @@ -184,11 +187,11 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { Employee e = new Employee(); e.setName("Steve"); e.setSex('M'); - e.setTitle("Mr"); + e.setTitle("Mr"); e.setPasswordExpiryDays(PASSWORD_EXPIRY_DAYS); s.persist(e); s.flush(); - + // Test value conversion during insert // Value returned by Oracle native query is a Types.NUMERIC, which is mapped to a BigDecimalType; // Cast returned value to Number then call Number.doubleValue() so it works on all dialects. @@ -201,13 +204,13 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { .uniqueResult() ).doubleValue(); assertEquals(PASSWORD_EXPIRY_WEEKS, expiryViaSql, 0.01d); - + // Test projection Double heightViaHql = (Double)s.createQuery("select p.heightInches from Person p where p.name = 'Emmanuel'").uniqueResult(); assertEquals(HEIGHT_INCHES, heightViaHql, 0.01d); Double expiryViaHql = (Double)s.createQuery("select e.passwordExpiryDays from Employee e where e.name = 'Steve'").uniqueResult(); assertEquals(PASSWORD_EXPIRY_DAYS, expiryViaHql, 0.01d); - + // Test restriction and entity load via criteria p = (Person)s.createCriteria(Person.class) .add(Restrictions.between("heightInches", HEIGHT_INCHES - 0.01d, HEIGHT_INCHES + 0.01d)) @@ -217,7 +220,7 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { .add(Restrictions.between("passwordExpiryDays", PASSWORD_EXPIRY_DAYS - 0.01d, PASSWORD_EXPIRY_DAYS + 0.01d)) .uniqueResult(); assertEquals(PASSWORD_EXPIRY_DAYS, e.getPasswordExpiryDays(), 0.01d); - + // Test predicate and entity load via HQL p = (Person)s.createQuery("from Person p where p.heightInches between ? and ?") .setDouble(0, HEIGHT_INCHES - 0.01d) @@ -229,7 +232,7 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { .setDouble(1, PASSWORD_EXPIRY_DAYS + 0.01d) .uniqueResult(); assertEquals(PASSWORD_EXPIRY_DAYS, e.getPasswordExpiryDays(), 0.01d); - + // Test update p.setHeightInches(1); e.setPasswordExpiryDays(7); @@ -248,9 +251,9 @@ public class UnionSubclassTest extends BaseCoreFunctionalTestCase { s.delete(e); t.commit(); s.close(); - + } - - + + } diff --git a/hibernate-core/src/test/java/org/hibernate/test/version/db/DbVersionTest.java b/hibernate-core/src/test/java/org/hibernate/test/version/db/DbVersionTest.java index 428bac6989..6784bf2242 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/version/db/DbVersionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/version/db/DbVersionTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.type.StandardBasicTypes; @@ -38,6 +39,7 @@ import static org.junit.Assert.assertTrue; /** * @author Steve Ebersole */ +@FailureExpectedWithNewMetamodel public class DbVersionTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() { diff --git a/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/EhCacheRegionFactoryImpl.java b/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/EhCacheRegionFactoryImpl.java index ba599b4032..fdf217835b 100644 --- a/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/EhCacheRegionFactoryImpl.java +++ b/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/EhCacheRegionFactoryImpl.java @@ -6,10 +6,12 @@ import java.util.Map; import org.hibernate.cache.ehcache.EhCacheRegionFactory; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Alex Snaps */ +@FailureExpectedWithNewMetamodel public class EhCacheRegionFactoryImpl extends EhCacheTest { @Override diff --git a/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/EhCacheRegionTest.java b/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/EhCacheRegionTest.java index 7e81124210..dc4e369f8b 100644 --- a/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/EhCacheRegionTest.java +++ b/hibernate-ehcache/src/test/java/org/hibernate/test/cache/ehcache/EhCacheRegionTest.java @@ -6,10 +6,12 @@ import org.hibernate.cache.ehcache.EhCacheRegionFactory; import org.hibernate.cache.ehcache.internal.strategy.ItemValueExtractor; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; /** * @author Alex Snaps */ +@FailureExpectedWithNewMetamodel public class EhCacheRegionTest extends EhCacheTest { @Override protected void configCache(final Configuration cfg) { diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/merge/AddDelTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/merge/AddDelTest.java index 57f464138e..ae5d7e69c5 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/merge/AddDelTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/merge/AddDelTest.java @@ -9,6 +9,7 @@ import org.junit.Test; import org.hibernate.envers.test.BaseEnversFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; /** @@ -23,6 +24,7 @@ public class AddDelTest extends BaseEnversFunctionalTestCase { @Test @Priority(10) + @FailureExpectedWithNewMetamodel public void initData() { // Revision 1 Session session = openSession(); @@ -51,6 +53,7 @@ public class AddDelTest extends BaseEnversFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testRevisionsCountOfGivenIdStrEntity() { // Revision 2 has not changed entity's state. Assert.assertEquals(Arrays.asList(1, 3), getAuditReader().getRevisions(GivenIdStrEntity.class, 1)); @@ -59,6 +62,7 @@ public class AddDelTest extends BaseEnversFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testHistoryOfGivenIdStrEntity() { Assert.assertEquals(new GivenIdStrEntity(1, "data"), getAuditReader().find(GivenIdStrEntity.class, 1, 1)); Assert.assertEquals(new GivenIdStrEntity(1, "modified data"), getAuditReader().find(GivenIdStrEntity.class, 1, 3)); diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java index 49d435e382..48f7cfd798 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/proxy/QueryingWithProxyObjectTest.java @@ -1,16 +1,15 @@ package org.hibernate.envers.test.integration.proxy; -import java.net.URISyntaxException; import java.util.Arrays; import java.util.List; import org.junit.Assert; import org.junit.Test; -import org.hibernate.MappingException; import org.hibernate.envers.test.BaseEnversFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; /** @@ -26,6 +25,7 @@ public class QueryingWithProxyObjectTest extends BaseEnversFunctionalTestCase { @Test @Priority(10) + @FailureExpectedWithNewMetamodel public void initData() { // Revision 1 getSession().getTransaction().begin(); @@ -39,6 +39,7 @@ public class QueryingWithProxyObjectTest extends BaseEnversFunctionalTestCase { @Test @TestForIssue(jiraKey="HHH-4760") @SuppressWarnings("unchecked") + @FailureExpectedWithNewMetamodel public void testQueryingWithProxyObject() { StrTestEntity originalSte = new StrTestEntity("data", id); // Load the proxy instance diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java index 5b9a1476b4..2654aec25c 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/tools/SchemaExportTest.java @@ -4,6 +4,7 @@ import org.hibernate.Session; import org.hibernate.envers.test.BaseEnversFunctionalTestCase; import org.hibernate.envers.test.Priority; import org.hibernate.envers.test.entities.StrTestEntity; +import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.TestForIssue; import org.hibernate.tool.EnversSchemaGenerator; import org.junit.Assert; @@ -23,12 +24,14 @@ public class SchemaExportTest extends BaseEnversFunctionalTestCase { return new Class[] {StrTestEntity.class}; } + @Override protected boolean createSchema() { // Disable schema auto generation. return false; } @Test @Priority(10) + @FailureExpectedWithNewMetamodel public void testSchemaCreation() { // Generate complete schema. new EnversSchemaGenerator(configuration()).export().create( true, true ); @@ -45,6 +48,7 @@ public class SchemaExportTest extends BaseEnversFunctionalTestCase { @Test @Priority(9) + @FailureExpectedWithNewMetamodel public void testAuditDataRetrieval() { Assert.assertEquals(Arrays.asList(1), getAuditReader().getRevisions(StrTestEntity.class, id)); Assert.assertEquals(new StrTestEntity("data", id), getAuditReader().find(StrTestEntity.class, id, 1));