gatein SVN: r1905 - portal/trunk.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-02-28 18:36:37 -0500 (Sun, 28 Feb 2010)
New Revision: 1905
Modified:
portal/trunk/pom.xml
Log:
minor
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-02-28 22:47:55 UTC (rev 1904)
+++ portal/trunk/pom.xml 2010-02-28 23:36:37 UTC (rev 1905)
@@ -621,12 +621,6 @@
<name>java.naming.factory.initial</name>
<value>org.exoplatform.services.naming.SimpleContextFactory</value>
</property>
-
- <property>
- <name>java.util.logging.config.class</name>
- <value>org.exoplatform.component.test.LogConfigurator</value>
- </property>
-
</systemProperties>
</configuration>
</plugin>
14 years, 10 months
gatein SVN: r1904 - portal/trunk/component/test/core/src/main/resources/conf.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-02-28 17:47:55 -0500 (Sun, 28 Feb 2010)
New Revision: 1904
Modified:
portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml
Log:
minor
Modified: portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml
===================================================================
--- portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml 2010-02-28 22:04:29 UTC (rev 1903)
+++ portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml 2010-02-28 22:47:55 UTC (rev 1904)
@@ -24,25 +24,7 @@
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.jboss.cache.transaction.TransactionManagerLookup</key>
- <type>org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.transaction.TransactionService</key>
- <type>org.exoplatform.services.transaction.jbosscache.ArjunaTransactionService</type>
- <init-params>
- <value-param>
- <name>timeout</name>
- <value>300</value>
- </value-param>
- </init-params>
- </component>
--->
-
- <component>
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
<type>org.exoplatform.services.naming.InitialContextInitializer</type>
<init-params>
14 years, 10 months
gatein SVN: r1903 - in portal/trunk: component/application-registry/src/test/java/org/exoplatform/application/gadget and 32 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-02-28 17:04:29 -0500 (Sun, 28 Feb 2010)
New Revision: 1903
Added:
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractKernelTest.java
Modified:
portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java
portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestGadgetRegistryService.java
portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestSourceStorageService.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/TestSerialization.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/TestTypeModel.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/converter/TestConverter.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/factory/TestObjectFactory.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/metadata/TestMetaData.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestBufferingOutputStream.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestOutputStreamPrinter.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestPageListAccess.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestPrinter.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestSafe.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestTextEncoder.java
portal/trunk/component/identity/pom.xml
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestConfigOrganizationService.java
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java
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
portal/trunk/component/scripting/pom.xml
portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestGroovyTemplateEngine.java
portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateCompiler.java
portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateParser.java
portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java
portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java
portal/trunk/component/test/jcr/src/test/java/org/exoplatform/component/test/jcr/BootstrapTestCase.java
portal/trunk/component/test/organization/src/test/java/org/exoplatform/component/test/organization/BootstrapTestCase.java
portal/trunk/component/web/pom.xml
portal/trunk/component/web/src/test/java/org/exoplatform/download/test/TestDownloadService.java
portal/trunk/component/web/src/test/java/org/exoplatform/json/test/TestJSONConverterService.java
portal/trunk/component/web/src/test/java/org/exoplatform/web/command/TestCommandHandler.java
portal/trunk/component/web/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java
portal/trunk/component/web/src/test/java/org/exoplatform/web/filter/TestFilterDefinition.java
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
portal/trunk/component/xml-parser/pom.xml
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestExceptionParser.java
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestFileDetect.java
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestHTMLParser.java
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestNodeParser.java
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestURL.java
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/rss/test/TestRSSParser.java
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/HtmlCharsetDetector.java
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestAttributeParser.java
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestFile.java
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestHTMLTidy.java
portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestParser.java
portal/trunk/webui/core/pom.xml
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/core/renderers/ValueRendererRegistryTestCase.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/test/TestApplication.java
Log:
- added an intermediate AbstractKernelTest in addition of AbstractGateInTest
- now all the unit test to extend directly or indirectly AbstractGateInTest
Modified: portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java
===================================================================
--- portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -18,10 +18,7 @@
*/
package org.exoplatform.application;
-import org.exoplatform.component.test.AbstractGateInTest;
-import org.exoplatform.component.test.ConfigurationUnit;
-import org.exoplatform.component.test.ConfiguredBy;
-import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.component.test.*;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -33,7 +30,7 @@
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.application-registry-configuration.xml"),
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration1.xml")
})
-public abstract class AbstractApplicationRegistryTest extends AbstractGateInTest
+public abstract class AbstractApplicationRegistryTest extends AbstractKernelTest
{
/*
Modified: portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestGadgetRegistryService.java
===================================================================
--- portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestGadgetRegistryService.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestGadgetRegistryService.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,8 +19,8 @@
package org.exoplatform.application.gadget;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.test.BasicTestCase;
import java.util.List;
@@ -32,7 +32,7 @@
* thanhtungty(a)gmail.com
* Jul 11, 2008
*/
-public abstract class TestGadgetRegistryService extends BasicTestCase
+public abstract class TestGadgetRegistryService extends AbstractGateInTest
{
private GadgetRegistryService service_;
Modified: portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestSourceStorageService.java
===================================================================
--- portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestSourceStorageService.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestSourceStorageService.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,7 +19,7 @@
package org.exoplatform.application.gadget;
-import org.exoplatform.test.BasicTestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
/**
* todo julien : fix or remove
@@ -30,7 +30,7 @@
* @since: 0.0
* @email: tuan08(a)yahoo.com
*/
-public class TestSourceStorageService extends BasicTestCase
+public class TestSourceStorageService extends AbstractGateInTest
{
private SourceStorage service_;
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -20,10 +20,7 @@
import org.chromattic.api.Chromattic;
import org.chromattic.api.ChromatticSession;
-import org.exoplatform.component.test.AbstractGateInTest;
-import org.exoplatform.component.test.ConfigurationUnit;
-import org.exoplatform.component.test.ConfiguredBy;
-import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.component.test.*;
import org.exoplatform.container.PortalContainer;
import javax.jcr.Session;
@@ -37,7 +34,7 @@
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.common-configuration.xml")
})
-public class ChromatticIntegrationTestCase extends AbstractGateInTest
+public class ChromatticIntegrationTestCase extends AbstractKernelTest
{
/** . */
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/TestSerialization.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/TestSerialization.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/TestSerialization.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,9 +19,8 @@
package org.exoplatform.commons.serialization;
-import junit.framework.TestCase;
-import org.exoplatform.commons.serialization.SerializationContext;
import org.exoplatform.commons.serialization.model.TypeDomain;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.ByteArrayInputStream;
import java.io.NotSerializableException;
@@ -30,7 +29,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestSerialization extends TestCase
+public class TestSerialization extends AbstractGateInTest
{
public void testState() throws Exception
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/TestTypeModel.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/TestTypeModel.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/TestTypeModel.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,8 +19,8 @@
package org.exoplatform.commons.serialization;
-import junit.framework.TestCase;
import org.exoplatform.commons.serialization.model.*;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.util.Map;
@@ -28,7 +28,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestTypeModel extends TestCase
+public class TestTypeModel extends AbstractGateInTest
{
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/converter/TestConverter.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/converter/TestConverter.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/converter/TestConverter.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -20,10 +20,10 @@
package org.exoplatform.commons.serialization.converter;
import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
import org.exoplatform.commons.serialization.SerializationContext;
import org.exoplatform.commons.serialization.api.TypeConverter;
import org.exoplatform.commons.serialization.model.TypeDomain;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.InvalidObjectException;
@@ -31,7 +31,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestConverter extends TestCase
+public class TestConverter extends AbstractGateInTest
{
public void testConvertSerializedType() throws Exception
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/factory/TestObjectFactory.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/factory/TestObjectFactory.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/factory/TestObjectFactory.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,9 +19,9 @@
package org.exoplatform.commons.serialization.factory;
-import junit.framework.TestCase;
import org.exoplatform.commons.serialization.SerializationContext;
import org.exoplatform.commons.serialization.model.TypeDomain;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.InvalidClassException;
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestObjectFactory extends TestCase
+public class TestObjectFactory extends AbstractGateInTest
{
public void testCustomFactory() throws Exception
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/metadata/TestMetaData.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/metadata/TestMetaData.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/serialization/metadata/TestMetaData.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,12 +19,12 @@
package org.exoplatform.commons.serialization.metadata;
-import junit.framework.TestCase;
import org.exoplatform.commons.serialization.model.ClassTypeModel;
import org.exoplatform.commons.serialization.model.ConvertedTypeModel;
import org.exoplatform.commons.serialization.model.SerializationMode;
import org.exoplatform.commons.serialization.model.TypeDomain;
import org.exoplatform.commons.serialization.model.metadata.DomainMetaData;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.util.ArrayList;
import java.util.LinkedList;
@@ -33,7 +33,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestMetaData extends TestCase
+public class TestMetaData extends AbstractGateInTest
{
public void testSerializedObjectClassType() throws Exception
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestBufferingOutputStream.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestBufferingOutputStream.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestBufferingOutputStream.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -18,18 +18,17 @@
*/
package org.exoplatform.commons.utils;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestBufferingOutputStream extends TestCase
+public class TestBufferingOutputStream extends AbstractGateInTest
{
private ByteArrayOutputStream bytes = new ByteArrayOutputStream();
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestOutputStreamPrinter.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestOutputStreamPrinter.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestOutputStreamPrinter.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -20,7 +20,7 @@
package org.exoplatform.commons.utils;
import junit.framework.Assert;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.gatein.common.io.UndeclaredIOException;
import java.io.IOException;
@@ -31,7 +31,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestOutputStreamPrinter extends TestCase
+public class TestOutputStreamPrinter extends AbstractGateInTest
{
static final int NOOP = -1;
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestPageListAccess.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestPageListAccess.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestPageListAccess.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -20,7 +20,7 @@
package org.exoplatform.commons.utils;
import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.*;
import java.util.List;
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestPageListAccess extends TestCase
+public class TestPageListAccess extends AbstractGateInTest
{
private final String[] l = {"0", "1", "2", "3", "4", "5", "6"};
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestPrinter.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestPrinter.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestPrinter.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,7 +19,7 @@
package org.exoplatform.commons.utils;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.IOException;
@@ -27,7 +27,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestPrinter extends TestCase
+public class TestPrinter extends AbstractGateInTest
{
private MyPrinter printer;
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestSafe.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestSafe.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestSafe.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -20,7 +20,7 @@
package org.exoplatform.commons.utils;
import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
@@ -30,7 +30,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestSafe extends TestCase
+public class TestSafe extends AbstractGateInTest
{
public TestSafe()
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestTextEncoder.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestTextEncoder.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/utils/TestTextEncoder.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,7 +19,7 @@
package org.exoplatform.commons.utils;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -31,7 +31,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestTextEncoder extends TestCase
+public class TestTextEncoder extends AbstractGateInTest
{
public void testA() throws IOException
Modified: portal/trunk/component/identity/pom.xml
===================================================================
--- portal/trunk/component/identity/pom.xml 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/identity/pom.xml 2010-02-28 22:04:29 UTC (rev 1903)
@@ -74,11 +74,17 @@
<artifactId>picketlink-idm-cache</artifactId>
</dependency>
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.test.core</artifactId>
+ <version>3.0.0-CR02-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>javax.resource</groupId>
Modified: portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestConfigOrganizationService.java
===================================================================
--- portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestConfigOrganizationService.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestConfigOrganizationService.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -22,12 +22,12 @@
package org.exoplatform.services.organization;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.ComponentRequestLifecycle;
import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.services.organization.idm.Config;
import org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl;
-import org.exoplatform.test.BasicTestCase;
import java.util.ArrayList;
import java.util.List;
@@ -37,7 +37,7 @@
* Oct 27, 2005
*/
-public class TestConfigOrganizationService extends BasicTestCase
+public class TestConfigOrganizationService extends AbstractGateInTest
{
static String Group1 = "Group1";
Modified: portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
===================================================================
--- portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -20,11 +20,11 @@
package org.exoplatform.services.organization;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.ComponentRequestLifecycle;
import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.services.organization.idm.UserDAOImpl;
-import org.exoplatform.test.BasicTestCase;
import java.util.ArrayList;
import java.util.List;
@@ -34,7 +34,7 @@
* Oct 27, 2005
*/
-public class TestOrganizationService extends BasicTestCase
+public class TestOrganizationService extends AbstractGateInTest
{
static String Group1 = "Group1";
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,10 +19,7 @@
package org.exoplatform.portal.config;
import org.exoplatform.commons.chromattic.ChromatticManager;
-import org.exoplatform.component.test.AbstractGateInTest;
-import org.exoplatform.component.test.ConfigurationUnit;
-import org.exoplatform.component.test.ConfiguredBy;
-import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.component.test.*;
import org.exoplatform.container.PortalContainer;
/**
@@ -35,7 +32,7 @@
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration1.xml"),
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration2.xml")
})
-public abstract class AbstractPortalTest extends AbstractGateInTest
+public abstract class AbstractPortalTest extends AbstractKernelTest
{
public AbstractPortalTest()
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -22,7 +22,6 @@
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.test.BasicTestCase;
import java.util.concurrent.atomic.AtomicBoolean;
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -21,7 +21,6 @@
import org.exoplatform.container.PortalContainer;
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.test.BasicTestCase;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.config;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.portal.application.PortletPreferences.PortletPreferencesSet;
import org.exoplatform.portal.config.model.Application;
import org.exoplatform.portal.config.model.Page;
@@ -28,7 +29,6 @@
import org.exoplatform.portal.config.model.Page.PageSet;
import org.exoplatform.portal.pom.spi.portlet.Portlet;
import org.exoplatform.portal.pom.spi.portlet.PortletBuilder;
-import org.exoplatform.test.BasicTestCase;
import org.jibx.runtime.BindingDirectory;
import org.jibx.runtime.IBindingFactory;
import org.jibx.runtime.IMarshallingContext;
@@ -44,7 +44,7 @@
* @since: 0.0
* @email: tuan08(a)yahoo.com
*/
-public class TestJIBXXmlMapping extends BasicTestCase
+public class TestJIBXXmlMapping extends AbstractGateInTest
{
public TestJIBXXmlMapping(String name)
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -30,7 +30,6 @@
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.test.BasicTestCase;
import java.util.Arrays;
import java.util.GregorianCalendar;
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,7 +19,7 @@
package org.exoplatform.portal.config.security;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.UserACLMetaData;
import org.exoplatform.portal.config.model.Page;
@@ -39,7 +39,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class AbstractTestUserACL extends TestCase
+public abstract class AbstractTestUserACL extends AbstractGateInTest
{
protected UserACL ua;
Modified: portal/trunk/component/resources/pom.xml
===================================================================
--- portal/trunk/component/resources/pom.xml 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/resources/pom.xml 2010-02-28 22:04:29 UTC (rev 1903)
@@ -79,10 +79,17 @@
<version>3.0.0-CR02-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.test.core</artifactId>
+ <version>3.0.0-CR02-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
</project>
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-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestExoResourceBundle.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,9 +19,9 @@
package org.exoplatform.services.resources;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
-public class TestExoResourceBundle extends TestCase
+public class TestExoResourceBundle extends AbstractGateInTest
{
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-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/TestLocaleConfigService.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,9 +19,8 @@
package org.exoplatform.services.resources;
-import junit.framework.TestCase;
-
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;
@@ -36,7 +35,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestLocaleConfigService extends TestCase
+public class TestLocaleConfigService extends AbstractGateInTest
{
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-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestLocaleConfig.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,13 +19,12 @@
package org.exoplatform.services.resources.test;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
-import org.exoplatform.test.BasicTestCase;
import java.util.Collection;
-import java.util.Comparator;
import java.util.Locale;
/**
@@ -34,7 +33,7 @@
* @version: $Id: TestLocaleConfig.java 5799 2006-05-28 17:55:42Z geaz $
* @email: tuan08(a)yahoo.com
*/
-public class TestLocaleConfig extends BasicTestCase
+public class TestLocaleConfig extends AbstractGateInTest
{
private LocaleConfigService service_;
@@ -76,21 +75,20 @@
assertTrue(locales.size() == 4);
Locale vnlocale = service_.getLocaleConfig("vi").getLocale();
- hasObjectInCollection(vnlocale, locales, new LocaleComparator());
- hasObjectInCollection(Locale.ENGLISH, locales, new LocaleComparator());
- hasObjectInCollection(Locale.FRENCH, locales, new LocaleComparator());
+ assertContains(locales, vnlocale);
+ assertContains(locales, Locale.ENGLISH);
+ assertContains(locales, Locale.FRENCH);
}
- public static class LocaleComparator implements Comparator
+ private void assertContains(Collection<LocaleConfig> configs, Locale locale)
{
-
- public int compare(Object o1, Object o2)
+ for (LocaleConfig config : configs)
{
- Locale locale1 = (Locale)o1;
- LocaleConfig localse2 = (LocaleConfig)o2;
- if (locale1.equals(localse2.getLocale()))
- return 0;
- return -1;
+ if (config.getLocale().equals(locale))
+ {
+ return;
+ }
}
+ fail("Was expecting locale " + locale + " to be present in " + configs);
}
}
\ No newline at end of file
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-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,12 +19,12 @@
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.test.BasicTestCase;
import java.util.List;
import java.util.Locale;
@@ -37,7 +37,7 @@
* @since: 0.0
* @email: tuan08(a)yahoo.com
*/
-public class TestResourceBundleService extends BasicTestCase
+public class TestResourceBundleService extends AbstractGateInTest
{
final static private String PROPERTIES = "language=en\nproperty=property";
Modified: portal/trunk/component/scripting/pom.xml
===================================================================
--- portal/trunk/component/scripting/pom.xml 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/scripting/pom.xml 2010-02-28 22:04:29 UTC (rev 1903)
@@ -58,5 +58,12 @@
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.test.core</artifactId>
+ <version>3.0.0-CR02-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified: portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestGroovyTemplateEngine.java
===================================================================
--- portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestGroovyTemplateEngine.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestGroovyTemplateEngine.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.groovyscript;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.IOException;
@@ -26,7 +26,7 @@
* @author <a href="mailto:trong.tran@exoplatform.com">Trong Tran</a>
* @version $Revision$
*/
-public class TestGroovyTemplateEngine extends TestCase
+public class TestGroovyTemplateEngine extends AbstractGateInTest
{
public void testFileName() throws IOException, TemplateCompilationException
{
Modified: portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateCompiler.java
===================================================================
--- portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateCompiler.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateCompiler.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.groovyscript;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.IOException;
@@ -26,7 +26,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestTemplateCompiler extends TestCase
+public class TestTemplateCompiler extends AbstractGateInTest
{
/** . */
Modified: portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateParser.java
===================================================================
--- portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateParser.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateParser.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -18,10 +18,7 @@
*/
package org.exoplatform.groovyscript;
-import junit.framework.TestCase;
-import org.exoplatform.groovyscript.TemplateSection;
-import org.exoplatform.groovyscript.SectionType;
-import org.exoplatform.groovyscript.TemplateParser;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.IOException;
import java.util.Arrays;
@@ -32,7 +29,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestTemplateParser extends TestCase
+public class TestTemplateParser extends AbstractGateInTest
{
/** . */
Modified: portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java
===================================================================
--- portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -18,9 +18,9 @@
*/
package org.exoplatform.groovyscript;
-import junit.framework.TestCase;
import org.exoplatform.commons.utils.CharsetTextEncoder;
import org.exoplatform.commons.utils.OutputStreamPrinter;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.awt.*;
import java.io.*;
@@ -32,7 +32,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class TestTemplateRendering extends TestCase
+public class TestTemplateRendering extends AbstractGateInTest
{
public void testOutputStreamWriter() throws Exception
Modified: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -18,20 +18,13 @@
*/
package org.exoplatform.component.test;
-import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.component.RequestLifeCycle;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
-import java.io.File;
-import java.io.FilenameFilter;
import java.util.*;
/**
- * An abstract test that takes care of running the unit tests with the semantic described by the
- * {#link GateInTestClassLoader}.
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -39,18 +32,11 @@
public abstract class AbstractGateInTest extends TestCase
{
- /** The system property for gatein tmp dir. */
- private static final String TMP_DIR = "gatein.test.tmp.dir";
-
/** . */
protected final Logger log = LoggerFactory.getLogger(getClass());
- /** . */
- private PortalContainer container;
-
protected AbstractGateInTest()
{
- super();
}
protected AbstractGateInTest(String name)
@@ -58,26 +44,22 @@
super(name);
}
- public PortalContainer getContainer()
+ protected void beforeRunBare() throws Exception
{
- return container;
+ //
}
- protected void begin()
+ /**
+ * After the run base, it should not throw anything as it is executed in a finally clause.
+ */
+ protected void afterRunBare()
{
- RequestLifeCycle.begin(container);
+ //
}
- protected void end()
- {
- RequestLifeCycle.end();
- }
-
@Override
- public void runBare() throws Throwable
+ public final void runBare() throws Throwable
{
- ClassLoader realClassLoader = Thread.currentThread().getContextClassLoader();
-
// Patch a bug with maven that does not pass properly the system property
// with an empty value
if ("org.hsqldb.jdbcDriver".equals(System.getProperty("gatein.test.datasource.driver")))
@@ -86,7 +68,7 @@
}
//
- log.info("Listing gatein system properties:");
+ log.info("Running unit test:" + getName());
for (Map.Entry<?, ?> entry : System.getProperties().entrySet())
{
if (entry.getKey() instanceof String)
@@ -96,118 +78,32 @@
{
log.info(key + "=" + entry.getValue());
}
- }
- }
-
- //
- Set<String> rootConfigPaths = new HashSet<String>();
- rootConfigPaths.add("conf/root-configuration.xml");
-
- //
- Set<String> portalConfigPaths = new HashSet<String>();
- portalConfigPaths.add("conf/portal-configuration.xml");
-
- //
- EnumMap<ContainerScope, Set<String>> configs = new EnumMap<ContainerScope, Set<String>>(ContainerScope.class);
- configs.put(ContainerScope.ROOT, rootConfigPaths);
- configs.put(ContainerScope.PORTAL, portalConfigPaths);
-
- //
- ConfiguredBy cfBy = getClass().getAnnotation(ConfiguredBy.class);
- if (cfBy != null)
- {
- for (ConfigurationUnit src : cfBy.value())
- {
- configs.get(src.scope()).add(src.path());
- }
- }
-
- // Take care of creating tmp directory for unit test
- if (System.getProperty(TMP_DIR) == null)
- {
- // Get base dir set by maven or die
- File targetDir = new File(new File(System.getProperty("basedir")), "target");
- if (!targetDir.exists())
- {
- throw new AssertionFailedError("Target dir for unit test does not exist");
- }
- if (!targetDir.isDirectory())
- {
- throw new AssertionFailedError("Target dir is not a directory");
- }
- if (!targetDir.canWrite())
- {
- throw new AssertionFailedError("Target dir is not writable");
- }
-
- //
- Set<String> fileNames = new HashSet<String>();
- for (File child : targetDir.listFiles(new FilenameFilter()
- {
- public boolean accept(File dir, String name)
+ else
{
- return name.startsWith("gateintest-");
+ log.debug(key + "=" + entry.getValue());
}
- }))
- {
- fileNames.add(child.getName());
}
-
- //
- String fileName;
- int count = 0;
- while (true)
- {
- fileName = "gateintest-" + count;
- if (!fileNames.contains(fileName)) {
- break;
- }
- count++;
- }
-
- //
- File tmp = new File(targetDir, fileName);
- if (!tmp.mkdirs())
- {
- throw new AssertionFailedError("Could not create directory " + tmp.getCanonicalPath());
- }
-
- //
- System.setProperty(TMP_DIR, tmp.getCanonicalPath());
}
//
-// List<Throwable> failures = new ArrayList<Throwable>();
+ beforeRunBare();
//
try
{
- ClassLoader testClassLoader = new GateInTestClassLoader(realClassLoader, rootConfigPaths, portalConfigPaths);
- Thread.currentThread().setContextClassLoader(testClassLoader);
-
- // Boot the container
- container = PortalContainer.getInstance();
-
- // Execute test
super.runBare();
+ log.info("Unit test " + getName() + " completed");
}
- finally
+ catch (Throwable throwable)
{
- container = null;
+ log.error("Unit test " + getName() + " did not complete", throwable);
//
- Thread.currentThread().setContextClassLoader(realClassLoader);
+ throw throwable;
}
-
- //
-/*
- if (failures.size() > 0)
+ finally
{
- Throwable failure = failures.get(0);
- AssertionFailedError afe = new AssertionFailedError();
- afe.initCause(failure);
- throw afe;
+ afterRunBare();
}
-*/
}
}
Added: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractKernelTest.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractKernelTest.java (rev 0)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractKernelTest.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -0,0 +1,187 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.component.test;
+
+import junit.framework.AssertionFailedError;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.EnumMap;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * An abstract test that takes care of running the unit tests with the semantic described by the
+ * {#link GateInTestClassLoader}.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class AbstractKernelTest extends AbstractGateInTest
+{
+
+ /** The system property for gatein tmp dir. */
+ private static final String TMP_DIR = "gatein.test.tmp.dir";
+
+ /** . */
+ private PortalContainer container;
+
+ /** . */
+ private ClassLoader realClassLoader;
+
+ protected AbstractKernelTest()
+ {
+ super();
+ }
+
+ protected AbstractKernelTest(String name)
+ {
+ super(name);
+ }
+
+ public PortalContainer getContainer()
+ {
+ return container;
+ }
+
+ protected void begin()
+ {
+ RequestLifeCycle.begin(container);
+ }
+
+ protected void end()
+ {
+ RequestLifeCycle.end();
+ }
+
+ @Override
+ protected void beforeRunBare() throws Exception
+ {
+ realClassLoader = Thread.currentThread().getContextClassLoader();
+
+ //
+ Set<String> rootConfigPaths = new HashSet<String>();
+ rootConfigPaths.add("conf/root-configuration.xml");
+
+ //
+ Set<String> portalConfigPaths = new HashSet<String>();
+ portalConfigPaths.add("conf/portal-configuration.xml");
+
+ //
+ EnumMap<ContainerScope, Set<String>> configs = new EnumMap<ContainerScope, Set<String>>(ContainerScope.class);
+ configs.put(ContainerScope.ROOT, rootConfigPaths);
+ configs.put(ContainerScope.PORTAL, portalConfigPaths);
+
+ //
+ ConfiguredBy cfBy = getClass().getAnnotation(ConfiguredBy.class);
+ if (cfBy != null)
+ {
+ for (ConfigurationUnit src : cfBy.value())
+ {
+ configs.get(src.scope()).add(src.path());
+ }
+ }
+
+ // Take care of creating tmp directory for unit test
+ if (System.getProperty(TMP_DIR) == null)
+ {
+ // Get base dir set by maven or die
+ File targetDir = new File(new File(System.getProperty("basedir")), "target");
+ if (!targetDir.exists())
+ {
+ throw new AssertionFailedError("Target dir for unit test does not exist");
+ }
+ if (!targetDir.isDirectory())
+ {
+ throw new AssertionFailedError("Target dir is not a directory");
+ }
+ if (!targetDir.canWrite())
+ {
+ throw new AssertionFailedError("Target dir is not writable");
+ }
+
+ //
+ Set<String> fileNames = new HashSet<String>();
+ for (File child : targetDir.listFiles(new FilenameFilter()
+ {
+ public boolean accept(File dir, String name)
+ {
+ return name.startsWith("gateintest-");
+ }
+ }))
+ {
+ fileNames.add(child.getName());
+ }
+
+ //
+ String fileName;
+ int count = 0;
+ while (true)
+ {
+ fileName = "gateintest-" + count;
+ if (!fileNames.contains(fileName)) {
+ break;
+ }
+ count++;
+ }
+
+ //
+ File tmp = new File(targetDir, fileName);
+ if (!tmp.mkdirs())
+ {
+ throw new AssertionFailedError("Could not create directory " + tmp.getCanonicalPath());
+ }
+
+ //
+ System.setProperty(TMP_DIR, tmp.getCanonicalPath());
+ }
+
+ //
+ ClassLoader testClassLoader = new GateInTestClassLoader(realClassLoader, rootConfigPaths, portalConfigPaths);
+ Thread.currentThread().setContextClassLoader(testClassLoader);
+
+ // Boot the container
+ container = PortalContainer.getInstance();
+
+ //
+// List<Throwable> failures = new ArrayList<Throwable>();
+ }
+
+ @Override
+ protected void afterRunBare()
+ {
+ container = null;
+
+ //
+ Thread.currentThread().setContextClassLoader(realClassLoader);
+
+/*
+ if (failures.size() > 0)
+ {
+ Throwable failure = failures.get(0);
+ AssertionFailedError afe = new AssertionFailedError();
+ afe.initCause(failure);
+ throw afe;
+ }
+*/
+ }
+}
Modified: portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java
===================================================================
--- portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -36,7 +36,7 @@
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/jcr/jcr-configuration.xml"),
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/test-configuration.xml")
})
-public class BootstrapTestCase extends AbstractGateInTest
+public class BootstrapTestCase extends AbstractKernelTest
{
/** . */
Modified: portal/trunk/component/test/jcr/src/test/java/org/exoplatform/component/test/jcr/BootstrapTestCase.java
===================================================================
--- portal/trunk/component/test/jcr/src/test/java/org/exoplatform/component/test/jcr/BootstrapTestCase.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/test/jcr/src/test/java/org/exoplatform/component/test/jcr/BootstrapTestCase.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -18,10 +18,7 @@
*/
package org.exoplatform.component.test.jcr;
-import org.exoplatform.component.test.AbstractGateInTest;
-import org.exoplatform.component.test.ConfigurationUnit;
-import org.exoplatform.component.test.ConfiguredBy;
-import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.component.test.*;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.core.ManageableRepository;
@@ -33,7 +30,7 @@
* @version $Revision$
*/
@ConfiguredBy({@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml")})
-public class BootstrapTestCase extends AbstractGateInTest
+public class BootstrapTestCase extends AbstractKernelTest
{
public void testWorkspace() throws Exception
Modified: portal/trunk/component/test/organization/src/test/java/org/exoplatform/component/test/organization/BootstrapTestCase.java
===================================================================
--- portal/trunk/component/test/organization/src/test/java/org/exoplatform/component/test/organization/BootstrapTestCase.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/test/organization/src/test/java/org/exoplatform/component/test/organization/BootstrapTestCase.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -23,10 +23,7 @@
package org.exoplatform.component.test.organization;
-import org.exoplatform.component.test.AbstractGateInTest;
-import org.exoplatform.component.test.ConfigurationUnit;
-import org.exoplatform.component.test.ConfiguredBy;
-import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.component.test.*;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.database.HibernateService;
import org.exoplatform.services.organization.OrganizationService;
@@ -34,7 +31,7 @@
import org.exoplatform.services.organization.impl.UserImpl;
@ConfiguredBy({@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.organization-configuration.xml")})
-public class BootstrapTestCase extends AbstractGateInTest
+public class BootstrapTestCase extends AbstractKernelTest
{
public void testWorkspace() throws Exception
Modified: portal/trunk/component/web/pom.xml
===================================================================
--- portal/trunk/component/web/pom.xml 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/web/pom.xml 2010-02-28 22:04:29 UTC (rev 1903)
@@ -105,6 +105,13 @@
</dependency>
<dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.test.core</artifactId>
+ <version>3.0.0-CR02-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-tomcat</artifactId>
<version>5.1.0.GA</version>
Modified: portal/trunk/component/web/src/test/java/org/exoplatform/download/test/TestDownloadService.java
===================================================================
--- portal/trunk/component/web/src/test/java/org/exoplatform/download/test/TestDownloadService.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/web/src/test/java/org/exoplatform/download/test/TestDownloadService.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,8 +19,8 @@
package org.exoplatform.download.test;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.download.DownloadService;
-import org.exoplatform.test.BasicTestCase;
/**
* Created by The eXo Platform SARL
@@ -28,7 +28,7 @@
* tuan08(a)users.sourceforge.net
* Dec 26, 2005
*/
-public class TestDownloadService extends BasicTestCase
+public class TestDownloadService extends AbstractGateInTest
{
private DownloadService service_;
Modified: portal/trunk/component/web/src/test/java/org/exoplatform/json/test/TestJSONConverterService.java
===================================================================
--- portal/trunk/component/web/src/test/java/org/exoplatform/json/test/TestJSONConverterService.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/web/src/test/java/org/exoplatform/json/test/TestJSONConverterService.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,11 +19,11 @@
package org.exoplatform.json.test;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.json.BeanToJSONPlugin;
import org.exoplatform.json.JSONMap;
import org.exoplatform.json.JSONService;
import org.exoplatform.json.MapToJSONPlugin;
-import org.exoplatform.test.BasicTestCase;
import java.util.ArrayList;
import java.util.HashMap;
@@ -36,7 +36,7 @@
* nhudinhthuan(a)exoplatform.com
* Mar 26, 2007
*/
-public class TestJSONConverterService extends BasicTestCase
+public class TestJSONConverterService extends AbstractGateInTest
{
private JSONService service_;
Modified: portal/trunk/component/web/src/test/java/org/exoplatform/web/command/TestCommandHandler.java
===================================================================
--- portal/trunk/component/web/src/test/java/org/exoplatform/web/command/TestCommandHandler.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/web/src/test/java/org/exoplatform/web/command/TestCommandHandler.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,7 +19,7 @@
package org.exoplatform.web.command;
-import org.exoplatform.test.BasicTestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.web.WebAppController;
import java.util.HashMap;
@@ -34,7 +34,7 @@
* nhudinhthuan(a)exoplatform.com
* Mar 26, 2007
*/
-public class TestCommandHandler extends BasicTestCase
+public class TestCommandHandler extends AbstractGateInTest
{
public TestCommandHandler(String name)
Modified: portal/trunk/component/web/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java
===================================================================
--- portal/trunk/component/web/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/web/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,7 +19,7 @@
package org.exoplatform.web.filter;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.BufferedReader;
import java.io.IOException;
@@ -47,7 +47,7 @@
* nicolas.filotto(a)exoplatform.com
* 25 sept. 2009
*/
-public class TestExtensibleFilter extends TestCase
+public class TestExtensibleFilter extends AbstractGateInTest
{
public void testDoFilter() throws IOException, ServletException
Modified: portal/trunk/component/web/src/test/java/org/exoplatform/web/filter/TestFilterDefinition.java
===================================================================
--- portal/trunk/component/web/src/test/java/org/exoplatform/web/filter/TestFilterDefinition.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/web/src/test/java/org/exoplatform/web/filter/TestFilterDefinition.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,7 +19,7 @@
package org.exoplatform.web.filter;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.util.ArrayList;
import java.util.Arrays;
@@ -30,7 +30,7 @@
* nicolas.filotto(a)exoplatform.com
* 25 sept. 2009
*/
-public class TestFilterDefinition extends TestCase
+public class TestFilterDefinition extends AbstractGateInTest
{
public void testMatch()
Modified: portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
===================================================================
--- portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -23,10 +23,7 @@
package org.gatein.portal.wsrp.state.consumer;
-import org.exoplatform.component.test.AbstractGateInTest;
-import org.exoplatform.component.test.ConfigurationUnit;
-import org.exoplatform.component.test.ConfiguredBy;
-import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.component.test.*;
import org.gatein.pc.federation.impl.FederatingPortletInvokerService;
import org.gatein.wsrp.WSRPConsumer;
import org.gatein.wsrp.consumer.ConsumerException;
@@ -47,7 +44,7 @@
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.wsrp-configuration.xml")
})
-public class ConsumerRegistryTestCase extends AbstractGateInTest
+public class ConsumerRegistryTestCase extends AbstractKernelTest
{
private JCRConsumerRegistry registry;
Modified: portal/trunk/component/xml-parser/pom.xml
===================================================================
--- portal/trunk/component/xml-parser/pom.xml 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/pom.xml 2010-02-28 22:04:29 UTC (rev 1903)
@@ -46,6 +46,13 @@
<artifactId>commons-httpclient</artifactId>
<scope>compile</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.test.core</artifactId>
+ <version>3.0.0-CR02-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<testResources>
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestExceptionParser.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestExceptionParser.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestExceptionParser.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,6 +19,7 @@
package org.exoplatform.services.parser.html.test;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.services.html.HTMLDocument;
import org.exoplatform.services.html.HTMLNode;
import org.exoplatform.services.html.Name;
@@ -27,7 +28,6 @@
import org.exoplatform.services.html.path.NodePath;
import org.exoplatform.services.html.path.NodePathParser;
import org.exoplatform.services.html.path.NodePathUtil;
-import org.exoplatform.test.BasicTestCase;
import java.io.File;
import java.util.List;
@@ -38,7 +38,7 @@
* nhudinhthuan(a)exoplatform.com
* Nov 30, 2006
*/
-public class TestExceptionParser extends BasicTestCase
+public class TestExceptionParser extends AbstractGateInTest
{
private File file_;
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestFileDetect.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestFileDetect.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestFileDetect.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,6 +19,7 @@
package org.exoplatform.services.parser.html.test;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.services.html.HTMLDocument;
import org.exoplatform.services.html.HTMLNode;
import org.exoplatform.services.html.Name;
@@ -26,7 +27,6 @@
import org.exoplatform.services.html.path.NodePath;
import org.exoplatform.services.html.path.NodePathParser;
import org.exoplatform.services.html.path.NodePathUtil;
-import org.exoplatform.test.BasicTestCase;
import java.io.File;
import java.net.URL;
@@ -35,7 +35,7 @@
* Created by The eXo Platform SARL Author : Nhu Dinh Thuan
* nhudinhthuan(a)exoplatform.com Nov 29, 2006
*/
-public class TestFileDetect extends BasicTestCase
+public class TestFileDetect extends AbstractGateInTest
{
private File file_;
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestHTMLParser.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestHTMLParser.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestHTMLParser.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -25,6 +25,7 @@
* laivankhoi46pm1(a)yahoo.com
* Nov 28, 2006
*/
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.services.html.HTMLDocument;
import org.exoplatform.services.html.HTMLNode;
import org.exoplatform.services.html.Name;
@@ -35,13 +36,12 @@
import org.exoplatform.services.token.attribute.Attribute;
import org.exoplatform.services.token.attribute.AttributeParser;
import org.exoplatform.services.token.attribute.Attributes;
-import org.exoplatform.test.BasicTestCase;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
-public class TestHTMLParser extends BasicTestCase
+public class TestHTMLParser extends AbstractGateInTest
{
private File file_;
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestNodeParser.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestNodeParser.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestNodeParser.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,6 +19,7 @@
package org.exoplatform.services.parser.html.test;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.services.html.HTMLDocument;
import org.exoplatform.services.html.HTMLNode;
import org.exoplatform.services.html.Name;
@@ -27,7 +28,6 @@
import org.exoplatform.services.html.path.NodePath;
import org.exoplatform.services.html.path.NodePathParser;
import org.exoplatform.services.html.path.NodePathUtil;
-import org.exoplatform.test.BasicTestCase;
import java.io.File;
@@ -37,7 +37,7 @@
* nhudinhthuan(a)exoplatform.com
* Nov 29, 2006
*/
-public class TestNodeParser extends BasicTestCase
+public class TestNodeParser extends AbstractGateInTest
{
private File file_;
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestURL.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestURL.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/html/test/TestURL.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,6 +19,7 @@
package org.exoplatform.services.parser.html.test;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.services.html.HTMLDocument;
import org.exoplatform.services.html.HTMLNode;
import org.exoplatform.services.html.Name;
@@ -27,7 +28,6 @@
import org.exoplatform.services.html.path.NodePathUtil;
import org.exoplatform.services.html.util.HyperLinkUtil;
import org.exoplatform.services.html.util.URLCreator;
-import org.exoplatform.test.BasicTestCase;
import java.net.URL;
import java.util.ArrayList;
@@ -39,7 +39,7 @@
* nhudinhthuan(a)exoplatform.com
* Nov 30, 2006
*/
-public class TestURL extends BasicTestCase
+public class TestURL extends AbstractGateInTest
{
//test ContentBuilder.java
private URL url_;
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/rss/test/TestRSSParser.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/rss/test/TestRSSParser.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/services/parser/rss/test/TestRSSParser.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,13 +19,13 @@
package org.exoplatform.services.parser.rss.test;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.rss.parser.DefaultRSSChannel;
import org.exoplatform.services.rss.parser.DefaultRSSItem;
import org.exoplatform.services.rss.parser.IRSSChannel;
import org.exoplatform.services.rss.parser.RSSDocument;
import org.exoplatform.services.rss.parser.RSSParser;
-import org.exoplatform.test.BasicTestCase;
import java.net.URL;
import java.util.List;
@@ -35,7 +35,7 @@
* hoa.nguyen(a)exoplatform.com Jul 20, 2006
*/
-public class TestRSSParser extends BasicTestCase
+public class TestRSSParser extends AbstractGateInTest
{
private RSSParser parser_;
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/HtmlCharsetDetector.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/HtmlCharsetDetector.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/HtmlCharsetDetector.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -24,6 +24,7 @@
*/
package org.exoplatform.test;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.services.chars.chardet.Detector;
import org.exoplatform.services.chars.chardet.ICharsetDetectionObserver;
import org.exoplatform.services.chars.chardet.PSMDetector;
@@ -37,7 +38,7 @@
* laivankhoi46pm1(a)yahoo.com
* Nov 27, 2006
*/
-public class HtmlCharsetDetector extends BasicTestCase
+public class HtmlCharsetDetector extends AbstractGateInTest
{
public static boolean found = false;
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestAttributeParser.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestAttributeParser.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestAttributeParser.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,6 +19,7 @@
package org.exoplatform.test;
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.services.token.Node;
import org.exoplatform.services.token.attribute.Attribute;
import org.exoplatform.services.token.attribute.AttributeParser;
@@ -30,7 +31,7 @@
* laivankhoi46pm1(a)yahoo.com
* Nov 28, 2006
*/
-public class TestAttributeParser extends BasicTestCase
+public class TestAttributeParser extends AbstractGateInTest
{
public void testAttributes()
{
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestFile.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestFile.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestFile.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -25,8 +25,7 @@
* laivankhoi46pm1(a)yahoo.com
* Nov 27, 2006
*/
-import junit.framework.TestCase;
-
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.services.chars.chardet.Detector;
import org.exoplatform.services.chars.chardet.ICharsetDetectionObserver;
import org.exoplatform.services.chars.chardet.PSMDetector;
@@ -35,7 +34,7 @@
import java.io.File;
import java.io.FileInputStream;
-public class TestFile extends TestCase
+public class TestFile extends AbstractGateInTest
{
public static boolean found = false;
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestHTMLTidy.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestHTMLTidy.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestHTMLTidy.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -25,13 +25,12 @@
* laivankhoi46pm1(a)yahoo.com
* Nov 27, 2006
*/
-import junit.framework.TestCase;
-
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.services.html.tidy.HTMLTidy;
import java.util.List;
-public class TestHTMLTidy extends TestCase
+public class TestHTMLTidy extends AbstractGateInTest
{
public void testText() throws Exception
Modified: portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestParser.java
===================================================================
--- portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestParser.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/component/xml-parser/src/test/java/org/exoplatform/test/TestParser.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -25,13 +25,14 @@
* laivankhoi46pm1(a)yahoo.com
* Nov 28, 2006
*/
+import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.services.html.HTMLNode;
import org.exoplatform.services.html.parser.HTMLParser;
import java.io.File;
import java.util.List;
-public class TestParser extends BasicTestCase
+public class TestParser extends AbstractGateInTest
{
public static void print(String text, HTMLNode element)
Modified: portal/trunk/webui/core/pom.xml
===================================================================
--- portal/trunk/webui/core/pom.xml 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/webui/core/pom.xml 2010-02-28 22:04:29 UTC (rev 1903)
@@ -46,6 +46,12 @@
<groupId>org.gatein.common</groupId>
<artifactId>common-common</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.test.core</artifactId>
+ <version>3.0.0-CR02-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
Modified: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/core/renderers/ValueRendererRegistryTestCase.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/core/renderers/ValueRendererRegistryTestCase.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/core/renderers/ValueRendererRegistryTestCase.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -23,7 +23,7 @@
package org.exoplatform.webui.core.renderers;
-import junit.framework.TestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -32,7 +32,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class ValueRendererRegistryTestCase extends TestCase
+public class ValueRendererRegistryTestCase extends AbstractGateInTest
{
private ValueRendererRegistry registry;
Modified: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/test/TestApplication.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/test/TestApplication.java 2010-02-28 18:10:35 UTC (rev 1902)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/test/TestApplication.java 2010-02-28 22:04:29 UTC (rev 1903)
@@ -19,7 +19,7 @@
package org.exoplatform.webui.test;
-import org.exoplatform.test.BasicTestCase;
+import org.exoplatform.component.test.AbstractGateInTest;
import java.io.File;
import java.net.URL;
@@ -31,7 +31,7 @@
* nhudinhthuan(a)yahoo.com
* May 5, 2006
*/
-public class TestApplication extends BasicTestCase
+public class TestApplication extends AbstractGateInTest
{
public void testApplication() throws Exception
14 years, 10 months
gatein SVN: r1902 - in portal/trunk: component/test/core and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-02-28 13:10:35 -0500 (Sun, 28 Feb 2010)
New Revision: 1902
Added:
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/LogConfigurator.java
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/PatternElementType.java
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/PatternFormatter.java
portal/trunk/component/test/core/src/main/resources/gatein-logging.properties
Modified:
portal/trunk/component/test/core/pom.xml
portal/trunk/component/test/organization/src/main/resources/conf/exo.portal.component.test.organization-configuration.xml
portal/trunk/pom.xml
Log:
GTNPORTAL-778 : Unit test logging
Modified: portal/trunk/component/test/core/pom.xml
===================================================================
--- portal/trunk/component/test/core/pom.xml 2010-02-27 22:03:28 UTC (rev 1901)
+++ portal/trunk/component/test/core/pom.xml 2010-02-28 18:10:35 UTC (rev 1902)
@@ -65,6 +65,24 @@
</dependencies>
<build>
+
+<!--
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>java.util.logging.config.class</name>
+ <value>org.exoplatform.component.test</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+-->
+
<resources>
<resource>
<directory>src/main/resources</directory>
Added: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/LogConfigurator.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/LogConfigurator.java (rev 0)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/LogConfigurator.java 2010-02-28 18:10:35 UTC (rev 1902)
@@ -0,0 +1,117 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.component.test.logging;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.net.URL;
+import java.util.Map;
+import java.util.Properties;
+import java.util.logging.LogManager;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * <p>A logger configuration for the the java logging system. It attempts to load the logging configuration from
+ * the classpath under the name <i>gatein-logging.properties</i>. If the configuration cannot happen for some reason
+ * (the file cannot be loaded for instance) then an exception is thrown that will be logged by the java logging
+ * system and configuration will happen by other means defined by the java logging system (which means RTFM).</p>
+ *
+ * <p>When the property file is loaded, string interpolation happens on the values using the format <i>${}</i>. When
+ * interpolation occurs it happens with the system properties. This is useful to configure the output directory
+ * of the {@link java.util.logging.FileHandler} class with the maven target directory.</p>
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class LogConfigurator
+{
+
+ /** The interpolation pattern. */
+ private static final Pattern INTERPOLATION_PATTERN = Pattern.compile("\\$\\{([^}]+)\\}");
+
+ public LogConfigurator() throws Exception
+ {
+ LogManager manager = LogManager.getLogManager();
+
+ //
+ boolean configured = false;
+ URL url = Thread.currentThread().getContextClassLoader().getResource("gatein-logging.properties");
+ if (url != null)
+ {
+ try
+ {
+ InputStream in = url.openStream();
+
+ //
+ Properties props = new Properties();
+ props.load(in);
+
+ //
+ for (Map.Entry<?, ?> entry : props.entrySet())
+ {
+ // A necessity here...
+ Map.Entry<String, String> entry2 = (Map.Entry<String, String>)entry;
+
+ //
+ String value = entry2.getValue();
+ Matcher matcher = INTERPOLATION_PATTERN.matcher(value);
+ StringBuffer builder = new StringBuffer();
+ while (matcher.find())
+ {
+ String matched = matcher.group(1);
+ String repl = System.getProperty(matched);
+ if (repl == null)
+ {
+ repl = matched;
+ }
+ matcher.appendReplacement(builder, repl);
+ }
+ matcher.appendTail(builder);
+ entry2.setValue(builder.toString());
+ }
+
+ //
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ props.store(baos, null);
+ baos.close();
+ in = new ByteArrayInputStream(baos.toByteArray());
+
+ //
+ manager.readConfiguration(in);
+ configured = true;
+ }
+ catch (Throwable t)
+ {
+ throw new UndeclaredThrowableException(t, "Could not configure logging " +
+ "from gatein-logging.properties file");
+ }
+ }
+
+ // In case something bad happened we reconfigure with default
+ if (!configured)
+ {
+ throw new Exception("Could not configure logging " +
+ "from gatein-logging.properties file");
+ }
+ }
+}
Added: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/PatternElementType.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/PatternElementType.java (rev 0)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/PatternElementType.java 2010-02-28 18:10:35 UTC (rev 1902)
@@ -0,0 +1,160 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.component.test.logging;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.logging.LogRecord;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public enum PatternElementType
+{
+
+ LEVEL('l') {
+ @Override
+ Object get(LogRecord record)
+ {
+ return record.getLevel().toString();
+ }},
+
+ MESSAGE('m') {
+ @Override
+ Object get(LogRecord record)
+ {
+ return record.getMessage();
+ }},
+
+ THREAD_NAME('t') {
+ @Override
+ Object get(LogRecord record)
+ {
+ return record.getThreadID();
+ }},
+
+ DATE('d') {
+ @Override
+ Object get(LogRecord record)
+ {
+ return record.getMillis();
+ }},
+
+ LOGGER_NAME('n') {
+ @Override
+ Object get(LogRecord record)
+ {
+ String name = record.getLoggerName();
+ return name.substring(name.lastIndexOf('.') + 1);
+ }},
+
+ LOGGER_FQN('N') {
+ @Override
+ Object get(LogRecord record)
+ {
+ return record.getLoggerName();
+ }},
+
+ CLASS_NAME('c') {
+ @Override
+ Object get(LogRecord record)
+ {
+ String sourceClassName = record.getSourceClassName();
+ return sourceClassName.substring(sourceClassName.lastIndexOf('.') + 1);
+ }},
+
+ CLASS_FQN('C') {
+ @Override
+ Object get(LogRecord record)
+ {
+ return record.getSourceClassName();
+ }},
+
+ METHOD_NAME('m') {
+ @Override
+ Object get(LogRecord record)
+ {
+ return record.getSourceMethodName();
+ }},
+
+ THROWABLE_MESSAGE('t') {
+ @Override
+ Object get(LogRecord record)
+ {
+ final Throwable t = record.getThrown();
+ return (t == null) ? "" : t.getMessage();
+ }},
+
+ THROWABLE_TRACE('T') {
+ @Override
+ Object get(LogRecord record)
+ {
+ String o = "";
+ final Throwable t = record.getThrown();
+ if (t != null)
+ {
+ StringWriter buffer = new StringWriter();
+ PrintWriter writer = new PrintWriter(buffer);
+ t.printStackTrace(writer);
+ writer.close();
+ o = buffer.toString();
+ }
+ return o;
+ }};
+
+ /** . */
+ private static final PatternElementType[] all = PatternElementType.values();
+
+ /** . */
+ public static final String LINE_SEPARATOR = System.getProperty("line.separator");
+
+ /** . */
+ final char blah;
+
+ PatternElementType(char blah)
+ {
+ this.blah = blah;
+ }
+
+ abstract Object get(LogRecord record);
+
+ static Object[] getRecordValue(LogRecord record)
+ {
+ Object[] objs = new Object[all.length];
+ for (int i = 0;i < all.length;i++)
+ {
+ PatternElementType eltType = all[i];
+ objs[i] = eltType.get(record);
+ }
+ return objs;
+
+ }
+
+ static String computeMPFPattern(String format)
+ {
+ for (int i = 0;i < all.length;i++)
+ {
+ PatternElementType elt = all[i];
+ format = format.replaceAll("%" + elt.blah, "" + i);
+ }
+ return format;
+ }
+}
Added: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/PatternFormatter.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/PatternFormatter.java (rev 0)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/logging/PatternFormatter.java 2010-02-28 18:10:35 UTC (rev 1902)
@@ -0,0 +1,90 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.component.test.logging;
+
+import java.text.MessageFormat;
+import java.util.logging.Formatter;
+import java.util.logging.LogManager;
+import java.util.logging.LogRecord;
+
+/**
+ * <p>A more flexible formatter than what is provided by the Java runtime. This log formatter is used only for unit
+ * tests as it is not optimized for performances nor robustness.</p>
+ *
+ * <p>The formatter is parameterized with a pattern based on the pattern defined by the {@link java.text.MessageFormat}
+ * class replacing the format elements by pattern element types. Each pattern element type replaces an integer in the
+ * pattern string. A pattern element type symbolize an information computed from a {@link LogRecord}
+ * object when one needs to be formatted.</p>
+ *
+ * <p>The existing pattern element types are:
+ * <ul>
+ * <li>l: the level returned by {@link LogRecord#getLevel()}</li>
+ * <li>m: the message returned by {@link LogRecord#getMessage()}</li>
+ * <li>t: the thread id returned by {@link LogRecord#getThreadID()}</li>
+ * <li>d: the number of milliseconds since 1970 returned by {@link LogRecord#getMillis()}</li>
+ * <li>n: the logger name obtained as the simple name (in the sense of {@link Class#getSimpleName()}) of the value
+ * returned by {@link LogRecord#getLoggerName()}</li>
+ * <li>N: the logger name returned by {@link LogRecord#getLoggerName()}</li>
+ * <li>c: the source class name obtained as the simple name (in the sense of {@link Class#getSimpleName()}) of the value
+ * returned by {@link LogRecord#getSourceClassName()}</li>
+ * <li>N: the source class name returned by {@link LogRecord#getSourceClassName()}</li>
+ * <li>t: the throwable message name returned by {@link LogRecord#getThrown()} when it is not null or the empty string</li>
+ * <li>T: the formatted throwable stack trace returned by {@link LogRecord#getThrown()} when it is not null or the empty string</li>
+ * </ul>
+ * </p>
+ *
+ * <p>The pattern is configurable by <i>pattern</p> property of the formatter otheriwse the default pattern {@link #DEFAULT_PATTERN}
+ * is used.</p>.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PatternFormatter extends Formatter
+{
+
+ /** . */
+ public static final String DEFAULT_PATTERN = "[{%d,date,HH:mm:ss-SSS}][{%l}] {%n} {%m} {%T}";
+
+ /** . */
+ private final String mfPattern;
+
+ public PatternFormatter()
+ {
+ LogManager manager = LogManager.getLogManager();
+ String format = manager.getProperty(PatternFormatter.class.getName() + ".pattern");
+ if (format == null)
+ {
+ format = DEFAULT_PATTERN;
+ }
+ else
+ {
+ format = format.trim();
+ }
+ mfPattern = PatternElementType.computeMPFPattern(format);
+ }
+
+ @Override
+ public String format(LogRecord record)
+ {
+ MessageFormat mf = new MessageFormat(mfPattern);
+ Object[] objs = PatternElementType.getRecordValue(record);
+ return mf.format(objs) + PatternElementType.LINE_SEPARATOR;
+ }
+}
Added: portal/trunk/component/test/core/src/main/resources/gatein-logging.properties
===================================================================
--- portal/trunk/component/test/core/src/main/resources/gatein-logging.properties (rev 0)
+++ portal/trunk/component/test/core/src/main/resources/gatein-logging.properties 2010-02-28 18:10:35 UTC (rev 1902)
@@ -0,0 +1,36 @@
+#
+# 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.
+#
+
+handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
+
+# Console handler
+java.util.logging.ConsoleHandler.level = INFO
+java.util.logging.ConsoleHandler.formatter = org.exoplatform.component.test.logging.PatternFormatter
+
+# File handler
+java.util.logging.FileHandler.level = ALL
+java.util.logging.FileHandler.formatter = org.exoplatform.component.test.logging.PatternFormatter
+java.util.logging.FileHandler.pattern = ${basedir}/target/gateintest-%u.log
+
+# Default level is info
+.level = INFO
+
+# Configures GateIn logging as fine
+org.exoplatform.level = FINE
+org.gatein.level = FINE
Modified: portal/trunk/component/test/organization/src/main/resources/conf/exo.portal.component.test.organization-configuration.xml
===================================================================
--- portal/trunk/component/test/organization/src/main/resources/conf/exo.portal.component.test.organization-configuration.xml 2010-02-27 22:03:28 UTC (rev 1901)
+++ portal/trunk/component/test/organization/src/main/resources/conf/exo.portal.component.test.organization-configuration.xml 2010-02-28 18:10:35 UTC (rev 1902)
@@ -135,7 +135,7 @@
<name>ref-addresses</name>
<description>ref-addresses</description>
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:${gatein.test.tmp.dir}/idm"/>
+ <property name="url" value="jdbc:hsqldb:file:${gatein.test.tmp.dir}/idmdb"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
</properties-param>
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-02-27 22:03:28 UTC (rev 1901)
+++ portal/trunk/pom.xml 2010-02-28 18:10:35 UTC (rev 1902)
@@ -110,6 +110,16 @@
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.commons</artifactId>
<version>${org.exoplatform.kernel.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
@@ -125,11 +135,31 @@
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.component.common</artifactId>
<version>${org.exoplatform.kernel.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.container</artifactId>
<version>${org.exoplatform.kernel.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
@@ -140,6 +170,16 @@
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.database</artifactId>
<version>${org.exoplatform.core.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
@@ -150,6 +190,16 @@
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.jdbc</artifactId>
<version>${org.exoplatform.core.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.core</groupId>
@@ -170,6 +220,16 @@
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.component.ext</artifactId>
<version>${org.exoplatform.jcr.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.exoplatform.ws</groupId>
@@ -292,6 +352,16 @@
<groupId>org.picketlink.idm</groupId>
<artifactId>picketlink-idm-hibernate</artifactId>
<version>${org.picketlink.idm}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.picketlink.idm</groupId>
@@ -483,7 +553,7 @@
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
+ <artifactId>slf4j-jdk14</artifactId>
<version>${org.slf4j.version}</version>
<scope>test</scope>
</dependency>
@@ -551,6 +621,12 @@
<name>java.naming.factory.initial</name>
<value>org.exoplatform.services.naming.SimpleContextFactory</value>
</property>
+
+ <property>
+ <name>java.util.logging.config.class</name>
+ <value>org.exoplatform.component.test.LogConfigurator</value>
+ </property>
+
</systemProperties>
</configuration>
</plugin>
@@ -580,18 +656,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemProperties>
- <property>
- <name>com.arjuna.ats.arjuna.objectstore.objectStoreDir</name>
- <value>${project.build.directory}</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
</plugins>
</build>
@@ -616,6 +680,10 @@
<configuration>
<systemProperties>
<property>
+ <name>java.util.logging.config.class</name>
+ <value>org.exoplatform.component.test.logging.LogConfigurator</value>
+ </property>
+ <property>
<name>com.arjuna.ats.arjuna.objectstore.objectStoreDir</name>
<value>${project.build.directory}</value>
</property>
@@ -625,7 +693,7 @@
</property>
<property>
<name>gatein.test.datasource.url</name>
- <value>jdbc:hsqldb:file:${project.build.directory}/idm</value>
+ <value>jdbc:hsqldb:file:${project.build.directory}/gateindb</value>
</property>
<property>
<name>gatein.test.datasource.username</name>
@@ -659,6 +727,10 @@
<configuration>
<systemProperties>
<property>
+ <name>java.util.logging.config.class</name>
+ <value>org.exoplatform.component.test.logging.LogConfigurator</value>
+ </property>
+ <property>
<name>com.arjuna.ats.arjuna.objectstore.objectStoreDir</name>
<value>${project.build.directory}</value>
</property>
14 years, 10 months
gatein SVN: r1901 - portal/trunk.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-02-27 17:03:28 -0500 (Sat, 27 Feb 2010)
New Revision: 1901
Modified:
portal/trunk/pom.xml
Log:
better location for test data in target dir
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-02-27 21:56:38 UTC (rev 1900)
+++ portal/trunk/pom.xml 2010-02-27 22:03:28 UTC (rev 1901)
@@ -625,7 +625,7 @@
</property>
<property>
<name>gatein.test.datasource.url</name>
- <value>jdbc:hsqldb:file:${gatein.test.tmp.dir}/idm</value>
+ <value>jdbc:hsqldb:file:${project.build.directory}/idm</value>
</property>
<property>
<name>gatein.test.datasource.username</name>
14 years, 10 months
gatein SVN: r1900 - portal/trunk.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-02-27 16:56:38 -0500 (Sat, 27 Feb 2010)
New Revision: 1900
Modified:
portal/trunk/pom.xml
Log:
rename database name of bilto to gatein :-)
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-02-27 21:44:43 UTC (rev 1899)
+++ portal/trunk/pom.xml 2010-02-27 21:56:38 UTC (rev 1900)
@@ -668,7 +668,7 @@
</property>
<property>
<name>gatein.test.datasource.url</name>
- <value>jdbc:mysql://10.37.129.4/bilto?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8</value>
+ <value>jdbc:mysql://10.37.129.4/gatein?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8</value>
</property>
<property>
<name>gatein.test.datasource.username</name>
14 years, 10 months
gatein SVN: r1899 - in portal/trunk: component/test/core/src/main/java/org/exoplatform/component/test and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-02-27 16:44:43 -0500 (Sat, 27 Feb 2010)
New Revision: 1899
Modified:
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java
portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml
portal/trunk/component/test/core/src/main/resources/conf/root-configuration.xml
portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java
portal/trunk/component/test/jcr/src/main/resources/conf/exo.portal.component.test.jcr-repository-configuration.xml
portal/trunk/component/test/organization/src/main/resources/conf/exo.portal.component.test.organization-configuration.xml
portal/trunk/pom.xml
Log:
externalize unit test jdbc configuration with a profile for mysql (that will not work for the whole build as no cleanup is done in the database)
Modified: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java 2010-02-27 18:56:53 UTC (rev 1898)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java 2010-02-27 21:44:43 UTC (rev 1899)
@@ -22,14 +22,12 @@
import junit.framework.TestCase;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.RequestLifeCycle;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import java.io.File;
import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
/**
* An abstract test that takes care of running the unit tests with the semantic described by the
@@ -42,9 +40,12 @@
{
/** The system property for gatein tmp dir. */
- private static final String TMP_DIR = "gatein.tmp.dir";
+ private static final String TMP_DIR = "gatein.test.tmp.dir";
/** . */
+ protected final Logger log = LoggerFactory.getLogger(getClass());
+
+ /** . */
private PortalContainer container;
protected AbstractGateInTest()
@@ -77,7 +78,28 @@
{
ClassLoader realClassLoader = Thread.currentThread().getContextClassLoader();
+ // Patch a bug with maven that does not pass properly the system property
+ // with an empty value
+ if ("org.hsqldb.jdbcDriver".equals(System.getProperty("gatein.test.datasource.driver")))
+ {
+ System.setProperty("gatein.test.datasource.password", "");
+ }
+
//
+ log.info("Listing gatein system properties:");
+ for (Map.Entry<?, ?> entry : System.getProperties().entrySet())
+ {
+ if (entry.getKey() instanceof String)
+ {
+ String key = (String)entry.getKey();
+ if (key.startsWith("gatein."))
+ {
+ log.info(key + "=" + entry.getValue());
+ }
+ }
+ }
+
+ //
Set<String> rootConfigPaths = new HashSet<String>();
rootConfigPaths.add("conf/root-configuration.xml");
Modified: portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml
===================================================================
--- portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml 2010-02-27 18:56:53 UTC (rev 1898)
+++ portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml 2010-02-27 21:44:43 UTC (rev 1899)
@@ -24,6 +24,7 @@
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.jboss.cache.transaction.TransactionManagerLookup</key>
<type>org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup</type>
@@ -39,6 +40,7 @@
</value-param>
</init-params>
</component>
+-->
<component>
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
@@ -74,10 +76,10 @@
<properties-param>
<name>ref-addresses</name>
<description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:${gatein.tmp.dir}/hsqldb"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
+ <property name="driverClassName" value="${gatein.test.datasource.driver}"/>
+ <property name="url" value="${gatein.test.datasource.url}"/>
+ <property name="username" value="${gatein.test.datasource.username}"/>
+ <property name="password" value="${gatein.test.datasource.password}"/>
</properties-param>
</init-params>
</component-plugin>
Modified: portal/trunk/component/test/core/src/main/resources/conf/root-configuration.xml
===================================================================
--- portal/trunk/component/test/core/src/main/resources/conf/root-configuration.xml 2010-02-27 18:56:53 UTC (rev 1898)
+++ portal/trunk/component/test/core/src/main/resources/conf/root-configuration.xml 2010-02-27 21:44:43 UTC (rev 1899)
@@ -28,4 +28,17 @@
<type>org.exoplatform.container.definition.PortalContainerConfig</type>
</component>
+<!--
+ <component>
+ <key>org.exoplatform.container.PropertyConfigurator</key>
+ <type>org.exoplatform.container.PropertyConfigurator</type>
+ <init-params>
+ <value-param>
+ <name>properties.url</name>
+ <value>jar:/conf/test-configuration.properties</value>
+ </value-param>
+ </init-params>
+ </component>
+-->
+
</configuration>
Modified: portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java
===================================================================
--- portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java 2010-02-27 18:56:53 UTC (rev 1898)
+++ portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java 2010-02-27 21:44:43 UTC (rev 1899)
@@ -25,6 +25,8 @@
import javax.naming.InitialContext;
import javax.sql.DataSource;
import java.io.File;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -58,6 +60,14 @@
container.getComponentInstanceOfType(InitialContextInitializer.class);
DataSource ds = (DataSource)new InitialContext().lookup("jdbcexo");
assertNotNull(ds);
+ Connection conn = ds.getConnection();
+ DatabaseMetaData databaseMD = conn.getMetaData();
+ String db = databaseMD.getDatabaseProductName() + " " + databaseMD.getDatabaseProductVersion() + "." +
+ databaseMD.getDatabaseMajorVersion() + "." + databaseMD.getDatabaseMinorVersion();
+ String driver = databaseMD.getDriverName() + " " + databaseMD.getDriverVersion() + "." +
+ databaseMD.getDriverMajorVersion() + "." + databaseMD.getDriverMinorVersion();
+ log.info("Using database " + db + " with driver " + driver);
+ conn.close();
}
public void testTmpDir1() throws Exception
@@ -72,7 +82,7 @@
private void ensureTmpDir() throws Exception
{
- String tmpDirPath = System.getProperty("gatein.tmp.dir");
+ String tmpDirPath = System.getProperty("gatein.test.tmp.dir");
assertNotNull(tmpDirPath);
//
Modified: portal/trunk/component/test/jcr/src/main/resources/conf/exo.portal.component.test.jcr-repository-configuration.xml
===================================================================
--- portal/trunk/component/test/jcr/src/main/resources/conf/exo.portal.component.test.jcr-repository-configuration.xml 2010-02-27 18:56:53 UTC (rev 1898)
+++ portal/trunk/component/test/jcr/src/main/resources/conf/exo.portal.component.test.jcr-repository-configuration.xml 2010-02-27 21:44:43 UTC (rev 1899)
@@ -34,12 +34,12 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="${gatein.tmp.dir}/jcr/swap/system"/>
+ <property name="swap-directory" value="${gatein.test.tmp.dir}/jcr/swap/system"/>
</properties>
<value-storages>
<value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="${gatein.tmp.dir}/jcr/values/system"/>
+ <property name="path" value="${gatein.test.tmp.dir}/jcr/values/system"/>
</properties>
<filters>
<filter property-type="Binary"/>
@@ -60,7 +60,7 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="${gatein.tmp.dir}/jcr/jcrlucenedb/system"/>
+ <property name="index-dir" value="${gatein.test.tmp.dir}/jcr/jcrlucenedb/system"/>
</properties>
</query-handler>
<lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
@@ -80,12 +80,12 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="${gatein.tmp.dir}/jcr/swap/portal-test"/>
+ <property name="swap-directory" value="${gatein.test.tmp.dir}/jcr/swap/portal-test"/>
</properties>
<value-storages>
<value-storage id="portal-test" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="${gatein.tmp.dir}/jcr/values/portal-test"/>
+ <property name="path" value="${gatein.test.tmp.dir}/jcr/values/portal-test"/>
</properties>
<filters>
<filter property-type="Binary"/>
@@ -106,7 +106,7 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="${gatein.tmp.dir}/jcr/jcrlucenedb/portal-test"/>
+ <property name="index-dir" value="${gatein.test.tmp.dir}/jcr/jcrlucenedb/portal-test"/>
</properties>
</query-handler>
<lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
Modified: portal/trunk/component/test/organization/src/main/resources/conf/exo.portal.component.test.organization-configuration.xml
===================================================================
--- portal/trunk/component/test/organization/src/main/resources/conf/exo.portal.component.test.organization-configuration.xml 2010-02-27 18:56:53 UTC (rev 1898)
+++ portal/trunk/component/test/organization/src/main/resources/conf/exo.portal.component.test.organization-configuration.xml 2010-02-27 21:44:43 UTC (rev 1899)
@@ -77,14 +77,7 @@
<!--CHANGEME HashtableCacheProvider shold not be used in production env-->
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
-<!--
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:${basedir}/target/temp/organization"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
--->
- <property name="hibernate.connection.datasource" value="jdbcexo"/>
+ <property name="hibernate.connection.datasource" value="jdbcidm"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.c3p0.min_size" value="5"/>
<property name="hibernate.c3p0.max_size" value="20"/>
@@ -119,4 +112,34 @@
</component-plugin>
</external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcidm</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:${gatein.test.tmp.dir}/idm"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
\ No newline at end of file
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-02-27 18:56:53 UTC (rev 1898)
+++ portal/trunk/pom.xml 2010-02-27 21:44:43 UTC (rev 1899)
@@ -595,6 +595,97 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>hsqldb</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>com.arjuna.ats.arjuna.objectstore.objectStoreDir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ <property>
+ <name>gatein.test.datasource.driver</name>
+ <value>org.hsqldb.jdbcDriver</value>
+ </property>
+ <property>
+ <name>gatein.test.datasource.url</name>
+ <value>jdbc:hsqldb:file:${gatein.test.tmp.dir}/idm</value>
+ </property>
+ <property>
+ <name>gatein.test.datasource.username</name>
+ <value>sa</value>
+ </property>
+ <property>
+ <name>gatein.test.datasource.password</name>
+ <value></value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>mysql5</id>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.6</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>com.arjuna.ats.arjuna.objectstore.objectStoreDir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ <property>
+ <name>gatein.test.datasource.driver</name>
+ <value>com.mysql.jdbc.Driver</value>
+ </property>
+ <property>
+ <name>gatein.test.datasource.url</name>
+ <value>jdbc:mysql://10.37.129.4/bilto?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8</value>
+ </property>
+ <property>
+ <name>gatein.test.datasource.username</name>
+ <value>root</value>
+ </property>
+ <property>
+ <name>gatein.test.datasource.password</name>
+ <value>a</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
<!-- To be removed and replaced by settings in user config -->
<repositories>
<repository>
14 years, 10 months
gatein SVN: r1898 - in portal/trunk: component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp and 8 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-02-27 13:56:53 -0500 (Sat, 27 Feb 2010)
New Revision: 1898
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateContextMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateContextsMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateMapping.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-portlet-states-nodetypes.xml
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
portal/trunk/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
Log:
- Updated to use PC 2.1.0-CR05 and WSRP 1.0.0-Beta09.
- GTNPORTAL-737:
+ Implemented a JCR-backed implementation of PortletStatePersistenceManager and configure the WSRP producer to use it.
+ Implemented WSRPContentProvider.combine as it is now called when the producer returns a state.
+ Added PortletNameFormatter to deal with / in WSRP portlet names that would cause an issue with JCR persistence.
+ Added portlet-states-system JCR workspace and producer-portlet-states-nodetypes.xml.
+ Added MappedMap to facilitate using @Properties in JCR by dealing with blacklisted properties and internal vs. external values.
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java 2010-02-27 14:29:19 UTC (rev 1897)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java 2010-02-27 18:56:53 UTC (rev 1898)
@@ -20,6 +20,7 @@
package org.exoplatform.portal.pom.spi.wsrp;
import org.exoplatform.commons.utils.Safe;
+import org.gatein.common.util.ParameterValidation;
import org.gatein.mop.spi.content.ContentProvider;
import org.gatein.mop.spi.content.StateContainer;
@@ -35,7 +36,19 @@
public WSRP combine(List<WSRP> wsrpStates)
{
- throw new UnsupportedOperationException("todo");
+ WSRP result = null;
+ if(ParameterValidation.existsAndIsNotEmpty(wsrpStates))
+ {
+ for (WSRP state : wsrpStates)
+ {
+ result = state;
+ if(state.isCloned())
+ {
+ return state;
+ }
+ }
+ }
+ return result;
}
public void setState(StateContainer<WSRPState> container, WSRP state)
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2010-02-27 14:29:19 UTC (rev 1897)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2010-02-27 18:56:53 UTC (rev 1898)
@@ -37,10 +37,12 @@
import org.gatein.pc.portlet.impl.state.StateManagementPolicyService;
import org.gatein.pc.portlet.impl.state.producer.PortletStatePersistenceManagerService;
import org.gatein.pc.portlet.state.StateConverter;
+import org.gatein.pc.portlet.state.producer.PortletStatePersistenceManager;
import org.gatein.pc.portlet.state.producer.ProducerPortletInvoker;
import org.gatein.portal.wsrp.state.consumer.JCRConsumerRegistry;
import org.gatein.portal.wsrp.state.producer.configuration.JCRProducerConfigurationService;
import org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
+import org.gatein.portal.wsrp.state.producer.state.JCRPortletStatePersistenceManager;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPersistenceManager;
import org.gatein.registration.impl.RegistrationManagerImpl;
@@ -175,7 +177,15 @@
(ContainerPortletInvoker)container.getComponentInstanceOfType(ContainerPortletInvoker.class);
// The producer persistence manager
- PortletStatePersistenceManagerService producerPersistenceManager = new PortletStatePersistenceManagerService();
+ PortletStatePersistenceManager producerPersistenceManager;
+ try
+ {
+ producerPersistenceManager = new JCRPortletStatePersistenceManager(container);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Couldn't instantiate PortletStatePersistenceManager", e);
+ }
// The producer state management policy
StateManagementPolicyService producerStateManagementPolicy = new StateManagementPolicyService();
@@ -274,7 +284,6 @@
switch (lifeCycleEvent.getType())
{
case WebAppLifeCycleEvent.ADDED:
-
context.setAttribute("ConsumerRegistry", consumerRegistry);
context.setAttribute("ProducerConfigurationService", producer.getConfigurationService());
break;
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-02-27 14:29:19 UTC (rev 1897)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-02-27 18:56:53 UTC (rev 1898)
@@ -139,6 +139,9 @@
private static final String OPEN_BRACE_REPLACEMENT = "-__";
private static final String CLOSE_BRACE_REPLACEMENT = "__-";
private static final String COLON_REPLACEMENT = "_-_";
+ private static final String CLOSE_BRACE = "}";
+ private static final String OPEN_BRACE = "{";
+ private static final String COLON = ":";
public String decodeNodeName(FormatterContext formatterContext, String s)
{
@@ -162,12 +165,33 @@
private String decode(String s)
{
- return s.replace(CLOSE_BRACE_REPLACEMENT, "}").replace(OPEN_BRACE_REPLACEMENT, "{").replace(COLON_REPLACEMENT, ":");
+ return s.replace(CLOSE_BRACE_REPLACEMENT, CLOSE_BRACE).replace(OPEN_BRACE_REPLACEMENT, OPEN_BRACE).replace(COLON_REPLACEMENT, COLON);
}
private String encode(String s)
{
- return s.replace("{", OPEN_BRACE_REPLACEMENT).replace("}", CLOSE_BRACE_REPLACEMENT).replace(":", COLON_REPLACEMENT);
+ return s.replace(OPEN_BRACE, OPEN_BRACE_REPLACEMENT).replace(CLOSE_BRACE, CLOSE_BRACE_REPLACEMENT).replace(COLON, COLON_REPLACEMENT);
}
}
+
+ public static class PortletNameFormatter implements ObjectFormatter
+ {
+ public static final String SLASH_REPLACEMENT = "___";
+ private static final String SLASH = "/";
+
+ public String decodeNodeName(FormatterContext formatterContext, String s)
+ {
+ return s.replace(SLASH_REPLACEMENT, SLASH);
+ }
+
+ public String encodeNodeName(FormatterContext formatterContext, String s) throws IllegalArgumentException, NullPointerException
+ {
+ return encode(s);
+ }
+
+ public static String encode(String s)
+ {
+ return s.replace(SLASH, SLASH_REPLACEMENT);
+ }
+ }
}
Added: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java (rev 0)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/MappedMap.java 2010-02-27 18:56:53 UTC (rev 1898)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.mapping;
+
+import org.exoplatform.commons.utils.Tools;
+import org.gatein.common.util.AbstractTypedMap;
+import org.gatein.common.util.ParameterValidation;
+
+import javax.xml.namespace.QName;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class MappedMap<Key, Value>
+{
+ /** Need to ignore JCR properties for now until scoping mechanism exists on @Properties */
+ private static final Set<String> jcrBlacklistedPropertyKeys = Tools.set("jcr:uuid", "jcr:primaryType");
+ private Set<String> blacklistedPropertyKeys;
+ private Converter<String, Key> keyConverter;
+ private Converter<Object, Value> valueConverter;
+
+ public static final Converter<String, String> IDENTITY_KEY_CONVERTER = new Converter<String, String>()
+ {
+
+ public String fromInternal(String s)
+ {
+ return s;
+ }
+
+ public String toInternal(String s)
+ {
+ return s;
+ }
+ };
+
+ public MappedMap(Converter<String, Key> keyConverter, Converter<Object, Value> valueConverter, String... blacklistedPropertyNames)
+ {
+ this.keyConverter = keyConverter;
+ this.valueConverter = valueConverter;
+
+ int blacklistedNumber = blacklistedPropertyNames.length;
+ if(blacklistedNumber > 0)
+ {
+ blacklistedPropertyKeys = new HashSet<String>(jcrBlacklistedPropertyKeys);
+ blacklistedPropertyKeys.addAll(Arrays.asList(blacklistedPropertyNames));
+ }
+ }
+
+ public Map<Key, Value> toExternalMap(Map<String, Object> internalMap)
+ {
+ if (!internalMap.isEmpty())
+ {
+ Map<Key, Value> externalMap = new HashMap<Key, Value>(internalMap.size());
+ for (Map.Entry<String, Object> entry : internalMap.entrySet())
+ {
+ String key = entry.getKey();
+
+ // ignore blacklisted properties
+ if (!blacklistedPropertyKeys.contains(key))
+ {
+ externalMap.put(keyConverter.fromInternal(key), valueConverter.fromInternal(entry.getValue()));
+ }
+ }
+
+ return externalMap;
+ }
+ else
+ {
+ return Collections.emptyMap();
+ }
+ }
+
+ public void initFrom(Map<Key, Value> externalMap, Map<String, Object> internalMap)
+ {
+ if (ParameterValidation.existsAndIsNotEmpty(externalMap))
+ {
+ for (Map.Entry<Key, Value> entry : externalMap.entrySet())
+ {
+ internalMap.put(keyConverter.toInternal(entry.getKey()), valueConverter.toInternal(entry.getValue()));
+ }
+ }
+ }
+
+ public static interface Converter<Internal, External>
+ {
+ External fromInternal(Internal internal);
+ Internal toInternal(External external);
+ }
+}
Added: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java (rev 0)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java 2010-02-27 18:56:53 UTC (rev 1898)
@@ -0,0 +1,167 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.producer.state;
+
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.container.ExoContainer;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.state.PropertyMap;
+import org.gatein.pc.portlet.state.InvalidStateIdException;
+import org.gatein.pc.portlet.state.NoSuchStateException;
+import org.gatein.pc.portlet.state.producer.AbstractPortletStatePersistenceManager;
+import org.gatein.pc.portlet.state.producer.PortletStateContext;
+import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.portal.wsrp.state.producer.state.mapping.PortletStateContextMapping;
+import org.gatein.portal.wsrp.state.producer.state.mapping.PortletStateContextsMapping;
+import org.gatein.portal.wsrp.state.producer.state.mapping.PortletStateMapping;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class JCRPortletStatePersistenceManager extends AbstractPortletStatePersistenceManager
+{
+ private JCRPersister persister;
+ private static final String PATH = PortletStateContextsMapping.NODE_NAME + "/";
+
+ public JCRPortletStatePersistenceManager(ExoContainer container) throws Exception
+ {
+ persister = new JCRPersister(container);
+
+ List<Class> mappingClasses = new ArrayList<Class>(6);
+ Collections.addAll(mappingClasses, PortletStateContextsMapping.class, PortletStateContextMapping.class, PortletStateMapping.class);
+
+ persister.initializeBuilderFor(mappingClasses);
+
+// persister = NewJCRPersister.getInstance(container);
+ }
+
+ private PortletStateContextsMapping getContexts(ChromatticSession session)
+ {
+ PortletStateContextsMapping portletStateContexts = session.findByPath(PortletStateContextsMapping.class, PortletStateContextsMapping.NODE_NAME);
+ if (portletStateContexts == null)
+ {
+ portletStateContexts = session.insert(PortletStateContextsMapping.class, PortletStateContextsMapping.NODE_NAME);
+ }
+ return portletStateContexts;
+ }
+
+ @Override
+ public void updateState(String stateId, PropertyMap propertyMap) throws NoSuchStateException, InvalidStateIdException
+ {
+ // more optimized version of updateState
+ ParameterValidation.throwIllegalArgExceptionIfNull(propertyMap, "property map");
+
+ ChromatticSession session = persister.getSession();
+
+ PortletStateContextMapping pscm = getPortletStateContextMapping(session, stateId);
+ PortletStateMapping psm = pscm.getState();
+ psm.setProperties(propertyMap);
+
+ persister.closeSession(session, false);
+ }
+
+
+ @Override
+ protected PortletStateContext getStateContext(String stateId)
+ {
+ ChromatticSession session = persister.getSession();
+
+ PortletStateContextMapping pscm = getPortletStateContextMapping(session, stateId);
+ PortletStateContext context;
+ if(pscm == null)
+ {
+ context = null;
+ }
+ else
+ {
+ context = pscm.toPortletStateContext();
+ }
+
+ persister.closeSession(session, false);
+
+ return context;
+ }
+
+ @Override
+ protected String createStateContext(String portletId, PropertyMap propertyMap)
+ {
+ ChromatticSession session = persister.getSession();
+
+ String encodedForPath = JCRPersister.PortletNameFormatter.encode(portletId);
+
+ PortletStateContextMapping pscm = session.findByPath(PortletStateContextMapping.class, PATH + encodedForPath);
+ if(pscm == null)
+ {
+ PortletStateContextsMapping portletStateContexts = getContexts(session);
+ pscm = portletStateContexts.createPortletStateContext(portletId);
+ portletStateContexts.getPortletStateContexts().add(pscm);
+ }
+
+ PortletStateMapping psm = pscm.getState();
+ psm.setPortletID(pscm.getPortletId());
+ psm.setProperties(propertyMap);
+
+ persister.closeSession(session, true);
+
+ return pscm.getPersistentKey();
+ }
+
+ @Override
+ protected PortletStateContext destroyStateContext(String stateId)
+ {
+ ChromatticSession session = persister.getSession();
+
+ PortletStateContextMapping pscm = getPortletStateContextMapping(session, stateId);
+ PortletStateContext result;
+ if (pscm == null)
+ {
+ result = null;
+ }
+ else
+ {
+ getContexts(session).getPortletStateContexts().remove(pscm);
+ session.remove(pscm);
+ result = pscm.toPortletStateContext();
+ }
+
+ persister.closeSession(session, true);
+ return result;
+ }
+
+ @Override
+ protected void updateStateContext(PortletStateContext stateContext)
+ {
+ throw new UnsupportedOperationException("Shouldn't be called as updateState method is overriden!");
+ }
+
+ private PortletStateContextMapping getPortletStateContextMapping(ChromatticSession session, String stateId)
+ {
+ return getContexts(session).findPortletStateContextById(stateId);
+ }
+}
Added: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateContextMapping.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateContextMapping.java (rev 0)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateContextMapping.java 2010-02-27 18:56:53 UTC (rev 1898)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.producer.state.mapping;
+
+import org.chromattic.api.annotations.Id;
+import org.chromattic.api.annotations.MappedBy;
+import org.chromattic.api.annotations.Name;
+import org.chromattic.api.annotations.OneToOne;
+import org.chromattic.api.annotations.PrimaryType;
+import org.gatein.pc.portlet.impl.state.producer.PortletStateContextImpl;
+import org.gatein.pc.portlet.state.producer.PortletStateContext;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = PortletStateContextMapping.NODE_NAME)
+public abstract class PortletStateContextMapping
+{
+ public static final String NODE_NAME = "portlet:statecontext";
+
+ @Id
+ public abstract String getPersistentKey();
+
+ @Name
+ public abstract String getPortletId();
+
+ @OneToOne
+ @MappedBy("state")
+ public abstract PortletStateMapping getState();
+
+ public PortletStateContext toPortletStateContext()
+ {
+ PortletStateMapping psm = getState();
+ String portletId = psm.getPortletID();
+
+ if(getPortletId().equals(portletId))
+ {
+ PortletStateContextImpl context = new PortletStateContextImpl(getPersistentKey(), portletId, psm.getPropertiesAsPropertyMap());
+ context.getState().setTerminationTime(psm.getTerminationTime());
+ return context;
+ }
+ else
+ {
+ throw new IllegalStateException("PortletStateContext's portlet id is '" + getPortletId()
+ + "' but PortletState has '" + portletId + "'");
+ }
+ }
+}
Added: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateContextsMapping.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateContextsMapping.java (rev 0)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateContextsMapping.java 2010-02-27 18:56:53 UTC (rev 1898)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.producer.state.mapping;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.FindById;
+import org.chromattic.api.annotations.FormattedBy;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.PrimaryType;
+import org.gatein.portal.wsrp.state.JCRPersister;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = PortletStateContextsMapping.NODE_NAME)
+(a)FormattedBy(JCRPersister.PortletNameFormatter.class)
+public abstract class PortletStateContextsMapping
+{
+ public static final String NODE_NAME = "portlet:producerstates";
+
+ @OneToMany
+ public abstract Collection<PortletStateContextMapping> getPortletStateContexts();
+
+ @Create
+ public abstract PortletStateContextMapping createPortletStateContext(String id);
+
+ @FindById
+ public abstract PortletStateContextMapping findPortletStateContextById(String id);
+}
Added: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateMapping.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateMapping.java (rev 0)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/mapping/PortletStateMapping.java 2010-02-27 18:56:53 UTC (rev 1898)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.producer.state.mapping;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Properties;
+import org.chromattic.api.annotations.Property;
+import org.exoplatform.commons.utils.Tools;
+import org.gatein.common.util.AbstractTypedMap;
+import org.gatein.pc.api.state.PropertyMap;
+import org.gatein.pc.portlet.state.AbstractPropertyMap;
+import org.gatein.pc.portlet.state.SimplePropertyMap;
+import org.gatein.portal.wsrp.state.mapping.MappedMap;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = PortletStateMapping.NODE_NAME)
+public abstract class PortletStateMapping
+{
+ public static final String NODE_NAME = "portlet:state";
+
+ private static final String PORTLET_ID = "portlet:portletid";
+ private static final String TERMINATION_TIME = "portlet:terminationtime";
+
+ private static final ObjectToStringListConverter VALUE_CONVERTER = new ObjectToStringListConverter();
+ private static final MappedMap<String, List<String>> mappedMap =
+ new MappedMap<String, List<String>>(MappedMap.IDENTITY_KEY_CONVERTER, VALUE_CONVERTER, PORTLET_ID, TERMINATION_TIME);
+
+ @Property(name = PORTLET_ID)
+ public abstract String getPortletID();
+
+ public abstract void setPortletID(String portletId);
+
+ @Properties
+ public abstract Map<String, Object> getProperties();
+
+ @Property(name = TERMINATION_TIME)
+ public abstract Date getTerminationTime();
+
+ public abstract void setTerminationTime(Date terminationTime);
+
+ public PropertyMap getPropertiesAsPropertyMap()
+ {
+ Map<String, Object> map = getProperties();
+
+ if (!map.isEmpty())
+ {
+ return new SimplePropertyMap(mappedMap.toExternalMap(map));
+ }
+ else
+ {
+ return new SimplePropertyMap();
+ }
+ }
+
+ public void setProperties(PropertyMap props)
+ {
+ mappedMap.initFrom(props, getProperties());
+ }
+
+ /**
+ * todo: copied from org.exoplatform.portal.pom.config.Utils class that should really be moved to common module...
+ * @param separator
+ * @param strings
+ * @return
+ */
+ public static String join(String separator, List<String> strings)
+ {
+ if (strings == null)
+ {
+ return null;
+ }
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < strings.size(); i++)
+ {
+ Object o = strings.get(i);
+ if (i > 0)
+ {
+ sb.append(separator);
+ }
+ sb.append(o);
+ }
+ return sb.toString();
+ }
+
+ /**
+ * todo: move to common module
+ * @param separator
+ * @param s
+ * @return
+ */
+ public static String[] split(String separator, String s)
+ {
+ if (s == null)
+ {
+ return null;
+ }
+ return split(s, 0, 0, separator);
+ }
+
+ private static String[] split(String s, int fromIndex, int index, String separator)
+ {
+ int toIndex = s.indexOf(separator, fromIndex);
+ String[] chunks;
+ if (toIndex == -1)
+ {
+ chunks = new String[index + 1];
+ toIndex = s.length();
+ }
+ else
+ {
+ chunks = split(s, toIndex + separator.length(), index + 1, separator);
+ }
+ chunks[index] = s.substring(fromIndex, toIndex);
+ return chunks;
+ }
+
+ private static class ObjectToStringListConverter implements MappedMap.Converter<Object, List<String>>
+ {
+
+ public List<String> fromInternal(Object o)
+ {
+ return Arrays.asList(split(",", (String)o));
+ }
+
+ public String toInternal(List<String> strings)
+ {
+ return join(",", strings);
+ }
+ }
+}
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-02-27 14:29:19 UTC (rev 1897)
+++ portal/trunk/pom.xml 2010-02-27 18:56:53 UTC (rev 1898)
@@ -45,9 +45,9 @@
<org.shindig.version>SNAPSHOT-r790473</org.shindig.version>
<org.gatein.common.version>2.0.0-CR03</org.gatein.common.version>
<org.gatein.wci.version>2.0.0-CR02</org.gatein.wci.version>
- <org.gatein.pc.version>2.1.0-CR04</org.gatein.pc.version>
+ <org.gatein.pc.version>2.1.0-CR05</org.gatein.pc.version>
<org.picketlink.idm>1.1.0.Beta5</org.picketlink.idm>
- <org.gatein.wsrp.version>1.0.0-Beta08</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>1.0.0-Beta09</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.0-CR03</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2010-02-27 14:29:19 UTC (rev 1897)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2010-02-27 18:56:53 UTC (rev 1898)
@@ -100,6 +100,7 @@
<property name="app" value="http://www.gatein.org/jcr/application-registry/1.0/"/>
<property name="lgn" value="http://www.gatein.org/jcr/autologin/1.0/"/>
<property name="wsrp" value="http://www.gatein.org/jcr/wsrp/1.0/"/>
+ <property name="portlet" value="http://www.gatein.org/jcr/portlet/1.0/"/>
</properties-param>
</init-params>
</component-plugin>
@@ -121,6 +122,7 @@
<value>war:/conf/wsrp/consumers-configuration-nodetypes.xml</value>
<value>war:/conf/wsrp/producer-configuration-nodetypes.xml</value>
<value>war:/conf/wsrp/producer-registrations-nodetypes.xml</value>
+ <value>war:/conf/wsrp/producer-portlet-states-nodetypes.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2010-02-27 14:29:19 UTC (rev 1897)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2010-02-27 18:56:53 UTC (rev 1898)
@@ -26,7 +26,7 @@
<access-control>optional</access-control>
<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <!-- System -->
+ <!-- System -->
<workspaces>
<workspace name="system">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
@@ -292,6 +292,79 @@
</lock-manager>
</workspace>
+ <!-- Producer portlet states -->
+ <workspace name="portlet-states-system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="${gatein.jcr.datasource.name}${container.name.suffix}"/>
+ <property name="dialect" value="${gatein.jcr.datasource.dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="${gatein.jcr.data.dir}/swap/portlet-states${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="${gatein.jcr.storage.data.dir}/portlet-states${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration"
+ value="conf/jcr/jbosscache/${gatein.jcr.config.type}/config.xml"/>
+ <property name="jgroups-configuration" value="jar:/conf/jcr/jbosscache/cluster/udp-mux.xml"/>
+ <property name="jgroups-multiplexer-stack" value="true"/>
+ <property name="jbosscache-cluster-name" value="jcr-${container.name.suffix}-portlet-states-system"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="${gatein.jcr.index.data.dir}/portlet-states-system${container.name.suffix}"/>
+ <property name="changesfilter-class" value="${gatein.jcr.index.changefilterclass}"/>
+ <property name="jbosscache-configuration" value="conf/jcr/jbosscache/cluster/indexer-config.xml"/>
+ <property name="jgroups-configuration" value="jar:/conf/jcr/jbosscache/cluster/udp-mux.xml"/>
+ <property name="jgroups-multiplexer-stack" value="true"/>
+ <property name="jbosscache-cluster-name" value="jcrindexer-${container.name.suffix}-portlet-states-system"/>
+ <property name="max-volatile-time" value="60"/>
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m"/>
+ <property name="jbosscache-configuration"
+ value="conf/jcr/jbosscache/${gatein.jcr.config.type}/lock-config.xml"/>
+ <property name="jgroups-configuration" value="jar:/conf/jcr/jbosscache/cluster/udp-mux.xml"/>
+ <property name="jgroups-multiplexer-stack" value="true"/>
+ <property name="jbosscache-cluster-namejbosscache-cluster-name"
+ value="jcrlock-${container.name.suffix}-system"/>
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlock_portlet_states_system"/>
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource"
+ value="${gatein.jcr.datasource.name}${container.name.suffix}"/>
+ </properties>
+ </lock-manager>
+ </workspace>
+
</workspaces>
</repository>
</repositories>
Added: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-portlet-states-nodetypes.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-portlet-states-nodetypes.xml (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-portlet-states-nodetypes.xml 2010-02-27 18:56:53 UTC (rev 1898)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2010, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+ xmlns:jcr="http://www.jcp.org/jcr/1.0">
+ <nodeType name="portlet:producerstates" isMixin="false" hasOrderableChildNodes="false">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions/>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>portlet:statecontext</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="portlet:statecontext" isMixin="false" hasOrderableChildNodes="false">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="id" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="state" defaultPrimaryType="portlet:state" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>portlet:state</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="portlet:state" isMixin="false" hasOrderableChildNodes="false">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="portlet:portletid" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="portlet:terminationtime" requiredType="Date" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions/>
+ </nodeType>
+
+</nodeTypes>
14 years, 10 months
gatein SVN: r1897 - in components/wsrp/trunk: admin-gui and 7 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-02-27 09:29:19 -0500 (Sat, 27 Feb 2010)
New Revision: 1897
Modified:
components/wsrp/trunk/admin-gui/pom.xml
components/wsrp/trunk/api/pom.xml
components/wsrp/trunk/common/pom.xml
components/wsrp/trunk/consumer/pom.xml
components/wsrp/trunk/pom.xml
components/wsrp/trunk/producer/pom.xml
components/wsrp/trunk/test/pom.xml
components/wsrp/trunk/wsrp-producer-war/pom.xml
components/wsrp/trunk/wsrp1-ws/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: components/wsrp/trunk/admin-gui/pom.xml
===================================================================
--- components/wsrp/trunk/admin-gui/pom.xml 2010-02-27 14:28:56 UTC (rev 1896)
+++ components/wsrp/trunk/admin-gui/pom.xml 2010-02-27 14:29:19 UTC (rev 1897)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
- <version>1.0.0-Beta09</version>
+ <version>1.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wsrp-admin-gui</artifactId>
Modified: components/wsrp/trunk/api/pom.xml
===================================================================
--- components/wsrp/trunk/api/pom.xml 2010-02-27 14:28:56 UTC (rev 1896)
+++ components/wsrp/trunk/api/pom.xml 2010-02-27 14:29:19 UTC (rev 1897)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
- <version>1.0.0-Beta09</version>
+ <version>1.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wsrp-integration-api</artifactId>
Modified: components/wsrp/trunk/common/pom.xml
===================================================================
--- components/wsrp/trunk/common/pom.xml 2010-02-27 14:28:56 UTC (rev 1896)
+++ components/wsrp/trunk/common/pom.xml 2010-02-27 14:29:19 UTC (rev 1897)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
- <version>1.0.0-Beta09</version>
+ <version>1.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wsrp-common</artifactId>
Modified: components/wsrp/trunk/consumer/pom.xml
===================================================================
--- components/wsrp/trunk/consumer/pom.xml 2010-02-27 14:28:56 UTC (rev 1896)
+++ components/wsrp/trunk/consumer/pom.xml 2010-02-27 14:29:19 UTC (rev 1897)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
- <version>1.0.0-Beta09</version>
+ <version>1.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wsrp-consumer</artifactId>
Modified: components/wsrp/trunk/pom.xml
===================================================================
--- components/wsrp/trunk/pom.xml 2010-02-27 14:28:56 UTC (rev 1896)
+++ components/wsrp/trunk/pom.xml 2010-02-27 14:29:19 UTC (rev 1897)
@@ -29,7 +29,7 @@
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
- <version>1.0.0-Beta09</version>
+ <version>1.0.0-CR01-SNAPSHOT</version>
<packaging>pom</packaging>
@@ -40,9 +40,9 @@
</parent>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/wsrp/tags/1.0.0-...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/wsrp/tags/1.0.0-Beta09</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/wsrp/tags/1.0.0-Beta09</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/wsrp/trunk/</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/wsrp/trunk/</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/wsrp/trunk/</url>
</scm>
<properties>
Modified: components/wsrp/trunk/producer/pom.xml
===================================================================
--- components/wsrp/trunk/producer/pom.xml 2010-02-27 14:28:56 UTC (rev 1896)
+++ components/wsrp/trunk/producer/pom.xml 2010-02-27 14:29:19 UTC (rev 1897)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
- <version>1.0.0-Beta09</version>
+ <version>1.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wsrp-producer-lib</artifactId>
Modified: components/wsrp/trunk/test/pom.xml
===================================================================
--- components/wsrp/trunk/test/pom.xml 2010-02-27 14:28:56 UTC (rev 1896)
+++ components/wsrp/trunk/test/pom.xml 2010-02-27 14:29:19 UTC (rev 1897)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
- <version>1.0.0-Beta09</version>
+ <version>1.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: components/wsrp/trunk/wsrp-producer-war/pom.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/pom.xml 2010-02-27 14:28:56 UTC (rev 1896)
+++ components/wsrp/trunk/wsrp-producer-war/pom.xml 2010-02-27 14:29:19 UTC (rev 1897)
@@ -26,7 +26,7 @@
<parent>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
- <version>1.0.0-Beta09</version>
+ <version>1.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: components/wsrp/trunk/wsrp1-ws/pom.xml
===================================================================
--- components/wsrp/trunk/wsrp1-ws/pom.xml 2010-02-27 14:28:56 UTC (rev 1896)
+++ components/wsrp/trunk/wsrp1-ws/pom.xml 2010-02-27 14:29:19 UTC (rev 1897)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
- <version>1.0.0-Beta09</version>
+ <version>1.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wsrp-wsrp1-ws</artifactId>
14 years, 10 months
gatein SVN: r1896 - components/wsrp/tags.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-02-27 09:28:56 -0500 (Sat, 27 Feb 2010)
New Revision: 1896
Added:
components/wsrp/tags/1.0.0-Beta09/
Log:
[maven-scm] copy for tag 1.0.0-Beta09
Copied: components/wsrp/tags/1.0.0-Beta09 (from rev 1895, components/wsrp/trunk)
14 years, 10 months