HHH-7474: Added @FailureExpectedWithNewMetamodel annotation to all remaining tests that fail with the new metamodel, but still a couple of strange failures happening with some Envers tests.

This commit is contained in:
John Verhaeg 2012-07-26 15:32:19 -05:00
parent 952d8b230b
commit d7c4128826
233 changed files with 1245 additions and 665 deletions

View File

@ -55,8 +55,12 @@ public class OrmVersion1SupportedTest extends BaseCoreFunctionalTestCase {
action = "countInvocation()",
name = "testOrm1Support")
})
@FailureExpectedWithNewMetamodel
@FailureExpectedWithNewMetamodel // This doesn't actually work since this test class requires BMUnitRunner instead of
// CustomRunner. Thus, the if block below skips the test if the new metamodel is being used.
public void testOrm1Support() {
if ( Boolean.getBoolean( USE_NEW_METADATA_MAPPINGS ) ) {
return;
}
// need to call buildSessionFactory, because this test is not using org.hibernate.testing.junit4.CustomRunner
buildSessionFactory();

View File

@ -26,6 +26,7 @@ package org.hibernate.test.any;
import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -33,6 +34,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
* @author Steve Ebersole
*/
@TestForIssue( jiraKey = "HHH-1663" )
@FailureExpectedWithNewMetamodel
public class AnyTypeTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -27,6 +27,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -43,6 +44,7 @@ public class ArrayTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testArrayJoinFetch() throws Exception {
Session s;
Transaction tx;

View File

@ -31,6 +31,7 @@ import org.junit.Test;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -48,6 +49,7 @@ public class BatchFetchTest extends BaseCoreFunctionalTestCase {
@SuppressWarnings( {"unchecked"})
@Test
@FailureExpectedWithNewMetamodel
public void testBatchFetch() {
Session s = openSession();
Transaction t = s.beginTransaction();

View File

@ -32,6 +32,7 @@ import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -42,7 +43,9 @@ import static org.junit.Assert.assertTrue;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class AuctionTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "bidi/Auction.hbm.xml" };
}

View File

@ -30,6 +30,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -43,6 +44,7 @@ import static org.junit.Assert.assertNull;
* @author Steve Ebersole
*/
public class InsertedDataTest extends BaseCoreFunctionalTestCase {
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class[] { CacheableItem.class };
@ -56,6 +58,7 @@ public class InsertedDataTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testInsert() {
sessionFactory().getCache().evictEntityRegions();
sessionFactory().getStatistics().clear();
@ -95,6 +98,7 @@ public class InsertedDataTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testInsertThenUpdate() {
sessionFactory().getCache().evictEntityRegions();
sessionFactory().getStatistics().clear();
@ -119,6 +123,7 @@ public class InsertedDataTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testInsertThenUpdateThenRollback() {
sessionFactory().getCache().evictEntityRegions();
sessionFactory().getStatistics().clear();
@ -143,6 +148,7 @@ public class InsertedDataTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testInsertWithRefresh() {
sessionFactory().getCache().evictEntityRegions();
sessionFactory().getStatistics().clear();
@ -193,6 +199,7 @@ public class InsertedDataTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testInsertWithClear() {
sessionFactory().getCache().evictEntityRegions();
sessionFactory().getStatistics().clear();

View File

@ -28,6 +28,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.TransientObjectException;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -40,6 +41,7 @@ import static org.junit.Assert.fail;
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class MultiPathCascadeTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -33,6 +33,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.jdbc.Work;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -42,6 +43,7 @@ import static org.junit.Assert.assertEquals;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class RefreshTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -31,6 +31,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -42,15 +43,16 @@ import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
/**
* Tests the use of composite-id with a generator.
* Test this behavior in all the various entity states (transient, managed, detached)
* Tests the use of composite-id with a generator.
* Test this behavior in all the various entity states (transient, managed, detached)
* and the different state transitions.
*
*
* For HHH-2060.
*
*
* @author Jacob Robertson
*/
@TestForIssue( jiraKey = "HHH-2060" )
@FailureExpectedWithNewMetamodel
public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
private DateFormat df = SimpleDateFormat.getDateTimeInstance( DateFormat.LONG, DateFormat.LONG );
@ -77,10 +79,10 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
assertNotNull(generatedId);
assertNotNull( generatedId.getPurchaseSequence() );
assertTrue(generatedId.getPurchaseNumber() > 0);
s = openSession();
t = s.beginTransaction();
// find the record, and see that the ids match
PurchaseRecord find = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId);
assertNotNull(find);
@ -92,11 +94,11 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
s = openSession();
t = s.beginTransaction();
// generate another new record
PurchaseRecord record2 = new PurchaseRecord();
s.persist(record2);
t.commit();
s.close();
@ -105,12 +107,12 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
s = openSession();
t = s.beginTransaction();
PurchaseRecord find2 = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId2);
t.commit();
s.close();
// test that the ids are different
PurchaseRecord.Id id1 = find.getId();
PurchaseRecord.Id id2 = find2.getId();
@ -118,7 +120,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
String seq2 = id2.getPurchaseSequence();
int num1 = id1.getPurchaseNumber();
int num2 = id2.getPurchaseNumber();
assertEquals( df.format(timestamp2), df.format(find2.getTimestamp()) );
assertFalse( id1.equals(id2) );
assertFalse( seq1.equals(seq2) );
@ -133,7 +135,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
// persist the record
PurchaseRecord record = new PurchaseRecord();
s.persist(record);
// close session so we know the record is detached
t.commit();
s.close();
@ -144,34 +146,34 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
Date persistedTimestamp = record.getTimestamp();
Date newTimestamp = new Date(persistedTimestamp.getTime() + 1);
record.setTimestamp(newTimestamp);
s = openSession();
t = s.beginTransaction();
PurchaseRecord find = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId);
t.commit();
s.close();
// see that we get the original id, and the original timestamp
assertEquals( generatedId, find.getId() );
assertEquals( df.format(persistedTimestamp), df.format(find.getTimestamp()) );
s = openSession();
t = s.beginTransaction();
// update with the new timestamp
s.update(record);
t.commit();
s.close();
// find the newly updated record
s = openSession();
t = s.beginTransaction();
PurchaseRecord find2 = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId);
t.commit();
s.close();
@ -195,27 +197,27 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
record2.setTimestamp(timestamp2);
s.persist(record1);
s.persist(record2);
// close session so we know the records are detached
t.commit();
s.close();
PurchaseRecord.Id generatedId1 = record1.getId();
PurchaseRecord.Id generatedId2 = record2.getId();
// change the ids around - effectively making record1 have the same id as record2
// do not persist yet
PurchaseRecord.Id toChangeId1 = new PurchaseRecord.Id();
toChangeId1.setPurchaseNumber( record2.getId().getPurchaseNumber() );
toChangeId1.setPurchaseSequence( record2.getId().getPurchaseSequence() );
record1.setId(toChangeId1);
s = openSession();
t = s.beginTransaction();
PurchaseRecord find1 = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId1);
PurchaseRecord find2 = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId2);
t.commit();
s.close();
@ -225,13 +227,13 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
assertEquals( df.format(timestamp1), df.format(find1.getTimestamp()) );
assertEquals( generatedId2, find2.getId() );
assertEquals( df.format(timestamp2), df.format(find2.getTimestamp()) );
s = openSession();
t = s.beginTransaction();
// update with the new changed record id
s.update(record1);
t.commit();
s.close();
@ -240,13 +242,13 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
assertSame(toChangeId1, foundId1);
assertEquals( toChangeId1.getPurchaseNumber(), foundId1.getPurchaseNumber() );
assertEquals( toChangeId1.getPurchaseSequence(), foundId1.getPurchaseSequence() );
// find record 2 and see that it has the timestamp originally found in record 1
s = openSession();
t = s.beginTransaction();
find2 = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId2);
t.commit();
s.close();
@ -267,7 +269,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
PurchaseRecord record = new PurchaseRecord();
record.setTimestamp(timestamp1);
s.saveOrUpdate(record);
t.commit();
s.close();
@ -275,15 +277,15 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
PurchaseRecord.Id generatedId = record.getId();
assertNotNull(generatedId);
assertNotNull( generatedId.getPurchaseSequence() );
// change the timestamp
record.setTimestamp(timestamp2);
s = openSession();
t = s.beginTransaction();
s.saveOrUpdate(record);
t.commit();
s.close();
@ -300,24 +302,24 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
// persist the record, then get the id and timestamp back
PurchaseRecord record = new PurchaseRecord();
s.persist(record);
t.commit();
s.close();
PurchaseRecord.Id id = record.getId();
Date timestamp = record.getTimestamp();
// using the given id, load a transient record
PurchaseRecord toLoad = new PurchaseRecord();
s = openSession();
t = s.beginTransaction();
s.load(toLoad, id);
t.commit();
s.close();
// show that the correct timestamp and ids were loaded
assertEquals( id, toLoad.getId() );
assertEquals( df.format(timestamp), df.format(toLoad.getTimestamp()) );
@ -330,34 +332,34 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
Date timestamp1 = new Date();
Date timestamp2 = new Date(timestamp1.getTime() + 1);
// persist the record, then evict it, then make changes to it ("within" the session)
PurchaseRecord record = new PurchaseRecord();
record.setTimestamp(timestamp1);
s.persist(record);
s.flush();
s.evict(record);
record.setTimestamp(timestamp2);
t.commit();
s.close();
PurchaseRecord.Id generatedId = record.getId();
// now, re-fetch the record and show that the timestamp change wasn't persisted
s = openSession();
t = s.beginTransaction();
PurchaseRecord persistent = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId);
t.commit();
s.close();
assertEquals( generatedId, persistent.getId() );
assertEquals( df.format(timestamp1), df.format(persistent.getTimestamp()) );
}
@Test
public void testMerge() {
Session s = openSession();
@ -369,7 +371,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
// persist the record
PurchaseRecord record = new PurchaseRecord();
s.persist(record);
t.commit();
s.close();
@ -377,7 +379,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
PurchaseRecord.Id generatedId = record.getId();
assertNotNull(generatedId);
assertNotNull( generatedId.getPurchaseSequence() );
s = openSession();
t = s.beginTransaction();
@ -385,18 +387,18 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
PurchaseRecord detached = record;
detached.setTimestamp(timestamp2);
PurchaseRecord persistent = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId);
// show that the timestamp hasn't changed
assertEquals( df.format(timestamp1), df.format(persistent.getTimestamp()) );
s.merge(detached);
t.commit();
s.close();
// show that the persistent object was changed only after the session flush
assertEquals( timestamp2, persistent.getTimestamp() );
// show that the persistent store was updated - not just the in-memory object
s = openSession();
t = s.beginTransaction();
@ -405,7 +407,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
t.commit();
s.close();
assertEquals( df.format(timestamp2), df.format(persistent.getTimestamp()) );
}
@ -417,12 +419,12 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
// persist the record
PurchaseRecord record = new PurchaseRecord();
s.saveOrUpdate(record);
t.commit();
s.close();
PurchaseRecord.Id generatedId = record.getId();
// re-fetch, then delete the record
s = openSession();
t = s.beginTransaction();
@ -430,7 +432,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
PurchaseRecord find = (PurchaseRecord) s.get(PurchaseRecord.class, generatedId);
s.delete(find);
assertFalse( s.contains(find) );
t.commit();
s.close();
@ -442,13 +444,13 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
t.commit();
s.close();
assertNull(find);
}
@Test
public void testGeneratedIdsWithChildren() {
Session s = openSession();
Transaction t = s.beginTransaction();
@ -459,17 +461,17 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
details.add( new PurchaseDetail(record, "p@2", 2) );
s.persist(record);
t.commit();
s.close();
// show that the ids were generated (non-zero) and come out the same
int foundPurchaseNumber = record.getId().getPurchaseNumber();
String foundPurchaseSequence = record.getId().getPurchaseSequence();
assertNotNull( record.getId() );
assertTrue(foundPurchaseNumber > 0);
assertNotNull(foundPurchaseSequence);
// search on detail1 by itself and show it got the parent's id
s = openSession();
t = s.beginTransaction();
@ -478,7 +480,7 @@ public class CompositeIdWithGeneratorTest extends BaseCoreFunctionalTestCase {
PurchaseRecord foundRecord = (PurchaseRecord) s.get(PurchaseRecord.class,
new PurchaseRecord.Id(foundPurchaseNumber, foundPurchaseSequence)
);
t.commit();
s.close();

View File

@ -30,6 +30,7 @@ import org.hibernate.LockMode;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.internal.util.SerializationHelper;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertNotNull;
@ -42,6 +43,7 @@ import static org.junit.Assert.assertTrue;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class BackrefCompositeMapKeyTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -28,6 +28,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.collection.internal.PersistentBag;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertFalse;
@ -45,6 +46,7 @@ public class PersistentBagTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testWriteMethodDirtying() {
BagOwner parent = new BagOwner( "root" );
BagOwner child = new BagOwner( "c1" );

View File

@ -23,9 +23,12 @@
*/
package org.hibernate.test.collection.custom.basic;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class UserCollectionTypeAnnotationsVariantTest extends UserCollectionTypeTest {
@Override
protected Class<?>[] getAnnotatedClasses() {

View File

@ -23,9 +23,12 @@
*/
package org.hibernate.test.collection.custom.basic;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class UserCollectionTypeHbmVariantTest extends UserCollectionTypeTest {
@Override
public String[] getMappings() {

View File

@ -23,9 +23,12 @@
*/
package org.hibernate.test.collection.custom.parameterized;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class ParameterizedUserCollectionTypeAnnotationsVariantTest extends ParameterizedUserCollectionTypeTest {
@Override
protected Class<?>[] getAnnotatedClasses() {

View File

@ -23,10 +23,14 @@
*/
package org.hibernate.test.collection.custom.parameterized;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class ParameterizedUserCollectionTypeHbmVariantTest extends ParameterizedUserCollectionTypeTest {
@Override
public String[] getMappings() {
return new String[] { "collection/custom/parameterized/Mapping.hbm.xml" };
}

View File

@ -28,6 +28,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.collection.internal.PersistentIdentifierBag;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertFalse;
@ -45,6 +46,7 @@ public class PersistentIdBagTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testWriteMethodDirtying() {
IdbagOwner parent = new IdbagOwner( "root" );
IdbagOwner child = new IdbagOwner( "c1" );

View File

@ -40,6 +40,7 @@ import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.collection.QueryableCollection;
import org.hibernate.sql.SimpleSelect;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -121,6 +122,7 @@ public class PersistentListTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testWriteMethodDirtying() {
ListOwner parent = new ListOwner( "root" );
ListOwner child = new ListOwner( "c1" );

View File

@ -28,6 +28,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.collection.internal.PersistentMap;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -41,6 +42,7 @@ import static org.junit.Assert.assertTrue;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class PersistentMapTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -27,11 +27,13 @@ import org.hibernate.Session;
import org.junit.Test;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class OrderCollectionOfJoinedHierarchyTest extends BaseCoreFunctionalTestCase {
@Override
protected Class<?>[] getAnnotatedClasses() {

View File

@ -30,6 +30,7 @@ import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -42,6 +43,7 @@ import static org.junit.Assert.assertTrue;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class CollectionTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -26,11 +26,14 @@ package org.hibernate.test.collection.set;
import org.junit.Test;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class PersistentSetNonLazyTest extends PersistentSetTest {
@Override
public String[] getMappings() {
return new String[] { "collection/set/MappingsNonLazy.hbm.xml" };
}

View File

@ -35,6 +35,7 @@ import org.hibernate.collection.internal.PersistentSet;
import org.hibernate.criterion.Restrictions;
import org.hibernate.stat.CollectionStatistics;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -44,6 +45,7 @@ import static org.junit.Assert.assertTrue;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class PersistentSetTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -26,6 +26,7 @@ package org.hibernate.test.component.basic2;
import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
/**
@ -33,6 +34,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class ComponentJoinsTest extends BaseCoreFunctionalTestCase {
@Override
public Class[] getAnnotatedClasses() {

View File

@ -28,6 +28,7 @@ import java.util.Locale;
import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -35,7 +36,9 @@ import static org.junit.Assert.assertEquals;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class CascadeToComponentCollectionTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "component/cascading/collection/Mappings.hbm.xml" };
}

View File

@ -26,6 +26,7 @@ package org.hibernate.test.component.cascading.toone;
import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertNotNull;
@ -41,6 +42,7 @@ public class CascadeToComponentAssociationTest extends BaseCoreFunctionalTestCas
}
@Test
@FailureExpectedWithNewMetamodel
public void testMerging() {
// step1, we create a document with owner
Session session = openSession();

View File

@ -35,6 +35,7 @@ import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.mapping.Collection;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.Formula;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.type.StandardBasicTypes;
@ -43,6 +44,7 @@ import static org.junit.Assert.assertEquals;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class CompositeElementTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
@ -56,7 +58,7 @@ public class CompositeElementTest extends BaseCoreFunctionalTestCase {
Component childComponents = ( Component ) children.getElement();
Formula f = ( Formula ) childComponents.getProperty( "bioLength" ).getValue().getColumnIterator().next();
SQLFunction lengthFunction = ( SQLFunction ) dialect.getFunctions().get( "length" );
SQLFunction lengthFunction = dialect.getFunctions().get( "length" );
if ( lengthFunction != null ) {
ArrayList args = new ArrayList();
args.add( "bio" );

View File

@ -17,6 +17,7 @@ import org.hibernate.cfg.Environment;
import org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory;
import org.hibernate.internal.util.SerializationHelper;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.jta.TestingJtaBootstrap;
import org.hibernate.testing.jta.TestingJtaPlatformImpl;
@ -29,6 +30,7 @@ import static org.junit.Assert.fail;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class AggressiveReleaseTest extends ConnectionManagementTestCase {
@Override
public void configure(Configuration cfg) {

View File

@ -27,12 +27,14 @@ import org.hibernate.ConnectionReleaseMode;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* Implementation of BasicConnectionProviderTest.
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class BasicConnectionProviderTest extends ConnectionManagementTestCase {
@Override
protected Session getSessionUnderTest() {

View File

@ -24,12 +24,14 @@
package org.hibernate.test.connections;
import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* Implementation of CurrentSessionConnectionTest.
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class CurrentSessionConnectionTest extends AggressiveReleaseTest {
@Override
protected Session getSessionUnderTest() throws Throwable {

View File

@ -33,6 +33,7 @@ import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertFalse;
@ -42,6 +43,7 @@ import static org.junit.Assert.assertFalse;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class HibernateCreateBlobFailedCase extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -36,6 +36,7 @@ import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.service.spi.Stoppable;
import org.hibernate.testing.AfterClassOnce;
import org.hibernate.testing.BeforeClassOnce;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.env.ConnectionProviderBuilder;
import org.hibernate.tool.hbm2ddl.SchemaExport;
@ -44,6 +45,7 @@ import org.hibernate.tool.hbm2ddl.SchemaExport;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class SuppliedConnectionTest extends ConnectionManagementTestCase {
private ConnectionProvider cp = ConnectionProviderBuilder.buildConnectionProvider();
private Connection connectionUnderTest;

View File

@ -32,6 +32,7 @@ import org.hibernate.cfg.Environment;
import org.hibernate.context.internal.ThreadLocalSessionContext;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.transaction.spi.LocalStatus;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@ -41,6 +42,7 @@ import static org.junit.Assert.fail;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class ThreadLocalCurrentSessionTest extends ConnectionManagementTestCase {
@Override
public void configure(Configuration cfg) {

View File

@ -31,6 +31,7 @@ import org.junit.Test;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -94,6 +95,7 @@ import static org.junit.Assert.assertEquals;
* @link https://hibernate.onjira.com/browse/HHH-4630
*/
@FailureExpectedWithNewMetamodel
public class ComplexJoinAliasTest extends BaseCoreFunctionalTestCase {
@Override

View File

@ -61,6 +61,7 @@ import org.hibernate.internal.util.SerializationHelper;
import org.hibernate.test.hql.Animal;
import org.hibernate.test.hql.Reptile;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
@ -81,6 +82,7 @@ import static org.junit.Assert.fail;
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
*/
@RequiresDialectFeature(DialectChecks.SupportsSequences.class)
@FailureExpectedWithNewMetamodel
public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
@ -1811,7 +1813,7 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
assertEquals( 1, result.size() );
assertEquals( kinga, result.get( 0 ) );
}
tx.commit();
session.close();
@ -1906,13 +1908,13 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
session.close();
}
@Test
@TestForIssue(jiraKey = "HHH-7194")
public void testNestedCorrelatedSubquery() throws Exception {
Session session = openSession();
Transaction t = session.beginTransaction();
Course course = new Course();
course.setCourseCode("HIB");
course.setDescription("Hibernate Training");
@ -1922,7 +1924,7 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
gavin.setName("Gavin King");
gavin.setStudentNumber(232);
gavin.setPreferredCourse(course);
Enrolment enrolment = new Enrolment();
enrolment.setCourse( course );
enrolment.setCourseCode( course.getCourseCode() );
@ -1934,13 +1936,13 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
session.persist(course);
session.persist(gavin);
session.persist(enrolment);
session.flush();
session.clear();
//execute a nested subquery
DetachedCriteria mainCriteria = DetachedCriteria.forClass(Student.class, "student");
DetachedCriteria nestedSubQuery = DetachedCriteria.forClass( Enrolment.class, "maxStudentEnrolment" );
nestedSubQuery.add(Restrictions.eqProperty("student.preferredCourse", "maxStudentEnrolment.course"));
nestedSubQuery.setProjection(Projections.max("maxStudentEnrolment.year"));
@ -1948,14 +1950,14 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
DetachedCriteria subQuery = DetachedCriteria.forClass( Enrolment.class, "enrolment" );
subQuery.add(Subqueries.propertyEq("enrolment.year", nestedSubQuery));
subQuery.setProjection(Projections.property("student"));
mainCriteria.add(Subqueries.exists(subQuery));
//query should complete and return gavin in the list
List results = mainCriteria.getExecutableCriteria(session).list();
assertEquals(1, results.size());
assertEquals(gavin.getStudentNumber(), ((Student) results.get(0)).getStudentNumber());
t.rollback();
session.close();
}
@ -1968,7 +1970,7 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
Student gavin = new Student();
gavin.setName("Gavin King");
gavin.setStudentNumber(232);
Country gb = new Country("GB", "United Kingdom");
Country fr = new Country("FR", "France");
session.persist(gb);
@ -1980,21 +1982,21 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
studyAbroads.add(sa1);
studyAbroads.add(sa2);
gavin.setStudyAbroads(studyAbroads);
session.persist(gavin);
session.flush();
session.clear();
List results = session.createCriteria(Student.class)
.setFetchMode("studyAbroads", FetchMode.JOIN)
.setFetchMode("studyAbroads.country", FetchMode.JOIN)
.list();
assertEquals(results.size(), 2);
Student st = (Student)results.get(0);
assertNotNull(st.getStudyAbroads());
assertTrue(Hibernate.isInitialized(st.getStudyAbroads()));
assertEquals(st.getStudyAbroads().size(), 2);
@ -2006,10 +2008,10 @@ public class CriteriaQueryTest extends BaseCoreFunctionalTestCase {
session.delete(st);
session.delete(c1);
session.delete(c2);
t.commit();
session.close();
}
}

View File

@ -32,6 +32,7 @@ import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -44,11 +45,14 @@ import static org.junit.Assert.assertTrue;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "cuk/Person.hbm.xml" };
}
@Override
public void configure(Configuration cfg) {
cfg.setProperty(Environment.DEFAULT_BATCH_FETCH_SIZE, "1");
}
@ -78,7 +82,7 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase {
s.save(act);
s.flush();
s.clear();
p = (Person) s.get( Person.class, p.getId() ); //get address reference by outer join
p2 = (Person) s.get( Person.class, p2.getId() ); //get null address reference by outer join
assertNull( p2.getAddress() );
@ -87,13 +91,13 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase {
assertEquals( l.size(), 2 );
assertTrue( l.contains(p) && l.contains(p2) );
s.clear();
l = s.createQuery("from Person p order by p.name").list(); //get address references by sequential selects
assertEquals( l.size(), 2 );
assertNull( ( (Person) l.get(0) ).getAddress() );
assertNotNull( ( (Person) l.get(1) ).getAddress() );
s.clear();
l = s.createQuery("from Person p left join fetch p.address a order by a.country").list(); //get em by outer join
assertEquals( l.size(), 2 );
if ( ( (Person) l.get(0) ).getName().equals("Max") ) {
@ -105,7 +109,7 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase {
assertNotNull( ( (Person) l.get(0) ).getAddress() );
}
s.clear();
l = s.createQuery("from Person p left join p.accounts").list();
for ( int i=0; i<2; i++ ) {
Object[] row = (Object[]) l.get(i);
@ -125,13 +129,13 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase {
assertTrue( Hibernate.isInitialized( p1.getAccounts() ) );
assertEquals( p1.getAccounts().size(), 0 );
s.clear();
l = s.createQuery("from Account a join fetch a.user").list();
s.clear();
l = s.createQuery("from Person p left join fetch p.address").list();
s.clear();
s.createQuery( "delete Address" ).executeUpdate();
s.createQuery( "delete Account" ).executeUpdate();

View File

@ -33,6 +33,7 @@ import org.hibernate.criterion.Restrictions;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -41,6 +42,7 @@ import static org.junit.Assert.assertEquals;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
@ -51,32 +53,32 @@ public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase {
public void testCompositeUserType() {
Session s = openSession();
org.hibernate.Transaction t = s.beginTransaction();
Transaction tran = new Transaction();
tran.setDescription("a small transaction");
tran.setValue( new MonetoryAmount( new BigDecimal(1.5), Currency.getInstance("USD") ) );
s.persist(tran);
List result = s.createQuery("from Transaction tran where tran.value.amount > 1.0 and tran.value.currency = 'USD'").list();
assertEquals( result.size(), 1 );
tran.getValue().setCurrency( Currency.getInstance("AUD") );
result = s.createQuery("from Transaction tran where tran.value.amount > 1.0 and tran.value.currency = 'AUD'").list();
assertEquals( result.size(), 1 );
if ( !(getDialect() instanceof HSQLDialect) ) {
result = s.createQuery("from Transaction txn where txn.value = (1.5, 'AUD')").list();
assertEquals( result.size(), 1 );
result = s.createQuery("from Transaction where value = (1.5, 'AUD')").list();
assertEquals( result.size(), 1 );
}
s.delete(tran);
t.commit();
s.close();
}
@Test
@SkipForDialect( value = {SybaseASE15Dialect.class, DB2Dialect.class}, jiraKey = "HHH-6788,HHH-6867")
public void testCustomColumnReadAndWrite() {
@ -92,29 +94,29 @@ public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase {
// Test value conversion during insert
BigDecimal amountViaSql = (BigDecimal)s.createSQLQuery("select amount_millions from MutualFund").uniqueResult();
assertEquals(AMOUNT_MILLIONS.doubleValue(), amountViaSql.doubleValue(), 0.01d);
// Test projection
BigDecimal amountViaHql = (BigDecimal)s.createQuery("select f.holdings.amount from MutualFund f").uniqueResult();
assertEquals(AMOUNT.doubleValue(), amountViaHql.doubleValue(), 0.01d);
// Test restriction and entity load via criteria
BigDecimal one = new BigDecimal(1);
f = (MutualFund)s.createCriteria(MutualFund.class)
.add(Restrictions.between("holdings.amount", AMOUNT.subtract(one), AMOUNT.add(one)))
.uniqueResult();
assertEquals(AMOUNT.doubleValue(), f.getHoldings().getAmount().doubleValue(), 0.01d);
// Test predicate and entity load via HQL
f = (MutualFund)s.createQuery("from MutualFund f where f.holdings.amount between ? and ?")
.setBigDecimal(0, AMOUNT.subtract(one))
.setBigDecimal(1, AMOUNT.add(one))
.uniqueResult();
assertEquals(AMOUNT.doubleValue(), f.getHoldings().getAmount().doubleValue(), 0.01d);
s.delete(f);
t.commit();
s.close();
}
}

View File

@ -27,6 +27,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -34,7 +35,9 @@ import static org.junit.Assert.assertEquals;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class DeleteTransientEntityTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "deletetransient/Person.hbm.xml" };
}

View File

@ -30,6 +30,7 @@ import org.hibernate.Session;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.Configuration;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -39,6 +40,7 @@ import static org.junit.Assert.assertTrue;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class CustomDirtinessStrategyTest extends BaseCoreFunctionalTestCase {
private static final String INITIAL_NAME = "thing 1";
private static final String SUBSEQUENT_NAME = "thing 2";

View File

@ -30,10 +30,10 @@ import org.junit.Test;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.criterion.Property;
import org.hibernate.criterion.Restrictions;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -53,6 +53,7 @@ public class DiscriminatorTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testDiscriminatorSubclass() {
Session s = openSession();
Transaction t = s.beginTransaction();

View File

@ -31,6 +31,7 @@ import org.hibernate.cfg.Configuration;
import org.hibernate.test.dynamicentity.Company;
import org.hibernate.test.dynamicentity.Customer;
import org.hibernate.test.dynamicentity.ProxyHelper;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -65,6 +66,7 @@ public class InterceptorDynamicEntityTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testIt() {
// Test saving these dyna-proxies
Session session = openSession();

View File

@ -35,6 +35,7 @@ import org.hibernate.test.dynamicentity.Company;
import org.hibernate.test.dynamicentity.Customer;
import org.hibernate.test.dynamicentity.Person;
import org.hibernate.test.dynamicentity.ProxyHelper;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -53,6 +54,7 @@ import static org.junit.Assert.assertNotNull;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class TuplizerDynamicEntityTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -36,6 +36,7 @@ import org.hibernate.test.dynamicentity.Company;
import org.hibernate.test.dynamicentity.Customer;
import org.hibernate.test.dynamicentity.Person;
import org.hibernate.test.dynamicentity.ProxyHelper;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -54,10 +55,12 @@ import static org.junit.Assert.assertNotNull;
* @author Steve Ebersole
*/
public class ImprovedTuplizerDynamicEntityTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "dynamicentity/tuplizer2/Customer.hbm.xml" };
}
@Override
public void configure(Configuration cfg) {
super.configure( cfg );
cfg.getEntityTuplizerFactory().registerDefaultTuplizerClass( EntityMode.POJO, MyEntityTuplizer.class );
@ -65,6 +68,7 @@ public class ImprovedTuplizerDynamicEntityTest extends BaseCoreFunctionalTestCas
@Test
@SuppressWarnings( {"unchecked"})
@FailureExpectedWithNewMetamodel
public void testIt() {
// Test saving these dyna-proxies
Session session = openSession();

View File

@ -30,6 +30,7 @@ import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -41,6 +42,7 @@ import static org.junit.Assert.assertTrue;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class EmbeddedCompositeIdTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
@ -57,17 +59,17 @@ public class EmbeddedCompositeIdTest extends BaseCoreFunctionalTestCase {
s.persist(c);
t.commit();
s.close();
c.setDescription("Grade 5 English");
uc.setDescription("Second year mathematics");
s = openSession();
t = s.beginTransaction();
s.merge(c);
s.merge(uc);
t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
s.delete(c);
@ -116,7 +118,7 @@ public class EmbeddedCompositeIdTest extends BaseCoreFunctionalTestCase {
s.persist(c);
t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
Course ucid = new Course("mat2000", "Monash", null);
@ -160,17 +162,17 @@ public class EmbeddedCompositeIdTest extends BaseCoreFunctionalTestCase {
assertEquals( uc.getCourseCode(), "mat2000" );
t.commit();
s.close();
c.setDescription("Grade 5 English");
uc.setDescription("Second year mathematics");
s = openSession();
t = s.beginTransaction();
s.saveOrUpdate(c);
s.saveOrUpdate(uc);
t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
s.delete(c);

View File

@ -36,6 +36,7 @@ import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -45,6 +46,7 @@ import static org.junit.Assert.assertTrue;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class DynamicClassTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
@ -81,15 +83,15 @@ public class DynamicClassTest extends BaseCoreFunctionalTestCase {
s = openSession();
t = s.beginTransaction();
cars = (Map) s.createQuery("from ProductLine pl order by pl.description").uniqueResult();
models = (List) cars.get("models");
assertFalse( Hibernate.isInitialized(models) );
assertEquals( models.size(), 2);
assertTrue( Hibernate.isInitialized(models) );
s.clear();
List list = s.createQuery("from Model m").list();
for ( Iterator i=list.iterator(); i.hasNext(); ) {
assertFalse( Hibernate.isInitialized( ( (Map) i.next() ).get("productLine") ) );
@ -97,7 +99,7 @@ public class DynamicClassTest extends BaseCoreFunctionalTestCase {
Map model = (Map) list.get(0);
assertTrue( ( (List) ( (Map) model.get("productLine") ).get("models") ).contains(model) );
s.clear();
t.commit();
s.close();

View File

@ -28,11 +28,13 @@ import java.util.HashMap;
import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class SubclassDynamicMapTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -25,6 +25,7 @@ package org.hibernate.test.entityname;
import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -32,7 +33,9 @@ import static org.junit.Assert.assertEquals;
/**
* @author stliu
*/
@FailureExpectedWithNewMetamodel
public class EntityNameFromSubClassTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "entityname/Vehicle.hbm.xml" };
}
@ -50,7 +53,7 @@ public class EntityNameFromSubClassTest extends BaseCoreFunctionalTestCase {
s.save(stliu);
s.getTransaction().commit();
s.close();
s=openSession();
s.beginTransaction();
Person p = (Person)s.get(Person.class, stliu.getId());

View File

@ -27,11 +27,13 @@ import java.util.Collection;
import org.hibernate.test.event.collection.ParentWithCollection;
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
*
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class BidirectionalManyToManyBagToSetCollectionEventTest extends AbstractAssociationCollectionEventTest {
@Override
public String[] getMappings() {

View File

@ -27,11 +27,13 @@ import java.util.HashSet;
import org.hibernate.test.event.collection.ParentWithCollection;
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
*
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class BidirectionalManyToManySetToSetCollectionEventTest extends AbstractAssociationCollectionEventTest {
@Override
public String[] getMappings() {

View File

@ -31,10 +31,12 @@ import org.hibernate.test.event.collection.ChildEntity;
import org.hibernate.test.event.collection.ParentWithCollection;
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class UnidirectionalManyToManyBagCollectionEventTest extends AbstractAssociationCollectionEventTest {
@Override
public String[] getMappings() {

View File

@ -28,11 +28,13 @@ import java.util.Collection;
import org.hibernate.test.event.collection.AbstractCollectionEventTest;
import org.hibernate.test.event.collection.ParentWithCollection;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
*
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class ValuesBagCollectionEventTest extends AbstractCollectionEventTest {
@Override
public String[] getMappings() {

View File

@ -40,6 +40,7 @@ import org.hibernate.integrator.spi.Integrator;
import org.hibernate.metamodel.spi.source.MetadataImplementor;
import org.hibernate.service.BootstrapServiceRegistryBuilder;
import org.hibernate.service.spi.SessionFactoryServiceRegistry;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -100,6 +101,7 @@ public class CallbackTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testCallbacks() {
assertEquals( "observer not notified of creation", 1, observer.creationCount );
assertEquals( "listener not notified of creation", 1, listener.initCount );

View File

@ -34,6 +34,7 @@ import org.hibernate.dialect.MySQLMyISAMDialect;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.exception.SQLGrammarException;
import org.hibernate.jdbc.Work;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -44,7 +45,9 @@ import static org.junit.Assert.fail;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class SQLExceptionConversionTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] {"exception/User.hbm.xml", "exception/Group.hbm.xml"};
}

View File

@ -30,6 +30,7 @@ import org.junit.Test;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -41,6 +42,7 @@ import static org.junit.Assert.assertTrue;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
@ -57,7 +59,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
s.persist(gavin);
t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
gavin = (User) s.get(User.class, "gavin");
@ -84,7 +86,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
t.commit();
s.close();
}
@Test
public void testGet() {
Session s = openSession();
@ -119,7 +121,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
t.commit();
s.close();
}
@Test
public void testRemoveClear() {
Session s = openSession();
@ -162,7 +164,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
t.commit();
s.close();
}
@Test
public void testIndexFormulaMap() {
Session s = openSession();
@ -177,7 +179,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
gavin.getSession().put( "bar", new SessionAttribute("bar", "foo bar baz 2") );
t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
g = (Group) s.get(Group.class, "developers");
@ -215,7 +217,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
t.commit();
s.close();
}
@Test
public void testSQLQuery() {
Session s = openSession();
@ -237,7 +239,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
s.createQuery("delete User").executeUpdate();
t.commit();
s.close();
}
}

View File

@ -32,6 +32,7 @@ import org.hibernate.UnknownProfileException;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -45,14 +46,17 @@ import static org.junit.Assert.fail;
* @author Steve Ebersole
*/
public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "fetchprofiles/join/Mappings.hbm.xml" };
}
@Override
public String getCacheConcurrencyStrategy() {
return null;
}
@Override
public void configure(Configuration cfg) {
cfg.setProperty( Environment.GENERATE_STATISTICS, "true" );
}
@ -170,6 +174,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testBasicFetchProfileOperation() {
assertTrue( "fetch profile not parsed properly", sessionFactory().containsFetchProfileDefinition( "enrollment.details" ) );
assertTrue( "fetch profile not parsed properly", sessionFactory().containsFetchProfileDefinition( "offering.details" ) );
@ -232,6 +237,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testLoadOneToManyFetchProfile() {
performWithStandardData(
new TestCode() {
@ -251,6 +257,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testLoadDeepFetchProfile() {
performWithStandardData(
new TestCode() {
@ -274,6 +281,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testLoadComponentDerefFetchProfile() {
performWithStandardData(
new TestCode() {
@ -298,6 +306,7 @@ public class JoinFetchProfileTest extends BaseCoreFunctionalTestCase {
* TODO : this is actually not strictly true. what we should have happen is to subsequently load those fetches
*/
@Test
@FailureExpectedWithNewMetamodel
public void testHQL() {
performWithStandardData(
new TestCode() {

View File

@ -51,6 +51,7 @@ import org.hibernate.dialect.IngresDialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.transform.DistinctRootEntityResultTransformer;
@ -66,6 +67,7 @@ import static org.junit.Assert.assertTrue;
* @author Steve Ebersole
*/
@SkipForDialect( value = SybaseASE15Dialect.class, jiraKey = "HHH-3637")
@FailureExpectedWithNewMetamodel
public class DynamicFilterTest extends BaseCoreFunctionalTestCase {
private static final Logger log = Logger.getLogger( DynamicFilterTest.class );

View File

@ -26,6 +26,7 @@ package org.hibernate.test.filter.hql;
import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -35,6 +36,7 @@ import static org.junit.Assert.assertEquals;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class BasicFilteredBulkManipulationTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -27,6 +27,7 @@ import java.util.Date;
import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -34,7 +35,9 @@ import static org.junit.Assert.assertEquals;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class JoinedFilteredBulkManipulationTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] {
"filter/hql/filter-defs.hbm.xml",

View File

@ -33,7 +33,6 @@ import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.collection.internal.PersistentSet;
import org.hibernate.engine.spi.ActionQueue;
import org.hibernate.engine.spi.PersistenceContext;
import org.hibernate.engine.spi.SessionFactoryImplementor;
@ -47,17 +46,18 @@ import org.hibernate.internal.SessionImpl;
import org.hibernate.metamodel.spi.source.MetadataImplementor;
import org.hibernate.service.BootstrapServiceRegistryBuilder;
import org.hibernate.service.spi.SessionFactoryServiceRegistry;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* @author Gail Badner
*/
@TestForIssue( jiraKey = "HHH-6960" )
@FailureExpectedWithNewMetamodel
public class TestAutoFlushBeforeQueryExecution extends BaseCoreFunctionalTestCase {
@Test

View File

@ -37,6 +37,7 @@ import org.hibernate.integrator.spi.Integrator;
import org.hibernate.metamodel.spi.source.MetadataImplementor;
import org.hibernate.service.BootstrapServiceRegistryBuilder;
import org.hibernate.service.spi.SessionFactoryServiceRegistry;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -47,6 +48,7 @@ import static org.junit.Assert.assertTrue;
* @author Steve Ebersole
*/
@TestForIssue( jiraKey = "HHH-2763" )
@FailureExpectedWithNewMetamodel
public class TestCollectionInitializingDuringFlush extends BaseCoreFunctionalTestCase {
@Test
public void testInitializationDuringFlush() {

View File

@ -30,6 +30,7 @@ import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -38,7 +39,9 @@ import static org.junit.Assert.assertTrue;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class FormulaJoinTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "formulajoin/Master.hbm.xml" };
}
@ -65,7 +68,7 @@ public class FormulaJoinTest extends BaseCoreFunctionalTestCase {
s.persist(current);
tx.commit();
s.close();
if ( getDialect() instanceof PostgreSQLDialect || getDialect() instanceof PostgreSQL81Dialect ) return;
s = openSession();
@ -74,7 +77,7 @@ public class FormulaJoinTest extends BaseCoreFunctionalTestCase {
assertEquals( l.size(), 1 );
tx.commit();
s.close();
s = openSession();
tx = s.beginTransaction();
l = s.createQuery("from Master m left join fetch m.detail").list();
@ -84,14 +87,14 @@ public class FormulaJoinTest extends BaseCoreFunctionalTestCase {
assertTrue( m==m.getDetail().getMaster() );
tx.commit();
s.close();
s = openSession();
tx = s.beginTransaction();
l = s.createQuery("from Master m join fetch m.detail").list();
assertEquals( l.size(), 1 );
tx.commit();
s.close();
s = openSession();
tx = s.beginTransaction();
l = s.createQuery("from Detail d join fetch d.currentMaster.master").list();
@ -103,10 +106,10 @@ public class FormulaJoinTest extends BaseCoreFunctionalTestCase {
tx = s.beginTransaction();
l = s.createQuery("from Detail d join fetch d.currentMaster.master m join fetch m.detail").list();
assertEquals( l.size(), 2 );
s.createQuery("delete from Detail").executeUpdate();
s.createQuery("delete from Master").executeUpdate();
tx.commit();
s.close();

View File

@ -6,6 +6,7 @@ import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -17,12 +18,15 @@ import static org.junit.Assert.assertNull;
* @author Steve Ebersole
*/
@RequiresDialectFeature( DialectChecks.SupportsIdentityColumns.class )
@FailureExpectedWithNewMetamodel
public class IdentityGeneratedKeysTest extends BaseCoreFunctionalTestCase {
@Override
public void configure(Configuration cfg) {
super.configure( cfg );
cfg.setProperty( Environment.GENERATE_STATISTICS, "true" );
}
@Override
public String[] getMappings() {
return new String[] { "generatedkeys/identity/MyEntity.hbm.xml" };
}

View File

@ -36,6 +36,7 @@ import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -46,6 +47,7 @@ import static org.junit.Assert.assertTrue;
*
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
StateProvince stateProvince;
private Zoo zoo1;
@ -108,7 +110,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
zoo2Director2 = new Human();
zoo2Director2.setName( new Name( "Fat", 'A', "Cat" ) );
zoo2.getDirectors().put( "Head Honcho", zoo2Director1 );
zoo2.getDirectors().put( "Asst. Head Honcho", zoo2Director2 );
zoo2.getDirectors().put( "Asst. Head Honcho", zoo2Director2 );
zoo3 = new Zoo();
zoo3.setName( "Zoo" );
@ -183,7 +185,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
}
if ( zoo2Director2 != null ) {
s.delete( zoo2Director2 );
zoo2Director2 = null;
zoo2Director2 = null;
}
if ( stateProvince != null ) {
s.delete( stateProvince );

View File

@ -76,6 +76,7 @@ import org.hibernate.test.cid.Order;
import org.hibernate.test.cid.Product;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
@ -105,6 +106,7 @@ import static org.junit.Assert.fail;
*
* @author Steve
*/
@FailureExpectedWithNewMetamodel
public class ASTParserLoadingTest extends BaseCoreFunctionalTestCase {
private static final Logger log = Logger.getLogger( ASTParserLoadingTest.class );

View File

@ -39,6 +39,7 @@ import org.hibernate.id.BulkInsertionCapableIdentifierGenerator;
import org.hibernate.id.IdentifierGenerator;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipLog;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -53,7 +54,9 @@ import static org.junit.Assert.fail;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class BulkManipulationTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] {
"hql/Animal.hbm.xml",
@ -239,7 +242,7 @@ public class BulkManipulationTest extends BaseCoreFunctionalTestCase {
data.cleanup();
}
@Test
public void testInsertWithManyToOne() {
TestData data = new TestData();
@ -506,7 +509,7 @@ public class BulkManipulationTest extends BaseCoreFunctionalTestCase {
s.createQuery( "insert into CompositeIdEntity (key2, someProperty, key1) select a.key2, 'COPY', a.key1 from CompositeIdEntity a" ).executeUpdate();
s.createQuery( "delete from CompositeIdEntity" ).executeUpdate();
s.getTransaction().commit();
s.close();
s.close();
}
@Test
@ -1082,7 +1085,7 @@ public class BulkManipulationTest extends BaseCoreFunctionalTestCase {
data.cleanup();
}
@Test
public void testDeleteUnionSubclassAbstractRoot() {
TestData data = new TestData();

View File

@ -29,6 +29,7 @@ import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* Some simple test queries using the classic translator explicitly
@ -38,6 +39,7 @@ import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class ClassicTranslatorTest extends QueryTranslatorTestCase {
@Override
public void configure(Configuration cfg) {

View File

@ -34,6 +34,7 @@ import org.hibernate.hql.internal.ast.QueryTranslatorImpl;
import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory;
import org.hibernate.hql.spi.QueryTranslator;
import org.hibernate.hql.spi.QueryTranslatorFactory;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.type.BigDecimalType;
import org.hibernate.type.BigIntegerType;
import org.hibernate.type.DoubleType;
@ -46,6 +47,7 @@ import static org.junit.Assert.assertEquals;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class CriteriaClassicAggregationReturnTest extends QueryTranslatorTestCase {
@Override
public void configure(Configuration cfg) {

View File

@ -40,6 +40,7 @@ import org.hibernate.hql.internal.ast.tree.SelectClause;
import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory;
import org.hibernate.hql.spi.QueryTranslator;
import org.hibernate.hql.spi.QueryTranslatorFactory;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
import org.hibernate.type.BigDecimalType;
import org.hibernate.type.BigIntegerType;
@ -51,10 +52,11 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
/**
* Tests cases for ensuring alignment between HQL and Criteria behavior.
* Tests cases for ensuring alignment between HQL and Criteria behavior.
*
* @author Max Rydahl Andersen
*/
@FailureExpectedWithNewMetamodel
public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
private boolean initialVersion2SqlFlagValue;
@ -92,43 +94,43 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
QueryTranslatorImpl translator = createNewQueryTranslator( "select count(*) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] );
translator = createNewQueryTranslator( "select count(h.heightInches) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] );
// MAX, MIN return the type of the state-field to which they are applied.
// MAX, MIN return the type of the state-field to which they are applied.
translator = createNewQueryTranslator( "select max(h.heightInches) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] );
translator = createNewQueryTranslator( "select max(h.id) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] );
// AVG returns Double.
translator = createNewQueryTranslator( "select avg(h.heightInches) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] );
translator = createNewQueryTranslator( "select avg(h.id) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] );
translator = createNewQueryTranslator( "select avg(h.bigIntegerValue) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] );
// SUM returns Long when applied to state-fields of integral types (other than BigInteger);
translator = createNewQueryTranslator( "select sum(h.id) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] );
translator = createNewQueryTranslator( "select sum(h.intValue) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] );
// SUM returns Double when applied to state-fields of floating point types;
// SUM returns Double when applied to state-fields of floating point types;
translator = createNewQueryTranslator( "select sum(h.heightInches) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] );
@ -136,12 +138,12 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
translator = createNewQueryTranslator( "select sum(h.floatValue) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] );
// SUM returns BigInteger when applied to state-fields of type BigInteger
// SUM returns BigInteger when applied to state-fields of type BigInteger
translator = createNewQueryTranslator( "select sum(h.bigIntegerValue) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", BigIntegerType.INSTANCE, translator.getReturnTypes()[0] );
// SUM and BigDecimal when applied to state-fields of type BigDecimal.
translator = createNewQueryTranslator( "select sum(h.bigDecimalValue) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
@ -173,46 +175,46 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
assertEquals(longValue, new Long(1));
longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.count("heightInches")).uniqueResult();
assertEquals(longValue, new Long(1));
// MAX, MIN return the type of the state-field to which they are applied.
// MAX, MIN return the type of the state-field to which they are applied.
Double dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.max( "heightInches" )).uniqueResult();
assertNotNull(dblValue);
longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.max( "id" )).uniqueResult();
assertNotNull(longValue);
// AVG returns Double.
dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "heightInches" )).uniqueResult();
assertNotNull(dblValue);
dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "id" )).uniqueResult();
assertNotNull(dblValue);
dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "bigIntegerValue" )).uniqueResult();
assertNotNull(dblValue);
// SUM returns Long when applied to state-fields of integral types (other than BigInteger);
longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.sum( "id" )).uniqueResult();
assertNotNull(longValue);
longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.sum( "intValue" )).uniqueResult();
assertNotNull(longValue);
// SUM returns Double when applied to state-fields of floating point types;
// SUM returns Double when applied to state-fields of floating point types;
dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.sum( "heightInches" )).uniqueResult();
assertNotNull(dblValue);
dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.sum( "floatValue" )).uniqueResult();
assertNotNull(dblValue);
// SUM returns BigInteger when applied to state-fields of type BigInteger
// SUM returns BigInteger when applied to state-fields of type BigInteger
BigInteger bigIValue = (BigInteger) s.createCriteria( Human.class ).setProjection( Projections.sum( "bigIntegerValue" )).uniqueResult();
assertNotNull(bigIValue);
// SUM and BigDecimal when applied to state-fields of type BigDecimal.
BigDecimal bigDValue = (BigDecimal) s.createCriteria( Human.class ).setProjection( Projections.sum( "bigDecimalValue" )).uniqueResult();
assertNotNull(bigDValue);
s.delete( human );
s.flush();
s.getTransaction().commit();

View File

@ -39,6 +39,7 @@ import org.hibernate.hql.internal.ast.QueryTranslatorImpl;
import org.hibernate.hql.internal.ast.util.ASTUtil;
import org.hibernate.hql.spi.QueryTranslator;
import org.hibernate.hql.spi.QueryTranslatorFactory;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static junit.framework.Assert.assertEquals;
@ -47,6 +48,7 @@ import static junit.framework.Assert.assertTrue;
/**
* @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
*/
@FailureExpectedWithNewMetamodel
public class EJBQLTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -69,6 +69,7 @@ import org.hibernate.hql.spi.QueryTranslator;
import org.hibernate.hql.spi.QueryTranslatorFactory;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
@ -87,6 +88,7 @@ import static org.junit.Assert.assertTrue;
*
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class HQLTest extends QueryTranslatorTestCase {
@Override
public boolean createSchema() {
@ -131,7 +133,7 @@ public class HQLTest extends QueryTranslatorTestCase {
assertTranslation( "from Animal a where a.offspring.description = 'xyz'" );
assertTranslation( "from Animal a where a.offspring.father.description = 'xyz'" );
}
@Test
@FailureExpected( jiraKey = "N/A", message = "Lacking ClassicQueryTranslatorFactory support" )
public void testRowValueConstructorSyntaxInInList2() {
@ -180,7 +182,7 @@ public class HQLTest extends QueryTranslatorTestCase {
AST inNode = whereNode.getFirstChild();
assertEquals( message, expected, inNode != null && inNode.getType() == HqlTokenTypes.IN );
}
@Test
public void testSubComponentReferences() {
assertTranslation( "select c.address.zip.code from ComponentContainer c" );
@ -198,7 +200,7 @@ public class HQLTest extends QueryTranslatorTestCase {
public void testJoinFetchCollectionOfValues() {
assertTranslation( "select h from Human as h join fetch h.nickNames" );
}
@Test
public void testCollectionMemberDeclarations2() {
assertTranslation( "from Customer c, in(c.orders) o" );
@ -211,9 +213,9 @@ public class HQLTest extends QueryTranslatorTestCase {
public void testCollectionMemberDeclarations(){
// both these two query translators throw exeptions for this HQL since
// IN asks an alias, but the difference is that the error message from AST
// contains the error token location (by lines and columns), which is hardly
// contains the error token location (by lines and columns), which is hardly
// to get from Classic query translator --stliu
assertTranslation( "from Customer c, in(c.orders)" );
assertTranslation( "from Customer c, in(c.orders)" );
}
@Test
@ -346,7 +348,7 @@ public class HQLTest extends QueryTranslatorTestCase {
assertTranslation("from Animal where abs(:x - :y) < 2.0");
assertTranslation("from Animal where lower(upper(:foo)) like 'f%'");
if ( ! ( getDialect() instanceof SybaseDialect ) && ! ( getDialect() instanceof Sybase11Dialect ) && ! ( getDialect() instanceof SybaseASE15Dialect ) && ! ( getDialect() instanceof SQLServerDialect ) ) {
// Transact-SQL dialects (except SybaseAnywhereDialect) map the length function -> len;
// Transact-SQL dialects (except SybaseAnywhereDialect) map the length function -> len;
// classic translator does not consider that *when nested*;
// SybaseAnywhereDialect supports the length function
@ -744,13 +746,13 @@ public class HQLTest extends QueryTranslatorTestCase {
|| getDialect() instanceof Sybase11Dialect
|| getDialect() instanceof SybaseASE15Dialect
|| getDialect() instanceof SybaseAnywhereDialect
|| getDialect() instanceof SQLServerDialect
|| getDialect() instanceof SQLServerDialect
|| getDialect() instanceof IngresDialect) {
// SybaseASE15Dialect and SybaseAnywhereDialect support '||'
// MySQL uses concat(x, y, z)
// SQL Server replaces '||' with '+'
//
// this is syntax checked in {@link ASTParserLoadingTest#testConcatenation}
// this is syntax checked in {@link ASTParserLoadingTest#testConcatenation}
// Ingres supports both "||" and '+' but IngresDialect originally
// uses '+' operator; updated Ingres9Dialect to use "||".
return;

View File

@ -32,6 +32,7 @@ import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -48,7 +49,9 @@ import static org.junit.Assert.fail;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "hql/Animal.hbm.xml" };
}
@ -173,7 +176,7 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.previous() );
assertFalse( results.previous() );
assertTrue( results.next() );
assertTrue( results.isFirst() );
@ -217,7 +220,7 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
assertTrue( results.first() );
assertTrue( results.isFirst() );
assertTrue( results.isLast() );
assertTrue( results.isLast() );
for ( int i=1; i<3; i++ ) {
assertTrue( results.setRowNumber( 1 ) );
@ -424,7 +427,7 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
private void cleanup() {
Session s = openSession();
Transaction txn = s.beginTransaction();
s.createQuery( "delete Animal where description like 'grand%'" ).executeUpdate();
s.createQuery( "delete Animal where not description like 'root%'" ).executeUpdate();
s.createQuery( "delete Animal" ).executeUpdate();

View File

@ -31,6 +31,7 @@ import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.hql.internal.ast.InvalidWithClauseException;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertTrue;
@ -41,7 +42,9 @@ import static org.junit.Assert.fail;
*
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class WithClauseTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "hql/Animal.hbm.xml" };
}

View File

@ -26,12 +26,14 @@ package org.hibernate.test.hql.joinedSubclass;
import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class JoinedSubclassBulkManipTest extends BaseCoreFunctionalTestCase {
@Override
protected Class<?>[] getAnnotatedClasses() {

View File

@ -27,6 +27,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -35,11 +36,13 @@ import static org.junit.Assert.assertEquals;
* @author Emmanuel Bernard
*/
public class MultipleHiLoPerTableGeneratorTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[]{ "id/Car.hbm.xml", "id/Plane.hbm.xml", "id/Radio.hbm.xml" };
}
@Test
@FailureExpectedWithNewMetamodel
public void testDistinctId() throws Exception {
Session s = openSession();
Transaction tx = s.beginTransaction();
@ -60,7 +63,7 @@ public class MultipleHiLoPerTableGeneratorTest extends BaseCoreFunctionalTestCas
assertEquals(i+1, cars[i].getId().intValue());
//assertEquals(i+1, planes[i].getId().intValue());
}
s = openSession();
tx = s.beginTransaction();
s.createQuery( "delete from Car" ).executeUpdate();
@ -69,6 +72,7 @@ public class MultipleHiLoPerTableGeneratorTest extends BaseCoreFunctionalTestCas
}
@Test
@FailureExpectedWithNewMetamodel
public void testRollingBack() throws Throwable {
Session s = openSession();
Transaction tx = s.beginTransaction();
@ -102,6 +106,7 @@ public class MultipleHiLoPerTableGeneratorTest extends BaseCoreFunctionalTestCas
}
@Test
@FailureExpectedWithNewMetamodel
public void testAllParams() throws Exception {
Session s = openSession();
Transaction tx = s.beginTransaction();
@ -115,7 +120,7 @@ public class MultipleHiLoPerTableGeneratorTest extends BaseCoreFunctionalTestCas
assertEquals( new Integer(2), radio.getId() );
tx.commit();
s.close();
s = openSession();
tx = s.beginTransaction();
s.createQuery( "delete from Radio" ).executeUpdate();

View File

@ -31,6 +31,7 @@ import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -63,7 +64,7 @@ public class IdBagTest extends BaseCoreFunctionalTestCase {
s.persist(banned);
t.commit();
s.close();
s = openSession();
t = s.beginTransaction();
gavin = (User) s.createCriteria(User.class).uniqueResult();
@ -79,12 +80,13 @@ public class IdBagTest extends BaseCoreFunctionalTestCase {
s.delete(moderators);
s.delete(admins);
s.delete(gavin);
t.commit();
s.close();
s.close();
}
@Test
@FailureExpectedWithNewMetamodel
public void testJoin() throws HibernateException, SQLException {
Session s = openSession();
Transaction t = s.beginTransaction();
@ -96,22 +98,22 @@ public class IdBagTest extends BaseCoreFunctionalTestCase {
s.persist(gavin);
s.persist(plebs);
s.persist(admins);
List l = s.createQuery("from User u join u.groups g").list();
assertEquals( l.size(), 2 );
s.clear();
gavin = (User) s.createQuery("from User u join fetch u.groups").uniqueResult();
assertTrue( Hibernate.isInitialized( gavin.getGroups() ) );
assertEquals( gavin.getGroups().size(), 2 );
assertEquals( ( (Group) gavin.getGroups().get(0) ).getName(), "admins" );
s.delete( gavin.getGroups().get(0) );
s.delete( gavin.getGroups().get(1) );
s.delete(gavin);
t.commit();
s.close();
s.close();
}
}

View File

@ -27,6 +27,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -34,7 +35,9 @@ import static org.junit.Assert.assertEquals;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class IdClassTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "idclass/Customer.hbm.xml" };
}
@ -47,7 +50,7 @@ public class IdClassTest extends BaseCoreFunctionalTestCase {
s.persist(cust);
t.commit();
s.close();
s = openSession();
CustomerId custId = new CustomerId("JBoss", "RouteOne");
t = s.beginTransaction();
@ -56,7 +59,7 @@ public class IdClassTest extends BaseCoreFunctionalTestCase {
assertEquals( cust.getCustomerName(), custId.getCustomerName() );
assertEquals( cust.getOrgName(), custId.getOrgName() );
t.commit();
s.close();
s.close();
s = openSession();
t = s.beginTransaction();
@ -73,9 +76,9 @@ public class IdClassTest extends BaseCoreFunctionalTestCase {
assertEquals( "Detroit", cust.getAddress() );
assertEquals( cust.getCustomerName(), custId.getCustomerName() );
assertEquals( cust.getOrgName(), custId.getOrgName() );
s.createQuery( "delete from Customer" ).executeUpdate();
t.commit();
s.close();
}

View File

@ -27,6 +27,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -35,11 +36,13 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
*/
@RequiresDialectFeature( value = DialectChecks.SupportsSequences.class )
public class BigIntegerSequenceGeneratorTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "idgen/biginteger/sequence/Mapping.hbm.xml" };
}
@Test
@FailureExpectedWithNewMetamodel
public void testBasics() {
Session s = openSession();
s.beginTransaction();

View File

@ -31,6 +31,7 @@ import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;
import org.hibernate.id.enhanced.TableStructure;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -41,11 +42,13 @@ import static org.junit.Assert.assertTrue;
* @author Steve Ebersole
*/
public class BasicForcedTableSequenceTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "idgen/enhanced/forcedtable/Basic.hbm.xml" };
}
@Test
@FailureExpectedWithNewMetamodel
public void testNormalBoundary() {
EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() );
assertTrue(

View File

@ -31,6 +31,7 @@ import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;
import org.hibernate.id.enhanced.TableStructure;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -42,11 +43,13 @@ import static org.junit.Assert.assertTrue;
* @author Steve Ebersole
*/
public class HiLoForcedTableSequenceTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "idgen/enhanced/forcedtable/HiLo.hbm.xml" };
}
@Test
@FailureExpectedWithNewMetamodel
public void testNormalBoundary() {
EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() );
assertTrue(

View File

@ -31,6 +31,7 @@ import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;
import org.hibernate.id.enhanced.TableStructure;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -40,11 +41,13 @@ import static org.junit.Assert.assertTrue;
* @author Steve Ebersole
*/
public class PooledForcedTableSequenceTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {
return new String[] { "idgen/enhanced/forcedtable/Pooled.hbm.xml" };
}
@Test
@FailureExpectedWithNewMetamodel
public void testNormalBoundary() {
EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() );
assertTrue(

View File

@ -29,6 +29,7 @@ import org.hibernate.Session;
import org.hibernate.id.IdentifierGeneratorHelper.BasicHolder;
import org.hibernate.id.enhanced.SequenceStyleGenerator;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -39,6 +40,7 @@ import static org.junit.Assert.assertEquals;
* @author Steve Ebersole
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
*/
@FailureExpectedWithNewMetamodel
public class BasicSequenceTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -31,6 +31,7 @@ import org.hibernate.id.IdentifierGeneratorHelper.BasicHolder;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.hibernate.testing.junit4.ExtraAssertions.assertClassAssignability;
@ -40,11 +41,13 @@ import static org.junit.Assert.assertEquals;
* @author Steve Ebersole
*/
public class HiLoSequenceTest extends BaseCoreFunctionalTestCase {
@Override
protected String[] getMappings() {
return new String[] { "idgen/enhanced/sequence/HiLo.hbm.xml" };
}
@Test
@FailureExpectedWithNewMetamodel
public void testNormalBoundary() {
EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() );
assertClassAssignability( SequenceStyleGenerator.class, persister.getIdentifierGenerator().getClass() );

View File

@ -29,6 +29,7 @@ import org.hibernate.Session;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.hibernate.id.IdentifierGeneratorHelper.BasicHolder;
@ -45,6 +46,7 @@ public class PooledSequenceTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testNormalBoundary() {
EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() );
assertClassAssignability( SequenceStyleGenerator.class, persister.getIdentifierGenerator().getClass() );

View File

@ -28,6 +28,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.id.enhanced.TableGenerator;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.hibernate.id.IdentifierGeneratorHelper.BasicHolder;
@ -37,6 +38,7 @@ import static org.junit.Assert.assertEquals;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class BasicTableTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -29,6 +29,7 @@ import org.hibernate.Session;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.TableGenerator;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.hibernate.id.IdentifierGeneratorHelper.BasicHolder;
@ -38,6 +39,7 @@ import static org.junit.Assert.assertEquals;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class HiLoTableTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -29,6 +29,7 @@ import org.hibernate.Session;
import org.hibernate.id.enhanced.OptimizerFactory;
import org.hibernate.id.enhanced.TableGenerator;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.hibernate.id.IdentifierGeneratorHelper.BasicHolder;
@ -45,6 +46,7 @@ public class PooledTableTest extends BaseCoreFunctionalTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testNormalBoundary() {
EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() );
assertClassAssignability( TableGenerator.class, persister.getIdentifierGenerator().getClass() );

View File

@ -30,6 +30,7 @@ import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -37,6 +38,7 @@ import static org.junit.Assert.assertEquals;
/**
* @author Steve Ebersole
*/
@FailureExpectedWithNewMetamodel
public class IdentifierPropertyReferencesTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() {

View File

@ -35,6 +35,7 @@ import org.hibernate.cfg.Environment;
import org.hibernate.criterion.Projections;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.type.AbstractSingleColumnStandardBasicType;
import org.hibernate.type.TextType;
@ -51,6 +52,7 @@ import static org.junit.Assert.fail;
/**
* @author Gavin King
*/
@FailureExpectedWithNewMetamodel
public class ImmutableTest extends BaseCoreFunctionalTestCase {
private static class TextAsMaterializedClobType extends AbstractSingleColumnStandardBasicType<String> {
public final static TextAsMaterializedClobType INSTANCE = new TextAsMaterializedClobType();
@ -69,7 +71,7 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase {
}
cfg.setProperty( Environment.GENERATE_STATISTICS, "true");
cfg.setProperty( Environment.STATEMENT_BATCH_SIZE, "0" );
}
}
@Override
public String[] getMappings() {
@ -733,7 +735,7 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase {
s.close();
assertUpdateCount( 0 );
assertDeleteCount( 3 );
assertDeleteCount( 3 );
}
@ -1124,7 +1126,7 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase {
s.close();
assertUpdateCount( 0 );
assertDeleteCount( 3 );
assertDeleteCount( 3 );
}
@Test
@ -1396,7 +1398,7 @@ public class ImmutableTest extends BaseCoreFunctionalTestCase {
assertUpdateCount( 0 );
assertDeleteCount( 4 );
}
@Test
public void testImmutableEntityRemoveImmutableFromInverseMutableCollection() {
clearCounts();

View File

@ -24,10 +24,12 @@
package org.hibernate.test.immutable.entitywithmutablecollection.inverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithManyToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class EntityWithInverseManyToManyTest extends AbstractEntityWithManyToManyTest {
@Override
public String[] getMappings() {

View File

@ -24,11 +24,14 @@
package org.hibernate.test.immutable.entitywithmutablecollection.inverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class EntityWithInverseOneToManyJoinTest extends AbstractEntityWithOneToManyTest {
@Override
public String[] getMappings() {
return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariationOneToManyJoin.hbm.xml" };
}

View File

@ -24,11 +24,14 @@
package org.hibernate.test.immutable.entitywithmutablecollection.inverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class EntityWithInverseOneToManyTest extends AbstractEntityWithOneToManyTest {
@Override
public String[] getMappings() {
return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariation.hbm.xml" };
}

View File

@ -24,10 +24,12 @@
package org.hibernate.test.immutable.entitywithmutablecollection.inverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithManyToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class VersionedEntityWithInverseManyToManyTest extends AbstractEntityWithManyToManyTest {
@Override
public String[] getMappings() {

View File

@ -27,13 +27,16 @@ import org.junit.Test;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*
* These tests reproduce HHH-4992.
*/
@FailureExpectedWithNewMetamodel
public class VersionedEntityWithInverseOneToManyFailureExpectedTest extends AbstractEntityWithOneToManyTest {
@Override
public String[] getMappings() {
return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariationVersioned.hbm.xml" };
}

View File

@ -27,11 +27,14 @@ import org.junit.Test;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class VersionedEntityWithInverseOneToManyJoinFailureExpectedTest extends AbstractEntityWithOneToManyTest {
@Override
public String[] getMappings() {
return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariationVersionedOneToManyJoin.hbm.xml" };
}

View File

@ -24,6 +24,7 @@
package org.hibernate.test.immutable.entitywithmutablecollection.inverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue;
@ -31,15 +32,19 @@ import org.hibernate.testing.TestForIssue;
* @author Gail Badner
*/
@TestForIssue( jiraKey = "HHH-4992" )
@FailureExpectedWithNewMetamodel
public class VersionedEntityWithInverseOneToManyJoinTest extends AbstractEntityWithOneToManyTest {
@Override
public String[] getMappings() {
return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariationVersionedOneToManyJoin.hbm.xml" };
}
@Override
protected boolean checkUpdateCountsAfterAddingExistingElement() {
return false;
}
@Override
protected boolean checkUpdateCountsAfterRemovingElementWithoutDelete() {
return false;
}

View File

@ -24,19 +24,24 @@
package org.hibernate.test.immutable.entitywithmutablecollection.inverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class VersionedEntityWithInverseOneToManyTest extends AbstractEntityWithOneToManyTest {
@Override
public String[] getMappings() {
return new String[] { "immutable/entitywithmutablecollection/inverse/ContractVariationVersioned.hbm.xml" };
}
@Override
protected boolean checkUpdateCountsAfterAddingExistingElement() {
return false;
}
@Override
protected boolean checkUpdateCountsAfterRemovingElementWithoutDelete() {
return false;
}

View File

@ -24,10 +24,12 @@
package org.hibernate.test.immutable.entitywithmutablecollection.noninverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithManyToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class EntityWithNonInverseManyToManyTest extends AbstractEntityWithManyToManyTest {
@Override
public String[] getMappings() {

View File

@ -24,10 +24,12 @@
package org.hibernate.test.immutable.entitywithmutablecollection.noninverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithManyToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class EntityWithNonInverseManyToManyUnidirTest extends AbstractEntityWithManyToManyTest {
@Override
public String[] getMappings() {

View File

@ -24,11 +24,14 @@
package org.hibernate.test.immutable.entitywithmutablecollection.noninverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class EntityWithNonInverseOneToManyJoinTest extends AbstractEntityWithOneToManyTest {
@Override
public String[] getMappings() {
return new String[] { "immutable/entitywithmutablecollection/noninverse/ContractVariationOneToManyJoin.hbm.xml" };
}

View File

@ -24,11 +24,14 @@
package org.hibernate.test.immutable.entitywithmutablecollection.noninverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class EntityWithNonInverseOneToManyTest extends AbstractEntityWithOneToManyTest {
@Override
public String[] getMappings() {
return new String[] { "immutable/entitywithmutablecollection/noninverse/ContractVariation.hbm.xml" };
}

View File

@ -24,11 +24,14 @@
package org.hibernate.test.immutable.entitywithmutablecollection.noninverse;
import org.hibernate.test.immutable.entitywithmutablecollection.AbstractEntityWithOneToManyTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/**
* @author Gail Badner
*/
@FailureExpectedWithNewMetamodel
public class EntityWithNonInverseOneToManyUnidirTest extends AbstractEntityWithOneToManyTest {
@Override
public String[] getMappings() {
return new String[] { "immutable/entitywithmutablecollection/noninverse/ContractVariationUnidir.hbm.xml" };
}

Some files were not shown because too many files have changed in this diff Show More