incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From timothyjw...@apache.org
Subject svn commit: r908733 - in /incubator/aries/trunk/jpa: jpa-container-itest/ jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/ jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/
Date Wed, 10 Feb 2010 23:09:28 GMT
Author: timothyjward
Date: Wed Feb 10 23:09:24 2010
New Revision: 908733

URL: http://svn.apache.org/viewvc?rev=908733&view=rev
Log:
ARIES-157: Deliver JPA iTests

Modified:
    incubator/aries/trunk/jpa/jpa-container-itest/pom.xml
    incubator/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/PersistenceUnitInfoImpl.java

Modified: incubator/aries/trunk/jpa/jpa-container-itest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container-itest/pom.xml?rev=908733&r1=908732&r2=908733&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container-itest/pom.xml (original)
+++ incubator/aries/trunk/jpa/jpa-container-itest/pom.xml Wed Feb 10 23:09:24 2010
@@ -8,6 +8,7 @@
   <groupId>org.apache.aries.jpa</groupId>
   <artifactId>jpa-container-itest</artifactId>
   <version>1.0.0-incubating-SNAPSHOT</version>
+  <name>Aries JPA iTests - Managed Persistence Units</name>
 <!--   
 
 	For adding EclipseLink as a provider
@@ -128,7 +129,12 @@
     <dependency>
       <groupId>org.apache.openjpa</groupId>
       <artifactId>openjpa</artifactId>
-      <version>2.0.0-M3</version>
+      <version>2.0.0-beta</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jta_1.1_spec</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -149,6 +155,11 @@
       <scope>test</scope>
     </dependency>  
     <dependency>
+      <groupId>org.apache.servicemix.bundles</groupId> 
+      <artifactId>org.apache.servicemix.bundles.serp</artifactId> 
+      <version>1.13.1_2</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.aries.jpa</groupId>
       <artifactId>jpa-container-testbundle</artifactId>
       <version>1.0.0-incubating-SNAPSHOT</version>

Modified: incubator/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java?rev=908733&r1=908732&r2=908733&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
Wed Feb 10 23:09:24 2010
@@ -56,7 +56,7 @@
   @Before
   public void setupApplication() throws Exception
   {
-    Bundle openJPA = getBundle("org.apache.openjpa.openjpa");
+    Bundle openJPA = getBundle("org.apache.openjpa");
     
     Class<? extends PersistenceProvider> clz = openJPA.loadClass("org.apache.openjpa.persistence.PersistenceProviderImpl");
     
@@ -78,7 +78,6 @@
   }
   
   //This test will run once there is an updated OpenJPA bundle that uses the latest JPA API
-  @Ignore
   @Test
   public void findEntityManagerFactory() throws Exception {
     EntityManagerFactory emf = getOsgiService(EntityManagerFactory.class, "(osgi.unit.name=test-unit)",
DEFAULT_TIMEOUT);
@@ -109,9 +108,11 @@
         mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"), 
         mavenBundle("org.apache.geronimo.specs", "geronimo-jpa_2.0_spec"),
         mavenBundle("org.apache.aries.jpa", "jpa-container"),
+        mavenBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec"),
         mavenBundle("commons-lang", "commons-lang"),
         mavenBundle("commons-collections", "commons-collections"),
         mavenBundle("commons-pool", "commons-pool"),
+        mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.serp"),
         mavenBundle("org.apache.openjpa", "openjpa"),
 
 //        mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa"),

Modified: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/PersistenceUnitInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/PersistenceUnitInfoImpl.java?rev=908733&r1=908732&r2=908733&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/PersistenceUnitInfoImpl.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/PersistenceUnitInfoImpl.java
Wed Feb 10 23:09:24 2010
@@ -52,12 +52,32 @@
   /** Logger */
   private static final Logger _logger = LoggerFactory.getLogger("org.apache.aries.jpa.container");
   
-  public PersistenceUnitInfoImpl (Bundle b, ParsedPersistenceUnit parsedData, ServiceReference
providerRef)
+  public PersistenceUnitInfoImpl (Bundle b, ParsedPersistenceUnit parsedData, final ServiceReference
providerRef)
   {
     bundle = b;
     unit = parsedData;
     this.providerRef = providerRef;
-    cl = new BundleDelegatingClassLoader(b);
+    //Override the default behaviour until OPENJPA-1491 is fixed, remove the inner class
when
+    //it is
+    cl = new BundleDelegatingClassLoader(b){
+
+      @Override
+      protected Class<?> findClass(String className)
+          throws ClassNotFoundException {
+        try {
+         return super.findClass(className);
+        } catch (ClassNotFoundException cnfe) {
+          if("org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".equals(className))
+            try{
+              return providerRef.getBundle().loadClass(className);
+            } catch (ClassNotFoundException cnfe2) {
+              
+            }
+            throw cnfe;
+        }
+      }
+    };
+    //End temporary fix for OPENJPA-1491
   }
   
   public void addTransformer(ClassTransformer arg0) {



Mime
View raw message