HHH-8960 Re-enabling Bean Validation tests

This commit is contained in:
Hardy Ferentschik 2014-02-12 20:05:24 +01:00
parent 77b497be98
commit 83e9ceb429
5 changed files with 3 additions and 40 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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" );
}
}

View File

@ -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() );

View File

@ -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();