[jboss-cvs] JBossAS SVN: r69974 - projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 20 08:01:42 EST 2008


Author: alesj
Date: 2008-02-20 08:01:42 -0500 (Wed, 20 Feb 2008)
New Revision: 69974

Modified:
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase.java
Log:
Testing change usage.

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase.java	2008-02-20 11:52:35 UTC (rev 69973)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase.java	2008-02-20 13:01:42 UTC (rev 69974)
@@ -22,14 +22,15 @@
 package org.jboss.test.kernel.controller.test;
 
 import junit.framework.Test;
-
 import org.jboss.dependency.spi.ControllerContext;
 import org.jboss.dependency.spi.ControllerState;
 import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
 
 /**
  * RedeployAfterErrorTestCase.
- * 
+ *
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 1.1 $
  */
@@ -60,7 +61,7 @@
       }
 
       validate();
-      
+
       deployment = deploy("RedeployAfterErrorTestCase_good.xml");
       try
       {
@@ -72,4 +73,29 @@
          undeploy(deployment);
       }
    }
+
+   public void testChangeUsage() throws Throwable
+   {
+      KernelDeployment deployment = deploy("RedeployAfterErrorTestCase_bad.xml");
+      try
+      {
+         KernelControllerContext context = getControllerContext("Name1", null);
+         assertEquals(ControllerState.ERROR, context.getState());
+         checkThrowable(ClassNotFoundException.class, context.getError());
+
+         // a hacky fix, but the point is to get the error away :-)
+         AbstractBeanMetaData bmd = (AbstractBeanMetaData)context.getBeanMetaData();
+         bmd.setBean(Object.class.getName());
+
+         // we suspect the error was resolved, let's try to install
+         change(context, ControllerState.INSTALLED);
+
+         // nope, still in error
+         assertEquals(ControllerState.ERROR, context.getState());
+      }
+      finally
+      {
+         undeploy(deployment);
+      }
+   }
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list