[jboss-cvs] JBossAS SVN: r65017 - in projects/microcontainer/trunk: kernel/src/resources/tests/xml-test/org/jboss/test/kernel/annotations/test/override and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 3 12:35:26 EDT 2007


Author: alesj
Date: 2007-09-03 12:35:26 -0400 (Mon, 03 Sep 2007)
New Revision: 65017

Added:
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/JavaBeanValueAnnotationPlugin.java
   projects/microcontainer/trunk/kernel/src/resources/tests/xml-test/org/jboss/test/kernel/annotations/test/override/testLifecycleOverride.xml
   projects/microcontainer/trunk/kernel/src/resources/tests/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackWrongOrder1.xml
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/test/override/FactoryAnnotationOverrideXMLTestCase.java
   projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/metadata/MetaDataTestSuite.java
Log:
Reinstantiate previously removed files.

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/JavaBeanValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/JavaBeanValueAnnotationPlugin.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/JavaBeanValueAnnotationPlugin.java	2007-09-03 16:35:26 UTC (rev 65017)
@@ -0,0 +1,76 @@
+/*
+* 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.kernel.plugins.annotations;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
+import org.jboss.beans.metadata.plugins.annotations.JavaBeanValue;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.config.plugins.property.PropertyConfiguration;
+import org.jboss.config.spi.Configuration;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class JavaBeanValueAnnotationPlugin extends PropertyAnnotationPlugin<JavaBeanValue>
+{
+   static JavaBeanValueAnnotationPlugin INSTANCE = new JavaBeanValueAnnotationPlugin();
+
+   /** The configuration */
+   private static Configuration configuration;
+
+   static
+   {
+      configuration = AccessController.doPrivileged(new PrivilegedAction<Configuration>()
+      {
+         public Configuration run()
+         {
+            return new PropertyConfiguration();
+         }
+      });
+   }
+
+   public JavaBeanValueAnnotationPlugin()
+   {
+      super(JavaBeanValue.class);
+   }
+
+   public ValueMetaData createValueMetaData(JavaBeanValue annotation)
+   {
+      String className = annotation.value();
+      if (isAttributePresent(className) == false)
+         throw new IllegalArgumentException("Javabean class must be set: " + annotation);
+
+      try
+      {
+         BeanInfo beanInfo = configuration.getBeanInfo(className, null);
+         return new AbstractValueMetaData(beanInfo.newInstance());
+      }
+      catch (Throwable t)
+      {
+         throw new IllegalArgumentException("Exception while creating javabean: " + t);
+      }
+   }
+}

Added: projects/microcontainer/trunk/kernel/src/resources/tests/xml-test/org/jboss/test/kernel/annotations/test/override/testLifecycleOverride.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/tests/xml-test/org/jboss/test/kernel/annotations/test/override/testLifecycleOverride.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/tests/xml-test/org/jboss/test/kernel/annotations/test/override/testLifecycleOverride.xml	2007-09-03 16:35:26 UTC (rev 65017)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Tester" class="org.jboss.test.kernel.annotations.support.LifecycleAnnotationTester">
+      <create method="fromXMLCreate"/>
+      <start method="fromXMLStart"/>
+      <stop method="fromXMLStop"/>
+      <destroy method="fromXMLDestroy"/>
+   </bean>
+
+</deployment>

Added: projects/microcontainer/trunk/kernel/src/resources/tests/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackWrongOrder1.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/tests/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackWrongOrder1.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/tests/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackWrongOrder1.xml	2007-09-03 16:35:26 UTC (rev 65017)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="Name2" class="org.jboss.test.kernel.dependency.support.SimpleBeanImpl">
+      <property name="string">String1</property>
+   </bean>
+</deployment>

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/test/override/FactoryAnnotationOverrideXMLTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/test/override/FactoryAnnotationOverrideXMLTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/test/override/FactoryAnnotationOverrideXMLTestCase.java	2007-09-03 16:35:26 UTC (rev 65017)
@@ -0,0 +1,40 @@
+/*
+* 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.annotations.test.override;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class FactoryAnnotationOverrideXMLTestCase extends FactoryAnnotationOverrideTestCase
+{
+   public FactoryAnnotationOverrideXMLTestCase(String name) throws Throwable
+   {
+      super(name, true);
+   }
+
+   public static Test suite()
+   {
+      return suite(FactoryAnnotationOverrideXMLTestCase.class);
+   }
+}

Added: projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/metadata/MetaDataTestSuite.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/metadata/MetaDataTestSuite.java	                        (rev 0)
+++ projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/metadata/MetaDataTestSuite.java	2007-09-03 16:35:26 UTC (rev 65017)
@@ -0,0 +1,49 @@
+/*
+* 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.bundle.metadata;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * MetaData Test Suite.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MetaDataTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("MetaData Tests");
+
+      suite.addTest(HeaderValuesTestCase.suite());
+      suite.addTest(VersionRangeTestCase.suite());
+
+      return suite;
+   }
+}




More information about the jboss-cvs-commits mailing list