[jboss-cvs] JBossAS SVN: r60393 - in projects/microcontainer/trunk/kernel/src: resources/schema and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 7 12:43:31 EST 2007


Author: alesj
Date: 2007-02-07 12:43:30 -0500 (Wed, 07 Feb 2007)
New Revision: 60393

Added:
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithComplexValue.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithNoName.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithPlainValue.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/Policy.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithAnnotations.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithBindings.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithExtends.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithName.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithScope.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/Scope.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/ScopeWithLevel.xml
   projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/ScopeWithQualifier.xml
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/BindingTestCase.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/PolicyTestCase.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/ScopeTestCase.java
Modified:
   projects/microcontainer/trunk/kernel/src/resources/schema/policy_1_0.xsd
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/AbstractXMLTest.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/XMLTestDelegate.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/XMLTestSuite.java
Log:
Policy tests - not yet working, schema not resolved (looking into why).

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithComplexValue.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithComplexValue.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithComplexValue.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<binding xmlns="urn:jboss:policy:1.0">
+   <value xmlns="urn:jboss:bean-deployer:2.0" class="java.lang.Integer">42</value>
+</binding>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithNoName.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithNoName.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithNoName.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<binding xmlns="urn:jboss:policy:1.0">binddinb</binding>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithPlainValue.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithPlainValue.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithPlainValue.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<binding xmlns="urn:jboss:policy:1.0">binddinb</binding>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/Policy.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/Policy.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/Policy.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<policy xmlns="urn:jboss:policy:1.0"/>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithAnnotations.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithAnnotations.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithAnnotations.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<policy name="SimpleDeployment" xmlns="urn:jboss:policy:1.0">
+   <annotation xmlns="urn:jboss:bean-deployer:2.0">@org.jboss.test.Someannotaion</annotation>
+</policy>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithBindings.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithBindings.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithBindings.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<policy name="SimpleDeployment" xmlns="urn:jboss:policy:1.0">
+   <binding>binddnib</binding>
+</policy>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithExtends.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithExtends.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithExtends.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<policy extends="ExtendablePolicy" xmlns="urn:jboss:policy:1.0"/>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithName.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithName.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithName.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<policy name="NamedPolicy" xmlns="urn:jboss:policy:1.0"/>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithScope.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithScope.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithScope.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<policy name="SimpleDeployment" xmlns="urn:jboss:policy:1.0">
+   <scope level="DefaultLevel" />
+</policy>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/Scope.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/Scope.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/Scope.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<scope qualifier="SimpleQualifier" xmlns="urn:jboss:policy:1.0"/>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/ScopeWithLevel.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/ScopeWithLevel.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/ScopeWithLevel.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<scope level="DefaultLevel" xmlns="urn:jboss:policy:1.0"/>

Added: projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/ScopeWithQualifier.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/ScopeWithQualifier.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/org/jboss/test/kernel/deployment/xml/test/ScopeWithQualifier.xml	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<scope qualifier="SimpleQualifier" xmlns="urn:jboss:policy:1.0"/>

Modified: projects/microcontainer/trunk/kernel/src/resources/schema/policy_1_0.xsd
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/schema/policy_1_0.xsd	2007-02-07 17:43:16 UTC (rev 60392)
+++ projects/microcontainer/trunk/kernel/src/resources/schema/policy_1_0.xsd	2007-02-07 17:43:30 UTC (rev 60393)
@@ -1,5 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- A prototype xsd schema for the pojoserver xml policy -->
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- A prototype xsd schema for the pojoserver xml policy
+$Id: policy_1_0.xsd 56471 2007-02-07 18:44:05 +0100 (Sre, 07 feb 2007) alesj $
+ -->
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="urn:jboss:policy:1.0"
    xmlns="urn:jboss:policy:1.0"
