You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bv...@apache.org on 2013/10/13 13:44:46 UTC

[1/5] git commit: Fixed JpaProducerConcurrentTest failing from time to time on the CI-Server. Also polished it a bit.

Updated Branches:
  refs/heads/camel-2.12.x c4ad5ea68 -> 97171d285


Fixed JpaProducerConcurrentTest failing from time to time on the CI-Server. Also polished it a bit.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/33e2f808
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/33e2f808
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/33e2f808

Branch: refs/heads/camel-2.12.x
Commit: 33e2f808f18643f60d4023ad84c13d25a6c9ba71
Parents: c4ad5ea
Author: bvahdat <bv...@apache.org>
Authored: Fri Oct 11 19:20:24 2013 +0200
Committer: bvahdat <bv...@apache.org>
Committed: Sun Oct 13 12:45:48 2013 +0200

----------------------------------------------------------------------
 .../jpa/JpaProducerConcurrentTest.java          | 21 +++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/33e2f808/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
index 8e753aa..ac278be 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
@@ -16,9 +16,9 @@
  */
 package org.apache.camel.processor.jpa;
 
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
@@ -50,13 +50,14 @@ public class JpaProducerConcurrentTest extends AbstractJpaTest {
         getMockEndpoint("mock:result").assertNoDuplicates(body());
 
         ExecutorService executor = Executors.newFixedThreadPool(poolSize);
-        Map<Integer, Future<Object>> responses = new ConcurrentHashMap<Integer, Future<Object>>();
+        // we access the responses Map below only inside the main thread,
+        // so no need for a thread-safe Map implementation
+        Map<Integer, Future<SendEmail>> responses = new HashMap<Integer, Future<SendEmail>>();
         for (int i = 0; i < files; i++) {
             final int index = i;
-            Future<Object> out = executor.submit(new Callable<Object>() {
-                public Object call() throws Exception {
-                    template.sendBody("direct:start", new SendEmail("user" + index + "@somewhere.org"));
-                    return null;
+            Future<SendEmail> out = executor.submit(new Callable<SendEmail>() {
+                public SendEmail call() throws Exception {
+                    return template.requestBody("direct:start", new SendEmail("user" + index + "@somewhere.org"), SendEmail.class);
                 }
             });
             responses.put(index, out);
@@ -67,8 +68,10 @@ public class JpaProducerConcurrentTest extends AbstractJpaTest {
         assertEquals(files, responses.size());
 
         // get them so they are complete
-        for (Future<Object> future : responses.values()) {
-            future.get();
+        for (Future<SendEmail> future : responses.values()) {
+        	SendEmail sendMail = future.get();
+        	assertNotNull(sendMail);
+        	log.info("Got the managed entity {}", sendMail);
         }
 
         // assert in the database
@@ -80,7 +83,7 @@ public class JpaProducerConcurrentTest extends AbstractJpaTest {
     protected RouteBuilder createRouteBuilder() {
         return new SpringRouteBuilder() {
             public void configure() {
-                from("direct:start").to("jpa://" + SendEmail.class.getName()).to("mock:result");
+                from("direct:start").to("jpa://" + SendEmail.class.getName() + "?usePersist=true").to("mock:result");
             }
         };
     }


[2/5] git commit: Temporarily set the log output to the console to find the root cause of the failing JpaProducerConcurrentTest on CI-Server.

Posted by bv...@apache.org.
Temporarily set the log output to the console to find the root cause of the failing JpaProducerConcurrentTest on CI-Server.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/34079e88
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/34079e88
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/34079e88

Branch: refs/heads/camel-2.12.x
Commit: 34079e889656f0f90a10c2b66369f915db4d4e5f
Parents: 33e2f80
Author: Babak Vahdat <bv...@apache.org>
Authored: Sat Oct 12 10:09:53 2013 +0200
Committer: bvahdat <bv...@apache.org>
Committed: Sun Oct 13 12:46:07 2013 +0200

----------------------------------------------------------------------
 components/camel-jpa/src/test/resources/log4j.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/34079e88/components/camel-jpa/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/resources/log4j.properties b/components/camel-jpa/src/test/resources/log4j.properties
index 926f81c..a59802d 100644
--- a/components/camel-jpa/src/test/resources/log4j.properties
+++ b/components/camel-jpa/src/test/resources/log4j.properties
@@ -18,7 +18,7 @@
 #
 # The logging properties used for eclipse testing, We want to see debug output on the console.
 #
-log4j.rootLogger=INFO, file
+log4j.rootLogger=DEBUG, out
 
 #log4j.logger.org.apache.camel=DEBUG
 #log4j.logger.org.springframework=WARN


[5/5] git commit: Avoid openjpa warnings about fields being accessed directly instead of using the corresponding setter/getter. Conflicts: components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java

Posted by bv...@apache.org.
Avoid openjpa warnings about fields being accessed directly instead of using the corresponding setter/getter.
Conflicts:
	components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/97171d28
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/97171d28
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/97171d28

Branch: refs/heads/camel-2.12.x
Commit: 97171d285488e8b59830191efd656a9745421acf
Parents: b4fe0e1
Author: bvahdat <bv...@apache.org>
Authored: Sun Oct 13 12:40:00 2013 +0200
Committer: bvahdat <bv...@apache.org>
Committed: Sun Oct 13 13:10:38 2013 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/examples/MultiSteps.java   |  9 +--------
 .../java/org/apache/camel/examples/SendEmail.java    | 15 ++++++++-------
 2 files changed, 9 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/97171d28/components/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java b/components/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java
index 3e8fc51..17c6e82 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java
@@ -48,13 +48,6 @@ public class MultiSteps {
         setStep(1);
     }
 
-    @Override
-    public String toString() {
-        // TODO: don't make use of the id property here as it could potentially end up
-        // with a deadlock through the openjpa generated proxy object of this entity 
-        return "MultiSteps[step: " + getStep() + " address: " + getAddress() + "]";
-    }
-
     @Id
     @GeneratedValue
     public Long getId() {
@@ -88,6 +81,6 @@ public class MultiSteps {
     public void goToNextStep() {
         setStep(getStep() + 1);
 
-        LOG.info("Invoked the completion complete method. Now updated the step to: " + getStep());
+        LOG.info("Invoked the completion complete method. Now updated the step to: {}", getStep());
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/97171d28/components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java b/components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java
index b57098c..e4e0d33 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java
@@ -37,13 +37,6 @@ public class SendEmail {
         setAddress(address);
     }
 
-    @Override
-    public String toString() {
-        // TODO: don't make use of the id property here as it could potentially end up
-        // with a deadlock through the openjpa generated proxy object of this entity 
-        return "SendEmail[address: " + getAddress() + "]";
-    }
-
     @Id
     @GeneratedValue
     public Long getId() {
@@ -61,4 +54,12 @@ public class SendEmail {
     public void setAddress(String address) {
         this.address = address;
     }
+
+    @PreConsumed
+    public void doBefore() {
+        LOG.info("Invoked the pre consumed method with address {}", getAddress());
+        if ("dummy".equals(getAddress())) {
+            setAddress("dummy@somewhere.org");
+        }
+    }
 }


[4/5] git commit: Fixed JpaProducerConcurrentTest failing from time to time on the CI-Server.

Posted by bv...@apache.org.
Fixed JpaProducerConcurrentTest failing from time to time on the CI-Server.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b4fe0e16
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b4fe0e16
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b4fe0e16

Branch: refs/heads/camel-2.12.x
Commit: b4fe0e16b6aef9a2b8536027c457ba13359b41f3
Parents: 71d1a08
Author: bvahdat <bv...@apache.org>
Authored: Sat Oct 12 22:52:04 2013 +0200
Committer: bvahdat <bv...@apache.org>
Committed: Sun Oct 13 13:07:08 2013 +0200

----------------------------------------------------------------------
 .../src/test/java/org/apache/camel/examples/MultiSteps.java      | 4 +++-
 .../src/test/java/org/apache/camel/examples/SendEmail.java       | 4 +++-
 .../apache/camel/processor/jpa/JpaProducerConcurrentTest.java    | 2 +-
 components/camel-jpa/src/test/resources/log4j.properties         | 2 +-
 4 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b4fe0e16/components/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java b/components/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java
index e872839..3e8fc51 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/examples/MultiSteps.java
@@ -50,7 +50,9 @@ public class MultiSteps {
 
     @Override
     public String toString() {
-        return "MultiSteps[id: " + getId() + " step: " + getStep() + " address: " + getAddress() + "]";
+        // TODO: don't make use of the id property here as it could potentially end up
+        // with a deadlock through the openjpa generated proxy object of this entity 
+        return "MultiSteps[step: " + getStep() + " address: " + getAddress() + "]";
     }
 
     @Id

http://git-wip-us.apache.org/repos/asf/camel/blob/b4fe0e16/components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java b/components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java
index 88650f1..b57098c 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/examples/SendEmail.java
@@ -39,7 +39,9 @@ public class SendEmail {
 
     @Override
     public String toString() {
-        return "SendEmail[id: " + getId() + " address: " + getAddress() + "]";
+        // TODO: don't make use of the id property here as it could potentially end up
+        // with a deadlock through the openjpa generated proxy object of this entity 
+        return "SendEmail[address: " + getAddress() + "]";
     }
 
     @Id

http://git-wip-us.apache.org/repos/asf/camel/blob/b4fe0e16/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
index b6c16e0..52b31d3 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
@@ -71,7 +71,7 @@ public class JpaProducerConcurrentTest extends AbstractJpaTest {
         for (Future<SendEmail> future : responses.values()) {
             SendEmail sendMail = future.get();
             assertNotNull(sendMail);
-            log.info("Got the managed entity {}", sendMail);
+            log.info("Got the managed entity {} with the id {}", sendMail, sendMail.getId());
         }
 
         // assert in the database

http://git-wip-us.apache.org/repos/asf/camel/blob/b4fe0e16/components/camel-jpa/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/resources/log4j.properties b/components/camel-jpa/src/test/resources/log4j.properties
index a59802d..926f81c 100644
--- a/components/camel-jpa/src/test/resources/log4j.properties
+++ b/components/camel-jpa/src/test/resources/log4j.properties
@@ -18,7 +18,7 @@
 #
 # The logging properties used for eclipse testing, We want to see debug output on the console.
 #
-log4j.rootLogger=DEBUG, out
+log4j.rootLogger=INFO, file
 
 #log4j.logger.org.apache.camel=DEBUG
 #log4j.logger.org.springframework=WARN


[3/5] git commit: Fixed the CS error of camel-jpa

Posted by bv...@apache.org.
Fixed the CS error of camel-jpa


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/71d1a087
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/71d1a087
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/71d1a087

Branch: refs/heads/camel-2.12.x
Commit: 71d1a087b218121ed88007f7d1f4c80a82d8ff4f
Parents: 34079e8
Author: Willem Jiang <ni...@apache.org>
Authored: Sat Oct 12 12:19:28 2013 +0800
Committer: bvahdat <bv...@apache.org>
Committed: Sun Oct 13 13:06:05 2013 +0200

----------------------------------------------------------------------
 .../apache/camel/processor/jpa/JpaProducerConcurrentTest.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/71d1a087/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
index ac278be..b6c16e0 100644
--- a/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
+++ b/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaProducerConcurrentTest.java
@@ -69,9 +69,9 @@ public class JpaProducerConcurrentTest extends AbstractJpaTest {
 
         // get them so they are complete
         for (Future<SendEmail> future : responses.values()) {
-        	SendEmail sendMail = future.get();
-        	assertNotNull(sendMail);
-        	log.info("Got the managed entity {}", sendMail);
+            SendEmail sendMail = future.get();
+            assertNotNull(sendMail);
+            log.info("Got the managed entity {}", sendMail);
         }
 
         // assert in the database