Author: nfilotto
Date: 2010-02-19 05:21:51 -0500 (Fri, 19 Feb 2010)
New Revision: 1919
Added:
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-empty-portal-def.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-empty-portal-def2.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-invalid-values.xml
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/settings-with-invalid-values.properties
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
Log:
EXOJCR-528: Invalid values where not properly managed
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
===================================================================
---
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-02-19
08:53:30 UTC (rev 1918)
+++
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-02-19
10:21:51 UTC (rev 1919)
@@ -406,6 +406,7 @@
String name = def.getName();
if (name == null || (name = name.trim()).length() == 0)
{
+ log.warn("A PortalContainerDefinition cannot have empty
name");
continue;
}
else
@@ -501,58 +502,7 @@
final Map<String, String> props = ContainerUtil.loadProperties(url);
if (props != null && !props.isEmpty())
{
- if (settings.isEmpty())
- {
- // No settings exist so we can add everything
- settings.putAll(props);
- }
- else
- {
- // Some settings exists so we need to be careful if we override
properties
- // We need to try to keep the same type if possible
- for (Map.Entry<String, String> entry : props.entrySet())
- {
- String propertyName = entry.getKey();
- Object propertyValue = entry.getValue();
- propertyValue = Deserializer.resolveString((String)propertyValue);
- Object oldValue = settings.get(propertyName);
- if (oldValue != null)
- {
- // The value is not null so we need to convert the String into
- // the target type, we will convert thanks to the static method
- // valueOf(String value) if it exist for the target type
- Method m = null;
- try
- {
- // First we check if the method exists
- m = oldValue.getClass().getMethod("valueOf",
String.class);
- }
- catch (Exception e)
- {
- if (log.isDebugEnabled())
- {
- log.debug("The static method valueOf(String) cannot be
found for the class "
- + oldValue.getClass(), e);
- }
- }
- if (m != null)
- {
- // The method could be found, thus we will try to convert the
value
- try
- {
- propertyValue = m.invoke(null, propertyValue);
- }
- catch (Exception e)
- {
- log.error("Cannot convert the value '" +
propertyValue + "' to an Object of type "
- + oldValue.getClass(), e);
- }
- }
- }
- // We set the new value
- settings.put(propertyName, propertyValue);
- }
- }
+ mergeSettings(settings, props);
}
}
catch (Exception e)
@@ -563,14 +513,88 @@
// We then add the portal container name
settings.put(PORTAL_CONTAINER_SETTING_NAME, def.getName());
// We add the rest context name
- settings.put(REST_CONTEXT_SETTING_NAME, def.getRestContextName());
+ settings.put(REST_CONTEXT_SETTING_NAME, def.getRestContextName() == null ?
defaultRestContextName : def.getRestContextName());
// We add the realm name
- settings.put(REALM_SETTING_NAME, def.getRealmName());
+ settings.put(REALM_SETTING_NAME, def.getRealmName() == null ? defaultRealmName :
def.getRealmName());
// We re-inject the settings and we make sure it is thread safe
def.setSettings(Collections.unmodifiableMap(settings));
}
/**
+ * Merge the internal settings with the external settings
+ * @param settings the internal settings
+ * @param props the external settings
+ */
+ private void mergeSettings(final Map<String, Object> settings, final
Map<String, String> props)
+ {
+ if (settings.isEmpty())
+ {
+ // No settings exist so we can add everything
+ settings.putAll(props);
+ }
+ else
+ {
+ // Some settings exists so we need to be careful if we override properties
+ // We need to try to keep the same type if possible
+ for (Map.Entry<String, String> entry : props.entrySet())
+ {
+ String propertyName = entry.getKey();
+ Object propertyValue = entry.getValue();
+ propertyValue = Deserializer.resolveString((String)propertyValue);
+ if (propertyValue == null)
+ {
+ // We skip null value
+ continue;
+ }
+ Object oldValue = settings.get(propertyName);
+ if (oldValue != null)
+ {
+ // The value is not null so we need to convert the String into
+ // the target type, we will convert thanks to the static method
+ // valueOf(String value) if it exist for the target type
+ Method m = null;
+ try
+ {
+ // First we check if the method exists
+ m = oldValue.getClass().getMethod("valueOf", String.class);
+ }
+ catch (Exception e)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("The static method valueOf(String) cannot be found
for the class "
+ + oldValue.getClass(), e);
+ }
+ }
+ if (m != null)
+ {
+ // The method could be found, thus we will try to convert the value
+ String sPropertyValue = ((String)propertyValue).trim();
+ if (sPropertyValue.length() == 0)
+ {
+ // We ignore empty value since it cannot be converted
+ continue;
+ }
+ try
+ {
+ propertyValue = m.invoke(null, propertyValue);
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot convert the value '" + propertyValue
+ "' to an Object of type "
+ + oldValue.getClass(), e);
+ // we ignore invalid value
+ continue;
+ }
+ }
+ }
+ // We set the new value
+ settings.put(propertyName, propertyValue);
+ }
+ }
+ }
+
+ /**
* Initialize the current component
* @param mDefinitions the list of all the portal container definition to treat
*/
Modified:
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
===================================================================
---
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-02-19
08:53:30 UTC (rev 1918)
+++
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-02-19
10:21:51 UTC (rev 1919)
@@ -106,7 +106,69 @@
assertTrue(config.isScopeValid("foo", "foo"));
assertTrue(config.isScopeValid("myPortal", "foo"));
assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
-
+ assertTrue(config.hasDefinition());
+
+ // Without dependencies and with no portal container name
+ rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-empty-portal-def.xml");
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getDependencies("foo"));
+ assertNull(config.getDependencies("myPortal"));
+ assertNull(config.getDependencies("myPortal-pcdef"));
+ names = config.getPortalContainerNames("foo");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
+ assertEquals("myPortal",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal-pcdef"));
+ assertEquals("myRest", config.getRestContextName("foo"));
+ assertEquals("myRest", config.getRestContextName("myPortal"));
+ assertEquals("myRest",
config.getRestContextName("myPortal-pcdef"));
+ assertEquals("my-exo-domain", config.getRealmName("foo"));
+ assertEquals("my-exo-domain",
config.getRealmName("myPortal"));
+ assertEquals("my-exo-domain",
config.getRealmName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertTrue(config.isPortalContainerName("myPortal"));
+ assertFalse(config.isPortalContainerName("myPortal-pcdef"));
+
+ // Without dependencies and with no rest context name an realm name
+ rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-empty-portal-def2.xml");
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertNull(config.getDependencies("foo"));
+ assertNull(config.getDependencies("myPortal"));
+ assertNull(config.getDependencies("myPortal-pcdef"));
+ names = config.getPortalContainerNames("foo");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
+ names = config.getPortalContainerNames("myPortal");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal", names.get(0));
+ names = config.getPortalContainerNames("myPortal-pcdef");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals("myPortal-pcdef", names.get(0));
+ assertEquals("myPortal",
config.getPortalContainerName("foo"));
+ assertEquals("myPortal",
config.getPortalContainerName("myPortal"));
+ assertEquals("myPortal-pcdef",
config.getPortalContainerName("myPortal-pcdef"));
+ assertEquals("myRest", config.getRestContextName("foo"));
+ assertEquals("myRest", config.getRestContextName("myPortal"));
+ assertEquals("myRest",
config.getRestContextName("myPortal-pcdef"));
+ assertEquals("my-exo-domain", config.getRealmName("foo"));
+ assertEquals("my-exo-domain",
config.getRealmName("myPortal"));
+ assertEquals("my-exo-domain",
config.getRealmName("myPortal-pcdef"));
+ assertFalse(config.isPortalContainerName("foo"));
+ assertTrue(config.isPortalContainerName("myPortal"));
+ assertTrue(config.isPortalContainerName("myPortal-pcdef"));
+ // Needed for backward compatibility
+ assertTrue(config.isScopeValid("foo", "foo"));
+ assertTrue(config.isScopeValid("myPortal", "foo"));
+ assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
+ assertTrue(config.hasDefinition());
+
// With dependencies
rootContainer =
createRootContainer("portal-container-config-with-default-values-and-with-portal-def2.xml");
config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
@@ -138,6 +200,7 @@
assertFalse(config.isScopeValid("foo", "foo"));
assertFalse(config.isScopeValid("myPortal", "foo"));
assertTrue(config.isScopeValid("myPortal-pcdef", "foo"));
+ assertTrue(config.hasDefinition());
}
public void testSettings()
@@ -294,5 +357,24 @@
assertNull(config.getSetting("foo",
PortalContainerConfig.REALM_SETTING_NAME));
assertNull(config.getSetting("myPortal",
PortalContainerConfig.REALM_SETTING_NAME));
assertEquals("my-exo-domain-pcdef",
config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
+
+ // With both settings internal and external, and with invalid values
+ rootContainer =
createRootContainer("portal-container-config-with-invalid-values.xml");
+ config =
(PortalContainerConfig)rootContainer.getComponentInstanceOfType(PortalContainerConfig.class);
+ assertEquals("value", config.getSetting("myPortal-pcdef",
"internal-empty-value"));
+ assertEquals("", config.getSetting("myPortal-pcdef",
"external-empty-value"));
+ assertEquals("", config.getSetting("myPortal-pcdef",
"fake-value-4-string"));
+ assertEquals(new Integer(10), config.getSetting("myPortal-pcdef",
"fake-value-4-int"));
+ assertEquals(new Integer(10), config.getSetting("myPortal-pcdef",
"invalid-value-4-int"));
+ assertNull(config.getSetting("foo",
PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("myPortal",
PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertEquals("myPortal-pcdef",
config.getSetting("myPortal-pcdef",
+ PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME));
+ assertNull(config.getSetting("foo",
PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("myPortal",
PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertEquals("myRest", config.getSetting("myPortal-pcdef",
PortalContainerConfig.REST_CONTEXT_SETTING_NAME));
+ assertNull(config.getSetting("foo",
PortalContainerConfig.REALM_SETTING_NAME));
+ assertNull(config.getSetting("myPortal",
PortalContainerConfig.REALM_SETTING_NAME));
+ assertEquals("my-exo-domain",
config.getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING_NAME));
}
}
Added:
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-empty-portal-def.xml
===================================================================
---
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-empty-portal-def.xml
(rev 0)
+++
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-empty-portal-def.xml 2010-02-19
10:21:51 UTC (rev 1919)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ 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.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>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the context name of the rest web application -->
+ <field name="restContextName">
+ <string>myRest-pcdef</string>
+ </field>
+ <!-- The name of the realm -->
+ <field name="realmName">
+ <string>my-exo-domain-pcdef</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added:
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-empty-portal-def2.xml
===================================================================
---
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-empty-portal-def2.xml
(rev 0)
+++
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-default-values-and-with-empty-portal-def2.xml 2010-02-19
10:21:51 UTC (rev 1919)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ 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.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>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>myPortal-pcdef</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added:
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-invalid-values.xml
===================================================================
---
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-invalid-values.xml
(rev 0)
+++
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/portal-container-config-with-invalid-values.xml 2010-02-19
10:21:51 UTC (rev 1919)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ 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.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>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <type>org.exoplatform.container.definition.PortalContainerConfig</type>
+ <init-params>
+ <!-- The name of the default portal container -->
+ <value-param>
+ <name>default.portal.container</name>
+ <value>myPortal</value>
+ </value-param>
+ <!-- The name of the default rest ServletContext -->
+ <value-param>
+ <name>default.rest.context</name>
+ <value>myRest</value>
+ </value-param>
+ <!-- The name of the default realm -->
+ <value-param>
+ <name>default.realm.name</name>
+ <value>my-exo-domain</value>
+ </value-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <!-- The full qualified name of the PortalContainerConfig -->
+ <target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>Add PortalContainer Definitions</name>
+ <!-- The name of the method to call on the PortalContainerConfig in order to
register the PortalContainerDefinitions -->
+ <set-method>registerPlugin</set-method>
+ <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
+ <type>org.exoplatform.container.definition.PortalContainerDefinitionPlugin</type>
+ <init-params>
+ <object-param>
+ <name>portal</name>
+ <object
type="org.exoplatform.container.definition.PortalContainerDefinition">
+ <!-- The name of the portal container -->
+ <field name="name">
+ <string>myPortal-pcdef</string>
+ </field>
+ <!-- A map of settings tied to the portal container -->
+ <field name="settings">
+ <map type="java.util.HashMap">
+ <entry>
+ <key>
+ <string>internal-empty-value</string>
+ </key>
+ <value>
+ <string></string>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>external-empty-value</string>
+ </key>
+ <value>
+ <string>value</string>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>fake-value-4-string</string>
+ </key>
+ <value>
+ <string>value</string>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>fake-value-4-int</string>
+ </key>
+ <value>
+ <int>10</int>
+ </value>
+ </entry>
+ <entry>
+ <key>
+ <string>invalid-value-4-int</string>
+ </key>
+ <value>
+ <int>10</int>
+ </value>
+ </entry>
+ </map>
+ </field>
+ <!-- The path to the external properties file -->
+ <field name="externalSettingsPath">
+ <string>classpath:/org/exoplatform/container/definition/settings-with-invalid-values.properties</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Added:
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/settings-with-invalid-values.properties
===================================================================
---
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/settings-with-invalid-values.properties
(rev 0)
+++
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/definition/settings-with-invalid-values.properties 2010-02-19
10:21:51 UTC (rev 1919)
@@ -0,0 +1,5 @@
+external-empty-value=
+internal-empty-value=value
+fake-value-4-string=
+fake-value-4-int=
+invalid-value-4-int=foo
\ No newline at end of file