Author: julien_viet
Date: 2010-03-04 12:27:12 -0500 (Thu, 04 Mar 2010)
New Revision: 1980
Added:
portal/trunk/component/resources/src/test/java/conf/exo.portal.component.resources-configuration.xml
portal/trunk/component/resources/src/test/java/conf/locales-config.xml
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/AbstractResourceBundleTest.java
Removed:
portal/trunk/component/resources/src/main/java/conf/
portal/trunk/component/resources/src/test/java/conf/portal/locales-config.xml
portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml
portal/trunk/component/resources/src/test/java/conf/portal/testjcr/
Modified:
portal/trunk/component/resources/pom.xml
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestExoResourceBundle.java
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestLocaleConfigService.java
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestLocaleConfig.java
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
Log:
- fix resource bundle unit test that were having issues with cache configuration
Modified: portal/trunk/component/resources/pom.xml
===================================================================
--- portal/trunk/component/resources/pom.xml 2010-03-04 17:18:43 UTC (rev 1979)
+++ portal/trunk/component/resources/pom.xml 2010-03-04 17:27:12 UTC (rev 1980)
@@ -26,10 +26,6 @@
<version>3.0.0-CR02-SNAPSHOT</version>
</parent>
- <properties>
- <maven.test.skip>true</maven.test.skip>
- </properties>
-
<modelVersion>4.0.0</modelVersion>
<artifactId>exo.portal.component.resources</artifactId>
<packaging>jar</packaging>
Added:
portal/trunk/component/resources/src/test/java/conf/exo.portal.component.resources-configuration.xml
===================================================================
---
portal/trunk/component/resources/src/test/java/conf/exo.portal.component.resources-configuration.xml
(rev 0)
+++
portal/trunk/component/resources/src/test/java/conf/exo.portal.component.resources-configuration.xml 2010-03-04
17:27:12 UTC (rev 1980)
@@ -0,0 +1,89 @@
+<?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_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <component>
+ <key>org.exoplatform.services.cache.CacheService</key>
+ <jmx-name>cache:type=CacheService</jmx-name>
+ <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>cache.config.default</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field
name="name"><string>default</string></field>
+ <field name="maxSize"><int>300</int></field>
+ <field
name="liveTime"><long>60</long></field>
+ <field
name="distributed"><boolean>false</boolean></field>
+ <field
name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.resources.LocaleConfigService</key>
+
<type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>locale.config.file</name>
+ <value>jar:/conf/locales-config.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.resources.ResourceBundleManager</key>
+ <type>org.exoplatform.services.resources.ResourceBundleManager</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.resources.ResourceBundleService</key>
+
<type>org.exoplatform.services.resources.impl.SimpleResourceBundleService</type>
+ <init-params>
+ <values-param>
+ <name>classpath.resources</name>
+ <description>The resources that start with the following package name
should be load from file system</description>
+ <value>locale.portlet</value>
+ </values-param>
+
+ <values-param>
+ <name>init.resources</name>
+ <description>Store the following resources into the db for the first
launch </description>
+ <value>locale.test.resources.test</value>
+ </values-param>
+
+ <values-param>
+ <name>portal.resource.names</name>
+ <description>The properties files of the portal , those file will be
merged
+ into one ResourceBundle properties </description>
+ <value>local.portal.portal</value>
+ <value>local.portal.custom</value>
+ </values-param>
+ </init-params>
+ </component>
+
+</configuration>
Copied: portal/trunk/component/resources/src/test/java/conf/locales-config.xml (from rev
1974, portal/trunk/component/resources/src/test/java/conf/portal/locales-config.xml)
===================================================================
--- portal/trunk/component/resources/src/test/java/conf/locales-config.xml
(rev 0)
+++ portal/trunk/component/resources/src/test/java/conf/locales-config.xml 2010-03-04
17:27:12 UTC (rev 1980)
@@ -0,0 +1,60 @@
+<?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.
+
+-->
+
+<locales-config>
+ <!--
+ Check
http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt for locale code
+ The encoding parameter will be used for the request response stream.
+ The input-encoding parameter will be used for request setCharacterEncoding(..)
+
+ encoding: ISO-8859-1
+ -->
+
+ <locale-config>
+ <locale>en</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for english locale</description>
+ </locale-config>
+
+ <locale-config>
+ <locale>fr</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for the french locale</description>
+ </locale-config>
+
+ <locale-config>
+ <locale>ar</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for the arabic locale</description>
+ <orientation>rt</orientation>
+ </locale-config>
+
+ <locale-config>
+ <locale>vi</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for the vietnam locale</description>
+ </locale-config>
+</locales-config>
Deleted: portal/trunk/component/resources/src/test/java/conf/portal/locales-config.xml
===================================================================
---
portal/trunk/component/resources/src/test/java/conf/portal/locales-config.xml 2010-03-04
17:18:43 UTC (rev 1979)
+++
portal/trunk/component/resources/src/test/java/conf/portal/locales-config.xml 2010-03-04
17:27:12 UTC (rev 1980)
@@ -1,60 +0,0 @@
-<?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.
-
--->
-
-<locales-config>
- <!--
- Check
http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt for locale code
- The encoding parameter will be used for the request response stream.
- The input-encoding parameter will be used for request setCharacterEncoding(..)
-
- encoding: ISO-8859-1
- -->
-
- <locale-config>
- <locale>en</locale>
- <output-encoding>UTF-8</output-encoding>
- <input-encoding>UTF-8</input-encoding>
- <description>Default configuration for english locale</description>
- </locale-config>
-
- <locale-config>
- <locale>fr</locale>
- <output-encoding>UTF-8</output-encoding>
- <input-encoding>UTF-8</input-encoding>
- <description>Default configuration for the french locale</description>
- </locale-config>
-
- <locale-config>
- <locale>ar</locale>
- <output-encoding>UTF-8</output-encoding>
- <input-encoding>UTF-8</input-encoding>
- <description>Default configuration for the arabic locale</description>
- <orientation>rt</orientation>
- </locale-config>
-
- <locale-config>
- <locale>vi</locale>
- <output-encoding>UTF-8</output-encoding>
- <input-encoding>UTF-8</input-encoding>
- <description>Default configuration for the vietnam locale</description>
- </locale-config>
-</locales-config>
Deleted:
portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml
===================================================================
---
portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml 2010-03-04
17:18:43 UTC (rev 1979)
+++
portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml 2010-03-04
17:27:12 UTC (rev 1980)
@@ -1,90 +0,0 @@
-<?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_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
- <component>
- <key>org.exoplatform.services.cache.CacheService</key>
- <jmx-name>cache:type=CacheService</jmx-name>
- <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
- <init-params>
- <object-param>
- <name>cache.config.default</name>
- <description>The default cache configuration</description>
- <object type="org.exoplatform.services.cache.ExoCacheConfig">
- <field
name="name"><string>default</string></field>
- <field name="maxSize"><int>300</int></field>
- <field
name="liveTime"><long>60</long></field>
- <field
name="distributed"><boolean>false</boolean></field>
- <field
name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
- </object>
- </object-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.resources.LocaleConfigService</key>
-
<type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
- <init-params>
- <value-param>
- <name>locale.config.file</name>
- <value>jar:/conf/portal/locales-config.xml</value>
- </value-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.resources.ResourceBundleManager</key>
- <type>org.exoplatform.services.resources.ResourceBundleManager</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.resources.ResourceBundleService</key>
-
<type>org.exoplatform.services.resources.impl.SimpleResourceBundleService</type>
- <init-params>
- <values-param>
- <name>classpath.resources</name>
- <description>The resources that start with the following package name
should be load from file system</description>
- <value>locale.portlet</value>
- </values-param>
-
- <values-param>
- <name>init.resources</name>
- <description>Store the following resources into the db for the first
launch </description>
- <value>locale.test.resources.test</value>
- </values-param>
-
- <values-param>
- <name>portal.resource.names</name>
- <description>The properties files of the portal , those file will be
merged
- into one ResoruceBundle properties </description>
- <value>local.portal.portal</value>
- <value>local.portal.custom</value>
- </values-param>
- </init-params>
- </component>
-
- <import>jar:/conf/portal/testjcr/test-jcr-configuration.xml</import>
-</configuration>
Added:
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/AbstractResourceBundleTest.java
===================================================================
---
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/AbstractResourceBundleTest.java
(rev 0)
+++
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/AbstractResourceBundleTest.java 2010-03-04
17:27:12 UTC (rev 1980)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 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.services.resources;
+
+import org.exoplatform.component.test.AbstractKernelTest;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path =
"conf/exo.portal.component.resources-configuration.xml")
+})
+public abstract class AbstractResourceBundleTest extends AbstractKernelTest {
+ protected AbstractResourceBundleTest() {
+ }
+
+ protected AbstractResourceBundleTest(String name) {
+ super(name);
+ }
+}
Modified:
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestExoResourceBundle.java
===================================================================
---
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestExoResourceBundle.java 2010-03-04
17:18:43 UTC (rev 1979)
+++
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestExoResourceBundle.java 2010-03-04
17:27:12 UTC (rev 1980)
@@ -19,9 +19,7 @@
package org.exoplatform.services.resources;
-import org.exoplatform.component.test.AbstractGateInTest;
-
-public class TestExoResourceBundle extends AbstractGateInTest
+public class TestExoResourceBundle extends AbstractResourceBundleTest
{
public void testConstructor()
Modified:
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestLocaleConfigService.java
===================================================================
---
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestLocaleConfigService.java 2010-03-04
17:18:43 UTC (rev 1979)
+++
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestLocaleConfigService.java 2010-03-04
17:27:12 UTC (rev 1980)
@@ -20,7 +20,6 @@
package org.exoplatform.services.resources;
import org.exoplatform.commons.utils.PropertyManager;
-import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.configuration.ConfigurationManagerImpl;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -35,7 +34,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public class TestLocaleConfigService extends AbstractGateInTest
+public class TestLocaleConfigService extends AbstractResourceBundleTest
{
public TestLocaleConfigService()
Modified:
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestLocaleConfig.java
===================================================================
---
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestLocaleConfig.java 2010-03-04
17:18:43 UTC (rev 1979)
+++
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestLocaleConfig.java 2010-03-04
17:27:12 UTC (rev 1980)
@@ -19,8 +19,8 @@
package org.exoplatform.services.resources.test;
-import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.PortalContainer;
+import org.exoplatform.services.resources.AbstractResourceBundleTest;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
@@ -33,7 +33,7 @@
* @version: $Id: TestLocaleConfig.java 5799 2006-05-28 17:55:42Z geaz $
* @email: tuan08(a)yahoo.com
*/
-public class TestLocaleConfig extends AbstractGateInTest
+public class TestLocaleConfig extends AbstractResourceBundleTest
{
private LocaleConfigService service_;
@@ -45,8 +45,7 @@
public void setUp() throws Exception
{
- service_ =
-
(LocaleConfigService)PortalContainer.getInstance().getComponentInstanceOfType(LocaleConfigService.class);
+ service_ =
(LocaleConfigService)PortalContainer.getInstance().getComponentInstanceOfType(LocaleConfigService.class);
}
public void tearDown() throws Exception
Modified:
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
===================================================================
---
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2010-03-04
17:18:43 UTC (rev 1979)
+++
portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2010-03-04
17:27:12 UTC (rev 1980)
@@ -19,12 +19,8 @@
package org.exoplatform.services.resources.test;
-import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.services.resources.LocaleConfigService;
-import org.exoplatform.services.resources.Query;
-import org.exoplatform.services.resources.ResourceBundleData;
-import org.exoplatform.services.resources.ResourceBundleService;
+import org.exoplatform.services.resources.*;
import java.util.List;
import java.util.Locale;
@@ -37,7 +33,7 @@
* @since: 0.0
* @email: tuan08(a)yahoo.com
*/
-public class TestResourceBundleService extends AbstractGateInTest
+public class TestResourceBundleService extends AbstractResourceBundleTest
{
final static private String PROPERTIES = "language=en\nproperty=property";