aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1691026 [1/2] - in /aries/trunk/jpa: itests/jpa-container-advancedtestbundle/src/main/resources/META-INF/ itests/jpa-container-blueprint-testbundle/ itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/ it...
Date Tue, 14 Jul 2015 16:20:11 GMT
Author: cschneider
Date: Tue Jul 14 16:20:10 2015
New Revision: 1691026

URL: http://svn.apache.org/r1691026
Log:
[ARIES-1346] Refactored itests

Added:
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/AbstractCarServiceImpl.java
      - copied, changed from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/AbstractCarServiceImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceImpl.java
      - copied, changed from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithEmfImpl.java
      - copied, changed from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithEmfImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithMethodImpl.java
      - copied, changed from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithMethodImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithMultiAnnotationImpl.java
      - copied, changed from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithMultiAnnotationImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithSupplierImpl.java
      - copied, changed from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithSupplierImpl.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkEmSupplierTest.java
      - copied, changed from r1691025, aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EmSupplierTest.java
      - copied, changed from r1691025, aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaEmSupplierTest.java
      - copied, changed from r1691025, aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaContextTest.java
    aries/trunk/jpa/itests/jpa-container-testbundle/src/main/java/org/apache/aries/jpa/container/itest/entities/CarService.java
      - copied, changed from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/CarService.java
Removed:
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/entities/Car.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/CarService.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/AbstractCarServiceImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithEmfImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithMethodImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithMultiAnnotationImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithSupplierImpl.java
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/META-INF/persistence.xml
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintWithMethodTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintWithMultiAnnotationTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintWithSingleAnnotationTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaContextTest.java
Modified:
    aries/trunk/jpa/itests/jpa-container-advancedtestbundle/src/main/resources/META-INF/persistence.xml
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/pom.xml
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml
    aries/trunk/jpa/itests/jpa-container-itest/pom.xml
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/JPAWeavingAndAnnotationScanningTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/OpenjpaWeavingAndAnnotationScanningTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/EMFBuilderTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerHibernateTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/OpenJPAContainerTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/TCKJPATestCase.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java
    aries/trunk/jpa/itests/jpa-container-testbundle/pom.xml
    aries/trunk/jpa/itests/jpa-container-testbundle/src/main/resources/META-INF/persistence.xml
    aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaInterceptor.java
    aries/trunk/jpa/jpa-support/src/main/java/org/apache/aries/jpa/support/impl/EMSupplierImpl.java
    aries/trunk/jpa/jpa-support/src/test/java/org/apache/aries/jpa/impl/EmSupplierTest.java

Modified: aries/trunk/jpa/itests/jpa-container-advancedtestbundle/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-advancedtestbundle/src/main/resources/META-INF/persistence.xml?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-advancedtestbundle/src/main/resources/META-INF/persistence.xml (original)
+++ aries/trunk/jpa/itests/jpa-container-advancedtestbundle/src/main/resources/META-INF/persistence.xml Tue Jul 14 16:20:10 2015
@@ -14,25 +14,6 @@
     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
     version="2.0">
 
-    <persistence-unit name="test-unit" transaction-type="JTA">
-        <description>Test persistence unit for the JPA Container advanced iTests</description>
-        <properties>
-            <property name="javax.persistence.jdbc.driver"
-                value="org.apache.derby.jdbc.EmbeddedDriver-pool-xa" />
-            <property name="javax.persistence.jdbc.url" value="jdbc:derby:memory:TEST;create=true" />
 
-            <!-- These properties are creating the database on the fly. We 
-                are using them to avoid the tests having to create a database -->
-
-            <property name="openjpa.jdbc.SynchronizeMappings"
-                value="buildSchema(ForeignKeys=true)" />
-            <property name="openjpa.jdbc.DBDictionary" value="derby" />
-
-            <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
-            <property name="hibernate.dialect"
-                value="org.hibernate.dialect.DerbyTenSevenDialect" />
-    <!--         <property name="hibernate.hbm2ddl.auto" value="create-drop" /> -->
-        </properties>
-    </persistence-unit>
 
 </persistence>

Modified: aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/pom.xml?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/pom.xml (original)
+++ aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/pom.xml Tue Jul 14 16:20:10 2015
@@ -30,6 +30,11 @@
             <artifactId>org.apache.aries.jpa.api</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.aries.jpa</groupId>
+            <artifactId>org.apache.aries.jpa.container.itest.bundle</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
 
     <build>
@@ -39,12 +44,7 @@
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
-                        <Export-Package>org.apache.aries.jpa.itest.testbundle.*</Export-Package>
-                        <!-- Dynamic import to for hibernate enhancement 
-                            to make sure it also works in eclipselink -->
-                        <DynamicImport-Package>org.hibernate.proxy,
-                            javassist.util.proxy</DynamicImport-Package>
-                        <Meta-Persistence>META-INF/persistence.xml</Meta-Persistence>
+
                     </instructions>
                 </configuration>
             </plugin>

Copied: aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/AbstractCarServiceImpl.java (from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/AbstractCarServiceImpl.java)
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/AbstractCarServiceImpl.java?p2=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/AbstractCarServiceImpl.java&p1=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/AbstractCarServiceImpl.java&r1=1691025&r2=1691026&rev=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/AbstractCarServiceImpl.java (original)
+++ aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/AbstractCarServiceImpl.java Tue Jul 14 16:20:10 2015
@@ -1,9 +1,9 @@
-package org.apache.aries.jpa.itest.testbundle.service.impl;
+package org.apache.aries.jpa.container.itest.bundle.blueprint.impl;
 
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
 
