aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1631104 [1/2] - in /aries/trunk/jpa: ./ jpa-api/ jpa-blueprint-aries/ jpa-blueprint-testbundle/ jpa-container-advancedtestbundle/ jpa-container-advancedtestbundle/src/main/resources/META-INF/ jpa-container-context/ jpa-container-context/sr...
Date Sat, 11 Oct 2014 19:51:38 GMT
Author: cschneider
Date: Sat Oct 11 19:51:37 2014
New Revision: 1631104

URL: http://svn.apache.org/r1631104
Log:
[ARIES-1251] Improvements in jpa21 support and added eclipse test for jpa 2.1 with thanks to Guiseppe Gerla

Added:
    aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/
    aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/create.sql
    aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/data.sql
    aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/drop.sql
    aries/trunk/jpa/jpa-container/src/main/resources/org/apache/aries/jpa/container/parsing/impl/persistence_2_1.xsd.rsrc
Modified:
    aries/trunk/jpa/jpa-api/pom.xml
    aries/trunk/jpa/jpa-blueprint-aries/pom.xml
    aries/trunk/jpa/jpa-blueprint-testbundle/pom.xml
    aries/trunk/jpa/jpa-container-advancedtestbundle/pom.xml
    aries/trunk/jpa/jpa-container-advancedtestbundle/src/main/resources/META-INF/persistence.xml
    aries/trunk/jpa/jpa-container-context/pom.xml
    aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/transaction/impl/JTAEntityManagerHandler.java
    aries/trunk/jpa/jpa-container-context/src/main/resources/org/apache/aries/jpa/container/context/nls/jpaContainerContextMessages.properties
    aries/trunk/jpa/jpa-container-eclipselink-adapter/pom.xml
    aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/Activator.java
    aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/EclipseLinkProviderService.java
    aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/platform/OSGiTSServer.java
    aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/platform/OSGiTSWrapper.java
    aries/trunk/jpa/jpa-container-itest/pom.xml
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/OpenjpaWeavingAndAnnotationScanningTest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/JPAInjectionTest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerDataSourceFactoryTest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkStartupTest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaContextTest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/quiesce/itest/AbstractQuiesceJPATest.java
    aries/trunk/jpa/jpa-container-testbundle-eclipselink/pom.xml
    aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/persistence.xml
    aries/trunk/jpa/jpa-container-testbundle/pom.xml
    aries/trunk/jpa/jpa-container/pom.xml
    aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerProxyFactory.java
    aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/QuiesceEMFHandler.java
    aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/JPAHandler.java
    aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/SchemaLocatingHandler.java
    aries/trunk/jpa/jpa-container/src/main/resources/org/apache/aries/jpa/container/nls/jpaContainerMessages.properties
    aries/trunk/jpa/pom.xml

Modified: aries/trunk/jpa/jpa-api/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-api/pom.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-api/pom.xml (original)
+++ aries/trunk/jpa/jpa-api/pom.xml Sat Oct 11 19:51:37 2014
@@ -64,9 +64,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.hibernate.javax.persistence</groupId>
-            <artifactId>hibernate-jpa-2.1-api</artifactId>
-            <version>1.0.0.Final</version>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <version>1.1</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>

Modified: aries/trunk/jpa/jpa-blueprint-aries/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-blueprint-aries/pom.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-blueprint-aries/pom.xml (original)
+++ aries/trunk/jpa/jpa-blueprint-aries/pom.xml Sat Oct 11 19:51:37 2014
@@ -62,9 +62,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.hibernate.javax.persistence</groupId>
-            <artifactId>hibernate-jpa-2.1-api</artifactId>
-            <version>1.0.0.Final</version>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <version>1.1</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -76,7 +76,7 @@
         <dependency>
             <groupId>org.apache.aries.jpa</groupId>
             <artifactId>org.apache.aries.jpa.api</artifactId>
-            <version>1.0.2</version>
+            <version>1.0.3-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>

Modified: aries/trunk/jpa/jpa-blueprint-testbundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-blueprint-testbundle/pom.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-blueprint-testbundle/pom.xml (original)
+++ aries/trunk/jpa/jpa-blueprint-testbundle/pom.xml Sat Oct 11 19:51:37 2014
@@ -53,9 +53,9 @@
 
     <dependencies>
         <dependency>
-            <groupId>org.hibernate.javax.persistence</groupId>
-            <artifactId>hibernate-jpa-2.1-api</artifactId>
-            <version>1.0.0.Final</version>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <version>1.1</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>

Modified: aries/trunk/jpa/jpa-container-advancedtestbundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-advancedtestbundle/pom.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-advancedtestbundle/pom.xml (original)
+++ aries/trunk/jpa/jpa-container-advancedtestbundle/pom.xml Sat Oct 11 19:51:37 2014
@@ -56,9 +56,9 @@
 
     <dependencies>
         <dependency>
-            <groupId>org.hibernate.javax.persistence</groupId>
-            <artifactId>hibernate-jpa-2.1-api</artifactId>
-            <version>1.0.0.Final</version>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <version>1.1</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>

Modified: aries/trunk/jpa/jpa-container-advancedtestbundle/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-advancedtestbundle/src/main/resources/META-INF/persistence.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-advancedtestbundle/src/main/resources/META-INF/persistence.xml (original)
+++ aries/trunk/jpa/jpa-container-advancedtestbundle/src/main/resources/META-INF/persistence.xml Sat Oct 11 19:51:37 2014
@@ -24,10 +24,11 @@
   
   <persistence-unit name="test-unit" transaction-type="RESOURCE_LOCAL">
     <description>Test persistence unit for the JPA Container advanced iTests</description>
-    <properties>
+	<properties>
       <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
       <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
       <property name="javax.persistence.jdbc.databaseName" value="memory:TEST;create=true"/>
+      <property name="eclipselink.jdbc.url" value="jdbc:derby:memory:TEST;create=true"/>
       <property name="eclipselink.target-database" value="Derby"/>     
       <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
       <property name="eclipselink.ddl-generation.output-mode" value="database" />

Modified: aries/trunk/jpa/jpa-container-context/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-context/pom.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-context/pom.xml (original)
+++ aries/trunk/jpa/jpa-container-context/pom.xml Sat Oct 11 19:51:37 2014
@@ -70,9 +70,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.hibernate.javax.persistence</groupId>
-            <artifactId>hibernate-jpa-2.0-api</artifactId>
-            <version>1.0.0.Final</version>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <version>1.1</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -90,7 +90,7 @@
         <dependency>
             <groupId>org.apache.aries.jpa</groupId>
             <artifactId>org.apache.aries.jpa.api</artifactId>
-            <version>1.0.2</version>
+            <version>1.0.3-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/transaction/impl/JTAEntityManagerHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/transaction/impl/JTAEntityManagerHandler.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/transaction/impl/JTAEntityManagerHandler.java (original)
+++ aries/trunk/jpa/jpa-container-context/src/main/java/org/apache/aries/jpa/container/context/transaction/impl/JTAEntityManagerHandler.java Sat Oct 11 19:51:37 2014
@@ -13,6 +13,7 @@ import java.util.concurrent.atomic.Atomi
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.LockModeType;
+import javax.persistence.PersistenceException;
 import javax.persistence.TransactionRequiredException;
 
 import org.apache.aries.jpa.container.context.impl.NLS;
@@ -170,16 +171,23 @@ public class JTAEntityManagerHandler imp
         boolean forceTransaction = transactedMethods.contains(methodName);
         
         // TODO Check if this can be reached