@@ -13,7 +15,7 @@
    <xsd:annotation>
       <xsd:documentation>
          <![CDATA[
-            <policy xmlns="urn:jboss-policy:1.0"/>
+            <policy xmlns="urn:jboss:policy:1.0"/>
          ]]>
       </xsd:documentation>
    </xsd:annotation>

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/AbstractXMLTest.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/AbstractXMLTest.java	2007-02-07 17:43:16 UTC (rev 60392)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/AbstractXMLTest.java	2007-02-07 17:43:30 UTC (rev 60393)
@@ -93,7 +93,7 @@
     */
    protected AbstractBeanMetaData unmarshalBean(String name) throws Exception
    {
-      return (AbstractBeanMetaData) unmarshal(name, AbstractBeanMetaData.class);
+      return unmarshal(name, AbstractBeanMetaData.class);
    }
 
    /**
@@ -105,7 +105,7 @@
     */
    protected GenericBeanFactoryMetaData unmarshalBeanFactory(String name) throws Exception
    {
-      return (GenericBeanFactoryMetaData) unmarshal(name, GenericBeanFactoryMetaData.class);
+      return unmarshal(name, GenericBeanFactoryMetaData.class);
    }
    
    /**
@@ -116,7 +116,7 @@
     * @return the unmarshalled object
     * @throws Exception for any error
     */
