[jboss-cvs] JBossAS SVN: r104939 - in projects/microcontainer/branches/Branch_2_0: kernel/src/test/java/org/jboss/test/kernel/config/support and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 18 12:46:09 EDT 2010


Author: kabir.khan at jboss.com
Date: 2010-05-18 12:46:09 -0400 (Tue, 18 May 2010)
New Revision: 104939

Added:
   projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/ControllerStateBean.java
   projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValue.java
   projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValueBean.java
   projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfTestCase.java
   projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfXMLTestCase.java
   projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForControllerState.xml
   projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForCustomValue.xml
Modified:
   projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigTestSuite.java
   projects/microcontainer/branches/Branch_2_0/pom.xml
Log:
[JBKERNEL-73] Port from trunk

Copied: projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/ControllerStateBean.java (from rev 98935, projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/config/support/ControllerStateBean.java)
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/ControllerStateBean.java	                        (rev 0)
+++ projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/ControllerStateBean.java	2010-05-18 16:46:09 UTC (rev 104939)
@@ -0,0 +1,46 @@
+/*
+* 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.kernel.config.support;
+
+import org.jboss.dependency.spi.ControllerState;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ControllerStateBean
+{
+   ControllerState state;
+
+   public ControllerState getState()
+   {
+      return state;
+   }
+
+   public void setState(ControllerState state)
+   {
+      this.state = state;
+   }
+   
+   
+}  

Copied: projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValue.java (from rev 98935, projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValue.java)
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValue.java	                        (rev 0)
+++ projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValue.java	2010-05-18 16:46:09 UTC (rev 104939)
@@ -0,0 +1,47 @@
+/*
+* 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.kernel.config.support;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class CustomValue
+{
+   String value;
+   
+   CustomValue(String value)
+   {
+      this.value = value;
+   }
+   
+   public static CustomValue valueOf(String value)
+   {
+      return new CustomValue(value);
+   }
+   
+   public String getValue()
+   {
+      return value;
+   }
+}

Copied: projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValueBean.java (from rev 98935, projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValueBean.java)
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValueBean.java	                        (rev 0)
+++ projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValueBean.java	2010-05-18 16:46:09 UTC (rev 104939)
@@ -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.kernel.config.support;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class CustomValueBean
+{
+   CustomValue value;
+
+   public CustomValue getValue()
+   {
+      return value;
+   }
+
+   public void setValue(CustomValue value)
+   {
+      this.value = value;
+   }
+}

Modified: projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigTestSuite.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigTestSuite.java	2010-05-18 16:23:33 UTC (rev 104938)
+++ projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigTestSuite.java	2010-05-18 16:46:09 UTC (rev 104939)
@@ -84,6 +84,8 @@
       suite.addTest(ValueFactoryTestCase.suite());
       suite.addTest(ValueFactoryXMLTestCase.suite());
       suite.addTest(ValueFactoryAnnotationTestCase.suite());
+      suite.addTest(ValueConverterValueOfTestCase.suite());
+      suite.addTest(ValueConverterValueOfXMLTestCase.suite());
       suite.addTest(ValueTrimTestCase.suite());
       suite.addTest(ValueTrimXMLTestCase.suite());
       suite.addTest(ValueTrimAnnotationTestCase.suite());

Copied: projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfTestCase.java (from rev 98935, projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfTestCase.java)
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfTestCase.java	                        (rev 0)
+++ projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfTestCase.java	2010-05-18 16:46:09 UTC (rev 104939)
@@ -0,0 +1,105 @@
+/*
+* 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.kernel.config.test;
+
+import java.util.HashSet;
+
+import junit.framework.Test;
+
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
+import org.jboss.beans.metadata.plugins.StringValueMetaData;
+import org.jboss.beans.metadata.spi.PropertyMetaData;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.config.KernelConfigurator;
+import org.jboss.test.kernel.config.support.ControllerStateBean;
+import org.jboss.test.kernel.config.support.CustomValueBean;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ValueConverterValueOfTestCase extends AbstractKernelConfigTest
+{
+   public ValueConverterValueOfTestCase(String name)
+   {
+      super(name);
+   }
+
+   public ValueConverterValueOfTestCase(String name, boolean xmltest)
+   {
+      super(name, xmltest);
+   }
+
+   public static Test suite()
+   {
+      return suite(ValueConverterValueOfTestCase.class);
+   }
+   
+   public void testValueOfForCustomValue() throws Throwable
+   {
+      CustomValueBean bean = valueOfForCustomValue();
+      assertNotNull(bean);
+      assertNotNull(bean.getValue());
+      assertEquals("Custom", bean.getValue().getValue());
+   }
+   
+   public void testValueOfForControllerState() throws Throwable
+   {
+      ControllerStateBean bean = valueOfForControllerState();
+      assertNotNull(bean);
+      assertNotNull(bean.getState());
+      assertEquals(ControllerState.CONFIGURED, bean.getState());
+   }
+   
+   protected CustomValueBean valueOfForCustomValue() throws Throwable
+   {
+      Kernel kernel = bootstrap();
+      KernelConfigurator configurator = kernel.getConfigurator();
+      
+      AbstractBeanMetaData bmd = new AbstractBeanMetaData(CustomValueBean.class.getName());
+      HashSet<PropertyMetaData> properties = new HashSet<PropertyMetaData>();
+      bmd.setProperties(properties);
+
+      AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("value", new StringValueMetaData("Custom"));
+      properties.add(pmd);
+      
+      return (CustomValueBean) instantiateAndConfigure(configurator, bmd);
+   }
+   
+   protected ControllerStateBean valueOfForControllerState() throws Throwable
+   {
+      Kernel kernel = bootstrap();
+      KernelConfigurator configurator = kernel.getConfigurator();
+      
+      AbstractBeanMetaData bmd = new AbstractBeanMetaData(ControllerStateBean.class.getName());
+      HashSet<PropertyMetaData> properties = new HashSet<PropertyMetaData>();
+      bmd.setProperties(properties);
+
+      AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("state", new StringValueMetaData("Configured"));
+      properties.add(pmd);
+      
+      return (ControllerStateBean) instantiateAndConfigure(configurator, bmd);
+   }
+}

Copied: projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfXMLTestCase.java (from rev 98935, projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfXMLTestCase.java)
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfXMLTestCase.java	                        (rev 0)
+++ projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfXMLTestCase.java	2010-05-18 16:46:09 UTC (rev 104939)
@@ -0,0 +1,58 @@
+/*
+* 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.kernel.config.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.kernel.config.support.ControllerStateBean;
+import org.jboss.test.kernel.config.support.CustomValueBean;
+import org.jboss.test.kernel.config.support.XMLUtil;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ValueConverterValueOfXMLTestCase extends ValueConverterValueOfTestCase
+{
+   public ValueConverterValueOfXMLTestCase(String name)
+   {
+      super(name, true);
+   }
+
+   public static Test suite()
+   {
+      return suite(ValueConverterValueOfXMLTestCase.class);
+   }
+   
+   protected CustomValueBean valueOfForCustomValue() throws Throwable
+   {
+      XMLUtil util = bootstrapXML(true);
+      return (CustomValueBean) util.getBean("CustomValueBean");
+   }
+   
+   protected ControllerStateBean valueOfForControllerState() throws Throwable
+   {
+      XMLUtil util = bootstrapXML(true);
+      return (ControllerStateBean) util.getBean("ControllerStateBean");
+   }
+}

Copied: projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForControllerState.xml (from rev 98935, projects/kernel/trunk/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForControllerState.xml)
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForControllerState.xml	                        (rev 0)
+++ projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForControllerState.xml	2010-05-18 16:46:09 UTC (rev 104939)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="ControllerStateBean" class="org.jboss.test.kernel.config.support.ControllerStateBean">
+      <property name="state">Configured</property>
+   </bean>
+</deployment>

Copied: projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForCustomValue.xml (from rev 98935, projects/kernel/trunk/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForCustomValue.xml)
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForCustomValue.xml	                        (rev 0)
+++ projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForCustomValue.xml	2010-05-18 16:46:09 UTC (rev 104939)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="CustomValueBean" class="org.jboss.test.kernel.config.support.CustomValueBean">
+      <property name="value">Custom</property>
+   </bean>
+</deployment>

Modified: projects/microcontainer/branches/Branch_2_0/pom.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/pom.xml	2010-05-18 16:23:33 UTC (rev 104938)
+++ projects/microcontainer/branches/Branch_2_0/pom.xml	2010-05-18 16:46:09 UTC (rev 104939)
@@ -39,7 +39,7 @@
     <version.jboss.vfs>2.1.3.SP1</version.jboss.vfs>
     <version.javassist>3.10.0.GA</version.javassist>
     <version.jboss.aop>2.1.0.CR3</version.jboss.aop>
-    <version.org.jboss.reflect>2.0.2.GA</version.org.jboss.reflect>
+    <version.org.jboss.reflect>2.0.3-SNAPSHOT</version.org.jboss.reflect>
     <version.org.jboss.mdr>2.0.2.GA</version.org.jboss.mdr>
     <version.org.jboss.test>1.1.1.GA</version.org.jboss.test>
     <version.junit>4.4</version.junit>




More information about the jboss-cvs-commits mailing list