[jboss-cvs] JBossAS SVN: r91107 - in projects/jboss-deployers/trunk: deployers-client-spi/src/main/java/org/jboss/deployers/client/spi and 14 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jul 10 12:10:21 EDT 2009


Author: kabir.khan at jboss.com
Date: 2009-07-10 12:10:20 -0400 (Fri, 10 Jul 2009)
New Revision: 91107

Added:
   projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/MissingAsynchronousDependency.java
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/support/
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/support/BeanWithDependency.java
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/support/TestControllerContext.java
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/test/
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/test/AsynchronousCheckCompleteTestCase.java
   projects/jboss-deployers/trunk/deployers-impl/src/test/resources/
   projects/jboss-deployers/trunk/deployers-impl/src/test/resources/build.xml
   projects/jboss-deployers/trunk/deployers-impl/src/test/resources/org/
   projects/jboss-deployers/trunk/deployers-impl/src/test/resources/org/jboss/
   projects/jboss-deployers/trunk/deployers-impl/src/test/resources/org/jboss/test/
   projects/jboss-deployers/trunk/deployers-impl/src/test/resources/org/jboss/test/deployers/
   projects/jboss-deployers/trunk/deployers-impl/src/test/resources/org/jboss/test/deployers/asynchronous/
   projects/jboss-deployers/trunk/deployers-impl/src/test/resources/org/jboss/test/deployers/asynchronous/test/
   projects/jboss-deployers/trunk/deployers-impl/src/test/resources/org/jboss/test/deployers/asynchronous/test/AsynchronousCheckCompleteTestCase.txt
Modified:
   projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/IncompleteDeployments.java
   projects/jboss-deployers/trunk/deployers-impl/pom.xml
   projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/deployers/DeployersImpl.java
   projects/jboss-deployers/trunk/pom.xml
Log:
[JBDEPLOY-204] Different error reporting for in progress asynchronous deployments

Modified: projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/IncompleteDeployments.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/IncompleteDeployments.java	2009-07-10 15:50:47 UTC (rev 91106)
+++ projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/IncompleteDeployments.java	2009-07-10 16:10:20 UTC (rev 91107)
@@ -239,7 +239,12 @@
          for (Map.Entry<String, Set<MissingDependency>> entry : contextsMissingDependencies.entrySet())
          {
             for (MissingDependency dependency : entry.getValue())
-               mergeRootCauses(rootCauses, dependency.getDependency(), dependency.getActualState());
+            {
+               if (dependency instanceof MissingAsynchronousDependency == false)
+               {
+                  mergeRootCauses(rootCauses, dependency.getDependency(), dependency.getActualState());
+               }
+            }
          }
       }
 
@@ -269,10 +274,18 @@
             buffer.append(String.format("  Deployment \"%s\" is missing the following dependencies:\n", name));
             for (MissingDependency dependency : entry.getValue())
             {
-               buffer.append(String.format("    Dependency \"%s\" (should be in state \"%s\", but is actually in state \"%s\")\n",
-                       dependency.getDependency(),
-                       dependency.getRequiredState(),
-                       dependency.getActualState()));
+               if (dependency instanceof MissingAsynchronousDependency)
+               {
+                  buffer.append(String.format("    Dependency \"%s\" (is currently being installed in a background thread)\n",
+                           dependency.getDependency()));
+               }
+               else
+               {
+                  buffer.append(String.format("    Dependency \"%s\" (should be in state \"%s\", but is actually in state \"%s\")\n",
+                          dependency.getDependency(),
+                          dependency.getRequiredState(),
+                          dependency.getActualState()));
+               }
             }
 
             // It is not a root cause if it has missing dependencies

Added: projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/MissingAsynchronousDependency.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/MissingAsynchronousDependency.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/MissingAsynchronousDependency.java	2009-07-10 16:10:20 UTC (rev 91107)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.deployers.client.spi;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MissingAsynchronousDependency extends MissingDependency
+{
+   private static final long serialVersionUID = 1L;
+
+   /**
+    * For serialization
+    */
+   public MissingAsynchronousDependency()
+   {
+   }
+
+   /**
+    * Create a new MissingDependency.
+    * 
+    * @param name the name
+    * @param dependency the dependency
+    * @param requiredState the required state
+    * @param actualState the actual state
+    */
+   public MissingAsynchronousDependency(String name, String dependency, String requiredState, String actualState)
+   {
+      super(name, dependency, requiredState, actualState);
+   }
+
+}

