[jboss-cvs] JBossAS SVN: r58996 - in projects/microcontainer/trunk: kernel/src/tests/org/jboss/test kernel/src/tests/org/jboss/test/ioc kernel/src/tests/org/jboss/test/ioc/test kernel/src/tests/org/jboss/test/javabean/test spring-int/src/main/org/jboss/spring/deployment/xml spring-int/src/resources spring-int/src/resources/org spring-int/src/resources/org/jboss spring-int/src/resources/org/jboss/test spring-int/src/resources/org/jboss/test/spring spring-int/src/resources/org/jboss/test/spring/test spring-int/src/resources/schema spring-int/src/tests spring-int/src/tests/org spring-int/src/tests/org/jboss spring-int/src/tests/org/jboss/test spring-int/src/tests/org/jboss/test/spring spring-int/src/tests/org/jboss/test/spring/support spring-int/src/tests/org/jboss/test/spring/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 12 11:57:20 EST 2006


Author: alesj
Date: 2006-12-12 11:56:59 -0500 (Tue, 12 Dec 2006)
New Revision: 58996

Added:
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/AbstractIoCTest.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/IoCTestDelegate.java
   projects/microcontainer/trunk/spring-int/src/resources/org/
   projects/microcontainer/trunk/spring-int/src/resources/org/jboss/
   projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/
   projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/spring/
   projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/spring/test/
   projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/spring/test/TestInstantiate.xml
   projects/microcontainer/trunk/spring-int/src/tests/org/
   projects/microcontainer/trunk/spring-int/src/tests/org/jboss/
   projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/
   projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/
   projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/support/
   projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/support/SimpleBean.java
   projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/
   projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/InstantiateSpringTestCase.java
   projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/SpringTestSuite.java
   projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/TempSpringSchemaTest.java
   projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/TempSpringSchemaTestDelegate.java
Modified:
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/AbstractJavaBeanTest.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/InstantiateTestCase.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/JavaBeanTestDelegate.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/PropertyTestCase.java
   projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringSchemaBinding.java
   projects/microcontainer/trunk/spring-int/src/resources/schema/mc-spring-beans_2_0.xsd
Log:
JBMICROCONT-26; inital tests - not yet working

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/AbstractIoCTest.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/AbstractIoCTest.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/AbstractIoCTest.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -0,0 +1,132 @@
+/*
+* 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 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");
+   }
+}
+

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/IoCTestDelegate.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/IoCTestDelegate.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/ioc/test/IoCTestDelegate.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -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.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
+import org.jboss.test.AbstractTestDelegate;
+
+/**
+ * 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;
+      }
+   }
+}

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/AbstractJavaBeanTest.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/AbstractJavaBeanTest.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/AbstractJavaBeanTest.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -21,10 +21,8 @@
 */
 package org.jboss.test.javabean.test;
 
-import java.net.URL;
-
-import org.jboss.test.AbstractTestCaseWithSetup;
 import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.ioc.test.AbstractIoCTest;
 
 /**
  * AbstractJavaBeanTest.
@@ -32,10 +30,8 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class AbstractJavaBeanTest extends AbstractTestCaseWithSetup
+public class AbstractJavaBeanTest extends AbstractIoCTest
 {
-   protected String rootName = getRootName();
-   
    /**
     * Create a new AbstractJBossXBTest.
     * 
@@ -47,50 +43,6 @@
    }
 
    /**
-    * Unmarshal some xml
-    * 
-    * @param name the name
-    * @param expected the expected type
-    * @return the unmarshalled object
-    * @throws Exception for any error
-    */
-   protected Object unmarshal(String name, Class<?> 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 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();
-   }
-
-   /**
     * Setup the test delegate
     * 
     * @param clazz the class
@@ -102,33 +54,4 @@
       return new JavaBeanTestDelegate(clazz);
    }
 
-   protected JavaBeanTestDelegate getJBossXBDelegate()
-   {
-      return (JavaBeanTestDelegate) getDelegate();
-   }
-   
-   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");
-   }
 }

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/InstantiateTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/InstantiateTestCase.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/InstantiateTestCase.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -35,7 +35,7 @@
 {
    public void testInstantiate() throws Exception
    {
-      SimpleBean bean = (SimpleBean) unmarshal("TestInstantiate.xml", SimpleBean.class);
+      SimpleBean bean = unmarshal("TestInstantiate.xml", SimpleBean.class);
       assertEquals("()", bean.getConstructorUsed());
    }
    

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/JavaBeanTestDelegate.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/JavaBeanTestDelegate.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/JavaBeanTestDelegate.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -21,11 +21,7 @@
 */
 package org.jboss.test.javabean.test;
 
