HHH-7513 test cleanup

This commit is contained in:
Brett Meyer 2013-09-20 11:32:13 -04:00
parent 7cf6a6272a
commit bb5e03cb64
1 changed files with 3 additions and 43 deletions

View File

@ -32,6 +32,7 @@ import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.TestForIssue;
import static org.junit.Assert.assertEquals;
@ -184,6 +185,7 @@ public abstract class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestC
}
@Test
@FailureExpected(jiraKey = "HHH-7513")
public void testReattachementUnmodifiedInstance() {
Session session = openSession();
session.beginTransaction();
@ -199,49 +201,7 @@ public abstract class CachedMutableNaturalIdTest extends BaseCoreFunctionalTestC
session = openSession();
session.beginTransaction();
session.buildLockRequest(LockOptions.NONE).lock(b);
// org.hibernate.PropertyAccessException: could not get a field value by reflection getter of org.hibernate.test.naturalid.mutable.cached.A.oid
// at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:62)
// at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:341)
// at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:4425)
// at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:4147)
// at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:209)
// at org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:248)
// at org.hibernate.type.ManyToOneType.disassemble(ManyToOneType.java:214)
// at org.hibernate.cache.spi.NaturalIdCacheKey.<init>(NaturalIdCacheKey.java:84)
// at org.hibernate.engine.internal.StatefulPersistenceContext$1.removeSharedNaturalIdCrossReference(StatefulPersistenceContext.java:1991)
// at org.hibernate.persister.entity.AbstractEntityPersister.handleNaturalIdReattachment(AbstractEntityPersister.java:4134)
// at org.hibernate.persister.entity.AbstractEntityPersister.afterReassociate(AbstractEntityPersister.java:4106)
// at org.hibernate.event.internal.AbstractReassociateEventListener.reassociate(AbstractReassociateEventListener.java:100)
// at org.hibernate.event.internal.DefaultLockEventListener.onLock(DefaultLockEventListener.java:81)
// at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:811)
// at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:804)
// at org.hibernate.internal.SessionImpl.access$11(SessionImpl.java:803)
// at org.hibernate.internal.SessionImpl$LockRequestImpl.lock(SessionImpl.java:2365)
// at org.hibernate.test.naturalid.mutable.cached.CachedMutableNaturalIdTest.testSimone(CachedMutableNaturalIdTest.java:308)
// at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
// at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
// at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
// at java.lang.reflect.Method.invoke(Unknown Source)
// at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
// at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
// at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
// at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63)
// at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
// at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
// at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
// at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62)
// Caused by: java.lang.IllegalArgumentException: Can not set long field org.hibernate.test.naturalid.mutable.cached.A.oid to java.lang.Long
// at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
// at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
// at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source)
// at sun.reflect.UnsafeLongFieldAccessorImpl.getLong(Unknown Source)
// at sun.reflect.UnsafeLongFieldAccessorImpl.get(Unknown Source)
// at java.lang.reflect.Field.get(Unknown Source)
// at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:59)
// ... 29 more
session.buildLockRequest(LockOptions.NONE).lock(b); // HHH-7513 failure during reattachment
session.delete(b.assA);
session.delete(b);