aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1692875 - in /aries/trunk/jpa: itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/ itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/ jpa-blu...
Date Mon, 27 Jul 2015 12:50:16 GMT
Author: cschneider
Date: Mon Jul 27 12:50:15 2015
New Revision: 1692875

URL: http://svn.apache.org/r1692875
Log:
[ARIES-628] Fixing jta 1.2 testcase

Modified:
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceEmJtaAnn.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java
    aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaBeanProcessor.java

Modified: aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceEmJtaAnn.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/CarServiceEmJtaAnn.java?rev=1692875&r1=1692874&r2=1692875&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceEmJtaAnn.java
(original)
+++ aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/java/org/apache/aries/jpa/container/itest/bundle/blueprint/impl/CarServiceEmJtaAnn.java
Mon Jul 27 12:50:15 2015
@@ -31,6 +31,7 @@ public class CarServiceEmJtaAnn implemen
     @PersistenceContext(unitName = "xa-test-unit")
     protected EntityManager em;
 
+    @Transactional(Transactional.TxType.SUPPORTS)
     @Override
     public Car getCar(String id) {
         return em.find(Car.class, id);
@@ -42,6 +43,7 @@ public class CarServiceEmJtaAnn implemen
         em.persist(car);
     }
 
+    @Transactional(Transactional.TxType.SUPPORTS)
     public Collection<Car> getCars() {
         return em.createQuery("select c from Car c", Car.class).getResultList();
     }

Modified: 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=1692875&r1=1692874&r2=1692875&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java
(original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java
Mon Jul 27 12:50:15 2015
@@ -30,12 +30,9 @@ import org.apache.aries.jpa.container.it
 import org.apache.aries.jpa.container.itest.entities.CarService;
 import org.apache.aries.jpa.itest.AbstractCarJPAITest;
 import org.junit.Assert;
-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.framework.BundleException;
 import org.osgi.service.coordinator.Coordination;
 import org.osgi.service.coordinator.Coordinator;
 
@@ -43,15 +40,6 @@ public class BlueprintTest extends Abstr
     @Inject
     Coordinator coordinator;
     
-    @Before
-    public void deleteCars() throws BundleException {
-        resolveBundles();
-        CarService carService = getCarService("emf");
-        if (carService.getCar(BLUE_CAR_PLATE)!=null) {
-            carService.deleteCar(BLUE_CAR_PLATE);
-        }
-    }
-
     @Test
     public void testCoordination() {
         CarService carService = getCarService("em");
@@ -88,23 +76,22 @@ public class BlueprintTest extends Abstr
     }
 
     @Test
-    public void testEmfAddQuery() throws Exception {
+    public void testEmf() throws Exception {
         carLifecycle(getCarService("emf"));
     }
 
     @Test
-    public void testEmAddQuery() throws Exception {
+    public void testEm() throws Exception {
         carLifecycle(getCarService("em"));
     }
     
-    @Ignore
     @Test
     public void testEmJtaAnn() throws Exception {
         carLifecycle(getCarService("emJtaAnn"));
     }
 
     @Test
-    public void testSupplierAddQuery() throws Exception {
+    public void testSupplier() throws Exception {
         carLifecycle(getCarService("supplier"));
     }
     
@@ -130,6 +117,7 @@ public class BlueprintTest extends Abstr
     private void carLifecycle(CarService carService) {
         carService.addCar(createBlueCar());
         assertBlueCar(carService.getCar(BLUE_CAR_PLATE));
+        carService.deleteCar(BLUE_CAR_PLATE);
     }
 
     @Configuration

Modified: aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaBeanProcessor.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaBeanProcessor.java?rev=1692875&r1=1692874&r2=1692875&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaBeanProcessor.java
(original)
+++ aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaBeanProcessor.java
Mon Jul 27 12:50:15 2015
@@ -48,7 +48,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class JpaBeanProcessor implements BeanProcessor {
-    private static final Logger LOGGER = LoggerFactory.getLogger(JpaInterceptor.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(JpaBeanProcessor.class);
     public static final String JPA_PROCESSOR_BEAN_NAME = "org_apache_aries_jpan";
     private Map<Object, Collection<Closeable>> serviceProxies;
     private ComponentDefinitionRegistry cdr;
@@ -105,13 +105,12 @@ public class JpaBeanProcessor implements
                                           BeanMetadata beanData) {
         Collection<Closeable> beanProxies = getBeanProxies(bean);
         BundleContext context = FrameworkUtil.getBundle(bean.getClass()).getBundleContext();
-        LOGGER.info("context bundle " + context.getBundle());
         JpaAnnotatedMemberHandler jpaAnnotatedMember = new JpaAnnotatedMemberHandler(bean);
         for (AccessibleObject member : jpaAnnotated) {
             member.setAccessible(true);
             PersistenceContext pcAnn = member.getAnnotation(PersistenceContext.class);
             if (pcAnn != null) {
-                LOGGER.info("Adding jpa/jta interceptor bean {} with class {}", beanName,
bean.getClass());
+                LOGGER.debug("Adding jpa interceptor for bean {} with class {}", beanName,
bean.getClass());
                 String filter = getFilter(EmSupplier.class, pcAnn.unitName());
                 EmSupplier supplierProxy = ServiceProxy.create(context, EmSupplier.class,
filter);
                 jpaAnnotatedMember.handleSupplierMember(member, pcAnn.unitName(), supplierProxy);



Mime
View raw message