[jboss-cvs] JBossAS SVN: r60371 - in projects/microcontainer/trunk: container/src/resources and 15 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Feb 7 06:48:07 EST 2007
Author: alesj
Date: 2007-02-07 06:48:07 -0500 (Wed, 07 Feb 2007)
New Revision: 60371
Added:
projects/microcontainer/trunk/container/src/resources/org/
projects/microcontainer/trunk/container/src/resources/org/jboss/
projects/microcontainer/trunk/container/src/resources/org/jboss/test/
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestAmbiguityInt.xml
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestAmbiguityString.xml
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure.xml
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20.xml
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtor.xml
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClass.xml
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClassAndParams.xml
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorFactory.xml
projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestInstantiate.xml
projects/microcontainer/trunk/container/src/resources/schema/
projects/microcontainer/trunk/container/src/resources/schema/javabean_1_0.xsd
projects/microcontainer/trunk/container/src/resources/schema/javabean_2_0.xsd
projects/microcontainer/trunk/container/src/tests/org/jboss/test/ioc/
projects/microcontainer/trunk/container/src/tests/org/jboss/test/ioc/test/
projects/microcontainer/trunk/container/src/tests/org/jboss/test/ioc/test/AbstractIoCTest.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/ioc/test/IoCTestDelegate.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/AmbiguityBean.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/SimpleBean.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/SimpleBeanFactory.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/AbstractJavaBeanTest.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/AmbiguityTestCase.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/InstantiateTestCase.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/JavaBeanTestDelegate.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/JavaBeanTestSuite.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/PropertyTestCase.java
Removed:
projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/javabean/
projects/microcontainer/trunk/kernel/src/resources/schema/javabean_1_0.xsd
projects/microcontainer/trunk/kernel/src/resources/schema/javabean_2_0.xsd
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/
Modified:
projects/microcontainer/trunk/container/build-test.xml
projects/microcontainer/trunk/container/build-test14.xml
projects/microcontainer/trunk/container/build.xml
projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerAllTestSuite.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/KernelAllTestSuite.java
Log:
Moved JavaBean tests, schema to Container.
Modified: projects/microcontainer/trunk/container/build-test.xml
===================================================================
--- projects/microcontainer/trunk/container/build-test.xml 2007-02-07 11:33:39 UTC (rev 60370)
+++ projects/microcontainer/trunk/container/build-test.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -82,6 +82,7 @@
<path refid="jboss/common.logging.spi.classpath"/>
<path refid="jboss/common.logging.log4j.classpath"/>
<path refid="jboss.test.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
<path refid="jboss.profiler.jvmti.classpath"/>
</path>
@@ -153,6 +154,9 @@
<jar destfile="${build.lib}/jboss-container-test.jar" manifest="${build.etc}/default.mf">
<fileset dir="${build.classes}"/>
+ <fileset dir="${build.resources}">
+ <include name="org/**"/>
+ </fileset>
</jar>
</target>
Modified: projects/microcontainer/trunk/container/build-test14.xml
===================================================================
--- projects/microcontainer/trunk/container/build-test14.xml 2007-02-07 11:33:39 UTC (rev 60370)
+++ projects/microcontainer/trunk/container/build-test14.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -75,6 +75,7 @@
<path refid="oswego.concurrent.classpath"/>
<path refid="jboss.profiler.jvmti.classpath"/>
<path refid="jboss.test.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
</path>
<!-- ======= -->
@@ -188,6 +189,9 @@
<!-- Build jboss-kernel.jar -->
<jar jarfile="${build.lib.retro}/jboss-container-test14.jar" manifest="${build.etc}/default.mf">
<fileset dir="${build.classes.retro}"/>
+ <fileset dir="${build.resources}">
+ <include name="org/**"/>
+ </fileset>
</jar>
</target>
Modified: projects/microcontainer/trunk/container/build.xml
===================================================================
--- projects/microcontainer/trunk/container/build.xml 2007-02-07 11:33:39 UTC (rev 60370)
+++ projects/microcontainer/trunk/container/build.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -165,9 +165,15 @@
<!-- Build jboss-kernel.jar -->
<jar jarfile="${build.lib}/jboss-container.jar" manifest="${build.etc}/default.mf">
<fileset dir="${build.classes}"/>
+ <fileset dir="${build.resources}">
+ <include name="schema/**"/>
+ </fileset>
</jar>
<jar jarfile="${build.lib.retro}/jboss-container14.jar" manifest="${build.etc}/default.mf">
<fileset dir="${build.classes.retro}"/>
+ <fileset dir="${build.resources}">
+ <include name="schema/**"/>
+ </fileset>
</jar>
<!-- Minimal source bundle -->
<zip destfile="${build.lib}/${jar.prefix}-src.zip">
Copied: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestAmbiguityInt.xml (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/javabean/test/TestAmbiguityInt.xml)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestAmbiguityInt.xml (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestAmbiguityInt.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<javabean xmlns="urn:jboss:javabean:1.0" class="org.jboss.test.javabean.support.AmbiguityBean">
+ <property name="something" class="java.lang.Integer">123</property>
+</javabean>
Copied: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestAmbiguityString.xml (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/javabean/test/TestAmbiguityString.xml)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestAmbiguityString.xml (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestAmbiguityString.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<javabean xmlns="urn:jboss:javabean:1.0" class="org.jboss.test.javabean.support.AmbiguityBean">
+ <property name="something" class="java.lang.String">SomeString</property>
+</javabean>
Copied: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure.xml (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/javabean/test/TestConfigure.xml)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure.xml (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<javabean xmlns="urn:jboss:javabean:1.0" class="org.jboss.test.javabean.support.SimpleBean">
+ <property name="AString">StringValue</property>
+ <property name="AByte">12</property>
+ <property name="ABoolean">true</property>
+ <property name="AShort">123</property>
+ <property name="anInt">1234</property>
+ <property name="ALong">12345</property>
+ <property name="AFloat">3.14</property>
+ <property name="ADouble">3.14e12</property>
+ <!--<property name="ADate">Mon Jan 01 00:00:00 CET 2001</property>-->
+ <property name="ADate">Jan 01 00:00:00 CET 2001</property>
+ <property name="ABigDecimal">12e4</property>
+ <property name="ABigInteger">123456</property>
+ <property name="abyte">12</property>
+ <property name="aboolean">true</property>
+ <property name="ashort">123</property>
+ <property name="anint">1234</property>
+ <property name="along">12345</property>
+ <property name="afloat">3.14</property>
+ <property name="adouble">3.14e12</property>
+ <property name="ANumber" class="java.lang.Long">12345</property>
+ <property name="overloadedProperty">StringValue</property>
+ <property name="XYZ">XYZ</property>
+ <property name="abc">abc</property>
+</javabean>
Property changes on: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20.xml (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/javabean/test/TestConfigure20.xml)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20.xml (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.test.javabean.support.SimpleBean">
+ <property name="AString">StringValue</property>
+ <property name="AByte">12</property>
+ <property name="ABoolean">true</property>
+ <property name="AShort">123</property>
+ <property name="anInt">1234</property>
+ <property name="ALong">12345</property>
+ <property name="AFloat">3.14</property>
+ <property name="ADouble">3.14e12</property>
+ <!--<property name="ADate">Mon Jan 01 00:00:00 CET 2001</property>-->
+ <property name="ADate">Jan 01 00:00:00 CET 2001</property>
+ <property name="ABigDecimal">12e4</property>
+ <property name="ABigInteger">123456</property>
+ <property name="abyte">12</property>
+ <property name="aboolean">true</property>
+ <property name="ashort">123</property>
+ <property name="anint">1234</property>
+ <property name="along">12345</property>
+ <property name="afloat">3.14</property>
+ <property name="adouble">3.14e12</property>
+ <property name="ANumber" class="java.lang.Long">12345</property>
+ <property name="overloadedProperty">StringValue</property>
+ <property name="XYZ">XYZ</property>
+ <property name="abc">abc</property>
+</javabean>
Property changes on: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20.xml
___________________________________________________________________
Name: svn:keywords
+ Id,Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtor.xml (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtor.xml)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtor.xml (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtor.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<javabean xmlns="urn:jboss:javabean:2.0"
+ class="org.jboss.test.javabean.support.SimpleBean">
+ <!--
+ public SimpleBean(Object anObject, String string, Byte byte1,
+ Boolean boolean1, Character character, Short short1,
+ Integer anInt, Long long1, Float float1, Double double1,
+ Date date, BigDecimal bigDecimal, BigInteger bigInteger,
+ byte abyte, boolean aboolean, char achar, short ashort,
+ int anint2, long along, float afloat, double adouble,
+ Number number, String overloadedProperty, String xyz, String abc)
+ -->
+ <constructor>
+ <!-- The name is not used for parameter matching, its just for info -->
+ <property name="anObject">anObjectValue</property>
+ <property name="AString">StringValue</property>
+ <property name="AByte">12</property>
+ <property name="ABoolean">true</property>
+ <property name="ACharacter">x</property>
+ <property name="AShort">123</property>
+ <property name="anInt">1234</property>
+ <property name="ALong">12345</property>
+ <property name="AFloat">3.14</property>
+ <property name="ADouble">3.14e12</property>
+ <property name="ADate">Jan 01 00:00:00 CET 2001</property>
+ <property name="ABigDecimal">12e4</property>
+ <property name="ABigInteger">123456</property>
+ <property name="abyte">12</property>
+ <property name="aboolean">true</property>
+ <property name="achar">y</property>
+ <property name="ashort">123</property>
+ <property name="anint">1234</property>
+ <property name="along">12345</property>
+ <property name="afloat">3.14</property>
+ <property name="adouble">3.14e12</property>
+ <property name="ANumber" class="java.lang.Long">12345</property>
+ <property name="overloadedProperty">StringValue</property>
+ <property name="XYZ">XYZ</property>
+ <property name="abc">abc</property>
+ </constructor>
+</javabean>
Property changes on: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtor.xml
___________________________________________________________________
Name: svn:keywords
+ Id,Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClass.xml (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClass.xml)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClass.xml (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClass.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<javabean xmlns="urn:jboss:javabean:2.0"
+ class="org.jboss.test.javabean.support.SimpleBean">
+ <!--
+ public SimpleBean(Object anObject, String string, Byte byte1,
+ Boolean boolean1, Character character, Short short1,
+ Integer anInt, Long long1, Float float1, Double double1,
+ Date date, BigDecimal bigDecimal, BigInteger bigInteger,
+ byte abyte, boolean aboolean, char achar, short ashort,
+ int anint2, long along, float afloat, double adouble,
+ Number number, String overloadedProperty, String xyz, String abc)
+ -->
+ <constructor factoryClass="org.jboss.test.javabean.support.SimpleBeanFactory"
+ factoryMethod="newInstance" />
+
+ <property name="anObject">anObjectValue</property>
+ <property name="AString">StringValue</property>
+ <property name="AByte">12</property>
+ <property name="ABoolean">true</property>
+ <property name="ACharacter">x</property>
+ <property name="AShort">123</property>
+ <property name="anInt">1234</property>
+ <property name="ALong">12345</property>
+ <property name="AFloat">3.14</property>
+ <property name="ADouble">3.14e12</property>
+ <property name="ADate">Jan 01 00:00:00 CET 2001</property>
+ <property name="ABigDecimal">12e4</property>
+ <property name="ABigInteger">123456</property>
+ <property name="abyte">12</property>
+ <property name="aboolean">true</property>
+ <property name="achar">y</property>
+ <property name="ashort">123</property>
+ <property name="anint">1234</property>
+ <property name="along">12345</property>
+ <property name="afloat">3.14</property>
+ <property name="adouble">3.14e12</property>
+ <property name="ANumber" class="java.lang.Long">12345</property>
+ <property name="overloadedProperty">StringValue</property>
+ <property name="XYZ">XYZ</property>
+ <property name="abc">abc</property>
+</javabean>
Property changes on: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClass.xml
___________________________________________________________________
Name: svn:keywords
+ Id,Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClassAndParams.xml (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClassAndParams.xml)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClassAndParams.xml (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClassAndParams.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<javabean xmlns="urn:jboss:javabean:2.0"
+ class="org.jboss.test.javabean.support.SimpleBean">
+ <!--
+ public SimpleBean(Object anObject, String string, Byte byte1,
+ Boolean boolean1, Character character, Short short1,
+ Integer anInt, Long long1, Float float1, Double double1,
+ Date date, BigDecimal bigDecimal, BigInteger bigInteger,
+ byte abyte, boolean aboolean, char achar, short ashort,
+ int anint2, long along, float afloat, double adouble,
+ Number number, String overloadedProperty, String xyz, String abc)
+ -->
+ <constructor factoryClass="org.jboss.test.javabean.support.SimpleBeanFactory"
+ factoryMethod="newInstance">
+ <!-- The name is not used for parameter matching, its just for info -->
+ <property name="anObject" class="java.lang.Object">anObjectValue</property>
+ <property name="AString">StringValue</property>
+ <property name="AByte">12</property>
+ <property name="ABoolean">true</property>
+ <property name="ACharacter">x</property>
+ <property name="AShort">123</property>
+ <property name="anInt">1234</property>
+ <property name="ALong">12345</property>
+ <property name="AFloat">3.14</property>
+ <property name="ADouble">3.14e12</property>
+ <property name="ADate">Jan 01 00:00:00 CET 2001</property>
+ <property name="ABigDecimal">12e4</property>
+ <property name="ABigInteger">123456</property>
+ <property name="abyte">12</property>
+ <property name="aboolean">true</property>
+ <property name="achar">y</property>
+ <property name="ashort">123</property>
+ <property name="anint">1234</property>
+ <property name="along">12345</property>
+ <property name="afloat">3.14</property>
+ <property name="adouble">3.14e12</property>
+ <property name="ANumber" class="java.lang.Long">12345</property>
+ <property name="overloadedProperty">StringValue</property>
+ <property name="XYZ">XYZ</property>
+ <property name="abc">abc</property>
+ </constructor>
+</javabean>
Property changes on: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorExplicitFactoryClassAndParams.xml
___________________________________________________________________
Name: svn:keywords
+ Id,Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorFactory.xml (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorFactory.xml)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorFactory.xml (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorFactory.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<javabean xmlns="urn:jboss:javabean:2.0"
+ class="org.jboss.test.javabean.support.SimpleBean">
+ <!--
+ public SimpleBean(Object anObject, String string, Byte byte1,
+ Boolean boolean1, Character character, Short short1,
+ Integer anInt, Long long1, Float float1, Double double1,
+ Date date, BigDecimal bigDecimal, BigInteger bigInteger,
+ byte abyte, boolean aboolean, char achar, short ashort,
+ int anint2, long along, float afloat, double adouble,
+ Number number, String overloadedProperty, String xyz, String abc)
+ -->
+ <constructor factoryMethod="getInstance">
+ <!-- The name is not used for parameter matching, its just for info -->
+ <property name="anObject" class="java.lang.Object">anObjectValue</property>
+ <property name="AString">StringValue</property>
+ <property name="AByte">12</property>
+ <property name="ABoolean">true</property>
+ <property name="ACharacter">x</property>
+ <property name="AShort">123</property>
+ <property name="anInt">1234</property>
+ <property name="ALong">12345</property>
+ <property name="AFloat">3.14</property>
+ <property name="ADouble">3.14e12</property>
+ <property name="ADate">Jan 01 00:00:00 CET 2001</property>
+ <property name="ABigDecimal">12e4</property>
+ <property name="ABigInteger">123456</property>
+ <property name="abyte">12</property>
+ <property name="aboolean">true</property>
+ <property name="achar">y</property>
+ <property name="ashort">123</property>
+ <property name="anint">1234</property>
+ <property name="along">12345</property>
+ <property name="afloat">3.14</property>
+ <property name="adouble">3.14e12</property>
+ <property name="ANumber" class="java.lang.Long">12345</property>
+ <property name="overloadedProperty">StringValue</property>
+ <property name="XYZ">XYZ</property>
+ <property name="abc">abc</property>
+ </constructor>
+</javabean>
Property changes on: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestConfigure20WithCtorFactory.xml
___________________________________________________________________
Name: svn:keywords
+ Id,Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestInstantiate.xml (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/javabean/test/TestInstantiate.xml)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestInstantiate.xml (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestInstantiate.xml 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<javabean xmlns="urn:jboss:javabean:1.0" class="org.jboss.test.javabean.support.SimpleBean"/>
Property changes on: projects/microcontainer/trunk/container/src/resources/org/jboss/test/javabean/test/TestInstantiate.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/resources/schema/javabean_1_0.xsd (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/schema/javabean_1_0.xsd)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/schema/javabean_1_0.xsd (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/schema/javabean_1_0.xsd 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A prototype xsd schema for javabeans
+$Id$
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:javabean:1.0"
+ xmlns="urn:jboss:javabean:1.0"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0"
+>
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ A schema for constructing javabeans.
+
+ <javabean xmlns="urn:jboss:javabean:1.0"
+ class="com.acme.MyJavaBean">
+ <property name="someProperty">SomeValue</property>
+ ...
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:element name="javabean" type="javabeanType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ The root of the javabean document
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:complexType name="javabeanType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ The javabean contains a set of properties.
+
+ e.g.
+ <javabean class="com.acme.SomeJavaBean">
+ <property .../>
+ <property .../>
+ </javabean>
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="class" type="xsd:token" use="required"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="propertyType" mixed="true">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ A property defines values passed to the setters.
+
+ e.g. Using the type from the setter argument
+ <javabean ...>
+ <property name="someProperty">Some value</property>
+ </javabean>
+
+ e.g. Overridding the injected type
+ <javabean ...>
+ <property name="someProperty" class="java.lang.String">Some value</property>
+ </javabean>
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="valueType"/>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:simpleType name="classNameType">
+ <xsd:annotation>
+ <xsd:documentation> The elements that use this type designate the name
+ of a Java class or interface. The name is in the form of a "binary
+ name", as defined in the JLS and as used in Class.forName().
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:string">
+ <xsd:whiteSpace value="collapse"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="valueType" mixed="true">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ A simple value with an optional class name
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="class" type="classNameType" use="optional"/>
+ </xsd:complexType>
+
+</xsd:schema>
Property changes on: projects/microcontainer/trunk/container/src/resources/schema/javabean_1_0.xsd
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/resources/schema/javabean_2_0.xsd (from rev 60366, projects/microcontainer/trunk/kernel/src/resources/schema/javabean_2_0.xsd)
===================================================================
--- projects/microcontainer/trunk/container/src/resources/schema/javabean_2_0.xsd (rev 0)
+++ projects/microcontainer/trunk/container/src/resources/schema/javabean_2_0.xsd 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- An xsd schema for javabeans
+$Id: javabean_1_0.xsd 59176 2006-12-20 11:56:02Z alesj $
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:javabean:2.0"
+ xmlns="urn:jboss:javabean:2.0"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0"
+>
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ A schema for constructing javabeans. This extends the 1.0
+ syntax to support constructor specifications.
+
+ <javabean xmlns="urn:jboss:javabean:2.0"
+ class="com.acme.MyJavaBean">
+ <property name="someProperty">SomeValue</property>
+ ...
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:element name="javabean" type="javabeanType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ The root of the javabean document
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:complexType name="javabeanType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ The javabean contains a set of properties.
+
+ e.g.
+ <javabean class="com.acme.SomeJavaBean">
+ <constructor .../>
+ <property .../>
+ <property .../>
+ </javabean>
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="constructor" type="constructorType" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="class" type="xsd:token" use="required"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="constructorType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ The constructor for a javabean instance.
+
+ e.g. simple constructor - new POJO(new String("String value"));
+ <javabean class="com.acme.POJO">
+ <constructor>
+ <property>String value</property>
+ </constructor>
+ </javabean>
+
+ e.g. static factory - com.acme.Factory.newInstance(new String("String value"));
+ <bean name="MyBean" class="com.acme.POJO">
+ <constructor factoryClass="com.acme.Factory" factoryMethod="newInstance">
+ <property>String value</property>
+ </constructor>
+ </bean>
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="property" type="propertyType" minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="factoryClass" type="classNameType" use="optional"/>
+ <xsd:attribute name="factoryMethod" type="xsd:token" use="optional"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="propertyType" mixed="true">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ A property defines values passed to the setters.
+
+ e.g. Using the type from the setter argument
+ <javabean ...>
+ <property name="someProperty">Some value</property>
+ </javabean>
+
+ e.g. Overridding the injected type
+ <javabean ...>
+ <property name="someProperty" class="java.lang.String">Some value</property>
+ </javabean>
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="valueType"/>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:simpleType name="classNameType">
+ <xsd:annotation>
+ <xsd:documentation> The elements that use this type designate the name
+ of a Java class or interface. The name is in the form of a "binary
+ name", as defined in the JLS and as used in Class.forName().
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:string">
+ <xsd:whiteSpace value="collapse"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="valueType" mixed="true">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ A simple value with an optional class name
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="class" type="classNameType" use="optional"/>
+ </xsd:complexType>
+
+</xsd:schema>
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerAllTestSuite.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerAllTestSuite.java 2007-02-07 11:33:39 UTC (rev 60370)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/ContainerAllTestSuite.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -24,9 +24,9 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
-
import org.jboss.test.beaninfo.test.BeanInfoTestSuite;
import org.jboss.test.classinfo.test.ClassInfoTestSuite;
+import org.jboss.test.javabean.test.JavaBeanTestSuite;
import org.jboss.test.joinpoint.test.JoinpointTestSuite;
import org.jboss.test.metadata.MetaDataAllTestSuite;
@@ -51,7 +51,8 @@
suite.addTest(JoinpointTestSuite.suite());
suite.addTest(BeanInfoTestSuite.suite());
suite.addTest(MetaDataAllTestSuite.suite());
-
+ suite.addTest(JavaBeanTestSuite.suite());
+
return suite;
}
}
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/ioc/test/AbstractIoCTest.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/AbstractIoCTest.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/ioc/test/AbstractIoCTest.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/ioc/test/AbstractIoCTest.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,133 @@
+/*
+* 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.ioc.test;
+
+import java.net.URL;
+
+import org.jboss.test.AbstractTestCaseWithSetup;
+import org.jboss.test.AbstractTestDelegate;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractIoCTest extends AbstractTestCaseWithSetup
+{
+ protected String rootName = getRootName();
+
+ /**
+ * Create a new AbstractJBossXBTest.
+ *
+ * @param name the name of the test
+ */
+ public AbstractIoCTest(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Unmarshal some xml
+ *
+ * @param <T> the expected type
+ * @param name the name
+ * @param expected the expected type
+ * @return the unmarshalled object
+ * @throws Exception for any error
+ */
+ protected <T> T unmarshal(String name, Class<T> expected) throws Exception
+ {
+ Object object = unmarshal(name);
+ if (object == null)
+ fail("No object from " + name);
+ assertTrue("Object '" + object + "' cannot be assigned to " + expected.getName(), expected.isAssignableFrom(object.getClass()));
+ return expected.cast(object);
+ }
+
+ /**
+ * Unmarshal some xml
+ *
+ * @param name the name
+ * @return the unmarshalled object
+ * @throws Exception for any error
+ */
+ protected Object unmarshal(String name) throws Exception
+ {
+ String url = findXML(name);
+ return getJBossXBDelegate().unmarshal(url);
+ }
+
+ /**
+ * Find the xml
+ *
+ * @param name the name
+ * @return the url of the xml
+ */
+ protected String findXML(String name)
+ {
+ URL url = getResource(name);
+ if (url == null)
+ fail(name + " not found");
+ return url.toString();
+ }
+
+ protected IoCTestDelegate getJBossXBDelegate()
+ {
+ return (IoCTestDelegate) getDelegate();
+ }
+
+ /**
+ * Setup the test delegate
+ *
+ * @param clazz the class
+ * @return the delegate
+ * @throws Exception for any error
+ */
+ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+ {
+ return new IoCTestDelegate(clazz);
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ configureLogging();
+ }
+
+ /**
+ * Get the package root name
+ *
+ * @return the root name
+ */
+ protected String getRootName()
+ {
+ String longName = getClass().getName();
+ int dot = longName.lastIndexOf('.');
+ if (dot != -1)
+ return longName.substring(dot + 1);
+ return longName;
+ }
+
+ protected void configureLogging()
+ {
+ //enableTrace("org.jboss.xb");
+ }
+}
+
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/ioc/test/IoCTestDelegate.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/IoCTestDelegate.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/ioc/test/IoCTestDelegate.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/ioc/test/IoCTestDelegate.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,84 @@
+/*
+* 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.ioc.test;
+
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
+
+/**
+ * Test delegate support for other IoC / XML bindings than MC's.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class IoCTestDelegate extends AbstractTestDelegate
+{
+ /** The unmarshaller factory */
+ protected UnmarshallerFactory unmarshallerFactory;
+
+ /** The resolver */
+ protected SchemaBindingResolver resolver;
+
+ /**
+ * Create a new JBossXBTestDelegate.
+ *
+ * @param clazz the test class
+ */
+ public IoCTestDelegate(Class clazz)
+ {
+ super(clazz);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ unmarshallerFactory = UnmarshallerFactory.newInstance();
+ resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
+ }
+
+ /**
+ * Unmarshal an object
+ *
+ * @param url the url
+ * @return the object
+ * @throws Exception for any error
+ */
+ public Object unmarshal(String url) throws Exception
+ {
+ long start = System.currentTimeMillis();
+ Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
+ log.debug("Initialized parsing in " + (System.currentTimeMillis() - start) + "ms");
+ try
+ {
+ Object result = unmarshaller.unmarshal(url, resolver);
+ log.debug("Total parse for " + url + " took " + (System.currentTimeMillis() - start) + "ms");
+ return result;
+ }
+ catch (Exception e)
+ {
+ log.debug("Error during parsing: " + url, e);
+ throw e;
+ }
+ }
+}
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/AmbiguityBean.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/support/AmbiguityBean.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/AmbiguityBean.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/AmbiguityBean.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -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.javabean.support;
+
+/**
+ * SimpleBean.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AmbiguityBean
+{
+ private Integer someint;
+ private String somestring;
+
+ public void setSomething(Integer integer)
+ {
+ someint = integer;
+ }
+
+ public void setSomething(String string)
+ {
+ somestring = string;
+ }
+
+ public Object something()
+ {
+ if (someint != null && somestring != null)
+ throw new IllegalArgumentException("Only one 'something' can be set!");
+ if (someint != null)
+ return someint;
+ if (somestring != null)
+ return somestring;
+ throw new IllegalArgumentException("Must set 'something'!");
+ }
+
+ public String toString()
+ {
+ return someint + "," + somestring;
+ }
+
+}
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/SimpleBean.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/support/SimpleBean.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/SimpleBean.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/SimpleBean.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,447 @@
+/*
+* 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.javabean.support;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+
+/**
+ * SimpleBean.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class SimpleBean
+{
+ /** Constructor used */
+ private String constructorUsed;
+ private String factoryUsed;
+
+ /** Object */
+ private Object anObject;
+
+ /** A string */
+ private String aString;
+
+ /** Byte */
+ private Byte aByte;
+
+ /** Boolean */
+ private Boolean aBoolean;
+
+ /** Character */
+ private Character aCharacter;
+
+ /** Short */
+ private Short aShort;
+
+ /** Int */
+ private Integer anInt;
+
+ /** Long */
+ private Long aLong;
+
+ /** Float */
+ private Float aFloat;
+
+ /** Double */
+ private Double aDouble;
+
+ /** Date */
+ private Date aDate;
+
+ /** BigDecimal */
+ private BigDecimal aBigDecimal;
+
+ /** BigDecimal */
+ private BigInteger aBigInteger;
+
+ /** byte */
+ private byte abyte;
+
+ /** boolean */
+ private boolean aboolean;
+
+ /** char */
+ private char achar;
+
+ /** short */
+ private short ashort;
+
+ /** int */
+ private int anint;
+
+ /** long */
+ private long along;
+
+ /** float */
+ private float afloat;
+
+ /** double */
+ private double adouble;
+
+ /** number */
+ private Number aNumber;
+
+ /** Overloaded property */
+ private String overloadedProperty;
+ private String xyz;
+ private String abc;
+
+ public SimpleBean()
+ {
+ constructorUsed = "()";
+ }
+ public SimpleBean(String aString)
+ {
+ constructorUsed = "(String)";
+ this.aString = aString;
+ }
+
+ public static SimpleBean getInstance(Object anObject, String string, Byte byte1,
+ Boolean boolean1, Character character, Short short1,
+ Integer anInt, Long long1, Float float1, Double double1,
+ Date date, BigDecimal bigDecimal, BigInteger bigInteger,
+ byte abyte, boolean aboolean, char achar, short ashort,
+ int anint2, long along, float afloat, double adouble,
+ Number number, String overloadedProperty, String xyz, String abc)
+ {
+ SimpleBean bean = new SimpleBean(anObject, string, byte1,
+ boolean1, character, short1,
+ anInt, long1, float1, double1,
+ date, bigDecimal, bigInteger,
+ abyte, aboolean, achar, ashort,
+ anint2, along, afloat, adouble,
+ number, overloadedProperty, xyz, abc);
+ bean.factoryUsed = "getInstance(<all-fields>)";
+ return bean;
+ }
+
+ public SimpleBean(Object anObject, String string, Byte byte1,
+ Boolean boolean1, Character character, Short short1,
+ Integer anInt, Long long1, Float float1, Double double1,
+ Date date, BigDecimal bigDecimal, BigInteger bigInteger,
+ byte abyte, boolean aboolean, char achar, short ashort,
+ int anint2, long along, float afloat, double adouble,
+ Number number, String overloadedProperty, String xyz, String abc)
+ {
+ constructorUsed = "(<all-fields>)";
+ this.anObject = anObject;
+ aString = string;
+ aByte = byte1;
+ aBoolean = boolean1;
+ aCharacter = character;
+ aShort = short1;
+ this.anInt = anInt;
+ aLong = long1;
+ aFloat = float1;
+ aDouble = double1;
+ aDate = date;
+ aBigDecimal = bigDecimal;
+ aBigInteger = bigInteger;
+ this.abyte = abyte;
+ this.aboolean = aboolean;
+ this.achar = achar;
+ this.ashort = ashort;
+ anint = anint2;
+ this.along = along;
+ this.afloat = afloat;
+ this.adouble = adouble;
+ aNumber = number;
+ this.overloadedProperty = overloadedProperty;
+ this.xyz = xyz;
+ this.abc = abc;
+ }
+
+ public String getConstructorUsed()
+ {
+ return constructorUsed;
+ }
+
+ public String getFactoryUsed()
+ {
+ return factoryUsed;
+ }
+ public void setFactoryUsed(String factoryUsed)
+ {
+ this.factoryUsed = factoryUsed;
+ }
+
+ public Object getAnObject()
+ {
+ return anObject;
+ }
+
+ public void setAnObject(Object object)
+ {
+ anObject = object;
+ }
+
+ public BigDecimal getABigDecimal()
+ {
+ return aBigDecimal;
+ }
+
+ public void setABigDecimal(BigDecimal bigDecimal)
+ {
+ aBigDecimal = bigDecimal;
+ }
+
+ public BigInteger getABigInteger()
+ {
+ return aBigInteger;
+ }
+
+ public void setABigInteger(BigInteger bigInteger)
+ {
+ aBigInteger = bigInteger;
+ }
+
+ public boolean isAboolean()
+ {
+ return aboolean;
+ }
+
+ public void setAboolean(boolean aboolean)
+ {
+ this.aboolean = aboolean;
+ }
+
+ public Boolean getABoolean()
+ {
+ return aBoolean;
+ }
+
+ public void setABoolean(Boolean boolean1)
+ {
+ aBoolean = boolean1;
+ }
+
+ public Number getANumber()
+ {
+ return aNumber;
+ }
+
+ public void setANumber(Number number)
+ {
+ aNumber = number;
+ }
+
+ public byte getAbyte()
+ {
+ return abyte;
+ }
+
+ public void setAbyte(byte abyte)
+ {
+ this.abyte = abyte;
+ }
+
+ public Byte getAByte()
+ {
+ return aByte;
+ }
+
+ public void setAByte(Byte byte1)
+ {
+ aByte = byte1;
+ }
+
+ public char getAchar()
+ {
+ return achar;
+ }
+
+ public void setAchar(char achar)
+ {
+ this.achar = achar;
+ }
+
+ public Character getACharacter()
+ {
+ return aCharacter;
+ }
+
+ public void setACharacter(Character character)
+ {
+ aCharacter = character;
+ }
+
+ public Date getADate()
+ {
+ return aDate;
+ }
+
+ public void setADate(Date date)
+ {
+ aDate = date;
+ }
+
+ public double getAdouble()
+ {
+ return adouble;
+ }
+
+ public void setAdouble(double adouble)
+ {
+ this.adouble = adouble;
+ }
+
+ public Double getADouble()
+ {
+ return aDouble;
+ }
+
+ public void setADouble(Double double1)
+ {
+ aDouble = double1;
+ }
+
+ public float getAfloat()
+ {
+ return afloat;
+ }
+
+ public void setAfloat(float afloat)
+ {
+ this.afloat = afloat;
+ }
+
+ public Float getAFloat()
+ {
+ return aFloat;
+ }
+
+ public void setAFloat(Float float1)
+ {
+ aFloat = float1;
+ }
+
+ public long getAlong()
+ {
+ return along;
+ }
+
+ public void setAlong(long along)
+ {
+ this.along = along;
+ }
+
+ public Long getALong()
+ {
+ return aLong;
+ }
+
+ public void setALong(Long long1)
+ {
+ aLong = long1;
+ }
+
+ public int getAnint()
+ {
+ return anint;
+ }
+
+ public void setAnint(int anint)
+ {
+ this.anint = anint;
+ }
+
+ public Integer getAnInt()
+ {
+ return anInt;
+ }
+
+ public void setAnInt(Integer anInt)
+ {
+ this.anInt = anInt;
+ }
+
+ public short getAshort()
+ {
+ return ashort;
+ }
+
+ public void setAshort(short ashort)
+ {
+ this.ashort = ashort;
+ }
+
+ public Short getAShort()
+ {
+ return aShort;
+ }
+
+ public void setAShort(Short short1)
+ {
+ aShort = short1;
+ }
+
+ public String getAString()
+ {
+ return aString;
+ }
+
+ public void setAString(String string)
+ {
+ aString = string;
+ }
+
+ public String getOverloadedProperty()
+ {
+ return overloadedProperty;
+ }
+
+ public void setOverloadedProperty(Long broken)
+ {
+ throw new RuntimeException("Invoked the wrong setter");
+ }
+
+ public void setOverloadedProperty(String overloadedProperty)
+ {
+ this.overloadedProperty = overloadedProperty;
+ }
+
+ public void setOverloadedProperty(Integer broken)
+ {
+ throw new RuntimeException("Invoked the wrong setter");
+ }
+
+ public String getXYZ()
+ {
+ return xyz;
+ }
+ public void setXYZ(String xyz)
+ {
+ this.xyz = xyz;
+ }
+
+ public String getAbc()
+ {
+ return abc;
+ }
+ public void setAbc(String abc)
+ {
+ this.abc = abc;
+ }
+}
Property changes on: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/SimpleBean.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/SimpleBeanFactory.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/support/SimpleBeanFactory.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/SimpleBeanFactory.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/SimpleBeanFactory.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.javabean.support;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+
+/**
+ * Factory for javabean tests.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class SimpleBeanFactory
+{
+ public static SimpleBean newInstance()
+ {
+ SimpleBean bean = new SimpleBean();
+ bean.setFactoryUsed("SimpleBeanFactory.newInstance()");
+ return bean;
+ }
+ public static SimpleBean newInstance(Object anObject, String string, Byte byte1,
+ Boolean boolean1, Character character, Short short1,
+ Integer anInt, Long long1, Float float1, Double double1,
+ Date date, BigDecimal bigDecimal, BigInteger bigInteger,
+ byte abyte, boolean aboolean, char achar, short ashort,
+ int anint2, long along, float afloat, double adouble,
+ Number number, String overloadedProperty, String xyz, String abc)
+ {
+ SimpleBean bean = new SimpleBean(anObject, string, byte1,
+ boolean1, character, short1,
+ anInt, long1, float1, double1,
+ date, bigDecimal, bigInteger,
+ abyte, aboolean, achar, ashort,
+ anint2, along, afloat, adouble,
+ number, overloadedProperty, xyz, abc);
+ bean.setFactoryUsed("SimpleBeanFactory.newInstance(<all-fields>)");
+ return bean;
+ }
+}
Property changes on: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/support/SimpleBeanFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id,Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/AbstractJavaBeanTest.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/AbstractJavaBeanTest.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/AbstractJavaBeanTest.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/AbstractJavaBeanTest.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,57 @@
+/*
+* 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.javabean.test;
+
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.ioc.test.AbstractIoCTest;
+
+/**
+ * AbstractJavaBeanTest.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class AbstractJavaBeanTest extends AbstractIoCTest
+{
+ /**
+ * Create a new AbstractJBossXBTest.
+ *
+ * @param name the name of the test
+ */
+ public AbstractJavaBeanTest(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Setup the test delegate
+ *
+ * @param clazz the class
+ * @return the delegate
+ * @throws Exception for any error
+ */
+ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+ {
+ return new JavaBeanTestDelegate(clazz);
+ }
+
+}
Property changes on: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/AbstractJavaBeanTest.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/AmbiguityTestCase.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/AmbiguityTestCase.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/AmbiguityTestCase.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/AmbiguityTestCase.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,69 @@
+/*
+* 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.javabean.test;
+
+import junit.framework.Test;
+import org.jboss.test.javabean.support.AmbiguityBean;
+
+/**
+ * PropertyTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 58996 $
+ */
+public class AmbiguityTestCase extends AbstractJavaBeanTest
+{
+ /**
+ * Create a new AmbiguityTestCase.
+ *
+ * @param name the test name
+ */
+ public AmbiguityTestCase(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Setup the test
+ *
+ * @return the test
+ */
+ public static Test suite()
+ {
+ return suite(AmbiguityTestCase.class);
+ }
+
+ public void testConfigureInt() throws Exception
+ {
+ AmbiguityBean ab = unmarshal("TestAmbiguityInt.xml", AmbiguityBean.class);
+ Object something = ab.something();
+ assertEquals(something.getClass(), Integer.class);
+ }
+
+ public void testConfigureString() throws Exception
+ {
+ AmbiguityBean ab = unmarshal("TestAmbiguityString.xml", AmbiguityBean.class);
+ Object something = ab.something();
+ assertEquals(something.getClass(), String.class);
+ }
+
+}
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/InstantiateTestCase.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/InstantiateTestCase.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/InstantiateTestCase.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/InstantiateTestCase.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,61 @@
+/*
+* 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.javabean.test;
+
+import junit.framework.Test;
+import org.jboss.test.javabean.support.SimpleBean;
+
+/**
+ * InstantiateTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class InstantiateTestCase extends AbstractJavaBeanTest
+{
+ public void testInstantiate() throws Exception
+ {
+ SimpleBean bean = unmarshal("TestInstantiate.xml", SimpleBean.class);
+ assertEquals("()", bean.getConstructorUsed());
+ }
+
+ /**
+ * Setup the test
+ *
+ * @return the test
+ */
+ public static Test suite()
+ {
+ return suite(InstantiateTestCase.class);
+ }
+
+ /**
+ * Create a new InstantiateTestCase.
+ *
+ * @param name the test name
+ */
+ public InstantiateTestCase(String name)
+ {
+ super(name);
+ }
+
+}
Property changes on: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/InstantiateTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/JavaBeanTestDelegate.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/JavaBeanTestDelegate.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/JavaBeanTestDelegate.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/JavaBeanTestDelegate.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,44 @@
+/*
+* 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.javabean.test;
+
+import org.jboss.test.ioc.test.IoCTestDelegate;
+
+/**
+ * JavaBeanTestDelegate.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class JavaBeanTestDelegate extends IoCTestDelegate
+{
+ /**
+ * Create a new JBossXBTestDelegate.
+ *
+ * @param clazz the test class
+ */
+ public JavaBeanTestDelegate(Class clazz)
+ {
+ super(clazz);
+ }
+
+}
Property changes on: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/JavaBeanTestDelegate.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/JavaBeanTestSuite.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/JavaBeanTestSuite.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/JavaBeanTestSuite.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/JavaBeanTestSuite.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,51 @@
+/*
+* 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.javabean.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * JavaBean Test Suite.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class JavaBeanTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("JavaBean Tests");
+
+ suite.addTest(InstantiateTestCase.suite());
+ suite.addTest(PropertyTestCase.suite());
+ suite.addTest(AmbiguityTestCase.suite());
+
+ return suite;
+ }
+}
Property changes on: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/JavaBeanTestSuite.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/PropertyTestCase.java (from rev 60366, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/PropertyTestCase.java)
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/PropertyTestCase.java (rev 0)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/PropertyTestCase.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -0,0 +1,204 @@
+/*
+* 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.javabean.test;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+
+import junit.framework.Test;
+import org.jboss.test.javabean.support.SimpleBean;
+import org.jboss.util.NestedRuntimeException;
+
+/**
+ * PropertyTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class PropertyTestCase extends AbstractJavaBeanTest
+{
+// private static DateFormat dateFormat = new SimpleDateFormat("EEE MMM d HH:mm:ss z yyyy");
+ // EEE names - Locale configured
+ private static DateFormat dateFormat = new SimpleDateFormat("MMM d HH:mm:ss z yyyy");
+
+ String stringValue = "StringValue";
+ Byte byteValue = new Byte("12");
+ Boolean booleanValue = Boolean.TRUE;
+ // TODO character
+ // Character characterValue = new Character('a');
+ Short shortValue = new Short("123");
+ Integer integerValue = new Integer("1234");
+ Long longValue = new Long("12345");
+ Float floatValue = new Float("3.14");
+ Double doubleValue = new Double("3.14e12");
+// Date dateValue = createDate("Mon Jan 01 00:00:00 CET 2001");
+ Date dateValue = createDate("Jan 01 00:00:00 CET 2001");
+ BigDecimal bigDecimalValue = new BigDecimal("12e4");
+ BigInteger bigIntegerValue = new BigInteger("123456");
+
+ public void testConfigure() throws Exception
+ {
+ // check bean
+ SimpleBean bean = unmarshal("TestConfigure.xml", SimpleBean.class);
+ validateFields("()", null, bean);
+ }
+
+ public void testConfigure20() throws Exception
+ {
+ // check bean
+ SimpleBean bean = unmarshal("TestConfigure20.xml", SimpleBean.class);
+ validateFields("()", null, bean);
+ }
+
+ public void testConfigure20WithCtor() throws Exception
+ {
+ // check bean
+ SimpleBean bean = unmarshal("TestConfigure20WithCtor.xml", SimpleBean.class);
+ validateFields("(<all-fields>)", null, bean);
+ }
+
+ public void testConfigure20WithCtorFactory() throws Exception
+ {
+ // check bean
+ SimpleBean bean = unmarshal("TestConfigure20WithCtorFactory.xml", SimpleBean.class);
+ validateFields("(<all-fields>)", "getInstance(<all-fields>)", bean);
+ }
+
+ public void testConfigure20WithCtorExplicitFactoryClass() throws Exception
+ {
+ // check bean
+ SimpleBean bean = unmarshal("TestConfigure20WithCtorExplicitFactoryClass.xml", SimpleBean.class);
+ validateFields("()", "SimpleBeanFactory.newInstance()", bean);
+ }
+ public void testConfigure20WithCtorExplicitFactoryClassAndParams() throws Exception
+ {
+ // check bean
+ SimpleBean bean = unmarshal("TestConfigure20WithCtorExplicitFactoryClassAndParams.xml", SimpleBean.class);
+ validateFields("(<all-fields>)", "SimpleBeanFactory.newInstance(<all-fields>)", bean);
+ }
+
+ /**
+ * Validate the JavaBean property name introspection
+ * @throws Exception
+ */
+ public void testJavaBeanMatching() throws Exception
+ {
+ BeanInfo info = Introspector.getBeanInfo(SimpleBean.class);
+ PropertyDescriptor[] props = info.getPropertyDescriptors();
+ HashMap<String, PropertyDescriptor> propMap = new HashMap<String, PropertyDescriptor>();
+ for(PropertyDescriptor pd : props)
+ {
+ propMap.put(pd.getName(), pd);
+ }
+ assertNotNull("Has XYZ", propMap.get("XYZ"));
+ assertNull("Does not have xYZ", propMap.get("xYZ"));
+ }
+
+ @Override
+ protected Object unmarshal(String name) throws Exception
+ {
+ // tmp format
+ System.setProperty("org.jboss.util.propertyeditor.DateEditor.format", "MMM d HH:mm:ss z yyyy");
+ // TODO Auto-generated method stub
+ return super.unmarshal(name);
+ }
+
+ protected void validateFields(String ctor, String factory, SimpleBean bean)
+ {
+ // check bean
+ assertEquals(ctor, bean.getConstructorUsed());
+ if( factory == null )
+ assertTrue("factory == null", bean.getFactoryUsed() == null);
+ else
+ assertEquals(factory, bean.getFactoryUsed());
+
+ assertEquals(stringValue, bean.getAString());
+ assertEquals(byteValue, bean.getAByte());
+ assertEquals(booleanValue, bean.getABoolean());
+ // TODO character
+ // assertEquals(characterValue, bean.getACharacter());
+ assertEquals(shortValue, bean.getAShort());
+ assertEquals(integerValue, bean.getAnInt());
+ assertEquals(longValue, bean.getALong());
+ assertEquals(floatValue, bean.getAFloat());
+ assertEquals(doubleValue, bean.getADouble());
+ assertEquals(dateValue, bean.getADate());
+ assertEquals(bigDecimalValue, bean.getABigDecimal());
+ assertEquals(bigIntegerValue, bean.getABigInteger());
+ assertEquals(byteValue.byteValue(), bean.getAbyte());
+ assertEquals(booleanValue.booleanValue(), bean.isAboolean());
+ // TODO character
+ // assertEquals(characterValue.charValue(), bean.getAchar());
+ assertEquals(shortValue.shortValue(), bean.getAshort());
+ assertEquals(integerValue.intValue(), bean.getAnint());
+ assertEquals(longValue.longValue(), bean.getAlong());
+ assertEquals(floatValue.floatValue(), bean.getAfloat());
+ assertEquals(doubleValue.doubleValue(), bean.getAdouble());
+ Number number = bean.getANumber();
+ assertEquals(Long.class, number.getClass());
+ assertEquals(longValue, number);
+ assertEquals(stringValue, bean.getOverloadedProperty());
+ // An all uppercase property
+ assertEquals("XYZ", bean.getXYZ());
+ assertEquals("abc", bean.getAbc());
+ }
+
+ protected Date createDate(String date)
+ {
+ try
+ {
+ return dateFormat.parse(date);
+ }
+ catch (Exception e)
+ {
+ throw new NestedRuntimeException(e);
+ }
+ }
+
+ /**
+ * Setup the test
+ *
+ * @return the test
+ */
+ public static Test suite()
+ {
+ return suite(PropertyTestCase.class);
+ }
+
+ /**
+ * Create a new InstantiateTestCase.
+ *
+ * @param name the test name
+ */
+ public PropertyTestCase(String name)
+ {
+ super(name);
+ }
+
+}
Property changes on: projects/microcontainer/trunk/container/src/tests/org/jboss/test/javabean/test/PropertyTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: projects/microcontainer/trunk/kernel/src/resources/schema/javabean_1_0.xsd
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/schema/javabean_1_0.xsd 2007-02-07 11:33:39 UTC (rev 60370)
+++ projects/microcontainer/trunk/kernel/src/resources/schema/javabean_1_0.xsd 2007-02-07 11:48:07 UTC (rev 60371)
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- A prototype xsd schema for javabeans
-$Id$
- -->
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="urn:jboss:javabean:1.0"
- xmlns="urn:jboss:javabean:1.0"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.0"
->
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- A schema for constructing javabeans.
-
- <javabean xmlns="urn:jboss:javabean:1.0"
- class="com.acme.MyJavaBean">
- <property name="someProperty">SomeValue</property>
- ...
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:element name="javabean" type="javabeanType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- The root of the javabean document
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:complexType name="javabeanType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- The javabean contains a set of properties.
-
- e.g.
- <javabean class="com.acme.SomeJavaBean">
- <property .../>
- <property .../>
- </javabean>
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:token" use="required"/>
- </xsd:complexType>
-
- <xsd:complexType name="propertyType" mixed="true">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- A property defines values passed to the setters.
-
- e.g. Using the type from the setter argument
- <javabean ...>
- <property name="someProperty">Some value</property>
- </javabean>
-
- e.g. Overridding the injected type
- <javabean ...>
- <property name="someProperty" class="java.lang.String">Some value</property>
- </javabean>
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="valueType"/>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:simpleType name="classNameType">
- <xsd:annotation>
- <xsd:documentation> The elements that use this type designate the name
- of a Java class or interface. The name is in the form of a "binary
- name", as defined in the JLS and as used in Class.forName().
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:whiteSpace value="collapse"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="valueType" mixed="true">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- A simple value with an optional class name
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="classNameType" use="optional"/>
- </xsd:complexType>
-
-</xsd:schema>
Deleted: projects/microcontainer/trunk/kernel/src/resources/schema/javabean_2_0.xsd
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/schema/javabean_2_0.xsd 2007-02-07 11:33:39 UTC (rev 60370)
+++ projects/microcontainer/trunk/kernel/src/resources/schema/javabean_2_0.xsd 2007-02-07 11:48:07 UTC (rev 60371)
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- An xsd schema for javabeans
-$Id: javabean_1_0.xsd 59176 2006-12-20 11:56:02Z alesj $
- -->
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="urn:jboss:javabean:2.0"
- xmlns="urn:jboss:javabean:2.0"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.0"
->
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- A schema for constructing javabeans. This extends the 1.0
- syntax to support constructor specifications.
-
- <javabean xmlns="urn:jboss:javabean:2.0"
- class="com.acme.MyJavaBean">
- <property name="someProperty">SomeValue</property>
- ...
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:element name="javabean" type="javabeanType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- The root of the javabean document
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:complexType name="javabeanType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- The javabean contains a set of properties.
-
- e.g.
- <javabean class="com.acme.SomeJavaBean">
- <constructor .../>
- <property .../>
- <property .../>
- </javabean>
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="constructor" type="constructorType" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="class" type="xsd:token" use="required"/>
- </xsd:complexType>
-
- <xsd:complexType name="constructorType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- The constructor for a javabean instance.
-
- e.g. simple constructor - new POJO(new String("String value"));
- <javabean class="com.acme.POJO">
- <constructor>
- <property>String value</property>
- </constructor>
- </javabean>
-
- e.g. static factory - com.acme.Factory.newInstance(new String("String value"));
- <bean name="MyBean" class="com.acme.POJO">
- <constructor factoryClass="com.acme.Factory" factoryMethod="newInstance">
- <property>String value</property>
- </constructor>
- </bean>
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="property" type="propertyType" minOccurs="1" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="factoryClass" type="classNameType" use="optional"/>
- <xsd:attribute name="factoryMethod" type="xsd:token" use="optional"/>
- </xsd:complexType>
-
- <xsd:complexType name="propertyType" mixed="true">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- A property defines values passed to the setters.
-
- e.g. Using the type from the setter argument
- <javabean ...>
- <property name="someProperty">Some value</property>
- </javabean>
-
- e.g. Overridding the injected type
- <javabean ...>
- <property name="someProperty" class="java.lang.String">Some value</property>
- </javabean>
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="valueType"/>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:simpleType name="classNameType">
- <xsd:annotation>
- <xsd:documentation> The elements that use this type designate the name
- of a Java class or interface. The name is in the form of a "binary
- name", as defined in the JLS and as used in Class.forName().
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- <xsd:whiteSpace value="collapse"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="valueType" mixed="true">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- A simple value with an optional class name
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="class" type="classNameType" use="optional"/>
- </xsd:complexType>
-
-</xsd:schema>
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/KernelAllTestSuite.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/KernelAllTestSuite.java 2007-02-07 11:33:39 UTC (rev 60370)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/KernelAllTestSuite.java 2007-02-07 11:48:07 UTC (rev 60371)
@@ -24,8 +24,6 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
-
-import org.jboss.test.javabean.test.JavaBeanTestSuite;
import org.jboss.test.junit.test.JUnitTestSuite;
import org.jboss.test.kernel.KernelTestSuite;
@@ -47,7 +45,6 @@
TestSuite suite = new TestSuite("All Tests");
suite.addTest(JUnitTestSuite.suite());
- suite.addTest(JavaBeanTestSuite.suite());
suite.addTest(KernelTestSuite.suite());
return suite;
More information about the jboss-cvs-commits
mailing list