tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andygumbre...@apache.org
Subject svn commit: r1414734 - /openejb/trunk/openejb/server/openejb-client/src/test/java/org/apache/openejb/client/StickyConnectionStrategyIteratorTest.java
Date Wed, 28 Nov 2012 14:50:29 GMT
Author: andygumbrecht
Date: Wed Nov 28 14:50:28 2012
New Revision: 1414734

URL: http://svn.apache.org/viewvc?rev=1414734&view=rev
Log:
Fix test. Should not be checking order and only unique finds.

Modified:
    openejb/trunk/openejb/server/openejb-client/src/test/java/org/apache/openejb/client/StickyConnectionStrategyIteratorTest.java

Modified: openejb/trunk/openejb/server/openejb-client/src/test/java/org/apache/openejb/client/StickyConnectionStrategyIteratorTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/server/openejb-client/src/test/java/org/apache/openejb/client/StickyConnectionStrategyIteratorTest.java?rev=1414734&r1=1414733&r2=1414734&view=diff
==============================================================================
--- openejb/trunk/openejb/server/openejb-client/src/test/java/org/apache/openejb/client/StickyConnectionStrategyIteratorTest.java
(original)
+++ openejb/trunk/openejb/server/openejb-client/src/test/java/org/apache/openejb/client/StickyConnectionStrategyIteratorTest.java
Wed Nov 28 14:50:28 2012
@@ -21,8 +21,6 @@ import org.junit.Test;
 
 import java.net.URI;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
 
 /**
  * @version $Rev$ $Date$
@@ -62,28 +60,29 @@ public class StickyConnectionStrategyIte
             Assert.assertEquals(uri, iterable.iterator().next());
         }
 
-//        assertIteration(uris, iterable);
+        assertIteration(uris, iterable);
 
     }
 
     private void assertIteration(URI[] uris, Iterable<URI> iterable) {
-        List<URI> found = new ArrayList<URI>();
+        ArrayList<URI> found = new ArrayList<URI>();
 
         for (URI uri : iterable) {
-            found.add(uri);
+            if (!found.contains(uri)) found.add(uri);
         }
 
         Assert.assertEquals(uris.length, found.size());
+
         for (URI uri : uris) {
             Assert.assertTrue(found.contains(uri));
         }
 
-        Assert.assertTrue("Found: " + found + ", Expected: " + Arrays.asList(uris),
-                found.get(0).equals(uris[0]) &&
-                        found.get(1).equals(uris[1]) &&
-                        found.get(2).equals(uris[2]) &&
-                        found.get(3).equals(uris[3])
-        );
+//        Assert.assertTrue("Found: " + found + ", Expected: " + Arrays.asList(uris),
+//                found.get(0).equals(uris[0]) &&
+//                        found.get(1).equals(uris[1]) &&
+//                        found.get(2).equals(uris[2]) &&
+//                        found.get(3).equals(uris[3])
+//        );
     }
 
 



Mime
View raw message