Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 150156 Details for
Bug 292951
test failures of "test-spring-srg"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
fix test failures of advanced and fieldaccess advanced model
bug292695.patch (text/plain), 5.16 KB, created by
Yiping Zhao
on 2009-10-21 16:02:27 EDT
(
hide
)
Description:
fix test failures of advanced and fieldaccess advanced model
Filename:
MIME Type:
Creator:
Yiping Zhao
Created:
2009-10-21 16:02:27 EDT
Size:
5.16 KB
patch
obsolete
>Index: jpa/eclipselink.jpa.test/resource/server/ejb-jar.xml >=================================================================== >--- jpa/eclipselink.jpa.test/resource/server/ejb-jar.xml (revision 5579) >+++ jpa/eclipselink.jpa.test/resource/server/ejb-jar.xml (working copy) >@@ -8,11 +8,11 @@ > <session> > <ejb-name>TestRunner</ejb-name> > <persistence-context-ref> >- <persistence-context-ref-name>persistence/entity-manager</persistence-context-ref-name> >+ <persistence-context-ref-name>persistence/default/entity-manager</persistence-context-ref-name> > <persistence-unit-name>%%default%%</persistence-unit-name> > </persistence-context-ref> > <persistence-unit-ref> >- <persistence-unit-ref-name>persistence/factory</persistence-unit-ref-name> >+ <persistence-unit-ref-name>persistence/default/factory</persistence-unit-ref-name> > <persistence-unit-name>%%default%%</persistence-unit-name> > </persistence-unit-ref> > </session> >Index: jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/server/JEEPlatform.java >=================================================================== >--- jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/server/JEEPlatform.java (revision 5579) >+++ jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/server/JEEPlatform.java (working copy) >@@ -33,6 +33,9 @@ > /** The entity manager factory for the test is injected and passed to the test server platform. */ > public static EntityManagerFactory entityManagerFactory; > >+ /** The variable for getting entity manager by jndi lookup, set it to true in test.properties if you want jndi lookup */ >+ public static final String EJB_LOOKUP = "ejb.lookup"; >+ > /** > * Nothing required in JEE. > */ >@@ -152,30 +155,34 @@ > * Return the managed EntityManager for the persistence unit. > */ > public EntityManager getEntityManager(String persistenceUnit) { >- if (entityManager != null) { >+ String property = System.getProperty(EJB_LOOKUP); >+ if (property == null || !property.toUpperCase().equals("TRUE")){ > return entityManager; >+ } else { >+ String contextName = "java:comp/env/persistence/" + persistenceUnit + "/entity-manager"; >+ try { >+ return (EntityManager)new InitialContext().lookup(contextName); >+ } catch (NamingException exception) { >+ throw new RuntimeException(exception); >+ } > } >- String contextName = "java:comp/env/persistence/" + persistenceUnit + "/entity-manager"; >- try { >- return (EntityManager)new InitialContext().lookup(contextName); >- } catch (NamingException exception) { >- throw new RuntimeException(exception); >- } > } > > /** > * Return the managed EntityManagerFactory for the persistence unit. > */ > public EntityManagerFactory getEntityManagerFactory(String persistenceUnit) { >- if (entityManagerFactory != null) { >+ String property = System.getProperty(EJB_LOOKUP); >+ if (property == null || !property.toUpperCase().equals("TRUE")){ > return entityManagerFactory; >+ } else{ >+ String contextName = "java:comp/env/persistence/" + persistenceUnit + "/factory"; >+ try { >+ return (EntityManagerFactory)new InitialContext().lookup(contextName); >+ } catch (NamingException exception) { >+ throw new RuntimeException(exception); >+ } > } >- String contextName = "java:comp/env/persistence/" + persistenceUnit + "/factory"; >- try { >- return (EntityManagerFactory)new InitialContext().lookup(contextName); >- } catch (NamingException exception) { >- throw new RuntimeException(exception); >- } > } > > } >Index: jpa/eclipselink.jpa.test/test.properties >=================================================================== >--- jpa/eclipselink.jpa.test/test.properties (revision 5579) >+++ jpa/eclipselink.jpa.test/test.properties (working copy) >@@ -45,6 +45,9 @@ > # Valid values of server.name are weblogic, websphere, jboss, oc4j, glassfish ... > server.name=weblogic > >+# Set value to true if you want to validate container managed JPA using jndi lookup >+#ejb.lookup=true >+ > # A property specifying if PromptTestRunner should save the test results to the database > should.save.results=false > >Index: jpa/eclipselink.jpa.test/weblogic.xml >=================================================================== >--- jpa/eclipselink.jpa.test/weblogic.xml (revision 5579) >+++ jpa/eclipselink.jpa.test/weblogic.xml (working copy) >@@ -106,6 +106,7 @@ > <!--sysproperty key="http.proxyHost" value="www-proxy.us.oracle.com"/--> > <!--sysproperty key="http.proxyPort" value="80"/--> > <sysproperty key="eclipselink.logging.level" value="${logging.level}"/> >+ <sysproperty key="ejb.lookup" value="${ejb.lookup}"/> > </wlserver> > </target> >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 292951
:
150156
|
150159