[exo-jcr-commits] exo-jcr SVN: r1015 - in kernel/branches/config-branch/exo.kernel.container/src: test/java/org/exoplatform/container/configuration/test and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 11 16:57:45 EST 2009


Author: julien_viet
Date: 2009-12-11 16:57:45 -0500 (Fri, 11 Dec 2009)
New Revision: 1015

Modified:
   kernel/branches/config-branch/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd
   kernel/branches/config-branch/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/test/TestComponentPluginProfile.java
   kernel/branches/config-branch/exo.kernel.container/src/test/resources/org/exoplatform/container/configuration/component-plugin-configuration.xml
Log:
support for external component plugin profile


Modified: kernel/branches/config-branch/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd
===================================================================
--- kernel/branches/config-branch/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd	2009-12-11 21:41:36 UTC (rev 1014)
+++ kernel/branches/config-branch/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd	2009-12-11 21:57:45 UTC (rev 1015)
@@ -153,6 +153,7 @@
             <xsd:element name="priority" type="xsd:string" minOccurs="0" maxOccurs="1"/>
             <xsd:element name="init-params" type="initParamsType" minOccurs="0" maxOccurs="1"/>
         </xsd:sequence>
+        <xsd:attribute name="profile" type="xsd:string"/>
     </xsd:complexType>
 
     <xsd:complexType name="externalComponentPluginType">

Modified: kernel/branches/config-branch/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/test/TestComponentPluginProfile.java
===================================================================
--- kernel/branches/config-branch/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/test/TestComponentPluginProfile.java	2009-12-11 21:41:36 UTC (rev 1014)
+++ kernel/branches/config-branch/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/test/TestComponentPluginProfile.java	2009-12-11 21:57:45 UTC (rev 1015)
@@ -35,21 +35,16 @@
 public class TestComponentPluginProfile extends TestCase
 {
 
-/*
    public void testNoProfile() throws Exception
    {
       String basedir = System.getProperty("basedir");
-      File f = new File(basedir + "/src/test/resources/org/exoplatform/container/configuration/init-param-configuration.xml");
-      ConfigurationUnmarshaller unmarshaller = new ConfigurationUnmarshaller();
+      File f = new File(basedir + "/src/test/resources/org/exoplatform/container/configuration/component-plugin-configuration.xml");
+      ConfigurationUnmarshaller unmarshaller = new ConfigurationUnmarshaller(Tools.<String>set());
       URL url = f.toURI().toURL();
-      PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, "");
       Configuration config = unmarshaller.unmarshall(url);
       Component component = config.getComponent("Component");
-      InitParams initParams = component.getInitParams();
-      ValueParam valueParam = initParams.getValueParam("param");
-      assertEquals("empty", valueParam.getValue());
+      assertEquals(1, component.getComponentPlugins().size());
    }
-*/
 
    public void testFooProfile() throws Exception
    {
@@ -59,27 +54,6 @@
       URL url = f.toURI().toURL();
       Configuration config = unmarshaller.unmarshall(url);
       Component component = config.getComponent("Component");
-      System.out.println("component.getComponentPlugins() = " + component.getComponentPlugins());
-/*
-      InitParams initParams = component.getInitParams();
-      ValueParam valueParam = initParams.getValueParam("param");
-      assertEquals("foo", valueParam.getValue());
-*/
+      assertEquals(2, component.getComponentPlugins().size());
    }
-
-/*
-   public void testFooBarProfiles() throws Exception
-   {
-      String basedir = System.getProperty("basedir");
-      File f = new File(basedir + "/src/test/resources/org/exoplatform/container/configuration/init-param-configuration.xml");
-      ConfigurationUnmarshaller unmarshaller = new ConfigurationUnmarshaller();
-      URL url = f.toURI().toURL();
-      PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, "foo,bar");
-      Configuration config = unmarshaller.unmarshall(url);
-      Component component = config.getComponent("Component");
-      InitParams initParams = component.getInitParams();
-      ValueParam valueParam = initParams.getValueParam("param");
-      assertEquals("bar", valueParam.getValue());
-   }
-*/
 }
\ No newline at end of file

Modified: kernel/branches/config-branch/exo.kernel.container/src/test/resources/org/exoplatform/container/configuration/component-plugin-configuration.xml
===================================================================
--- kernel/branches/config-branch/exo.kernel.container/src/test/resources/org/exoplatform/container/configuration/component-plugin-configuration.xml	2009-12-11 21:41:36 UTC (rev 1014)
+++ kernel/branches/config-branch/exo.kernel.container/src/test/resources/org/exoplatform/container/configuration/component-plugin-configuration.xml	2009-12-11 21:57:45 UTC (rev 1015)
@@ -21,10 +21,8 @@
 -->
 <configuration
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-   xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-   xmlns:foo="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-   xmlns:bar="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+   xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+   xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
 
   <component>
     <key>Component</key>
@@ -35,11 +33,11 @@
         <set-method>set_method</set-method>
         <type>PluginA</type>
       </component-plugin>
-      <foo:component-plugin>
+      <component-plugin profile="foo">
         <name>Plugin</name>
         <set-method>set_method</set-method>
         <type>PluginA</type>
-      </foo:component-plugin>
+      </component-plugin>
     </component-plugins>
   </component>
 



More information about the exo-jcr-commits mailing list