-import org.jboss.test.AbstractTestDelegate;
-import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.test.ioc.test.IoCTestDelegate;
 
 /**
  * JavaBeanTestDelegate.
@@ -33,17 +29,11 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class JavaBeanTestDelegate extends AbstractTestDelegate
+public class JavaBeanTestDelegate extends IoCTestDelegate
 {
-   /** The unmarshaller factory */
-   protected UnmarshallerFactory unmarshallerFactory;
-
-   /** The resolver */
-   protected SchemaBindingResolver resolver;
-
    /**
     * Create a new JBossXBTestDelegate.
-    * 
+    *
     * @param clazz the test class
     */
    public JavaBeanTestDelegate(Class clazz)
@@ -51,35 +41,4 @@
       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;
-      }
-   }
 }

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/PropertyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/PropertyTestCase.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/javabean/test/PropertyTestCase.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -46,7 +46,7 @@
 {
    private static DateFormat dateFormat = new SimpleDateFormat("EEE MMM d HH:mm:ss z yyyy");
    
-   String stringValue =  new String("StringValue");
+   String stringValue =  "StringValue";
    Byte byteValue = new Byte("12");
    Boolean booleanValue = Boolean.TRUE;
    // TODO character
@@ -62,7 +62,7 @@
 
    public void testConfigure() throws Exception
    {
-      SimpleBean bean = (SimpleBean) unmarshal("TestConfigure.xml", SimpleBean.class);
+      SimpleBean bean = unmarshal("TestConfigure.xml", SimpleBean.class);
       assertEquals("()", bean.getConstructorUsed());
       
       assertEquals(stringValue, bean.getAString());

Modified: projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringSchemaBinding.java
===================================================================
--- projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringSchemaBinding.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringSchemaBinding.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -35,7 +35,7 @@
    /**
     * The namespace
     */
-   public static final String SPRING_DEPLOYER_NS = "http://www.springframework.org/schema/beans";
+   public static final String SPRING_DEPLOYER_NS = "urn:jboss:spring-beans:2.0";
 
    /**
     * The beans binding

Added: projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/spring/test/TestInstantiate.xml
===================================================================
--- projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/spring/test/TestInstantiate.xml	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/spring/test/TestInstantiate.xml	2006-12-12 16:56:59 UTC (rev 58996)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<bean xmlns="urn:jboss:spring-beans:2.0" class="org.jboss.test.spring.support.SimpleBean">
+   <constructor-arg index="2">SpringBean</constructor-arg>
+   <constructor-arg index="0">1</constructor-arg>
+   <constructor-arg index="1">3.1415</constructor-arg>
+   <property name="list">
+      <list>
+         <value>one</value>
+         <value>two</value>
+         <value>three</value>
+      </list>
+   </property>
+   <property name="set">
+      <set>
+         <value>one</value>
+         <value>two</value>
+         <value>one</value>
+      </set>
+   </property>
+   <property name="map">
+      <entry>
+         <key>
+            <value>key</value>
+         </key>
+         <value>key</value>
+      </entry>
+   </property>
+</bean>

Modified: projects/microcontainer/trunk/spring-int/src/resources/schema/mc-spring-beans_2_0.xsd
===================================================================
--- projects/microcontainer/trunk/spring-int/src/resources/schema/mc-spring-beans_2_0.xsd	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/spring-int/src/resources/schema/mc-spring-beans_2_0.xsd	2006-12-12 16:56:59 UTC (rev 58996)
@@ -2,9 +2,13 @@
 <!-- A prototype Spring xsd schema for the pojoserver xml deployer
 $Id: mc-spring-beans_2_0.xsd 56471 2006-08-31 10:44:05 +0200 (Pon, 11 dec 2006) alesj $
  -->
-<xsd:schema xmlns="http://www.springframework.org/schema/beans"
-            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-            targetNamespace="http://www.springframework.org/schema/beans">
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+   targetNamespace="urn:jboss:spring-beans:2.0"
+   xmlns="urn:jboss:spring-beans:2.0"
+   elementFormDefault="qualified"
+   attributeFormDefault="unqualified"
+   version="1.0"
+>
 
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
 

Added: projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/support/SimpleBean.java
===================================================================
--- projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/support/SimpleBean.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/support/SimpleBean.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -0,0 +1,82 @@
+/*
+* 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.spring.support;
+
+import java.util.List;
+import java.util.Set;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SimpleBean
+{
+
+   private int x;
+   private double y;
+   private String s;
+   private List list;
+   private Set set;
+   private Map map;
+
+   public SimpleBean()
+   {
+   }
+
+   public SimpleBean(int x, double y, String s)
+   {
+      this.x = x;
+      this.y = y;
+      this.s = s;
+   }
+
+   public List getList()
+   {
+      return list;
+   }
+
+   public void setList(List list)
+   {
+      this.list = list;
+   }
+
+   public Set getSet()
+   {
+      return set;
+   }
+
+   public void setSet(Set set)
+   {
+      this.set = set;
+   }
+
+   public Map getMap()
+   {
+      return map;
+   }
+
+   public void setMap(Map map)
+   {
+      this.map = map;
+   }
+
+}

Added: projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/InstantiateSpringTestCase.java
===================================================================
--- projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/InstantiateSpringTestCase.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/InstantiateSpringTestCase.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -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.spring.test;
+
+import junit.framework.Test;
+import org.jboss.test.spring.support.SimpleBean;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class InstantiateSpringTestCase extends TempSpringSchemaTest
+{
+
+   public InstantiateSpringTestCase(String name)
+   {
+      super(name);
+   }
+
+   /**
+    * Setup the test
+    *
+    * @return the test
+    */
+   public static Test suite()
+   {
+      return suite(InstantiateSpringTestCase.class);
+   }
+
+   public void testInstantiate() throws Exception
+   {
+      SimpleBean simpleBean = unmarshal("TestInstantiate.xml", SimpleBean.class);
+      System.out.println("simpleBean = " + simpleBean);
+   }
+
+}

Added: projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/SpringTestSuite.java
===================================================================
--- projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/SpringTestSuite.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/SpringTestSuite.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -0,0 +1,48 @@
+/*
+* 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.spring.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SpringTestSuite extends TestSuite
+{
+
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Spring Tests");
+
+      suite.addTest(InstantiateSpringTestCase.suite());
+
+      return suite;
+   }
+
+}

Added: projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/TempSpringSchemaTest.java
===================================================================
--- projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/TempSpringSchemaTest.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/TempSpringSchemaTest.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -0,0 +1,50 @@
+/*
+* 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.spring.test;
+
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.ioc.test.AbstractIoCTest;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class TempSpringSchemaTest extends AbstractIoCTest
+{
+
+   public TempSpringSchemaTest(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 TempSpringSchemaTestDelegate(clazz);
+   }
+
+}

Added: projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/TempSpringSchemaTestDelegate.java
===================================================================
--- projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/TempSpringSchemaTestDelegate.java	2006-12-12 14:47:58 UTC (rev 58995)
+++ projects/microcontainer/trunk/spring-int/src/tests/org/jboss/test/spring/test/TempSpringSchemaTestDelegate.java	2006-12-12 16:56:59 UTC (rev 58996)
@@ -0,0 +1,47 @@
+/*
+* 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.spring.test;
+
+import org.jboss.test.ioc.test.IoCTestDelegate;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.spring.deployment.xml.SpringSchemaInitializer;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class TempSpringSchemaTestDelegate extends IoCTestDelegate
+{
+
+   public TempSpringSchemaTestDelegate(Class clazz)
+   {
+      super(clazz);
+   }
+
+   public void setUp() throws Exception
+   {
+      super.setUp();
+      DefaultSchemaResolver defaultSchemaResolver = ((DefaultSchemaResolver) resolver);
+      defaultSchemaResolver.addSchemaInitializer("urn:jboss:spring-beans:2.0", new SpringSchemaInitializer());
+      defaultSchemaResolver.addSchemaLocation("urn:jboss:spring-beans:2.0", "mc-spring-beans_2_0.xsd");
+   }
+
+}




More information about the jboss-cvs-commits mailing list