Bug 315486 - tests of jpa cacheable model failed with NPE and junit.framework.AssertionFailedError
Summary: tests of jpa cacheable model failed with NPE and junit.framework.AssertionFai...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2010-06-02 16:19 EDT by Yiping Zhao CLA
Modified: 2022-06-09 10:30 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yiping Zhao CLA 2010-06-02 16:19:31 EDT
This is the first time this model is running on application servers after fix of bug 310329, the failed tests and error messages are:

1. testCachingOnALL, testCachingOnNONE, testCachingOnENABLE_SELECTIVE, testCachingOnDISABLE_SELECTIVE

<error type="java.lang.NullPointerException">java.lang.NullPointerException
	at org.eclipse.persistence.testing.tests.jpa.cacheable.CacheableModelJunitTest.usesNoCache(CacheableModelJunitTest.java:899)
	at org.eclipse.persistence.testing.tests.jpa.cacheable.CacheableModelJunitTest.testCachingOnALL(CacheableModelJunitTest.java:680)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:486)

2. testRefreshWithEMProperties, testRefreshWithRefreshProperties

<failure message="CacheableTrueEntity should have been refreshed." type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: CacheableTrueEntity should have been refreshed.
	at org.eclipse.persistence.testing.tests.jpa.cacheable.CacheableModelJunitTest.testRefreshWithEMProperties(CacheableModelJunitTest.java:405)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:487)
	at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87)
	at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)

3. testRetrieveBYPASSStoreUSE1, testRetrieveBYPASSStoreUSE2,testRetrieveBYPASSStoreBYPASS1

<failure message="The entity instances must be the same" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: The entity instances must be the same
	at org.eclipse.persistence.testing.tests.jpa.cacheable.CacheableModelJunitTest.testRetrieveBYPASSStoreUSE1(CacheableModelJunitTest.java:519)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:487)
	at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87)
	at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)

4. testRetrieveUSEStoreBYPASS1,testRetrieveUSEStoreBYPASS2,testRetrieveBYPASSStoreBYPASS2

<failure message="The entity returned should match the cached instance" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: The entity returned should match the cached instance
	at org.eclipse.persistence.testing.tests.jpa.cacheable.CacheableModelJunitTest.testRetrieveUSEStoreBYPASS1(CacheableModelJunitTest.java:573)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:487)
	at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87)
	at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
	at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)

5. testEMPropertiesOnCommit1
 <failure message="The shared cache was updated when the EM property CacheStoreMode = BYPASS" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: The shared cache was updated when the EM property CacheStoreMode = BYPASS
	at org.eclipse.persistence.testing.tests.jpa.cacheable.CacheableModelJunitTest.testEMPropertiesOnCommit1(CacheableModelJunitTest.java:248)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:487)
	at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87)
	at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)

6. testEMPropertiesOnCommit2
 <failure message="The shared cache should NOT have been updated" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: The shared cache should NOT have been updated
	at org.eclipse.persistence.testing.tests.jpa.cacheable.CacheableModelJunitTest.testEMPropertiesOnCommit2(CacheableModelJunitTest.java:299)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:487)
	at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87)
	at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
	at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)

7. testInheritanceCacheable
<failure message="ChildCacheableFalseEntity was in the cache" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: ChildCacheableFalseEntity was in the cache
	at org.eclipse.persistence.testing.tests.jpa.cacheable.CacheableModelJunitTest.testInheritanceCacheable(CacheableModelJunitTest.java:642)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:487)
	at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87)
	at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
	at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
	at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
	at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
Comment 1 Yiping Zhao CLA 2010-06-03 10:46:53 EDT
above test failures are the one on WebLogic, the same tests failed on GlassFish V3 except testInheritanceCacheable
Comment 2 Tom Ware CLA 2010-06-04 14:57:18 EDT
It appears this test is incompatible with the server test framework as it currently works.

Some observations:

1. The build file omits several entities from the cacheable model jar.
2. When #1 is fixed my calls to getPUServerSession(<puName>) always behave as if <puName> is "default'
3. With #1 fixed all the rest of the failures I am getting are serialization issiues.  I suspect this is related to the fact that these tests use multiple entity managers and I have had some issues with doing that when previous tests I have written are moved from SE to the server test framework

At the moment, these testing issues appear to be related to compatibility of the Cacheable tests with the server test framework and are not showing any issues with our implementation of cacheable.

For now I am setting this bug to "test".  We can reassign when we address some of those issues.
Comment 3 Yiping Zhao CLA 2010-07-22 16:21:31 EDT
After investigation, I found the problems are:

    * sessionbean class can't have super class which itself is a sessionbean class, so I changed the extra test runner beans to not extend the original TestRunnerBean as I did originally
    * one single test case class can't have multiple persistence unit tests because we only one test runner which has one entity manager is associated with one test case class, so I wrote several individual server tests by retrieved from original tests according to persistence init , each test case class has only one single persistence unit associated
    * changed JUnitTestCase to lookup different test runner regarding to if it's single persistence unit or multiple persistence units

The changes are:
(1). modify jpa/build.xml to not replacing the multiple persistence unit names in test runner beans since the persistence unit names are fixed one now. "MulitPU-1" ... "MulitPU-5"
(2). modify TestRunner1Bean.java ... TestRunner4Bean.java to not extend the TestRunnerBean, and implement its own remote interface since WebSphere needs that, add new TestRunner5Bean.java. The new test runner interfaces are added like TestRunner1.java ... TestRunner5.java under jpa\eclipselink.jpa.test\src\org\eclipse\persistence\testing\framework\
(3). change eclipselink.jpa.test\src\org\eclipse\persistence\testing\framework\junit\JUnitTestCase.java to lookup different test runner regarding to single or multiple persistence units
(4). add CacheableServerTestSuite.java including individual persistence unit tests CacheableModelJunitTestAll.java, CacheableModelJunitTestDisableSelective.java, CacheableModelJunitTestEnableSelective.java, CacheableModelJunitTestNone.java and CacheableModelJunitTestUnspecified.java for server only

code is checked in SVN as revision 7897 and reviewed by Kevin Yuan.
Comment 4 Yiping Zhao CLA 2010-07-26 15:43:38 EDT
checked in fix in 2.1 as revision 7924
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:14:37 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:30:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink