From c73162270a5f9a15c80b4d25811e312c554781a8 Mon Sep 17 00:00:00 2001 From: brmeyer Date: Tue, 2 Oct 2012 10:44:20 -0400 Subject: [PATCH] HHH-7664 5.0.0 unit test clean-up --- .../test/annotations/access/AccessTest.java | 17 +++++------------ .../dataTypes/BasicOperationsTest.java | 11 ++++------- .../test/annotations/fetch/FetchingTest.java | 3 ++- .../fetchprofile/MoreFetchProfileTest.java | 9 +++------ .../test/collection/bag/PersistentBagTest.java | 11 ++++------- .../collection/list/PersistentListTest.java | 13 +++++-------- .../dirtiness/CustomDirtinessStrategyTest.java | 2 +- .../CollectionReattachmentTest.java | 6 +----- .../reattachment/ProxyReattachmentTest.java | 9 +++------ .../sql/autodiscovery/AutoDiscoveryTest.java | 11 ++++------- .../test/typeparameters/TypeParameterTest.java | 11 ++++------- 11 files changed, 36 insertions(+), 67 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/access/AccessTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/access/AccessTest.java index b760352a4b..91d003e915 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/access/AccessTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/access/AccessTest.java @@ -23,25 +23,22 @@ */ package org.hibernate.test.annotations.access; -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; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; +import org.junit.Test; + /** * @author Emmanuel Bernard */ public class AccessTest extends BaseCoreFunctionalTestCase { @Test - @FailureExpectedWithNewMetamodel public void testSuperclassOverriding() throws Exception { Furniture fur = new Furniture(); fur.setColor( "Black" ); @@ -62,7 +59,6 @@ public class AccessTest extends BaseCoreFunctionalTestCase { } @Test - @FailureExpectedWithNewMetamodel public void testSuperclassNonOverriding() throws Exception { Furniture fur = new Furniture(); fur.setGod( "Buddha" ); @@ -80,7 +76,6 @@ public class AccessTest extends BaseCoreFunctionalTestCase { } @Test - @FailureExpectedWithNewMetamodel public void testPropertyOverriding() throws Exception { Furniture fur = new Furniture(); fur.weight = 3; @@ -98,7 +93,6 @@ public class AccessTest extends BaseCoreFunctionalTestCase { } @Test - @FailureExpectedWithNewMetamodel public void testNonOverridenSubclass() throws Exception { Chair chair = new Chair(); chair.setPillow( "Blue" ); @@ -116,7 +110,6 @@ public class AccessTest extends BaseCoreFunctionalTestCase { } @Test - @FailureExpectedWithNewMetamodel public void testOverridenSubclass() throws Exception { BigBed bed = new BigBed(); bed.size = 5; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/dataTypes/BasicOperationsTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/dataTypes/BasicOperationsTest.java index 7f77739c18..1676b268a7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/dataTypes/BasicOperationsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/dataTypes/BasicOperationsTest.java @@ -23,6 +23,9 @@ */ package org.hibernate.test.annotations.dataTypes; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; @@ -30,27 +33,21 @@ import java.sql.SQLException; import java.sql.Statement; import java.util.Date; -import org.junit.Test; - import org.hibernate.Session; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.Oracle8iDialect; import org.hibernate.jdbc.Work; import org.hibernate.testing.DialectCheck; import org.hibernate.testing.DialectChecks; -import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.type.descriptor.JdbcTypeNameMapper; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import org.junit.Test; /** * @author Steve Ebersole */ @RequiresDialectFeature(value = {DialectChecks.SupportsExpectedLobUsagePattern.class, BasicOperationsTest.OracleDialectChecker.class}, jiraKey = "HHH-6834") -@FailureExpectedWithNewMetamodel public class BasicOperationsTest extends BaseCoreFunctionalTestCase { private static final String SOME_ENTITY_TABLE_NAME = "SOMEENTITY"; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/fetch/FetchingTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/fetch/FetchingTest.java index b69d226c1b..973df5c223 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/fetch/FetchingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/fetch/FetchingTest.java @@ -40,7 +40,6 @@ import static org.junit.Assert.assertTrue; /** * @author Emmanuel Bernard */ -@FailureExpectedWithNewMetamodel public class FetchingTest extends BaseCoreFunctionalTestCase { @Test public void testLazy() throws Exception { @@ -64,6 +63,7 @@ public class FetchingTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testExtraLazy() throws Exception { Session s; Transaction tx; @@ -89,6 +89,7 @@ public class FetchingTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testHibernateFetchingLazy() throws Exception { Session s; Transaction tx; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/fetchprofile/MoreFetchProfileTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/fetchprofile/MoreFetchProfileTest.java index e6dfb0bbb1..35ca21ad00 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/fetchprofile/MoreFetchProfileTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/fetchprofile/MoreFetchProfileTest.java @@ -24,23 +24,20 @@ */ package org.hibernate.test.annotations.fetchprofile; -import java.util.Date; +import static org.junit.Assert.assertTrue; -import org.junit.Test; +import java.util.Date; 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.assertTrue; +import org.junit.Test; /** * @author Emmanuel Bernard * @author Hardy Ferentschik */ -@FailureExpectedWithNewMetamodel public class MoreFetchProfileTest extends BaseCoreFunctionalTestCase { @Test public void testFetchWithTwoOverrides() throws Exception { 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 7e493039f6..ac01a7054d 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 @@ -22,17 +22,15 @@ * Boston, MA 02110-1301 USA */ package org.hibernate.test.collection.bag; -import java.util.ArrayList; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; -import org.junit.Test; +import java.util.ArrayList; 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; -import static org.junit.Assert.assertTrue; +import org.junit.Test; /** * Tests related to operations on a PersistentBag. @@ -46,7 +44,6 @@ 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/list/PersistentListTest.java b/hibernate-core/src/test/java/org/hibernate/test/collection/list/PersistentListTest.java index 96cd22ef62..009cfc363c 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 @@ -23,6 +23,10 @@ */ package org.hibernate.test.collection.list; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -31,8 +35,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; -import org.junit.Test; - import org.hibernate.Session; import org.hibernate.collection.internal.PersistentList; import org.hibernate.jdbc.Work; @@ -40,13 +42,9 @@ 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; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import org.junit.Test; /** * Tests related to operations on a PersistentList @@ -122,7 +120,6 @@ 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/dirtiness/CustomDirtinessStrategyTest.java b/hibernate-core/src/test/java/org/hibernate/test/dirtiness/CustomDirtinessStrategyTest.java index fe119482d0..3e58cb2f82 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 @@ -40,7 +40,6 @@ 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"; @@ -57,6 +56,7 @@ public class CustomDirtinessStrategyTest extends BaseCoreFunctionalTestCase { } @Test + @FailureExpectedWithNewMetamodel public void testOnlyCustomStrategy() { Session session = openSession(); session.beginTransaction(); 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 fe61ba4a2e..3f1bd50816 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 @@ -23,11 +23,9 @@ */ package org.hibernate.test.reattachment; -import org.junit.Test; - import org.hibernate.Session; -import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; +import org.junit.Test; /** * Test of collection reattachment semantics @@ -41,7 +39,6 @@ public class CollectionReattachmentTest extends BaseCoreFunctionalTestCase { } @Test - @FailureExpectedWithNewMetamodel public void testUpdateOwnerAfterClear() { Session s = openSession(); s.beginTransaction(); @@ -69,7 +66,6 @@ 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 41d997bd67..073b9557ae 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 @@ -23,17 +23,16 @@ */ package org.hibernate.test.reattachment; +import static org.junit.Assert.assertEquals; + import java.util.HashSet; import java.util.Iterator; 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; +import org.junit.Test; /** * Test of proxy reattachment semantics @@ -47,7 +46,6 @@ public class ProxyReattachmentTest extends BaseCoreFunctionalTestCase { } @Test - @FailureExpectedWithNewMetamodel public void testUpdateAfterEvict() { Session s = openSession(); s.beginTransaction(); @@ -74,7 +72,6 @@ public class ProxyReattachmentTest extends BaseCoreFunctionalTestCase { } @Test - @FailureExpectedWithNewMetamodel public void testUpdateAfterClear() { Session s = openSession(); s.beginTransaction(); 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 542eb3c003..90117aaaaa 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 @@ -23,6 +23,8 @@ */ package org.hibernate.test.sql.autodiscovery; +import static org.junit.Assert.assertEquals; + import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -30,21 +32,16 @@ import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util.List; -import org.junit.Assert; -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; +import org.junit.Assert; +import org.junit.Test; /** * @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/typeparameters/TypeParameterTest.java b/hibernate-core/src/test/java/org/hibernate/test/typeparameters/TypeParameterTest.java index 8a13e5a52f..0b006cbcac 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 @@ -23,28 +23,25 @@ */ package org.hibernate.test.typeparameters; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -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; -import static org.junit.Assert.assertTrue; +import org.junit.Test; /** * Test for parameterizable types. * * @author Michael Gloegl */ -@FailureExpectedWithNewMetamodel public class TypeParameterTest extends BaseCoreFunctionalTestCase { @Override public String[] getMappings() {