exo-jcr SVN: r4781 - in jcr/trunk/exo.jcr.component.core: src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-08-19 07:52:03 -0400 (Fri, 19 Aug 2011)
New Revision: 4781
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java.orig
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-mysql-jbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-mysql-sjdbc-jbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-oracle-sjdbc-jbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-pgsql-jbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-pgsql-sjdbc-jbc.xml
Modified:
jcr/trunk/exo.jcr.component.core/pom.xml
Log:
EXOJCR-852: add profiles to run tests on MySQL, PgSQL and Oracle DBs
Modified: jcr/trunk/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/pom.xml 2011-08-19 08:50:19 UTC (rev 4780)
+++ jcr/trunk/exo.jcr.component.core/pom.xml 2011-08-19 11:52:03 UTC (rev 4781)
@@ -32,6 +32,7 @@
<properties>
<jcr.test.configuration.file>/conf/standalone/test-configuration-jbc.xml</jcr.test.configuration.file>
<jbosscache.shareable>true</jbosscache.shareable>
+ <cache.enabled>true</cache.enabled>
<jbc.specific.1>**/jbc/**</jbc.specific.1>
<jbc.specific.2>**/jbosscache/**</jbc.specific.2>
<ispn.specific.1>**/ispn/**</ispn.specific.1>
@@ -261,7 +262,7 @@
<scope>test</scope>
</dependency>
<!-- For Oracle 10g support (local-jcr repository) -->
- <!-- dependency>
+ <dependency>
<groupId>ojdbc</groupId>
<artifactId>ojdbc</artifactId>
<version>14</version>
@@ -272,7 +273,7 @@
<artifactId>orai18n</artifactId>
<version>14</version>
<scope>test</scope>
- </dependency -->
+ </dependency>
<!-- For IBM DB2 support (local-jcr repository) -->
<!-- dependency>
<groupId>com.ibm.db2</groupId>
@@ -385,6 +386,10 @@
<name>jbosscache-shareable</name>
<value>${jbosscache.shareable}</value>
</property>
+ <property>
+ <name>cache-enabled</name>
+ <value>${cache.enabled}</value>
+ </property>
<!-- Uncomment the line below if you want to enable the statistics -->
<!--property>
<name>JDBCWorkspaceDataContainer.statistics.enabled</name>
@@ -606,6 +611,10 @@
<name>jbosscache-shareable</name>
<value>${jbosscache.shareable}</value>
</property>
+ <property>
+ <name>cache-enabled</name>
+ <value>${cache.enabled}</value>
+ </property>
<property>
<name>known.issues</name>
<value>org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
@@ -690,6 +699,10 @@
<value>${jbosscache.shareable}</value>
</property>
<property>
+ <name>cache-enabled</name>
+ <value>${cache.enabled}</value>
+ </property>
+ <property>
<name>known.issues</name>
<value>org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder2
@@ -774,6 +787,10 @@
<name>jbosscache-shareable</name>
<value>${jbosscache.shareable}</value>
</property>
+ <property>
+ <name>cache-enabled</name>
+ <value>${cache.enabled}</value>
+ </property>
<!-- Uncomment the line below if you want to enable the statistics -->
<!--property>
<name>JDBCWorkspaceDataContainer.statistics.enabled</name>
@@ -812,6 +829,42 @@
</build>
</profile>
<profile>
+ <id>oracle</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-oracle-sjdbc-jbc.xml</jcr.test.configuration.file>
+ </properties>
+ </profile>
+ <profile>
+ <id>mysql</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-mysql-jbc.xml</jcr.test.configuration.file>
+ </properties>
+ </profile>
+ <profile>
+ <id>mysql-sjdbc</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-mysql-sjdbc-jbc.xml</jcr.test.configuration.file>
+ </properties>
+ </profile>
+ <profile>
+ <id>pgsql</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-pgsql-jbc.xml</jcr.test.configuration.file>
+ </properties>
+ </profile>
+ <profile>
+ <id>pgsql-sjdbc</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-pgsql-sjdbc-jbc.xml</jcr.test.configuration.file>
+ </properties>
+ </profile>
+ <profile>
+ <id>cache-disabled</id>
+ <properties>
+ <cache.enabled>false</cache.enabled>
+ </properties>
+ </profile>
+ <profile>
<id>sjdbc</id>
<properties>
<jcr.test.configuration.file>/conf/standalone/test-configuration-sjdbc-jbc.xml</jcr.test.configuration.file>
Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java.orig
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java.orig (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java.orig 2011-08-19 11:52:03 UTC (rev 4781)
@@ -0,0 +1,995 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.dataflow.persistent;
+
+import org.exoplatform.commons.utils.QName;
+import org.exoplatform.services.jcr.JcrImplBaseTest;
+import org.exoplatform.services.jcr.dataflow.ItemState;
+import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
+import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
+import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
+import org.exoplatform.services.jcr.datamodel.InternalQName;
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.ItemType;
+import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.datamodel.PropertyData;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.datamodel.QPathEntry;
+import org.exoplatform.services.jcr.datamodel.ValueData;
+import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.core.itemfilters.PatternQPathEntry;
+import org.exoplatform.services.jcr.impl.core.itemfilters.PatternQPathEntryFilter;
+import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
+import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
+import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBase;
+import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+
+/**
+ * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public abstract class TestWorkspaceStorageCacheInClusterMode<T extends WorkspaceStorageCache> extends JcrImplBaseTest
+{
+ public abstract T getCacheImpl() throws Exception;
+
+ public void testRaceConditionsNConsistency() throws Exception
+ {
+ T cache1 = null, cache2 = null;
+ try
+ {
+ MyWorkspaceStorageConnection con = new MyWorkspaceStorageConnection();
+ WorkspaceDataContainer wdc = new MyWorkspaceDataContainer(con);
+ CacheableWorkspaceDataManager cwdmNode1 =
+ new CacheableWorkspaceDataManager(wdc, cache1 = getCacheImpl(), new SystemDataContainerHolder(wdc));
+ CacheableWorkspaceDataManager cwdmNode2 =
+ new CacheableWorkspaceDataManager(wdc, cache2 = getCacheImpl(), new SystemDataContainerHolder(wdc));
+ NodeData parentNode = new PersistedNodeData("parent-id", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ // Test getChildNodesData
+ Action readAction = new Action(cwdmNode2)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ cwdm.getChildNodesData(parentNode);
+ }
+ };
+ Action writeAction = new Action(cwdmNode1)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ PlainChangesLog chlog = new PlainChangesLogImpl();
+ cwdm.getChildNodesData(parentNode);
+ chlog.add(ItemState.createAddedState(new PersistedNodeData("id-node" + parentNode.getIdentifier(), QPath.makeChildPath(parentNode.getQPath(), new InternalQName(null, "node")), parentNode.getIdentifier(), 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null)));
+ cwdm.save(chlog);
+ }
+ };
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.READ_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getChildNodesData(parentNode));
+ assertEquals(2, cwdmNode1.getChildNodesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildNodesData(parentNode));
+ assertEquals(2, cwdmNode2.getChildNodesData(parentNode).size());
+ parentNode = new PersistedNodeData("parent-id2", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node2")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.WRITE_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getChildNodesData(parentNode));
+ assertEquals(2, cwdmNode1.getChildNodesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildNodesData(parentNode));
+ assertEquals(2, cwdmNode2.getChildNodesData(parentNode).size());
+ // Test getChildPropertiesData
+ readAction = new Action(cwdmNode2)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ cwdm.getChildPropertiesData(parentNode);
+ }
+ };
+ writeAction = new Action(cwdmNode1)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ PlainChangesLog chlog = new PlainChangesLogImpl();
+ cwdm.getChildPropertiesData(parentNode);
+ chlog.add(ItemState.createAddedState(new PersistedPropertyData("id-property" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "property")), parentNode.getIdentifier(), 0,
+ PropertyType.STRING, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))));
+ cwdm.save(chlog);
+ }
+ };
+ parentNode = new PersistedNodeData("parent-id3", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node3")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.READ_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode));
+ assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode));
+ assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode).size());
+ parentNode = new PersistedNodeData("parent-id4", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node4")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.WRITE_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode));
+ assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode));
+ assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode).size());
+ // Test getReferencesData
+ readAction = new Action(cwdmNode2)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ cwdm.getReferencesData(parentNode.getIdentifier(), false);
+ }
+ };
+ writeAction = new Action(cwdmNode1)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ PlainChangesLog chlog = new PlainChangesLogImpl();
+ cwdm.getReferencesData(parentNode.getIdentifier(), false);
+ chlog.add(ItemState.createAddedState(new PersistedPropertyData("id-reference" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "reference")), parentNode.getIdentifier(), 0,
+ PropertyType.REFERENCE, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8"))))));
+ cwdm.save(chlog);
+ }
+ };
+ parentNode = new PersistedNodeData("parent-id5", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node5")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.READ_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(2, cwdmNode1.getReferencesData(parentNode.getIdentifier(), false).size());
+ assertNotNull(cwdmNode2.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(2, cwdmNode2.getReferencesData(parentNode.getIdentifier(), false).size());
+ parentNode = new PersistedNodeData("parent-id6", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node6")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.WRITE_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(2, cwdmNode1.getReferencesData(parentNode.getIdentifier(), false).size());
+ assertNotNull(cwdmNode2.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(2, cwdmNode2.getReferencesData(parentNode.getIdentifier(), false).size());
+
+ // Test getItemData by Id
+ readAction = new Action(cwdmNode2)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ cwdm.getItemData(parentNode.getIdentifier());
+ }
+ };
+ writeAction = new Action(cwdmNode1)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ PlainChangesLog chlog = new PlainChangesLogImpl();
+ cwdm.getItemData(parentNode.getIdentifier());
+ chlog.add(ItemState.createUpdatedState(new PersistedNodeData(parentNode.getIdentifier(), parentNode.getQPath(), Constants.ROOT_UUID, 2, 1,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null)));
+ cwdm.save(chlog);
+ }
+ };
+ parentNode = new PersistedNodeData("parent-id7", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node7")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.READ_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getItemData(parentNode.getIdentifier()));
+ assertEquals(2, cwdmNode1.getItemData(parentNode.getIdentifier()).getPersistedVersion());
+ assertNotNull(cwdmNode2.getItemData(parentNode.getIdentifier()));
+ assertEquals(2, cwdmNode2.getItemData(parentNode.getIdentifier()).getPersistedVersion());
+ parentNode = new PersistedNodeData("parent-id8", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node8")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.WRITE_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getItemData(parentNode.getIdentifier()));
+ assertEquals(2, cwdmNode1.getItemData(parentNode.getIdentifier()).getPersistedVersion());
+ assertNotNull(cwdmNode2.getItemData(parentNode.getIdentifier()));
+ assertEquals(2, cwdmNode2.getItemData(parentNode.getIdentifier()).getPersistedVersion());
+
+ // Test getItemData by Path
+ final QPathEntry qpe = new QPathEntry(null, "my-property", 1);
+ readAction = new Action(cwdmNode2)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ cwdm.getItemData(parentNode, qpe, ItemType.PROPERTY);
+ }
+ };
+ writeAction = new Action(cwdmNode1)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ PlainChangesLog chlog = new PlainChangesLogImpl();
+ cwdm.getItemData(parentNode, qpe, ItemType.PROPERTY);
+ chlog.add(ItemState.createUpdatedState(new PersistedPropertyData("property-by-path"
+ + parentNode.getIdentifier(), QPath.makeChildPath(parentNode.getQPath(), qpe), parentNode
+ .getIdentifier(), 2, PropertyType.STRING, false, Arrays
+ .asList((ValueData)new ByteArrayPersistedValueData(0, "some new data".getBytes("UTF-8"))))));
+ cwdm.save(chlog);
+ }
+ };
+ parentNode = new PersistedNodeData("parent-id9", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node9")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.READ_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getItemData(parentNode, qpe, ItemType.PROPERTY));
+ assertEquals(2, cwdmNode1.getItemData(parentNode, qpe, ItemType.PROPERTY).getPersistedVersion());
+ assertNotNull(cwdmNode2.getItemData(parentNode, qpe, ItemType.PROPERTY));
+ assertEquals(2, cwdmNode2.getItemData(parentNode, qpe, ItemType.PROPERTY).getPersistedVersion());
+ parentNode = new PersistedNodeData("parent-id10", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node10")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.WRITE_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getItemData(parentNode, qpe, ItemType.PROPERTY));
+ assertEquals(2, cwdmNode1.getItemData(parentNode, qpe, ItemType.PROPERTY).getPersistedVersion());
+ assertNotNull(cwdmNode2.getItemData(parentNode, qpe, ItemType.PROPERTY));
+ assertEquals(2, cwdmNode2.getItemData(parentNode, qpe, ItemType.PROPERTY).getPersistedVersion());
+
+ // Test getChildNodesData by patterns
+ final List<QPathEntryFilter> nodePatterns =
+ Collections.singletonList((QPathEntryFilter)new PatternQPathEntryFilter(new PatternQPathEntry("",
+ "my-node", -1)));
+ readAction = new Action(cwdmNode2)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ cwdm.getChildNodesData(parentNode, nodePatterns);
+ }
+ };
+ writeAction = new Action(cwdmNode1)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ PlainChangesLog chlog = new PlainChangesLogImpl();
+ cwdm.getChildNodesData(parentNode, nodePatterns);
+ chlog.add(ItemState.createAddedState(new PersistedNodeData("my-node2" + parentNode.getIdentifier(),
+ QPath.makeChildPath(parentNode.getQPath(), new QName("", "my-node"), 2), parentNode.getIdentifier(), 1, 2,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null)));
+ cwdm.save(chlog);
+ }
+ };
+ con.setCanModify(true);
+ parentNode = new PersistedNodeData("parent-id11", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node11")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.READ_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getChildNodesData(parentNode, nodePatterns));
+ assertEquals(2, cwdmNode1.getChildNodesData(parentNode, nodePatterns).size());
+ assertNotNull(cwdmNode2.getChildNodesData(parentNode, nodePatterns));
+ assertEquals(2, cwdmNode2.getChildNodesData(parentNode, nodePatterns).size());
+ parentNode = new PersistedNodeData("parent-id12", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node12")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.WRITE_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getChildNodesData(parentNode, nodePatterns));
+ assertEquals(2, cwdmNode1.getChildNodesData(parentNode, nodePatterns).size());
+ assertNotNull(cwdmNode2.getChildNodesData(parentNode, nodePatterns));
+ assertEquals(2, cwdmNode2.getChildNodesData(parentNode, nodePatterns).size());
+
+ // Test getChildPropertiesData by patterns
+ final List<QPathEntryFilter> propPatterns =
+ Collections.singletonList((QPathEntryFilter)new PatternQPathEntryFilter(new PatternQPathEntry("",
+ "my-property*", -1)));
+ readAction = new Action(cwdmNode2)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ cwdm.getChildPropertiesData(parentNode, propPatterns);
+ }
+ };
+ writeAction = new Action(cwdmNode1)
+ {
+ public void execute(NodeData parentNode) throws Exception
+ {
+ PlainChangesLog chlog = new PlainChangesLogImpl();
+ cwdm.getChildPropertiesData(parentNode, propPatterns);
+ chlog.add(ItemState.createAddedState(new PersistedPropertyData("id-property" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "my-property1")), parentNode.getIdentifier(), 0,
+ PropertyType.STRING, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))));
+ cwdm.save(chlog);
+ }
+ };
+ parentNode = new PersistedNodeData("parent-id13", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node13")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.READ_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode, propPatterns));
+ assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode, propPatterns).size());
+ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode, propPatterns));
+ assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode, propPatterns).size());
+ parentNode = new PersistedNodeData("parent-id14", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node14")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ executeConcurrentReadNWrite(con, readAction, writeAction, Mode.WRITE_FIRST, parentNode);
+ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode, propPatterns));
+ assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode, propPatterns).size());
+ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode, propPatterns));
+ assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode, propPatterns).size());
+
+ // testConsistency
+ con = new MyWorkspaceStorageConnection(true);
+ wdc = new MyWorkspaceDataContainer(con);
+ cwdmNode1 =
+ new CacheableWorkspaceDataManager(wdc, cache1, new SystemDataContainerHolder(wdc));
+ cwdmNode2 =
+ new CacheableWorkspaceDataManager(wdc, cache2, new SystemDataContainerHolder(wdc));
+ parentNode = new PersistedNodeData("parent2-id", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ // Test getChildNodesData
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildNodesData(parentNode);
+ PlainChangesLog chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createAddedState(new PersistedNodeData("id-node" + parentNode.getIdentifier(), QPath.makeChildPath(parentNode.getQPath(), new InternalQName(null, "node")), parentNode.getIdentifier(), 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null)));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildNodesData(parentNode));
+ assertEquals(2, cwdmNode1.getChildNodesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildNodesData(parentNode));
+ assertEquals(2, cwdmNode2.getChildNodesData(parentNode).size());
+ parentNode = new PersistedNodeData("parent2-id2", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node2")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildNodesData(parentNode);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createDeletedState(new PersistedNodeData("id-node2" + parentNode.getIdentifier(), QPath.makeChildPath(parentNode.getQPath(), new InternalQName(null, "node2")), parentNode.getIdentifier(), 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null)));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildNodesData(parentNode));
+ assertEquals(0, cwdmNode1.getChildNodesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildNodesData(parentNode));
+ assertEquals(0, cwdmNode2.getChildNodesData(parentNode).size());
+
+ // Test getChildPropertiesData
+ parentNode = new PersistedNodeData("parent2-id3", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node3")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildPropertiesData(parentNode);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createAddedState(new PersistedPropertyData("id-property" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "property")), parentNode.getIdentifier(), 0,
+ PropertyType.STRING, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode));
+ assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode));
+ assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode).size());
+ parentNode = new PersistedNodeData("parent2-id4", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node4")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildPropertiesData(parentNode);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createDeletedState(new PersistedPropertyData("id-property2" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "property2")), parentNode.getIdentifier(), 0,
+ PropertyType.STRING, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode));
+ assertEquals(0, cwdmNode1.getChildPropertiesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode));
+ assertEquals(0, cwdmNode2.getChildPropertiesData(parentNode).size());
+
+ // Test getReferencesData
+ parentNode = new PersistedNodeData("parent2-id5", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node5")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getReferencesData(parentNode.getIdentifier(), false);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createAddedState(new PersistedPropertyData("id-reference" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "reference")), parentNode.getIdentifier(), 0,
+ PropertyType.REFERENCE, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8"))))));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(2, cwdmNode1.getReferencesData(parentNode.getIdentifier(), false).size());
+ assertNotNull(cwdmNode2.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(2, cwdmNode2.getReferencesData(parentNode.getIdentifier(), false).size());
+ parentNode = new PersistedNodeData("parent2-id6", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node6")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getReferencesData(parentNode.getIdentifier(), false);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createDeletedState(new PersistedPropertyData("id-reference2" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "reference2")), parentNode.getIdentifier(), 0,
+ PropertyType.REFERENCE, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8"))))));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(0, cwdmNode1.getReferencesData(parentNode.getIdentifier(), false).size());
+ assertNotNull(cwdmNode2.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(0, cwdmNode2.getReferencesData(parentNode.getIdentifier(), false).size());
+
+ // Test getChildNodesData by patterns
+ final List<QPathEntryFilter> patterns =
+ Collections.singletonList((QPathEntryFilter)new PatternQPathEntryFilter(new PatternQPathEntry("",
+ "my-node", -1)));
+ parentNode = new PersistedNodeData("parent2-id11", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node11")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildNodesData(parentNode, patterns);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createAddedState(new PersistedNodeData("my-node2" + parentNode.getIdentifier(),
+ QPath.makeChildPath(parentNode.getQPath(), new QName("", "my-node"), 2), parentNode.getIdentifier(), 1, 2,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null)));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildNodesData(parentNode, patterns));
+ assertEquals(2, cwdmNode1.getChildNodesData(parentNode, patterns).size());
+ assertNotNull(cwdmNode2.getChildNodesData(parentNode, patterns));
+ assertEquals(2, cwdmNode2.getChildNodesData(parentNode, patterns).size());
+ parentNode = new PersistedNodeData("parent2-id12", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node12")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildNodesData(parentNode, patterns);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createDeletedState(new PersistedNodeData("my-node" + parentNode.getIdentifier(), QPath
+ .makeChildPath(parentNode.getQPath(), new QName("", "my-node"), 1), parentNode.getIdentifier(), 1, 1,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null)));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildNodesData(parentNode, patterns));
+ assertEquals(0, cwdmNode1.getChildNodesData(parentNode, patterns).size());
+ assertNotNull(cwdmNode2.getChildNodesData(parentNode, patterns));
+ assertEquals(0, cwdmNode2.getChildNodesData(parentNode, patterns).size());
+
+
+ // Test getChildPropertiesData by patterns
+ final List<QPathEntryFilter> propPattern2s =
+ Collections.singletonList((QPathEntryFilter)new PatternQPathEntryFilter(new PatternQPathEntry("",
+ "my-property*", -1)));
+ parentNode = new PersistedNodeData("parent2-id13", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node13")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildPropertiesData(parentNode, propPattern2s);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createAddedState(new PersistedPropertyData("id-property" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "my-property1")), parentNode.getIdentifier(), 0,
+ PropertyType.STRING, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode, propPattern2s));
+ assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode, propPattern2s).size());
+ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode, propPattern2s));
+ assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode, propPattern2s).size());
+ parentNode = new PersistedNodeData("parent2-id14", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node14")), Constants.ROOT_UUID, 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildPropertiesData(parentNode, propPattern2s);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createDeletedState(new PersistedPropertyData("id-property2" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "my-property2")), parentNode.getIdentifier(), 0,
+ PropertyType.STRING, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode, propPattern2s));
+ assertEquals(0, cwdmNode1.getChildPropertiesData(parentNode, propPattern2s).size());
+ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode, propPattern2s));
+ assertEquals(0, cwdmNode2.getChildPropertiesData(parentNode, propPattern2s).size());
+ }
+ finally
+ {
+ if (cache1 != null)
+ {
+ try
+ {
+ finalize(cache1);
+ }
+ catch (Exception e)
+ {
+ // ignore me
+ }
+ }
+ if (cache2 != null)
+ {
+ try
+ {
+ finalize(cache2);
+ }
+ catch (Exception e)
+ {
+ // ignore me
+ }
+ }
+ }
+ }
+
+ protected void finalize(T cache)
+ {
+ }
+
+ /**
+ * @param con
+ * @param cwdm
+ * @param mode
+ * @param idNode
+ * @throws InterruptedException
+ */
+ private void executeConcurrentReadNWrite(final MyWorkspaceStorageConnection con, final Action readAction,
+ final Action writeAction, final Mode mode, final NodeData parentNode) throws InterruptedException
+ {
+ final CountDownLatch goSignal = con.initCountDownLatch();
+ con.setParentNode(parentNode);
+ final AtomicReference<Exception> ex = new AtomicReference<Exception>();
+ final CountDownLatch startSignal = new CountDownLatch(1);
+ final CountDownLatch doneSignal = new CountDownLatch(2);
+ Thread writer = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ startSignal.await();
+ con.wait.set(mode != Mode.WRITE_FIRST);
+ writeAction.execute(parentNode);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ ex.set(e);
+ }
+ finally
+ {
+ if (mode == Mode.WRITE_FIRST) goSignal.countDown();
+ doneSignal.countDown();
+ con.wait.remove();
+ }
+ }
+ };
+ writer.start();
+ Thread reader = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ startSignal.await();
+ con.wait.set(mode != Mode.READ_FIRST);
+ readAction.execute(parentNode);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ ex.set(e);
+ }
+ finally
+ {
+ if (mode == Mode.READ_FIRST) goSignal.countDown();
+ doneSignal.countDown();
+ con.wait.remove();
+ }
+ }
+ };
+ reader.start();
+ startSignal.countDown();
+ doneSignal.await();
+ assertNull(ex.get());
+ }
+
+ private abstract class Action
+ {
+
+ protected final CacheableWorkspaceDataManager cwdm;
+ public Action(CacheableWorkspaceDataManager cwdm)
+ {
+ this.cwdm = cwdm;
+ }
+ protected abstract void execute(NodeData parentNode) throws Exception;
+ }
+ private static enum Mode
+ {
+ READ_FIRST, WRITE_FIRST;
+ }
+ public static class MyWorkspaceStorageConnection implements WorkspaceStorageConnection
+ {
+ public ThreadLocal<Boolean> wait = new ThreadLocal<Boolean>();
+ private NodeData parentNode;
+ private CountDownLatch goSignal;
+ private ItemData itemAdded;
+ private boolean canModify;
+ private boolean itemDeleted;
+
+ public MyWorkspaceStorageConnection()
+ {
+ }
+
+ public MyWorkspaceStorageConnection(boolean canModify)
+ {
+ this.canModify = canModify;
+ }
+
+ /**
+ * @param canModify the canModify to set
+ */
+ public void setCanModify(boolean canModify)
+ {
+ this.canModify = canModify;
+ }
+
+ public CountDownLatch initCountDownLatch()
+ {
+ return this.goSignal = new CountDownLatch(1);
+ }
+
+ public void setParentNode(NodeData parentNode)
+ {
+ this.parentNode = parentNode;
+ this.itemAdded = null;
+ this.itemDeleted = false;
+ }
+
+ public void add(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ this.itemAdded = data;
+ }
+
+ public void add(PropertyData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ this.itemAdded = data;
+ }
+
+ public void close() throws IllegalStateException, RepositoryException
+ {
+ }
+
+ public void commit() throws IllegalStateException, RepositoryException
+ {
+ if (wait.get() != null && wait.get())
+ {
+ try
+ {
+ goSignal.await();
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ }
+ }
+
+ public void delete(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ this.itemDeleted = true;
+ }
+
+ public void delete(PropertyData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ this.itemDeleted = true;
+ }
+
+ public int getChildNodesCount(NodeData parent) throws RepositoryException
+ {
+ return -1;
+ }
+
+ public List<NodeData> getChildNodesData(NodeData parent) throws RepositoryException, IllegalStateException
+ {
+ if (wait.get() != null && wait.get())
+ {
+ try
+ {
+ goSignal.await();
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ }
+ List<NodeData> children = new ArrayList<NodeData>();
+ if (!canModify || !itemDeleted)
+ {
+ children.add(new PersistedNodeData("id-node2" + parentNode.getIdentifier(), QPath.makeChildPath(parent.getQPath(), new InternalQName(null, "node2")), parent.getIdentifier(), 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null));
+ }
+ if (canModify && itemAdded != null)
+ {
+ children.add((NodeData)itemAdded);
+ }
+ return children;
+ }
+
+ public List<PropertyData> getChildPropertiesData(NodeData parent) throws RepositoryException,
+ IllegalStateException
+ {
+ if (wait.get() != null && wait.get())
+ {
+ try
+ {
+ goSignal.await();
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ }
+ List<PropertyData> children = new ArrayList<PropertyData>();
+ try
+ {
+ if (!canModify || !itemDeleted)
+ {
+ children.add(new PersistedPropertyData("id-property2" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "property2")), parentNode.getIdentifier(), 0,
+ PropertyType.STRING, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8")))));
+ }
+ if (canModify && itemAdded != null)
+ {
+ children.add((PropertyData)itemAdded);
+ }
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ e.printStackTrace();
+ }
+ return children;
+ }
+
+ public List<PropertyData> getChildPropertiesData(NodeData parent, List<QPathEntryFilter> pattern) throws RepositoryException,
+ IllegalStateException
+ {
+ if (wait.get() != null && wait.get())
+ {
+ try
+ {
+ goSignal.await();
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ }
+ List<PropertyData> children = new ArrayList<PropertyData>();
+ try
+ {
+ if (!canModify || !itemDeleted)
+ {
+ children.add(new PersistedPropertyData("id-property2" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "my-property2")), parentNode.getIdentifier(), 0,
+ PropertyType.STRING, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8")))));
+ }
+ if (canModify && itemAdded != null)
+ {
+ children.add((PropertyData)itemAdded);
+ }
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ e.printStackTrace();
+ }
+ return children;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData getItemData(NodeData parentData, QPathEntry name) throws RepositoryException,
+ IllegalStateException
+ {
+ return getItemData(parentData, name, ItemType.UNKNOWN);
+ }
+
+ public ItemData getItemData(NodeData parentData, QPathEntry name, ItemType itemType) throws RepositoryException,
+ IllegalStateException
+ {
+ if (wait.get() != null && wait.get())
+ {
+ try
+ {
+ goSignal.await();
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ }
+ if (itemType == ItemType.NODE)
+ {
+ return new PersistedNodeData("my-node" + parentNode.getIdentifier(), QPath.makeChildPath(parentNode.getQPath(), name), Constants.ROOT_UUID, 1, 1,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ }
+ try
+ {
+ return new PersistedPropertyData("property-by-path"
+ + parentNode.getIdentifier(), QPath.makeChildPath(parentNode.getQPath(), name), parentNode
+ .getIdentifier(), 1, PropertyType.STRING, false, Arrays
+ .asList((ValueData)new ByteArrayPersistedValueData(0, "some new data".getBytes("UTF-8"))));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public ItemData getItemData(String identifier) throws RepositoryException, IllegalStateException
+ {
+ if (wait.get() != null && wait.get())
+ {
+ try
+ {
+ goSignal.await();
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ }
+ return parentNode;
+ }
+
+ public List<PropertyData> getReferencesData(String nodeIdentifier) throws RepositoryException,
+ IllegalStateException, UnsupportedOperationException
+ {
+ if (wait.get() != null && wait.get())
+ {
+ try
+ {
+ goSignal.await();
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ }
+ List<PropertyData> children = new ArrayList<PropertyData>();
+ try
+ {
+ if (!canModify || !itemDeleted)
+ {
+ children.add(new PersistedPropertyData("id-reference2" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "reference2")), parentNode.getIdentifier(), 0,
+ PropertyType.REFERENCE, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8")))));
+ }
+ if (canModify && itemAdded != null)
+ {
+ children.add((PropertyData)itemAdded);
+ }
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ e.printStackTrace();
+ }
+ return children;
+ }
+
+ public boolean isOpened()
+ {
+ return true;
+ }
+
+ public List<PropertyData> listChildPropertiesData(NodeData parent) throws RepositoryException,
+ IllegalStateException
+ {
+ return null;
+ }
+
+ public void rename(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ }
+
+ public void rollback() throws IllegalStateException, RepositoryException
+ {
+ }
+
+ public void update(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ }
+
+ public void update(PropertyData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getLastOrderNumber(org.exoplatform.services.jcr.datamodel.NodeData)
+ */
+ public int getLastOrderNumber(NodeData parent) throws RepositoryException
+ {
+ return 0;
+ }
+
+ public List<NodeData> getChildNodesData(NodeData parent, List<QPathEntryFilter> pattern) throws RepositoryException,
+ IllegalStateException
+ {
+ if (wait.get() != null && wait.get())
+ {
+ try
+ {
+ goSignal.await();
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ }
+ List<NodeData> children = new ArrayList<NodeData>();
+ if (!canModify || !itemDeleted)
+ {
+ children.add(new PersistedNodeData("my-node" + parent.getIdentifier(), QPath.makeChildPath(parent.getQPath(), new QName("","my-node"), 1), parent.getIdentifier(), 1, 1,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null));
+ }
+ if (canModify && itemAdded != null)
+ {
+ children.add((NodeData)itemAdded);
+ }
+
+ return children;
+ }
+
+
+ };
+
+ private static class MyWorkspaceDataContainer extends WorkspaceDataContainerBase
+ {
+
+ private WorkspaceStorageConnection con;
+
+ public MyWorkspaceDataContainer(WorkspaceStorageConnection con)
+ {
+ this.con = con;
+ }
+
+ public boolean isCheckSNSNewConnection()
+ {
+ return false;
+ }
+
+ public boolean isSame(WorkspaceDataContainer another)
+ {
+ return false;
+ }
+
+ public WorkspaceStorageConnection openConnection() throws RepositoryException
+ {
+ return con;
+ }
+
+ public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
+ {
+ return con;
+ }
+
+ public WorkspaceStorageConnection reuseConnection(WorkspaceStorageConnection original) throws RepositoryException
+ {
+ return con;
+ }
+
+ public String getInfo()
+ {
+ return "MyWorkspaceDataContainer";
+ }
+
+ public String getName()
+ {
+ return "MyWorkspaceDataContainer";
+ }
+
+ public String getStorageVersion()
+ {
+ return "0";
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.storage.DataContainer#getUniqueName()
+ */
+ public String getUniqueName()
+ {
+ return "MyWorkspaceDataContainer";
+ }
+ };
+}
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-mysql-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-mysql-jbc.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-mysql-jbc.xml 2011-08-19 11:52:03 UTC (rev 4781)
@@ -0,0 +1,664 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file"/>
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+ <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.stdout.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+ <property name="log4j.appender.file.File" value="target/jcr.log"/>
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.file.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
+ <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
+ </properties-param>
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>SimpleLog properties</description>
+ <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
+ <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
+ </properties-param -->
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>jdk1.4 Logger properties</description>
+ <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+ <property name=".level" value="FINE"/>
+ <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+ </properties-param -->
+
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="test" value="http://www.apache.org/jackrabbit/test"/>
+ <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
+ <property name="rma" value="http://www.rma.com/jcr/"/>
+ <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/test/nodetypes-tck.xml</value>
+ <value>jar:/conf/test/nodetypes-impl.xml</value>
+ <value>jar:/conf/test/nodetypes-usecase.xml</value>
+ <value>jar:/conf/test/nodetypes-config.xml</value>
+ <value>jar:/conf/test/nodetypes-config-extended.xml</value>
+ <value>jar:/conf/test/wcm-nodetypes.xml</value>
+ <value>jar:/conf/test/nodetypes-publication-config.xml</value>
+ <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepository</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepository
+ </description>
+ <value>jar:/conf/test/nodetypes-test.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepositoryTest2</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
+ </description>
+ <value>jar:/conf/test/nodetypes-test2.xml</value>
+ </values-param>
+
+ <!--values-param>
+ <name>testInitNodeTypesRepositoryTest3</name>
+ <description>Node types from ext. Needed bacause core starup earlie than ext</description>
+ <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
+ </values-param-->
+
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-config-jbc.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="dialect" value="auto" />
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
+ </component>
+
+ <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.JBossTransactionsService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>3000</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <!-- component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>300</value>
+ </value-param>
+ </init-params>
+ </component -->
+
+ <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>jdbcjcr</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db1_ws" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr1</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db1_ws1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db1_ws2" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr3</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db1_ws3" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrtest</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:target/temp/data/jcrtest"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ <property name="maxActive" value="100" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrdb2</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db2_ws" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr1db2</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db2_ws1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrtck</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db1tck_ws" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr1tck</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db1tck_ws1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2tck</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db1tck_ws2" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export1</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:target/temp/data/jdbcjcr2export1"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export2</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:target/temp/data/jdbcjcr2export2"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export3</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:target/temp/data/jdbcjcr2export3"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>testdbcleaner</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/testdbcleaner" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>repo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="repositoryName" value="db1"/>
+ <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>rmi.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>rmirepository</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="url" value="//localhost:9999/repository"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
+ <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
+</configuration>
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-mysql-sjdbc-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-mysql-sjdbc-jbc.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-mysql-sjdbc-jbc.xml 2011-08-19 11:52:03 UTC (rev 4781)
@@ -0,0 +1,503 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file"/>
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+ <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.stdout.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+ <property name="log4j.appender.file.File" value="target/jcr.log"/>
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.file.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
+ <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
+ </properties-param>
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>SimpleLog properties</description>
+ <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
+ <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
+ </properties-param -->
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>jdk1.4 Logger properties</description>
+ <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+ <property name=".level" value="FINE"/>
+ <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+ </properties-param -->
+
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="test" value="http://www.apache.org/jackrabbit/test"/>
+ <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
+ <property name="rma" value="http://www.rma.com/jcr/"/>
+ <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/test/nodetypes-tck.xml</value>
+ <value>jar:/conf/test/nodetypes-impl.xml</value>
+ <value>jar:/conf/test/nodetypes-usecase.xml</value>
+ <value>jar:/conf/test/nodetypes-config.xml</value>
+ <value>jar:/conf/test/nodetypes-config-extended.xml</value>
+ <value>jar:/conf/test/wcm-nodetypes.xml</value>
+ <value>jar:/conf/test/nodetypes-publication-config.xml</value>
+ <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepository</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepository
+ </description>
+ <value>jar:/conf/test/nodetypes-test.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepositoryTest2</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
+ </description>
+ <value>jar:/conf/test/nodetypes-test2.xml</value>
+ </values-param>
+
+ <!--values-param>
+ <name>testInitNodeTypesRepositoryTest3</name>
+ <description>Node types from ext. Needed bacause core starup earlie than ext</description>
+ <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
+ </values-param-->
+
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-config-sjdbc-jbc.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="dialect" value="auto" />
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
+ </component>
+
+ <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.JBossTransactionsService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>3000</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <!-- component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>300</value>
+ </value-param>
+ </init-params>
+ </component -->
+
+ <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>jdbcjcr</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrtest</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:target/temp/data/jcrtest"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ <property name="maxActive" value="100" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrdb2</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db2" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrtck</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/db1tck" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export1</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:target/temp/data/jdbcjcr2export1"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export2</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:target/temp/data/jdbcjcr2export2"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export3</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:target/temp/data/jdbcjcr2export3"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>testdbcleaner</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/testdbcleaner_sjdbc" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>repo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="repositoryName" value="db1"/>
+ <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>rmi.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>rmirepository</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="url" value="//localhost:9999/repository"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
+ <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
+</configuration>
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-oracle-sjdbc-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-oracle-sjdbc-jbc.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-oracle-sjdbc-jbc.xml 2011-08-19 11:52:03 UTC (rev 4781)
@@ -0,0 +1,503 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file"/>
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+ <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.stdout.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+ <property name="log4j.appender.file.File" value="target/jcr.log"/>
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.file.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
+ <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
+ </properties-param>
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>SimpleLog properties</description>
+ <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
+ <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
+ </properties-param -->
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>jdk1.4 Logger properties</description>
+ <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+ <property name=".level" value="FINE"/>
+ <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+ </properties-param -->
+
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="test" value="http://www.apache.org/jackrabbit/test"/>
+ <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
+ <property name="rma" value="http://www.rma.com/jcr/"/>
+ <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/test/nodetypes-tck.xml</value>
+ <value>jar:/conf/test/nodetypes-impl.xml</value>
+ <value>jar:/conf/test/nodetypes-usecase.xml</value>
+ <value>jar:/conf/test/nodetypes-config.xml</value>
+ <value>jar:/conf/test/nodetypes-config-extended.xml</value>
+ <value>jar:/conf/test/wcm-nodetypes.xml</value>
+ <value>jar:/conf/test/nodetypes-publication-config.xml</value>
+ <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepository</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepository
+ </description>
+ <value>jar:/conf/test/nodetypes-test.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepositoryTest2</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
+ </description>
+ <value>jar:/conf/test/nodetypes-test2.xml</value>
+ </values-param>
+
+ <!--values-param>
+ <name>testInitNodeTypesRepositoryTest3</name>
+ <description>Node types from ext. Needed bacause core starup earlie than ext</description>
+ <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
+ </values-param-->
+
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-config-sjdbc-jbc.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="dialect" value="auto" />
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
+ </component>
+
+ <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.JBossTransactionsService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>3000</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <!-- component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>300</value>
+ </value-param>
+ </init-params>
+ </component -->
+
+ <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>jdbcjcr</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="oracle.jdbc.OracleDriver" />
+ <property name="url" value="jdbc:oracle:thin:@v06.storm.exoplatform.com.ua:1521:orclvm" />
+ <property name="username" value="exoperf" />
+ <property name="password" value="exo12321" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrtest</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:target/temp/data/jcrtest"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ <property name="maxActive" value="100" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrdb2</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="oracle.jdbc.OracleDriver" />
+ <property name="url" value="jdbc:oracle:thin:@v06.storm.exoplatform.com.ua:1521:orclvm" />
+ <property name="username" value="exoperf1" />
+ <property name="password" value="exo12321" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrtck</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="oracle.jdbc.OracleDriver" />
+ <property name="url" value="jdbc:oracle:thin:@v06.storm.exoplatform.com.ua:1521:orclvm" />
+ <property name="username" value="exoperf2" />
+ <property name="password" value="exo12321" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export1</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:target/temp/data/jdbcjcr2export1"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export2</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:target/temp/data/jdbcjcr2export2"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export3</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:target/temp/data/jdbcjcr2export3"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>testdbcleaner</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="oracle.jdbc.OracleDriver" />
+ <property name="url" value="jdbc:oracle:thin:@v06.storm.exoplatform.com.ua:1521:orclvm" />
+ <property name="username" value="exoperf3" />
+ <property name="password" value="exo12321" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>repo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="repositoryName" value="db1"/>
+ <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>rmi.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>rmirepository</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="url" value="//localhost:9999/repository"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
+ <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
+</configuration>
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-pgsql-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-pgsql-jbc.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-pgsql-jbc.xml 2011-08-19 11:52:03 UTC (rev 4781)
@@ -0,0 +1,664 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file"/>
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+ <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.stdout.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+ <property name="log4j.appender.file.File" value="target/jcr.log"/>
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.file.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
+ <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
+ </properties-param>
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>SimpleLog properties</description>
+ <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
+ <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
+ </properties-param -->
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>jdk1.4 Logger properties</description>
+ <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+ <property name=".level" value="FINE"/>
+ <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+ </properties-param -->
+
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="test" value="http://www.apache.org/jackrabbit/test"/>
+ <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
+ <property name="rma" value="http://www.rma.com/jcr/"/>
+ <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/test/nodetypes-tck.xml</value>
+ <value>jar:/conf/test/nodetypes-impl.xml</value>
+ <value>jar:/conf/test/nodetypes-usecase.xml</value>
+ <value>jar:/conf/test/nodetypes-config.xml</value>
+ <value>jar:/conf/test/nodetypes-config-extended.xml</value>
+ <value>jar:/conf/test/wcm-nodetypes.xml</value>
+ <value>jar:/conf/test/nodetypes-publication-config.xml</value>
+ <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepository</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepository
+ </description>
+ <value>jar:/conf/test/nodetypes-test.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepositoryTest2</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
+ </description>
+ <value>jar:/conf/test/nodetypes-test2.xml</value>
+ </values-param>
+
+ <!--values-param>
+ <name>testInitNodeTypesRepositoryTest3</name>
+ <description>Node types from ext. Needed bacause core starup earlie than ext</description>
+ <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
+ </values-param-->
+
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-config-jbc.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="dialect" value="auto" />
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
+ </component>
+
+ <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.JBossTransactionsService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>3000</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <!-- component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>300</value>
+ </value-param>
+ </init-params>
+ </component -->
+
+ <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>jdbcjcr</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1_ws" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr1</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1_ws1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1_ws2" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr3</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1_ws3" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrtest</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:target/temp/data/jcrtest"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ <property name="maxActive" value="100" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrdb2</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db2_ws" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr1db2</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db2_ws1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrtck</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1tck_ws" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr1tck</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1tck_ws1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2tck</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1tck_ws2" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export1</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:target/temp/data/jdbcjcr2export1"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export2</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:target/temp/data/jdbcjcr2export2"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export3</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:target/temp/data/jdbcjcr2export3"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>testdbcleaner</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/testdbcleaner_sjdbc" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>repo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="repositoryName" value="db1"/>
+ <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>rmi.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>rmirepository</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="url" value="//localhost:9999/repository"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
+ <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
+</configuration>
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-pgsql-sjdbc-jbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-pgsql-sjdbc-jbc.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-pgsql-sjdbc-jbc.xml 2011-08-19 11:52:03 UTC (rev 4781)
@@ -0,0 +1,503 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file"/>
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+ <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.stdout.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+ <property name="log4j.appender.file.File" value="target/jcr.log"/>
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.file.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
+ <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
+ </properties-param>
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>SimpleLog properties</description>
+ <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
+ <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
+ </properties-param -->
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>jdk1.4 Logger properties</description>
+ <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+ <property name=".level" value="FINE"/>
+ <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+ </properties-param -->
+
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="test" value="http://www.apache.org/jackrabbit/test"/>
+ <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
+ <property name="rma" value="http://www.rma.com/jcr/"/>
+ <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/test/nodetypes-tck.xml</value>
+ <value>jar:/conf/test/nodetypes-impl.xml</value>
+ <value>jar:/conf/test/nodetypes-usecase.xml</value>
+ <value>jar:/conf/test/nodetypes-config.xml</value>
+ <value>jar:/conf/test/nodetypes-config-extended.xml</value>
+ <value>jar:/conf/test/wcm-nodetypes.xml</value>
+ <value>jar:/conf/test/nodetypes-publication-config.xml</value>
+ <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepository</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepository
+ </description>
+ <value>jar:/conf/test/nodetypes-test.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepositoryTest2</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
+ </description>
+ <value>jar:/conf/test/nodetypes-test2.xml</value>
+ </values-param>
+
+ <!--values-param>
+ <name>testInitNodeTypesRepositoryTest3</name>
+ <description>Node types from ext. Needed bacause core starup earlie than ext</description>
+ <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
+ </values-param-->
+
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-config-sjdbc-jbc.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="dialect" value="auto" />
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
+ </component>
+
+ <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.JBossTransactionsService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>3000</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <!-- component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>300</value>
+ </value-param>
+ </init-params>
+ </component -->
+
+ <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>jdbcjcr</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrtest</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:target/temp/data/jcrtest"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ <property name="maxActive" value="100" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrdb2</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db2" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcrtck</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/db1tck" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export1</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:target/temp/data/jdbcjcr2export1"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export2</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:target/temp/data/jdbcjcr2export2"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>jdbcjcr2export3</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:target/temp/data/jdbcjcr2export3"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <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>testdbcleaner</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.postgresql.Driver" />
+ <property name="url" value="jdbc:postgresql://localhost:5433/testdbcleaner" />
+ <property name="username" value="root" />
+ <property name="password" value="eXoAdmin" />
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>repo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="repositoryName" value="db1"/>
+ <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>rmi.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>rmirepository</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="url" value="//localhost:9999/repository"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
+ <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
+</configuration>
12 years, 9 months
exo-jcr SVN: r4780 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-08-19 04:50:19 -0400 (Fri, 19 Aug 2011)
New Revision: 4780
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NamespaceRegistryImpl.java
Log:
EXOJCR-1390 : Applying patch along with StringBuilder replacement.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NamespaceRegistryImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NamespaceRegistryImpl.java 2011-08-19 08:39:14 UTC (rev 4779)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NamespaceRegistryImpl.java 2011-08-19 08:50:19 UTC (rev 4780)
@@ -332,21 +332,23 @@
final Set<String> nodes = indexSearcherHolder.getNodesByUri(uri);
if (nodes.size() > 0)
{
- StringBuffer buffer = new StringBuffer();
- buffer.append("Fail to unregister namespace");
- buffer.append(prefix);
- buffer.append(" because of following nodes: ");
+ StringBuilder builder = new StringBuilder();
+ builder.append("Fail to unregister namespace '");
+ builder.append(prefix);
+ builder.append("' because of following nodes: ");
for (String uuid : nodes)
{
ItemData item = dataManager.getItemData(uuid);
if (item != null && item.isNode())
{
- buffer.append(item.getQPath().getAsString());
+ builder.append(" - ");
+ builder.append(item.getQPath().getAsString());
+ builder.append("\r\n");
}
}
- buffer.append(" contains whese prefix ");
- throw new NamespaceException(buffer.toString());
+ builder.append(" uses this prefix.");
+ throw new NamespaceException(builder.toString());
}
}
prefixes.remove(uri);
@@ -418,7 +420,9 @@
registerNamespace(prefix, uri);
}
if (log.isDebugEnabled())
+ {
log.debug("Namespace is registered " + prefix + " = " + uri);
+ }
}
}
catch (Exception e)
12 years, 9 months
exo-jcr SVN: r4779 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2011-08-19 04:39:14 -0400 (Fri, 19 Aug 2011)
New Revision: 4779
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml
Log:
EXOJCR-1456: doc updated. Info about bloom filter configuration added
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml 2011-08-19 07:10:16 UTC (rev 4778)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml 2011-08-19 08:39:14 UTC (rev 4779)
@@ -262,11 +262,7 @@
operation but in same time Observation'll not notified, has
default value true</entry>
</row>
- </tbody>
- </tgroup>
- <tgroup cols="2">
- <tbody>
<row>
<entry>lazy-node-iterator-page-size</entry>
@@ -274,6 +270,20 @@
can be retrieved from storage per request. The default value is
100</entry>
</row>
+
+ <row>
+ <entry>acl-bloomfilter-false-positive-probability</entry>
+
+ <entry>ACL Bloom-filter desired false positive probability. Range
+ [0..1]. Default value 0.1d.</entry>
+ </row>
+
+ <row>
+ <entry>acl-bloomfilter-elements-number</entry>
+
+ <entry>Expected number of ACL-elements in the Bloom-filter.
+ Default value 1000000.</entry>
+ </row>
</tbody>
</tgroup>
</table>
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml 2011-08-19 07:10:16 UTC (rev 4778)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml 2011-08-19 08:39:14 UTC (rev 4779)
@@ -24,6 +24,8 @@
<property name="max-buffer-size" value="200K"/>
<property name="swap-directory" value="target/temp/swap/ws"/>
<property name="lazy-node-iterator-page-size" value="50"/>
+ <property name="acl-bloomfilter-false-positive-probability" value="0.1d"/>
+ <property name="acl-bloomfilter-elements-number" value="1000000"/>
</properties></programlisting>
<para>Properties are Container specific parameters:</para>
@@ -51,6 +53,26 @@
child nodes iterator settings. Defines size of page, the number of nodes
that are retrieved from persistent storage at once.</para>
+ <para><emphasis
+ role="bold">acl-bloomfilter-false-positive-probability</emphasis>: ACL
+ Bloom-filter settings. ACL Bloom-filter desired false positive probability.
+ Range [0..1]. Default value 0.1d.</para>
+
+ <para><emphasis role="bold">acl-bloomfilter-elements-number</emphasis>: ACL
+ Bloom-filter settings. Expected number of ACL-elements in the Bloom-filter.
+ Default value 1000000.</para>
+
+ <note>
+ <para>Bloom-filter used to avoid read nodes that definitely do not have
+ ACL. <emphasis
+ role="bold">acl-bloomfilter-false-positive-probability</emphasis> and
+ <emphasis role="bold">acl-bloomfilter-elements-number</emphasis> used to
+ configure such filters.</para>
+
+ <para>More about Bloom filters you can read here <ulink
+ url="http://en.wikipedia.org/wiki/Bloom_filter">http://en.wikipedia.org/wiki/Bloom_filter</ulink>.</para>
+ </note>
+
<para>eXo JCR has an RDB (JDBC) based, production ready <emphasis
role="bold">Workspace Data Container</emphasis>.</para>
12 years, 9 months
exo-jcr SVN: r4778 - in jcr/branches/1.12.x: exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command and 2 other directories.
by do-not-reply@jboss.org
Author: trang_vu
Date: 2011-08-19 03:10:16 -0400 (Fri, 19 Aug 2011)
New Revision: 4778
Added:
jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1652/readme.txt
Modified:
jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java
jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java
jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml
Log:
JCR-1652: Empty multi-valued properties should be processed properly
How is the problem fixed?
* Before trying to get property value, we check whether the array is empty.
Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java 2011-08-18 15:15:47 UTC (rev 4777)
+++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java 2011-08-19 07:10:16 UTC (rev 4778)
@@ -315,7 +315,18 @@
String propertyValue;
if (property.getDefinition().isMultiple())
{
- propertyValue = property.getValues()[0].getString();
+ if (property.getValues().length >= 1)
+ {
+ propertyValue = property.getValues()[0].getString();
+ }
+ else
+ {
+ // this means that we return empty value, because according to WebDAV spec:
+ // this is a property whose semantics and syntax are not enforced by the server
+ // the server only records the value of a dead property;
+ // the client is responsible for maintaining the consistency of the syntax and semantics of a dead property.
+ propertyValue = "";
+ }
}
else
{
@@ -323,7 +334,6 @@
}
return new HierarchicalProperty(name, propertyValue);
}
-
}
}
Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java 2011-08-18 15:15:47 UTC (rev 4777)
+++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java 2011-08-19 07:10:16 UTC (rev 4778)
@@ -46,17 +46,27 @@
protected Node testPropFind;
- private final String author = "eXoPlatform";
+ private final static String AUTHOR = "eXoPlatform";
- private final String authorProp = "webdav:Author";
+ private final static String WEBDAV_AUTHOR_PROPERTY = "webdav:Author";
- private final String nt_webdave_file = "webdav:file";
+ private final static String WEBDAV_NT_FILE = "webdav:file";
+ private final static String WEBDAV_NT_RESOURCE = "exo:testResource";
+
+ private final static String WEBDAV_TEST_PROPERTY = "webdav:test-property";
+
+ private final static String CONTENT_TYPE = "text/xml";
+
private String propFindXML =
"<?xml version=\"1.0\" encoding=\"utf-8\" ?><D:propfind xmlns:D=\"DAV:\">"
+ "<D:prop xmlns:webdav=\"http://www.exoplatform.org/jcr/webdav\">"
+ "<webdav:Author/><webdav:author/><webdave:DingALing/></D:prop></D:propfind>";
+ private String multiPropFindXML = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><D:propfind xmlns:D=\"DAV:\">"
+ + "<D:prop xmlns:webdav=\"http://www.exoplatform.org/jcr/webdav\">" + "<" + WEBDAV_TEST_PROPERTY
+ + "/></D:prop></D:propfind>";
+
private String propnameXML =
"<?xml version=\"1.0\" encoding=\"utf-8\" ?><propfind xmlns=\"DAV:\"><propname/></propfind>";
@@ -97,7 +107,7 @@
{
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
ContainerResponse containerResponseFind = service(WebDAVMethods.PROPFIND, getPathWS() + file, "", null, null);
assertEquals(HTTPStatus.MULTISTATUS, containerResponseFind.getStatus());
}
@@ -116,8 +126,8 @@
String encodedfileName = "%e3%81%82%e3%81%84%e3%81%86%e3%81%88%e3%81%8a";
String decodedfileName = URLDecoder.decode(encodedfileName, "UTF-8");
String content = TestUtils.getFileContent();
- TestUtils.addContent(session, decodedfileName, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
- TestUtils.addNodeProperty(session, decodedfileName, authorProp, author);
+ TestUtils.addContent(session, decodedfileName, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
+ TestUtils.addNodeProperty(session, decodedfileName, WEBDAV_AUTHOR_PROPERTY, AUTHOR);
ContainerResponse response =
service(WebDAVMethods.PROPFIND, getPathWS() + "/" + encodedfileName, "", null, allPropsXML.getBytes());
@@ -142,8 +152,8 @@
{
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
- TestUtils.addNodeProperty(session, file, authorProp, author);
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
+ TestUtils.addNodeProperty(session, file, WEBDAV_AUTHOR_PROPERTY, AUTHOR);
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
headers.add(HttpHeaders.CONTENT_TYPE, "text/xml");
ContainerResponse responseFind =
@@ -153,16 +163,87 @@
PropFindResponseEntity entity = (PropFindResponseEntity)responseFind.getEntity();
entity.write(outputStream);
String find = outputStream.toString();
- assertTrue(find.contains(authorProp));
- assertTrue(find.contains(author));
+ assertTrue(find.contains(WEBDAV_AUTHOR_PROPERTY));
+ assertTrue(find.contains(AUTHOR));
}
+ /**
+ * Here we test WebDAV PROPFIND method implementation for correct response
+ * in case we are asking for a multi-valued property. It is expected
+ * to receive first value of a values list. That is basicly because WebDAV
+ * actually does not support multi-valued properties in the way JCR does,
+ * though it supports nested (hierarchical) properties.
+ * @throws Exception
+ */
+ public void testNonEmptyMultiPropFind() throws Exception
+ {
+ String content = TestUtils.getFileContent();
+ String file = TestUtils.getFileName();
+ String[] propValues =
+ new String[]{"No sacrifice is too great in the service of freedom.",
+ "Freedom is the right of all sentient beings."};
+
+ Node node =
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE,
+ WEBDAV_NT_RESOURCE, CONTENT_TYPE);
+
+ // set multi-valued property
+ node.getNode("jcr:content").setProperty(WEBDAV_TEST_PROPERTY, propValues);
+ session.save();
+
+ MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ headers.add(HttpHeaders.CONTENT_TYPE, CONTENT_TYPE);
+
+ ContainerResponse responseFind =
+ service(WebDAVMethods.PROPFIND, getPathWS() + file, "", headers, multiPropFindXML.getBytes());
+ assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus());
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ PropFindResponseEntity entity = (PropFindResponseEntity)responseFind.getEntity();
+ entity.write(outputStream);
+ String find = outputStream.toString();
+ assertTrue("Response should contain requested property element.", find.contains(WEBDAV_TEST_PROPERTY));
+ assertTrue("Property element should contain value data.",
+ find.contains("No sacrifice is too great in the service of freedom."));
+ }
+
+ /**
+ * Here we test WebDAV PROPFIND method implementation for correct response
+ * in case we are asking for an empty multi-valued property. It is expected
+ * to receive an empty value in response xml representation as it is 'dead'
+ * property and it is not a server responsibility to support its consistency.
+ * @throws Exception
+ */
+ public void testEmptyMultiPropFind() throws Exception
+ {
+ String content = TestUtils.getFileContent();
+ String file = TestUtils.getFileName();
+
+ Node node =
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE,
+ WEBDAV_NT_RESOURCE, CONTENT_TYPE);
+ // set empty multi-valued property
+ node.getNode("jcr:content").setProperty(WEBDAV_TEST_PROPERTY, new String[]{});
+ session.save();
+
+ MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ headers.add(HttpHeaders.CONTENT_TYPE, CONTENT_TYPE);
+
+ ContainerResponse responseFind =
+ service(WebDAVMethods.PROPFIND, getPathWS() + file, "", headers, multiPropFindXML.getBytes());
+ assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus());
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ PropFindResponseEntity entity = (PropFindResponseEntity)responseFind.getEntity();
+ entity.write(outputStream);
+ String find = outputStream.toString();
+ assertTrue("Response should contain requested property element.", find.contains(WEBDAV_TEST_PROPERTY));
+ }
+
public void testPropNames() throws Exception
{
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
- TestUtils.addNodeProperty(session, file, authorProp, author);
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
+ TestUtils.addNodeProperty(session, file, WEBDAV_AUTHOR_PROPERTY, AUTHOR);
ContainerResponse responseFind =
service(WebDAVMethods.PROPFIND, getPathWS() + file, "", null, propnameXML.getBytes());
assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus());
@@ -170,7 +251,7 @@
PropFindResponseEntity entity = (PropFindResponseEntity)responseFind.getEntity();
entity.write(outputStream);
String find = outputStream.toString();
- assertTrue(find.contains(authorProp));
+ assertTrue(find.contains(WEBDAV_AUTHOR_PROPERTY));
assertTrue(find.contains("D:getlastmodified"));
}
@@ -178,8 +259,8 @@
{
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
- TestUtils.addNodeProperty(session, file, authorProp, author);
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
+ TestUtils.addNodeProperty(session, file, WEBDAV_AUTHOR_PROPERTY, AUTHOR);
ContainerResponse responseFind =
service(WebDAVMethods.PROPFIND, getPathWS() + file, "", null, allPropsXML.getBytes());
assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus());
@@ -188,21 +269,17 @@
entity.write(outputStream);
String find = outputStream.toString();
assertTrue(find.contains("D:getlastmodified"));
- assertTrue(find.contains(authorProp));
- assertTrue(find.contains(author));
+ assertTrue(find.contains(WEBDAV_AUTHOR_PROPERTY));
+ assertTrue(find.contains(AUTHOR));
}
-
-
-
-
-
+
public void testPropWithPercent() throws Exception
{
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
String authorValue = "bla % bla";
- TestUtils.addNodeProperty(session, file, authorProp, authorValue);
+ TestUtils.addNodeProperty(session, file, WEBDAV_AUTHOR_PROPERTY, authorValue);
ContainerResponse responseFind =
service(WebDAVMethods.PROPFIND, getPathWS() + file, "", null, allPropsXML.getBytes());
assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus());
@@ -211,7 +288,7 @@
entity.write(outputStream);
String find = outputStream.toString();
assertTrue(find.contains("D:getlastmodified"));
- assertTrue(find.contains(authorProp));
+ assertTrue(find.contains(WEBDAV_AUTHOR_PROPERTY));
assertTrue(find.contains(authorValue));
}
Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml 2011-08-18 15:15:47 UTC (rev 4777)
+++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml 2011-08-19 07:10:16 UTC (rev 4778)
@@ -113,6 +113,18 @@
<supertype>nt:unstructured</supertype>
</supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false"
+
+ multiple="false">
+ <valueConstraints />
+ </propertyDefinition>
+ <propertyDefinition name="webdav:test-property" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false"
+ multiple="true">
+ <valueConstraints />
+ </propertyDefinition>
+ </propertyDefinitions>
+
</nodeType>
<nodeType name="exo:testContentResource" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1652/readme.txt
===================================================================
--- jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1652/readme.txt (rev 0)
+++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1652/readme.txt 2011-08-19 07:10:16 UTC (rev 4778)
@@ -0,0 +1,91 @@
+Summary
+
+ * Status: Empty multi-valued properties should be processed properly
+ * CCP Issue: N/A, Product Jira Issue: JCR-1652.
+ * Complexity: low
+
+The Proposal
+Problem description
+
+What is the problem to fix?
+
+ * When we have empty multi-valued property we receive exception, trying to get it via WebDAV, becuase of trying to get first element of array of property values which is empty.
+
+Fix description
+
+How is the problem fixed?
+
+ * Before trying to get property value we check if array containing it is empty.
+
+Patch file: JCR-1652.patch
+
+Tests to perform
+
+Reproduction test
+
+ * Steps to reproduce:
+
+ 1. Upload a CSS file in the content explorer
+ 1. Login as root in the file explorer
+ 2. Go in Collaboration/Documents
+ 3. Create a new folder "TEST"
+ 4. Upload a new CSS file into this folder
+ 5. view it
+ 2. Edit the file in the IDE
+ 1. Go to Collaboration workspace
+ 2. Go to /Documents/TEST. You can see your CSS
+ 3. Modify and save the file
+ 4. The file is updated, you can modify and save it if you want.
+ 3. Use the Content Explorer to modify this file
+ 1. Go back to the file explorer
+ 2. Go on your file
+ 3. As you can see the file is updated
+ 4. You must Check Out the file (yes we are using DAV on the IDE)
+ 5. Edit it using the File Explorer
+ 6. Save it
+ 7. Close it
+ 4. Go back to the IDE. You cannot get back to the folder/file
+
+Tests performed at DevLevel
+
+ * Unit test were created to cover this issue. It tests for correct response if we're trying to get property value of multi-valued property
+
+Tests performed at QA/Support Level
+*
+Documentation changes
+
+Documentation changes:
+
+ * None
+
+Configuration changes
+
+Configuration changes:
+
+ * None
+
+Will previous configuration continue to work?
+
+ * Yes
+
+Risks and impacts
+
+Can this bug fix have any side effects on current client projects?
+
+ * No
+
+Is there a performance risk/cost?
+
+ * No
+
+Validation (PM/Support/QA)
+
+PM Comment
+* Patch approved.
+
+Support Comment
+* Patch validated.
+
+QA Feedbacks
+*
+
12 years, 9 months
exo-jcr SVN: r4777 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/dataflow/persistent and 4 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2011-08-18 11:15:47 -0400 (Thu, 18 Aug 2011)
New Revision: 4777
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorksapceDataManagerBloomFilter.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCache.java
Log:
EXOJCR-1456: test added. Bloom filter configuration implemented.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java 2011-08-18 15:09:19 UTC (rev 4776)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java 2011-08-18 15:15:47 UTC (rev 4777)
@@ -227,6 +227,55 @@
}
/**
+ * Parse named parameter as Double.
+ *
+ * @param name
+ * parameter name
+ * @param defaultValue
+ * default Double value
+ * @return Double value
+ */
+ public Double getParameterDouble(String name, Double defaultValue)
+ {
+ for (int i = 0; i < parameters.size(); i++)
+ {
+ SimpleParameterEntry p = parameters.get(i);
+ if (p.getName().equals(name))
+ {
+ try
+ {
+ return StringNumberParser.parseDouble(p.getValue());
+ }
+ catch (NumberFormatException e)
+ {
+ //LOG.warn(name + ": unparseable Long. " + e);
+ }
+ }
+ }
+ return defaultValue;
+ }
+
+ /**
+ * Parse named parameter as Double.
+ *
+ * @param name
+ * parameter name
+ * @return Double value
+ * @throws RepositoryConfigurationException
+ */
+ public Double getParameterDouble(String name) throws RepositoryConfigurationException
+ {
+ try
+ {
+ return StringNumberParser.parseDouble(getParameterValue(name));
+ }
+ catch (NumberFormatException e)
+ {
+ throw new RepositoryConfigurationException(name + ": unparseable Long. " + e, e);
+ }
+ }
+
+ /**
* Parse named parameter using {@link StringNumberParser.parseTime} and return time in
* milliseconds (Long value).
*
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-08-18 15:09:19 UTC (rev 4776)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-08-18 15:15:47 UTC (rev 4777)
@@ -23,6 +23,7 @@
import org.exoplatform.management.annotations.ManagedDescription;
import org.exoplatform.services.jcr.access.AccessControlEntry;
import org.exoplatform.services.jcr.access.AccessControlList;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
import org.exoplatform.services.jcr.dataflow.persistent.MandatoryItemsPersistenceListener;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
@@ -90,6 +91,10 @@
TopologyChangeListener, Startable, WorkspaceStorageCacheListener
{
+ private final static double ACL_BF_FALSE_PROPBABILITY_DEFAULT = 0.1d;
+
+ private final static int ACL_BF_ELEMENTS_NUMBER_DEFAULT = 1000000;
+
/**
* Items cache.
*/
@@ -107,6 +112,13 @@
private final AtomicBoolean filtersEnabled = new AtomicBoolean();
+ /**
+ * Bloom filter parameters.
+ */
+ private final double bfProbability;
+
+ private final int bfElementNumber;
+
private volatile BloomFilter<String> filterPermissions;
private volatile BloomFilter<String> filterOwner;
@@ -361,6 +373,8 @@
/**
* CacheableWorkspaceDataManager constructor.
*
+ * @param wsConfig
+ * WorkspaceEntry used to fetch bloom filter parameters
* @param dataContainer
* Workspace data container (persistent level)
* @param cache
@@ -374,11 +388,30 @@
* @param rpcService
* the service for executing commands on all nodes of cluster
*/
- public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
- SystemDataContainerHolder systemDataContainerHolder, TransactionableResourceManager txResourceManager,
- TransactionService transactionService, RPCService rpcService)
+ public CacheableWorkspaceDataManager(WorkspaceEntry wsConfig, WorkspaceDataContainer dataContainer,
+ WorkspaceStorageCache cache, SystemDataContainerHolder systemDataContainerHolder,
+ TransactionableResourceManager txResourceManager, TransactionService transactionService, RPCService rpcService)
{
super(dataContainer, systemDataContainerHolder, txResourceManager);
+
+ bfProbability =
+ wsConfig.getContainer().getParameterDouble(WorkspaceDataContainer.ACL_BF_FALSE_PROPBABILITY,
+ ACL_BF_FALSE_PROPBABILITY_DEFAULT);
+ if (bfProbability < 0 || bfProbability > 1)
+ {
+ throw new IllegalArgumentException("Parameter " + WorkspaceDataContainer.ACL_BF_FALSE_PROPBABILITY
+ + " is invalid, must be between 0 and 1.");
+ }
+
+ bfElementNumber =
+ wsConfig.getContainer().getParameterInteger(WorkspaceDataContainer.ACL_BF_ELEMENTS_NUMBER,
+ ACL_BF_ELEMENTS_NUMBER_DEFAULT);
+ if (bfElementNumber <= 0)
+ {
+ throw new IllegalArgumentException("Parameter " + WorkspaceDataContainer.ACL_BF_ELEMENTS_NUMBER
+ + " is invalid, can not be less then 1.");
+ }
+
this.cache = cache;
this.requestCache = new ConcurrentHashMap<Integer, DataRequest>();
@@ -394,6 +427,8 @@
/**
* CacheableWorkspaceDataManager constructor.
*
+ * @param wsConfig
+ * WorkspaceEntry used to fetch bloom filter parameters
* @param dataContainer
* Workspace data container (persistent level)
* @param cache
@@ -404,16 +439,18 @@
* the resource manager used to manage the whole tx
* @param transactionService TransactionService
*/
- public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
- SystemDataContainerHolder systemDataContainerHolder, TransactionableResourceManager txResourceManager,
- TransactionService transactionService)
+ public CacheableWorkspaceDataManager(WorkspaceEntry wsConfig, WorkspaceDataContainer dataContainer,
+ WorkspaceStorageCache cache, SystemDataContainerHolder systemDataContainerHolder,
+ TransactionableResourceManager txResourceManager, TransactionService transactionService)
{
- this(dataContainer, cache, systemDataContainerHolder, txResourceManager, transactionService, null);
+ this(wsConfig, dataContainer, cache, systemDataContainerHolder, txResourceManager, transactionService, null);
}
/**
* CacheableWorkspaceDataManager constructor.
*
+ * @param wsConfig
+ * WorkspaceEntry used to fetch bloom filter parameters
* @param dataContainer
* Workspace data container (persistent level)
* @param cache
@@ -423,11 +460,30 @@
* @param txResourceManager
* the resource manager used to manage the whole tx
*/
- public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
- SystemDataContainerHolder systemDataContainerHolder, TransactionableResourceManager txResourceManager,
- RPCService rpcService)
+ public CacheableWorkspaceDataManager(WorkspaceEntry wsConfig, WorkspaceDataContainer dataContainer,
+ WorkspaceStorageCache cache, SystemDataContainerHolder systemDataContainerHolder,
+ TransactionableResourceManager txResourceManager, RPCService rpcService)
{
super(dataContainer, systemDataContainerHolder, txResourceManager);
+
+ bfProbability =
+ wsConfig.getContainer().getParameterDouble(WorkspaceDataContainer.ACL_BF_FALSE_PROPBABILITY,
+ ACL_BF_FALSE_PROPBABILITY_DEFAULT);
+ if (bfProbability < 0 || bfProbability > 1)
+ {
+ throw new IllegalArgumentException("Parameter " + WorkspaceDataContainer.ACL_BF_FALSE_PROPBABILITY
+ + " is invalid, must be between 0 and 1.");
+ }
+
+ bfElementNumber =
+ wsConfig.getContainer().getParameterInteger(WorkspaceDataContainer.ACL_BF_ELEMENTS_NUMBER,
+ ACL_BF_ELEMENTS_NUMBER_DEFAULT);
+ if (bfElementNumber <= 0)
+ {
+ throw new IllegalArgumentException("Parameter " + WorkspaceDataContainer.ACL_BF_ELEMENTS_NUMBER
+ + " is invalid, can not be less then 1.");
+ }
+
this.cache = cache;
this.requestCache = new ConcurrentHashMap<Integer, DataRequest>();
@@ -452,6 +508,8 @@
/**
* CacheableWorkspaceDataManager constructor.
*
+ * @param wsConfig
+ * WorkspaceEntry used to fetch bloom filter parameters
* @param dataContainer
* Workspace data container (persistent level)
* @param cache
@@ -461,15 +519,18 @@
* @param txResourceManager
* the resource manager used to manage the whole tx
*/
- public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
- SystemDataContainerHolder systemDataContainerHolder, TransactionableResourceManager txResourceManager)
+ public CacheableWorkspaceDataManager(WorkspaceEntry wsConfig, WorkspaceDataContainer dataContainer,
+ WorkspaceStorageCache cache, SystemDataContainerHolder systemDataContainerHolder,
+ TransactionableResourceManager txResourceManager)
{
- this(dataContainer, cache, systemDataContainerHolder, txResourceManager, (RPCService)null);
+ this(wsConfig, dataContainer, cache, systemDataContainerHolder, txResourceManager, (RPCService)null);
}
/**
* CacheableWorkspaceDataManager constructor.
*
+ * @param wsConfig
+ * WorkspaceEntry used to fetch bloom filter parameters
* @param dataContainer
* Workspace data container (persistent level)
* @param cache
@@ -477,10 +538,10 @@
* @param systemDataContainerHolder
* System Workspace data container (persistent level)
*/
- public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
- SystemDataContainerHolder systemDataContainerHolder)
+ public CacheableWorkspaceDataManager(WorkspaceEntry wsConfig, WorkspaceDataContainer dataContainer,
+ WorkspaceStorageCache cache, SystemDataContainerHolder systemDataContainerHolder)
{
- this(dataContainer, cache, systemDataContainerHolder, null, (RPCService)null);
+ this(wsConfig, dataContainer, cache, systemDataContainerHolder, null, (RPCService)null);
}
/**
@@ -725,8 +786,22 @@
* {@inheritDoc}
*/
@Override
- public ItemData getItemData(final String identifier) throws RepositoryException
+ public ItemData getItemData(String identifier) throws RepositoryException
{
+ return getItemData(identifier, true);
+ }
+
+ /**
+ * Do the same thing as getItemData(identifier), but ACL initialization can be specified.
+ * If doInitACL is true (default value for getItemData(identifier)) ACL will be initialized.
+ *
+ * @param identifier
+ * @param doInitACL
+ * @return
+ * @throws RepositoryException
+ */
+ private ItemData getItemData(final String identifier, final boolean doInitACL) throws RepositoryException
+ {
if (cache.isEnabled())
{
// 1. Try from cache
@@ -779,7 +854,14 @@
public ItemData run() throws RepositoryException
{
ItemData item = CacheableWorkspaceDataManager.super.getItemData(identifier);
- return item != null && item.isNode() ? initACL(null, (NodeData)item) : item;
+ if (item != null && item.isNode() && doInitACL)
+ {
+ return initACL(null, (NodeData)item);
+ }
+ else
+ {
+ return item;
+ }
}
});
}
@@ -2070,8 +2152,8 @@
{
// use parent ACL
node =
- new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(), node
- .getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
+ new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(),
+ node.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
node.getParentIdentifier(), parent.getACL());
}
else
@@ -2082,8 +2164,8 @@
}
// use nearest ancestor ACL... case of get by id
node =
- new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(), node
- .getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
+ new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(),
+ node.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
node.getParentIdentifier(), getNearestACAncestorAcl(node, search));
}
}
@@ -2207,7 +2289,7 @@
*/
private NodeData getACL(String identifier, ACLSearch search) throws RepositoryException
{
- final ItemData item = getItemData(identifier);
+ final ItemData item = getItemData(identifier, false);
return item != null && item.isNode() ? initACL(null, (NodeData)item, search) : null;
}
@@ -2277,9 +2359,8 @@
protected boolean loadFilters(boolean cleanOnFail)
{
filtersEnabled.set(false);
- // TODO: Make it configurable
- this.filterPermissions = new BloomFilter<String>(0.1d, 1000000);
- this.filterOwner = new BloomFilter<String>(0.1d, 1000000);
+ this.filterPermissions = new BloomFilter<String>(bfProbability, bfElementNumber);
+ this.filterOwner = new BloomFilter<String>(bfProbability, bfElementNumber);
boolean fails = true;
List<ACLHolder> holders = null;
try
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceDataContainer.java 2011-08-18 15:09:19 UTC (rev 4776)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceDataContainer.java 2011-08-18 15:15:47 UTC (rev 4777)
@@ -60,6 +60,10 @@
public final static String CHECK_SNS_NEW_CONNECTION = "check-sns-new-connection";
+ public final static String ACL_BF_FALSE_PROPBABILITY = "acl-bloomfilter-false-positive-probability";
+
+ public final static String ACL_BF_ELEMENTS_NUMBER = "acl-bloomfilter-elements-number";
+
/**
* [G.A] do we need it here or in WorkspaceDataManager better??
*
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2011-08-18 15:09:19 UTC (rev 4776)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2011-08-18 15:15:47 UTC (rev 4777)
@@ -25,14 +25,22 @@
import org.exoplatform.services.jcr.core.CredentialsImpl;
import org.exoplatform.services.jcr.core.ManageableRepository;
import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.ItemType;
+import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.datamodel.PropertyData;
+import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.core.ItemImpl;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
+import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpoolFileHolder;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -43,10 +51,12 @@
import java.lang.ref.WeakReference;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Calendar;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
+import javax.jcr.InvalidItemStateException;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.PathNotFoundException;
@@ -509,4 +519,239 @@
assertTrue(finded);
}
}
+
+ /**
+ * Test WorkspaceDataContainer.
+ * Does nothing, must be extended in tests.
+ *
+ * @author <a href="mailto:skarpenko@exoplatform.com">Sergiy Karpenko</a>
+ * @version $Id: exo-jboss-codetemplates.xml 34360 18.08.2011 skarpenko $
+ */
+ public class TestWorkspaceDataContainer implements WorkspaceDataContainer
+ {
+ @Override
+ public String getInfo()
+ {
+ return null;
+ }
+
+ @Override
+ public String getName()
+ {
+ return null;
+ }
+
+ @Override
+ public String getUniqueName()
+ {
+ return null;
+ }
+
+ @Override
+ public String getStorageVersion()
+ {
+ return null;
+ }
+
+ @Override
+ public Calendar getCurrentTime()
+ {
+ return null;
+ }
+
+ @Override
+ public boolean isSame(WorkspaceDataContainer another)
+ {
+ return false;
+ }
+
+ @Override
+ public WorkspaceStorageConnection openConnection() throws RepositoryException
+ {
+ return null;
+ }
+
+ @Override
+ public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
+ {
+ return null;
+ }
+
+ @Override
+ public WorkspaceStorageConnection reuseConnection(WorkspaceStorageConnection original) throws RepositoryException
+ {
+ return null;
+ }
+
+ @Override
+ public boolean isCheckSNSNewConnection()
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Test WorkspaceStorageConnection.
+ * Does nothing, must be extended in tests.
+ *
+ * @author <a href="mailto:skarpenko@exoplatform.com">Sergiy Karpenko</a>
+ * @version $Id: exo-jboss-codetemplates.xml 34360 18.08.2011 skarpenko $
+ */
+ public class TestWorkspaceStorageConnection implements WorkspaceStorageConnection
+ {
+
+ @Override
+ public ItemData getItemData(NodeData parentData, QPathEntry name) throws RepositoryException,
+ IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public ItemData getItemData(NodeData parentData, QPathEntry name, ItemType itemType) throws RepositoryException,
+ IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public ItemData getItemData(String identifier) throws RepositoryException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public List<NodeData> getChildNodesData(NodeData parent) throws RepositoryException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public List<NodeData> getChildNodesData(NodeData parent, List<QPathEntryFilter> pattern)
+ throws RepositoryException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public int getChildNodesCount(NodeData parent) throws RepositoryException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public int getLastOrderNumber(NodeData parent) throws RepositoryException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public List<PropertyData> getChildPropertiesData(NodeData parent) throws RepositoryException,
+ IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public List<PropertyData> getChildPropertiesData(NodeData parent, List<QPathEntryFilter> pattern)
+ throws RepositoryException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public List<PropertyData> listChildPropertiesData(NodeData parent) throws RepositoryException,
+ IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public List<PropertyData> getReferencesData(String nodeIdentifier) throws RepositoryException,
+ IllegalStateException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public void add(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public void add(PropertyData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public void update(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public void update(PropertyData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public void rename(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public void delete(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public void delete(PropertyData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public void commit() throws IllegalStateException, RepositoryException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public void rollback() throws IllegalStateException, RepositoryException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public void close() throws IllegalStateException, RepositoryException
+ {
+ }
+
+ @Override
+ public boolean isOpened()
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ @Override
+ public List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException,
+ UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException("TestWorkspaceStorageConnection: operation is unsupported.");
+ }
+
+ }
+
}
Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorksapceDataManagerBloomFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorksapceDataManagerBloomFilter.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorksapceDataManagerBloomFilter.java 2011-08-18 15:15:47 UTC (rev 4777)
@@ -0,0 +1,301 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.dataflow.persistent;
+
+import org.exoplatform.commons.utils.QName;
+import org.exoplatform.services.jcr.JcrImplBaseTest;
+import org.exoplatform.services.jcr.access.AccessControlEntry;
+import org.exoplatform.services.jcr.access.AccessControlList;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
+import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.datamodel.QPathEntry;
+import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * @author <a href="mailto:skarpenko@exoplatform.com">Sergiy Karpenko</a>
+ * @version $Id: exo-jboss-codetemplates.xml 34360 18.08.2011 skarpenko $
+ *
+ */
+public class TestCacheableWorksapceDataManagerBloomFilter extends JcrImplBaseTest
+{
+ private MyWorkspaceDataContainer dataContainer;
+
+ private CacheableWorkspaceDataManager mgr;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ dataContainer = new MyWorkspaceDataContainer();
+ WorkspaceStorageCache cache = new MyWorkspaceStorageCache();
+ WorkspaceContainerFacade wsc = repository.getWorkspaceContainer("ws");
+ WorkspaceEntry wconf = (WorkspaceEntry)wsc.getComponent(WorkspaceEntry.class);
+ mgr =
+ new CacheableWorkspaceDataManager(wconf, dataContainer, cache, new SystemDataContainerHolder(dataContainer));
+ }
+
+ protected void tearDown() throws Exception
+ {
+ dataContainer.clear();
+ dataContainer = null;
+ mgr.clear();
+ mgr = null;
+ super.tearDown();
+ }
+
+ public void testGetItemWithACL() throws Exception
+ {
+ QPath path;
+ dataContainer.add(new PersistedNodeData("2", path = new QPath(new QPathEntry[]{new QPathEntry("", "2", 1, "2")}),
+ "3", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
+ 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ mgr.reloadFilters();
+ mgr.getItemData("1");
+ assertEquals(1, dataContainer.getTotalCalls());
+ dataContainer.clear();
+ }
+
+ public void testGetItemWithoutACL() throws Exception
+ {
+ QPath path;
+ dataContainer.add(new PersistedNodeData("3", path = new QPath(new QPathEntry[]{new QPathEntry("", "3", 1, "3")}),
+ "4", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
+ 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
+ 1, 1, null, null, null));
+ mgr.reloadFilters();
+ mgr.getItemData("1");
+ assertEquals(2, dataContainer.getTotalCalls());
+ dataContainer.clear();
+ }
+
+ public void testGetItemParentWithSingleOwner() throws Exception
+ {
+ QPath path;
+ dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
+ "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
+ 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
+ 1, 1, null, null, new AccessControlList("owner", null)));
+ dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
+ 1, 1, null, null, null));
+ mgr.reloadFilters();
+ mgr.getItemData("1");
+ assertEquals(3, dataContainer.getTotalCalls());
+ dataContainer.clear();
+ }
+
+ public void testGetItemParentWithSinglePermission() throws Exception
+ {
+ QPath path;
+ dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
+ "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
+ 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
+ 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
+ 1, 1, null, null, null));
+ mgr.reloadFilters();
+ mgr.getItemData("1");
+ assertEquals(3, dataContainer.getTotalCalls());
+ dataContainer.clear();
+ }
+
+ public void testGetItemParentsWithCrossEmptyACL() throws Exception
+ {
+ QPath path;
+ dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
+ "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
+ 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
+ 1, 1, null, null, new AccessControlList("owner", null)));
+ dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
+ 1, 1, null, null, null));
+ mgr.reloadFilters();
+ mgr.getItemData("1");
+ assertEquals(3, dataContainer.getTotalCalls());
+ dataContainer.clear();
+ }
+
+ public void testGetItemParentsWithCrossEmptyACL2() throws Exception
+ {
+ QPath path;
+ dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
+ "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
+ 1, 1, null, null, new AccessControlList("owner", null)));
+ dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
+ 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
+ 1, 1, null, null, null));
+ mgr.reloadFilters();
+ mgr.getItemData("1");
+ assertEquals(3, dataContainer.getTotalCalls());
+ dataContainer.clear();
+ }
+
+ public void testGetItemParentsWithSameOwnerlessACL() throws Exception
+ {
+ QPath path;
+ dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
+ "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
+ 1, 1, null, null, new AccessControlList("owner", null)));
+ dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
+ 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
+ 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
+ mgr.reloadFilters();
+ mgr.getItemData("1");
+ assertEquals(2, dataContainer.getTotalCalls());
+ dataContainer.clear();
+ }
+
+ public void testGetItemParentsWithSamePermissionlessACL() throws Exception
+ {
+ QPath path;
+ dataContainer.add(new PersistedNodeData("4", path = new QPath(new QPathEntry[]{new QPathEntry("", "4", 1, "4")}),
+ "5", 1, 1, null, null, new AccessControlList("owner", new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("3", path = QPath.makeChildPath(path, new QName("", "3"), 1, "3"), "4",
+ 1, 1, null, null, new AccessControlList(null, new ArrayList<AccessControlEntry>())));
+ dataContainer.add(new PersistedNodeData("2", path = QPath.makeChildPath(path, new QName("", "2"), 1, "2"), "3",
+ 1, 1, null, null, new AccessControlList("owner", null)));
+ dataContainer.add(new PersistedNodeData("1", path = QPath.makeChildPath(path, new QName("", "1"), 1, "1"), "2",
+ 1, 1, null, null, new AccessControlList("owner", null)));
+ mgr.reloadFilters();
+ mgr.getItemData("1");
+ assertEquals(2, dataContainer.getTotalCalls());
+ dataContainer.clear();
+ }
+
+ class MyWorkspaceDataContainer extends TestWorkspaceDataContainer
+ {
+
+ protected Map<String, NodeData> nodesById = new HashMap<String, NodeData>();
+
+ protected List<ACLHolder> holders = new ArrayList<ACLHolder>();
+
+ private int totalCalls;
+
+ protected synchronized void incrementCalls()
+ {
+ totalCalls++;
+ }
+
+ public WorkspaceStorageConnection openConnection() throws RepositoryException
+ {
+ return new MyWorkspaceStorageConnection(this);
+ }
+
+ public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
+ {
+ return openConnection();
+ }
+
+ public void clear()
+ {
+ nodesById.clear();
+ holders.clear();
+ totalCalls = 0;
+ }
+
+ public void add(NodeData node)
+ {
+ nodesById.put(node.getIdentifier(), node);
+ AccessControlList acl = node.getACL();
+ if (acl != null)
+ {
+ ACLHolder holder = new ACLHolder(node.getIdentifier());
+ holder.setOwner(acl.hasOwner());
+ holder.setPermissions(acl.hasPermissions());
+ holders.add(holder);
+ }
+ }
+
+ /**
+ * @return the totalCalls
+ */
+ public int getTotalCalls()
+ {
+ return totalCalls;
+ }
+
+ }
+
+ class MyWorkspaceStorageConnection extends TestWorkspaceStorageConnection
+ {
+ private final MyWorkspaceDataContainer container;
+
+ public MyWorkspaceStorageConnection(MyWorkspaceDataContainer myWorkspaceDataContainer)
+ {
+ container = myWorkspaceDataContainer;
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager#getItemData(java.lang.String)
+ */
+ @Override
+ public ItemData getItemData(String identifier) throws RepositoryException
+ {
+ container.incrementCalls();
+ return container.nodesById.get(identifier);
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager#getACLHolders()
+ */
+ @Override
+ public List<ACLHolder> getACLHolders() throws RepositoryException
+ {
+ return container.holders;
+ }
+ }
+
+ class MyWorkspaceStorageCache extends LinkedWorkspaceStorageCacheImpl
+ {
+ public MyWorkspaceStorageCache() throws RepositoryConfigurationException
+ {
+ super("", false, 0, 0, 0, 0, false, false, 0, false);
+ }
+
+ public boolean isEnabled()
+ {
+ return false;
+ }
+ }
+
+}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2011-08-18 15:09:19 UTC (rev 4776)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2011-08-18 15:15:47 UTC (rev 4777)
@@ -16,8 +16,9 @@
*/
package org.exoplatform.services.jcr.impl.dataflow.persistent;
-import junit.framework.TestCase;
-
+import org.exoplatform.services.jcr.JcrImplBaseTest;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
@@ -53,7 +54,7 @@
* nicolas.filotto(a)exoplatform.com
* 29 mars 2010
*/
-public class TestCacheableWorkspaceDataManager extends TestCase
+public class TestCacheableWorkspaceDataManager extends JcrImplBaseTest
{
private static final int READER = 100;
@@ -67,13 +68,16 @@
private MyWorkspaceStorageConnection con;
@Override
- protected void setUp() throws Exception
+ public void setUp() throws Exception
{
super.setUp();
this.con = new MyWorkspaceStorageConnection();
this.wdc = new MyWorkspaceDataContainer(con);
+ WorkspaceContainerFacade wsc = repository.getWorkspaceContainer("ws");
+ WorkspaceEntry wconf = (WorkspaceEntry)wsc.getComponent(WorkspaceEntry.class);
this.cwdm =
- new CacheableWorkspaceDataManager(wdc, new MyWorkspaceStorageCache(), new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wconf, wdc, new MyWorkspaceStorageCache(),
+ new SystemDataContainerHolder(wdc));
}
@Override
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2011-08-18 15:09:19 UTC (rev 4776)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2011-08-18 15:15:47 UTC (rev 4777)
@@ -21,6 +21,8 @@
import org.exoplatform.commons.utils.QName;
import org.exoplatform.services.jcr.JcrImplBaseTest;
import org.exoplatform.services.jcr.access.AccessControlList;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl;
@@ -72,10 +74,12 @@
{
MyWorkspaceStorageConnection con = new MyWorkspaceStorageConnection();
WorkspaceDataContainer wdc = new MyWorkspaceDataContainer(con);
+ WorkspaceContainerFacade wsc = repository.getWorkspaceContainer("ws");
+ WorkspaceEntry wconf = (WorkspaceEntry)wsc.getComponent(WorkspaceEntry.class);
CacheableWorkspaceDataManager cwdmNode1 =
- new CacheableWorkspaceDataManager(wdc, cache1 = getCacheImpl(), new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wconf, wdc, cache1 = getCacheImpl(), new SystemDataContainerHolder(wdc));
CacheableWorkspaceDataManager cwdmNode2 =
- new CacheableWorkspaceDataManager(wdc, cache2 = getCacheImpl(), new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wconf, wdc, cache2 = getCacheImpl(), new SystemDataContainerHolder(wdc));
NodeData parentNode = new PersistedNodeData("parent-id", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node")), Constants.ROOT_UUID, 1, 0,
Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
// Test getChildNodesData
@@ -329,10 +333,12 @@
// testConsistency
con = new MyWorkspaceStorageConnection(true);
wdc = new MyWorkspaceDataContainer(con);
+ wsc = repository.getWorkspaceContainer("ws");
+ wconf = (WorkspaceEntry)wsc.getComponent(WorkspaceEntry.class);
cwdmNode1 =
- new CacheableWorkspaceDataManager(wdc, cache1, new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wconf, wdc, cache1, new SystemDataContainerHolder(wdc));
cwdmNode2 =
- new CacheableWorkspaceDataManager(wdc, cache2, new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wconf, wdc, cache2, new SystemDataContainerHolder(wdc));
parentNode = new PersistedNodeData("parent2-id", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node")), Constants.ROOT_UUID, 1, 0,
Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
// Test getChildNodesData
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2011-08-18 15:09:19 UTC (rev 4776)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2011-08-18 15:15:47 UTC (rev 4777)
@@ -22,6 +22,7 @@
import org.exoplatform.services.jcr.config.CacheEntry;
import org.exoplatform.services.jcr.config.SimpleParameterEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl;
@@ -37,7 +38,6 @@
import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager;
import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspaceStorageCacheBaseCase;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache;
import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBase;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
@@ -84,8 +84,10 @@
{
MyWorkspaceStorageConnection con = new MyWorkspaceStorageConnection();
WorkspaceDataContainer wdc = new MyWorkspaceDataContainer(con);
+ WorkspaceContainerFacade wsc = repository.getWorkspaceContainer("ws");
+ WorkspaceEntry wconf = (WorkspaceEntry)wsc.getComponent(WorkspaceEntry.class);
final CacheableWorkspaceDataManager cwdm =
- new CacheableWorkspaceDataManager(wdc, getCacheImpl(), new SystemDataContainerHolder(wdc));
+ new CacheableWorkspaceDataManager(wconf, wdc, getCacheImpl(), new SystemDataContainerHolder(wdc));
String idNode = "foo1";
executeConcurrentReadNWrite(con, cwdm, Mode.READ_FIRST, idNode);
assertNotNull(cwdm.getItemData(idNode));
12 years, 9 months
exo-jcr SVN: r4776 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-08-18 11:09:19 -0400 (Thu, 18 Aug 2011)
New Revision: 4776
Modified:
kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/SimpleContext.java
Log:
EXOJCR-1445: fixed imports
Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/SimpleContext.java
===================================================================
--- kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/SimpleContext.java 2011-08-18 15:01:36 UTC (rev 4775)
+++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/SimpleContext.java 2011-08-18 15:09:19 UTC (rev 4776)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.naming;
+import org.exoplatform.services.jdbc.impl.CloseableDataSource;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
12 years, 9 months
exo-jcr SVN: r4775 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-08-18 11:01:36 -0400 (Thu, 18 Aug 2011)
New Revision: 4775
Modified:
kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/ExoContainerContextFactory.java
kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/SimpleContext.java
Log:
EXOJCR-1445: changed DS binding for tomcat AS
Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/ExoContainerContextFactory.java
===================================================================
--- kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/ExoContainerContextFactory.java 2011-08-18 08:47:38 UTC (rev 4774)
+++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/ExoContainerContextFactory.java 2011-08-18 15:01:36 UTC (rev 4775)
@@ -111,6 +111,11 @@
}
}
+ protected void bindRefValue(String name, Object value) throws NamingException
+ {
+ bind(name, value, false);
+ }
+
protected Map<String, Object> getBindings()
{
return bindingsRef.get();
Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/SimpleContext.java
===================================================================
--- kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/SimpleContext.java 2011-08-18 08:47:38 UTC (rev 4774)
+++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming/SimpleContext.java 2011-08-18 15:01:36 UTC (rev 4775)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.naming;
-import org.exoplatform.services.jdbc.impl.CloseableDataSource;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -121,7 +120,7 @@
}
// Re-bind with the object with its new value to be able to return the same ins
- bind(name, obj, false);
+ bindRefValue(name, obj);
}
catch (Exception e)
{
@@ -156,7 +155,7 @@
bind(name, value, true);
}
- private void bind(String name, Object value, boolean checkIfExists) throws NamingException
+ protected void bind(String name, Object value, boolean checkIfExists) throws NamingException
{
if (name.isEmpty())
{
@@ -192,6 +191,13 @@
/**
* {@inheritDoc}
*/
+ protected void bindRefValue(String name, Object value) throws NamingException
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public void rebind(Name name, Object value) throws NamingException
{
rebind(nameToString(name), value);
12 years, 9 months
exo-jcr SVN: r4774 - in jcr/branches/1.12.x: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache and 1 other directories.
by do-not-reply@jboss.org
Author: trang_vu
Date: 2011-08-18 04:47:38 -0400 (Thu, 18 Aug 2011)
New Revision: 4774
Added:
jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1650/readme.txt
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java
jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCacheInClusterMode.java
Log:
JCR-1650: Lists stored into the cache can be inconsistent in cluster environment
Fix description
* Invalidate the list of child nodes on all cluster nodes when a new child has been added and the local cache has now the list of child nodes.
Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java 2011-08-18 08:09:15 UTC (rev 4773)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java 2011-08-18 08:47:38 UTC (rev 4774)
@@ -30,6 +30,7 @@
import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.Region;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jgroups.Address;
@@ -993,6 +994,12 @@
LOG.error("Unexpected object found by FQN:" + getFqn() + " and key:" + key + ". Expected Set, but found:"
+ existingObject.getClass().getName());
}
+ else if (!localMode && cache.getConfiguration().getCacheMode() != CacheMode.LOCAL)
+ {
+ // to prevent consistency issue since we don't have the list in the local cache, we are in cluster env
+ // and we are in a non local mode, we clear the list in order to enforce other cluster nodes to reload it from the db
+ cache.put(fqn, key, null);
+ }
}
@Override
@@ -1022,6 +1029,13 @@
@Override
public void apply()
{
+ if (!localMode && cache.getConfiguration().getCacheMode() != CacheMode.LOCAL)
+ {
+ // to prevent consistency issue since we don't have the list in the local cache, we are in cluster env
+ // and we are in a non local mode, we remove all the patterns in order to enforce other cluster nodes to reload them from the db
+ cache.removeNode(fqn);
+ return;
+ }
// force writeLock on next read
cache.getInvocationContext().getOptionOverrides().setForceWriteLock(true);
// object found by FQN and key;
Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCacheInClusterMode.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCacheInClusterMode.java 2011-08-18 08:09:15 UTC (rev 4773)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCacheInClusterMode.java 2011-08-18 08:47:38 UTC (rev 4774)
@@ -80,12 +80,12 @@
transactionService == null ? null : transactionService, new ConfigurationManagerImpl());
}
- public void testRaceConditions() throws Exception
+ public void testRaceConditionsNConsistency() throws Exception
{
JBossCacheWorkspaceStorageCache cache1 = null, cache2 = null;
try
{
- MyWorkspaceStorageConnection con = new MyWorkspaceStorageConnection();
+ MyWorkspaceSC con = new MyWorkspaceSC();
WorkspaceDataContainer wdc = new MyWorkspaceDataContainer(con);
CacheableWorkspaceDataManager cwdmNode1 =
new CacheableWorkspaceDataManager(wdc, cache1 = getCacheImpl(), new SystemDataContainerHolder(wdc));
@@ -273,6 +273,106 @@
assertEquals(2, cwdmNode1.getItemData(parentNode, qpe, ItemType.PROPERTY).getPersistedVersion());
assertNotNull(cwdmNode2.getItemData(parentNode, qpe, ItemType.PROPERTY));
assertEquals(2, cwdmNode2.getItemData(parentNode, qpe, ItemType.PROPERTY).getPersistedVersion());
+
+ // testConsistency
+ con = new MyWorkspaceSC(true);
+ wdc = new MyWorkspaceDataContainer(con);
+ cwdmNode1 = new CacheableWorkspaceDataManager(wdc, cache1, new SystemDataContainerHolder(wdc));
+ cwdmNode2 = new CacheableWorkspaceDataManager(wdc, cache2, new SystemDataContainerHolder(wdc));
+ parentNode =
+ new PersistedNodeData("parent2-id", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null,
+ "parent2-node")), Constants.ROOT_UUID, 1, 0, Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+
+ // Test getChildNodesData
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildNodesData(parentNode);
+ PlainChangesLog chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createAddedState(new PersistedNodeData("id-node" + parentNode.getIdentifier(), QPath
+ .makeChildPath(parentNode.getQPath(), new InternalQName(null, "node")), parentNode.getIdentifier(), 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null)));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildNodesData(parentNode));
+ assertEquals(2, cwdmNode1.getChildNodesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildNodesData(parentNode));
+ assertEquals(2, cwdmNode2.getChildNodesData(parentNode).size());
+ parentNode =
+ new PersistedNodeData("parent2-id2", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null,
+ "parent2-node2")), Constants.ROOT_UUID, 1, 0, Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildNodesData(parentNode);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createDeletedState(new PersistedNodeData("id-node2" + parentNode.getIdentifier(), QPath
+ .makeChildPath(parentNode.getQPath(), new InternalQName(null, "node2")), parentNode.getIdentifier(), 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null)));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildNodesData(parentNode));
+ assertEquals(0, cwdmNode1.getChildNodesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildNodesData(parentNode));
+ assertEquals(0, cwdmNode2.getChildNodesData(parentNode).size());
+
+ // Test getChildPropertiesData
+ parentNode =
+ new PersistedNodeData("parent2-id3", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null,
+ "parent2-node3")), Constants.ROOT_UUID, 1, 0, Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildPropertiesData(parentNode);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createAddedState(new PersistedPropertyData("id-property" + parentNode.getIdentifier(),
+ QPath.makeChildPath(parentNode.getQPath(), new InternalQName(null, "property")),
+ parentNode.getIdentifier(), 0, PropertyType.STRING, false, Arrays
+ .asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode));
+ assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode));
+ assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode).size());
+ parentNode =
+ new PersistedNodeData("parent2-id4", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null,
+ "parent2-node4")), Constants.ROOT_UUID, 1, 0, Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getChildPropertiesData(parentNode);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createDeletedState(new PersistedPropertyData("id-property2" + parentNode.getIdentifier(),
+ QPath.makeChildPath(parentNode.getQPath(), new InternalQName(null, "property2")), parentNode
+ .getIdentifier(), 0, PropertyType.STRING, false, Arrays
+ .asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode));
+ assertEquals(0, cwdmNode1.getChildPropertiesData(parentNode).size());
+ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode));
+ assertEquals(0, cwdmNode2.getChildPropertiesData(parentNode).size());
+
+ // Test getReferencesData
+ parentNode =
+ new PersistedNodeData("parent2-id5", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null,
+ "parent2-node5")), Constants.ROOT_UUID, 1, 0, Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getReferencesData(parentNode.getIdentifier(), false);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createAddedState(new PersistedPropertyData("id-reference" + parentNode.getIdentifier(),
+ QPath.makeChildPath(parentNode.getQPath(), new InternalQName(null, "reference")), parentNode
+ .getIdentifier(), 0, PropertyType.REFERENCE, false, Arrays
+ .asList((ValueData)new ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8"))))));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(2, cwdmNode1.getReferencesData(parentNode.getIdentifier(), false).size());
+ assertNotNull(cwdmNode2.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(2, cwdmNode2.getReferencesData(parentNode.getIdentifier(), false).size());
+ parentNode =
+ new PersistedNodeData("parent2-id6", QPath.makeChildPath(Constants.ROOT_PATH, new InternalQName(null,
+ "parent2-node6")), Constants.ROOT_UUID, 1, 0, Constants.NT_UNSTRUCTURED, new InternalQName[0], null);
+ con.setParentNode(parentNode);
+ cwdmNode2.getReferencesData(parentNode.getIdentifier(), false);
+ chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createDeletedState(new PersistedPropertyData("id-reference2" + parentNode.getIdentifier(),
+ QPath.makeChildPath(parentNode.getQPath(), new InternalQName(null, "reference2")), parentNode
+ .getIdentifier(), 0, PropertyType.REFERENCE, false, Arrays
+ .asList((ValueData)new ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8"))))));
+ cwdmNode1.save(chlog);
+ assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(0, cwdmNode1.getReferencesData(parentNode.getIdentifier(), false).size());
+ assertNotNull(cwdmNode2.getReferencesData(parentNode.getIdentifier(), false));
+ assertEquals(0, cwdmNode2.getReferencesData(parentNode.getIdentifier(), false).size());
}
finally
{
@@ -308,7 +408,7 @@
* @param idNode
* @throws InterruptedException
*/
- private void executeConcurrentReadNWrite(final MyWorkspaceStorageConnection con, final Action readAction,
+ private void executeConcurrentReadNWrite(final MyWorkspaceSC con, final Action readAction,
final Action writeAction, final Mode mode, final NodeData parentNode) throws InterruptedException
{
final CountDownLatch goSignal = con.initCountDownLatch();
@@ -336,6 +436,8 @@
{
if (mode == Mode.WRITE_FIRST) goSignal.countDown();
doneSignal.countDown();
+
+ con.wait.remove();
}
}
};
@@ -360,6 +462,8 @@
{
if (mode == Mode.READ_FIRST) goSignal.countDown();
doneSignal.countDown();
+
+ con.wait.remove();
}
}
};
@@ -373,22 +477,50 @@
{
protected final CacheableWorkspaceDataManager cwdm;
+
public Action(CacheableWorkspaceDataManager cwdm)
{
this.cwdm = cwdm;
}
protected abstract void execute(NodeData parentNode) throws Exception;
}
+
private static enum Mode
{
READ_FIRST, WRITE_FIRST;
}
- private static class MyWorkspaceStorageConnection implements WorkspaceStorageConnection
+
+ public static class MyWorkspaceSC implements WorkspaceStorageConnection
{
public ThreadLocal<Boolean> wait = new ThreadLocal<Boolean>();
+
private NodeData parentNode;
+
private CountDownLatch goSignal;
+ private ItemData itemAdded;
+
+ private boolean canModify;
+
+ private boolean itemDeleted;
+
+ public MyWorkspaceSC()
+ {
+ }
+
+ public MyWorkspaceSC(boolean canModify)
+ {
+ this.canModify = canModify;
+ }
+
+ /**
+ * @param canModify the canModify to set
+ */
+ public void setCanModify(boolean canModify)
+ {
+ this.canModify = canModify;
+ }
+
public CountDownLatch initCountDownLatch()
{
return this.goSignal = new CountDownLatch(1);
@@ -397,16 +529,20 @@
public void setParentNode(NodeData parentNode)
{
this.parentNode = parentNode;
+ this.itemAdded = null;
+ this.itemDeleted = false;
}
public void add(NodeData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
+ this.itemAdded = data;
}
public void add(PropertyData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
+ this.itemAdded = data;
}
public void close() throws IllegalStateException, RepositoryException
@@ -431,11 +567,13 @@
public void delete(NodeData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
+ this.itemDeleted = true;
}
public void delete(PropertyData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
+ this.itemDeleted = true;
}
public int getChildNodesCount(NodeData parent) throws RepositoryException
@@ -457,8 +595,17 @@
}
}
List<NodeData> children = new ArrayList<NodeData>();
- children.add(new PersistedNodeData("id-node2" + parentNode.getIdentifier(), QPath.makeChildPath(parent.getQPath(), new InternalQName(null, "node2")), parent.getIdentifier(), 1, 0,
- Constants.NT_UNSTRUCTURED, new InternalQName[0], null));
+ if (!canModify || !itemDeleted)
+ {
+ children.add(new PersistedNodeData("id-node2" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parent.getQPath(), new InternalQName(null, "node2")), parent.getIdentifier(), 1, 0,
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], null));
+ }
+ if (canModify && itemAdded != null)
+ {
+ children.add((NodeData)itemAdded);
+ }
+
return children;
}
@@ -479,9 +626,17 @@
List<PropertyData> children = new ArrayList<PropertyData>();
try
{
- children.add(new PersistedPropertyData("id-property2" + parentNode.getIdentifier(), QPath.makeChildPath(
- parentNode.getQPath(), new InternalQName(null, "property2")), parentNode.getIdentifier(), 0,
- PropertyType.STRING, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8")))));
+ if (!canModify || !itemDeleted)
+ {
+ children.add(new PersistedPropertyData("id-property2" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "property2")), parentNode.getIdentifier(), 0,
+ PropertyType.STRING, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, "some data"
+ .getBytes("UTF-8")))));
+ }
+ if (canModify && itemAdded != null)
+ {
+ children.add((PropertyData)itemAdded);
+ }
}
catch (UnsupportedEncodingException e)
{
@@ -565,9 +720,18 @@
List<PropertyData> children = new ArrayList<PropertyData>();
try
{
- children.add(new PersistedPropertyData("id-reference2" + parentNode.getIdentifier(), QPath.makeChildPath(
- parentNode.getQPath(), new InternalQName(null, "reference2")), parentNode.getIdentifier(), 0,
- PropertyType.REFERENCE, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8")))));
+ if (!canModify || !itemDeleted)
+ {
+ children
+ .add(new PersistedPropertyData("id-reference2" + parentNode.getIdentifier(), QPath.makeChildPath(
+ parentNode.getQPath(), new InternalQName(null, "reference2")), parentNode.getIdentifier(), 0,
+ PropertyType.REFERENCE, false, Arrays.asList((ValueData)new ByteArrayPersistedValueData(0,
+ parentNode.getIdentifier().getBytes("UTF-8")))));
+ }
+ if (canModify && itemAdded != null)
+ {
+ children.add((PropertyData)itemAdded);
+ }
}
catch (UnsupportedEncodingException e)
{
Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1650/readme.txt
===================================================================
--- jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1650/readme.txt (rev 0)
+++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1650/readme.txt 2011-08-18 08:47:38 UTC (rev 4774)
@@ -0,0 +1,71 @@
+Summary
+
+ * Status: Lists stored into the cache can be inconsistent in cluster environment
+ * CCP Issue: N/A Product Jira Issue: JCR-1650.
+ * Complexity: Low
+
+The Proposal
+Problem description
+
+What is the problem to fix?
+In cluster environment for example if:
+1. we have the list of all the children nodes of a given JCR node in the cluster node 1
+2. this list has not been loaded in the cluster node 2
+3. and we add a new child node in the cluster node 2
+
+In this kind of usecase, since the list has not been loaded locally, we don't change the list content which has for consequences that the cluster node 1 doesn't have this new node in its list which is a consistency issue.
+Fix description
+
+How is the problem fixed?
+
+ * Invalidate the list of child nodes on all cluster nodes when a new child has been added and the local cache has now the list of child nodes
+
+Patch file: JCR-1650.patch
+
+Tests to perform
+
+Reproduction test
+
+ * TestWorkspaceStorageCacheInClusterMode.java
+
+Tests performed at DevLevel
+
+ * functional testing jcr-core project
+
+Tests performed at QA/Support Level
+*
+Documentation changes
+
+Documentation changes:
+ * No
+
+Configuration changes
+
+Configuration changes:
+
+ * No
+
+Will previous configuration continue to work?
+
+ * Yes
+
+Risks and impacts
+
+Can this bug fix have any side effects on current client projects?
+
+ * No
+
+Is there a performance risk/cost?
+
+ * After invalidation all cluster nodes are supposed to reload the list of child nodes if need
+
+Validation (PM/Support/QA)
+
+PM Comment
+* Patch approved.
+
+Support Comment
+*
+
+QA Feedbacks
+*
12 years, 9 months
exo-jcr SVN: r4773 - jcr/trunk/exo.jcr.component.core.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-08-18 04:09:15 -0400 (Thu, 18 Aug 2011)
New Revision: 4773
Modified:
jcr/trunk/exo.jcr.component.core/known-issues.txt
Log:
EXOJCR-1428: review TCK tests
Modified: jcr/trunk/exo.jcr.component.core/known-issues.txt
===================================================================
--- jcr/trunk/exo.jcr.component.core/known-issues.txt 2011-08-18 07:47:44 UTC (rev 4772)
+++ jcr/trunk/exo.jcr.component.core/known-issues.txt 2011-08-18 08:09:15 UTC (rev 4773)
@@ -0,0 +1,13 @@
+FrozenNodeTest
+ eXo JCR has different versionable storage implementation. Node with nodetype nt:frozenNode has no child nodes with the same nodetype instead what TCK supposed.
+
+RestoreTest#testRestoreName
+RestoreTest#testRestoreOrder2
+ eXo JCR doesn't remove versionable child node with OnParentVerion=Version during restore operation
+
+PropertyDefTest#testIsRequiredType:
+ eXo JCR has additional property type called PERMISSION
+
+PredefinedNodeTypeTest#testVersionable
+PredefinedNodeTypeTest#testVersion
+ TCK's nodetypes differ from what spec says
\ No newline at end of file
12 years, 9 months
exo-jcr SVN: r4772 - jcr/trunk/exo.jcr.component.core.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-08-18 03:47:44 -0400 (Thu, 18 Aug 2011)
New Revision: 4772
Modified:
jcr/trunk/exo.jcr.component.core/pom.xml
Log:
EXOJCR-1428: review TCK tests
Modified: jcr/trunk/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/pom.xml 2011-08-18 07:25:24 UTC (rev 4771)
+++ jcr/trunk/exo.jcr.component.core/pom.xml 2011-08-18 07:47:44 UTC (rev 4772)
@@ -691,21 +691,11 @@
</property>
<property>
<name>known.issues</name>
- <value>org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testBooleanProperty
- org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testMultipleBooleanProperty
- org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
- org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder
+ <value>org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder2
org.apache.jackrabbit.test.api.nodetype.PropertyDefTest#testIsRequiredType
- org.apache.jackrabbit.test.api.SetPropertyConstraintViolationExceptionTest#testBooleanProperty
- org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testShareable
- org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testSimpleVersionable
- org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testActivity
- org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testConfiguration
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersionable
- org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersion
- org.apache.jackrabbit.test.api.NamespaceRegistryTest#testRegisterNamespace
- </value>
+ org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersion</value>
</property>
<!-- Uncomment the line below if you want to enable the statistics -->
<!--property>
12 years, 9 months