-   protected Object unmarshal(String name, Class<?> expected) throws Exception
+   protected <T> T unmarshal(String name, Class<T> expected) throws Exception
    {
       String url = findXML(name);
       Object object = getJBossXBDelegate().unmarshal(url);
@@ -129,7 +129,7 @@
       object = deserialize(serialize(serializable));
 
       assertTrue("Object '" + object + "' cannot be assigned to " + expected.getName(), expected.isAssignableFrom(object.getClass()));
-      return object;
+      return expected.cast(object);
    }
    
    /**

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/BindingTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/BindingTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/BindingTestCase.java	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.deployment.xml.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.policy.AbstractBindingMetaData;
+import org.jboss.beans.metadata.spi.policy.BindingMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class BindingTestCase extends AbstractXMLTest
+{
+   public BindingTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(BindingTestCase.class);
+   }
+
+   public void testBindingWithNoName() throws Throwable
+   {
+      BindingMetaData binding = unmarshal("BindingWithNoName.xml", AbstractBindingMetaData.class);
+      assertNotNull(binding.getName());
+//      assertEquals("", binding.getName()); // todo
+      assertNotNull(binding.getValue());
+   }
+
+   public void testBindingWithPlainValue() throws Throwable
+   {
+      BindingMetaData binding = unmarshal("BindingWithPlainValue.xml", AbstractBindingMetaData.class);
+      assertNotNull(binding.getName());
+      assertNotNull(binding.getValue());
+   }
+
+   public void testBindingWithComplexValue() throws Throwable
+   {
+      BindingMetaData binding = unmarshal("BindingWithComplexValue.xml", AbstractBindingMetaData.class);
+      assertNotNull(binding.getName());
+      assertNotNull(binding.getValue());
+   }
+
+}

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/PolicyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/PolicyTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/PolicyTestCase.java	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,106 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.deployment.xml.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData;
+import org.jboss.beans.metadata.spi.policy.PolicyMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class PolicyTestCase extends AbstractXMLTest
+{
+   public PolicyTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(PolicyTestCase.class);
+   }
+
+   public void testPolicy() throws Throwable
+   {
+      PolicyMetaData policy = unmarshal("Policy.xml", AbstractPolicyMetaData.class);
+      assertNull(policy.getName());
+      assertNull(policy.getExtends());
+      assertNull(policy.getScope());
+      assertNull(policy.getAnnotations());
+      assertNull(policy.getBindings());
+   }
+
+   public void testPolicyWithName() throws Throwable
+   {
+      PolicyMetaData policy = unmarshal("PolicyWithName.xml", AbstractPolicyMetaData.class);
+      assertEquals("NamedPolicy", policy.getName());
+      assertNull(policy.getExtends());
+      assertNull(policy.getScope());
+      assertNull(policy.getAnnotations());
+      assertNull(policy.getBindings());
+   }
+
+   public void testPolicyWithExtends() throws Throwable
+   {
+      PolicyMetaData policy = unmarshal("PolicyWithName.xml", AbstractPolicyMetaData.class);
+      assertNull(policy.getName());
+      assertEquals("ExtendablePolicy", policy.getExtends());
+      assertNull(policy.getScope());
+      assertNull(policy.getAnnotations());
+      assertNull(policy.getBindings());
+   }
+
+   public void testPolicyWithScope() throws Throwable
+   {
+      PolicyMetaData policy = unmarshal("PolicyWithScope.xml", AbstractPolicyMetaData.class);
+      assertNull(policy.getName());
+      assertNull(policy.getExtends());
+      assertNotNull(policy.getScope());
+      assertEquals("DefaultLevel", policy.getScope().getLevel());
+      assertNull(policy.getAnnotations());
+      assertNull(policy.getBindings());
+   }
+
+   public void testPolicyWithAnnotations() throws Throwable
+   {
+      PolicyMetaData policy = unmarshal("PolicyWithAnnotations.xml", AbstractPolicyMetaData.class);
+      assertNull(policy.getName());
+      assertNull(policy.getExtends());
+      assertNull(policy.getScope());
+      assertNotNull(policy.getAnnotations());
+      assertTrue(policy.getAnnotations().size() > 0);
+      assertNull(policy.getBindings());
+   }
+
+   public void testPolicyWithBindings() throws Throwable
+   {
+      PolicyMetaData policy = unmarshal("PolicyWithBindings.xml", AbstractPolicyMetaData.class);
+      assertNull(policy.getName());
+      assertNull(policy.getExtends());
+      assertNull(policy.getScope());
+      assertNull(policy.getAnnotations());
+      assertNotNull(policy.getBindings());
+      assertTrue(policy.getBindings().size() > 0);
+   }
+
+}

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/ScopeTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/ScopeTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/ScopeTestCase.java	2007-02-07 17:43:30 UTC (rev 60393)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.deployment.xml.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.policy.AbstractScopeMetaData;
+import org.jboss.beans.metadata.spi.policy.ScopeMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ScopeTestCase extends AbstractXMLTest
+{
+   public ScopeTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(ScopeTestCase.class);
+   }
+
+   public void testScope() throws Throwable
+   {
+      ScopeMetaData scope = unmarshal("Scope.xml", AbstractScopeMetaData.class);
+      assertNull(scope.getLevel());
+      assertNull(scope.getQualifier());
+   }
+
+   public void testScopeWithLevel() throws Throwable
+   {
+      ScopeMetaData scope = unmarshal("ScopeWithLevel.xml", AbstractScopeMetaData.class);
+      assertNotNull(scope.getLevel());
+      assertEquals("DefaultLevel", scope.getLevel());
+      assertNull(scope.getQualifier());
+   }
+
+   public void testScopeWithQualifier() throws Throwable
+   {
+      ScopeMetaData scope = unmarshal("ScopeWithQualifier.xml", AbstractScopeMetaData.class);
+      assertNull(scope.getLevel());
+      assertNotNull(scope.getQualifier());
+      assertEquals("SimpleQualifier", scope.getQualifier());
+   }
+
+}

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/XMLTestDelegate.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/XMLTestDelegate.java	2007-02-07 17:43:16 UTC (rev 60392)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/XMLTestDelegate.java	2007-02-07 17:43:30 UTC (rev 60393)
@@ -22,10 +22,10 @@
 package org.jboss.test.kernel.deployment.xml.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.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
 
 /**
  * XMLTestDelegate.
@@ -55,7 +55,7 @@
    {
       super.setUp();
       unmarshallerFactory = UnmarshallerFactory.newInstance();
-      resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();;
+      resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
    }
    
    /**

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/XMLTestSuite.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/XMLTestSuite.java	2007-02-07 17:43:16 UTC (rev 60392)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/xml/test/XMLTestSuite.java	2007-02-07 17:43:30 UTC (rev 60393)
@@ -63,7 +63,10 @@
       suite.addTest(ArrayTestCase.suite());
       suite.addTest(MapTestCase.suite());
       suite.addTest(AnnotationTestCase.suite());
-      
+      suite.addTest(ScopeTestCase.suite());
+      suite.addTest(BindingTestCase.suite());
+      suite.addTest(PolicyTestCase.suite());
+
       return suite;
    }
 }




More information about the jboss-cvs-commits mailing list