-        if ("joinTransaction".equals(methodName)) {
+        if ("joinTransaction".equals(methodName) && args != null && args.length > 2 && args[2].getClass() == LockModeType.class) {
             forceTransaction = args[2] != LockModeType.NONE;
         }
         
-        if ("find".equals(methodName) && args.length >= 3 && args[2].getClass() == LockModeType.class) {
+        if ("find".equals(methodName) && args != null && args.length >= 3 && args[2].getClass() == LockModeType.class) {
             forceTransaction = args[2] != LockModeType.NONE;
         }
         
         EntityManager delegate = getPersistenceContext(forceTransaction); 
-        Object res = method.invoke(delegate, args);
+        Object res = null;
+        try {
+          res = method.invoke(delegate, args);
+        } catch (IllegalArgumentException e) {
+          new PersistenceException(NLS.MESSAGES.getMessage("wrong.JPA.version", new Object[]{
+              method.getName(), delegate
+          }), e);
+        }
         return res;
 
     }

Modified: aries/trunk/jpa/jpa-container-context/src/main/resources/org/apache/aries/jpa/container/context/nls/jpaContainerContextMessages.properties
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-context/src/main/resources/org/apache/aries/jpa/container/context/nls/jpaContainerContextMessages.properties?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-context/src/main/resources/org/apache/aries/jpa/container/context/nls/jpaContainerContextMessages.properties (original)
+++ aries/trunk/jpa/jpa-container-context/src/main/resources/org/apache/aries/jpa/container/context/nls/jpaContainerContextMessages.properties Sat Oct 11 19:51:37 2014
@@ -78,5 +78,7 @@ interruption.waiting.for.pu.unregister=T
 # {0} The persistence unit name
 possible.livelock.detected=The JPA container detected a possible live lock whilst unregistering the managed persistence context {0}. \
  The service cannot be unregistered immediately so the context may become unusable before being unregistered.
-
+# {0} Method name not found
+# {1} The persistence unit name
+wrong.JPA.version="Method {0} is not implemented by delegate {1}. Probably you want use JPA 2.1 but you are installed JPA 2.0."
 

Modified: aries/trunk/jpa/jpa-container-eclipselink-adapter/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-eclipselink-adapter/pom.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-eclipselink-adapter/pom.xml (original)
+++ aries/trunk/jpa/jpa-container-eclipselink-adapter/pom.xml Sat Oct 11 19:51:37 2014
@@ -31,7 +31,7 @@
     <groupId>org.apache.aries.jpa</groupId>
     <artifactId>org.apache.aries.jpa.eclipselink.adapter</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.1-SNAPSHOT</version>
+    <version>1.0.0-SNAPSHOT</version>
     <name>Aries JPA Container adapter for use with EclipseLink</name>
 
     <scm>
@@ -41,16 +41,30 @@
     </scm>
 
     <properties>
-        <aries.osgi.private.pkg>org.apache.aries.jpa.eclipselink.adapter.*</aries.osgi.private.pkg>
-        <aries.osgi.export.pkg></aries.osgi.export.pkg>
+        <aries.osgi.export.pkg>
+        	org.apache.aries.jpa.eclipselink.adapter,
+        	org.apache.aries.jpa.eclipselink.adapter.platform
+        </aries.osgi.export.pkg>
         <aries.osgi.import.pkg>
-            javax.persistence*;version="[1.1,2.1)",
-            !org.eclipse.persistence.*,
+			javax.persistence*;version="[2.1,3.0)",
+			org.eclipse.persistence.jpa;resolution:=optional,
+			org.eclipse.persistence.internal.weaving;resolution:=optional,
+			org.eclipse.persistence.internal.descriptors;resolution:=optional,
+			org.eclipse.persistence.queries;resolution:=optional,
+			org.eclipse.persistence.descriptors.changetracking;resolution:=optional,
+			org.eclipse.persistence.internal.identitymaps;resolution:=optional,
+			org.eclipse.persistence.sessions;resolution:=optional,
+			org.eclipse.persistence.internal.jpa.rs.metadata.model;resolution:=optional,
+			org.eclipse.persistence.indirection;resolution:=optional,
+			org.eclipse.persistence.jpa.jpql;resolution:=optional,
+			org.eclipse.persistence.jpa.jpql.parser;resolution:=optional,
+			org.eclipse.persistence.platform.server;resolution:=optional,
             *
         </aries.osgi.import.pkg>
         <aries.osgi.failok>true</aries.osgi.failok>
         <aries.osgi.activator>org.apache.aries.jpa.eclipselink.adapter.Activator</aries.osgi.activator>
-        <lastReleaseVersion>1.0.0</lastReleaseVersion>
+        <!-- First version -->
+        <aries.skip.version.check>true</aries.skip.version.check>
     </properties>
 
     <dependencies>
@@ -70,10 +84,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jpa_2.0_spec</artifactId>
-            <version>1.1</version>
-            <scope>provided</scope>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>javax.persistence</artifactId>
+            <version>2.1.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
@@ -82,18 +95,17 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.eclipse.persistence</groupId>
-            <artifactId>org.eclipse.persistence.jpa</artifactId>
-            <version>2.1.0</version>
-        </dependency>
-        <dependency>
             <groupId>org.apache.aries</groupId>
             <artifactId>org.apache.aries.util</artifactId>
-            <version>0.4</version>
-            <scope>provided</scope>
+            <version>1.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>org.eclipse.persistence.jpa</artifactId>
+            <version>2.5.2</version>
         </dependency>
     </dependencies>
-
+  
     <build>
         <plugins>
             <plugin>

Modified: aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/Activator.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/Activator.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/Activator.java (original)
+++ aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/Activator.java Sat Oct 11 19:51:37 2014
@@ -18,19 +18,6 @@
  */
 package org.apache.aries.jpa.eclipselink.adapter;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.spi.PersistenceProvider;
-
-import org.apache.aries.jpa.eclipselink.adapter.EclipseLinkProviderService;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
@@ -39,12 +26,22 @@ import org.osgi.framework.BundleListener
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.packageadmin.ExportedPackage;
-import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.framework.wiring.BundleRevision;
+import org.osgi.framework.wiring.BundleWire;
+import org.osgi.framework.wiring.BundleWiring;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.spi.PersistenceProvider;
+
 /**
  * Eclipselink adapter main class.
  * 
@@ -58,11 +55,10 @@ import org.slf4j.LoggerFactory;
 public class Activator implements BundleActivator, BundleListener {
     public static final String ECLIPSELINK_JPA_PROVIDER_BUNDLE_SYMBOLIC_NAME = "org.eclipse.persistence.jpa";
     public static final String ECLIPSELINK_JPA_PROVIDER_CLASS_NAME = "org.eclipse.persistence.jpa.PersistenceProvider";
-    private final ConcurrentMap<Bundle, ServiceRegistration> registeredProviders = new ConcurrentHashMap<Bundle, ServiceRegistration>();
+    private final ConcurrentMap<Bundle, ServiceRegistration<?>> registeredProviders = new ConcurrentHashMap<Bundle, ServiceRegistration<?>>();
     
     private static final Logger logger = LoggerFactory.getLogger(Activator.class);
     
-    private ServiceTracker tracker;
     private BundleContext context;
     
     public void start(BundleContext ctx) {
@@ -70,9 +66,6 @@ public class Activator implements Bundle
         
         context = ctx;
         
-        tracker = new ServiceTracker(ctx, PackageAdmin.class.getName(), null);
-        tracker.open();
-        
         ctx.addBundleListener(this);
         
         for (Bundle b : ctx.getBundles()) {
@@ -80,22 +73,15 @@ public class Activator implements Bundle
                 handlePotentialEclipseLink(b);
         }
     }
-  
+    
     public void stop(BundleContext ctx) {
-        logger.debug("Stopping EclipseLink adapter");
-        
-        tracker.close();
-        
-        for (ServiceRegistration reg : registeredProviders.values()) {
-            reg.unregister();
-        }
     }
-
+    
     public void bundleChanged(BundleEvent event) {
         if ((event.getType() & (BundleEvent.RESOLVED)) != 0) {
             handlePotentialEclipseLink(event.getBundle());
         } else if (event.getType() == BundleEvent.UNRESOLVED | event.getType() == BundleEvent.UNINSTALLED) {
-            ServiceRegistration reg = registeredProviders.remove(event.getBundle());
+            ServiceRegistration<?> reg = registeredProviders.remove(event.getBundle());
             if (reg != null) {
                 reg.unregister();
             }
@@ -118,7 +104,7 @@ public class Activator implements Bundle
             if (!!!registeredProviders.containsKey(b)) {
                 logger.debug("Adding new EclipseLink provider for bundle {}", b);
                 
-                ServiceFactory factory = new EclipseLinkProviderService(b);
+                ServiceFactory<?> factory = new EclipseLinkProviderService(b);
                 
                 Hashtable<String, Object> props = new Hashtable<String, Object>();
                 props.put("org.apache.aries.jpa.container.weaving.packages", getJPAPackages(b));
@@ -148,25 +134,24 @@ public class Activator implements Bundle
     private String[] getJPAPackages(Bundle jpaBundle) {
         Set<String> result = new HashSet<String>();
         
-        PackageAdmin admin = (PackageAdmin) tracker.getService();
         for (Bundle b : context.getBundles()) {
-            for (ExportedPackage ep : nullSafe(admin.getExportedPackages(b))) {
-                boolean add = true;
+            BundleWiring bw = b.adapt(BundleWiring.class);
+            List<BundleWire> wires = bw.getProvidedWires(BundleRevision.PACKAGE_NAMESPACE);
+
+            for (BundleWire w : wires) {
+                String pkgName = (String) w.getCapability().getAttributes().get(BundleRevision.PACKAGE_NAMESPACE);
+
+                boolean add = false;
                 if (b.equals(jpaBundle)) {
                     add = true;
-                } else if (ep.getName().startsWith("org.eclipse.persistence")) {
-                    inner: for (Bundle b2 : nullSafe(ep.getImportingBundles())) {
-                        if (b2.equals(jpaBundle)) {
-                            add = true;
-                            break inner;
-                        }
-                    }
+                } else if (pkgName.startsWith("org.eclipse.persistence")) {
+                    add = true;
                 }
                 
                 if (add) {
                     String suffix = ";" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + "=" + b.getSymbolicName() + ";" + Constants.BUNDLE_VERSION_ATTRIBUTE  + "=" + b.getVersion();                    
-                    result.add(ep.getName()+suffix);
-                }                
+                    result.add(pkgName + suffix);
+                }
             }
         }
         
@@ -178,9 +163,4 @@ public class Activator implements Bundle
         
         return result.toArray(new String[0]);
     }
-    
-    private<T> List<T> nullSafe(T[] array) {
-        if (array == null) return Collections.emptyList();
-        else return Arrays.asList(array);
-    }
 }

Modified: aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/EclipseLinkProviderService.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/EclipseLinkProviderService.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/EclipseLinkProviderService.java (original)
+++ aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/EclipseLinkProviderService.java Sat Oct 11 19:51:37 2014
@@ -18,14 +18,6 @@
  */
 package org.apache.aries.jpa.eclipselink.adapter;
 
-import java.lang.reflect.Constructor;
-import java.util.Map;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.spi.PersistenceProvider;
-import javax.persistence.spi.PersistenceUnitInfo;
-import javax.persistence.spi.ProviderUtil;
-
 import org.apache.aries.jpa.eclipselink.adapter.platform.OSGiTSServer;
 import org.apache.aries.util.nls.MessageUtil;
 import org.osgi.framework.Bundle;
@@ -34,11 +26,19 @@ import org.osgi.framework.ServiceRegistr
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.reflect.Constructor;
+import java.util.Map;
+
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.spi.PersistenceProvider;
+import javax.persistence.spi.PersistenceUnitInfo;
+import javax.persistence.spi.ProviderUtil;
 
 /**
  * Service factory for generating the Eclipselink OSGi compatible provider. It proxies the provider so that
  * we can go in at entity manager creation time and set the eclipselink target-server to be {@link OSGiTSServer}.
  */
+@SuppressWarnings({"rawtypes", "unchecked"})
 public class EclipseLinkProviderService implements ServiceFactory {
   private static final Logger logger = LoggerFactory.getLogger(Activator.class);
   private static final MessageUtil MESSAGES = MessageUtil.createMessageUtil(EclipseLinkProviderService.class, "org.apache.aries.jpa.eclipselink.adapter.jpaEclipseLinkAdapter");
@@ -49,11 +49,12 @@ public class EclipseLinkProviderService 
       eclipseLinkJpaBundle = b;
   }
   
+  @Override
   public Object getService(Bundle bundle, ServiceRegistration registration) {
     logger.debug("Requested EclipseLink Provider service");
     
     try {
-      Class<? extends PersistenceProvider> providerClass = eclipseLinkJpaBundle.loadClass(Activator.ECLIPSELINK_JPA_PROVIDER_CLASS_NAME);
+      Class<? extends PersistenceProvider> providerClass = (Class<? extends PersistenceProvider>) eclipseLinkJpaBundle.loadClass(Activator.ECLIPSELINK_JPA_PROVIDER_CLASS_NAME);
       Constructor<? extends PersistenceProvider> con = providerClass.getConstructor();
       final PersistenceProvider provider = con.newInstance();
       
@@ -68,10 +69,21 @@ public class EclipseLinkProviderService 
         
         public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo punit, Map props) {
           return provider.createContainerEntityManagerFactory(new PersistenceUnitProxyWithTargetServer(punit, 
-                eclipseLinkJpaBundle), props);
+                  eclipseLinkJpaBundle), props);
         }
