camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1409788 - in /camel/branches/camel-2.10.x: ./ camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java
Date Thu, 15 Nov 2012 13:58:12 GMT
Author: davsclaus
Date: Thu Nov 15 13:58:12 2012
New Revision: 1409788

URL: http://svn.apache.org/viewvc?rev=1409788&view=rev
Log:
Fixed test

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1409734

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java?rev=1409788&r1=1409787&r2=1409788&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java
Thu Nov 15 13:58:12 2012
@@ -17,9 +17,9 @@
 package org.apache.camel.builder.xml;
 
 import java.io.InputStream;
-import java.util.HashSet;
+import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.Set;
+import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
@@ -346,16 +346,19 @@ public class XPathTest extends ContextTe
         // convert the node concurrently to test that XML Parser is not thread safe when
         // importing nodes to a new Document, so try a test for that
 
-        final Set<Document> result = new HashSet<Document>();
+        final List<Document> result = new ArrayList<Document>();
         ExecutorService executor = Executors.newFixedThreadPool(size);
         final CountDownLatch latch = new CountDownLatch(size);
         for (int i = 0; i < size; i++) {
             executor.submit(new Callable<Document>() {
                 public Document call() throws Exception {
-                    Document doc = context.getTypeConverter().convertTo(Document.class, node);
-                    result.add(doc);
-                    latch.countDown();
-                    return doc;
+                    try {
+                        Document doc = context.getTypeConverter().convertTo(Document.class,
node);
+                        result.add(doc);
+                        return doc;
+                    } finally {
+                        latch.countDown();
+                    }
                 }
             });
         }
@@ -363,7 +366,6 @@ public class XPathTest extends ContextTe
         // give time to convert concurrently
         assertTrue(latch.await(20, TimeUnit.SECONDS));
 
-        assertEquals(size, result.size());
         Iterator<Document> it = result.iterator();
         int count = 0;
         while (it.hasNext()) {



Mime
View raw message