[exo-jcr-commits] exo-jcr SVN: r5942 - in kernel/trunk/exo.kernel.container/src: main/java/org/exoplatform/container/management and 9 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Mar 22 10:20:47 EDT 2012
Author: dkuleshov
Date: 2012-03-22 10:20:46 -0400 (Thu, 22 Mar 2012)
New Revision: 5942
Added:
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestValidation.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ExoContainerFinder.java
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/invalid-configuration.xml.bad
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/test-validation.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/invalid-configuration.xml.bad
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/test-validation.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/invalid-configuration.xml.bad
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/test-validation.xml
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0_OLD.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1_OLD.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2_OLD.xsd
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/TestRegistration.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ManagedWithObjectNameTemplate.java
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-19.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml
Log:
EXOJCR-1739: ported issues:
* EXOJCR-1774
* EXOJCR-1781
* EXOJCR-1791
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -413,7 +413,7 @@
Map<Object, Object> map = depResolutionCtx.get();
if (map != null)
{
- Object result = map.get(componentType);
+ Object result = map.get(componentAdapter.getComponentKey());
if (result != null)
{
return result;
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,7 +18,10 @@
*/
package org.exoplatform.container.management;
+import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.RootContainer;
import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.management.ManagementAware;
import org.exoplatform.management.ManagementContext;
@@ -31,6 +34,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -50,6 +54,11 @@
*/
private static final Log LOG = ExoLogger.getLogger("exo.kernel.container.ManagementContextImpl");
+ /**
+ * The previous container
+ */
+ private static final ThreadLocal<ExoContainer> previousContainer = new ThreadLocal<ExoContainer>();
+
/** . */
private final Map<Class<?>, Object> scopingDataList;
@@ -306,16 +315,48 @@
public void beforeInvoke(Object managedResource)
{
- ExoContainer container = findContainer();
+ final ExoContainer container = findContainer();
if (container != null)
{
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
+ {
+ public Void run()
+ {
+ ExoContainer oldContainer = ExoContainerContext.getCurrentContainerIfPresent();
+ if (!(oldContainer instanceof RootContainer))
+ {
+ previousContainer.set(oldContainer);
+ }
+ ExoContainerContext.setCurrentContainer(container);
+ return null;
+ }
+ });
RequestLifeCycle.begin(container);
}
}
public void afterInvoke(Object managedResource)
{
- RequestLifeCycle.end();
+ try
+ {
+ RequestLifeCycle.end();
+ }
+ finally
+ {
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
+ {
+ public Void run()
+ {
+ ExoContainer oldContainer = previousContainer.get();
+ if (oldContainer != null)
+ {
+ previousContainer.set(null);
+ }
+ ExoContainerContext.setCurrentContainer(oldContainer);
+ return null;
+ }
+ });
+ }
}
@Override
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -131,12 +131,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -184,8 +184,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0_OLD.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0_OLD.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0_OLD.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -131,12 +131,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -184,8 +184,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -146,12 +146,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -200,8 +200,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1_OLD.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1_OLD.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1_OLD.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -146,12 +146,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -200,8 +200,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -146,12 +146,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -203,8 +203,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2_OLD.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2_OLD.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2_OLD.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -146,12 +146,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -203,8 +203,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,6 +18,7 @@
import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.component.BaseComponentPlugin;
+import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.jmx.AbstractTestContainer;
import org.exoplatform.container.support.ContainerBuilder;
@@ -185,6 +186,19 @@
assertEquals(container.getComponentInstanceOfType(SOE1.class), soe2.soe1);
}
+ public void testStackOverFlow4()
+ {
+ final RootContainer container = createRootContainer("test-exo-container.xml", "testStackOverflowError");
+ MyService ms = (MyService)container.getComponentInstanceOfType(MyService.class);
+ assertNotNull(ms);
+ assertTrue(ms instanceof MyServiceImpl);
+ MyServiceImpl msi = (MyServiceImpl)ms;
+ assertNotNull(msi.componentPlugin);
+ assertTrue(msi.componentPlugin instanceof MyPlugin);
+ MyPlugin mp = (MyPlugin) msi.componentPlugin;
+ assertTrue(mp.svc == ms);
+ }
+
public void testCyclicRef()
{
final RootContainer container = createRootContainer("test-exo-container.xml", "testCyclicRef");
@@ -1005,4 +1019,44 @@
this.soe1 = (SOE1)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(SOE1.class);
}
}
+
+ public static class MyPlugin extends BaseComponentPlugin
+ {
+ MySpecialService svc;
+
+ public MyPlugin(MySpecialService svc)
+ {
+ this.svc = svc;
+ }
+ }
+
+ public static interface MyService
+ {
+ public void addPlugin(ComponentPlugin componentPlugin);
+ }
+
+ public static interface MySpecialService extends MyService
+ {
+ }
+
+ public static class MyServiceImpl implements MySpecialService, Startable
+ {
+ ComponentPlugin componentPlugin;
+ public MyServiceImpl()
+ {
+ }
+
+ public void addPlugin(ComponentPlugin componentPlugin)
+ {
+ this.componentPlugin = componentPlugin;
+ }
+
+ public void stop()
+ {
+ }
+
+ public void start()
+ {
+ }
+ }
}
Added: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestValidation.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestValidation.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestValidation.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2012 eXo Platform SAS.
+ *
+ * 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.exoplatform.container.configuration;
+
+import org.exoplatform.commons.utils.ExoProperties;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.PropertiesParam;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.container.xml.ValuesParam;
+
+/**
+ * @author <a href="mailto:nfilotto at exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class TestValidation
+{
+ public TestValidation(InitParams params)
+ {
+ PropertiesParam pp = params.getPropertiesParam("properties-param");
+ ExoProperties ep = pp.getProperties();
+ check(ep.containsKey("p1"));
+ check(ep.containsKey("p2"));
+ check(ep.containsKey("p3"));
+ pp = params.getPropertiesParam("properties-param2");
+ ep = pp.getProperties();
+ check(ep.containsKey("p1"));
+ check(ep.containsKey("p2"));
+ check(ep.containsKey("p3"));
+ MyBean bean = (MyBean)params.getObjectParam("object-param").getObject();
+ check(bean.value.equals("value"));
+ bean = (MyBean)params.getObjectParam("object-param2").getObject();
+ check(bean.value.equals("value"));
+ ValueParam vp = params.getValueParam("value-param");
+ check(vp.getValue().equals("value"));
+ vp = params.getValueParam("value-param2");
+ check(vp.getValue().equals("value"));
+ ValuesParam vps = params.getValuesParam("values-param");
+ check(vps.getValues().get(0).equals("value1"));
+ check(vps.getValues().get(1).equals("value2"));
+ check(vps.getValues().get(2).equals("value3"));
+ vps = params.getValuesParam("values-param2");
+ check(vps.getValues().get(0).equals("value1"));
+ check(vps.getValues().get(1).equals("value2"));
+ check(vps.getValues().get(2).equals("value3"));
+ }
+
+ public void check(boolean ok)
+ {
+ if (!ok)
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ public static class MyBean
+ {
+ public String value;
+ }
+}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.container.configuration;
+import org.exoplatform.container.RootContainer;
+import org.exoplatform.container.support.ContainerBuilder;
import org.exoplatform.test.BasicTestCase;
import java.io.File;
@@ -57,6 +59,26 @@
fail("Was not expecting such exception " + e.getMessage());
}
}
- assertEquals(18, count);
+ assertEquals(19, count);
+ try
+ {
+ File f = new File(baseDir, "invalid-configuration.xml.bad");
+ URL url = f.toURI().toURL();
+ assertFalse("XML configuration file " + url + " is valid", unmarshaller.isValid(url));
+ }
+ catch (MalformedURLException e)
+ {
+ // Expected
+ }
}
+
+ public void testInitParams() throws Exception
+ {
+ String baseDirPath = System.getProperty("basedir");
+ File file = new File(baseDirPath + "/src/test/resources/xsd_1_0/test-validation.xml");
+ URL url = file.toURI().toURL();
+ assertNotNull(url);
+ RootContainer container = new ContainerBuilder().withRoot(url).build();
+ container.getComponentInstanceOfType(TestValidation.class);
+ }
}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.container.configuration;
+import org.exoplatform.container.RootContainer;
+import org.exoplatform.container.support.ContainerBuilder;
import org.exoplatform.test.BasicTestCase;
import java.io.File;
@@ -57,6 +59,26 @@
fail("Was not expecting such exception " + e.getMessage());
}
}
- assertEquals(19, count);
+ assertEquals(20, count);
+ try
+ {
+ File f = new File(baseDir,"invalid-configuration.xml.bad");
+ URL url = f.toURI().toURL();
+ assertFalse("XML configuration file " + url + " is valid", unmarshaller.isValid(url));
+ }
+ catch (MalformedURLException e)
+ {
+ // Expected
+ }
}
+
+ public void testInitParams() throws Exception
+ {
+ String baseDirPath = System.getProperty("basedir");
+ File file = new File(baseDirPath + "/src/test/resources/xsd_1_1/test-validation.xml");
+ URL url = file.toURI().toURL();
+ assertNotNull(url);
+ RootContainer container = new ContainerBuilder().withRoot(url).build();
+ container.getComponentInstanceOfType(TestValidation.class);
+ }
}
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.container.configuration;
+import org.exoplatform.container.RootContainer;
+import org.exoplatform.container.support.ContainerBuilder;
import org.exoplatform.test.BasicTestCase;
import java.io.File;
@@ -57,6 +59,26 @@
fail("Was not expecting such exception " + e.getMessage());
}
}
- assertEquals(20, count);
+ assertEquals(21, count);
+ try
+ {
+ File f = new File(baseDir, "invalid-configuration.xml.bad");
+ URL url = f.toURI().toURL();
+ assertFalse("XML configuration file " + url + " is valid", unmarshaller.isValid(url));
+ }
+ catch (MalformedURLException e)
+ {
+ // Expected
+ }
}
+
+ public void testInitParams() throws Exception
+ {
+ String baseDirPath = System.getProperty("basedir");
+ File file = new File(baseDirPath + "/src/test/resources/xsd_1_2/test-validation.xml");
+ URL url = file.toURI().toURL();
+ assertNotNull(url);
+ RootContainer container = new ContainerBuilder().withRoot(url).build();
+ container.getComponentInstanceOfType(TestValidation.class);
+ }
}
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/TestRegistration.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/TestRegistration.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/TestRegistration.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,12 +18,17 @@
*/
package org.exoplatform.container.jmx;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.RootContainer;
+import org.exoplatform.container.jmx.support.ExoContainerFinder;
import org.exoplatform.container.jmx.support.ManagedWithObjectNameTemplate;
import java.util.Set;
import javax.management.MBeanServer;
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectInstance;
import javax.management.ObjectName;
/**
@@ -43,9 +48,33 @@
MBeanServer server = root.getMBeanServer();
- Set set = server.queryMBeans(ObjectName.getInstance("exo:object=\"Foo\""), null);
+ Set<ObjectInstance> set = server.queryMBeans(ObjectName.getInstance("exo:object=\"Foo\""), null);
assertEquals(1, set.size());
+ ObjectInstance oi = set.iterator().next();
+ ExoContainer oldContainer = ExoContainerContext.getCurrentContainerIfPresent();
+
+ ExoContainer currentContainer = new ExoContainer();
+ ExoContainerContext.setCurrentContainer(currentContainer);
+ try
+ {
+ ExoContainerFinder proxyObject =
+ MBeanServerInvocationHandler.newProxyInstance(server, oi.getObjectName(),
+ ExoContainerFinder.class, false);
+ assertTrue("We expect to get the current exo container", oldContainer == proxyObject.getCurrentExoContainer());
+ assertTrue("We expect to get the previous exo container", ExoContainerContext.getCurrentContainerIfPresent() == currentContainer);
+ ExoContainerContext.setCurrentContainer(oldContainer);
+ assertTrue("We expect to get the current exo container", oldContainer == proxyObject.getCurrentExoContainer());
+ assertTrue("We expect to get the previous exo container", ExoContainerContext.getCurrentContainerIfPresent() == oldContainer);
+ ExoContainerContext.setCurrentContainer(null);
+ assertTrue("We expect to get the current exo container", oldContainer == proxyObject.getCurrentExoContainer());
+ assertTrue("We expect to get the previous exo container", ExoContainerContext.getCurrentContainerIfPresent() == oldContainer);
+ }
+ finally
+ {
+ ExoContainerContext.setCurrentContainer(oldContainer);
+ }
+
// Manual
root.registerComponentInstance("Bar", new ManagedWithObjectNameTemplate("Bar"));
Added: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ExoContainerFinder.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ExoContainerFinder.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ExoContainerFinder.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2012 eXo Platform SAS.
+ *
+ * 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.exoplatform.container.jmx.support;
+
+import org.exoplatform.container.ExoContainer;
+
+/**
+ * @author <a href="mailto:nfilotto at exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public interface ExoContainerFinder
+{
+ ExoContainer getCurrentExoContainer();
+}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ManagedWithObjectNameTemplate.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ManagedWithObjectNameTemplate.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ManagedWithObjectNameTemplate.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.container.jmx.support;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.jmx.annotations.NameTemplate;
@@ -29,7 +31,7 @@
*/
@Managed
@NameTemplate(@Property(key = "object", value = "{Name}"))
-public class ManagedWithObjectNameTemplate
+public class ManagedWithObjectNameTemplate implements ExoContainerFinder
{
private String name;
@@ -45,6 +47,12 @@
}
@Managed
+ public ExoContainer getCurrentExoContainer()
+ {
+ return ExoContainerContext.getCurrentContainerIfPresent();
+ }
+
+ @Managed
public String getName()
{
return name;
Modified: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -87,4 +87,18 @@
<component profiles="testStartOrder">
<type>org.exoplatform.container.TestExoContainer$C2</type>
</component>
+ <component profiles="testStackOverflowError">
+ <key>org.exoplatform.container.TestExoContainer$MyService</key>
+ <type>org.exoplatform.container.TestExoContainer$MyServiceImpl</type>
+ </component>
+
+ <external-component-plugins profiles="testStackOverflowError">
+ <target-component>org.exoplatform.container.TestExoContainer$MyService</target-component>
+ <component-plugin>
+ <name>test.plugin</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.container.TestExoContainer$MyPlugin</type>
+ <description>User - Ticket Authenticator</description>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/invalid-configuration.xml.bad
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/invalid-configuration.xml.bad (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/invalid-configuration.xml.bad 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_0.xsd http://www.exoplatform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/test-validation.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/test-validation.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/test-validation.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_0.xsd http://www.exoplatform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/invalid-configuration.xml.bad
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/invalid-configuration.xml.bad (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/invalid-configuration.xml.bad 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_1.xsd http://www.exoplatform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -43,27 +43,6 @@
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
<type>org.exoplatform.services.naming.InitialContextInitializer</type>
<init-params>
- <object-param>
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a,b">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <properties-param>
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a">
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a,b">
- <name>properties</name>
- </properties-param>
<value-param>
<name>value</name>
<value>value</value>
@@ -85,6 +64,27 @@
<values-param profiles="a,b">
<name>values</name>
</values-param>
+ <properties-param>
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a">
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a,b">
+ <name>properties</name>
+ </properties-param>
+ <object-param>
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a,b">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
</init-params>
</component>
Modified: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-19.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-19.xml 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-19.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -43,27 +43,6 @@
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
<type>org.exoplatform.services.naming.InitialContextInitializer</type>
<init-params>
- <object-param>
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a,b">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <properties-param>
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a">
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a,b">
- <name>properties</name>
- </properties-param>
<value-param>
<name>value</name>
<value>value</value>
@@ -85,6 +64,27 @@
<values-param profiles="a,b">
<name>values</name>
</values-param>
+ <properties-param>
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a">
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a,b">
+ <name>properties</name>
+ </properties-param>
+ <object-param>
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a,b">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
</init-params>
</component>
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/test-validation.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/test-validation.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/test-validation.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_1.xsd http://www.exoplatform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/invalid-configuration.xml.bad
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/invalid-configuration.xml.bad (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/invalid-configuration.xml.bad 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -43,27 +43,6 @@
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
<type>org.exoplatform.services.naming.InitialContextInitializer</type>
<init-params>
- <object-param>
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a,b">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <properties-param>
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a">
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a,b">
- <name>properties</name>
- </properties-param>
<value-param>
<name>value</name>
<value>value</value>
@@ -85,6 +64,27 @@
<values-param profiles="a,b">
<name>values</name>
</values-param>
+ <properties-param>
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a">
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a,b">
+ <name>properties</name>
+ </properties-param>
+ <object-param>
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a,b">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
</init-params>
</component>
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/test-validation.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/test-validation.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/test-validation.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
More information about the exo-jcr-commits
mailing list