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 2012/11/22 21:58:19 UTC
svn commit: r1412674 - in /camel/branches/camel-2.10.x: ./
tests/camel-itest/src/test/java/org/apache/camel/itest/async/HttpAsyncCallbackTest.java
Author: bvahdat
Date: Thu Nov 22 20:58:18 2012
New Revision: 1412674
URL: http://svn.apache.org/viewvc?rev=1412674&view=rev
Log:
Merged revisions 1412672 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r1412672 | bvahdat | 2012-11-22 21:53:11 +0100 (Do, 22 Nov 2012) | 1 line
Fixed the broken test on the CI-Server (It was not thread-safe to call ArrayList.add() method concurrently).
........
Modified:
camel/branches/camel-2.10.x/ (props changed)
camel/branches/camel-2.10.x/tests/camel-itest/src/test/java/org/apache/camel/itest/async/HttpAsyncCallbackTest.java
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1412672
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.10.x/tests/camel-itest/src/test/java/org/apache/camel/itest/async/HttpAsyncCallbackTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/tests/camel-itest/src/test/java/org/apache/camel/itest/async/HttpAsyncCallbackTest.java?rev=1412674&r1=1412673&r2=1412674&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/tests/camel-itest/src/test/java/org/apache/camel/itest/async/HttpAsyncCallbackTest.java (original)
+++ camel/branches/camel-2.10.x/tests/camel-itest/src/test/java/org/apache/camel/itest/async/HttpAsyncCallbackTest.java Thu Nov 22 20:58:18 2012
@@ -16,8 +16,8 @@
*/
package org.apache.camel.itest.async;
-import java.util.ArrayList;
import java.util.List;
+import java.util.Vector;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -67,7 +67,10 @@ public class HttpAsyncCallbackTest exten
*/
private static class MyCallback extends SynchronizationAdapter {
- private final List<String> data = new ArrayList<String>();
+ // below the String elements are added in the context of different threads so that we should make
+ // sure that this's done in a thread-safe manner, that's no two threads should call the data.add()
+ // method below concurrently, so why we use Vector here and not e.g. ArrayList
+ private final List<String> data = new Vector<String>();
@Override
public void onComplete(Exchange exchange) {