-      };
         
+        @Override
+        public void generateSchema(PersistenceUnitInfo punit, Map arg1) {
+          provider.generateSchema(new PersistenceUnitProxyWithTargetServer(punit, 
+              eclipseLinkJpaBundle), arg1);
+        }
+
+        @Override
+        public boolean generateSchema(String arg0, Map arg1) {
+          return provider.generateSchema(arg0, arg1);
+        }
+      };
+      
     } catch (Exception e) {
         logger.error(MESSAGES.getMessage("error.creating.eclipselink.provider"), e);
         return null;                

Modified: aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/platform/OSGiTSServer.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/platform/OSGiTSServer.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/platform/OSGiTSServer.java (original)
+++ aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/platform/OSGiTSServer.java Sat Oct 11 19:51:37 2014
@@ -21,6 +21,7 @@ package org.apache.aries.jpa.eclipselink
 import org.eclipse.persistence.platform.server.ServerPlatformBase;
 import org.eclipse.persistence.sessions.DatabaseSession;
 
+@SuppressWarnings("rawtypes")
 public class OSGiTSServer extends ServerPlatformBase {
 
     public OSGiTSServer(DatabaseSession newDatabaseSession) {

Modified: aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/platform/OSGiTSWrapper.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/platform/OSGiTSWrapper.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/platform/OSGiTSWrapper.java (original)
+++ aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/platform/OSGiTSWrapper.java Sat Oct 11 19:51:37 2014
@@ -25,6 +25,7 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.ServiceReference;
 
+@SuppressWarnings({"rawtypes", "unchecked"})
 public class OSGiTSWrapper extends JTATransactionController {
 
     @Override

Modified: aries/trunk/jpa/jpa-container-itest/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/pom.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/pom.xml (original)
+++ aries/trunk/jpa/jpa-container-itest/pom.xml Sat Oct 11 19:51:37 2014
@@ -38,14 +38,14 @@
         <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/jpa/jpa-container-itest</developerConnection>
         <url>http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest</url>
     </scm>
-    
+
     <properties>
         <exam.version>3.4.0</exam.version>
         <url.version>1.6.0</url.version>
     </properties>
 
     <dependencies>
-		<dependency>
+        <dependency>
             <groupId>org.eclipse</groupId>
             <artifactId>org.eclipse.osgi</artifactId>
             <version>3.8.0.v20120529-1548</version>
@@ -96,10 +96,10 @@
             <version>1.1.0</version>
             <scope>test</scope>
         </dependency>
-                <dependency>
-            <groupId>org.hibernate.javax.persistence</groupId>
-            <artifactId>hibernate-jpa-2.1-api</artifactId>
-            <version>1.0.0.Final</version>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <version>1.1</version>
             <scope>test</scope>
         </dependency>
         
@@ -126,23 +126,23 @@
             <groupId>org.apache.aries.jpa</groupId>
             <artifactId>org.apache.aries.jpa.blueprint.aries</artifactId>
             <version>1.0.4-SNAPSHOT</version>
-            <!--<scope>test</scope>-->
+            <!--<scope>test</scope> -->
         </dependency>
 
         <dependency>
-        	<groupId>org.apache.geronimo.specs</groupId>
-        	<artifactId>geronimo-servlet_2.5_spec</artifactId>
-        	<version>1.2</version>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_2.5_spec</artifactId>
+            <version>1.2</version>
         </dependency>
         <dependency>
-        	<groupId>org.apache.servicemix.bundles</groupId>
-        	<artifactId>org.apache.servicemix.bundles.commons-dbcp</artifactId>
-        	<version>1.4_3</version>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.commons-dbcp</artifactId>
+            <version>1.4_3</version>
         </dependency>
         <dependency>
-        	<groupId>org.apache.xbean</groupId>
-        	<artifactId>xbean-asm4-shaded</artifactId>
-        	<version>3.16</version>
+            <groupId>org.apache.xbean</groupId>
+            <artifactId>xbean-asm4-shaded</artifactId>
+            <version>3.16</version>
         </dependency>
         <dependency>
             <groupId>org.apache.openjpa</groupId>
@@ -150,6 +150,44 @@
             <version>2.3.0</version>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>javax.persistence</artifactId>
+            <version>2.1.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>org.eclipse.persistence.antlr</artifactId>
+            <version>2.5.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>org.eclipse.persistence.core</artifactId>
+            <version>2.5.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>org.eclipse.persistence.jpa.jpql</artifactId>
+            <version>2.5.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>org.eclipse.persistence.asm</artifactId>
+            <version>2.5.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>org.eclipse.persistence.jpa</artifactId>
+            <version>2.5.2</version>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jta_1.1_spec</artifactId>
@@ -178,7 +216,7 @@
             <artifactId>org.apache.servicemix.bundles.serp</artifactId>
             <version>1.13.1_2</version>
         </dependency>
-        
+
         <!-- Test bundles -->
         <dependency>
             <groupId>org.apache.aries.jpa</groupId>
@@ -236,17 +274,29 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.aries.jpa</groupId>
+            <artifactId>org.apache.aries.jpa.eclipselink.adapter</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.jpa</groupId>
+            <artifactId>org.apache.aries.jpa.container.itest.bundle.eclipselink</artifactId>
+            <version>1.0.3-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.aries.jndi</groupId>
             <artifactId>org.apache.aries.jndi.url</artifactId>
             <version>1.0.0</version>
             <scope>test</scope>
         </dependency>
         <dependency>
-          <groupId>org.apache.aries.testsupport</groupId>
-          <artifactId>org.apache.aries.testsupport.unit</artifactId>
-          <version>2.0.0-SNAPSHOT</version>
-          <scope>test</scope>
-        </dependency>        
+            <groupId>org.apache.aries.testsupport</groupId>
+            <artifactId>org.apache.aries.testsupport.unit</artifactId>
+            <version>2.0.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derby</artifactId>
@@ -264,12 +314,11 @@
             <version>2.1_3_4</version>
             <scope>test</scope>
         </dependency>
-        
+
         <!-- pax exam -->
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-            <version>1.7.7</version>
         </dependency>
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java Sat Oct 11 19:51:37 2014
@@ -15,32 +15,38 @@
  */
 package org.apache.aries.jpa.advanced.features.itest;
 
-import static org.ops4j.pax.exam.CoreOptions.options;
-
-import org.junit.Ignore;
+import org.apache.aries.jpa.container.PersistenceUnitConstants;
+import org.apache.aries.jpa.container.advanced.itest.bundle.entities.Car;
+import org.eclipse.persistence.internal.weaving.PersistenceWeaved;
+import org.junit.Test;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 
-@Ignore
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.*;
+
+import java.util.Arrays;
+
+import javax.persistence.EntityManagerFactory;
+
 public class EclipseLinkWeavingAndAnnotationScanningTest extends JPAWeavingAndAnnotationScanningTest {
     @Configuration
     public Option[] eclipseLinkConfig() {
         return options(        
-        		baseOptions(), 
-        		eclipseLink(),
-        		openJpa(),
-        		testBundleAdvanced()
-
+            baseOptions(),
+            ariesJpa21(),
+            eclipseLink(),
+            testBundleAdvanced()          
         );
     }
     
-    /* Aries-811: EclipseLink removed from build to debug other build breaks
     @Test
     public void testClassIsWoven() throws Exception {
       context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)(" + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true))");
       
+      Thread.sleep(200);
       assertTrue("Not PersistenceCapable", Arrays.asList(Car.class.getInterfaces())
           .contains(PersistenceWeaved.class));
     }
-	*/
+	
 }

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/OpenjpaWeavingAndAnnotationScanningTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/OpenjpaWeavingAndAnnotationScanningTest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/OpenjpaWeavingAndAnnotationScanningTest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/OpenjpaWeavingAndAnnotationScanningTest.java Sat Oct 11 19:51:37 2014
@@ -35,7 +35,7 @@ public class OpenjpaWeavingAndAnnotation
 				baseOptions(),
 				openJpa(),
 				derbyDataSourceFactory(),
-				ariesJpa(),
+				ariesJpa20(),
 				transactionWrapper(),
 
 				testBundleAdvanced()

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/JPAInjectionTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/JPAInjectionTest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/JPAInjectionTest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/JPAInjectionTest.java Sat Oct 11 19:51:37 2014
@@ -28,7 +28,6 @@ import org.ops4j.pax.exam.Option;
 public class JPAInjectionTest extends AbstractJPAItest {
 
   @Test
-  @Ignore
   public void findResources() throws Exception {
     JPATestBean bean = context().getService(JPATestBean.class, "(version=1.0.0)");
     
@@ -37,7 +36,6 @@ public class JPAInjectionTest extends Ab
   }
   
   @Test
-  @Ignore
   public void findResources_110() throws Exception {
     JPATestBean bean = context().getService(JPATestBean.class, "(version=1.1.0)");
     
@@ -49,7 +47,6 @@ public class JPAInjectionTest extends Ab
   }
   
   @Test
-  @Ignore
   public void testLifecycle() throws Exception {
     JPATestBean bean = context().getService(JPATestBean.class, "(lifecycle=true)");
     assertTrue("No persistence context injection", bean.pContextAvailable());
@@ -62,7 +59,7 @@ public class JPAInjectionTest extends Ab
   public Option[] configuration() {
     return options(
     		baseOptions(),
-    		ariesJpa(),
+    		ariesJpa20(),
     		openJpa(),
     		testDs(),
     		testBundleBlueprint(),

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerDataSourceFactoryTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerDataSourceFactoryTest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerDataSourceFactoryTest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerDataSourceFactoryTest.java Sat Oct 11 19:51:37 2014
@@ -171,7 +171,7 @@ public class JPAContainerDataSourceFacto
 	public Option[] configuration() {
 		return options(
 				baseOptions(),
-				ariesJpa(),
+				ariesJpa20(),
 				transactionWrapper(),
 				openJpa(),
 				testBundle()

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java Sat Oct 11 19:51:37 2014
@@ -48,7 +48,7 @@ public class JPAContainerTest extends Ab
 	public Option[] configuration() {
 		return options(
 				baseOptions(),
-				ariesJpa(),
+				ariesJpa20(),
 				// Needed for the BP_TEST_UNIT
 				transactionWrapper(),
 				openJpa(),

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java Sat Oct 11 19:51:37 2014
@@ -15,22 +15,92 @@
  */
 package org.apache.aries.jpa.context.itest;
 
-import static org.ops4j.pax.exam.CoreOptions.options;
-
-import org.junit.Ignore;
+import org.apache.aries.jpa.container.itest.entities.Car;
+import org.junit.Test;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 
-@Ignore
+import static org.junit.Assert.assertEquals;
+import static org.ops4j.pax.exam.CoreOptions.options;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Query;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaDelete;
+
 public class EclipseLinkContextTest extends JPAContextTest {
-    @Configuration
-    public Option[] eclipseLinkConfig() {
-        return options(
-        		baseOptions(),
-        		ariesJpa(),
-        		eclipseLink(),
-                testBundleEclipseLink()
-        );
+  protected static final String SCRIPT_TEST_UNIT = "script-test-unit";
+  
+  @Test
+  public void testDeleteQuery() throws Exception {
+    registerClient(BP_TEST_UNIT);
+    EntityManagerFactory emf = getProxyEMF(BP_TEST_UNIT);
+    EntityManager em = emf.createEntityManager();
+
+    try {
+      ut.begin();
+
+      Car c = new Car();
+      c.setColour("Blue");
+      c.setNumberPlate("AB11CDE");
+      c.setNumberOfSeats(7);
+      c.setEngineSize(1900);
+      em.persist(c);
+
+      ut.commit();
+
+    } catch(Exception e) {
+      ut.rollback();
     }
-	
+
+    assertEquals(7, em.find(Car.class, "AB11CDE").getNumberOfSeats());
+
+    CriteriaBuilder cb = em.getCriteriaBuilder();
+    Method createCriteriaDelete = cb.getClass().getMethod("createCriteriaDelete", Class.class);
+    final List<Object> l = new ArrayList<Object>();
+    l.add(Car.class);
+    Object criteriaDelete = createCriteriaDelete.invoke(cb, Car.class);
+    Method from = CriteriaDelete.class.getMethod("from", Class.class);
+    from.invoke(criteriaDelete, Car.class);
+
+    try {
+      ut.begin();
+      Method createQuery = em.getClass().getMethod("createQuery", CriteriaDelete.class);
+      Query q = (Query) createQuery.invoke(em, criteriaDelete);
+      q.executeUpdate();
+      ut.commit();
+    } catch(Exception e) {
+      ut.rollback();
+    }
+    
+    Car c = em.find(Car.class, "AB11CDE");
+    assertEquals(c, null);
+  }
+  
+  @Test
+  public void testPersistenceFileParsing() throws Exception {
+    registerClient(SCRIPT_TEST_UNIT);
+    EntityManagerFactory emf = getProxyEMF(SCRIPT_TEST_UNIT);
+    EntityManager em = emf.createEntityManager();
+        
+    Car c = em.find(Car.class, "AB11CDE");
+    assertEquals(1300, em.find(Car.class, "AB11CDE").getEngineSize());
+  }
+
+  @Configuration
+  public Option[] eclipseLinkConfig() {
+    return options(
+        baseOptions(), 
+        ariesJpa21(), 
+        transactionWrapper(), 
+        eclipseLink(),
+        testBundleEclipseLink()
+        );
+  }
+
 }

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkStartupTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkStartupTest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkStartupTest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkStartupTest.java Sat Oct 11 19:51:37 2014
@@ -15,20 +15,16 @@
  */
 package org.apache.aries.jpa.context.itest;
 
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.spi.PersistenceProvider;
-
 import org.apache.aries.jpa.itest.AbstractJPAItest;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
 import org.osgi.framework.Bundle;
 
-@Ignore
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.spi.PersistenceProvider;
+
 public class EclipseLinkStartupTest extends AbstractJPAItest {
     
     @Test
@@ -49,9 +45,9 @@ public class EclipseLinkStartupTest exte
     public Option[] configuration() {
         return CoreOptions.options(
         		baseOptions(),
-        		ariesJpa(),
+        		ariesJpa21(),
         		eclipseLink(),
-                mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container.itest.bundle.eclipselink").noStart()
+        		testBundleEclipseLink().noStart()
             );
     }
 }

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java Sat Oct 11 19:51:37 2014
@@ -133,7 +133,11 @@ public abstract class JPAContextTest ext
       ensureTREBehaviour(false, managedEm, "createNativeQuery", "hi", "hi");
       ensureTREBehaviour(false, managedEm, "createQuery", "hi");
       ensureTREBehaviour(false, managedEm, "find", Object.class, new Object());
+      ut.rollback();
+      ut.begin();
       ensureTREBehaviour(false, managedEm, "flush");
+      ut.rollback();
+      ut.begin();
       ensureTREBehaviour(false, managedEm, "getDelegate");
       ensureTREBehaviour(false, managedEm, "getFlushMode");
       ensureTREBehaviour(false, managedEm, "getReference", Object.class, new Object());
@@ -353,12 +357,19 @@ public abstract class JPAContextTest ext
                 fail("Should have failed with TransactionRequiredException");
             }
         } catch (InvocationTargetException ite) {
+            Throwable e = ite;
+            while(e != null && !(e instanceof TransactionRequiredException)) {
+              e = e.getCause();
+            }
+            if(e==null) {
+              e = ite.getCause();
+            }
             if (expectedToFail && !(ite.getCause() instanceof TransactionRequiredException)) {
-                fail("We got the wrong failure. Expected a TransactionRequiredException" + ", got a "
-                     + ite.toString());
+                        fail("We got the wrong failure. Expected a TransactionRequiredException" + ", got a "
+                             + ite.toString());
             } else if (!expectedToFail && ite.getCause() instanceof TransactionRequiredException) {
-                fail("We got the wrong failure. Expected not to get a TransactionRequiredException"
-                     + ", but we got one anyway!");
+                       fail("We got the wrong failure. Expected not to get a TransactionRequiredException"
+                             + ", but we got one anyway!");
             }
         }
     }

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaContextTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaContextTest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaContextTest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaContextTest.java Sat Oct 11 19:51:37 2014
@@ -26,7 +26,7 @@ public class OpenjpaContextTest extends 
     public Option[] configuration() {
         return options(
         		baseOptions(),
-        		ariesJpa(),
+        		ariesJpa20(),
         		transactionWrapper(),
         		openJpa(),
                 testBundle()

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java Sat Oct 11 19:51:37 2014
@@ -83,7 +83,7 @@ public abstract class AbstractJPAItest e
          );
     }
 	
-	protected Option ariesJpa() {
+	protected Option ariesJpa20() {
 		return composite(
 				frameworkProperty("org.osgi.framework.system.packages")
             	.value("javax.accessibility,javax.activation,javax.activity,javax.annotation,javax.annotation.processing,javax.crypto,javax.crypto.interfaces,javax.crypto.spec,javax.imageio,javax.imageio.event,javax.imageio.metadata,javax.imageio.plugins.bmp,javax.imageio.plugins.jpeg,javax.imageio.spi,javax.imageio.stream,javax.jws,javax.jws.soap,javax.lang.model,javax.lang.model.element,javax.lang.model.type,javax.lang.model.util,javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.remote,javax.management.remote.rmi,javax.management.timer,javax.naming,javax.naming.directory,javax.naming.event,javax.naming.ldap,javax.naming.spi,javax.net,javax.net.ssl,javax.print,javax.print.attribute,javax.print.attribute.standard,javax.print.event,javax.rmi,javax.rmi.CORBA,javax.rmi.ssl,javax.script,javax.security.auth,javax.security.auth.callback,javax.security.auth.kerberos,javax.securit
 y.auth.login,javax.security.auth.spi,javax.security.auth.x500,javax.security.cert,javax.security.sasl,javax.sound.midi,javax.sound.midi.spi,javax.sound.sampled,javax.sound.sampled.spi,javax.sql,javax.sql.rowset,javax.sql.rowset.serial,javax.sql.rowset.spi,javax.swing,javax.swing.border,javax.swing.colorchooser,javax.swing.event,javax.swing.filechooser,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.plaf.multi,javax.swing.plaf.synth,javax.swing.table,javax.swing.text,javax.swing.text.html,javax.swing.text.html.parser,javax.swing.text.rtf,javax.swing.tree,javax.swing.undo,javax.tools,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.namespace,javax.xml.parsers,javax.xml.soap,javax.xml.s
 tream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.xpath,org.ietf.jgss,org.omg.CORBA,org.omg.CORBA.DynAnyPackage,org.omg.CORBA.ORBPackage,org.omg.CORBA.TypeCodePackage,org.omg.CORBA.portable,org.omg.CORBA_2_3,org.omg.CORBA_2_3.portable,org.omg.CosNaming,org.omg.CosNaming.NamingContextExtPackage,org.omg.CosNaming.NamingContextPackage,org.omg.Dynamic,org.omg.DynamicAny,org.omg.DynamicAny.DynAnyFactoryPackage,org.omg.DynamicAny.DynAnyPackage,org.omg.IOP,org.omg.IOP.CodecFactoryPackage,org.omg.IOP.CodecPackage,org.omg.Messaging,org.omg.PortableInterceptor,org.omg.PortableInterceptor.ORBInitInfoPackage,org.omg.PortableServer,org.omg.PortableServer.CurrentPackage,org.omg.PortableServer.POAManagerPackage,org.omg.PortableServer.PO
 APackage,org.omg.PortableServer.ServantLocatorPackage,org.omg.PortableServer.portable,org.omg.SendingContext,org.omg.stub.java.rmi,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.stylesheets,org.w3c.dom.traversal,org.w3c.dom.views,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers"),
@@ -106,7 +106,46 @@ public abstract class AbstractJPAItest e
 				mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.core").versionAsInProject(),
 
                 mavenBundle("org.apache.geronimo.specs", "geronimo-jpa_2.0_spec", "1.1"),
-				// mavenBundle("org.hibernate.javax.persistence", "hibernate-jpa-2.1-api").versionAsInProject(),
+				mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.api").versionAsInProject(),
+				mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container").versionAsInProject(),
+				mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container.context").versionAsInProject(),
+				mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.blueprint.aries").versionAsInProject(),
+				
+				mavenBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec").versionAsInProject(),
+				mavenBundle("org.apache.aries.transaction", "org.apache.aries.transaction.manager").versionAsInProject(),
+				
+				mavenBundle("commons-lang", "commons-lang").versionAsInProject(),
+				mavenBundle("commons-collections", "commons-collections").versionAsInProject(),
+				mavenBundle("commons-pool", "commons-pool").versionAsInProject(),
+				
+				mavenBundle("org.apache.derby", "derby").versionAsInProject()
+				
+				);
+	}
+	
+	protected Option ariesJpa21() {
+    return composite(
+        frameworkProperty("org.osgi.framework.system.packages")
+              .value("javax.accessibility,javax.activation,javax.activity,javax.annotation,javax.annotation.processing,javax.crypto,javax.crypto.interfaces,javax.crypto.spec,javax.imageio,javax.imageio.event,javax.imageio.metadata,javax.imageio.plugins.bmp,javax.imageio.plugins.jpeg,javax.imageio.spi,javax.imageio.stream,javax.jws,javax.jws.soap,javax.lang.model,javax.lang.model.element,javax.lang.model.type,javax.lang.model.util,javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.remote,javax.management.remote.rmi,javax.management.timer,javax.naming,javax.naming.directory,javax.naming.event,javax.naming.ldap,javax.naming.spi,javax.net,javax.net.ssl,javax.print,javax.print.attribute,javax.print.attribute.standard,javax.print.event,javax.rmi,javax.rmi.CORBA,javax.rmi.ssl,javax.script,javax.security.auth,javax.security.auth.callback,javax.security.auth.kerberos,javax.securi
 ty.auth.login,javax.security.auth.spi,javax.security.auth.x500,javax.security.cert,javax.security.sasl,javax.sound.midi,javax.sound.midi.spi,javax.sound.sampled,javax.sound.sampled.spi,javax.sql,javax.sql.rowset,javax.sql.rowset.serial,javax.sql.rowset.spi,javax.swing,javax.swing.border,javax.swing.colorchooser,javax.swing.event,javax.swing.filechooser,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.plaf.multi,javax.swing.plaf.synth,javax.swing.table,javax.swing.text,javax.swing.text.html,javax.swing.text.html.parser,javax.swing.text.rtf,javax.swing.tree,javax.swing.undo,javax.tools,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.namespace,javax.xml.parsers,javax.xml.soap,javax.xml.
 stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.xpath,org.ietf.jgss,org.omg.CORBA,org.omg.CORBA.DynAnyPackage,org.omg.CORBA.ORBPackage,org.omg.CORBA.TypeCodePackage,org.omg.CORBA.portable,org.omg.CORBA_2_3,org.omg.CORBA_2_3.portable,org.omg.CosNaming,org.omg.CosNaming.NamingContextExtPackage,org.omg.CosNaming.NamingContextPackage,org.omg.Dynamic,org.omg.DynamicAny,org.omg.DynamicAny.DynAnyFactoryPackage,org.omg.DynamicAny.DynAnyPackage,org.omg.IOP,org.omg.IOP.CodecFactoryPackage,org.omg.IOP.CodecPackage,org.omg.Messaging,org.omg.PortableInterceptor,org.omg.PortableInterceptor.ORBInitInfoPackage,org.omg.PortableServer,org.omg.PortableServer.CurrentPackage,org.omg.PortableServer.POAManagerPackage,org.omg.PortableServer.P
 OAPackage,org.omg.PortableServer.ServantLocatorPackage,org.omg.PortableServer.portable,org.omg.SendingContext,org.omg.stub.java.rmi,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.stylesheets,org.w3c.dom.traversal,org.w3c.dom.views,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers"),
+        //mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
+        //mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.cglib").versionAsInProject(),
+//              mavenBundle("org.osgi", "org.osgi.enterprise").versionAsInProject(),
+        mavenBundle("org.ow2.asm", "asm-all").versionAsInProject(),
+
+        mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy.api").versionAsInProject(),
+        mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy.impl").versionAsInProject(),
+
+        mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi.api").versionAsInProject(),
+        mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi.core").versionAsInProject(),
+        mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi.url").versionAsInProject(),
+        
+        mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.api").versionAsInProject(),
+        mavenBundle("org.apache.aries", "org.apache.aries.util").versionAsInProject(),
+
+        mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.api").versionAsInProject(),
+        mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.core").versionAsInProject(),
+
+        mavenBundle("org.eclipse.persistence", "javax.persistence").versionAsInProject(),
 				mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.api").versionAsInProject(),
 				mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container").versionAsInProject(),
 				mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container.context").versionAsInProject(),
@@ -130,12 +169,14 @@ public abstract class AbstractJPAItest e
 	
 	protected Option eclipseLink() {
 		return composite(
+		    mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-dbcp").versionAsInProject(),
 				mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa").versionAsInProject(),
-                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.core").versionAsInProject(),
-                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.asm").versionAsInProject(),
-                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.antlr").versionAsInProject(),
-                mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.eclipselink.adapter").versionAsInProject()
-                );
+        mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.core").versionAsInProject(),
+        mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.asm").versionAsInProject(),
+        mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.antlr").versionAsInProject(),
+        mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa.jpql").versionAsInProject(),
+        mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.eclipselink.adapter").versionAsInProject()
+        );
 	}
 	
 	protected Option openJpa() {
@@ -145,7 +186,7 @@ public abstract class AbstractJPAItest e
 				mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-dbcp").versionAsInProject(),
 				mavenBundle("org.apache.xbean","xbean-asm4-shaded").versionAsInProject(),
 				mavenBundle("org.apache.openjpa", "openjpa").versionAsInProject()
-				);
+        );
 	}
 	
 	protected Option testDs() {
@@ -165,7 +206,7 @@ public abstract class AbstractJPAItest e
 	}
 	
 	protected MavenArtifactProvisionOption testBundleEclipseLink() {
-		return mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container.itest.bundle.eclipselink");
+		return mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container.itest.bundle.eclipselink").versionAsInProject();
 	}
 	
 	protected MavenArtifactProvisionOption testBundleAdvanced() {

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/quiesce/itest/AbstractQuiesceJPATest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/quiesce/itest/AbstractQuiesceJPATest.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/quiesce/itest/AbstractQuiesceJPATest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/quiesce/itest/AbstractQuiesceJPATest.java Sat Oct 11 19:51:37 2014
@@ -63,7 +63,7 @@ public abstract class AbstractQuiesceJPA
     public Option[] configuration() {
         return options(
                 baseOptions(),
-                ariesJpa(),
+                ariesJpa20(),
                 openJpa(),
                 testDs(),
                 testBundle()

Modified: aries/trunk/jpa/jpa-container-testbundle-eclipselink/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-testbundle-eclipselink/pom.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-testbundle-eclipselink/pom.xml (original)
+++ aries/trunk/jpa/jpa-container-testbundle-eclipselink/pom.xml Sat Oct 11 19:51:37 2014
@@ -30,9 +30,9 @@
 
     <groupId>org.apache.aries.jpa</groupId>
     <artifactId>org.apache.aries.jpa.container.itest.bundle.eclipselink</artifactId>
-    <version>0.3.1-SNAPSHOT</version>
+    <version>1.0.3-SNAPSHOT</version>
     <packaging>bundle</packaging>
-    <name>Test Bundle for Aries JPA Container iTests</name>
+    <name>Test Bundle for Aries JPA Container iTests Eclipselink</name>
 
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/jpa/jpa-container-testbundle-eclipselink</connection>
@@ -46,11 +46,13 @@
             org.apache.aries.jpa.container.itest*
         </aries.osgi.export.pkg>
         <aries.osgi.import>
-            javax.persistence;version="[1.0.0,3.0.0)",
+            javax.persistence*;version="[1.1,3.0)",
             *
         </aries.osgi.import>
         <aries.osgi.private.pkg/>
         <aries.osgi.symbolic.name>${project.artifactId}</aries.osgi.symbolic.name>
+        <!-- Only test bundle -->
+        <aries.skip.version.check>true</aries.skip.version.check>
     </properties>
 
     <dependencies>
@@ -60,24 +62,8 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jpa_2.0_spec</artifactId>
-            <version>1.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.persistence</groupId>
-            <artifactId>org.eclipse.persistence.jpa</artifactId>
-            <version>2.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.persistence</groupId>
-            <artifactId>org.eclipse.persistence.core</artifactId>
-            <version>2.1.0</version>
-        </dependency>
-
-        <dependency>
             <groupId>org.eclipse.persistence</groupId>
-            <artifactId>org.eclipse.persistence.asm</artifactId>
+            <artifactId>javax.persistence</artifactId>
             <version>2.1.0</version>
         </dependency>
     </dependencies>

Modified: aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/persistence.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/persistence.xml (original)
+++ aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/persistence.xml Sat Oct 11 19:51:37 2014
@@ -17,11 +17,12 @@
     specific language governing permissions and limitations
     under the License.
 -->
-<persistence xmlns="http://java.sun.com/xml/ns/persistence"
-   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
-   version="1.0">
-  
+<persistence version="2.1" 
+             xmlns="http://xmlns.jcp.org/xml/ns/persistence"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence 
+             					http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
+
   <persistence-unit name="test-unit" transaction-type="RESOURCE_LOCAL">
     <description>Test persistence unit for the JPA Container and Context iTests</description>
     <jta-data-source>osgi:service/javax.sql.DataSource</jta-data-source>
@@ -32,34 +33,54 @@
       
     </properties>
   </persistence-unit>
-  
-  <persistence-unit name="bp-test-unit" transaction-type="JTA">
-    <description>Test persistence unit for the JPA Container and Context iTests</description>
-    <jta-data-source>blueprint:comp/jta</jta-data-source>
-    <non-jta-data-source>blueprint:comp/nonjta</non-jta-data-source>
-    <class>org.apache.aries.jpa.container.itest.entities.Car</class>
-    <exclude-unlisted-classes>true</exclude-unlisted-classes>
-    <properties>
-     <!-- These properties are creating the database on the fly. We are using them to avoid the tests having
-          to create a database  -->
-     <property name="eclipselink.target-database" value="Derby"/>     
-     <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
-     <property name="eclipselink.ddl-generation.output-mode" value="database" />
-    </properties>
-  </persistence-unit>
-  
-  <persistence-unit name="bp-xa-test-unit" transaction-type="JTA">
-    <description>Test persistence unit for the JPA Container and Context iTests</description>
-    <jta-data-source>blueprint:comp/xa</jta-data-source>
-    <non-jta-data-source>blueprint:comp/nonjta</non-jta-data-source>
-    <class>org.apache.aries.jpa.container.itest.entities.Car</class>
-    <exclude-unlisted-classes>true</exclude-unlisted-classes>
-    <properties>
-     <!-- These properties are creating the database on the fly. We are using them to avoid the tests having
-          to create a database  -->
-     <property name="eclipselink.target-database" value="Derby"/>     
-     <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
-     <property name="eclipselink.ddl-generation.output-mode" value="database" />
-    </properties>
-  </persistence-unit>
+
+	<persistence-unit name="bp-test-unit" transaction-type="JTA">
+		<description>Test persistence unit for the JPA Container and Context iTests</description>
+		<jta-data-source>blueprint:comp/jta</jta-data-source>
+		<non-jta-data-source>blueprint:comp/nonjta</non-jta-data-source>
+		<class>org.apache.aries.jpa.container.itest.entities.Car</class>
+		<exclude-unlisted-classes>true</exclude-unlisted-classes>
+		<properties>
+<!--    These properties are creating the database on the fly. We are using them to avoid the tests having
+		to create a database   -->
+			<property name="eclipselink.target-database" value="Derby" />
+			<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
+    		<property name="eclipselink.ddl-generation.output-mode" value="database" />
+		</properties>
+	</persistence-unit>
+
+	<persistence-unit name="bp-xa-test-unit" transaction-type="JTA">
+		<description>Test persistence unit for the JPA Container and Context iTests</description>
+		<jta-data-source>blueprint:comp/xa</jta-data-source>
+		<non-jta-data-source>blueprint:comp/nonjta</non-jta-data-source>
+		<class>org.apache.aries.jpa.container.itest.entities.Car</class>
+		<exclude-unlisted-classes>true</exclude-unlisted-classes>
+		<properties>
+<!--     These properties are creating the database on the fly. We are using them to avoid the tests having
+           to create a database   -->
+			<property name="eclipselink.target-database" value="Derby" />
+			<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
+     		<property name="eclipselink.ddl-generation.output-mode" value="database" />
+		</properties>
+	</persistence-unit>
+	
+	<persistence-unit name="script-test-unit" transaction-type="RESOURCE_LOCAL">
+		<properties>
+    		<property name="javax.persistence.jdbc.url" value="jdbc:derby:memory:TEST;create=true"/>
+      		<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+      		<property name="eclipselink.target-database" value="Derby"/>   
+        	<property name="javax.persistence.schema-generation.database.action"
+                  value="drop-and-create"/>
+        	<property name="javax.persistence.schema-generation.create-source"
+                  value="script"/>
+        	<property name="javax.persistence.schema-generation.create-script-source"
+                  value="META-INF/sql/create.sql" />
+        	<property name="javax.persistence.sql-load-script-source"
+                  value="META-INF/sql/data.sql" />
+        	<property name="javax.persistence.schema-generation.drop-source"
+                  value="script" />
+        	<property name="javax.persistence.schema-generation.drop-script-source"
+                  value="META-INF/sql/drop.sql" />
+    	</properties>
+  	</persistence-unit>
 </persistence>

Added: aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/create.sql
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/create.sql?rev=1631104&view=auto
==============================================================================
--- aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/create.sql (added)
+++ aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/create.sql Sat Oct 11 19:51:37 2014
@@ -0,0 +1,2 @@
+CREATE SCHEMA test_script
+CREATE TABLE CAR (NUMBERPLATE VARCHAR(50) PRIMARY KEY, COLOUR VARCHAR(50), ENGINESIZE INT, NUMBEROFSEATS INT)
\ No newline at end of file

Added: aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/data.sql
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/data.sql?rev=1631104&view=auto
==============================================================================
--- aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/data.sql (added)
+++ aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/data.sql Sat Oct 11 19:51:37 2014
@@ -0,0 +1 @@
+INSERT INTO CAR (NUMBERPLATE, COLOUR, ENGINESIZE, NUMBEROFSEATS) VALUES ('AB11CDE', 'Blue', 1300, 5)
\ No newline at end of file

Added: aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/drop.sql
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-testbundle-eclipselink/src/main/resources/META-INF/sql/drop.sql?rev=1631104&view=auto
==============================================================================
    (empty)

Modified: aries/trunk/jpa/jpa-container-testbundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-testbundle/pom.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-testbundle/pom.xml (original)
+++ aries/trunk/jpa/jpa-container-testbundle/pom.xml Sat Oct 11 19:51:37 2014
@@ -55,9 +55,9 @@
 
     <dependencies>
         <dependency>
-            <groupId>org.hibernate.javax.persistence</groupId>
-            <artifactId>hibernate-jpa-2.1-api</artifactId>
-            <version>1.0.0.Final</version>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <version>1.1</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: aries/trunk/jpa/jpa-container/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/pom.xml?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container/pom.xml (original)
+++ aries/trunk/jpa/jpa-container/pom.xml Sat Oct 11 19:51:37 2014
@@ -96,9 +96,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.hibernate.javax.persistence</groupId>
-            <artifactId>hibernate-jpa-2.0-api</artifactId>
-            <version>1.0.0.Final</version>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jpa_2.0_spec</artifactId>
+            <version>1.1</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerProxyFactory.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerProxyFactory.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerProxyFactory.java (original)
+++ aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerProxyFactory.java Sat Oct 11 19:51:37 2014
@@ -5,6 +5,7 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 
 import javax.persistence.EntityManager;
+import javax.persistence.PersistenceException;
 
 public class EntityManagerProxyFactory {
     static EntityManager create(EntityManager delegate, DestroyCallback destroyCallback) {
@@ -25,7 +26,14 @@ public class EntityManagerProxyFactory {
 
         @Override
         public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-            Object res = method.invoke(delegate, args);
+            Object res = null;
+            try {
+              res = method.invoke(delegate, args);
+            } catch (IllegalArgumentException e) {
+              new PersistenceException(NLS.MESSAGES.getMessage("wrong.JPA.version", new Object[]{
+                  method.getName(), delegate
+              }), e);
+            }
             
             // This will only ever be called once, the second time there
             // will be an IllegalStateException from the line above

Modified: aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/QuiesceEMFHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/QuiesceEMFHandler.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/QuiesceEMFHandler.java (original)
+++ aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/QuiesceEMFHandler.java Sat Oct 11 19:51:37 2014
@@ -7,6 +7,7 @@ import java.util.concurrent.atomic.Atomi
 
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceException;
 
 import org.apache.aries.jpa.container.impl.EntityManagerFactoryManager.NamedCallback;
 import org.apache.aries.util.AriesFrameworkUtil;
@@ -51,7 +52,14 @@ class QuiesceEMFHandler implements Invoc
             clearQuiesce();
             return null;
         }
-        Object res = method.invoke(delegate, args);
+        Object res = null;
+        try {
+          res = method.invoke(delegate, args);
+        } catch (IllegalArgumentException e) {
+          new PersistenceException(NLS.MESSAGES.getMessage("wrong.JPA.version", new Object[]{
+              method.getName(), delegate
+          }), e);
+        }
 
         // This will only ever be called once, the second time there
         // will be an IllegalStateException from the line above

Modified: aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/JPAHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/JPAHandler.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/JPAHandler.java (original)
+++ aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/JPAHandler.java Sat Oct 11 19:51:37 2014
@@ -106,9 +106,9 @@ public class JPAHandler extends DefaultH
       pu.addClassName(s);
     else if("exclude-unlisted-classes".equals(elementName))
       pu.setExcludeUnlisted(Boolean.parseBoolean(s));
-    else if ("2.0".equals(jpaVersion) && "shared-cache-mode".equals(elementName))
+    else if (checkJpa2Version() && "shared-cache-mode".equals(elementName))
       pu.setSharedCacheMode(s);
-    else if ("2.0".equals(jpaVersion) && "validation-mode".equals(elementName))
+    else if (checkJpa2Version() && "validation-mode".equals(elementName))
       pu.setValidationMode(s);
   }
 
@@ -128,4 +128,7 @@ public class JPAHandler extends DefaultH
     return persistenceUnits;
   }
 
+  private boolean checkJpa2Version() {
+    return ("2.0".equals(jpaVersion) || "2.1".equals(jpaVersion));
+  }
 }

Modified: aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/SchemaLocatingHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/SchemaLocatingHandler.java?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/SchemaLocatingHandler.java (original)
+++ aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/SchemaLocatingHandler.java Sat Oct 11 19:51:37 2014
@@ -40,6 +40,7 @@ public class SchemaLocatingHandler exten
   * URI for the JPA persistence namespace 
   */
   private static final String PERSISTENCE_NS_URI = "http://java.sun.com/xml/ns/persistence";
+  private static final String PERSISTENCE_21_NS_URI = "http://xmlns.jcp.org/xml/ns/persistence";
   
   /**
    * A static cache of schemas in use in the runtime
@@ -53,7 +54,7 @@ public class SchemaLocatingHandler exten
     
     Schema s = null;
     String version = null;
-    if(PERSISTENCE_NS_URI.equals(uri) && "persistence".equals(localName) ) {
+    if((PERSISTENCE_NS_URI.equals(uri) || PERSISTENCE_21_NS_URI.equals(uri)) && "persistence".equals(localName) ) {
       version = attributes.getValue("version");
        s = validate(version);
     }
@@ -93,6 +94,8 @@ public class SchemaLocatingHandler exten
       schemaURL = this.getClass().getResource("persistence.xsd.rsrc");
     } else if ("2.0".equals(type)) {
       schemaURL = this.getClass().getResource("persistence_2_0.xsd.rsrc");
+    } else if ("2.1".equals(type)) {
+      schemaURL = this.getClass().getResource("persistence_2_1.xsd.rsrc");
     }
 
     Schema schema = null;    

Modified: aries/trunk/jpa/jpa-container/src/main/resources/org/apache/aries/jpa/container/nls/jpaContainerMessages.properties
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/src/main/resources/org/apache/aries/jpa/container/nls/jpaContainerMessages.properties?rev=1631104&r1=1631103&r2=1631104&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container/src/main/resources/org/apache/aries/jpa/container/nls/jpaContainerMessages.properties (original)
+++ aries/trunk/jpa/jpa-container/src/main/resources/org/apache/aries/jpa/container/nls/jpaContainerMessages.properties Sat Oct 11 19:51:37 2014
@@ -201,4 +201,8 @@ xa.datasource.non.tx=The persistence uni
 # {1} The symbolic name of the persistence bundle.
 # {2} The version of the persistence bundle.
 # {3} The jndi name of the datasource
-not.a.datasource=The persistence unit {0} in persistence bundle {1}/{2} uses a JNDI name {3} that looks up an Objet that is not a DataSource or XADataSource. 
\ No newline at end of file
+not.a.datasource=The persistence unit {0} in persistence bundle {1}/{2} uses a JNDI name {3} that looks up an Objet that is not a DataSource or XADataSource.
+# {0} Method name not found
+# {1} The persistence unit name
+wrong.JPA.version="Method {0} is not implemented by delegate {1}. Probably you want use JPA 2.1 but you are installed JPA 2.0."
+ 
\ No newline at end of file



Mime
View raw message