incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awojtun...@apache.org
Subject svn commit: r929346 - /incubator/aries/trunk/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java
Date Wed, 31 Mar 2010 00:23:36 GMT
Author: awojtuniak
Date: Wed Mar 31 00:23:36 2010
New Revision: 929346

URL: http://svn.apache.org/viewvc?rev=929346&view=rev
Log:
PermissionAdminMBeanTest - adding wait for MBean in test setup

Modified:
    incubator/aries/trunk/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java

Modified: incubator/aries/trunk/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java?rev=929346&r1=929345&r2=929346&view=diff
==============================================================================
--- incubator/aries/trunk/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java
(original)
+++ incubator/aries/trunk/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java
Wed Mar 31 00:23:36 2010
@@ -24,7 +24,11 @@ import static org.ops4j.pax.swissbox.tin
 
 import java.io.IOException;
 
+import javax.management.InstanceNotFoundException;
+import javax.management.ObjectName;
+
 import org.apache.aries.jmx.AbstractIntegrationTest;
+import org.junit.Before;
 import org.junit.Test;
 import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
@@ -65,6 +69,24 @@ public class PermissionAdminMBeanTest ex
         options = updateOptions(options);
         return options;
     }
+    
+    @Before
+    public void doSetUp() throws Exception {
+        super.setUp();
+        int i = 0;
+        while (true) {
+            try {
+                mbeanServer.getObjectInstance(new ObjectName(PermissionAdminMBean.OBJECTNAME));
+                break;
+            } catch (InstanceNotFoundException e) {
+                if (i == 5) {
+                    throw new Exception("PermissionAdminMBean not available after waiting
5 seconds");
+                }
+            }
+            i++;
+            Thread.sleep(1000);
+        }
+    }
 
     @Test
     public void testMBeanInterface() throws IOException {



Mime
View raw message