geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r632360 - in /geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10: pom.xml src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java src/test/java/org/apache/geronimo/persistence/PersistenceUnitGBeanTest.java
Date Fri, 29 Feb 2008 15:50:34 GMT
Author: djencks
Date: Fri Feb 29 07:50:31 2008
New Revision: 632360

URL: http://svn.apache.org/viewvc?rev=632360&view=rev
Log:
GERONIMO-3880 another NPE fix, for persistenceUnitRootUrl

Modified:
    geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/pom.xml
    geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
    geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/src/test/java/org/apache/geronimo/persistence/PersistenceUnitGBeanTest.java

Modified: geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/pom.xml?rev=632360&r1=632359&r2=632360&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/pom.xml (original)
+++ geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/pom.xml Fri Feb
29 07:50:31 2008
@@ -50,6 +50,11 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jpa_3.0_spec</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>

Modified: geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java?rev=632360&r1=632359&r2=632360&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
(original)
+++ geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
Fri Feb 29 07:50:31 2008
@@ -87,10 +87,9 @@
         List<String> mappingFileNames = mappingFileNamesUntyped == null? new ArrayList<String>():
new ArrayList<String>(mappingFileNamesUntyped);
         this.persistenceUnitRoot = persistenceUnitRoot;
         URI configurationBaseURI = new File(configurationBaseURL.getFile()).toURI();
-        URL rootURL = null;
+        URL rootURL = configurationBaseURI.resolve(persistenceUnitRoot).normalize().toURL();
         List<URL> jarFileUrls = NO_URLS;
         if (!excludeUnlistedClassesValue) {
-            rootURL = configurationBaseURI.resolve(persistenceUnitRoot).normalize().toURL();
             jarFileUrls = new ArrayList<URL>();
             for (String urlString: jarFileUrlsUntyped) {
                 URL url = configurationBaseURI.resolve(urlString).normalize().toURL();

Modified: geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/src/test/java/org/apache/geronimo/persistence/PersistenceUnitGBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/src/test/java/org/apache/geronimo/persistence/PersistenceUnitGBeanTest.java?rev=632360&r1=632359&r2=632360&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/src/test/java/org/apache/geronimo/persistence/PersistenceUnitGBeanTest.java
(original)
+++ geronimo/server/branches/2.1/plugins/openjpa/geronimo-persistence-jpa10/src/test/java/org/apache/geronimo/persistence/PersistenceUnitGBeanTest.java
Fri Feb 29 07:50:31 2008
@@ -17,6 +17,10 @@
 
 package org.apache.geronimo.persistence;
 
+import java.io.File;
+
+import javax.persistence.spi.PersistenceUnitInfo;
+
 import junit.framework.TestCase;
 
 /**
@@ -26,5 +30,25 @@
 
     public void testNoArgConstructor() throws Exception {
         new PersistenceUnitGBean();
+    }
+    
+    public void testNonNullJavaFileUrls() throws Exception {
+        PersistenceUnitGBean gbean = new PersistenceUnitGBean("foo",
+                null,
+                "JTA",
+                null,
+                null,
+                null,
+                null,
+                "/foo/bar/Root",
+                null,
+                true,
+                null,
+                null,
+                null,
+                new File("/foo/bar/Root").toURL(),
+                getClass().getClassLoader());
+        assertNotNull(gbean.getJarFileUrls());
+        assertNotNull(gbean.getPersistenceUnitRootUrl());
     }
 }



Mime
View raw message