geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r893406 - /geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/test/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintMetadataTest.java
Date Wed, 23 Dec 2009 05:09:37 GMT
Author: gawor
Date: Wed Dec 23 05:09:36 2009
New Revision: 893406

URL: http://svn.apache.org/viewvc?rev=893406&view=rev
Log:
compare as sets since the order might be different between jvms

Modified:
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/test/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintMetadataTest.java

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/test/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintMetadataTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/test/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintMetadataTest.java?rev=893406&r1=893405&r2=893406&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/test/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintMetadataTest.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/test/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintMetadataTest.java
Wed Dec 23 05:09:36 2009
@@ -191,9 +191,7 @@
     @Test
     public void nomalGetComponentIds() throws Exception {
         final long serviceId = 7117;
-        final Set cidset = new HashSet();
-        final String [] cidarray = new String[]{".component-1", ".component-2", ".component-5"};
-        cidset.addAll(Arrays.asList(cidarray));
+        final Set cidset = getAsSet(new String[]{".component-1", ".component-2", ".component-5"});
         
         mockery.checking(new Expectations(){
             {
@@ -209,7 +207,8 @@
                 will(returnValue(cidset));
             }
         });
-        assertArrayEquals(cidarray, metadata.getComponentIds(serviceId));
+        
+        assertEquals(cidset, getAsSet(metadata.getComponentIds(serviceId)));
     }
 
     @Test
@@ -340,4 +339,11 @@
             assertTrue(ex instanceof IllegalArgumentException);
         }
     }
+
+    private Set getAsSet(String[] data) {
+        Set dataSet = new HashSet();
+        dataSet.addAll(Arrays.asList(data));
+        return dataSet;
+    }
+        
 }



Mime
View raw message