aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1693248 - in /aries/trunk/jpa: itests/jpa-container-itest/ itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/ itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/ jpa-blueprint/src/main/java/org/...
Date Wed, 29 Jul 2015 12:11:42 GMT
Author: cschneider
Date: Wed Jul 29 12:11:41 2015
New Revision: 1693248

URL: http://svn.apache.org/r1693248
Log:
Logging improvements

Modified:
    aries/trunk/jpa/itests/jpa-container-itest/pom.xml
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/itest/AbstractJPAItest.java
    aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaInterceptor.java
    aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/supplier/impl/ServiceProxy.java

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=1693248&r1=1693247&r2=1693248&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/pom.xml (original)
+++ aries/trunk/jpa/itests/jpa-container-itest/pom.xml Wed Jul 29 12:11:41 2015
@@ -441,7 +441,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <forkMode>pertest</forkMode>
+                    <forkCount>1</forkCount>
+                    <reuseForks>false</reuseForks>
                 </configuration>
             </plugin>
         </plugins>
@@ -461,7 +462,8 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
                         <configuration>
-                            <forkMode>pertest</forkMode>
+                            <forkCount>1</forkCount>
+                            <reuseForks>false</reuseForks>
                             <!--
                                 when the local repo location has been specified, we need
to pass
                                 on this information to PAX mvn url

Modified: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java?rev=1693248&r1=1693247&r2=1693248&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
(original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
Wed Jul 29 12:11:41 2015
@@ -70,8 +70,6 @@ public abstract class JPAContainerTest e
 
     @Test
     public void testEmSupplier() throws Exception {
-        // This test seems to fail sometimes on the build server. Checking if it is a timing
issue at startup
-        Thread.sleep(2000);
         EmSupplier emSupplier = getService(EmSupplier.class, "(osgi.unit.name=" + XA_TEST_UNIT
+ ")");
         try {
             emSupplier.preCall();

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=1693248&r1=1693247&r2=1693248&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
Wed Jul 29 12:11:41 2015
@@ -306,8 +306,9 @@ public abstract class AbstractJPAItest {
     }
 
     @Before
-    public void createConfigForDataSource() throws IOException {
+    public void createConfigForDataSource() throws Exception {
         if (config == null) {
+            createConfigForLogging();
             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");
@@ -317,5 +318,18 @@ public abstract class AbstractJPAItest {
             LOG.info("Created DataSource config testds");
         }
     }
+    
+    public void createConfigForLogging() throws IOException {
+        Configuration logConfig = configAdmin.getConfiguration("org.ops4j.pax.logging", null);
+        Dictionary<String, String> props = new Hashtable<String, String>();
+        props.put("log4j.rootLogger", "INFO, stdout");
+        props.put("log4j.logger.org.apache.aries.transaction", "DEBUG");
+        props.put("log4j.logger.org.apache.aries.transaction.parsing", "DEBUG");
+        props.put("log4j.logger.org.apache.aries.jpa.blueprint.impl", "DEBUG");
+        props.put("log4j.appender.stdout", "org.apache.log4j.ConsoleAppender");
+        props.put("log4j.appender.stdout.layout", "org.apache.log4j.PatternLayout");
+        props.put("log4j.appender.stdout.layout.ConversionPattern", "%d{ISO8601} | %-5.5p
| %-16.16t | %c | %m%n");
+        logConfig.update(props);
+    }
 
 }

Modified: aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaInterceptor.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaInterceptor.java?rev=1693248&r1=1693247&r2=1693248&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaInterceptor.java
(original)
+++ aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaInterceptor.java
Wed Jul 29 12:11:41 2015
@@ -44,6 +44,7 @@ public class JpaInterceptor implements I
 
     public Object preCall(ComponentMetadata cm, Method m, Object... parameters) throws Throwable
{
         try {
+            LOG.debug("PreCall for bean {}, method {}", cm.getId(), m.getName());
             emSupplier.preCall();
             EntityManager em = emSupplier.get();
             boolean weControlTx = isResourceLocal(em) && !em.getTransaction().isActive();
@@ -58,6 +59,7 @@ public class JpaInterceptor implements I
     }
 
     public void postCallWithException(ComponentMetadata cm, Method m, Throwable ex, Object
preCallToken) {
+        LOG.debug("PostCallWithException for bean {}, method {}", cm.getId(), m.getName(),
ex);
         boolean weControlTx = preCallToken == null ? false : (Boolean)preCallToken;
         if (weControlTx) {
             safeRollback(emSupplier.get(), ex);
@@ -71,6 +73,7 @@ public class JpaInterceptor implements I
 
     public void postCallWithReturn(ComponentMetadata cm, Method m, Object returnType, Object
preCallToken)
         throws Exception {
+        LOG.debug("PostCallWithReturn for bean {}, method {}", cm.getId(), m.getName());
         boolean weControlTx = preCallToken == null ? false : (Boolean)preCallToken;
         if (weControlTx) {
             emSupplier.get().getTransaction().commit();

Modified: aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/supplier/impl/ServiceProxy.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/supplier/impl/ServiceProxy.java?rev=1693248&r1=1693247&r2=1693248&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/supplier/impl/ServiceProxy.java
(original)
+++ aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/supplier/impl/ServiceProxy.java
Wed Jul 29 12:11:41 2015
@@ -28,7 +28,6 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.wiring.BundleWiring;
 import org.osgi.util.tracker.ServiceTracker;
 
 public class ServiceProxy implements InvocationHandler {



Mime
View raw message