| Summary: | JPA: LifecycleJUnitTest assertion failures (1 of 5) on UOW.lifecycle tests are ignored by AssertionFailedError catch blocks | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Michael OBrien <michael.f.obrien> |
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P2 | CC: | andrei.ilitchev, eclipselink.orm-inbox, jamesssss, michael.f.obrien, peter.krogh |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| URL: | http://wiki.eclipse.org/EclipseLink/Bugs/259993 | ||
| Whiteboard: | |||
| Bug Depends on: | 259993 | ||
| Bug Blocks: | |||
| Attachments: | |||
|
Description
Michael OBrien
>The failing test looks to be correct >If I understand it correctly - I was trying to test that a clearForClose() did not clear when in UOW state 4 >It is now clearing but (not failing properly) public void clearForClose(boolean shouldClearCache) { clear(shouldClearCache); if (isActive()) { //Reset lifecycle > this.lifecycle = Birth; >the lifecycle is reset to 0 from 4 because the isActive() check is true for all non state 5 Thread [Thread-6] (Suspended) UnitOfWorkImpl.clearForClose(boolean) line: 5751 LifecycleJUnitTest.testClearWhileEntityManagerInFakeMergePendingState4() line: 120 public boolean isActive() { > return this.lifecycle != Death; } >I discussed this with Andrei and the code was moved to clear() I should be calling the API function and not the backdoor now. >The change in the patch works now - and the test is once again usefull in reporting failures TEST MODEL NAME: (JUnit test): LifecycleJUnitTestSuite Errors: (failures): 0 Fatal Errors: (errors): 0 Passed: 6 Total Tests: 6 Created attachment 179490 [details]
Lifecycle tests for pendingMerge 4 state should use clear() now not backdoor clearForClose() anymore so that we do not clear in state 4
Created attachment 179521 [details]
Lifecycle tests for pendingMerge 4 state should use em.clear() now not backdoor uow.clearForClose() anymore so that we do not clear in state 4
>2.1.2 test results OK
<testcase classname="org.eclipse.persistence.testing.tests.jpa.advanced.concurrency.LifecycleJUnitTest" name="testClearWhileEntityManagerInFakeMergePendingState4" time="0.0" />
<testcase classname="org.eclipse.persistence.testing.tests.jpa.advanced.concurrency.LifecycleJUnitTest" name="testClearWhileEntityManagerInFakeBirthState0" time="0.0" />
<testcase classname="org.eclipse.persistence.testing.tests.jpa.advanced.concurrency.LifecycleJUnitTest" name="testClearWhileEntityManagerInCommitPendingStateWithClearAfterCommit" time="0.062" />
<testcase classname="org.eclipse.persistence.testing.tests.jpa.advanced.concurrency.LifecycleJUnitTest" name="testClearWhileEntityManagerInCommitPendingStateWithNoClearAfterCommit" time="0.0" />
<testcase classname="org.eclipse.persistence.testing.tests.jpa.advanced.concurrency.LifecycleJUnitTest" name="testClearAfterEntityManagerCommitFinished" time="0.0" />
>fix is in SVN Rev # 8241 and 8242 (2.1.2) https://fisheye2.atlassian.com/changelog/eclipselink/?cs=8241 The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |