[jboss-cvs] JBossAS SVN: r64351 - in projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config: test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jul 30 11:25:15 EDT 2007
Author: alesj
Date: 2007-07-30 11:25:15 -0400 (Mon, 30 Jul 2007)
New Revision: 64351
Added:
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamArrayConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamCollectionConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamCompConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamIntConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamListConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamMapConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamNullConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamPropertiesConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamSetConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/SimpleConstructorAnnBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/InstantiateAnnotationTestCase.java
Modified:
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/AbstractKernelConfigTest.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/ConfigTestSuite.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/InstantiateTestCase.java
Log:
Instantiate tests.
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamArrayConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamArrayConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamArrayConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,53 @@
+/*
+* 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.config.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+import org.jboss.beans.metadata.plugins.annotations.ArrayValue;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParamArrayConstructorAnnBean extends SimpleBean
+{
+ public ParamArrayConstructorAnnBean()
+ {
+ }
+
+ @Constructor
+ public ParamArrayConstructorAnnBean(
+ @ArrayValue(
+ elementClass = "java.lang.String",
+ value={
+ @Value(string = @StringValue("1")),
+ @Value(string = @StringValue("2"))
+ }
+ )
+ String[] collection)
+ {
+ super(collection);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamCollectionConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamCollectionConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamCollectionConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,55 @@
+/*
+* 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.config.support;
+
+import java.util.Collection;
+
+import org.jboss.beans.metadata.plugins.annotations.CollectionValue;
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParamCollectionConstructorAnnBean extends SimpleBean
+{
+ public ParamCollectionConstructorAnnBean()
+ {
+ }
+
+ @Constructor
+ public ParamCollectionConstructorAnnBean(
+ @CollectionValue(
+ elementClass = "java.lang.String",
+ value={
+ @Value(string = @StringValue("1")),
+ @Value(string = @StringValue("2"))
+ }
+ )
+ Collection collection)
+ {
+ super(collection);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamCompConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamCompConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamCompConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,43 @@
+/*
+* 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.config.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParamCompConstructorAnnBean extends SimpleBean
+{
+ public ParamCompConstructorAnnBean()
+ {
+ }
+
+ @Constructor
+ public ParamCompConstructorAnnBean(@StringValue(value = "12", type="java.lang.Integer") Comparable comparable)
+ {
+ super(comparable);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,43 @@
+/*
+* 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.config.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParamConstructorAnnBean extends SimpleBean
+{
+ public ParamConstructorAnnBean()
+ {
+ }
+
+ @Constructor
+ public ParamConstructorAnnBean(@StringValue("Constructor Value") String string)
+ {
+ super(string);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamIntConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamIntConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamIntConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,43 @@
+/*
+* 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.config.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParamIntConstructorAnnBean extends SimpleBean
+{
+ public ParamIntConstructorAnnBean()
+ {
+ }
+
+ @Constructor
+ public ParamIntConstructorAnnBean(@StringValue("7") Integer string)
+ {
+ super(string);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamListConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamListConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamListConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,55 @@
+/*
+* 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.config.support;
+
+import java.util.List;
+
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.ListValue;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParamListConstructorAnnBean extends SimpleBean
+{
+ public ParamListConstructorAnnBean()
+ {
+ }
+
+ @Constructor
+ public ParamListConstructorAnnBean(
+ @ListValue(
+ elementClass = "java.lang.String",
+ value={
+ @Value(string = @StringValue("1")),
+ @Value(string = @StringValue("2"))
+ }
+ )
+ List collection)
+ {
+ super(collection);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamMapConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamMapConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamMapConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,59 @@
+/*
+* 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.config.support;
+
+import java.util.Map;
+
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.EntryValue;
+import org.jboss.beans.metadata.plugins.annotations.MapValue;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParamMapConstructorAnnBean extends SimpleBean
+{
+ public ParamMapConstructorAnnBean()
+ {
+ }
+
+ @Constructor
+ public ParamMapConstructorAnnBean(
+ @MapValue(
+ keyClass = "java.lang.String",
+ valueClass = "java.lang.String",
+ value = {
+ @EntryValue(
+ key = @Value(string = @StringValue("1")),
+ value = @Value(string = @StringValue("2"))
+ )
+ }
+ )
+ Map collection)
+ {
+ super(collection);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamNullConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamNullConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamNullConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,43 @@
+/*
+* 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.config.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.NullValue;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParamNullConstructorAnnBean extends SimpleBean
+{
+ public ParamNullConstructorAnnBean()
+ {
+ }
+
+ @Constructor
+ public ParamNullConstructorAnnBean(@NullValue String string)
+ {
+ super(string);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamPropertiesConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamPropertiesConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamPropertiesConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,60 @@
+/*
+* 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.config.support;
+
+import java.util.Hashtable;
+
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.EntryValue;
+import org.jboss.beans.metadata.plugins.annotations.MapValue;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParamPropertiesConstructorAnnBean extends SimpleBean
+{
+ public ParamPropertiesConstructorAnnBean()
+ {
+ }
+
+ @Constructor
+ public ParamPropertiesConstructorAnnBean(
+ @MapValue(
+ clazz="java.util.Properties",
+ keyClass = "java.lang.String",
+ valueClass = "java.lang.String",
+ value = {
+ @EntryValue(
+ key = @Value(string = @StringValue("1")),
+ value = @Value(string = @StringValue("2"))
+ )
+ }
+ )
+ Hashtable collection)
+ {
+ super(collection);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamSetConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamSetConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/ParamSetConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -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.config.support;
+
+import java.util.Set;
+
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.SetValue;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ParamSetConstructorAnnBean extends SimpleBean
+{
+ public ParamSetConstructorAnnBean()
+ {
+ }
+
+ @Constructor
+ public ParamSetConstructorAnnBean(
+ @SetValue(
+ elementClass = "java.lang.String",
+ value={
+ @Value(string = @StringValue("1"))
+ }
+ )
+ Set collection)
+ {
+ super(collection);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/SimpleConstructorAnnBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/SimpleConstructorAnnBean.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/support/SimpleConstructorAnnBean.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,43 @@
+/*
+* 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.config.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+
+/**
+ * A simple annotated bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SimpleConstructorAnnBean extends SimpleBean
+{
+ @Constructor
+ public SimpleConstructorAnnBean()
+ {
+ super();
+ }
+
+ public SimpleConstructorAnnBean(String string)
+ {
+ super(string);
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/AbstractKernelConfigTest.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/AbstractKernelConfigTest.java 2007-07-30 14:54:00 UTC (rev 64350)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/AbstractKernelConfigTest.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -92,6 +92,11 @@
return result;
}
+ protected Object instantiate(BeanMetaData metaData) throws Throwable
+ {
+ return instantiate(bootstrap().getController(), metaData);
+ }
+
protected Object instantiate(KernelController controller, BeanMetaData metaData) throws Throwable
{
metaData.setMode(ControllerMode.AUTOMATIC);
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/ConfigTestSuite.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/ConfigTestSuite.java 2007-07-30 14:54:00 UTC (rev 64350)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/ConfigTestSuite.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -44,6 +44,7 @@
suite.addTest(InstantiateTestCase.suite());
suite.addTest(InstantiateXMLTestCase.suite());
+ suite.addTest(InstantiateAnnotationTestCase.suite());
suite.addTest(FactoryTestCase.suite());
suite.addTest(FactoryXMLTestCase.suite());
suite.addTest(ConfigureAttributeFromObjectTestCase.suite());
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/InstantiateAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/InstantiateAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/InstantiateAnnotationTestCase.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -0,0 +1,162 @@
+/*
+* 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.config.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.test.kernel.config.support.ParamArrayConstructorAnnBean;
+import org.jboss.test.kernel.config.support.ParamCollectionConstructorAnnBean;
+import org.jboss.test.kernel.config.support.ParamCompConstructorAnnBean;
+import org.jboss.test.kernel.config.support.ParamConstructorAnnBean;
+import org.jboss.test.kernel.config.support.ParamIntConstructorAnnBean;
+import org.jboss.test.kernel.config.support.ParamListConstructorAnnBean;
+import org.jboss.test.kernel.config.support.ParamMapConstructorAnnBean;
+import org.jboss.test.kernel.config.support.ParamNullConstructorAnnBean;
+import org.jboss.test.kernel.config.support.ParamPropertiesConstructorAnnBean;
+import org.jboss.test.kernel.config.support.ParamSetConstructorAnnBean;
+import org.jboss.test.kernel.config.support.SimpleBean;
+import org.jboss.test.kernel.config.support.SimpleConstructorAnnBean;
+
+/**
+ * Instantiation Annotation Test Case.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class InstantiateAnnotationTestCase extends InstantiateTestCase
+{
+ public static Test suite()
+ {
+ return suite(InstantiateAnnotationTestCase.class);
+ }
+
+ public InstantiateAnnotationTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testSimpleInstantiateFromBeanInfo() throws Throwable
+ {
+ // No Annotation equivalent
+ }
+
+ protected SimpleBean simpleInstantiateFromBeanMetaData() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", SimpleConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ protected SimpleBean parameterInstantiateFromBeanMetaData() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ protected SimpleBean parameterInstantiateFromNull() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamNullConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ protected SimpleBean parameterInstantiateWithTypeOverride() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamIntConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ protected SimpleBean parameterInstantiateViaInterfaceWithTypeOverride() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamCompConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ protected SimpleBean parameterInstantiateWithCollection() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamCollectionConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ protected SimpleBean parameterInstantiateWithList() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamListConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ protected SimpleBean parameterInstantiateWithSet() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamSetConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ protected SimpleBean parameterInstantiateWithArray() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamArrayConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ protected SimpleBean parameterInstantiateWithMap() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamMapConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ protected SimpleBean parameterInstantiateWithProperties() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamPropertiesConstructorAnnBean.class.getName());
+ return (SimpleBean)instantiate(builder.getBeanMetaData());
+ }
+
+ public void testValueInstantiateFromValue() throws Throwable
+ {
+ // Not really meaningful for Annotations
+ }
+
+ public void testValueInstantiateFromCollection() throws Throwable
+ {
+ // Not really meaningful for Annotations
+ }
+
+ public void testValueInstantiateFromList() throws Throwable
+ {
+ // Not really meaningful for Annotations
+ }
+
+ public void testValueInstantiateFromSet() throws Throwable
+ {
+ // Not really meaningful for Annotations
+ }
+
+ public void testValueInstantiateFromArray() throws Throwable
+ {
+ // Not really meaningful for Annotations
+ }
+
+ public void testValueInstantiateFromObject() throws Throwable
+ {
+ // Not really meaningful for Annotations
+ }
+
+ public void testConstructorDoesNotExist() throws Throwable
+ {
+ // No Annotation equivalent
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/InstantiateTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/InstantiateTestCase.java 2007-07-30 14:54:00 UTC (rev 64350)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/InstantiateTestCase.java 2007-07-30 15:25:15 UTC (rev 64351)
@@ -178,7 +178,7 @@
{
SimpleBean bean = parameterInstantiateViaInterfaceWithTypeOverride();
assertEquals("java.lang.Comparable:java.lang.Integer:12", bean.getConstructorUsed());
- assertEquals(new Integer(12), bean.getAnObject());
+ assertEquals(12, bean.getAnObject());
}
protected SimpleBean parameterInstantiateViaInterfaceWithTypeOverride() throws Throwable
More information about the jboss-cvs-commits
mailing list