aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1657597 - in /aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest: EclipseLinkContextTest.java EclipseLinkStartupTest.java
Date Thu, 05 Feb 2015 15:04:48 GMT
Author: cschneider
Date: Thu Feb  5 15:04:48 2015
New Revision: 1657597

URL: http://svn.apache.org/r1657597
Log:
Small refactoring

Modified:
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkStartupTest.java

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java?rev=1657597&r1=1657596&r2=1657597&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java
(original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkContextTest.java
Thu Feb  5 15:04:48 2015
@@ -78,8 +78,8 @@ public class EclipseLinkContextTest exte
       ut.rollback();
     }
     
-    Car c = em.find(Car.class, "AB11CDE");
-    assertEquals(c, null);
+    Car car = em.find(Car.class, "AB11CDE");
+    assertEquals(car, null);
   }
   
   @Test
@@ -88,8 +88,8 @@ public class EclipseLinkContextTest exte
     EntityManagerFactory emf = getProxyEMF(SCRIPT_TEST_UNIT);
     EntityManager em = emf.createEntityManager();
         
-    Car c = em.find(Car.class, "AB11CDE");
-    assertEquals(1300, em.find(Car.class, "AB11CDE").getEngineSize());
+    Car car = em.find(Car.class, "AB11CDE");
+    assertEquals(1300, car.getEngineSize());
   }
 
   @Configuration

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkStartupTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkStartupTest.java?rev=1657597&r1=1657596&r2=1657597&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkStartupTest.java
(original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/EclipseLinkStartupTest.java
Thu Feb  5 15:04:48 2015
@@ -15,39 +15,35 @@
  */
 package org.apache.aries.jpa.context.itest;
 
+import static org.ops4j.pax.exam.CoreOptions.options;
+
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.spi.PersistenceProvider;
+
+import org.apache.aries.itest.RichBundleContext;
 import org.apache.aries.jpa.itest.AbstractJPAItest;
 import org.junit.Test;
 import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
-import org.osgi.framework.Bundle;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.spi.PersistenceProvider;
 
 public class EclipseLinkStartupTest extends AbstractJPAItest {
-    
+
     @Test
     public void testContextCreationWithStartingBundle() throws Exception {
+        RichBundleContext context = context();
         // wait for the Eclipselink provider to come up
-        context().getService(PersistenceProvider.class);
-        
-        for (Bundle b : bundleContext.getBundles()) {
-            if (b.getSymbolicName().equals("org.apache.aries.jpa.container.itest.bundle.eclipselink"))
{
-                b.start();
-            }
-        }
-        
-        context().getService(EntityManagerFactory.class);
+        context.getService(PersistenceProvider.class);
+        context.getBundleByName("org.apache.aries.jpa.container.itest.bundle.eclipselink").start();
+        context.getService(EntityManagerFactory.class);
     }
 
     @Configuration
     public Option[] configuration() {
-        return CoreOptions.options(
-        		baseOptions(),
-        		ariesJpa21(),
-        		eclipseLink(),
-        		testBundleEclipseLink().noStart()
-            );
+        return options(//
+                baseOptions(),//
+                ariesJpa21(),//
+                eclipseLink(),//
+                testBundleEclipseLink().noStart()//
+        );
     }
 }



Mime
View raw message