-import org.apache.aries.jpa.itest.testbundle.service.CarService;
+import org.apache.aries.jpa.container.itest.entities.CarService;
 
 public abstract class AbstractCarServiceImpl implements CarService {
     @PersistenceContext(unitName = "test_unit_blueprint")

Copied: aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceImpl.java (from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceImpl.java)
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceImpl.java?p2=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceImpl.java&p1=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceImpl.java&r1=1691025&r2=1691026&rev=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceImpl.java (original)
+++ aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceImpl.java Tue Jul 14 16:20:10 2015
@@ -16,13 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.aries.jpa.itest.testbundle.service.impl;
+package org.apache.aries.jpa.container.itest.bundle.blueprint.impl;
 
 import java.util.Collection;
 
 import javax.persistence.EntityManager;
 
-import org.apache.aries.jpa.itest.testbundle.entities.Car;
+import org.apache.aries.jpa.container.itest.entities.Car;
 
 public class CarServiceImpl extends AbstractCarServiceImpl {
 
@@ -34,7 +34,6 @@ public class CarServiceImpl extends Abst
     @Override
     public void addCar(Car car) {
         em.persist(car);
-        em.flush();
     }
 
     public Collection<Car> getCars() {

Copied: aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithEmfImpl.java (from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithEmfImpl.java)
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithEmfImpl.java?p2=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithEmfImpl.java&p1=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithEmfImpl.java&r1=1691025&r2=1691026&rev=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithEmfImpl.java (original)
+++ aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithEmfImpl.java Tue Jul 14 16:20:10 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.aries.jpa.itest.testbundle.service.impl;
+package org.apache.aries.jpa.container.itest.bundle.blueprint.impl;
 
 import java.util.Collection;
 
@@ -24,8 +24,8 @@ import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.persistence.PersistenceUnit;
 
-import org.apache.aries.jpa.itest.testbundle.entities.Car;
-import org.apache.aries.jpa.itest.testbundle.service.CarService;
+import org.apache.aries.jpa.container.itest.entities.Car;
+import org.apache.aries.jpa.container.itest.entities.CarService;
 
 public class CarServiceWithEmfImpl implements CarService {
 
@@ -35,7 +35,11 @@ public class CarServiceWithEmfImpl imple
     @Override
     public Car getCar(String id) {
         EntityManager em = emf.createEntityManager();
-        return em.find(Car.class, id);
+        try {
+            return em.find(Car.class, id);
+        } finally {
+            em.close();
+        }
     }
 
     @Override
@@ -43,23 +47,31 @@ public class CarServiceWithEmfImpl imple
         EntityManager em = emf.createEntityManager();
         em.persist(car);
         em.flush();
+        em.close();
     }
 
     public Collection<Car> getCars() {
-        EntityManager em = emf.createEntityManager();
-        return em.createQuery("select c from Car c", Car.class).getResultList();
+        EntityManager em = null;
+        try {
+            em = emf.createEntityManager();
+            return em.createQuery("select c from Car c", Car.class).getResultList();
+        } finally {
+            em.close();
+        }
     }
 
     @Override
     public void updateCar(Car car) {
         EntityManager em = emf.createEntityManager();
         em.persist(car);
+        em.close();
     }
 
     @Override
     public void deleteCar(String id) {
         EntityManager em = emf.createEntityManager();
-        em.remove(getCar(id));
+        em.remove(em.find(Car.class, id));
+        em.close();
     }
 
     public void setEmf(EntityManagerFactory emf) {

Copied: aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithMethodImpl.java (from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithMethodImpl.java)
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithMethodImpl.java?p2=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithMethodImpl.java&p1=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithMethodImpl.java&r1=1691025&r2=1691026&rev=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithMethodImpl.java (original)
+++ aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithMethodImpl.java Tue Jul 14 16:20:10 2015
@@ -16,15 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.aries.jpa.itest.testbundle.service.impl;
+package org.apache.aries.jpa.container.itest.bundle.blueprint.impl;
 
 import java.util.Collection;
 
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
 
-import org.apache.aries.jpa.itest.testbundle.entities.Car;
-import org.apache.aries.jpa.itest.testbundle.service.CarService;
+import org.apache.aries.jpa.container.itest.entities.Car;
+import org.apache.aries.jpa.container.itest.entities.CarService;
 
 public class CarServiceWithMethodImpl implements CarService {
 

Copied: aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithMultiAnnotationImpl.java (from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithMultiAnnotationImpl.java)
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithMultiAnnotationImpl.java?p2=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithMultiAnnotationImpl.java&p1=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithMultiAnnotationImpl.java&r1=1691025&r2=1691026&rev=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithMultiAnnotationImpl.java (original)
+++ aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithMultiAnnotationImpl.java Tue Jul 14 16:20:10 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.aries.jpa.itest.testbundle.service.impl;
+package org.apache.aries.jpa.container.itest.bundle.blueprint.impl;
 
 import java.util.Collection;
 
@@ -25,8 +25,8 @@ import javax.persistence.EntityManagerFa
 import javax.persistence.PersistenceContext;
 import javax.persistence.PersistenceUnit;
 
-import org.apache.aries.jpa.itest.testbundle.entities.Car;
-import org.apache.aries.jpa.itest.testbundle.service.CarService;
+import org.apache.aries.jpa.container.itest.entities.Car;
+import org.apache.aries.jpa.container.itest.entities.CarService;
 import org.apache.aries.jpa.supplier.EmSupplier;
 
 public class CarServiceWithMultiAnnotationImpl implements CarService {

Copied: aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithSupplierImpl.java (from r1691025, aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithSupplierImpl.java)
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithSupplierImpl.java?p2=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithSupplierImpl.java&p1=aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithSupplierImpl.java&r1=1691025&r2=1691026&rev=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/itest/testbundle/service/impl/CarServiceWithSupplierImpl.java (original)
+++ aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceWithSupplierImpl.java Tue Jul 14 16:20:10 2015
@@ -16,14 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.aries.jpa.itest.testbundle.service.impl;
+package org.apache.aries.jpa.container.itest.bundle.blueprint.impl;
 
 import java.util.Collection;
 
 import javax.persistence.PersistenceContext;
 
-import org.apache.aries.jpa.itest.testbundle.entities.Car;
-import org.apache.aries.jpa.itest.testbundle.service.CarService;
+import org.apache.aries.jpa.container.itest.entities.Car;
+import org.apache.aries.jpa.container.itest.entities.CarService;
 import org.apache.aries.jpa.supplier.EmSupplier;
 
 public class CarServiceWithSupplierImpl implements CarService {

Modified: aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml (original)
+++ aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml Tue Jul 14 16:20:10 2015
@@ -7,62 +7,62 @@
     <jpa:enable />
 
     <service ref="carServiceEmf"
-        interface="org.apache.aries.jpa.itest.testbundle.service.CarService">
+        interface="org.apache.aries.jpa.container.itest.entities.CarService">
         <service-properties>
             <entry key="type" value="emf" />
         </service-properties>
     </service>
 
     <bean id="carServiceEmf"
-        class="org.apache.aries.jpa.itest.testbundle.service.impl.CarServiceWithEmfImpl">
+        class="org.apache.aries.jpa.container.itest.bundle.blueprint.impl.CarServiceWithEmfImpl">
         <tx:transaction method="*" value="Required" />
     </bean>
 
     <service ref="carServiceEm"
-        interface="org.apache.aries.jpa.itest.testbundle.service.CarService">
+        interface="org.apache.aries.jpa.container.itest.entities.CarService">
         <service-properties>
             <entry key="type" value="em" />
         </service-properties>
     </service>
 
     <bean id="carServiceEm"
-        class="org.apache.aries.jpa.itest.testbundle.service.impl.CarServiceImpl">
+        class="org.apache.aries.jpa.container.itest.bundle.blueprint.impl.CarServiceImpl">
         <tx:transaction method="*" value="Required" />
     </bean>
 
     <service ref="carServiceEmSupplier"
-        interface="org.apache.aries.jpa.itest.testbundle.service.CarService">
+        interface="org.apache.aries.jpa.container.itest.entities.CarService">
         <service-properties>
             <entry key="type" value="supplier" />
         </service-properties>
     </service>
 
     <bean id="carServiceEmSupplier"
-        class="org.apache.aries.jpa.itest.testbundle.service.impl.CarServiceWithSupplierImpl">
+        class="org.apache.aries.jpa.container.itest.bundle.blueprint.impl.CarServiceWithSupplierImpl">
         <tx:transaction method="*" value="Required" />
     </bean>
 
     <service ref="carServiceMulti"
-        interface="org.apache.aries.jpa.itest.testbundle.service.CarService">
+        interface="org.apache.aries.jpa.container.itest.entities.CarService">
         <service-properties>
             <entry key="type" value="multiannotation" />
         </service-properties>
     </service>
 
     <bean id="carServiceMulti"
-        class="org.apache.aries.jpa.itest.testbundle.service.impl.CarServiceWithMultiAnnotationImpl">
+        class="org.apache.aries.jpa.container.itest.bundle.blueprint.impl.CarServiceWithMultiAnnotationImpl">
         <tx:transaction method="*" value="Required" />
     </bean>
 
     <service ref="carServiceMethod"
-        interface="org.apache.aries.jpa.itest.testbundle.service.CarService">
+        interface="org.apache.aries.jpa.container.itest.entities.CarService">
         <service-properties>
             <entry key="type" value="method" />
         </service-properties>
     </service>
 
     <bean id="carServiceMethod"
-        class="org.apache.aries.jpa.itest.testbundle.service.impl.CarServiceWithMethodImpl">
+        class="org.apache.aries.jpa.container.itest.bundle.blueprint.impl.CarServiceWithMethodImpl">
         <tx:transaction method="*" value="Required" />
     </bean>
 

Modified: aries/trunk/jpa/itests/jpa-container-itest/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/pom.xml?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/pom.xml (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/pom.xml Tue Jul 14 16:20:10 2015
@@ -51,7 +51,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.coordinator</artifactId>
-            <version>1.0.0</version>
+            <version>1.0.1-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -288,13 +288,13 @@
         <!-- Test bundles -->
         <dependency>
             <groupId>org.apache.aries.jpa</groupId>
-            <artifactId>org.apache.aries.jpa.container.itest.bundle</artifactId>
+            <artifactId>org.apache.aries.jpa.container.itest.testds</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.jpa</groupId>
-            <artifactId>org.apache.aries.jpa.container.advanced.itest.bundle</artifactId>
+            <artifactId>org.apache.aries.jpa.container.itest.bundle</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
@@ -313,7 +313,7 @@
         <dependency>
             <groupId>org.apache.aries.transaction</groupId>
             <artifactId>org.apache.aries.transaction.manager</artifactId>
-            <version>1.0.0</version>
+            <version>1.1.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -324,11 +324,16 @@
         </dependency>
         <dependency>
             <groupId>org.apache.aries.transaction</groupId>
-            <artifactId>org.apache.aries.transaction.wrappers</artifactId>
-            <version>1.0.0</version>
+            <artifactId>org.apache.aries.transaction.jdbc</artifactId>
+            <version>2.1.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.aries.transaction</groupId>
+            <artifactId>org.apache.aries.transaction.blueprint</artifactId>
+            <version>1.0.2</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.aries.jndi</groupId>
             <artifactId>org.apache.aries.jndi.api</artifactId>
             <version>1.0.0</version>
@@ -366,6 +371,11 @@
         </dependency>
         <dependency>
             <groupId>org.ops4j.pax.jdbc</groupId>
+            <artifactId>pax-jdbc-spec</artifactId>
+            <version>${paxjdbc.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.jdbc</groupId>
             <artifactId>pax-jdbc-derby</artifactId>
             <version>${paxjdbc.version}</version>
         </dependency>
@@ -375,6 +385,12 @@
             <version>${paxjdbc.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.jdbc</groupId>
+            <artifactId>pax-jdbc-config</artifactId>
+            <version>${paxjdbc.version}</version>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.cglib</artifactId>

Modified: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java Tue Jul 14 16:20:10 2015
@@ -19,7 +19,7 @@ import static org.junit.Assert.assertTru
 
 import java.util.Arrays;
 
-import org.apache.aries.jpa.container.advanced.itest.bundle.entities.Car;
+import org.apache.aries.jpa.container.itest.entities.Car;
 import org.eclipse.persistence.internal.weaving.PersistenceWeaved;
 import org.junit.Test;
 import org.ops4j.pax.exam.Configuration;
@@ -33,7 +33,7 @@ public class EclipseLinkWeavingAndAnnota
             ariesJpa21(), //
             eclipseLink(), //
             derbyDSF(), //
-            testBundleAdvanced()
+            testBundle()
         };
     }
 

Modified: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/JPAWeavingAndAnnotationScanningTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/JPAWeavingAndAnnotationScanningTest.java?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/JPAWeavingAndAnnotationScanningTest.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/JPAWeavingAndAnnotationScanningTest.java Tue Jul 14 16:20:10 2015
@@ -15,41 +15,28 @@
  */
 package org.apache.aries.jpa.advanced.features.itest;
 
-import static org.junit.Assert.assertEquals;
-
 import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
 import javax.transaction.UserTransaction;
 
-import org.apache.aries.jpa.container.advanced.itest.bundle.entities.Car;
+import org.apache.aries.jpa.container.itest.entities.Car;
 import org.apache.aries.jpa.itest.AbstractJPAItest;
 import org.junit.Test;
-import org.ops4j.pax.exam.util.Filter;
 
 public abstract class JPAWeavingAndAnnotationScanningTest extends AbstractJPAItest {
     @Inject
     UserTransaction transaction;
 
-    @Inject
-    @Filter("(osgi.unit.name=" + TEST_UNIT + ")")
-    EntityManagerFactory emf;
-
     @Test
     public void testAnnotatedClassFound() throws Exception {
+        EntityManagerFactory emf = getEMF(XA_TEST_UNIT);
         EntityManager em = emf.createEntityManager();
         transaction.begin();
-
-        Car c = new Car();
-        c.setColour("Blue");
-        c.setNumberPlate("AB11CDE");
-        c.setNumberOfSeats(7);
-        c.setEngineSize(1900);
-        em.persist(c);
-
+        em.persist(createBlueCar());
         transaction.commit();
 
-        assertEquals(7, em.find(Car.class, "AB11CDE").getNumberOfSeats());
+        assertBlueCar(em.find(Car.class, BLUE_CAR_PLATE));
         em.close();
     }
 

Modified: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/OpenjpaWeavingAndAnnotationScanningTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/OpenjpaWeavingAndAnnotationScanningTest.java?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/OpenjpaWeavingAndAnnotationScanningTest.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/OpenjpaWeavingAndAnnotationScanningTest.java Tue Jul 14 16:20:10 2015
@@ -19,13 +19,12 @@ import static org.junit.Assert.assertTru
 
 import java.util.Arrays;
 
-import org.apache.aries.jpa.container.advanced.itest.bundle.entities.Car;
+import org.apache.aries.jpa.container.itest.entities.Car;
 import org.apache.openjpa.enhance.PersistenceCapable;
 import org.junit.Test;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 
-// TODO The Test persistence unit does not seem to be created. Reenable when this works 
 public class OpenjpaWeavingAndAnnotationScanningTest extends JPAWeavingAndAnnotationScanningTest {
 
     @Configuration
@@ -33,10 +32,9 @@ public class OpenjpaWeavingAndAnnotation
         return new Option[] {
             baseOptions(), //
             openJpa(), //
-            derbyDSF(), //
             ariesJpa20(), //
-            transactionWrapper(), //
-            testBundleAdvanced(), //
+            derbyDSF(), //
+            testBundle(), //
         };
     }
 

Added: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java?rev=1691026&view=auto
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java (added)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java Tue Jul 14 16:20:10 2015
@@ -0,0 +1,102 @@
+/*  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.aries.jpa.blueprint.aries.itest;
+
+import java.util.Collection;
+
+import javax.inject.Inject;
+
+import org.apache.aries.jpa.container.itest.entities.Car;
+import org.apache.aries.jpa.container.itest.entities.CarService;
+import org.apache.aries.jpa.itest.AbstractJPAItest;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.osgi.service.coordinator.Coordinator;
+
+public class BlueprintTest extends AbstractJPAItest {
+    @Inject
+    Coordinator coordinator;
+    
+    @Before
+    public void deleteCars() {
+        CarService carService = getCarService("emf");
+        if (carService.getCar(BLUE_CAR_PLATE)!=null) {
+            carService.deleteCar(BLUE_CAR_PLATE);
+        }
+    }
+
+    @Test
+    @Ignore
+    public void testCoordination() {
+        CarService carService = getCarService("em");
+        coordinator.begin("jpa", 0);
+        carService.addCar(createBlueCar());
+        Collection<Car> cars = carService.getCars();
+        carService.updateCar(cars.iterator().next());
+        carService.deleteCar(BLUE_CAR_PLATE);
+        coordinator.pop().end();
+        
+    }
+    
+    @Test
+    public void testInjectToMethod() throws Exception {
+        carLifecycle(getCarService("method"));
+    }
+
+    @Test
+    public void testMultiAnnotation() throws Exception {
+        carLifecycle(getCarService("multiannotation"));
+    }
+
+    @Test
+    public void testEmfAddQuery() throws Exception {
+        carLifecycle(getCarService("emf"));
+    }
+
+    @Test
+    public void testEmAddQuery() throws Exception {
+        carLifecycle(getCarService("em"));
+    }
+
+    @Test
+    public void testSupplierAddQuery() throws Exception {
+        carLifecycle(getCarService("supplier"));
+    }
+
+    private CarService getCarService(String type) {
+        return getService(CarService.class, "(type=" + type + ")");
+    }
+
+    private void carLifecycle(CarService carService) {
+        carService.addCar(createBlueCar());
+        assertBlueCar(carService.getCar(BLUE_CAR_PLATE));
+    }
+
+    @Configuration
+    public Option[] configuration() {
+        return new Option[] {
+            baseOptions(), //
+            ariesJpa20(), //
+            hibernate(), //
+            derbyDSF(), //
+            testBundleBlueprint(),
+        // debug()
+        };
+    }
+}

Modified: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/EMFBuilderTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/EMFBuilderTest.java?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/EMFBuilderTest.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/EMFBuilderTest.java Tue Jul 14 16:20:10 2015
@@ -31,10 +31,12 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.util.Filter;
 import org.osgi.service.jpa.EntityManagerFactoryBuilder;
 
 public class EMFBuilderTest extends AbstractJPAItest {
     @Inject
+    @Filter("(osgi.unit.name=dsf-test-unit)")
     EntityManagerFactoryBuilder emfBuilder;
     
     @Test
@@ -49,7 +51,6 @@ public class EMFBuilderTest extends Abst
         c.setNumberOfSeats(7);
         c.setEngineSize(1900);
         em.persist(c);
-        em.flush();
         em.getTransaction().commit();
         Car c2 = em.find(Car.class, "AB11CDE");
         Assert.assertEquals(7, c2.getNumberOfSeats());
@@ -62,10 +63,9 @@ public class EMFBuilderTest extends Abst
         return new Option[] {
             baseOptions(), //
             ariesJpa20(), //
-            transactionWrapper(), //
             hibernate(), //
-            testDs(),
-            testBundle()
+            derbyDSF(), //
+            testBundle() //
         };
     }
 

Modified: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerHibernateTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerHibernateTest.java?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerHibernateTest.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerHibernateTest.java Tue Jul 14 16:20:10 2015
@@ -27,38 +27,31 @@ import org.ops4j.pax.exam.Option;
 public class JPAContainerHibernateTest extends AbstractJPAItest {
     @Test
     public void testCarCreateDelete() throws Exception {
-        resolveBundles();
         EntityManagerFactory emf = getEMF(TEST_UNIT);
+        resolveBundles();
         EntityManager em = emf.createEntityManager();
         em.getTransaction().begin();
-        Car c = new Car();
-        c.setNumberPlate("123456");
-        c.setColour("blue");
-        em.persist(c);
+        Car car = createBlueCar();
+        em.persist(car);
         em.getTransaction().commit();
         em.close();
 
         em = emf.createEntityManager();
         em.getTransaction().begin();
-        deleteCar(em, c);
+        car = em.merge(car);
+        em.remove(car);
         em.getTransaction().commit();
         em.close();
     }
 
-    private void deleteCar(EntityManager em, Car c) {
-        c = em.merge(c);
-        em.remove(c);
-    }
-
     @Configuration
     public Option[] configuration() {
         return new Option[] {
             baseOptions(), //
             ariesJpa20(), //
+            derbyDSF(), //
+            hibernate(), //
             testBundle(), //
-            transactionWrapper(), //
-            testDs(), //
-            hibernate()
         };
     }
 }

Modified: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/OpenJPAContainerTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/OpenJPAContainerTest.java?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/OpenJPAContainerTest.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/OpenJPAContainerTest.java Tue Jul 14 16:20:10 2015
@@ -37,10 +37,8 @@ public class OpenJPAContainerTest extend
         return new Option[] {
             baseOptions(), //
             ariesJpa20(), //
-            // Needed for the BP_TEST_UNIT
-            transactionWrapper(), //
             openJpa(), //
-            testDs(), //
+            derbyDSF(), //
             testBundle()
         };
 

Modified: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/TCKJPATestCase.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/TCKJPATestCase.java?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/TCKJPATestCase.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/TCKJPATestCase.java Tue Jul 14 16:20:10 2015
@@ -27,34 +27,32 @@ import org.junit.Test;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.tinybundles.core.TinyBundles;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 
 /**
- * Simulates some tests from the tck
+ * Simulates the invalid bundle test from TCK
  */
 public class TCKJPATestCase extends AbstractJPAItest {
 
     @Test
-	public void testEntityManagerFactoryWithIncompletePersistenceUnit() throws Exception {
-		EntityManagerFactory emf = getService(EntityManagerFactory.class, "(osgi.unit.name=incompleteTestUnit)", false); 
-		Assert.assertNull("There should be no EntityManagerFactory registered since this persistence unit is incomplete", emf);
-		Bundle testBundle = getBundleByName("incompleteTestUnit");
-		testBundle.uninstall();
-	}
+    public void testEntityManagerFactoryWithIncompletePersistenceUnit() throws Exception {
+        EntityManagerFactory emf = getService(EntityManagerFactory.class, "(osgi.unit.name=incompleteTestUnit)", false);
+        Assert.assertNull("There should be no EntityManagerFactory registered since this persistence unit is incomplete", emf);
+    }
 
     @Configuration
     public Option[] configuration() {
-    	InputStream testBundle = TinyBundles.bundle()
-    			.set(Constants.BUNDLE_SYMBOLICNAME, "incompleteTestUnit")
-    			.set("Meta-Persistence", " ")
-    			.add("META-INF/persistence.xml", this.getClass().getResourceAsStream("persistence.xml"))
-    			.build(TinyBundles.withBnd());
+        InputStream testBundle = TinyBundles.bundle()
+            .set(Constants.BUNDLE_SYMBOLICNAME, "incompleteTestUnit") //
+            .set("Meta-Persistence", " ") //
+            .add("META-INF/persistence.xml", this.getClass().getResourceAsStream("persistence.xml"))
+            .build(TinyBundles.withBnd());
         return new Option[] {
             baseOptions(), //
             ariesJpa20(), //
             derbyDSF(), //
             hibernate(), //
+            testBundle(), // Just for Car class
             streamBundle(testBundle)
         };
     }

Copied: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkEmSupplierTest.java (from r1691025, aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java)
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkEmSupplierTest.java?p2=aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkEmSupplierTest.java&p1=aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java&r1=1691025&r2=1691026&rev=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkEmSupplierTest.java Tue Jul 14 16:20:10 2015
@@ -18,7 +18,7 @@ package org.apache.aries.jpa.context.ite
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 
-public class EclipseLinkContextTest extends JPAContextTest {
+public class EclipseLinkEmSupplierTest extends EmSupplierTest {
 
     @Configuration
     public Option[] eclipseLinkConfig() {
@@ -27,7 +27,7 @@ public class EclipseLinkContextTest exte
             ariesJpa21(), //
             eclipseLink(), //
             derbyDSF(), //
-            testBundleAdvanced()
+            testBundle()
         };
     }
 

Copied: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EmSupplierTest.java (from r1691025, aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java)
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EmSupplierTest.java?p2=aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EmSupplierTest.java&p1=aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java&r1=1691025&r2=1691026&rev=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EmSupplierTest.java Tue Jul 14 16:20:10 2015
@@ -25,25 +25,25 @@ import javax.persistence.Query;
 import javax.persistence.TypedQuery;
 import javax.transaction.UserTransaction;
 
-import org.apache.aries.jpa.container.advanced.itest.bundle.entities.Car;
+import org.apache.aries.jpa.container.itest.entities.Car;
 import org.apache.aries.jpa.itest.AbstractJPAItest;
 import org.apache.aries.jpa.supplier.EmSupplier;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.ops4j.pax.exam.util.Filter;
 
-public abstract class JPAContextTest extends AbstractJPAItest {
+public abstract class EmSupplierTest extends AbstractJPAItest {
 
     @Inject
-    UserTransaction ut;
-
-    @Inject
-    @Filter("(osgi.unit.name=test-unit)")
-    EmSupplier emSupplier;
+    private UserTransaction ut;
+    
+    private EmSupplier emSupplier;
 
     @Before
     public void preCall() {
+        if (emSupplier == null) {
+            emSupplier = getService(EmSupplier.class, "(osgi.unit.name=xa-test-unit)");
+        }
         emSupplier.preCall();
     }
     
@@ -51,136 +51,73 @@ public abstract class JPAContextTest ext
     public void postCall() {
         emSupplier.postCall();
     }
-    
+
     @Test
     public void testCreateAndChange() throws Exception {
-        resolveBundles();
         EntityManager em = emSupplier.get();
         ut.begin();
         em.joinTransaction();
-        try {
-            deleteCars(em);
-            Car car = new Car();
-            car.setNumberOfSeats(5);
-            car.setEngineSize(1200);
-            car.setColour("blue");
-            car.setNumberPlate("A1AAA");
-            em.persist(car);
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            ut.commit();
-        }
+        deleteCars(em);
+        em.persist(createBlueCar());
+        ut.commit();
         
-        Car c = em.find(Car.class, "A1AAA");
-        
-        assertEquals(5, c.getNumberOfSeats());
-        assertEquals(1200, c.getEngineSize());
-        assertEquals("blue", c.getColour());
+        Car c = em.find(Car.class, BLUE_CAR_PLATE);
+        assertBlueCar(c);
         
         ut.begin();
-        try {
-            Car car = em.find(Car.class, "A1AAA");
-            car.setNumberOfSeats(2);
-            car.setEngineSize(2000);
-            car.setColour("red");
-        } finally {
-            ut.commit();
-        }
-        
-        c = em.find(Car.class, "A1AAA");
+        Car car = em.find(Car.class, BLUE_CAR_PLATE);
+        car.setNumberOfSeats(2);
+        car.setEngineSize(2000);
+        car.setColour("red");
+        ut.commit();
         
+        c = em.find(Car.class, BLUE_CAR_PLATE);
         assertEquals(2, c.getNumberOfSeats());
         assertEquals(2000, c.getEngineSize());
         assertEquals("red", c.getColour());
     }
 
-    private void deleteCars(EntityManager em) {
-        Query q = em.createQuery("DELETE from Car c");
-        q.executeUpdate();
-
-        q = em.createQuery("SELECT Count(c) from Car c");
-        assertEquals(0l, q.getSingleResult());
-    }
-
     @Test
     public void testQueries() throws Exception {
         final EntityManager em = emSupplier.get();
-        try {
-            ut.begin();
-            em.joinTransaction();
-            deleteCars(em);
-        } finally {
-            ut.commit();
-        }
+
+        ut.begin();
+        em.joinTransaction();
+        deleteCars(em);
+        ut.commit();
 
         Query countQuery = em.createQuery("SELECT Count(c) from Car c");
         assertEquals(0l, countQuery.getSingleResult());
 
         ut.begin();
         em.joinTransaction();
-        try {
-            Car car = new Car();
-            car.setNumberOfSeats(5);
-            car.setEngineSize(1200);
-            car.setColour("blue");
-            car.setNumberPlate("A1AAA");
-            em.persist(car);
-
-            car = new Car();
-            car.setNumberOfSeats(7);
-            car.setEngineSize(1800);
-            car.setColour("green");
-            car.setNumberPlate("B2BBB");
-            em.persist(car);
-        } finally {
-            ut.commit();
-        }
+        em.persist(createBlueCar());
+        em.persist(createGreenCar());
+        ut.commit();
 
         assertEquals(2l, countQuery.getSingleResult());
 
-        TypedQuery<Car> carQuery = em.createQuery("Select c from Car c ORDER by c.engineSize",
-                                                         Car.class);
-
+        TypedQuery<Car> carQuery = em.createQuery("Select c from Car c ORDER by c.engineSize", Car.class);
         List<Car> list = carQuery.getResultList();
-        assertEquals(2l, list.size());
+        assertEquals(2, list.size());
 
-        assertEquals(5, list.get(0).getNumberOfSeats());
-        assertEquals(1200, list.get(0).getEngineSize());
-        assertEquals("blue", list.get(0).getColour());
-        assertEquals("A1AAA", list.get(0).getNumberPlate());
-
-        assertEquals(7, list.get(1).getNumberOfSeats());
-        assertEquals(1800, list.get(1).getEngineSize());
-        assertEquals("green", list.get(1).getColour());
-        assertEquals("B2BBB", list.get(1).getNumberPlate());
+        assertBlueCar(list.get(0));
+        assertGreenCar(list.get(1));
 
         ut.begin();
         em.joinTransaction();
-        try {
-            Car car = em.find(Car.class, "A1AAA");
-            car.setNumberOfSeats(2);
-            car.setEngineSize(2000);
-            car.setColour("red");
-
-            car = em.find(Car.class, "B2BBB");
-            em.remove(car);
-
-            car = new Car();
-            car.setNumberOfSeats(2);
-            car.setEngineSize(800);
-            car.setColour("black");
-            car.setNumberPlate("C3CCC");
-            em.persist(car);
-
-        } finally {
-            ut.commit();
-        }
+        Car car = em.find(Car.class, "A1AAA");
+        car.setNumberOfSeats(2);
+        car.setEngineSize(2000);
+        car.setColour("red");
+        em.remove(em.find(Car.class, "B2BBB"));
+        em.persist(createBlackCar());
+        ut.commit();
 
         assertEquals(2l, countQuery.getSingleResult());
 
         list = carQuery.getResultList();
-        assertEquals(2l, list.size());
+        assertEquals(2, list.size());
 
         assertEquals(2, list.get(0).getNumberOfSeats());
         assertEquals(800, list.get(0).getEngineSize());
@@ -193,4 +130,21 @@ public abstract class JPAContextTest ext
         assertEquals("A1AAA", list.get(1).getNumberPlate());
     }
 
+    private Car createBlackCar() {
+        Car car;
+        car = new Car();
+        car.setNumberOfSeats(2);
+        car.setEngineSize(800);
+        car.setColour("black");
+        car.setNumberPlate("C3CCC");
+        return car;
+    }
+    
+    private void deleteCars(EntityManager em) {
+        Query q = em.createQuery("DELETE from Car c");
+        q.executeUpdate();
+
+        q = em.createQuery("SELECT Count(c) from Car c");
+        assertEquals(0l, q.getSingleResult());
+    }
 }

Copied: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaEmSupplierTest.java (from r1691025, aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaContextTest.java)
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaEmSupplierTest.java?p2=aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaEmSupplierTest.java&p1=aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaContextTest.java&r1=1691025&r2=1691026&rev=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaContextTest.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/OpenjpaEmSupplierTest.java Tue Jul 14 16:20:10 2015
@@ -18,7 +18,7 @@ package org.apache.aries.jpa.context.ite
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 
-public class OpenjpaContextTest extends JPAContextTest {
+public class OpenjpaEmSupplierTest extends EmSupplierTest {
 
     @Configuration
     public Option[] configuration() {
@@ -27,7 +27,7 @@ public class OpenjpaContextTest extends
             ariesJpa20(), //
             openJpa(), //
             derbyDSF(), //
-            testBundleAdvanced()
+            testBundle()
         };
     }
 

Modified: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java Tue Jul 14 16:20:10 2015
@@ -1,5 +1,6 @@
 package org.apache.aries.jpa.itest;
 
+import static org.junit.Assert.assertEquals;
 import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.frameworkProperty;
 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
@@ -8,9 +9,15 @@ import static org.ops4j.pax.exam.CoreOpt
 import static org.ops4j.pax.exam.CoreOptions.vmOption;
 import static org.ops4j.pax.exam.CoreOptions.when;
 
+import java.io.IOException;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
 import javax.inject.Inject;
 import javax.persistence.EntityManagerFactory;
 
+import org.apache.aries.jpa.container.itest.entities.Car;
+import org.junit.Before;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
@@ -25,39 +32,51 @@ import org.osgi.framework.Filter;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.jdbc.DataSourceFactory;
 import org.osgi.util.tracker.ServiceTracker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerClass.class)
 public abstract class AbstractJPAItest {
+    private static Logger LOG = LoggerFactory.getLogger(AbstractJPAItest.class);
+    protected static final String BLUE_CAR_PLATE = "A1AAA";
     protected static final String TEST_UNIT = "test-unit";
+    protected static final String XA_TEST_UNIT = "xa-test-unit";
     protected static final String BP_TEST_UNIT = "bp-test-unit";
     protected static final String BP_XA_TEST_UNIT = "bp-xa-test-unit";
     protected static final String TEST_BUNDLE_NAME = "org.apache.aries.jpa.org.apache.aries.jpa.container.itest.bundle";
-    
+
     @Inject
     protected BundleContext bundleContext;
 
+    @Inject
+    protected ConfigurationAdmin configAdmin;
+    private Configuration config;
+
     /**
      * TODO check calls to this. Eventually switch to EmSupplier 
      */
     protected EntityManagerFactory getProxyEMF(String name) {
         return getEMF(name);
     }
-    
+
     protected EntityManagerFactory getEMF(String name) {
         return getService(EntityManagerFactory.class, "osgi.unit.name=" + name);
     }
-    
+
     public <T> T getService(Class<T> type, String filter) {
-    	return getService(type, filter, true);
+        return getService(type, filter, true);
     }
 
     @SuppressWarnings({ "rawtypes", "unchecked" })
-	public <T> T getService(Class<T> type, String filter, boolean mandatory) {
+    public <T> T getService(Class<T> type, String filter, boolean mandatory) {
         ServiceTracker tracker = null;
         try {
-        	String objClassFilter = "(" + Constants.OBJECTCLASS + "=" + type.getName() + ")";
+            String objClassFilter = "(" + Constants.OBJECTCLASS + "=" + type.getName() + ")";
             String flt = filter != null ? "(&" + objClassFilter + sanitizeFilter(filter) + ")" : objClassFilter;
             Filter osgiFilter = FrameworkUtil.createFilter(flt);
             tracker = new ServiceTracker(bundleContext, osgiFilter, null);
@@ -73,7 +92,7 @@ public abstract class AbstractJPAItest {
         } catch (InterruptedException e) {
             throw new RuntimeException(e);
         } finally {
-        	tracker.close();
+            tracker.close();
         }
     }
 
@@ -91,7 +110,7 @@ public abstract class AbstractJPAItest {
         for (Bundle bundle : bundles) {
             if (bundle.getState() == Bundle.INSTALLED) {
                 System.out.println("Found non resolved bundle " + bundle.getBundleId() + ":"
-                                   + bundle.getSymbolicName() + ":" + bundle.getVersion());
+                    + bundle.getSymbolicName() + ":" + bundle.getVersion());
                 bundle.start();
             }
         }
@@ -110,7 +129,7 @@ public abstract class AbstractJPAItest {
     protected ServiceReference[] getEMFRefs(String name) throws InvalidSyntaxException {
         return bundleContext.getAllServiceReferences(EntityManagerFactory.class.getName(), "(osgi.unit.name=" + name + ")");
     }
-    
+
     private MavenArtifactProvisionOption mvnBundle(String groupId, String artifactId) {
         return mavenBundle(groupId, artifactId).versionAsInProject();
     }
@@ -122,145 +141,185 @@ public abstract class AbstractJPAItest {
             localRepo = System.getProperty("org.ops4j.pax.url.mvn.localRepository");
         }
         return composite(junitBundles(),
-                mavenBundle("org.ops4j.pax.logging", "pax-logging-api", "1.7.2"),
-                mavenBundle("org.ops4j.pax.logging", "pax-logging-service", "1.7.2"),
-                // this is how you set the default log level when using pax
-                // logging (logProfile)
-                systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
-                when(localRepo != null).useOptions(vmOption("-Dorg.ops4j.pax.url.mvn.localRepository=" + localRepo))
-                //,
-                );
+                         mavenBundle("org.ops4j.pax.logging", "pax-logging-api", "1.7.2"),
+                         mavenBundle("org.ops4j.pax.logging", "pax-logging-service", "1.7.2"),
+                         // this is how you set the default log level when using pax
+                         // logging (logProfile)
+                         systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
+                         when(localRepo != null).useOptions(vmOption("-Dorg.ops4j.pax.url.mvn.localRepository=" + localRepo))
+                         //,
+            );
     }
-    
+
     protected Option debug() {
         return vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005");
     }
 
     private Option ariesJpaInternal() {
         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,ja
 vax.security.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; version=1.0,javax.xml.stream.events; version=1.0,javax.xml.stream.util; version=1.0,"
-                               + "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.POAPackage,org.omg.P
 ortableServer.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"),
-                
-                mvnBundle("org.ow2.asm", "asm-all"),
-                mvnBundle("org.apache.felix", "org.apache.felix.configadmin"),
-                mvnBundle("org.apache.felix", "org.apache.felix.coordinator"),
-
-                mvnBundle("org.apache.aries.proxy", "org.apache.aries.proxy.api"),
-                mvnBundle("org.apache.aries.proxy", "org.apache.aries.proxy.impl"),
-                mvnBundle("org.apache.aries", "org.apache.aries.util"),
-                
-                mvnBundle("org.apache.aries.jndi", "org.apache.aries.jndi.api"),
-                mvnBundle("org.apache.aries.jndi", "org.apache.aries.jndi.core"),
-                mvnBundle("org.apache.aries.jndi", "org.apache.aries.jndi.url"),
-
-                mvnBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.api"),
-                mvnBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.core"),
-                
-                mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.api"),
-                mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container"),
-                mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.support"),
-                mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.blueprint"),
-
-                mvnBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec"),
-                mvnBundle("org.apache.aries.transaction", "org.apache.aries.transaction.manager"),
-                mvnBundle("org.apache.aries.transaction", "org.apache.aries.transaction.blueprint"),
+                         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,j
 avax.security.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; version=1.0,javax.xml.stream.events; version=1.0,javax.xml.stream.util; version=1.0,"
+                             + "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.POAPackage,org.omg.Por
 tableServer.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"),
+
+                             mvnBundle("org.ow2.asm", "asm-all"),
+                             mvnBundle("org.apache.felix", "org.apache.felix.configadmin"),
+                             mvnBundle("org.apache.felix", "org.apache.felix.coordinator"),
+
+                             mvnBundle("org.apache.aries.proxy", "org.apache.aries.proxy.api"),
+                             mvnBundle("org.apache.aries.proxy", "org.apache.aries.proxy.impl"),
+                             mvnBundle("org.apache.aries", "org.apache.aries.util"),
+
+                             mvnBundle("org.apache.aries.jndi", "org.apache.aries.jndi.api"),
+                             mvnBundle("org.apache.aries.jndi", "org.apache.aries.jndi.core"),
+                             mvnBundle("org.apache.aries.jndi", "org.apache.aries.jndi.url"),
+
+                             mvnBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.api"),
+                             mvnBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.core"),
+
+                             mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.api"),
+                             mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container"),
+                             mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.support"),
+                             mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.blueprint"),
+
+                             mvnBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec"),
+                             mvnBundle("org.apache.aries.transaction", "org.apache.aries.transaction.manager"),
+                             mvnBundle("org.apache.aries.transaction", "org.apache.aries.transaction.blueprint"),
 
-                mvnBundle("org.apache.derby", "derby")
-        );
+                             mvnBundle("org.apache.derby", "derby")
+            );
     }
-    
+
     protected Option ariesJpa20() {
         return composite(
-                ariesJpaInternal(),
-                mavenBundle("org.apache.geronimo.specs", "geronimo-jpa_2.0_spec", "1.1")
-                );
+                         ariesJpaInternal(),
+                         mavenBundle("org.apache.geronimo.specs", "geronimo-jpa_2.0_spec", "1.1")
+            );
     }
 
     protected Option ariesJpa21() {
         return composite(
-                ariesJpaInternal(),
-                mvnBundle("org.eclipse.persistence", "javax.persistence")
-                );
-    }
-
-    protected Option transactionWrapper() {
-        return mvnBundle("org.apache.aries.transaction", "org.apache.aries.transaction.wrappers");
+                         ariesJpaInternal(),
+                         mvnBundle("org.eclipse.persistence", "javax.persistence")
+            );
     }
 
     protected Option eclipseLink() {
         return composite(
-                mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-dbcp"),
-                mvnBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa"),
-                mvnBundle("org.eclipse.persistence", "org.eclipse.persistence.core"),
-                mvnBundle("org.eclipse.persistence", "org.eclipse.persistence.asm"),
-                mvnBundle("org.eclipse.persistence", "org.eclipse.persistence.antlr"),
-                mvnBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa.jpql"),
-                mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.eclipselink.adapter")
-                );
+                         mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-dbcp"),
+                         mvnBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa"),
+                         mvnBundle("org.eclipse.persistence", "org.eclipse.persistence.core"),
+                         mvnBundle("org.eclipse.persistence", "org.eclipse.persistence.asm"),
+                         mvnBundle("org.eclipse.persistence", "org.eclipse.persistence.antlr"),
+                         mvnBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa.jpql"),
+                         mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.eclipselink.adapter")
+            );
     }
 
     protected Option openJpa() {
         return composite(
-                mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.cglib"), //
-                mvnBundle("commons-pool", "commons-pool"), //
-                mvnBundle("commons-lang", "commons-lang"), //
-                mvnBundle("commons-collections", "commons-collections"), //
-                mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.serp"),
-                mvnBundle("org.apache.geronimo.specs", "geronimo-servlet_2.5_spec"),
-                mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-dbcp"),
-                mvnBundle("org.apache.xbean", "xbean-asm4-shaded"),
-                mvnBundle("org.apache.openjpa", "openjpa")
-                );
+                         mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.cglib"), //
+                         mvnBundle("commons-pool", "commons-pool"), //
+                         mvnBundle("commons-lang", "commons-lang"), //
+                         mvnBundle("commons-collections", "commons-collections"), //
+                         mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.serp"),
+                         mvnBundle("org.apache.geronimo.specs", "geronimo-servlet_2.5_spec"),
+                         mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-dbcp"),
+                         mvnBundle("org.apache.xbean", "xbean-asm4-shaded"),
+                         mvnBundle("org.apache.openjpa", "openjpa")
+            );
     }
-    
+
     protected Option hibernate() {
         return composite(
-                mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.antlr"),
-                mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.ant"),
-                mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.dom4j"),
-                mvnBundle("org.apache.servicemix.bundles" , "org.apache.servicemix.bundles.serp"),
-                mvnBundle("com.fasterxml", "classmate"),
-                mvnBundle("org.javassist", "javassist"),
-                mvnBundle("org.jboss.logging", "jboss-logging"),
-                mvnBundle("org.hibernate.common", "hibernate-commons-annotations"), 
-                mvnBundle("org.jboss", "jandex"),
-                mvnBundle("org.hibernate", "hibernate-core"),
-                mvnBundle("org.hibernate", "hibernate-entitymanager"),
-                mvnBundle("org.hibernate", "hibernate-osgi")
-                );
+                         mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.antlr"),
+                         mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.ant"),
+                         mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.dom4j"),
+                         mvnBundle("org.apache.servicemix.bundles" , "org.apache.servicemix.bundles.serp"),
+                         mvnBundle("com.fasterxml", "classmate"),
+                         mvnBundle("org.javassist", "javassist"),
+                         mvnBundle("org.jboss.logging", "jboss-logging"),
+                         mvnBundle("org.hibernate.common", "hibernate-commons-annotations"), 
+                         mvnBundle("org.jboss", "jandex"),
+                         mvnBundle("org.hibernate", "hibernate-core"),
+                         mvnBundle("org.hibernate", "hibernate-entitymanager"),
+                         mvnBundle("org.hibernate", "hibernate-osgi")
+            );
     }
 
-    protected Option testDs() {
-        return mvnBundle("org.apache.aries.transaction", "org.apache.aries.transaction.testds");
-    }
-    
     protected Option derbyDSF() {
         return composite(
-                mvnBundle("org.ops4j.pax.jdbc", "pax-jdbc-derby"), //
-                mvnBundle("org.apache.commons", "commons-pool2"), //
-                mvnBundle("commons-logging", "commons-logging"), //
-                mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.cglib"), //
-                mvnBundle("org.apache.commons", "commons-dbcp2"), //
-                mvnBundle("org.ops4j.pax.jdbc", "pax-jdbc-pool-common"), //
-                mvnBundle("org.ops4j.pax.jdbc", "pax-jdbc-pool-dbcp2") //
+                         mvnBundle("org.ops4j.pax.jdbc", "pax-jdbc-spec"), //
+                         mvnBundle("org.ops4j.pax.jdbc", "pax-jdbc-derby"), //
+                         mvnBundle("org.apache.commons", "commons-pool2"), //
+                         mvnBundle("commons-logging", "commons-logging"), //
+                         mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.cglib"), //
+                         mvnBundle("org.apache.commons", "commons-dbcp2"), //
+                         mvnBundle("org.ops4j.pax.jdbc", "pax-jdbc-pool-common"), //
+                         mvnBundle("org.ops4j.pax.jdbc", "pax-jdbc-pool-dbcp2"), //
+                         mvnBundle("org.ops4j.pax.jdbc", "pax-jdbc-config")
             );
     }
-    
-    protected MavenArtifactProvisionOption testBundle() {
+
+    protected Option testBundle() {
         return mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container.itest.bundle");
     }
 
-    protected MavenArtifactProvisionOption testBundleBlueprint() {
-        return mvnBundle("org.apache.aries.jpa.itest", "org.apache.aries.jpa.container.itest.bundle.blueprint");
+    protected Option testBundleBlueprint() {
+        return composite(
+                         testBundle(),
+                         mvnBundle("org.apache.aries.jpa.itest", "org.apache.aries.jpa.container.itest.bundle.blueprint")
+            );
+
     }
 
     protected MavenArtifactProvisionOption testBundleEclipseLink() {
         return mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container.itest.bundle.eclipselink");
     }
 
-    protected MavenArtifactProvisionOption testBundleAdvanced() {
-        return mvnBundle("org.apache.aries.jpa", "org.apache.aries.jpa.container.advanced.itest.bundle");
+    @Before
+    public void createConfigForDataSource() throws IOException {
+        if (config == null) {
+            config = configAdmin.createFactoryConfiguration("org.ops4j.datasource", null);
+            Dictionary<String, String> props = new Hashtable<String, String>();
+            props.put(DataSourceFactory.OSGI_JDBC_DRIVER_CLASS, "org.apache.derby.jdbc.EmbeddedDriver-pool-xa");
+            props.put(DataSourceFactory.JDBC_URL, "jdbc:derby:memory:TEST1;create=true");
+            props.put("dataSourceName", "testds");
+            config.update(props);
+            LOG.info("Created DataSource config testds");
+        }
+    }
+
+    protected Car createBlueCar() {
+        Car car = new Car();
+        car.setNumberOfSeats(5);
+        car.setEngineSize(1200);
+        car.setColour("blue");
+        car.setNumberPlate(BLUE_CAR_PLATE);
+        return car;
+    }
+
+    protected Car createGreenCar() {
+        Car car;
+        car = new Car();
+        car.setNumberOfSeats(7);
+        car.setEngineSize(1800);
+        car.setColour("green");
+        car.setNumberPlate("B2BBB");
+        return car;
+    }
+
+    protected void assertBlueCar(Car car) {
+        assertEquals(5, car.getNumberOfSeats());
+        assertEquals(1200, car.getEngineSize());
+        assertEquals("blue", car.getColour());
+        assertEquals(BLUE_CAR_PLATE, car.getNumberPlate());
+    }
+
+    protected void assertGreenCar(Car car) {
+        assertEquals(7, car.getNumberOfSeats());
+        assertEquals(1800, car.getEngineSize());
+        assertEquals("green", car.getColour());
+        assertEquals("B2BBB", car.getNumberPlate());
     }
 }

Modified: aries/trunk/jpa/itests/jpa-container-testbundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-testbundle/pom.xml?rev=1691026&r1=1691025&r2=1691026&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-testbundle/pom.xml (original)
+++ aries/trunk/jpa/itests/jpa-container-testbundle/pom.xml Tue Jul 14 16:20:10 2015
@@ -67,6 +67,10 @@
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
+                        <!-- Dynamic import to for hibernate enhancement 
+                            to make sure it also works in eclipselink -->
+                        <DynamicImport-Package>org.hibernate.proxy,
+                            javassist.util.proxy</DynamicImport-Package>
                         <Meta-Persistence>META-INF/persistence.xml</Meta-Persistence>
                     </instructions>
                 </configuration>



Mime
View raw message