Modified: projects/jboss-deployers/trunk/deployers-impl/pom.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/pom.xml	2009-07-10 15:50:47 UTC (rev 91106)
+++ projects/jboss-deployers/trunk/deployers-impl/pom.xml	2009-07-10 16:10:20 UTC (rev 91107)
@@ -27,10 +27,51 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <!--configuration>
-          <testFailureIgnore>true</testFailureIgnore>
-        </configuration-->
+        <configuration>
+          <!-- skip>true</skip -->
+          <!--testFailureIgnore>true</testFailureIgnore-->
+          <excludes>
+            <exclude>org/jboss/test/deployers/asynchronous/**/*</exclude>
+          </excludes>
+        </configuration>
       </plugin>   	   
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.2</version>
+        <executions>
+          <execution>
+            <id>run-asynchronous-tests</id>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <phase>test</phase>
+            <configuration>
+              <tasks unless="maven.test.skip">
+                <property name="byteman.path" value="${maven.dependency.org.jboss.byteman.byteman.jar.path}"/>
+                <property name="report.dir" value="${project.build.directory}/surefire-reports"/>
+                <property name="testOutputDirectory" value="${project.build.testOutputDirectory}"/>
+
+                <ant antfile="${project.build.testOutputDirectory}/build.xml"  inheritrefs="true">
+                  <target name="asynchronous-tests"/>
+                </ant>
+              </tasks>
+            </configuration>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant-junit</artifactId>
+            <version>${version.ant.junit}</version>
+          </dependency>
+          <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${version.junit}</version>
+          </dependency>
+        </dependencies>
+      </plugin>
     </plugins>
   </build>
   
@@ -194,5 +235,10 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.jboss.byteman</groupId>
+      <artifactId>byteman</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>  
 </project>

Modified: projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/deployers/DeployersImpl.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/deployers/DeployersImpl.java	2009-07-10 15:50:47 UTC (rev 91106)
+++ projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/deployers/DeployersImpl.java	2009-07-10 16:10:20 UTC (rev 91107)
@@ -45,9 +45,11 @@
 import org.jboss.dependency.spi.ControllerStateModel;
 import org.jboss.dependency.spi.DependencyInfo;
 import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.dependency.spi.asynchronous.AsynchronousController;
 import org.jboss.deployers.client.spi.Deployment;
 import org.jboss.deployers.client.spi.IncompleteDeploymentException;
 import org.jboss.deployers.client.spi.IncompleteDeployments;
+import org.jboss.deployers.client.spi.MissingAsynchronousDependency;
 import org.jboss.deployers.client.spi.MissingDependency;
 import org.jboss.deployers.plugins.sort.DeployerSorter;
 import org.jboss.deployers.plugins.sort.DeployerSorterFactory;
