diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationAutoTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationAutoTest.java index fbd627d465..2aaf27d64e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationAutoTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationAutoTest.java @@ -31,8 +31,6 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; - -import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -41,12 +39,9 @@ import static org.junit.Assert.fail; /** * @author Emmanuel Bernard */ -@FailureExpectedWithNewMetamodel public class BeanValidationAutoTest extends BaseCoreFunctionalTestCase { @Test public void testListeners() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - CupHolder ch = new CupHolder(); ch.setRadius( new BigDecimal( "12" ) ); Session s = openSession(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationGroupsTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationGroupsTest.java index 3d54b358cf..26967e9853 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationGroupsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationGroupsTest.java @@ -34,7 +34,6 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; -import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -43,12 +42,9 @@ import static org.junit.Assert.fail; /** * @author Emmanuel Bernard */ -@FailureExpectedWithNewMetamodel public class BeanValidationGroupsTest extends BaseCoreFunctionalTestCase { @Test public void testListeners() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - CupHolder ch = new CupHolder(); ch.setRadius( new BigDecimal( "12" ) ); Session s = openSession(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationProvidedFactoryTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationProvidedFactoryTest.java index 72dc89c156..f6e9c28d7a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationProvidedFactoryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/BeanValidationProvidedFactoryTest.java @@ -35,7 +35,6 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; -import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -44,12 +43,9 @@ import static org.junit.Assert.fail; /** * @author Emmanuel Bernard */ -@FailureExpectedWithNewMetamodel public class BeanValidationProvidedFactoryTest extends BaseCoreFunctionalTestCase { @Test public void testListeners() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - CupHolder ch = new CupHolder(); ch.setRadius( new BigDecimal( "12" ) ); Session s = openSession(); @@ -89,8 +85,9 @@ public class BeanValidationProvidedFactoryTest extends BaseCoreFunctionalTestCas }; final javax.validation.Configuration configuration = Validation.byDefaultProvider().configure(); configuration.messageInterpolator( messageInterpolator ); - ValidatorFactory vf = configuration.buildValidatorFactory(); - cfg.getProperties().put( "javax.persistence.validation.factory", vf ); + ValidatorFactory validatorFactory = configuration.buildValidatorFactory(); + cfg.getProperties().put( "javax.persistence.validation.factory", validatorFactory ); + cfg.setProperty( "javax.persistence.validation.mode", "AUTO" ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/DDLWithoutCallbackTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/DDLWithoutCallbackTest.java index fc1bc5c89d..0a7b49f433 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/DDLWithoutCallbackTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/DDLWithoutCallbackTest.java @@ -34,7 +34,6 @@ import org.hibernate.metamodel.spi.binding.RelationalValueBinding; import org.hibernate.metamodel.spi.binding.SingularAttributeBinding; import org.hibernate.testing.DialectChecks; -import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.junit.Test; @@ -47,13 +46,10 @@ import static org.junit.Assert.fail; * @author Vladimir Klyushnikov * @author Hardy Ferentschik */ -@FailureExpectedWithNewMetamodel public class DDLWithoutCallbackTest extends BaseCoreFunctionalTestCase { @Test @RequiresDialectFeature(DialectChecks.SupportsColumnCheck.class) public void testListeners() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - CupHolder ch = new CupHolder(); ch.setRadius( new BigDecimal( "12" ) ); assertDatabaseConstraintViolationThrown( ch ); @@ -62,8 +58,6 @@ public class DDLWithoutCallbackTest extends BaseCoreFunctionalTestCase { @Test @RequiresDialectFeature(DialectChecks.SupportsColumnCheck.class) public void testMinAndMaxChecksGetApplied() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - MinMax minMax = new MinMax( 1 ); assertDatabaseConstraintViolationThrown( minMax ); @@ -82,8 +76,6 @@ public class DDLWithoutCallbackTest extends BaseCoreFunctionalTestCase { @Test @RequiresDialectFeature(DialectChecks.SupportsColumnCheck.class) public void testRangeChecksGetApplied() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - Range range = new Range( 1 ); assertDatabaseConstraintViolationThrown( range ); @@ -101,8 +93,6 @@ public class DDLWithoutCallbackTest extends BaseCoreFunctionalTestCase { @Test public void testDDLEnabled() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - EntityBinding eb = metadata().getEntityBinding( Address.class.getName() ); SingularAttributeBinding ab = (SingularAttributeBinding) eb.locateAttributeBinding( "country" ); assertEquals( 1, ab.getRelationalValueBindings().size() ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/HibernateTraversableResolverTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/HibernateTraversableResolverTest.java index 423a14236d..78cd3286dd 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/HibernateTraversableResolverTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/beanvalidation/HibernateTraversableResolverTest.java @@ -31,9 +31,7 @@ import org.junit.Test; import org.hibernate.Session; import org.hibernate.Transaction; -import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Configuration; -import org.hibernate.testing.FailureExpectedWithNewMetamodel; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.assertEquals; @@ -42,12 +40,9 @@ import static org.junit.Assert.fail; /** * @author Emmanuel Bernard */ -@FailureExpectedWithNewMetamodel public class HibernateTraversableResolverTest extends BaseCoreFunctionalTestCase { @Test public void testNonLazyAssocFieldWithConstraintsFailureExpected() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - Session s = openSession(); Transaction tx = s.beginTransaction(); @@ -68,8 +63,6 @@ public class HibernateTraversableResolverTest extends BaseCoreFunctionalTestCase @Test public void testEmbedded() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - Session s = openSession(); Transaction tx = s.beginTransaction(); @@ -99,8 +92,6 @@ public class HibernateTraversableResolverTest extends BaseCoreFunctionalTestCase @Test public void testToOneAssocNotValidated() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - Session s = openSession(); Transaction tx = s.beginTransaction(); @@ -126,8 +117,6 @@ public class HibernateTraversableResolverTest extends BaseCoreFunctionalTestCase @Test public void testCollectionAssocNotValidated() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - Session s = openSession(); Transaction tx = s.beginTransaction(); @@ -158,8 +147,6 @@ public class HibernateTraversableResolverTest extends BaseCoreFunctionalTestCase @Test public void testEmbeddedCollection() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - Session s = openSession(); Transaction tx = s.beginTransaction(); @@ -188,8 +175,6 @@ public class HibernateTraversableResolverTest extends BaseCoreFunctionalTestCase @Test public void testAssocInEmbeddedNotValidated() { - fail( "HARDY : needs the changes in BeanValidationIntegrator" ); - Session s = openSession(); Transaction tx = s.beginTransaction();