[Jboss-cvs] JBossAS SVN: r55945 - in projects/microcontainer/trunk/kernel/src: resources/org/jboss/test/kernel/controller/test tests/org/jboss/test/kernel/controller/test tests/org/jboss/test/kernel/inject/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 15 07:24:35 EDT 2006


Author: adrian at jboss.org
Date: 2006-08-15 07:24:28 -0400 (Tue, 15 Aug 2006)
New Revision: 55945

Added:
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase_bad.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase_good.xml
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase.java
Modified:
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test/ControllerTestSuite.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/inject/test/PropertyContextualInjectionTestCase.java
Log:
Add a test for redeploying after an error.

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase_bad.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase_bad.xml	2006-08-15 11:22:44 UTC (rev 55944)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase_bad.xml	2006-08-15 11:24:28 UTC (rev 55945)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="Name1" class="TYPEDOESNOTEXIST"/>
+</deployment>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase_good.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase_good.xml	2006-08-15 11:22:44 UTC (rev 55944)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase_good.xml	2006-08-15 11:24:28 UTC (rev 55945)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="Name1" class="java.lang.Object"/>
+</deployment>

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test/ControllerTestSuite.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test/ControllerTestSuite.java	2006-08-15 11:22:44 UTC (rev 55944)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test/ControllerTestSuite.java	2006-08-15 11:24:28 UTC (rev 55945)
@@ -44,6 +44,7 @@
 
       suite.addTest(AccessControlTestCase.suite());
       suite.addTest(NoInstantiateTestCase.suite());
+      suite.addTest(RedeployAfterErrorTestCase.suite());
       
       return suite;
    }

Added: 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	2006-08-15 11:22:44 UTC (rev 55944)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase.java	2006-08-15 11:24:28 UTC (rev 55945)
@@ -0,0 +1,75 @@
+/*
+* 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.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;
+
+/**
+ * RedeployAfterErrorTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class RedeployAfterErrorTestCase extends AbstractControllerTest
+{
+   public static Test suite()
+   {
+      return suite(RedeployAfterErrorTestCase.class);
+   }
+
+   public RedeployAfterErrorTestCase(String name) throws Throwable
+   {
+      super(name);
+   }
+
+   public void testRedeployAfterError() throws Throwable
+   {
+      KernelDeployment deployment = deploy("RedeployAfterErrorTestCase_bad.xml");
+      try
+      {
+         ControllerContext context = getControllerContext("Name1", null);
+         assertEquals(ControllerState.ERROR, context.getState());
+         checkThrowable(ClassNotFoundException.class, context.getError());
+      }
+      finally
+      {
+         undeploy(deployment);
+      }
+
+      validate();
+      
+      deployment = deploy("RedeployAfterErrorTestCase_good.xml");
+      try
+      {
+         validate();
+         assertNotNull(getBean("Name1"));
+      }
+      finally
+      {
+         undeploy(deployment);
+      }
+   }
+}
\ No newline at end of file

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/inject/test/PropertyContextualInjectionTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/inject/test/PropertyContextualInjectionTestCase.java	2006-08-15 11:22:44 UTC (rev 55944)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/inject/test/PropertyContextualInjectionTestCase.java	2006-08-15 11:24:28 UTC (rev 55945)
@@ -49,7 +49,7 @@
 
    public void testContextualInjection() throws Throwable
    {
-//      enableTrace("org.jboss.kernel");
+      enableTrace("org.jboss.kernel.plugins.dependency");
 //      enableTrace("org.jboss.dependency");
       for(int i = 0; i < PropertyContextualInjectionTestCase.PREFIX.length; i++)
       {




More information about the jboss-cvs-commits mailing list