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()", action = "countInvocation()",
name = "testOrm1Support") 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() { 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 // need to call buildSessionFactory, because this test is not using org.hibernate.testing.junit4.CustomRunner
buildSessionFactory(); buildSessionFactory();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -23,10 +23,14 @@
*/ */
package org.hibernate.test.collection.custom.parameterized; package org.hibernate.test.collection.custom.parameterized;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class ParameterizedUserCollectionTypeHbmVariantTest extends ParameterizedUserCollectionTypeTest { public class ParameterizedUserCollectionTypeHbmVariantTest extends ParameterizedUserCollectionTypeTest {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "collection/custom/parameterized/Mapping.hbm.xml" }; 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.Session;
import org.hibernate.collection.internal.PersistentIdentifierBag; import org.hibernate.collection.internal.PersistentIdentifierBag;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
@ -45,6 +46,7 @@ public class PersistentIdBagTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@FailureExpectedWithNewMetamodel
public void testWriteMethodDirtying() { public void testWriteMethodDirtying() {
IdbagOwner parent = new IdbagOwner( "root" ); IdbagOwner parent = new IdbagOwner( "root" );
IdbagOwner child = new IdbagOwner( "c1" ); 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.persister.collection.QueryableCollection;
import org.hibernate.sql.SimpleSelect; import org.hibernate.sql.SimpleSelect;
import org.hibernate.testing.FailureExpected; import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -121,6 +122,7 @@ public class PersistentListTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@FailureExpectedWithNewMetamodel
public void testWriteMethodDirtying() { public void testWriteMethodDirtying() {
ListOwner parent = new ListOwner( "root" ); ListOwner parent = new ListOwner( "root" );
ListOwner child = new ListOwner( "c1" ); ListOwner child = new ListOwner( "c1" );

View File

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

View File

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

View File

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

View File

@ -26,11 +26,14 @@ package org.hibernate.test.collection.set;
import org.junit.Test; import org.junit.Test;
import org.hibernate.testing.FailureExpected; import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/** /**
* @author Gail Badner * @author Gail Badner
*/ */
@FailureExpectedWithNewMetamodel
public class PersistentSetNonLazyTest extends PersistentSetTest { public class PersistentSetNonLazyTest extends PersistentSetTest {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "collection/set/MappingsNonLazy.hbm.xml" }; 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.criterion.Restrictions;
import org.hibernate.stat.CollectionStatistics; import org.hibernate.stat.CollectionStatistics;
import org.hibernate.testing.FailureExpected; import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -44,6 +45,7 @@ import static org.junit.Assert.assertTrue;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class PersistentSetTest extends BaseCoreFunctionalTestCase { public class PersistentSetTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { public String[] getMappings() {

View File

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

View File

@ -28,6 +28,7 @@ import java.util.Locale;
import org.junit.Test; import org.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -35,7 +36,9 @@ import static org.junit.Assert.assertEquals;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class CascadeToComponentCollectionTest extends BaseCoreFunctionalTestCase { public class CascadeToComponentCollectionTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "component/cascading/collection/Mappings.hbm.xml" }; 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.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
@ -41,6 +42,7 @@ public class CascadeToComponentAssociationTest extends BaseCoreFunctionalTestCas
} }
@Test @Test
@FailureExpectedWithNewMetamodel
public void testMerging() { public void testMerging() {
// step1, we create a document with owner // step1, we create a document with owner
Session session = openSession(); Session session = openSession();

View File

@ -35,6 +35,7 @@ import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.mapping.Collection; import org.hibernate.mapping.Collection;
import org.hibernate.mapping.Component; import org.hibernate.mapping.Component;
import org.hibernate.mapping.Formula; import org.hibernate.mapping.Formula;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.type.StandardBasicTypes; import org.hibernate.type.StandardBasicTypes;
@ -43,6 +44,7 @@ import static org.junit.Assert.assertEquals;
/** /**
* @author Gavin King * @author Gavin King
*/ */
@FailureExpectedWithNewMetamodel
public class CompositeElementTest extends BaseCoreFunctionalTestCase { public class CompositeElementTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { public String[] getMappings() {
@ -56,7 +58,7 @@ public class CompositeElementTest extends BaseCoreFunctionalTestCase {
Component childComponents = ( Component ) children.getElement(); Component childComponents = ( Component ) children.getElement();
Formula f = ( Formula ) childComponents.getProperty( "bioLength" ).getValue().getColumnIterator().next(); 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 ) { if ( lengthFunction != null ) {
ArrayList args = new ArrayList(); ArrayList args = new ArrayList();
args.add( "bio" ); 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.engine.transaction.internal.jta.CMTTransactionFactory;
import org.hibernate.internal.util.SerializationHelper; import org.hibernate.internal.util.SerializationHelper;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider; import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.jta.TestingJtaBootstrap; import org.hibernate.testing.jta.TestingJtaBootstrap;
import org.hibernate.testing.jta.TestingJtaPlatformImpl; import org.hibernate.testing.jta.TestingJtaPlatformImpl;
@ -29,6 +30,7 @@ import static org.junit.Assert.fail;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class AggressiveReleaseTest extends ConnectionManagementTestCase { public class AggressiveReleaseTest extends ConnectionManagementTestCase {
@Override @Override
public void configure(Configuration cfg) { public void configure(Configuration cfg) {

View File

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

View File

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

View File

@ -33,6 +33,7 @@ import org.hibernate.Hibernate;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
@ -42,6 +43,7 @@ import static org.junit.Assert.assertFalse;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class HibernateCreateBlobFailedCase extends BaseCoreFunctionalTestCase { public class HibernateCreateBlobFailedCase extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { 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.service.spi.Stoppable;
import org.hibernate.testing.AfterClassOnce; import org.hibernate.testing.AfterClassOnce;
import org.hibernate.testing.BeforeClassOnce; import org.hibernate.testing.BeforeClassOnce;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.env.ConnectionProviderBuilder; import org.hibernate.testing.env.ConnectionProviderBuilder;
import org.hibernate.tool.hbm2ddl.SchemaExport; import org.hibernate.tool.hbm2ddl.SchemaExport;
@ -44,6 +45,7 @@ import org.hibernate.tool.hbm2ddl.SchemaExport;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class SuppliedConnectionTest extends ConnectionManagementTestCase { public class SuppliedConnectionTest extends ConnectionManagementTestCase {
private ConnectionProvider cp = ConnectionProviderBuilder.buildConnectionProvider(); private ConnectionProvider cp = ConnectionProviderBuilder.buildConnectionProvider();
private Connection connectionUnderTest; private Connection connectionUnderTest;

View File

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

View File

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

View File

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

View File

@ -32,6 +32,7 @@ import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -44,11 +45,14 @@ import static org.junit.Assert.assertTrue;
/** /**
* @author Gavin King * @author Gavin King
*/ */
@FailureExpectedWithNewMetamodel
public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase { public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "cuk/Person.hbm.xml" }; return new String[] { "cuk/Person.hbm.xml" };
} }
@Override
public void configure(Configuration cfg) { public void configure(Configuration cfg) {
cfg.setProperty(Environment.DEFAULT_BATCH_FETCH_SIZE, "1"); cfg.setProperty(Environment.DEFAULT_BATCH_FETCH_SIZE, "1");
} }
@ -78,7 +82,7 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase {
s.save(act); s.save(act);
s.flush(); s.flush();
s.clear(); s.clear();
p = (Person) s.get( Person.class, p.getId() ); //get address reference by outer join 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 p2 = (Person) s.get( Person.class, p2.getId() ); //get null address reference by outer join
assertNull( p2.getAddress() ); assertNull( p2.getAddress() );
@ -87,13 +91,13 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase {
assertEquals( l.size(), 2 ); assertEquals( l.size(), 2 );
assertTrue( l.contains(p) && l.contains(p2) ); assertTrue( l.contains(p) && l.contains(p2) );
s.clear(); s.clear();
l = s.createQuery("from Person p order by p.name").list(); //get address references by sequential selects l = s.createQuery("from Person p order by p.name").list(); //get address references by sequential selects
assertEquals( l.size(), 2 ); assertEquals( l.size(), 2 );
assertNull( ( (Person) l.get(0) ).getAddress() ); assertNull( ( (Person) l.get(0) ).getAddress() );
assertNotNull( ( (Person) l.get(1) ).getAddress() ); assertNotNull( ( (Person) l.get(1) ).getAddress() );
s.clear(); s.clear();
l = s.createQuery("from Person p left join fetch p.address a order by a.country").list(); //get em by outer join 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 ); assertEquals( l.size(), 2 );
if ( ( (Person) l.get(0) ).getName().equals("Max") ) { if ( ( (Person) l.get(0) ).getName().equals("Max") ) {
@ -105,7 +109,7 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase {
assertNotNull( ( (Person) l.get(0) ).getAddress() ); assertNotNull( ( (Person) l.get(0) ).getAddress() );
} }
s.clear(); s.clear();
l = s.createQuery("from Person p left join p.accounts").list(); l = s.createQuery("from Person p left join p.accounts").list();
for ( int i=0; i<2; i++ ) { for ( int i=0; i<2; i++ ) {
Object[] row = (Object[]) l.get(i); Object[] row = (Object[]) l.get(i);
@ -125,13 +129,13 @@ public class CompositePropertyRefTest extends BaseCoreFunctionalTestCase {
assertTrue( Hibernate.isInitialized( p1.getAccounts() ) ); assertTrue( Hibernate.isInitialized( p1.getAccounts() ) );
assertEquals( p1.getAccounts().size(), 0 ); assertEquals( p1.getAccounts().size(), 0 );
s.clear(); s.clear();
l = s.createQuery("from Account a join fetch a.user").list(); l = s.createQuery("from Account a join fetch a.user").list();
s.clear(); s.clear();
l = s.createQuery("from Person p left join fetch p.address").list(); l = s.createQuery("from Person p left join fetch p.address").list();
s.clear(); s.clear();
s.createQuery( "delete Address" ).executeUpdate(); s.createQuery( "delete Address" ).executeUpdate();
s.createQuery( "delete Account" ).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.DB2Dialect;
import org.hibernate.dialect.HSQLDialect; import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -41,6 +42,7 @@ import static org.junit.Assert.assertEquals;
/** /**
* @author Gavin King * @author Gavin King
*/ */
@FailureExpectedWithNewMetamodel
public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase { public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { public String[] getMappings() {
@ -51,32 +53,32 @@ public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase {
public void testCompositeUserType() { public void testCompositeUserType() {
Session s = openSession(); Session s = openSession();
org.hibernate.Transaction t = s.beginTransaction(); org.hibernate.Transaction t = s.beginTransaction();
Transaction tran = new Transaction(); Transaction tran = new Transaction();
tran.setDescription("a small transaction"); tran.setDescription("a small transaction");
tran.setValue( new MonetoryAmount( new BigDecimal(1.5), Currency.getInstance("USD") ) ); tran.setValue( new MonetoryAmount( new BigDecimal(1.5), Currency.getInstance("USD") ) );
s.persist(tran); s.persist(tran);
List result = s.createQuery("from Transaction tran where tran.value.amount > 1.0 and tran.value.currency = 'USD'").list(); List result = s.createQuery("from Transaction tran where tran.value.amount > 1.0 and tran.value.currency = 'USD'").list();
assertEquals( result.size(), 1 ); assertEquals( result.size(), 1 );
tran.getValue().setCurrency( Currency.getInstance("AUD") ); tran.getValue().setCurrency( Currency.getInstance("AUD") );
result = s.createQuery("from Transaction tran where tran.value.amount > 1.0 and tran.value.currency = 'AUD'").list(); result = s.createQuery("from Transaction tran where tran.value.amount > 1.0 and tran.value.currency = 'AUD'").list();
assertEquals( result.size(), 1 ); assertEquals( result.size(), 1 );
if ( !(getDialect() instanceof HSQLDialect) ) { if ( !(getDialect() instanceof HSQLDialect) ) {
result = s.createQuery("from Transaction txn where txn.value = (1.5, 'AUD')").list(); result = s.createQuery("from Transaction txn where txn.value = (1.5, 'AUD')").list();
assertEquals( result.size(), 1 ); assertEquals( result.size(), 1 );
result = s.createQuery("from Transaction where value = (1.5, 'AUD')").list(); result = s.createQuery("from Transaction where value = (1.5, 'AUD')").list();
assertEquals( result.size(), 1 ); assertEquals( result.size(), 1 );
} }
s.delete(tran); s.delete(tran);
t.commit(); t.commit();
s.close(); s.close();
} }
@Test @Test
@SkipForDialect( value = {SybaseASE15Dialect.class, DB2Dialect.class}, jiraKey = "HHH-6788,HHH-6867") @SkipForDialect( value = {SybaseASE15Dialect.class, DB2Dialect.class}, jiraKey = "HHH-6788,HHH-6867")
public void testCustomColumnReadAndWrite() { public void testCustomColumnReadAndWrite() {
@ -92,29 +94,29 @@ public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase {
// Test value conversion during insert // Test value conversion during insert
BigDecimal amountViaSql = (BigDecimal)s.createSQLQuery("select amount_millions from MutualFund").uniqueResult(); BigDecimal amountViaSql = (BigDecimal)s.createSQLQuery("select amount_millions from MutualFund").uniqueResult();
assertEquals(AMOUNT_MILLIONS.doubleValue(), amountViaSql.doubleValue(), 0.01d); assertEquals(AMOUNT_MILLIONS.doubleValue(), amountViaSql.doubleValue(), 0.01d);
// Test projection // Test projection
BigDecimal amountViaHql = (BigDecimal)s.createQuery("select f.holdings.amount from MutualFund f").uniqueResult(); BigDecimal amountViaHql = (BigDecimal)s.createQuery("select f.holdings.amount from MutualFund f").uniqueResult();
assertEquals(AMOUNT.doubleValue(), amountViaHql.doubleValue(), 0.01d); assertEquals(AMOUNT.doubleValue(), amountViaHql.doubleValue(), 0.01d);
// Test restriction and entity load via criteria // Test restriction and entity load via criteria
BigDecimal one = new BigDecimal(1); BigDecimal one = new BigDecimal(1);
f = (MutualFund)s.createCriteria(MutualFund.class) f = (MutualFund)s.createCriteria(MutualFund.class)
.add(Restrictions.between("holdings.amount", AMOUNT.subtract(one), AMOUNT.add(one))) .add(Restrictions.between("holdings.amount", AMOUNT.subtract(one), AMOUNT.add(one)))
.uniqueResult(); .uniqueResult();
assertEquals(AMOUNT.doubleValue(), f.getHoldings().getAmount().doubleValue(), 0.01d); assertEquals(AMOUNT.doubleValue(), f.getHoldings().getAmount().doubleValue(), 0.01d);
// Test predicate and entity load via HQL // Test predicate and entity load via HQL
f = (MutualFund)s.createQuery("from MutualFund f where f.holdings.amount between ? and ?") f = (MutualFund)s.createQuery("from MutualFund f where f.holdings.amount between ? and ?")
.setBigDecimal(0, AMOUNT.subtract(one)) .setBigDecimal(0, AMOUNT.subtract(one))
.setBigDecimal(1, AMOUNT.add(one)) .setBigDecimal(1, AMOUNT.add(one))
.uniqueResult(); .uniqueResult();
assertEquals(AMOUNT.doubleValue(), f.getHoldings().getAmount().doubleValue(), 0.01d); assertEquals(AMOUNT.doubleValue(), f.getHoldings().getAmount().doubleValue(), 0.01d);
s.delete(f); s.delete(f);
t.commit(); t.commit();
s.close(); s.close();
} }
} }

View File

@ -27,6 +27,7 @@ import org.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -34,7 +35,9 @@ import static org.junit.Assert.assertEquals;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class DeleteTransientEntityTest extends BaseCoreFunctionalTestCase { public class DeleteTransientEntityTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "deletetransient/Person.hbm.xml" }; 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.AvailableSettings;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -39,6 +40,7 @@ import static org.junit.Assert.assertTrue;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class CustomDirtinessStrategyTest extends BaseCoreFunctionalTestCase { public class CustomDirtinessStrategyTest extends BaseCoreFunctionalTestCase {
private static final String INITIAL_NAME = "thing 1"; private static final String INITIAL_NAME = "thing 1";
private static final String SUBSEQUENT_NAME = "thing 2"; 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.Hibernate;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.criterion.Property; import org.hibernate.criterion.Property;
import org.hibernate.criterion.Restrictions; import org.hibernate.criterion.Restrictions;
import org.hibernate.proxy.HibernateProxy; import org.hibernate.proxy.HibernateProxy;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -53,6 +53,7 @@ public class DiscriminatorTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@FailureExpectedWithNewMetamodel
public void testDiscriminatorSubclass() { public void testDiscriminatorSubclass() {
Session s = openSession(); Session s = openSession();
Transaction t = s.beginTransaction(); 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.Company;
import org.hibernate.test.dynamicentity.Customer; import org.hibernate.test.dynamicentity.Customer;
import org.hibernate.test.dynamicentity.ProxyHelper; import org.hibernate.test.dynamicentity.ProxyHelper;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -65,6 +66,7 @@ public class InterceptorDynamicEntityTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@FailureExpectedWithNewMetamodel
public void testIt() { public void testIt() {
// Test saving these dyna-proxies // Test saving these dyna-proxies
Session session = openSession(); 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.Customer;
import org.hibernate.test.dynamicentity.Person; import org.hibernate.test.dynamicentity.Person;
import org.hibernate.test.dynamicentity.ProxyHelper; import org.hibernate.test.dynamicentity.ProxyHelper;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -53,6 +54,7 @@ import static org.junit.Assert.assertNotNull;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class TuplizerDynamicEntityTest extends BaseCoreFunctionalTestCase { public class TuplizerDynamicEntityTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { 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.Customer;
import org.hibernate.test.dynamicentity.Person; import org.hibernate.test.dynamicentity.Person;
import org.hibernate.test.dynamicentity.ProxyHelper; import org.hibernate.test.dynamicentity.ProxyHelper;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -54,10 +55,12 @@ import static org.junit.Assert.assertNotNull;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class ImprovedTuplizerDynamicEntityTest extends BaseCoreFunctionalTestCase { public class ImprovedTuplizerDynamicEntityTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "dynamicentity/tuplizer2/Customer.hbm.xml" }; return new String[] { "dynamicentity/tuplizer2/Customer.hbm.xml" };
} }
@Override
public void configure(Configuration cfg) { public void configure(Configuration cfg) {
super.configure( cfg ); super.configure( cfg );
cfg.getEntityTuplizerFactory().registerDefaultTuplizerClass( EntityMode.POJO, MyEntityTuplizer.class ); cfg.getEntityTuplizerFactory().registerDefaultTuplizerClass( EntityMode.POJO, MyEntityTuplizer.class );
@ -65,6 +68,7 @@ public class ImprovedTuplizerDynamicEntityTest extends BaseCoreFunctionalTestCas
@Test @Test
@SuppressWarnings( {"unchecked"}) @SuppressWarnings( {"unchecked"})
@FailureExpectedWithNewMetamodel
public void testIt() { public void testIt() {
// Test saving these dyna-proxies // Test saving these dyna-proxies
Session session = openSession(); Session session = openSession();

View File

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

View File

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

View File

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

View File

@ -25,6 +25,7 @@ package org.hibernate.test.entityname;
import org.junit.Test; import org.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -32,7 +33,9 @@ import static org.junit.Assert.assertEquals;
/** /**
* @author stliu * @author stliu
*/ */
@FailureExpectedWithNewMetamodel
public class EntityNameFromSubClassTest extends BaseCoreFunctionalTestCase { public class EntityNameFromSubClassTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "entityname/Vehicle.hbm.xml" }; return new String[] { "entityname/Vehicle.hbm.xml" };
} }
@ -50,7 +53,7 @@ public class EntityNameFromSubClassTest extends BaseCoreFunctionalTestCase {
s.save(stliu); s.save(stliu);
s.getTransaction().commit(); s.getTransaction().commit();
s.close(); s.close();
s=openSession(); s=openSession();
s.beginTransaction(); s.beginTransaction();
Person p = (Person)s.get(Person.class, stliu.getId()); 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.ParentWithCollection;
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/** /**
* *
* @author Gail Badner * @author Gail Badner
*/ */
@FailureExpectedWithNewMetamodel
public class BidirectionalManyToManyBagToSetCollectionEventTest extends AbstractAssociationCollectionEventTest { public class BidirectionalManyToManyBagToSetCollectionEventTest extends AbstractAssociationCollectionEventTest {
@Override @Override
public String[] getMappings() { 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.ParentWithCollection;
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/** /**
* *
* @author Gail Badner * @author Gail Badner
*/ */
@FailureExpectedWithNewMetamodel
public class BidirectionalManyToManySetToSetCollectionEventTest extends AbstractAssociationCollectionEventTest { public class BidirectionalManyToManySetToSetCollectionEventTest extends AbstractAssociationCollectionEventTest {
@Override @Override
public String[] getMappings() { 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.ParentWithCollection;
import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest; import org.hibernate.test.event.collection.association.AbstractAssociationCollectionEventTest;
import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities; import org.hibernate.test.event.collection.association.unidirectional.ParentWithCollectionOfEntities;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/** /**
* @author Gail Badner * @author Gail Badner
*/ */
@FailureExpectedWithNewMetamodel
public class UnidirectionalManyToManyBagCollectionEventTest extends AbstractAssociationCollectionEventTest { public class UnidirectionalManyToManyBagCollectionEventTest extends AbstractAssociationCollectionEventTest {
@Override @Override
public String[] getMappings() { 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.AbstractCollectionEventTest;
import org.hibernate.test.event.collection.ParentWithCollection; import org.hibernate.test.event.collection.ParentWithCollection;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/** /**
* *
* @author Gail Badner * @author Gail Badner
*/ */
@FailureExpectedWithNewMetamodel
public class ValuesBagCollectionEventTest extends AbstractCollectionEventTest { public class ValuesBagCollectionEventTest extends AbstractCollectionEventTest {
@Override @Override
public String[] getMappings() { 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.metamodel.spi.source.MetadataImplementor;
import org.hibernate.service.BootstrapServiceRegistryBuilder; import org.hibernate.service.BootstrapServiceRegistryBuilder;
import org.hibernate.service.spi.SessionFactoryServiceRegistry; import org.hibernate.service.spi.SessionFactoryServiceRegistry;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -100,6 +101,7 @@ public class CallbackTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@FailureExpectedWithNewMetamodel
public void testCallbacks() { public void testCallbacks() {
assertEquals( "observer not notified of creation", 1, observer.creationCount ); assertEquals( "observer not notified of creation", 1, observer.creationCount );
assertEquals( "listener not notified of creation", 1, listener.initCount ); 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.ConstraintViolationException;
import org.hibernate.exception.SQLGrammarException; import org.hibernate.exception.SQLGrammarException;
import org.hibernate.jdbc.Work; import org.hibernate.jdbc.Work;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -44,7 +45,9 @@ import static org.junit.Assert.fail;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class SQLExceptionConversionTest extends BaseCoreFunctionalTestCase { public class SQLExceptionConversionTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] {"exception/User.hbm.xml", "exception/Group.hbm.xml"}; 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.Hibernate;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -41,6 +42,7 @@ import static org.junit.Assert.assertTrue;
/** /**
* @author Gavin King * @author Gavin King
*/ */
@FailureExpectedWithNewMetamodel
public class ExtraLazyTest extends BaseCoreFunctionalTestCase { public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { public String[] getMappings() {
@ -57,7 +59,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
s.persist(gavin); s.persist(gavin);
t.commit(); t.commit();
s.close(); s.close();
s = openSession(); s = openSession();
t = s.beginTransaction(); t = s.beginTransaction();
gavin = (User) s.get(User.class, "gavin"); gavin = (User) s.get(User.class, "gavin");
@ -84,7 +86,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
t.commit(); t.commit();
s.close(); s.close();
} }
@Test @Test
public void testGet() { public void testGet() {
Session s = openSession(); Session s = openSession();
@ -119,7 +121,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
t.commit(); t.commit();
s.close(); s.close();
} }
@Test @Test
public void testRemoveClear() { public void testRemoveClear() {
Session s = openSession(); Session s = openSession();
@ -162,7 +164,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
t.commit(); t.commit();
s.close(); s.close();
} }
@Test @Test
public void testIndexFormulaMap() { public void testIndexFormulaMap() {
Session s = openSession(); Session s = openSession();
@ -177,7 +179,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
gavin.getSession().put( "bar", new SessionAttribute("bar", "foo bar baz 2") ); gavin.getSession().put( "bar", new SessionAttribute("bar", "foo bar baz 2") );
t.commit(); t.commit();
s.close(); s.close();
s = openSession(); s = openSession();
t = s.beginTransaction(); t = s.beginTransaction();
g = (Group) s.get(Group.class, "developers"); g = (Group) s.get(Group.class, "developers");
@ -215,7 +217,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
t.commit(); t.commit();
s.close(); s.close();
} }
@Test @Test
public void testSQLQuery() { public void testSQLQuery() {
Session s = openSession(); Session s = openSession();
@ -237,7 +239,7 @@ public class ExtraLazyTest extends BaseCoreFunctionalTestCase {
s.createQuery("delete User").executeUpdate(); s.createQuery("delete User").executeUpdate();
t.commit(); t.commit();
s.close(); s.close();
} }
} }

View File

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

View File

@ -51,6 +51,7 @@ import org.hibernate.dialect.IngresDialect;
import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.persister.collection.CollectionPersister; import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.transform.DistinctRootEntityResultTransformer; import org.hibernate.transform.DistinctRootEntityResultTransformer;
@ -66,6 +67,7 @@ import static org.junit.Assert.assertTrue;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@SkipForDialect( value = SybaseASE15Dialect.class, jiraKey = "HHH-3637") @SkipForDialect( value = SybaseASE15Dialect.class, jiraKey = "HHH-3637")
@FailureExpectedWithNewMetamodel
public class DynamicFilterTest extends BaseCoreFunctionalTestCase { public class DynamicFilterTest extends BaseCoreFunctionalTestCase {
private static final Logger log = Logger.getLogger( DynamicFilterTest.class ); 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.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -35,6 +36,7 @@ import static org.junit.Assert.assertEquals;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class BasicFilteredBulkManipulationTest extends BaseCoreFunctionalTestCase { public class BasicFilteredBulkManipulationTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { public String[] getMappings() {

View File

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

View File

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

View File

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

View File

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

View File

@ -6,6 +6,7 @@ import org.hibernate.Session;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.testing.DialectChecks; import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -17,12 +18,15 @@ import static org.junit.Assert.assertNull;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@RequiresDialectFeature( DialectChecks.SupportsIdentityColumns.class ) @RequiresDialectFeature( DialectChecks.SupportsIdentityColumns.class )
@FailureExpectedWithNewMetamodel
public class IdentityGeneratedKeysTest extends BaseCoreFunctionalTestCase { public class IdentityGeneratedKeysTest extends BaseCoreFunctionalTestCase {
@Override
public void configure(Configuration cfg) { public void configure(Configuration cfg) {
super.configure( cfg ); super.configure( cfg );
cfg.setProperty( Environment.GENERATE_STATISTICS, "true" ); cfg.setProperty( Environment.GENERATE_STATISTICS, "true" );
} }
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "generatedkeys/identity/MyEntity.hbm.xml" }; 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.cfg.Environment;
import org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory; import org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory;
import org.hibernate.testing.FailureExpected; import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -46,6 +47,7 @@ import static org.junit.Assert.assertTrue;
* *
* @author Gail Badner * @author Gail Badner
*/ */
@FailureExpectedWithNewMetamodel
public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase { public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
StateProvince stateProvince; StateProvince stateProvince;
private Zoo zoo1; private Zoo zoo1;
@ -108,7 +110,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
zoo2Director2 = new Human(); zoo2Director2 = new Human();
zoo2Director2.setName( new Name( "Fat", 'A', "Cat" ) ); zoo2Director2.setName( new Name( "Fat", 'A', "Cat" ) );
zoo2.getDirectors().put( "Head Honcho", zoo2Director1 ); zoo2.getDirectors().put( "Head Honcho", zoo2Director1 );
zoo2.getDirectors().put( "Asst. Head Honcho", zoo2Director2 ); zoo2.getDirectors().put( "Asst. Head Honcho", zoo2Director2 );
zoo3 = new Zoo(); zoo3 = new Zoo();
zoo3.setName( "Zoo" ); zoo3.setName( "Zoo" );
@ -183,7 +185,7 @@ public class ASTParserLoadingOrderByTest extends BaseCoreFunctionalTestCase {
} }
if ( zoo2Director2 != null ) { if ( zoo2Director2 != null ) {
s.delete( zoo2Director2 ); s.delete( zoo2Director2 );
zoo2Director2 = null; zoo2Director2 = null;
} }
if ( stateProvince != null ) { if ( stateProvince != null ) {
s.delete( stateProvince ); s.delete( stateProvince );

View File

@ -76,6 +76,7 @@ import org.hibernate.test.cid.Order;
import org.hibernate.test.cid.Product; import org.hibernate.test.cid.Product;
import org.hibernate.testing.DialectChecks; import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpected; import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
@ -105,6 +106,7 @@ import static org.junit.Assert.fail;
* *
* @author Steve * @author Steve
*/ */
@FailureExpectedWithNewMetamodel
public class ASTParserLoadingTest extends BaseCoreFunctionalTestCase { public class ASTParserLoadingTest extends BaseCoreFunctionalTestCase {
private static final Logger log = Logger.getLogger( ASTParserLoadingTest.class ); 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.id.IdentifierGenerator;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.DialectChecks; import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipLog; import org.hibernate.testing.SkipLog;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -53,7 +54,9 @@ import static org.junit.Assert.fail;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class BulkManipulationTest extends BaseCoreFunctionalTestCase { public class BulkManipulationTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { return new String[] {
"hql/Animal.hbm.xml", "hql/Animal.hbm.xml",
@ -239,7 +242,7 @@ public class BulkManipulationTest extends BaseCoreFunctionalTestCase {
data.cleanup(); data.cleanup();
} }
@Test @Test
public void testInsertWithManyToOne() { public void testInsertWithManyToOne() {
TestData data = new TestData(); 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( "insert into CompositeIdEntity (key2, someProperty, key1) select a.key2, 'COPY', a.key1 from CompositeIdEntity a" ).executeUpdate();
s.createQuery( "delete from CompositeIdEntity" ).executeUpdate(); s.createQuery( "delete from CompositeIdEntity" ).executeUpdate();
s.getTransaction().commit(); s.getTransaction().commit();
s.close(); s.close();
} }
@Test @Test
@ -1082,7 +1085,7 @@ public class BulkManipulationTest extends BaseCoreFunctionalTestCase {
data.cleanup(); data.cleanup();
} }
@Test @Test
public void testDeleteUnionSubclassAbstractRoot() { public void testDeleteUnionSubclassAbstractRoot() {
TestData data = new TestData(); TestData data = new TestData();

View File

@ -29,6 +29,7 @@ import org.hibernate.Session;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory; import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
/** /**
* Some simple test queries using the classic translator explicitly * Some simple test queries using the classic translator explicitly
@ -38,6 +39,7 @@ import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class ClassicTranslatorTest extends QueryTranslatorTestCase { public class ClassicTranslatorTest extends QueryTranslatorTestCase {
@Override @Override
public void configure(Configuration cfg) { 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.internal.classic.ClassicQueryTranslatorFactory;
import org.hibernate.hql.spi.QueryTranslator; import org.hibernate.hql.spi.QueryTranslator;
import org.hibernate.hql.spi.QueryTranslatorFactory; import org.hibernate.hql.spi.QueryTranslatorFactory;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.type.BigDecimalType; import org.hibernate.type.BigDecimalType;
import org.hibernate.type.BigIntegerType; import org.hibernate.type.BigIntegerType;
import org.hibernate.type.DoubleType; import org.hibernate.type.DoubleType;
@ -46,6 +47,7 @@ import static org.junit.Assert.assertEquals;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@FailureExpectedWithNewMetamodel
public class CriteriaClassicAggregationReturnTest extends QueryTranslatorTestCase { public class CriteriaClassicAggregationReturnTest extends QueryTranslatorTestCase {
@Override @Override
public void configure(Configuration cfg) { 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.internal.classic.ClassicQueryTranslatorFactory;
import org.hibernate.hql.spi.QueryTranslator; import org.hibernate.hql.spi.QueryTranslator;
import org.hibernate.hql.spi.QueryTranslatorFactory; import org.hibernate.hql.spi.QueryTranslatorFactory;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.type.BigDecimalType; import org.hibernate.type.BigDecimalType;
import org.hibernate.type.BigIntegerType; import org.hibernate.type.BigIntegerType;
@ -51,10 +52,11 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail; 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 * @author Max Rydahl Andersen
*/ */
@FailureExpectedWithNewMetamodel
public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase { public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
private boolean initialVersion2SqlFlagValue; private boolean initialVersion2SqlFlagValue;
@ -92,43 +94,43 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
QueryTranslatorImpl translator = createNewQueryTranslator( "select count(*) from Human h" ); QueryTranslatorImpl translator = createNewQueryTranslator( "select count(*) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] ); assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] );
translator = createNewQueryTranslator( "select count(h.heightInches) from Human h" ); translator = createNewQueryTranslator( "select count(h.heightInches) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] ); 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" ); translator = createNewQueryTranslator( "select max(h.heightInches) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] );
translator = createNewQueryTranslator( "select max(h.id) from Human h" ); translator = createNewQueryTranslator( "select max(h.id) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] ); assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] );
// AVG returns Double. // AVG returns Double.
translator = createNewQueryTranslator( "select avg(h.heightInches) from Human h" ); translator = createNewQueryTranslator( "select avg(h.heightInches) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] );
translator = createNewQueryTranslator( "select avg(h.id) from Human h" ); translator = createNewQueryTranslator( "select avg(h.id) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] );
translator = createNewQueryTranslator( "select avg(h.bigIntegerValue) from Human h" ); translator = createNewQueryTranslator( "select avg(h.bigIntegerValue) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] );
// SUM returns Long when applied to state-fields of integral types (other than BigInteger); // SUM returns Long when applied to state-fields of integral types (other than BigInteger);
translator = createNewQueryTranslator( "select sum(h.id) from Human h" ); translator = createNewQueryTranslator( "select sum(h.id) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] ); assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] );
translator = createNewQueryTranslator( "select sum(h.intValue) from Human h" ); translator = createNewQueryTranslator( "select sum(h.intValue) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", LongType.INSTANCE, translator.getReturnTypes()[0] ); 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" ); translator = createNewQueryTranslator( "select sum(h.heightInches) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); 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" ); translator = createNewQueryTranslator( "select sum(h.floatValue) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", DoubleType.INSTANCE, translator.getReturnTypes()[0] ); 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" ); translator = createNewQueryTranslator( "select sum(h.bigIntegerValue) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
assertEquals( "incorrect return type", BigIntegerType.INSTANCE, translator.getReturnTypes()[0] ); assertEquals( "incorrect return type", BigIntegerType.INSTANCE, translator.getReturnTypes()[0] );
// SUM and BigDecimal when applied to state-fields of type BigDecimal. // SUM and BigDecimal when applied to state-fields of type BigDecimal.
translator = createNewQueryTranslator( "select sum(h.bigDecimalValue) from Human h" ); translator = createNewQueryTranslator( "select sum(h.bigDecimalValue) from Human h" );
assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length ); assertEquals( "incorrect return type count", 1, translator.getReturnTypes().length );
@ -173,46 +175,46 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
assertEquals(longValue, new Long(1)); assertEquals(longValue, new Long(1));
longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.count("heightInches")).uniqueResult(); longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.count("heightInches")).uniqueResult();
assertEquals(longValue, new Long(1)); 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(); Double dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.max( "heightInches" )).uniqueResult();
assertNotNull(dblValue); assertNotNull(dblValue);
longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.max( "id" )).uniqueResult(); longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.max( "id" )).uniqueResult();
assertNotNull(longValue); assertNotNull(longValue);
// AVG returns Double. // AVG returns Double.
dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "heightInches" )).uniqueResult(); dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "heightInches" )).uniqueResult();
assertNotNull(dblValue); assertNotNull(dblValue);
dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "id" )).uniqueResult(); dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "id" )).uniqueResult();
assertNotNull(dblValue); assertNotNull(dblValue);
dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "bigIntegerValue" )).uniqueResult(); dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.avg( "bigIntegerValue" )).uniqueResult();
assertNotNull(dblValue); assertNotNull(dblValue);
// SUM returns Long when applied to state-fields of integral types (other than BigInteger); // 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(); longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.sum( "id" )).uniqueResult();
assertNotNull(longValue); assertNotNull(longValue);
longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.sum( "intValue" )).uniqueResult(); longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.sum( "intValue" )).uniqueResult();
assertNotNull(longValue); 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(); dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.sum( "heightInches" )).uniqueResult();
assertNotNull(dblValue); assertNotNull(dblValue);
dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.sum( "floatValue" )).uniqueResult(); dblValue = (Double) s.createCriteria( Human.class ).setProjection( Projections.sum( "floatValue" )).uniqueResult();
assertNotNull(dblValue); 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(); BigInteger bigIValue = (BigInteger) s.createCriteria( Human.class ).setProjection( Projections.sum( "bigIntegerValue" )).uniqueResult();
assertNotNull(bigIValue); assertNotNull(bigIValue);
// SUM and BigDecimal when applied to state-fields of type BigDecimal. // SUM and BigDecimal when applied to state-fields of type BigDecimal.
BigDecimal bigDValue = (BigDecimal) s.createCriteria( Human.class ).setProjection( Projections.sum( "bigDecimalValue" )).uniqueResult(); BigDecimal bigDValue = (BigDecimal) s.createCriteria( Human.class ).setProjection( Projections.sum( "bigDecimalValue" )).uniqueResult();
assertNotNull(bigDValue); assertNotNull(bigDValue);
s.delete( human ); s.delete( human );
s.flush(); s.flush();
s.getTransaction().commit(); 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.internal.ast.util.ASTUtil;
import org.hibernate.hql.spi.QueryTranslator; import org.hibernate.hql.spi.QueryTranslator;
import org.hibernate.hql.spi.QueryTranslatorFactory; import org.hibernate.hql.spi.QueryTranslatorFactory;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static junit.framework.Assert.assertEquals; 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> * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
*/ */
@FailureExpectedWithNewMetamodel
public class EJBQLTest extends BaseCoreFunctionalTestCase { public class EJBQLTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { public String[] getMappings() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,6 +27,7 @@ import org.junit.Test;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.testing.DialectChecks; import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -35,11 +36,13 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
*/ */
@RequiresDialectFeature( value = DialectChecks.SupportsSequences.class ) @RequiresDialectFeature( value = DialectChecks.SupportsSequences.class )
public class BigIntegerSequenceGeneratorTest extends BaseCoreFunctionalTestCase { public class BigIntegerSequenceGeneratorTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "idgen/biginteger/sequence/Mapping.hbm.xml" }; return new String[] { "idgen/biginteger/sequence/Mapping.hbm.xml" };
} }
@Test @Test
@FailureExpectedWithNewMetamodel
public void testBasics() { public void testBasics() {
Session s = openSession(); Session s = openSession();
s.beginTransaction(); 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.SequenceStyleGenerator;
import org.hibernate.id.enhanced.TableStructure; import org.hibernate.id.enhanced.TableStructure;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -41,11 +42,13 @@ import static org.junit.Assert.assertTrue;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class BasicForcedTableSequenceTest extends BaseCoreFunctionalTestCase { public class BasicForcedTableSequenceTest extends BaseCoreFunctionalTestCase {
@Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "idgen/enhanced/forcedtable/Basic.hbm.xml" }; return new String[] { "idgen/enhanced/forcedtable/Basic.hbm.xml" };
} }
@Test @Test
@FailureExpectedWithNewMetamodel
public void testNormalBoundary() { public void testNormalBoundary() {
EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() ); EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() );
assertTrue( assertTrue(

View File

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

View File

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

View File

@ -29,6 +29,7 @@ import org.hibernate.Session;
import org.hibernate.id.IdentifierGeneratorHelper.BasicHolder; import org.hibernate.id.IdentifierGeneratorHelper.BasicHolder;
import org.hibernate.id.enhanced.SequenceStyleGenerator; import org.hibernate.id.enhanced.SequenceStyleGenerator;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -39,6 +40,7 @@ import static org.junit.Assert.assertEquals;
* @author Steve Ebersole * @author Steve Ebersole
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
*/ */
@FailureExpectedWithNewMetamodel
public class BasicSequenceTest extends BaseCoreFunctionalTestCase { public class BasicSequenceTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { 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.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator; import org.hibernate.id.enhanced.SequenceStyleGenerator;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.hibernate.testing.junit4.ExtraAssertions.assertClassAssignability; import static org.hibernate.testing.junit4.ExtraAssertions.assertClassAssignability;
@ -40,11 +41,13 @@ import static org.junit.Assert.assertEquals;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class HiLoSequenceTest extends BaseCoreFunctionalTestCase { public class HiLoSequenceTest extends BaseCoreFunctionalTestCase {
@Override
protected String[] getMappings() { protected String[] getMappings() {
return new String[] { "idgen/enhanced/sequence/HiLo.hbm.xml" }; return new String[] { "idgen/enhanced/sequence/HiLo.hbm.xml" };
} }
@Test @Test
@FailureExpectedWithNewMetamodel
public void testNormalBoundary() { public void testNormalBoundary() {
EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() ); EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() );
assertClassAssignability( SequenceStyleGenerator.class, persister.getIdentifierGenerator().getClass() ); 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.OptimizerFactory;
import org.hibernate.id.enhanced.SequenceStyleGenerator; import org.hibernate.id.enhanced.SequenceStyleGenerator;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.hibernate.id.IdentifierGeneratorHelper.BasicHolder; import static org.hibernate.id.IdentifierGeneratorHelper.BasicHolder;
@ -45,6 +46,7 @@ public class PooledSequenceTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@FailureExpectedWithNewMetamodel
public void testNormalBoundary() { public void testNormalBoundary() {
EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() ); EntityPersister persister = sessionFactory().getEntityPersister( Entity.class.getName() );
assertClassAssignability( SequenceStyleGenerator.class, persister.getIdentifierGenerator().getClass() ); assertClassAssignability( SequenceStyleGenerator.class, persister.getIdentifierGenerator().getClass() );

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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