@@ -880,6 +882,8 @@
    {
       if (context.getState().equals(ControllerState.ERROR))
          contextsInError.put(context.getName().toString(), getRootCause(context.getError()));
+      else if (isBeingInstalledAsynchronously(context))
+         return;
       else
       {
          Object contextName = context.getName();
@@ -902,7 +906,7 @@
                {
                   // some items might only set iDependOn later on
                   iDependOn = item.getIDependOn();
-
+                  boolean isAsynchInProgress = false;
                   String dependency;
                   ControllerContext other = null;
                   if (iDependOn == null)
@@ -918,6 +922,7 @@
                         actualStateString = "** NOT FOUND " + item.toHumanReadableString() + " **";
                      else
                      {
+                        isAsynchInProgress = isBeingInstalledAsynchronously(other);
                         actualState = other.getState();
                         actualStateString = actualState.getStateString();
                      }
@@ -930,7 +935,9 @@
                   if (actualState == null || states.isBeforeState(actualState, requiredState))
                   {
                      String requiredStateString = requiredState.getStateString();
-                     MissingDependency missing = new MissingDependency(name, dependency, requiredStateString, actualStateString);
+                     MissingDependency missing = isAsynchInProgress ?
+                           new MissingAsynchronousDependency(name, dependency, requiredStateString, actualStateString) :
+                              new MissingDependency(name, dependency, requiredStateString, actualStateString);
                      dependencies.add(missing);
                   }
                }
@@ -999,6 +1006,15 @@
          throw new IncompleteDeploymentException(incomplete);
    }
 
+   protected boolean isBeingInstalledAsynchronously(ControllerContext ctx)
+   {
+      if (controller instanceof AsynchronousController)
+      {
+         return ((AsynchronousController)controller).isAsynchronousInstallInProgress(ctx);
+      }
+      return false;
+   }
+   
    /**
     * Is context deployed.
     *

Added: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/support/BeanWithDependency.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/support/BeanWithDependency.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/support/BeanWithDependency.java	2009-07-10 16:10:20 UTC (rev 91107)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.deployers.asynchronous.support;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithDependency
+{
+   Object dependency;
+
+   public Object getDependency()
+   {
+      return dependency;
+   }
+
+   public void setDependency(Object dependency)
+   {
+      this.dependency = dependency;
+   }
+}

Added: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/support/TestControllerContext.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/support/TestControllerContext.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/support/TestControllerContext.java	2009-07-10 16:10:20 UTC (rev 91107)
@@ -0,0 +1,132 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.asynchronous.support;
+
+import java.util.HashMap;
+import java.util.concurrent.TimeUnit;
+
+import org.jboss.dependency.plugins.AbstractControllerContext;
+import org.jboss.dependency.plugins.AbstractControllerContextActions;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerMode;
+import org.jboss.dependency.spi.ControllerState;
+
+/**
+ * A TestControllerContext.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 62039 $
+ */
+public class TestControllerContext extends AbstractControllerContext
+{
+   private static final AbstractControllerContextActions actions;
+   
+   static
+   {
+      HashMap<ControllerState, ControllerContextAction> map = new HashMap<ControllerState, ControllerContextAction>();
+      map.put(ControllerState.DESCRIBED, new DescribeAction());
+      map.put(ControllerState.INSTANTIATED, new InstantiateAction());
+      map.put(ControllerState.CONFIGURED, new ConfigureAction());
+      map.put(ControllerState.CREATE, new CreateAction());
+      map.put(ControllerState.START, new StartAction());
+      map.put(ControllerState.INSTALLED, new InstallAction());
+      actions = new AbstractControllerContextActions(map);
+   }
+   
+   public TestControllerContext(String name, ControllerMode mode)
+   {
+      super(name, actions);
+      super.setMode(mode);
+   }
+   
+   public TestControllerContext(String name)
+   {
+      this(name, ControllerMode.AUTOMATIC);
+   }
+   
+   public static class DescribeAction implements ControllerContextAction
+   {
+      public void install(ControllerContext context) throws Throwable
+      {
+      }
+
+      public void uninstall(ControllerContext context)
+      {
+      }
+   }
+   
+   public static class InstantiateAction implements ControllerContextAction
+   {
+      public void install(ControllerContext context) throws Throwable
+      {
+      }
+
+      public void uninstall(ControllerContext context)
+      {
+      }
+   }
+   
+   public static class ConfigureAction implements ControllerContextAction
+   {
+      public void install(ControllerContext context) throws Throwable
+      {
+      }
+
+      public void uninstall(ControllerContext context)
+      {
+      }
+   }
+   
+   public static class CreateAction implements ControllerContextAction
+   {
+      public void install(ControllerContext context) throws Throwable
+      {
+      }
+
+      public void uninstall(ControllerContext context)
+      {
+      }
+   }
+   
+   public static class StartAction implements ControllerContextAction
+   {
+      public void install(ControllerContext context) throws Throwable
+      {
+      }
+
+      public void uninstall(ControllerContext context)
+      {
+      }
+   }
+   
+   public static class InstallAction implements ControllerContextAction
+   {
+      public void install(ControllerContext context) throws Throwable
+      {
+      }
+
+      public void uninstall(ControllerContext context)
+      {
+      }
+   }
+}

Added: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/test/AsynchronousCheckCompleteTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/test/AsynchronousCheckCompleteTestCase.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/asynchronous/test/AsynchronousCheckCompleteTestCase.java	2009-07-10 16:10:20 UTC (rev 91107)
@@ -0,0 +1,135 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.asynchronous.test;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Executors;
+
+import junit.framework.Test;
+
+import org.jboss.dependency.plugins.AbstractController;
+import org.jboss.dependency.plugins.AbstractDependencyItem;
+import org.jboss.dependency.spi.ControllerMode;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.client.spi.IncompleteDeploymentException;
+import org.jboss.deployers.client.spi.IncompleteDeployments;
+import org.jboss.deployers.client.spi.MissingAsynchronousDependency;
+import org.jboss.deployers.client.spi.MissingDependency;
+import org.jboss.deployers.plugins.deployers.DeployersImpl;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.Deployers;
+import org.jboss.deployers.spi.deployer.managed.ManagedObjectCreator;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
+import org.jboss.test.deployers.asynchronous.support.TestControllerContext;
+import org.jboss.test.deployers.main.test.AbstractMainDeployerTest;
+
+/**
+ * Check complete deployment test case.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AsynchronousCheckCompleteTestCase extends AbstractMainDeployerTest
+{
+   AbstractController controller;
+   
+   public AsynchronousCheckCompleteTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(AsynchronousCheckCompleteTestCase.class);
+   }
+
+   public void testAsynchronousContextInProgressNotReported() throws Throwable
+   {
+      controller = (AbstractController)getController();
+      controller.setExecutor(Executors.newFixedThreadPool(2));
+      
+      DeployerClient main = getMainDeployer();
+
+      TestControllerContext bean = new TestControllerContext("Bean");
+      bean.getDependencyInfo().addIDependOn(new AbstractDependencyItem("Bean", "Dependency", ControllerState.CONFIGURED, ControllerState.INSTALLED));
+      controller.install(bean);
+      
+      TestControllerContext dependency = new TestControllerContext("Dependency", ControllerMode.ASYNCHRONOUS);
+      controller.install(dependency);
+
+      Deployment dA = createSimpleDeployment("A");
+      main.addDeployment(dA);
+      
+      DeploymentUnit depUnit = ((MainDeployerStructure)main).getDeploymentUnit("A");
+      assertNotNull(depUnit);
+      depUnit.addControllerContextName("Bean");
+      depUnit.addControllerContextName("Dependency");
+      
+      main.process();
+      try
+      {
+         main.checkComplete(dA);
+         fail("Should not be complete");
+      }
+      catch (DeploymentException e)
+      {
+         assertInstanceOf(e, IncompleteDeploymentException.class);
+         IncompleteDeployments id = ((IncompleteDeploymentException)e).getIncompleteDeployments();
+         
+         assertTrue(id.getContextsInError() == null || id.getContextsInError().size() == 0);
+         assertTrue(id.getDeploymentsInError() == null || id.getDeploymentsInError().size() == 0);
+         assertTrue(id.getDeploymentsMissingDeployer() == null || id.getDeploymentsMissingDeployer().size() == 0);
+         
+         Map<String, Set<MissingDependency>> missingDeps = id.getContextsMissingDependencies();
+         assertEquals(1, missingDeps.size());
+         Set<MissingDependency> missing = missingDeps.get("Bean");
+         assertNotNull(missing);
+         assertEquals(1, missing.size());
+         MissingDependency dep = missing.toArray(new MissingDependency[1])[0];
+         assertNotNull(dep);
+         assertInstanceOf(dep, MissingAsynchronousDependency.class);
+         
+         String msg = e.getMessage();
+         assertTrue(0 > msg.indexOf("DEPLOYMENTS IN ERROR"));
+         e.printStackTrace();
+      }
+   }
+
+   protected Deployers createDeployers()
+   {
+      log.debug("createDeployers");
+      if (controller == null)
+      {
+         throw new IllegalStateException("Controller not initialised");
+      }
+      ManagedObjectCreator moc = createManagedObjectCreator();
+      System.out.println("createDeployers, moc: "+moc);
+      DeployersImpl di = new DeployersImpl(controller);
+      di.setMgtObjectCreator(moc);
+      return di;
+   }
+
+
+}

Added: projects/jboss-deployers/trunk/deployers-impl/src/test/resources/build.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/resources/build.xml	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/resources/build.xml	2009-07-10 16:10:20 UTC (rev 91107)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project>
+   <target name="asynchronous-tests">
+   	<mkdir dir="${report.dir}"/>
+      <antcall target="run-asynchronous-test" inheritrefs="true">
+         <param name="test" value="AsynchronousCheckCompleteTestCase"/>
+      </antcall>
+   </target>
+   
+   <target name="run-asynchronous-test">
+  	   <property name="bytemanScript" value="${testOutputDirectory}/org/jboss/test/deployers/asynchronous/test/${test}.txt"/>
+
+      <junit printsummary="yes" fork="true" haltonfailure="true" haltonerror="true">
+         <classpath>
+            <path refid="maven.test.classpath"/>
+        </classpath>
+        <jvmarg value="-javaagent:${byteman.path}=script:${bytemanScript}"/>
+        <sysproperty key="org.jboss.byteman.debug" value="true"/>
+        <formatter type="plain" usefile="true" extension=".txt" />
+        <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" usefile="true" extension=".xml" />
+        <test fork="yes" name="org.jboss.test.deployers.asynchronous.test.${test}" todir="${report.dir}"/>
+      </junit>
+   </target>
+</project>
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-impl/src/test/resources/org/jboss/test/deployers/asynchronous/test/AsynchronousCheckCompleteTestCase.txt
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/resources/org/jboss/test/deployers/asynchronous/test/AsynchronousCheckCompleteTestCase.txt	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/resources/org/jboss/test/deployers/asynchronous/test/AsynchronousCheckCompleteTestCase.txt	2009-07-10 16:10:20 UTC (rev 91107)
@@ -0,0 +1,21 @@
+RULE Wait for Complete in Dependency's ConfigureAction
+CLASS org.jboss.test.deployers.asynchronous.support.TestControllerContext$ConfigureAction 
+METHOD install
+AT EXIT
+BIND ctx:ControllerContext = $1
+IF TRUE
+DO debug("wait in ConfigureAction"),
+   waitFor("Complete", 10000),
+   debug("go!!!")
+ENDRULE
+
+RULE Signal Complete for Dependency once called check
+CLASS org.jboss.test.deployers.asynchronous.test.AsynchronousCheckCompleteTestCase
+METHOD testAsynchronousContextInProgressNotReported
+AT EXIT
+BIND NOTHING
+IF TRUE
+DO debug("signalling wake"),
+   signalWake("Complete", true),
+   debug("signalled!")
+ENDRULE

Modified: projects/jboss-deployers/trunk/pom.xml
===================================================================
--- projects/jboss-deployers/trunk/pom.xml	2009-07-10 15:50:47 UTC (rev 91106)
+++ projects/jboss-deployers/trunk/pom.xml	2009-07-10 16:10:20 UTC (rev 91107)
@@ -36,6 +36,8 @@
     <version.junit>4.4</version.junit>
     <version.javassist>3.10.0.GA</version.javassist>
     <version.stax.staxapi>1.0</version.stax.staxapi>
+    <version.ant.junit>1.6.5</version.ant.junit>
+   <version.jboss.byteman>1.0.2</version.jboss.byteman>
   </properties>
 
   <modules>
@@ -343,6 +345,12 @@
         <version>${version.junit}</version>
         <scope>test</scope>
       </dependency>
+      <dependency>
+        <groupId>org.jboss.byteman</groupId>
+        <artifactId>byteman</artifactId>
+        <version>${version.jboss.byteman}</version>
+        <scope>test</scope>
+      </dependency>
     </dependencies>
   </dependencyManagement>
 




More information about the jboss-cvs-commits mailing list