[jboss-cvs] JBossAS SVN: r83145 - in projects/microcontainer/trunk/kernel/src/test: java/org/jboss/test/kernel/deployment/test and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 21 07:04:37 EST 2009


Author: alesj
Date: 2009-01-21 07:04:37 -0500 (Wed, 21 Jan 2009)
New Revision: 83145

Added:
   projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean.java
   projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/RealTM.java
   projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SecondBean.java
   projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.java
   projects/microcontainer/trunk/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xml
Modified:
   projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java
Log:
Mobicents transitive beans test.

Added: projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean.java	2009-01-21 12:04:37 UTC (rev 83145)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class FirstBean
+{
+   private RealTM tm;
+   private boolean flag;
+
+   public RealTM getTm()
+   {
+      return tm;
+   }
+
+   public void setTm(RealTM tm)
+   {
+      // tm == null means we're uniconfiguring
+      // the flag should be there from SecondBean's uninstall
+      if (tm == null && flag == false)
+         throw new IllegalArgumentException("Should be marked from SecondBean");
+
+      this.tm = tm;
+   }
+
+   public void markSecondUninstall()
+   {
+      flag = true;
+   }
+}
\ No newline at end of file

Added: projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/RealTM.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/RealTM.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/RealTM.java	2009-01-21 12:04:37 UTC (rev 83145)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class RealTM
+{
+}

Added: projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SecondBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SecondBean.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SecondBean.java	2009-01-21 12:04:37 UTC (rev 83145)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class SecondBean
+{
+   private FirstBean firstBean;
+
+   public FirstBean getFirstBean()
+   {
+      return firstBean;
+   }
+
+   public void setFirstBean(FirstBean firstBean)
+   {
+      this.firstBean = firstBean;
+   }
+}
\ No newline at end of file

Modified: projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java	2009-01-21 10:00:48 UTC (rev 83144)
+++ projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java	2009-01-21 12:04:37 UTC (rev 83145)
@@ -74,6 +74,7 @@
       suite.addTest(AliasInjectTestCase.suite());
       suite.addTest(GetInstanceTestCase.suite());
       suite.addTest(NullifyTestCase.suite());
+      suite.addTest(TransitiveBeansTestCase.suite());
       // bean container tests
       suite.addTest(BeanContainerUsageTestCase.suite());
       suite.addTest(BeanContainerUsageMDTestCase.suite());

Copied: projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.java (from rev 82467, projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.java)
===================================================================
--- projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.java	2009-01-21 12:04:37 UTC (rev 83145)
@@ -0,0 +1,54 @@
+/*
+* 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.kernel.deployment.test;
+
+import junit.framework.Test;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+import org.jboss.dependency.spi.ControllerState;
+
+/**
+ * TransitiveBeansTestCase
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class TransitiveBeansTestCase extends MicrocontainerTest
+{
+   public TransitiveBeansTestCase(String name) throws Throwable
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(TransitiveBeansTestCase.class);
+   }
+
+   public void testTransitiveShutdown() throws Throwable
+   {
+      KernelControllerContext tm = getControllerContext("RealTM");
+      undeploy(tm);
+      // we're not in error, from possible unconfigure exception
+      KernelControllerContext firstBean = getControllerContext("FirstBean", ControllerState.INSTANTIATED);
+      assertNotNull(firstBean);
+   }
+}
\ No newline at end of file


Property changes on: projects/microcontainer/trunk/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: projects/microcontainer/trunk/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xml (from rev 82467, projects/microcontainer/trunk/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.xml)
===================================================================
--- projects/microcontainer/trunk/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xml	2009-01-21 12:04:37 UTC (rev 83145)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="RealTM" class="org.jboss.test.kernel.deployment.support.RealTM"/>
+
+  <bean name="FirstBean" class="org.jboss.test.kernel.deployment.support.FirstBean">
+    <property name="tm"><inject bean="RealTM"/></property>
+  </bean>
+
+  <bean name="SecondBean" class="org.jboss.test.kernel.deployment.support.SecondBean">
+    <property name="firstBean"><inject bean="FirstBean"/></property>
+    <uninstall method="markSecondUninstall" bean="FirstBean"/>
+  </bean>
+
+</deployment>


Property changes on: projects/microcontainer/trunk/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xml
___________________________________________________________________
Name: svn:mergeinfo
   + 




More information about the jboss-cvs-commits mailing list