Skip to content

Commit bb5e03c

Browse files
committed
HHH-7513 test cleanup
1 parent 7cf6a62 commit bb5e03c

File tree

1 file changed

+3
-43
lines changed

1 file changed

+3
-43
lines changed

hibernate-core/src/test/java/org/hibernate/test/naturalid/mutable/cached/CachedMutableNaturalIdTest.java

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.hibernate.cfg.Configuration;
3333
import org.hibernate.cfg.Environment;
3434
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
35+
import org.hibernate.testing.FailureExpected;
3536
import org.hibernate.testing.TestForIssue;
3637

3738
import static org.junit.Assert.assertEquals;
@@ -184,6 +185,7 @@ public void testNaturalIdChangeAfterResolveEntityFrom2LCache() {
184185
}
185186

186187
@Test
188+
@FailureExpected(jiraKey = "HHH-7513")
187189
public void testReattachementUnmodifiedInstance() {
188190
Session session = openSession();
189191
session.beginTransaction();
@@ -199,49 +201,7 @@ public void testReattachementUnmodifiedInstance() {
199201

200202
session = openSession();
201203
session.beginTransaction();
202-
session.buildLockRequest(LockOptions.NONE).lock(b);
203-
// org.hibernate.PropertyAccessException: could not get a field value by reflection getter of org.hibernate.test.naturalid.mutable.cached.A.oid
204-
// at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:62)
205-
// at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:341)
206-
// at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:4425)
207-
// at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:4147)
208-
// at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:209)
209-
// at org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:248)
210-
// at org.hibernate.type.ManyToOneType.disassemble(ManyToOneType.java:214)
211-
// at org.hibernate.cache.spi.NaturalIdCacheKey.<init>(NaturalIdCacheKey.java:84)
212-
// at org.hibernate.engine.internal.StatefulPersistenceContext$1.removeSharedNaturalIdCrossReference(StatefulPersistenceContext.java:1991)
213-
// at org.hibernate.persister.entity.AbstractEntityPersister.handleNaturalIdReattachment(AbstractEntityPersister.java:4134)
214-
// at org.hibernate.persister.entity.AbstractEntityPersister.afterReassociate(AbstractEntityPersister.java:4106)
215-
// at org.hibernate.event.internal.AbstractReassociateEventListener.reassociate(AbstractReassociateEventListener.java:100)
216-
// at org.hibernate.event.internal.DefaultLockEventListener.onLock(DefaultLockEventListener.java:81)
217-
// at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:811)
218-
// at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:804)
219-
// at org.hibernate.internal.SessionImpl.access$11(SessionImpl.java:803)
220-
// at org.hibernate.internal.SessionImpl$LockRequestImpl.lock(SessionImpl.java:2365)
221-
// at org.hibernate.test.naturalid.mutable.cached.CachedMutableNaturalIdTest.testSimone(CachedMutableNaturalIdTest.java:308)
222-
// at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
223-
// at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
224-
// at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
225-
// at java.lang.reflect.Method.invoke(Unknown Source)
226-
// at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
227-
// at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
228-
// at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
229-
// at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63)
230-
// at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
231-
// at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
232-
// at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
233-
// at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62)
234-
// Caused by: java.lang.IllegalArgumentException: Can not set long field org.hibernate.test.naturalid.mutable.cached.A.oid to java.lang.Long
235-
// at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
236-
// at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
237-
// at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source)
238-
// at sun.reflect.UnsafeLongFieldAccessorImpl.getLong(Unknown Source)
239-
// at sun.reflect.UnsafeLongFieldAccessorImpl.get(Unknown Source)
240-
// at java.lang.reflect.Field.get(Unknown Source)
241-
// at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:59)
242-
// ... 29 more
243-
244-
204+
session.buildLockRequest(LockOptions.NONE).lock(b); // HHH-7513 failure during reattachment
245205
session.delete(b.assA);
246206
session.delete(b);
247207

0 commit comments

Comments
 (0)