HHH-7474: Added @FailureExpectedWithNewMetamodel annotation to more tests that fail with the new metamodel.
This commit is contained in:
parent
e3a606e3db
commit
0f77803b9c
|
@ -30,6 +30,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.fail;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
public class BeanValidationAutoTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testListeners() {
|
||||
CupHolder ch = new CupHolder();
|
||||
ch.setRadius( new BigDecimal( "12" ) );
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.hibernate.Transaction;
|
|||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.mapping.Column;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
@ -42,7 +43,9 @@ import static org.junit.Assert.fail;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
public class BeanValidationDisabledTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testListeners() {
|
||||
CupHolder ch = new CupHolder();
|
||||
ch.setRadius( new BigDecimal( "12" ) );
|
||||
|
@ -60,6 +63,7 @@ public class BeanValidationDisabledTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testDDLDisabled() {
|
||||
PersistentClass classMapping = configuration().getClassMapping( Address.class.getName() );
|
||||
Column countryColumn = (Column) classMapping.getProperty( "country" ).getColumnIterator().next();
|
||||
|
|
|
@ -34,6 +34,7 @@ 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,7 +44,9 @@ import static org.junit.Assert.fail;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
public class BeanValidationGroupsTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testListeners() {
|
||||
CupHolder ch = new CupHolder();
|
||||
ch.setRadius( new BigDecimal( "12" ) );
|
||||
|
@ -71,7 +74,7 @@ public class BeanValidationGroupsTest extends BaseCoreFunctionalTestCase {
|
|||
catch ( ConstraintViolationException e ) {
|
||||
assertEquals( 1, e.getConstraintViolations().size() );
|
||||
// TODO - seems this explicit case is necessary with JDK 5 (at least on Mac). With Java 6 there is no problem
|
||||
Annotation annotation = (Annotation) e.getConstraintViolations()
|
||||
Annotation annotation = e.getConstraintViolations()
|
||||
.iterator()
|
||||
.next()
|
||||
.getConstraintDescriptor()
|
||||
|
|
|
@ -35,6 +35,7 @@ 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,7 +45,9 @@ import static org.junit.Assert.fail;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
public class BeanValidationProvidedFactoryTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testListeners() {
|
||||
CupHolder ch = new CupHolder();
|
||||
ch.setRadius( new BigDecimal( "12" ) );
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.junit.Test;
|
|||
import org.hibernate.mapping.Column;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.mapping.Property;
|
||||
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 Emmanuel Bernard
|
||||
* @author Hardy Ferentschik
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DDLTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testBasicDDL() {
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.hibernate.cfg.Configuration;
|
|||
import org.hibernate.mapping.Column;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.testing.DialectChecks;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.RequiresDialectFeature;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
@ -45,8 +46,10 @@ import static org.junit.Assert.fail;
|
|||
* @author Hardy Ferentschik
|
||||
*/
|
||||
public class DDLWithoutCallbackTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Test
|
||||
@RequiresDialectFeature(DialectChecks.SupportsColumnCheck.class)
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testListeners() {
|
||||
CupHolder ch = new CupHolder();
|
||||
ch.setRadius( new BigDecimal( "12" ) );
|
||||
|
@ -55,6 +58,7 @@ public class DDLWithoutCallbackTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
@Test
|
||||
@RequiresDialectFeature(DialectChecks.SupportsColumnCheck.class)
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testMinAndMaxChecksGetApplied() {
|
||||
MinMax minMax = new MinMax( 1 );
|
||||
assertDatabaseConstraintViolationThrown( minMax );
|
||||
|
@ -73,6 +77,7 @@ public class DDLWithoutCallbackTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
@Test
|
||||
@RequiresDialectFeature(DialectChecks.SupportsColumnCheck.class)
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testRangeChecksGetApplied() {
|
||||
Range range = new Range( 1 );
|
||||
assertDatabaseConstraintViolationThrown( range );
|
||||
|
@ -90,6 +95,7 @@ public class DDLWithoutCallbackTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testDDLEnabled() {
|
||||
PersistentClass classMapping = configuration().getClassMapping( Address.class.getName() );
|
||||
Column countryColumn = (Column) classMapping.getProperty( "country" ).getColumnIterator().next();
|
||||
|
|
|
@ -32,6 +32,7 @@ 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;
|
||||
|
@ -40,6 +41,7 @@ import static org.junit.Assert.fail;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class HibernateTraversableResolverTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testNonLazyAssocFieldWithConstraintsFailureExpected() {
|
||||
|
|
|
@ -30,6 +30,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;
|
||||
|
@ -44,6 +45,7 @@ import static org.junit.Assert.assertNull;
|
|||
*
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class CascadeTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testPersist() {
|
||||
|
@ -166,7 +168,7 @@ public class CascadeTest extends BaseCoreFunctionalTestCase {
|
|||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
s.delete( s.get( Mouth.class, mouth.id ) );
|
||||
|
||||
|
||||
tx.commit();
|
||||
s.close();
|
||||
}
|
||||
|
|
|
@ -30,9 +30,10 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class CascadeToEmbeddedManyToOneTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Test
|
||||
|
@ -69,7 +70,7 @@ public class CascadeToEmbeddedManyToOneTest extends BaseCoreFunctionalTestCase {
|
|||
sess.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Class[] getAnnotatedClasses() {
|
||||
return new Class[]{
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.junit.Test;
|
|||
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.fail;
|
||||
|
@ -39,6 +40,7 @@ import static org.junit.Assert.fail;
|
|||
* @author Gail Badner
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class NonNullableCircularDependencyCascadeTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testIdClassInSuperclass() throws Exception {
|
||||
|
|
|
@ -27,11 +27,13 @@ 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.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
@RequiresDialectFeature(DialectChecks.SupportsIdentityColumns.class)
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class CascadeCircleIdentityIdTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-5472" )
|
||||
|
@ -47,28 +49,28 @@ public class CascadeCircleIdentityIdTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
a.getBCollection().add(b);
|
||||
b.setA(a);
|
||||
|
||||
|
||||
a.getCCollection().add(c);
|
||||
c.setA(a);
|
||||
|
||||
|
||||
b.getCCollection().add(c);
|
||||
c.setB(b);
|
||||
|
||||
|
||||
a.getDCollection().add(d);
|
||||
d.getACollection().add(a);
|
||||
|
||||
|
||||
d.getECollection().add(e);
|
||||
e.setF(f);
|
||||
|
||||
|
||||
f.getBCollection().add(b);
|
||||
b.setF(f);
|
||||
|
||||
|
||||
c.setG(g);
|
||||
g.getCCollection().add(c);
|
||||
|
||||
|
||||
f.setH(h);
|
||||
h.setG(g);
|
||||
|
||||
|
||||
Session s;
|
||||
s = openSession();
|
||||
s.getTransaction().begin();
|
||||
|
|
|
@ -27,11 +27,13 @@ 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.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
@RequiresDialectFeature(DialectChecks.SupportsSequences.class)
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class CascadeCircleSequenceIdTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-5472" )
|
||||
|
@ -47,28 +49,28 @@ public class CascadeCircleSequenceIdTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
a.getBCollection().add(b);
|
||||
b.setA(a);
|
||||
|
||||
|
||||
a.getCCollection().add(c);
|
||||
c.setA(a);
|
||||
|
||||
|
||||
b.getCCollection().add(c);
|
||||
c.setB(b);
|
||||
|
||||
|
||||
a.getDCollection().add(d);
|
||||
d.getACollection().add(a);
|
||||
|
||||
|
||||
d.getECollection().add(e);
|
||||
e.setF(f);
|
||||
|
||||
|
||||
f.getBCollection().add(b);
|
||||
b.setF(f);
|
||||
|
||||
|
||||
c.setG(g);
|
||||
g.getCCollection().add(c);
|
||||
|
||||
|
||||
f.setH(h);
|
||||
h.setG(g);
|
||||
|
||||
|
||||
Session s;
|
||||
s = openSession();
|
||||
s.getTransaction().begin();
|
||||
|
|
|
@ -30,6 +30,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;
|
||||
|
||||
|
@ -82,6 +83,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
|||
* c, e, d, b, g, f.
|
||||
*/
|
||||
@RequiresDialectFeature(DialectChecks.SupportsIdentityColumns.class)
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class MultiCircleJpaCascadeIdentityTest extends BaseCoreFunctionalTestCase {
|
||||
private B b;
|
||||
private C c;
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
/**
|
||||
|
@ -79,6 +80,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
|||
* Entities are inserted in the following order:
|
||||
* c, e, d, b, g, f.
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class MultiCircleJpaCascadeSequenceTest extends BaseCoreFunctionalTestCase {
|
||||
private B b;
|
||||
private C c;
|
||||
|
|
|
@ -30,6 +30,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;
|
||||
|
||||
|
@ -82,6 +83,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
|||
* c, e, d, b, g, f.
|
||||
*/
|
||||
@RequiresDialectFeature(DialectChecks.SupportsIdentityColumns.class)
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class MultiCircleNonJpaCascadeIdentityTest extends BaseCoreFunctionalTestCase {
|
||||
private B b;
|
||||
private C c;
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
/**
|
||||
|
@ -79,6 +80,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
|||
* Entities are inserted in the following order:
|
||||
* c, e, d, b, g, f.
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class MultiCircleNonJpaCascadeSequenceTest extends BaseCoreFunctionalTestCase {
|
||||
private B b;
|
||||
private C c;
|
||||
|
|
|
@ -35,6 +35,7 @@ import org.hibernate.Session;
|
|||
import org.hibernate.Transaction;
|
||||
import org.hibernate.criterion.Disjunction;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
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.assertNotNull;
|
|||
*
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class CompositeIdTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testOneToOneInCompositePk() throws Exception {
|
||||
|
@ -330,28 +332,28 @@ public class CompositeIdTest extends BaseCoreFunctionalTestCase {
|
|||
someEntity.getId().setVersion( 11 );
|
||||
someEntity.setProp( "aa" );
|
||||
s.persist( someEntity );
|
||||
|
||||
|
||||
someEntity = new SomeEntity();
|
||||
someEntity.setId( new SomeEntityId( ) );
|
||||
someEntity.getId().setId( 1 );
|
||||
someEntity.getId().setVersion( 12 );
|
||||
someEntity.setProp( "bb" );
|
||||
s.persist( someEntity );
|
||||
|
||||
|
||||
someEntity = new SomeEntity();
|
||||
someEntity.setId( new SomeEntityId( ) );
|
||||
someEntity.getId().setId( 10 );
|
||||
someEntity.getId().setVersion( 21 );
|
||||
someEntity.setProp( "cc1" );
|
||||
s.persist( someEntity );
|
||||
|
||||
|
||||
someEntity = new SomeEntity();
|
||||
someEntity.setId( new SomeEntityId( ) );
|
||||
someEntity.getId().setId( 10 );
|
||||
someEntity.getId().setVersion( 22 );
|
||||
someEntity.setProp( "cc2" );
|
||||
s.persist( someEntity );
|
||||
|
||||
|
||||
someEntity = new SomeEntity();
|
||||
someEntity.setId( new SomeEntityId( ) );
|
||||
someEntity.getId().setId( 10 );
|
||||
|
|
|
@ -26,6 +26,7 @@ package org.hibernate.test.annotations.cid.keymanytoone;
|
|||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
@ -36,6 +37,7 @@ import static org.junit.Assert.fail;
|
|||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class EagerKeyManyToOneTest extends BaseCoreFunctionalTestCase {
|
||||
public static final String CARD_ID = "cardId";
|
||||
public static final String KEY_ID = "keyId";
|
||||
|
|
|
@ -37,6 +37,7 @@ import org.hibernate.Transaction;
|
|||
import org.hibernate.mapping.Collection;
|
||||
import org.hibernate.mapping.Column;
|
||||
import org.hibernate.test.annotations.Country;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -48,6 +49,7 @@ import static org.junit.Assert.assertTrue;
|
|||
* @author Hardy Ferentschik
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class CollectionElementTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testSimpleElement() throws Exception {
|
||||
|
|
|
@ -31,8 +31,10 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class OrderByTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testOrderByName() throws Exception {
|
||||
|
|
|
@ -26,6 +26,7 @@ package org.hibernate.test.annotations.collectionelement.embeddables.withcustome
|
|||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
|
@ -33,6 +34,7 @@ import static junit.framework.Assert.assertEquals;
|
|||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class TestBasicOps extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
|
|
|
@ -26,6 +26,7 @@ package org.hibernate.test.annotations.collectionelement.indexedCollection;
|
|||
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;
|
||||
|
@ -33,6 +34,7 @@ import static org.junit.Assert.assertEquals;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IndexedCollectionOfElementsTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testIndexedCollectionOfElements() throws Exception {
|
||||
|
|
|
@ -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 ElementCollectionSortingTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
|
|
|
@ -38,6 +38,7 @@ 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;
|
||||
|
@ -49,6 +50,7 @@ import static org.junit.Assert.assertTrue;
|
|||
* @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";
|
||||
|
|
|
@ -26,10 +26,12 @@ package org.hibernate.test.annotations.derivedidentities.bidirectional;
|
|||
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;
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class CompositeDerivedIdentityTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.junit.Test;
|
|||
import org.hibernate.Query;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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 Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentitySimpleParentIdClassDepTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testManyToOne() throws Exception {
|
||||
|
@ -81,7 +83,7 @@ public class DerivedIdentitySimpleParentIdClassDepTest extends BaseCoreFunctiona
|
|||
Query query = s.createQuery("Select d from Dependent d where d.name='LittleP' and d.emp.empName='Paula'");
|
||||
List depList = query.list();
|
||||
assertEquals( 1, depList.size() );
|
||||
Object newDependent = (Dependent) depList.get(0);
|
||||
Object newDependent = depList.get(0);
|
||||
assertSame( d, newDependent );
|
||||
s.getTransaction().rollback();
|
||||
s.close();
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentitySimpleParentEmbeddedIdDepTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testManyToOne() throws Exception {
|
||||
|
|
|
@ -30,6 +30,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,6 +39,7 @@ import static org.junit.Assert.assertEquals;
|
|||
*
|
||||
* @author <a href="mailto:stale.pedersen@jboss.org">Stale W. Pedersen</a>
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IdMapManyToOneSpecjTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
public IdMapManyToOneSpecjTest() {
|
||||
|
@ -83,7 +85,7 @@ public class IdMapManyToOneSpecjTest extends BaseCoreFunctionalTestCase {
|
|||
c1.addInventory( house, 100, new BigDecimal( 50000 ) );
|
||||
s.merge( c1 );
|
||||
tx.commit();
|
||||
|
||||
|
||||
|
||||
tx = s.beginTransaction();
|
||||
Customer c12 = ( Customer ) s.createQuery( "select c from Customer c" ).uniqueResult();
|
||||
|
@ -116,20 +118,20 @@ public class IdMapManyToOneSpecjTest extends BaseCoreFunctionalTestCase {
|
|||
.uniqueResult();
|
||||
assertEquals( 3, c13.getInventories().size() );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Customer customer2 = new Customer(
|
||||
"foo2", "bar2", "contact12", "1002", new BigDecimal( 10002 ), new BigDecimal( 10002 ), new BigDecimal( 1000 ));
|
||||
customer2.setId(2);
|
||||
s.persist(customer2);
|
||||
|
||||
|
||||
customer2.addInventory(boat, 10, new BigDecimal(400));
|
||||
customer2.addInventory(house2, 3, new BigDecimal(4000));
|
||||
s.merge(customer2);
|
||||
|
||||
|
||||
Customer c23 = ( Customer ) s.createQuery( "select c from Customer c where c.id = 2" ).uniqueResult();
|
||||
assertEquals( 2, c23.getInventories().size() );
|
||||
|
||||
|
||||
tx.rollback();
|
||||
s.close();
|
||||
}
|
||||
|
|
|
@ -30,6 +30,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;
|
||||
|
@ -40,6 +41,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*
|
||||
* @author <a href="mailto:stale.pedersen@jboss.org">Stale W. Pedersen</a>
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IdClassGeneratedValueManyToOneTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testComplexIdClass() {
|
||||
|
@ -51,14 +53,14 @@ public class IdClassGeneratedValueManyToOneTest extends BaseCoreFunctionalTestCa
|
|||
s.persist( c1 );
|
||||
s.flush();
|
||||
s.clear();
|
||||
|
||||
// why does this cause a failure?
|
||||
|
||||
// why does this cause a failure?
|
||||
// Customer c2 = new Customer(
|
||||
// "foo1", "bar1", "contact2", "200", new BigDecimal( 2000 ), new BigDecimal( 2000 ), new BigDecimal( 2000 ));
|
||||
// s.persist( c2 );
|
||||
// s.flush();
|
||||
// s.clear();
|
||||
|
||||
|
||||
Item boat = new Item();
|
||||
boat.setId( "1" );
|
||||
boat.setName( "cruiser" );
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentitySimpleParentEmbeddedDepTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testManyToOne() throws Exception {
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -13,6 +14,7 @@ import static org.junit.Assert.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentityIdClassParentIdClassDepTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testManytoOne() {
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -13,6 +14,7 @@ import static org.junit.Assert.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentityIdClassParentEmbeddedIdDepTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testManyToOne() throws Exception {
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentityEmbeddedIdParentIdClassTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testManyToOne() throws Exception {
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentityEmbeddedIdParentEmbeddedIdDepTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testManyToOne() throws Exception {
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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 Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentitySimpleParentSimpleDepTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testOneToOneExplicitJoinColumn() throws Exception {
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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 Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentitySimpleParentSimpleDepMapsIdTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testOneToOneExplicitJoinColumn() throws Exception {
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentityIdClassParentSameIdTypeIdClassDepTest extends BaseCoreFunctionalTestCase {
|
||||
private static final String FIRST_NAME = "Emmanuel";
|
||||
private static final String LAST_NAME = "Bernard";
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentityIdClassParentSameIdTypeEmbeddedIdDepTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testOneToOneExplicitJoinColumn() throws Exception {
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class ForeignGeneratorViaMapsIdTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testForeignGenerator() throws Exception {
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentityEmbeddedIdParentSameIdTypeIdClassDepTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testOneToOneExplicitJoinColumn() throws Exception {
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class DerivedIdentityEmbeddedIdParentSameIdTypeEmbeddedIdDepTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testOneToOneExplicitJoinColumn() throws Exception {
|
||||
|
|
|
@ -37,6 +37,7 @@ import org.hibernate.Transaction;
|
|||
import org.hibernate.test.annotations.embedded.FloatLeg.RateIndex;
|
||||
import org.hibernate.test.annotations.embedded.Leg.Frequency;
|
||||
import org.hibernate.test.util.SchemaUtil;
|
||||
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 Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class EmbeddedTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testSimple() throws Exception {
|
||||
|
@ -104,7 +106,7 @@ public class EmbeddedTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
reg = (RegionalArticle) s.get( RegionalArticle.class, (Serializable) reg.getPk() );
|
||||
reg = (RegionalArticle) s.get( RegionalArticle.class, reg.getPk() );
|
||||
assertNotNull( reg );
|
||||
assertNotNull( reg.getPk() );
|
||||
assertEquals( "Je ne veux pes rester sage - Dolly", reg.getName() );
|
||||
|
@ -396,7 +398,7 @@ public class EmbeddedTest extends BaseCoreFunctionalTestCase {
|
|||
Set<Manager> topManagement = provider.getOwner().getTopManagement();
|
||||
assertNotNull( "OneToMany not set", topManagement );
|
||||
assertEquals( "Wrong number of elements", 1, topManagement.size() );
|
||||
manager = (Manager) topManagement.iterator().next();
|
||||
manager = topManagement.iterator().next();
|
||||
assertEquals( "Wrong element", "Bill", manager.getName() );
|
||||
s.delete( manager );
|
||||
s.delete( provider );
|
||||
|
|
|
@ -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;
|
||||
|
@ -35,6 +36,7 @@ import static org.junit.Assert.assertEquals;
|
|||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class EmbeddableWithMany2OneTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
|
|
|
@ -27,11 +27,13 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class UnidirCollectionWithMultipleOwnerTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testUnidirCollectionWithMultipleOwner() throws Exception {
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.hibernate.Session;
|
|||
import org.hibernate.Transaction;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.testing.DialectChecks;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.RequiresDialectFeature;
|
||||
import org.hibernate.testing.ServiceRegistryBuilder;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
@ -54,6 +55,7 @@ import static org.junit.Assert.fail;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected boolean isCleanupTestDataRequired() {
|
||||
|
@ -193,26 +195,26 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
/*
|
||||
* Test import of TypeDefs from MappedSuperclass and
|
||||
* Test import of TypeDefs from MappedSuperclass and
|
||||
* Embedded classes.
|
||||
* The classes 'Name' and 'FormalLastName' both embed the same
|
||||
* component 'LastName'. This is to verify that processing the
|
||||
* typedef defined in the component TWICE does not create any
|
||||
* issues.
|
||||
* The classes 'Name' and 'FormalLastName' both embed the same
|
||||
* component 'LastName'. This is to verify that processing the
|
||||
* typedef defined in the component TWICE does not create any
|
||||
* issues.
|
||||
*/
|
||||
@Test
|
||||
public void testImportTypeDefinitions() throws Exception {
|
||||
LastName lastName = new LastName();
|
||||
lastName.setName("reddy");
|
||||
|
||||
|
||||
Name name = new Name();
|
||||
name.setFirstName("SHARATH");
|
||||
name.setLastName(lastName);
|
||||
|
||||
|
||||
FormalLastName formalName = new FormalLastName();
|
||||
formalName.setLastName(lastName);
|
||||
formalName.setDesignation("Mr");
|
||||
|
||||
|
||||
Session s;
|
||||
Transaction tx;
|
||||
s = openSession();
|
||||
|
@ -221,17 +223,17 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
s.persist(formalName);
|
||||
tx.commit();
|
||||
s.close();
|
||||
|
||||
|
||||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
name = (Name) s.get( Name.class, name.getId() );
|
||||
assertNotNull( name );
|
||||
assertEquals( "sharath", name.getFirstName() );
|
||||
assertEquals( "REDDY", name.getLastName().getName() );
|
||||
|
||||
|
||||
formalName = (FormalLastName) s.get(FormalLastName.class, formalName.getId());
|
||||
assertEquals( "REDDY", formalName.getLastName().getName() );
|
||||
|
||||
|
||||
s.delete(name);
|
||||
s.delete(formalName);
|
||||
tx.commit();
|
||||
|
@ -293,19 +295,19 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
@Test
|
||||
public void testFilterOnCollection() {
|
||||
|
||||
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
|
||||
|
||||
Topic topic = new Topic();
|
||||
Narrative n1 = new Narrative();
|
||||
n1.setState("published");
|
||||
topic.addNarrative(n1);
|
||||
|
||||
|
||||
Narrative n2 = new Narrative();
|
||||
n2.setState("draft");
|
||||
topic.addNarrative(n2);
|
||||
|
||||
|
||||
s.persist(topic);
|
||||
tx.commit();
|
||||
s.close();
|
||||
|
@ -313,16 +315,16 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
topic = (Topic) s.load( Topic.class, topic.getId() );
|
||||
|
||||
|
||||
s.enableFilter("byState").setParameter("state", "published");
|
||||
topic = (Topic) s.load( Topic.class, topic.getId() );
|
||||
assertNotNull(topic);
|
||||
assertTrue(topic.getNarratives().size() == 1);
|
||||
assertNotNull(topic);
|
||||
assertTrue(topic.getNarratives().size() == 1);
|
||||
assertEquals("published", topic.getNarratives().iterator().next().getState());
|
||||
tx.commit();
|
||||
s.close();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCascadedDeleteOfChildEntitiesBug2() {
|
||||
|
@ -379,7 +381,7 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
// create two single player teams (for one versus one match of soccer)
|
||||
// and associate teams with players via the special OneVOne methods.
|
||||
// Clear the Team reference to players, which should orphan the teams.
|
||||
// Orphaning the team should delete the team.
|
||||
// Orphaning the team should delete the team.
|
||||
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
|
@ -455,7 +457,7 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
tx.rollback();
|
||||
s.close();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tests the functionality of inheriting @Filter and @FilterDef annotations
|
||||
* defined on a parent MappedSuperclass(s)
|
||||
|
@ -483,8 +485,8 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
s.close();
|
||||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
|
||||
//We test every filter with 2 queries, the first on the base class of the
|
||||
|
||||
//We test every filter with 2 queries, the first on the base class of the
|
||||
//inheritance hierarchy (Drill), and the second on a subclass (PowerDrill)
|
||||
s.enableFilter( "byName" ).setParameter( "name", "HomeDrill1");
|
||||
long count = ( (Long) s.createQuery( "select count(*) from Drill" ).iterate().next() ).intValue();
|
||||
|
@ -492,18 +494,18 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
count = ( (Long) s.createQuery( "select count(*) from PowerDrill" ).iterate().next() ).intValue();
|
||||
assertEquals( 1, count );
|
||||
s.disableFilter( "byName" );
|
||||
|
||||
|
||||
s.enableFilter( "byCategory" ).setParameter( "category", "Industrial" );
|
||||
count = ( (Long) s.createQuery( "select count(*) from Drill" ).iterate().next() ).longValue();
|
||||
assertEquals( 1, count );
|
||||
count = ( (Long) s.createQuery( "select count(*) from PowerDrill" ).iterate().next() ).longValue();
|
||||
assertEquals( 1, count );
|
||||
s.disableFilter( "byCategory" );
|
||||
|
||||
|
||||
tx.rollback();
|
||||
s.close();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@RequiresDialectFeature( DialectChecks.SupportsExpectedLobUsagePattern.class )
|
||||
public void testParameterizedType() throws Exception {
|
||||
|
@ -619,23 +621,23 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
tx.commit();
|
||||
s.close();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testTypeDefNameAndDefaultForTypeAttributes() {
|
||||
ContactDetails contactDetails = new ContactDetails();
|
||||
contactDetails.setLocalPhoneNumber(new PhoneNumber("999999"));
|
||||
contactDetails.setOverseasPhoneNumber(
|
||||
new OverseasPhoneNumber("041", "111111"));
|
||||
|
||||
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
s.persist(contactDetails);
|
||||
tx.commit();
|
||||
s.close();
|
||||
|
||||
|
||||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
contactDetails =
|
||||
contactDetails =
|
||||
(ContactDetails) s.get( ContactDetails.class, contactDetails.getId() );
|
||||
assertNotNull( contactDetails );
|
||||
assertEquals( "999999", contactDetails.getLocalPhoneNumber().getNumber() );
|
||||
|
@ -643,9 +645,9 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
s.delete(contactDetails);
|
||||
tx.commit();
|
||||
s.close();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testTypeDefWithoutNameAndDefaultForTypeAttributes() {
|
||||
try {
|
||||
|
@ -658,25 +660,25 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
assertEquals(
|
||||
"Either name or defaultForType (or both) attribute should be set in TypeDefinition having typeClass org.hibernate.test.annotations.entity.PhoneNumberType",
|
||||
ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A custom type is used in the base class, but defined in the derived class.
|
||||
* This would have caused an exception, because the base class is processed
|
||||
* BEFORE the derived class, and the custom type is not yet defined. However,
|
||||
* it works now because we are setting the typeName for SimpleValue in the second
|
||||
* pass.
|
||||
*
|
||||
*
|
||||
* A custom type is used in the base class, but defined in the derived class.
|
||||
* This would have caused an exception, because the base class is processed
|
||||
* BEFORE the derived class, and the custom type is not yet defined. However,
|
||||
* it works now because we are setting the typeName for SimpleValue in the second
|
||||
* pass.
|
||||
*
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void testSetSimpleValueTypeNameInSecondPass() throws Exception {
|
||||
Peugot derived = new Peugot();
|
||||
derived.setName("sharath");
|
||||
|
||||
|
||||
Session s;
|
||||
Transaction tx;
|
||||
s = openSession();
|
||||
|
@ -684,7 +686,7 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
|
|||
s.persist(derived);
|
||||
tx.commit();
|
||||
s.close();
|
||||
|
||||
|
||||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
derived = (Peugot) s.get( Peugot.class, derived.getId() );
|
||||
|
|
|
@ -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,6 +36,7 @@ import static org.junit.Assert.assertNull;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class Java5FeaturesTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testInterface() throws Exception {
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.hibernate.mapping.RootClass;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -34,6 +35,7 @@ import static org.junit.Assert.assertEquals;
|
|||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class NewCustomEntityMappingAnnotationsTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
|
|
|
@ -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;
|
||||
|
@ -37,7 +38,9 @@ import static org.junit.Assert.assertNotNull;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
public class PropertyDefaultMappingsTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testSerializableObject() throws Exception {
|
||||
Session s;
|
||||
Transaction tx;
|
||||
|
@ -63,6 +66,7 @@ public class PropertyDefaultMappingsTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testTransientField() throws Exception {
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
|
|
|
@ -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;
|
||||
|
@ -36,6 +37,7 @@ import static org.junit.Assert.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class EntityNonEntityTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testMix() throws Exception {
|
||||
|
|
|
@ -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 Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class FetchingTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testLazy() throws Exception {
|
||||
|
|
|
@ -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.assertTrue;
|
||||
|
@ -39,6 +40,7 @@ import static org.junit.Assert.assertTrue;
|
|||
* @author Emmanuel Bernard
|
||||
* @author Hardy Ferentschik
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class MoreFetchProfileTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testFetchWithTwoOverrides() throws Exception {
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package org.hibernate.test.annotations.filter.secondarytable;
|
||||
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class SecondaryTableTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Override
|
||||
|
@ -20,14 +22,14 @@ public class SecondaryTableTest extends BaseCoreFunctionalTestCase {
|
|||
insertUser("t@s.com", 24, false, "a4", "b");
|
||||
session.flush();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testFilter(){
|
||||
Assert.assertEquals(Long.valueOf(4), session.createQuery("select count(u) from User u").uniqueResult());
|
||||
session.enableFilter("ageFilter").setParameter("age", 24);
|
||||
Assert.assertEquals(Long.valueOf(2), session.createQuery("select count(u) from User u").uniqueResult());
|
||||
}
|
||||
|
||||
|
||||
private void insertUser(String emailAddress, int age, boolean lockedOut, String username, String password){
|
||||
User user = new User();
|
||||
user.setEmailAddress(emailAddress);
|
||||
|
|
|
@ -3,27 +3,29 @@ package org.hibernate.test.annotations.filter.subclass.joined;
|
|||
import junit.framework.Assert;
|
||||
|
||||
import org.hibernate.test.annotations.filter.subclass.SubClassTest;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.junit.Test;
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class JoinedSubClassTest extends SubClassTest{
|
||||
|
||||
@Override
|
||||
protected Class[] getAnnotatedClasses() {
|
||||
return new Class[]{Animal.class, Mammal.class, Human.class, Club.class};
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void cleanupTest() throws Exception {
|
||||
super.cleanupTest();
|
||||
openSession();
|
||||
session.beginTransaction();
|
||||
|
||||
|
||||
session.createQuery("delete from Club").executeUpdate();
|
||||
|
||||
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void persistTestData() {
|
||||
Club club = new Club();
|
||||
|
@ -42,20 +44,20 @@ public class JoinedSubClassTest extends SubClassTest{
|
|||
Club club = (Club) session.createQuery("from Club").uniqueResult();
|
||||
Assert.assertEquals(3, club.getMembers().size());
|
||||
session.clear();
|
||||
|
||||
|
||||
session.enableFilter("pregnantMembers");
|
||||
club = (Club) session.createQuery("from Club").uniqueResult();
|
||||
Assert.assertEquals(1, club.getMembers().size());
|
||||
session.clear();
|
||||
|
||||
|
||||
session.enableFilter("iqMin").setParameter("min", 148);
|
||||
club = (Club) session.createQuery("from Club").uniqueResult();
|
||||
Assert.assertEquals(0, club.getMembers().size());
|
||||
|
||||
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
|
||||
private Human createHuman(Club club, boolean pregnant, int iq){
|
||||
Human human = new Human();
|
||||
human.setClub(club);
|
||||
|
@ -65,6 +67,6 @@ public class JoinedSubClassTest extends SubClassTest{
|
|||
session.persist(human);
|
||||
return human;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
package org.hibernate.test.annotations.filter.subclass.singletable;
|
||||
|
||||
import org.hibernate.test.annotations.filter.subclass.SubClassTest;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class SingleTableTest extends SubClassTest{
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected Class[] getAnnotatedClasses() {
|
||||
return new Class[]{Animal.class, Mammal.class, Human.class};
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void persistTestData() {
|
||||
createHuman(false, 90);
|
||||
|
@ -26,6 +28,6 @@ public class SingleTableTest extends SubClassTest{
|
|||
human.setIq(iq);
|
||||
session.persist(human);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
package org.hibernate.test.annotations.filter.subclass.tableperclass;
|
||||
|
||||
import org.hibernate.test.annotations.filter.subclass.SubClassTest;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class TablePerClassTest extends SubClassTest{
|
||||
@Override
|
||||
protected Class[] getAnnotatedClasses() {
|
||||
return new Class[]{Animal.class, Mammal.class, Human.class};
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void persistTestData() {
|
||||
createHuman(false, 90);
|
||||
|
@ -22,6 +24,6 @@ public class TablePerClassTest extends SubClassTest{
|
|||
human.setIq(iq);
|
||||
session.persist(human);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -26,10 +26,12 @@ package org.hibernate.test.annotations.generics;
|
|||
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;
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class EmbeddedGenericsTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testWorksWithGenericEmbedded() {
|
||||
|
|
|
@ -29,11 +29,13 @@ 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;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class GenericsTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testManyToOneGenerics() throws Exception {
|
||||
|
|
|
@ -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,7 +36,9 @@ import static org.junit.Assert.assertEquals;
|
|||
* @author Paolo Perrotta
|
||||
*/
|
||||
public class UnresolvedTypeTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testAcceptsUnresolvedPropertyTypesIfATargetEntityIsExplicitlySet() {
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
|
@ -47,6 +50,7 @@ public class UnresolvedTypeTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testAcceptsUnresolvedPropertyTypesIfATypeExplicitlySet() {
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
|
|
|
@ -26,11 +26,13 @@ package org.hibernate.test.annotations.genericsinheritance;
|
|||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class GenericsInheritanceTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testMapping() throws Exception {
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.hibernate.Session;
|
|||
import org.hibernate.Transaction;
|
||||
import org.hibernate.test.annotations.id.entities.Planet;
|
||||
import org.hibernate.test.annotations.id.entities.PlanetCheatSheet;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
@ -44,9 +45,11 @@ import static org.junit.Assert.assertNull;
|
|||
@SuppressWarnings("unchecked")
|
||||
@TestForIssue( jiraKey = "ANN-744" )
|
||||
public class EnumIdTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
private static final Logger log = Logger.getLogger( EnumIdTest.class );
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testEnumAsId() throws Exception {
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.hibernate.Session;
|
|||
import org.hibernate.Transaction;
|
||||
import org.hibernate.test.annotations.id.entities.Location;
|
||||
import org.hibernate.test.annotations.id.entities.Tower;
|
||||
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.assertNotNull;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IdClassTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testIdClassInSuperclass() throws Exception {
|
||||
|
|
|
@ -45,6 +45,7 @@ import org.hibernate.test.annotations.id.entities.Shoe;
|
|||
import org.hibernate.test.annotations.id.entities.SoundSystem;
|
||||
import org.hibernate.test.annotations.id.entities.Store;
|
||||
import org.hibernate.test.annotations.id.entities.Tree;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -54,6 +55,7 @@ import static org.junit.Assert.assertNotNull;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IdTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testGenericGenerator() throws Exception {
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.hibernate.id.enhanced.SequenceStyleGenerator;
|
|||
import org.hibernate.id.enhanced.TableGenerator;
|
||||
import org.hibernate.internal.util.StringHelper;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
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
|
||||
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class NewGeneratorMappingsTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.hibernate.Session;
|
|||
import org.hibernate.Transaction;
|
||||
import org.hibernate.test.annotations.id.sequences.entities.Planet;
|
||||
import org.hibernate.test.annotations.id.sequences.entities.PlanetCheatSheet;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
@ -44,9 +45,11 @@ import static org.junit.Assert.assertNull;
|
|||
@SuppressWarnings("unchecked")
|
||||
@TestForIssue( jiraKey = "ANN-744" )
|
||||
public class EnumIdTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
private static final Logger log = Logger.getLogger( EnumIdTest.class );
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testEnumAsId() throws Exception {
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.hibernate.id.enhanced.SequenceStyleGenerator;
|
|||
import org.hibernate.mapping.Table;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
import org.hibernate.test.annotations.id.sequences.entities.HibernateSequenceEntity;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
@ -20,6 +21,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
|||
*/
|
||||
@TestForIssue(jiraKey = "HHH-6068")
|
||||
public class HibernateSequenceTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
private static final String SCHEMA_NAME = "OTHER_SCHEMA";
|
||||
|
||||
@Override
|
||||
|
@ -39,6 +41,7 @@ public class HibernateSequenceTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testHibernateSequenceSchema() {
|
||||
EntityPersister persister = sessionFactory().getEntityPersister( HibernateSequenceEntity.class.getName() );
|
||||
IdentifierGenerator generator = persister.getIdentifierGenerator();
|
||||
|
@ -51,6 +54,7 @@ public class HibernateSequenceTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testHibernateSequenceNextVal() {
|
||||
Session session = openSession();
|
||||
Transaction txn = session.beginTransaction();
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.hibernate.Session;
|
|||
import org.hibernate.Transaction;
|
||||
import org.hibernate.test.annotations.id.sequences.entities.Location;
|
||||
import org.hibernate.test.annotations.id.sequences.entities.Tower;
|
||||
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.assertNotNull;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IdClassTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testIdClassInSuperclass() throws Exception {
|
||||
|
|
|
@ -48,6 +48,7 @@ import org.hibernate.test.annotations.id.sequences.entities.SoundSystem;
|
|||
import org.hibernate.test.annotations.id.sequences.entities.Store;
|
||||
import org.hibernate.test.annotations.id.sequences.entities.Tree;
|
||||
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;
|
||||
|
@ -61,6 +62,7 @@ import static junit.framework.Assert.assertNotNull;
|
|||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequiresDialectFeature(DialectChecks.SupportsSequences.class)
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IdTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testGenericGenerator() throws Exception {
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.junit.Test;
|
|||
import org.hibernate.Query;
|
||||
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,6 +35,7 @@ import static org.junit.Assert.assertEquals;
|
|||
/**
|
||||
* @author <a href="mailto:stale.pedersen@jboss.org">Stale W. Pedersen</a>
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IdClassCompositePKTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testEntityMappningPropertiesAreNotIgnored() {
|
||||
|
|
|
@ -29,6 +29,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.assertEquals;
|
|||
*
|
||||
* @author <a href="mailto:stale.pedersen@jboss.org">Stale W. Pedersen</a>
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IdClassGeneratedValueTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
|
|
|
@ -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,6 +35,7 @@ import static org.junit.Assert.assertEquals;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IdentifierCollectionTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testIdBag() throws Exception {
|
||||
|
|
|
@ -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,6 +35,7 @@ import static org.junit.Assert.assertEquals;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IdManyToOneTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testFkCreationOrdering() throws Exception {
|
||||
|
@ -76,7 +78,7 @@ public class IdManyToOneTest extends BaseCoreFunctionalTestCase {
|
|||
Project.class,
|
||||
|
||||
//tested only through deployment
|
||||
//ANN-590 testIdClassManyToOneWithReferenceColumn
|
||||
//ANN-590 testIdClassManyToOneWithReferenceColumn
|
||||
Customers.class,
|
||||
ShoppingBaskets.class,
|
||||
ShoppingBasketsPK.class,
|
||||
|
|
|
@ -25,11 +25,13 @@ package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class AlphabeticalIdManyToOneTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testAlphabeticalTest() throws Exception {
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.hibernate.HibernateException;
|
|||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.ServiceRegistryBuilder;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
@ -48,6 +49,7 @@ import static org.junit.Assert.fail;
|
|||
* @author Hardy Ferentschik
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class ImmutableTest extends BaseCoreFunctionalTestCase {
|
||||
private static final Logger log = Logger.getLogger( ImmutableTest.class );
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.hibernate.dialect.H2Dialect;
|
|||
import org.hibernate.dialect.HSQLDialect;
|
||||
import org.hibernate.mapping.Collection;
|
||||
import org.hibernate.mapping.Column;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.RequiresDialect;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
@ -53,6 +54,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class IndexedCollectionTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testJPA2DefaultMapColumns() throws Exception {
|
||||
|
@ -492,7 +494,7 @@ public class IndexedCollectionTest extends BaseCoreFunctionalTestCase {
|
|||
Atmosphere atm = new Atmosphere();
|
||||
atm.colorPerDate.put( new Date(1234567000), "red" );
|
||||
s.persist( atm );
|
||||
|
||||
|
||||
s.flush();
|
||||
s.clear();
|
||||
|
||||
|
|
|
@ -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,6 +35,7 @@ import static org.junit.Assert.assertEquals;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class MapKeyTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testMapKeyOnEmbeddedId() {
|
||||
|
|
|
@ -37,6 +37,7 @@ import org.hibernate.test.annotations.inheritance.singletable.Funk;
|
|||
import org.hibernate.test.annotations.inheritance.singletable.Music;
|
||||
import org.hibernate.test.annotations.inheritance.singletable.Noise;
|
||||
import org.hibernate.test.annotations.inheritance.singletable.Rock;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -48,6 +49,7 @@ import static org.junit.Assert.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class SubclassTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected boolean isCleanupTestDataRequired() {
|
||||
|
|
|
@ -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;
|
||||
|
@ -36,6 +37,7 @@ import static org.junit.Assert.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class JoinedSubclassAndSecondaryTable extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testSecondaryTableAndJoined() throws Exception {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -43,6 +44,7 @@ import static org.junit.Assert.fail;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class JoinedSubclassTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testDefault() throws Exception {
|
||||
|
@ -152,46 +154,46 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase {
|
|||
transaction.commit();
|
||||
session.close();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-4250" )
|
||||
public void testManyToOneWithJoinTable() {
|
||||
//HHH-4250 : @ManyToOne - @OneToMany doesn't work with @Inheritance(strategy= InheritanceType.JOINED)
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
|
||||
|
||||
Client c1 = new Client();
|
||||
c1.setFirstname("Firstname1");
|
||||
c1.setName("Name1");
|
||||
c1.setCode("1234");
|
||||
c1.setStreet("Street1");
|
||||
c1.setCity("City1");
|
||||
|
||||
|
||||
Account a1 = new Account();
|
||||
a1.setNumber("1000");
|
||||
a1.setBalance(5000.0);
|
||||
|
||||
|
||||
a1.addClient(c1);
|
||||
|
||||
|
||||
s.persist(c1);
|
||||
s.persist(a1);
|
||||
|
||||
|
||||
s.flush();
|
||||
s.clear();
|
||||
|
||||
|
||||
c1 = (Client) s.load(Client.class, c1.getId());
|
||||
assertEquals( 5000.0, c1.getAccount().getBalance(), 0.01 );
|
||||
|
||||
|
||||
s.flush();
|
||||
s.clear();
|
||||
|
||||
|
||||
a1 = (Account) s.load(Account.class,a1.getId());
|
||||
Set<Client> clients = a1.getClients();
|
||||
assertEquals(1, clients.size());
|
||||
Iterator<Client> it = clients.iterator();
|
||||
c1 = it.next();
|
||||
assertEquals("Name1", c1.getName());
|
||||
|
||||
|
||||
tx.rollback();
|
||||
s.close();
|
||||
}
|
||||
|
@ -202,17 +204,17 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase {
|
|||
// HHH-4240 - SecondaryTables not recognized when using JOINED inheritance
|
||||
Session s = openSession();
|
||||
s.getTransaction().begin();
|
||||
|
||||
|
||||
Company company = new Company();
|
||||
company.setCustomerName("Mama");
|
||||
company.setCustomerCode("123");
|
||||
company.setCompanyName("Mama Mia Pizza");
|
||||
company.setCompanyAddress("Rome");
|
||||
|
||||
|
||||
s.persist( company );
|
||||
s.getTransaction().commit();
|
||||
s.clear();
|
||||
|
||||
|
||||
s = openSession();
|
||||
s.getTransaction().begin();
|
||||
company = (Company) s.get( Company.class, company.getId());
|
||||
|
@ -220,12 +222,12 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase {
|
|||
assertEquals("123", company.getCustomerCode());
|
||||
assertEquals("Mama Mia Pizza", company.getCompanyName());
|
||||
assertEquals("Rome", company.getCompanyAddress());
|
||||
|
||||
|
||||
s.delete( company );
|
||||
s.getTransaction().commit();
|
||||
s.close();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Class[] getAnnotatedClasses() {
|
||||
return new Class[]{
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.junit.Test;
|
|||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.exception.SQLGrammarException;
|
||||
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.fail;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class SubclassTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testDefault() throws Exception {
|
||||
|
|
|
@ -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;
|
||||
|
@ -41,6 +42,7 @@ import static org.junit.Assert.fail;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class SubclassTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testDefault() throws Exception {
|
||||
|
|
|
@ -25,11 +25,13 @@ package org.hibernate.test.annotations.interfaces;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class InterfacesTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testInterface() {
|
||||
|
|
|
@ -35,6 +35,7 @@ import org.hibernate.Session;
|
|||
import org.hibernate.Transaction;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernate.mapping.Join;
|
||||
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.fail;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class JoinTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testDefaultValue() throws Exception {
|
||||
|
@ -147,7 +149,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase {
|
|||
tx.commit();
|
||||
s.close();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testReferenceColumnWithBacktics() throws Exception {
|
||||
Session s=openSession();
|
||||
|
@ -161,7 +163,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase {
|
|||
s.getTransaction().commit();
|
||||
s.close();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testUniqueConstaintOnSecondaryTable() throws Exception {
|
||||
Cat cat = new Cat();
|
||||
|
@ -195,7 +197,7 @@ public class JoinTest extends BaseCoreFunctionalTestCase {
|
|||
s.persist( cat );
|
||||
s.flush();
|
||||
s.clear();
|
||||
|
||||
|
||||
s.get( Cat.class, cat.getId() );
|
||||
//Find a way to test it, I need to define the secondary table on a subclass
|
||||
|
||||
|
|
|
@ -30,6 +30,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.assertEquals;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class LoaderTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected String[] getXmlFiles() {
|
||||
|
@ -62,14 +64,14 @@ public class LoaderTest extends BaseCoreFunctionalTestCase {
|
|||
p.setName("me");
|
||||
t.getPlayers().add(p);
|
||||
p.setTeam(t);
|
||||
|
||||
|
||||
|
||||
try {
|
||||
s.persist(p);
|
||||
s.persist(t);
|
||||
tx.commit();
|
||||
s.close();
|
||||
|
||||
|
||||
s= openSession( );
|
||||
tx = s.beginTransaction();
|
||||
Team t2 = (Team)s.load(Team.class,new Long(1));
|
||||
|
@ -77,7 +79,7 @@ public class LoaderTest extends BaseCoreFunctionalTestCase {
|
|||
Iterator<Player> iterator = players.iterator();
|
||||
assertEquals("me", iterator.next().getName());
|
||||
tx.commit();
|
||||
|
||||
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -25,12 +25,14 @@
|
|||
package org.hibernate.test.annotations.lob;
|
||||
|
||||
import org.hibernate.testing.DialectChecks;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.RequiresDialectFeature;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class)
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class LobTest extends AbstractLobTest<Book, CompiledCode> {
|
||||
@Override
|
||||
protected Class<Book> getBookClass() {
|
||||
|
|
|
@ -29,6 +29,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;
|
||||
import org.hibernate.type.MaterializedBlobType;
|
||||
|
@ -42,6 +43,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
@RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class)
|
||||
public class MaterializedBlobTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
return new Class<?>[] { MaterializedBlobEntity.class };
|
||||
|
@ -55,6 +57,7 @@ public class MaterializedBlobTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testSaving() {
|
||||
byte[] testData = "test data".getBytes();
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.hibernate.Session;
|
|||
import org.hibernate.Transaction;
|
||||
import org.hibernate.testing.DialectChecks;
|
||||
import org.hibernate.testing.FailureExpected;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.RequiresDialectFeature;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -38,6 +39,7 @@ import static org.junit.Assert.assertNotNull;
|
|||
* @author Gail Badner
|
||||
*/
|
||||
@RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class)
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class VersionedLobTest extends AbstractLobTest<VersionedBook, VersionedCompiledCode> {
|
||||
@Override
|
||||
protected Class<VersionedBook> getBookClass() {
|
||||
|
|
|
@ -26,6 +26,7 @@ package org.hibernate.test.annotations.manytomany;
|
|||
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.cfg.Environment;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
|
||||
/**
|
||||
* Many to many tests using max_fetch_depth == 0
|
||||
|
@ -33,6 +34,7 @@ import org.hibernate.cfg.Environment;
|
|||
* @author Gail Badner
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class ManyToManyMaxFetchDepth0Test extends ManyToManyTest {
|
||||
@Override
|
||||
protected void configure(Configuration cfg) {
|
||||
|
|
|
@ -38,6 +38,7 @@ import org.hibernate.JDBCException;
|
|||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
@ -53,7 +54,9 @@ import static org.junit.Assert.fail;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class ManyToManyTest extends BaseCoreFunctionalTestCase {
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class ManyToManyTest
|
||||
extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testDefault() throws Exception {
|
||||
Session s;
|
||||
|
@ -313,7 +316,7 @@ public class ManyToManyTest extends BaseCoreFunctionalTestCase {
|
|||
tx.rollback();
|
||||
s.close();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRemoveInBetween() throws Exception {
|
||||
Session s;
|
||||
|
@ -536,15 +539,15 @@ public class ManyToManyTest extends BaseCoreFunctionalTestCase {
|
|||
Permission readAccess = new Permission();
|
||||
readAccess.setPermission( "read" );
|
||||
readAccess.setExpirationDate( new Date() );
|
||||
|
||||
|
||||
Permission writeAccess = new Permission();
|
||||
writeAccess.setPermission( "write" );
|
||||
writeAccess.setExpirationDate( new Date( new Date().getTime() - 10*60*1000 ) );
|
||||
|
||||
|
||||
Permission executeAccess = new Permission();
|
||||
executeAccess.setPermission( "execute" );
|
||||
executeAccess.setExpirationDate( new Date( new Date().getTime() - 5*60*1000 ) );
|
||||
|
||||
|
||||
Set<Permission> coll = new HashSet<Permission>( 3 );
|
||||
coll.add( readAccess );
|
||||
coll.add( writeAccess );
|
||||
|
@ -567,7 +570,7 @@ public class ManyToManyTest extends BaseCoreFunctionalTestCase {
|
|||
s.getTransaction().rollback();
|
||||
s.close();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testJoinedSubclassManyToMany() throws Exception {
|
||||
Session s = openSession();
|
||||
|
@ -666,7 +669,7 @@ public class ManyToManyTest extends BaseCoreFunctionalTestCase {
|
|||
s = openSession();
|
||||
s.getTransaction().begin();
|
||||
e = (Employee)s.get( e.getClass(),e.getId() );
|
||||
// follow both directions of many to many association
|
||||
// follow both directions of many to many association
|
||||
assertEquals("same employee", e.getName(), e.getContactInfo().getPhoneNumbers().get(0).getEmployees().iterator().next().getName());
|
||||
s.getTransaction().commit();
|
||||
|
||||
|
@ -702,7 +705,7 @@ public class ManyToManyTest extends BaseCoreFunctionalTestCase {
|
|||
s = openSession();
|
||||
s.getTransaction().begin();
|
||||
e = (Employee) s.get( e.getClass(), e.getId() );
|
||||
assertEquals( "same job in both directions",
|
||||
assertEquals( "same job in both directions",
|
||||
e.getJobInfo().getJobDescription(),
|
||||
e.getJobInfo().getPm().getManages().iterator().next().getJobInfo().getJobDescription() );
|
||||
s.getTransaction().commit();
|
||||
|
|
|
@ -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,6 +36,7 @@ import static org.junit.Assert.assertNotNull;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class ManyToOneJoinTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testManyToOneJoinTable() throws Exception {
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.hibernate.test.annotations.Discount;
|
|||
import org.hibernate.test.annotations.Flight;
|
||||
import org.hibernate.test.annotations.Passport;
|
||||
import org.hibernate.test.annotations.Ticket;
|
||||
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 Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class ManyToOneTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testEager() throws Exception {
|
||||
|
|
|
@ -29,12 +29,14 @@ 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;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class ManyToOneReferencedColumnNameTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
@RequiresDialectFeature(DialectChecks.SupportsIdentityColumns.class)
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.hibernate.dialect.DB2Dialect;
|
|||
import org.hibernate.dialect.HSQLDialect;
|
||||
import org.hibernate.dialect.Oracle8iDialect;
|
||||
import org.hibernate.dialect.SQLServer2005Dialect;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.RequiresDialect;
|
||||
import org.hibernate.testing.SkipForDialect;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
@ -44,6 +45,7 @@ import static org.junit.Assert.assertNotNull;
|
|||
/**
|
||||
* @author Sharath Reddy
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class ManyToOneWithFormulaTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testManyToOneFromNonPk() throws Exception {
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.math.BigDecimal;
|
|||
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 IntermediateMappedSuperclassTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
|
|
|
@ -35,12 +35,14 @@ import org.hibernate.cfg.Configuration;
|
|||
import org.hibernate.cfg.Environment;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernate.sql.JoinType;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
/**
|
||||
* @author Guenther Demetz
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@TestForIssue(jiraKey = "HHH-4838")
|
||||
|
@ -54,14 +56,14 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
|
|||
a1.setName( "name1" );
|
||||
s.persist( a1 );
|
||||
newTx.commit();
|
||||
|
||||
|
||||
newTx = s.beginTransaction();
|
||||
getCriteria( s ).uniqueResult(); // put query-result into cache
|
||||
A a2 = new A();
|
||||
a2.setName( "xxxxxx" );
|
||||
s.persist( a2 );
|
||||
newTx.commit(); // Invalidates space A in UpdateTimeStamps region
|
||||
|
||||
|
||||
//Create new session to avoid the session cache which can't be tracked
|
||||
s.close();
|
||||
s = openSession();
|
||||
|
@ -141,7 +143,7 @@ public class ImmutableNaturalKeyLookupTest extends BaseCoreFunctionalTestCase {
|
|||
a2.setName( "xxxxxx" );
|
||||
s.persist( a2 );
|
||||
newTx.commit(); // Invalidates space A in UpdateTimeStamps region
|
||||
|
||||
|
||||
//Create new session to avoid the session cache which can't be tracked
|
||||
s.close();
|
||||
s = openSession();
|
||||
|
|
|
@ -30,18 +30,17 @@ import org.junit.After;
|
|||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
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;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
|
@ -53,6 +52,7 @@ import static org.junit.Assert.assertTrue;
|
|||
@SuppressWarnings("unchecked")
|
||||
@TestForIssue( jiraKey = "ANN-750" )
|
||||
public class NaturalIdOnSingleManyToOneTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
private static final Logger log = Logger.getLogger( NaturalIdOnSingleManyToOneTest.class );
|
||||
|
||||
@After
|
||||
|
@ -68,6 +68,7 @@ public class NaturalIdOnSingleManyToOneTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testMappingProperties() {
|
||||
log.warn("Commented out test");
|
||||
|
||||
|
@ -83,6 +84,7 @@ public class NaturalIdOnSingleManyToOneTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testManyToOneNaturalIdCached() {
|
||||
NaturalIdOnManyToOne singleManyToOne = new NaturalIdOnManyToOne();
|
||||
Citizen c1 = new Citizen();
|
||||
|
@ -103,7 +105,7 @@ public class NaturalIdOnSingleManyToOneTest extends BaseCoreFunctionalTestCase {
|
|||
s.persist( singleManyToOne );
|
||||
tx.commit();
|
||||
s.close();
|
||||
|
||||
|
||||
s.getSessionFactory().getCache().evictNaturalIdRegions();
|
||||
Statistics stats = sessionFactory().getStatistics();
|
||||
stats.setStatisticsEnabled( true );
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.hibernate.cfg.Configuration;
|
|||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernate.metadata.ClassMetadata;
|
||||
import org.hibernate.stat.Statistics;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -50,6 +51,7 @@ import static org.junit.Assert.assertTrue;
|
|||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class NaturalIdTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@After
|
||||
public void cleanupData() {
|
||||
super.cleanupCache();
|
||||
|
@ -63,6 +65,7 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testMappingProperties() {
|
||||
ClassMetadata metaData = sessionFactory().getClassMetadata(
|
||||
Citizen.class
|
||||
|
@ -76,16 +79,17 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testNaturalIdCached() {
|
||||
saveSomeCitizens();
|
||||
|
||||
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
State france = this.getState( s, "Ile de France" );
|
||||
Criteria criteria = s.createCriteria( Citizen.class );
|
||||
criteria.add( Restrictions.naturalId().set( "ssn", "1234" ).set( "state", france ) );
|
||||
criteria.setCacheable( true );
|
||||
|
||||
|
||||
this.cleanupCache();
|
||||
|
||||
Statistics stats = sessionFactory().getStatistics();
|
||||
|
@ -115,6 +119,7 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testNaturalIdLoaderNotCached() {
|
||||
saveSomeCitizens();
|
||||
|
||||
|
@ -148,26 +153,27 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testNaturalIdLoaderCached() {
|
||||
Statistics stats = sessionFactory().getStatistics();
|
||||
stats.setStatisticsEnabled( true );
|
||||
stats.clear();
|
||||
|
||||
|
||||
assertEquals( "NaturalId Cache Hits", 0, stats.getNaturalIdCacheHitCount() );
|
||||
assertEquals( "NaturalId Cache Misses", 0, stats.getNaturalIdCacheMissCount() );
|
||||
assertEquals( "NaturalId Cache Puts", 0, stats.getNaturalIdCachePutCount() );
|
||||
assertEquals( "NaturalId Cache Queries", 0, stats.getNaturalIdQueryExecutionCount() );
|
||||
|
||||
saveSomeCitizens();
|
||||
|
||||
|
||||
assertEquals( "NaturalId Cache Hits", 0, stats.getNaturalIdCacheHitCount() );
|
||||
assertEquals( "NaturalId Cache Misses", 0, stats.getNaturalIdCacheMissCount() );
|
||||
assertEquals( "NaturalId Cache Puts", 2, stats.getNaturalIdCachePutCount() );
|
||||
assertEquals( "NaturalId Cache Queries", 0, stats.getNaturalIdQueryExecutionCount() );
|
||||
|
||||
|
||||
|
||||
//Try NaturalIdLoadAccess after insert
|
||||
|
||||
|
||||
Session s = openSession();
|
||||
Transaction tx = s.beginTransaction();
|
||||
State france = this.getState( s, "Ile de France" );
|
||||
|
@ -188,8 +194,8 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
|
|||
// cleanup
|
||||
tx.rollback();
|
||||
s.close();
|
||||
|
||||
|
||||
|
||||
|
||||
//Try NaturalIdLoadAccess
|
||||
|
||||
s = openSession();
|
||||
|
@ -211,9 +217,9 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
|
|||
tx.rollback();
|
||||
s.close();
|
||||
|
||||
|
||||
|
||||
//Try NaturalIdLoadAccess after load
|
||||
|
||||
|
||||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
france = this.getState( s, "Ile de France" );
|
||||
|
@ -238,6 +244,7 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testNaturalIdUncached() {
|
||||
saveSomeCitizens();
|
||||
|
||||
|
@ -252,7 +259,7 @@ public class NaturalIdTest extends BaseCoreFunctionalTestCase {
|
|||
)
|
||||
);
|
||||
criteria.setCacheable( false );
|
||||
|
||||
|
||||
this.cleanupCache();
|
||||
|
||||
Statistics stats = sessionFactory().getStatistics();
|
||||
|
|
|
@ -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.assertNull;
|
||||
|
@ -35,7 +36,9 @@ import static org.junit.Assert.assertNull;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
public class NotFoundTest extends BaseCoreFunctionalTestCase {
|
||||
|
||||
@Test
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testManyToOne() throws Exception {
|
||||
Currency euro = new Currency();
|
||||
euro.setName( "Euro" );
|
||||
|
|
|
@ -47,7 +47,7 @@ import org.hibernate.test.annotations.Discount;
|
|||
import org.hibernate.test.annotations.Passport;
|
||||
import org.hibernate.test.annotations.Ticket;
|
||||
import org.hibernate.test.annotations.TicketComparator;
|
||||
import org.hibernate.testing.FailureExpected;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
@ -66,6 +66,7 @@ import static org.junit.Assert.fail;
|
|||
* @author Hardy Ferentschik
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class OneToManyTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testColumnDefinitionPropagation() throws Exception {
|
||||
|
@ -307,7 +308,7 @@ public class OneToManyTest extends BaseCoreFunctionalTestCase {
|
|||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
Troop troop = ( Troop ) s.get( Troop.class, disney.getId() );
|
||||
Soldier soldier = ( Soldier ) troop.getSoldiers().iterator().next();
|
||||
Soldier soldier = troop.getSoldiers().iterator().next();
|
||||
tx.commit();
|
||||
s.close();
|
||||
troop.getSoldiers().clear();
|
||||
|
|
|
@ -26,6 +26,7 @@ package org.hibernate.test.annotations.onetomany;
|
|||
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;
|
||||
|
@ -33,6 +34,7 @@ import static org.junit.Assert.assertEquals;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class OrderByTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testOrderByOnIdClassProperties() throws Exception {
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.hibernate.test.annotations.Customer;
|
|||
import org.hibernate.test.annotations.Discount;
|
||||
import org.hibernate.test.annotations.Passport;
|
||||
import org.hibernate.test.annotations.Ticket;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
|
@ -50,6 +51,7 @@ import static org.junit.Assert.assertTrue;
|
|||
/**
|
||||
* @author Emmanuel Bernard
|
||||
*/
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class OneToOneTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testEagerFetching() throws Exception {
|
||||
|
@ -231,7 +233,7 @@ public class OneToOneTest extends BaseCoreFunctionalTestCase {
|
|||
party.partyId = "id";
|
||||
party.partyAffiliate = affiliate;
|
||||
affiliate.party = party;
|
||||
|
||||
|
||||
s.persist( party );
|
||||
s.getTransaction().commit();
|
||||
|
||||
|
@ -342,14 +344,14 @@ public class OneToOneTest extends BaseCoreFunctionalTestCase {
|
|||
s.persist( owner );
|
||||
s.flush();
|
||||
s.clear();
|
||||
|
||||
|
||||
owner = ( Owner ) s.get( Owner.class, owner.getId() );
|
||||
assertNotNull( owner );
|
||||
assertNotNull( owner.getAddress() );
|
||||
assertEquals( owner.getId(), owner.getAddress().getId() );
|
||||
s.flush();
|
||||
s.clear();
|
||||
|
||||
|
||||
address = ( OwnerAddress ) s.get( OwnerAddress.class, address.getId() );
|
||||
assertNotNull( address );
|
||||
assertNotNull( address.getOwner() );
|
||||
|
@ -383,7 +385,7 @@ public class OneToOneTest extends BaseCoreFunctionalTestCase {
|
|||
tx.rollback();
|
||||
s.close();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Class[] getAnnotatedClasses() {
|
||||
return new Class[] {
|
||||
|
@ -414,31 +416,32 @@ public class OneToOneTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
|
||||
/**
|
||||
* Verifies that generated 'select' statement has desired number of joins
|
||||
* Verifies that generated 'select' statement has desired number of joins
|
||||
* @author Sharath Reddy
|
||||
*
|
||||
*/
|
||||
class JoinCounter extends EmptyInterceptor {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -3689681272273261051L;
|
||||
|
||||
|
||||
private int expectedNumberOfJoins = 0;
|
||||
|
||||
|
||||
public JoinCounter(int val) {
|
||||
super();
|
||||
this.expectedNumberOfJoins = val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onPrepareStatement(String sql) {
|
||||
int numberOfJoins = 0;
|
||||
if (sql.startsWith("select") & !sql.contains("nextval")) {
|
||||
numberOfJoins = count(sql, "join");
|
||||
assertEquals( expectedNumberOfJoins, numberOfJoins );
|
||||
}
|
||||
|
||||
|
||||
return sql;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Count the number of instances of substring within a string.
|
||||
*
|
||||
|
@ -459,5 +462,5 @@ class JoinCounter extends EmptyInterceptor {
|
|||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue