[jboss-svn-commits] JBoss Common SVN: r4794 - arquillian/trunk/containers/jbossas-remote-6/src/main/java/org/jboss/arquillian/container/jbossas/remote_6.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jul 22 13:25:21 EDT 2010


Author: aslak
Date: 2010-07-22 13:25:21 -0400 (Thu, 22 Jul 2010)
New Revision: 4794

Modified:
   arquillian/trunk/containers/jbossas-remote-6/src/main/java/org/jboss/arquillian/container/jbossas/remote_6/JBossASRemoteContainer.java
Log:
ARQ-226 JBoss AS 6.0 M4 (JBAS-824) cause random test case failures due to issues with HDScanner/DeploymentManager. As a workaround; stop the HDScanner when the Arquillian Container connect to the server and start it again when we're done.


Modified: arquillian/trunk/containers/jbossas-remote-6/src/main/java/org/jboss/arquillian/container/jbossas/remote_6/JBossASRemoteContainer.java
===================================================================
--- arquillian/trunk/containers/jbossas-remote-6/src/main/java/org/jboss/arquillian/container/jbossas/remote_6/JBossASRemoteContainer.java	2010-07-22 00:15:22 UTC (rev 4793)
+++ arquillian/trunk/containers/jbossas-remote-6/src/main/java/org/jboss/arquillian/container/jbossas/remote_6/JBossASRemoteContainer.java	2010-07-22 17:25:21 UTC (rev 4794)
@@ -27,6 +27,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
 import javax.naming.InitialContext;
 
 import org.jboss.arquillian.protocol.servlet_3.ServletMethodExecutor;
@@ -81,6 +83,7 @@
                -1);
          httpFileServer.start();
          initDeploymentManager();
+         stopDeploymentScanner();
       } 
       catch (Exception e) 
       {
@@ -94,6 +97,7 @@
       {
          httpFileServer.stop(0);
          removeFailedUnDeployments();
+         startDeploymentScanner();
       } 
       catch (Exception e) 
       {
@@ -282,4 +286,24 @@
          destination.write(readBuffer, 0, bytesIn); 
       }
    }
+
+   /*
+    * JBoss AS 6.0 M4 has problems when using the ProfileService for deployment. Both the DeploymentManager and the HDScanner
+    * tried to deploy the same file. Since the HDScanner is lagging behind, it will undeploy what the DeploymentManager deployed and redeploy.
+    * 
+    *  Stop the HDScanner before we start to deploy, then start it again when we're done. 
+    */
+   private void startDeploymentScanner() throws Exception
+   {
+      ObjectName DEPLOYMNET_SCANNER = new ObjectName("jboss.deployment:flavor=URL,type=DeploymentScanner");
+      MBeanServerConnection adaptor = (MBeanServerConnection)new InitialContext().lookup("jmx/invoker/RMIAdaptor");
+      adaptor.invoke(DEPLOYMNET_SCANNER, "start", new Object[] {}, new String[]{});
+   }
+
+   private void stopDeploymentScanner() throws Exception
+   {
+      ObjectName DEPLOYMNET_SCANNER = new ObjectName("jboss.deployment:flavor=URL,type=DeploymentScanner");
+      MBeanServerConnection adaptor = (MBeanServerConnection)new InitialContext().lookup("jmx/invoker/RMIAdaptor");
+      adaptor.invoke(DEPLOYMNET_SCANNER, "stop", new Object[] {}, new String[]{});
+   }
 }



More information about the jboss-svn-commits mailing list