[exo-jcr-commits] exo-jcr SVN: r5433 - in jcr/branches/1.15.x: exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext and 5 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Jan 10 08:39:27 EST 2012
Author: areshetnyak
Date: 2012-01-10 08:39:25 -0500 (Tue, 10 Jan 2012)
New Revision: 5433
Added:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/FixupStream.java
Removed:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryChangesListenerRegisterPlugin.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/initializer/
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/BaseReplicationTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationCopyMoveNodeTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationDocumentViewImportTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationEditDataTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationExternalizableTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationLockTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationStreamTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationSysViewImportTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationVersionRestoreTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/AddNTFileCheckerTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/BaseTestCaseChecker.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/BasicAuthenticationHttpClient.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/CopyMoveCheckerTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/LockCheckerTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/MemberInfo.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/VersionCheckerTest.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/bandwidth/
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/concurrent/
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/priority/
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-replication.xml
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-replication.xml
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/fs/IncrementalBackupJob.java
Log:
EXOJCR-1701 : Old replication way and support of AsyncReplication was removed.
Deleted: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryChangesListenerRegisterPlugin.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryChangesListenerRegisterPlugin.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryChangesListenerRegisterPlugin.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.impl;
-
-import org.exoplatform.container.component.BaseComponentPlugin;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.ValueParam;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * @author <a href="mailto:anatoliy.bazko at exoplatform.com.ua">Anatoliy Bazko</a>
- * @version $Id: StoreChangesPlugin.java 111 2008-11-11 11:11:11Z $
- */
-public class RepositoryChangesListenerRegisterPlugin extends BaseComponentPlugin
-{
-
- private String repositoryName = null;
-
- private String workspaces = null;
-
- private String listenerClassName = null;
-
- /**
- * StoreChangesPlugin constructor.
- *
- * @param params
- */
- public RepositoryChangesListenerRegisterPlugin(InitParams params)
- {
- if (params != null)
- {
- ValueParam valueParam = params.getValueParam("repository-name");
- if (valueParam != null)
- {
- repositoryName = valueParam.getValue();
- }
-
- valueParam = params.getValueParam("workspaces");
- if (valueParam != null)
- {
- workspaces = valueParam.getValue();
- }
-
- valueParam = params.getValueParam("component-class-name");
- if (valueParam != null)
- {
- listenerClassName = valueParam.getValue();
- }
- }
- }
-
- /**
- * Return repository name.
- *
- * @return The repository name
- */
- public String getRepositoryName()
- {
- return repositoryName;
- }
-
- /**
- * Return workspaces.
- *
- * @return The workspaces
- */
- public String getWorkspaces()
- {
- return workspaces;
- }
-
- /**
- * Return listenerClassName.
- *
- * @return The listenerClassName.
- */
- public String getListenerClassName()
- {
- return listenerClassName;
- }
-
-}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -19,7 +19,6 @@
package org.exoplatform.services.jcr.impl;
import org.exoplatform.commons.utils.SecurityHelper;
-import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.PortalContainer;
@@ -33,7 +32,6 @@
import org.exoplatform.services.jcr.core.ManageableRepository;
import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager;
import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions;
-import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListener;
import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
import org.exoplatform.services.jcr.impl.core.SessionRegistry;
import org.exoplatform.services.log.ExoLogger;
@@ -43,12 +41,8 @@
import java.io.InputStream;
import java.security.PrivilegedAction;
import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Map.Entry;
-import java.util.StringTokenizer;
import java.util.concurrent.ConcurrentHashMap;
import javax.jcr.RepositoryException;
@@ -76,8 +70,6 @@
private final List<ComponentPlugin> addNamespacesPlugins;
- private final ManagerStartChanges managerStartChanges;
-
private final ExoContainerContext containerContext;
private ExoContainer parentContainer;
@@ -106,7 +98,6 @@
addNamespacesPlugins = new ArrayList<ComponentPlugin>();
containerContext = context;
currentRepositoryName.set(config.getDefaultRepositoryName());
- managerStartChanges = new ManagerStartChanges();
}
public void addPlugin(ComponentPlugin plugin)
@@ -115,10 +106,6 @@
addNodeTypePlugins.add(plugin);
else if (plugin instanceof AddNamespacesPlugin)
addNamespacesPlugins.add(plugin);
- else if (plugin instanceof RepositoryChangesListenerRegisterPlugin)
- {
- managerStartChanges.addPlugin((RepositoryChangesListenerRegisterPlugin)plugin);
- }
}
/**
@@ -154,7 +141,6 @@
{
public Void run()
{
- managerStartChanges.registerListeners(repositoryContainer);
repositoryContainer.start();
return null;
}
@@ -308,7 +294,6 @@
repositoryContainers.clear();
addNamespacesPlugins.clear();
addNodeTypePlugins.clear();
- managerStartChanges.cleanup();
}
private void init(ExoContainer container) throws RepositoryConfigurationException, RepositoryException
@@ -469,157 +454,4 @@
return true;
}
-
- /**
- * Manager start changes plugins.
- */
- public class ManagerStartChanges
- {
-
- private Map<StorageKey, ItemsPersistenceListener> startChangesListeners =
- new HashMap<StorageKey, ItemsPersistenceListener>();
-
- /**
- * Add new StartChangesPlugin to manager.
- *
- * @param plugin
- * The StartChangesPlugin
- */
- public void addPlugin(RepositoryChangesListenerRegisterPlugin plugin)
- {
- String repositoryName = plugin.getRepositoryName();
- String workspaces = plugin.getWorkspaces();
- String listenerClassName = plugin.getListenerClassName();
-
- if (repositoryName != null && workspaces != null && listenerClassName != null)
- {
- StringTokenizer listTokenizer = new StringTokenizer(workspaces, ",");
- while (listTokenizer.hasMoreTokens())
- {
- String wsName = listTokenizer.nextToken();
- startChangesListeners.put(new StorageKey(repositoryName, wsName, listenerClassName), null);
- }
- }
- }
-
- /**
- * Register listeners.
- *
- * @param repositoryContainer
- * @throws ClassNotFoundException
- */
- public void registerListeners(RepositoryContainer repositoryContainer)
- {
- Iterator<StorageKey> storageKeys = startChangesListeners.keySet().iterator();
- while (storageKeys.hasNext())
- {
- StorageKey sk = storageKeys.next();
- if (sk.getRepositoryName().equals(repositoryContainer.getName()))
- {
- WorkspaceContainer wc = repositoryContainer.getWorkspaceContainer(sk.getWorkspaceName());
-
- try
- {
- Class<?> listenerType = ClassLoading.forName(sk.getListenerClassName(), this);
- wc.registerComponentImplementation(listenerType);
- ItemsPersistenceListener listener =
- (ItemsPersistenceListener)wc.getComponentInstanceOfType(listenerType);
- startChangesListeners.put(sk, listener);
- }
- catch (ClassNotFoundException e)
- {
- log.error("Can not register listener " + e.getMessage());
- }
- }
- }
- }
-
- /**
- * Cleanup changes.
- *
- */
- public void cleanup()
- {
- startChangesListeners.clear();
- }
-
- /**
- * Will be used as key for startChangesListeners.
- *
- */
- private class StorageKey
- {
- private final String repositoryName;
-
- private final String workspaceName;
-
- private final String listenerClassName;
-
- /**
- * StorageKey constructor.
- *
- * @param repositoryName
- * The repository name
- * @param workspaceName
- * The workspace name
- */
- public StorageKey(String repositoryName, String workspaceName, String listenerClassName)
- {
- this.repositoryName = repositoryName;
- this.workspaceName = workspaceName;
- this.listenerClassName = listenerClassName;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object o)
- {
- StorageKey k = (StorageKey)o;
-
- return repositoryName.equals(k.repositoryName) && workspaceName.equals(k.workspaceName)
- && listenerClassName.equals(k.listenerClassName);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode()
- {
- return repositoryName.hashCode() ^ workspaceName.hashCode() ^ listenerClassName.hashCode();
- }
-
- /**
- * Return repository name.
- *
- * @return The repository name
- */
- public String getRepositoryName()
- {
- return repositoryName;
- }
-
- /**
- * Return workspace name.
- *
- * @return The workspace name
- */
- public String getWorkspaceName()
- {
- return workspaceName;
- }
-
- /**
- * Return listener class name.
- *
- * @return The listener class name
- */
- public String getListenerClassName()
- {
- return listenerClassName;
- }
- }
- }
}
Copied: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/FixupStream.java (from rev 5413, jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/FixupStream.java)
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/FixupStream.java (rev 0)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/FixupStream.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.ext.backup.impl;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
+ * @version $Id: FixupStream.java 34445 2009-07-24 07:51:18Z dkatayev $
+ */
+
+public class FixupStream implements Externalizable
+{
+
+ /**
+ * serialVersionUID. Determinate the version of serialization.
+ */
+ private static final long serialVersionUID = 6453641729031051616L;
+
+ /**
+ * iItemStateId. Index of ItemState in ChangesLog.
+ */
+ private int iItemStateId = -1;
+
+ /**
+ * iValueDataId. Index of ValueData in ItemState.
+ */
+ private int iValueDataId = -1;
+
+ /**
+ * FixupStream constructor. Empty constructor is necessary to Externalizable.
+ */
+ public FixupStream()
+ {
+ }
+
+ /**
+ * FixupStream constructor.
+ *
+ * @param itemState
+ * index of ItemState in ChangesLog
+ * @param valueData
+ * index of ValueData in ItemState
+ */
+ public FixupStream(int itemState, int valueData)
+ {
+ this.iItemStateId = itemState;
+ this.iValueDataId = valueData;
+ }
+
+ /**
+ * getItemSateId.
+ *
+ * @return int return the iItemStateId
+ */
+ public int getItemSateId()
+ {
+ return iItemStateId;
+ }
+
+ /**
+ * getValueDataId.
+ *
+ * @return int return the iValueDataId
+ */
+ public int getValueDataId()
+ {
+ return iValueDataId;
+ }
+
+ /**
+ * compare.
+ *
+ * @param fs
+ * FixupStream.
+ * @return boolean return 'true' if this == fs
+ */
+ public boolean compare(FixupStream fs)
+ {
+ boolean b = true;
+ if (fs.getItemSateId() != this.getItemSateId())
+ b = false;
+ if (fs.getValueDataId() != this.getValueDataId())
+ b = false;
+ return b;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ iItemStateId = in.readInt();
+ iValueDataId = in.readInt();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ out.writeInt(iItemStateId);
+ out.writeInt(iValueDataId);
+ }
+}
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -25,7 +25,6 @@
import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
import org.exoplatform.services.jcr.datamodel.ItemData;
import org.exoplatform.services.jcr.datamodel.ValueData;
-import org.exoplatform.services.jcr.ext.replication.FixupStream;
import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.impl.util.io.SpoolFile;
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/fs/IncrementalBackupJob.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/fs/IncrementalBackupJob.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/fs/IncrementalBackupJob.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -26,8 +26,8 @@
import org.exoplatform.services.jcr.ext.backup.BackupConfig;
import org.exoplatform.services.jcr.ext.backup.impl.AbstractIncrementalBackupJob;
import org.exoplatform.services.jcr.ext.backup.impl.FileNameProducer;
+import org.exoplatform.services.jcr.ext.backup.impl.FixupStream;
import org.exoplatform.services.jcr.ext.backup.impl.PendingChangesLog;
-import org.exoplatform.services.jcr.ext.replication.FixupStream;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder;
import org.exoplatform.services.log.ExoLogger;
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/BaseReplicationTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/BaseReplicationTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/BaseReplicationTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication;
-
-import org.exoplatform.container.StandaloneContainer;
-import org.exoplatform.services.jcr.RepositoryService;
-import org.exoplatform.services.jcr.core.CredentialsImpl;
-import org.exoplatform.services.jcr.ext.BaseStandaloneTest;
-import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
-import org.exoplatform.services.jcr.impl.core.SessionImpl;
-
-import java.io.File;
-
-import javax.jcr.Node;
-import javax.jcr.ValueFactory;
-import javax.jcr.Workspace;
-
-/**
- * Created by The eXo Platform SAS Author : Alex Reshetnyak alex.reshetnyak at exoplatform.com.ua
- * 20.02.2007 17:10:01
- *
- * @version $Id: BaseReplicationTest.java 20.02.2007 17:10:01 rainfox
- */
-public abstract class BaseReplicationTest extends BaseStandaloneTest
-{
-
- protected RepositoryImpl repository2;
-
- protected SessionImpl session2;
-
- protected Workspace workspace2;
-
- protected Node root2;
-
- protected ValueFactory valueFactory2;
-
- public void setUp() throws Exception
- {
-
- String containerConf = "src/test/resources/conf/standalone/test-configuration-replication.xml";
- String loginConf = Thread.currentThread().getContextClassLoader().getResource("login.conf").toString();
-
- if (!new File(containerConf).exists())
- {
- containerConf = "component/ext/" + containerConf;
- }
-
- StandaloneContainer.addConfigurationPath(containerConf);
-
- container = StandaloneContainer.getInstance();
-
- if (System.getProperty("java.security.auth.login.config") == null)
- System.setProperty("java.security.auth.login.config", loginConf);
-
- credentials = new CredentialsImpl("admin", "admin".toCharArray());
-
- repositoryService = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
-
- repository = (RepositoryImpl)repositoryService.getRepository("db1");
- repository2 = (RepositoryImpl)repositoryService.getRepository("db2");
-
- session = (SessionImpl)repository.login(credentials, "ws");
- session2 = (SessionImpl)repository2.login(credentials, "ws");
-
- workspace = session.getWorkspace();
- workspace2 = session2.getWorkspace();
-
- root = session.getRootNode();
- root2 = session2.getRootNode();
-
- valueFactory = session.getValueFactory();
- valueFactory2 = session2.getValueFactory();
-
- Thread.sleep(10000);
- }
-
- protected void tearDown() throws Exception
- {
- }
-
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationCopyMoveNodeTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationCopyMoveNodeTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationCopyMoveNodeTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,188 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication;
-
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.Calendar;
-
-import javax.jcr.Node;
-
-/**
- * Created by The eXo Platform SAS Author : Alex Reshetnyak alex.reshetnyak at exoplatform.com.ua
- * 28.02.2007 10:59:36
- *
- * @version $Id: TestReplicationCopyNode.java 28.02.2007 10:59:36 rainfox
- */
-
-public class ReplicationCopyMoveNodeTest extends BaseReplicationTest
-{
-
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.ext.ReplicationCopyMoveNodeTest");
-
- public void testSessionMove() throws Exception
- {
-
- Node file = root.addNode("testSessionMove", "nt:folder").addNode("childNode2", "nt:file");
- Node contentNode = file.addNode("jcr:content", "nt:resource");
- contentNode.setProperty("jcr:data", "this is the content");
- contentNode.setProperty("jcr:mimeType", "text/html");
- contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
-
- session.save();
-
- session.move("/testSessionMove", "/testSessionMove1");
-
- session.save();
-
- assertNotNull(session.getItem("/testSessionMove1"));
- assertNotNull(session.getItem("/testSessionMove1/childNode2/jcr:content"));
-
- Thread.sleep(7 * 1000);
-
- // COMPARE REPLICATION DATA
- assertNotNull(session2.getItem("/testSessionMove1"));
- assertNotNull(session2.getItem("/testSessionMove1/childNode2/jcr:content"));
-
- Node srcNode = root.getNode("testSessionMove1").getNode("childNode2").getNode("jcr:content");
- Node destNode = root2.getNode("testSessionMove1").getNode("childNode2").getNode("jcr:content");
-
- assertEquals(srcNode.getProperty("jcr:data").getString(), destNode.getProperty("jcr:data").getString());
- assertEquals(srcNode.getProperty("jcr:mimeType").getString(), destNode.getProperty("jcr:mimeType").getString());
- assertEquals(srcNode.getProperty("jcr:lastModified").getString(), destNode.getProperty("jcr:lastModified")
- .getString());
- }
-
- public void testCopy() throws Exception
- {
-
- Node file = root.addNode("testCopy", "nt:folder").addNode("childNode2", "nt:file");
- Node contentNode = file.addNode("jcr:content", "nt:resource");
- contentNode.setProperty("jcr:data", "this is the content");
- contentNode.setProperty("jcr:mimeType", "text/html");
- contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
-
- session.save();
-
- workspace.copy("/testCopy", "/testCopy1");
-
- Thread.sleep(7 * 1000);
-
- // COMPARE REPLICATION DATA
- assertNotNull(session2.getItem("/testCopy1"));
- assertNotNull(session2.getItem("/testCopy1/childNode2"));
- assertNotNull(session2.getItem("/testCopy1/childNode2/jcr:content"));
- assertNotNull(session2.getItem("/testCopy"));
-
- Node srcNode = root.getNode("testCopy1").getNode("childNode2").getNode("jcr:content");
- Node destNode = root2.getNode("testCopy1").getNode("childNode2").getNode("jcr:content");
-
- assertEquals(srcNode.getProperty("jcr:data").getString(), destNode.getProperty("jcr:data").getString());
- assertEquals(srcNode.getProperty("jcr:mimeType").getString(), destNode.getProperty("jcr:mimeType").getString());
- assertEquals(srcNode.getProperty("jcr:lastModified").getString(), destNode.getProperty("jcr:lastModified")
- .getString());
- }
-
- public void testMove() throws Exception
- {
-
- Node file = root.addNode("testMove", "nt:folder").addNode("childNode2", "nt:file");
- Node contentNode = file.addNode("jcr:content", "nt:resource");
- contentNode.setProperty("jcr:data", "this is the content");
- contentNode.setProperty("jcr:mimeType", "text/html");
- contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
-
- session.save();
-
- workspace.move("/testMove", "/testMove1");
-
- Thread.sleep(7 * 1000);
-
- // COMPARE REPLICATION DATA
- assertNotNull(session2.getItem("/testMove1"));
- assertNotNull(session2.getItem("/testMove1/childNode2"));
- assertNotNull(session2.getItem("/testMove1/childNode2/jcr:content"));
-
- Node srcNode = root.getNode("testMove1").getNode("childNode2").getNode("jcr:content");
- Node destNode = root2.getNode("testMove1").getNode("childNode2").getNode("jcr:content");
-
- assertEquals(srcNode.getProperty("jcr:data").getString(), destNode.getProperty("jcr:data").getString());
- assertEquals(srcNode.getProperty("jcr:mimeType").getString(), destNode.getProperty("jcr:mimeType").getString());
- assertEquals(srcNode.getProperty("jcr:lastModified").getString(), destNode.getProperty("jcr:lastModified")
- .getString());
- }
-
- public void testBigDataMove() throws Exception
- {
-
- File tempFile = File.createTempFile("tempFile", "doc");
- tempFile.deleteOnExit();
-
- FileOutputStream fos = new FileOutputStream(tempFile);
-
- String content = "this is the content";
-
- for (int i = 0; i < 15000; i++)
- fos.write((i + " " + content).getBytes());
-
- fos.close();
-
- log.info("MOVE: file size = " + tempFile.length() + " bytes");
-
- Node file = root.addNode("testMove_", "nt:folder").addNode("childNode2", "nt:file");
- Node contentNode = file.addNode("jcr:content", "nt:resource");
- contentNode.setProperty("jcr:data", new FileInputStream(tempFile));
- contentNode.setProperty("jcr:mimeType", "text/plain");
- contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
-
- session.save();
- log.info("FIRST");
-
- workspace.move("/testMove_", "/testMove_dest");
-
- session.save();
- log.info("MOVED");
-
- log.info("Sleep 15 seconds");
- Thread.yield();
- Thread.sleep(15 * 1000);
-
- // COMPARE REPLICATION DATA
- assertNotNull(session2.getItem("/testMove_dest"));
- assertNotNull(session2.getItem("/testMove_dest/childNode2"));
- assertNotNull(session2.getItem("/testMove_dest/childNode2/jcr:content"));
-
- Node srcNode = root.getNode("testMove_dest").getNode("childNode2").getNode("jcr:content");
- Node destNode = root2.getNode("testMove_dest").getNode("childNode2").getNode("jcr:content");
-
- log.info("source data size = " + srcNode.getProperty("jcr:data").getStream().available());
- log.info("destination data size = " + destNode.getProperty("jcr:data").getStream().available());
-
- assertEquals(srcNode.getProperty("jcr:data").getStream().available(), destNode.getProperty("jcr:data")
- .getStream().available());
- assertEquals(srcNode.getProperty("jcr:mimeType").getString(), destNode.getProperty("jcr:mimeType").getString());
- assertEquals(srcNode.getProperty("jcr:lastModified").getString(), destNode.getProperty("jcr:lastModified")
- .getString());
- }
-
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationDocumentViewImportTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationDocumentViewImportTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationDocumentViewImportTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-
-import javax.jcr.Node;
-
-/**
- * Created by The eXo Platform SAS Author : Alex Reshetnyak alex.reshetnyak at exoplatform.com.ua
- * 21.08.2009 10:59:36
- *
- * @version $Id: ReplicationDocumentViewImportTest.java 25.08.2009 10:49:36 rainfox
- */
-
-public class ReplicationDocumentViewImportTest
- extends BaseReplicationTest
-{
- public void testDocumentViewImportOverSession() throws Exception
- {
- Node nl1 = root.addNode("s_doc_view_node_l1");
- nl1.addNode("s_doc_view_node_l2");
- root.save();
-
- File f = File.createTempFile("s_doc_view", ".xml");
- f.deleteOnExit();
-
- // export
- session.exportDocumentView(nl1.getPath(), new FileOutputStream(f), false, false);
-
- Node parentImportPath = root.addNode("s_imported_doc_view_node");
- root.save();
-
- //import
- session.importXML(parentImportPath.getPath(), new FileInputStream(f), 0);
- session.save();
-
- Thread.sleep(5 * 1000);
-
- // check
- root.getNode("s_imported_doc_view_node").getNode("s_doc_view_node_l1").getNode("s_doc_view_node_l2");
- root2.getNode("s_imported_doc_view_node").getNode("s_doc_view_node_l1").getNode("s_doc_view_node_l2");
- }
-
- public void testDocumentViewImportOverWorksapce() throws Exception
- {
- Node nl1 = root.addNode("w_doc_view_node_l1");
- nl1.addNode("w_doc_view_node_l2");
- root.save();
-
- File f = File.createTempFile("w_doc_view", ".xml");
- f.deleteOnExit();
-
- // export
- session.exportDocumentView(nl1.getPath(), new FileOutputStream(f), false, false);
-
- Node parentImportPath = root.addNode("w_imported_doc_view_node");
- root.save();
-
- //import
- session.getWorkspace().importXML(parentImportPath.getPath(), new FileInputStream(f), 0);
- session.save();
-
- Thread.sleep(5 * 1000);
-
- // check
- root.getNode("w_imported_doc_view_node").getNode("w_doc_view_node_l1").getNode("w_doc_view_node_l2");
- root2.getNode("w_imported_doc_view_node").getNode("w_doc_view_node_l1").getNode("w_doc_view_node_l2");
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationEditDataTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationEditDataTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationEditDataTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication;
-
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-
-import java.util.Calendar;
-
-import javax.jcr.Node;
-
-/**
- * Created by The eXo Platform SAS Author : Alex Reshetnyak alex.reshetnyak at exoplatform.com.ua
- * 25.07.2007 17:48:00
- *
- * @version $Id: TestReplicationEditData.java 25.07.2007 17:48:00 rainfox
- */
-
-public class ReplicationEditDataTest extends BaseReplicationTest
-{
-
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.ext.ReplicationEditDataTest");
-
- public void testAddNode() throws Exception
- {
-
- Node test = root.addNode("cms3").addNode("test");
-
- Node cool = test.addNode("nnn", "nt:file");
- Node contentNode = cool.addNode("jcr:content", "nt:resource");
- contentNode.setProperty("jcr:encoding", "UTF-8");
- contentNode.setProperty("jcr:data", "_______________silple data________________");
- contentNode.setProperty("jcr:mimeType", "plain/text");
- contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
-
- try
- {
- session.save();
- }
- catch (Exception e)
- {
- log.error(e);
- fail("Error Save!!!");
- }
-
- // COMPARE REPLICATION DATA
- String sourceData =
- root.getNode("cms3").getNode("test").getNode("nnn").getNode("jcr:content").getProperty("jcr:data").getString();
- Thread.sleep(5 * 1000);
- String desinationData =
- root2.getNode("cms3").getNode("test").getNode("nnn").getNode("jcr:content").getProperty("jcr:data")
- .getString();
-
- log.info("Compare 1 data: \n" + sourceData + "\n" + desinationData);
- assertEquals(sourceData, desinationData);
-
- String newData = "____________simple_data_2____________";
-
- root2.getNode("cms3").getNode("test").getNode("nnn").getNode("jcr:content").setProperty("jcr:data", newData);
- session2.save();
-
- Thread.sleep(5 * 1000);
-
- sourceData =
- root.getNode("cms3").getNode("test").getNode("nnn").getNode("jcr:content").getProperty("jcr:data").getString();
- desinationData =
- root2.getNode("cms3").getNode("test").getNode("nnn").getNode("jcr:content").getProperty("jcr:data")
- .getString();
-
- log.info("Compare 2 data: \n" + sourceData + "\n" + desinationData);
- assertEquals(sourceData, desinationData);
- }
-
- public void tearDown() throws Exception
- {
- Thread.sleep(10 * 1000);
- log.info("Sleep 10 sec");
- super.tearDown();
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationExternalizableTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationExternalizableTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationExternalizableTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication;
-
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
- * @version $Id: ReplicationExternalizableTest.java 111 2008-11-11 11:11:11Z rainf0x $
- */
-public class ReplicationExternalizableTest extends BaseReplicationTest
-{
-
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.ext.ReplicationExternalizableTest");
-
- private static final int BUFFER_SIZE = 1024;
-
- private Node rootNode;
-
- public void testname() throws Exception
- {
- rootNode = root;
- int folders = 20;
- int files = 10;
-
- Long size = Long.valueOf(1024 * 1024);
-
- String[] relPath = new String[folders];
-
- for (int i = 0; i < folders; i++)
- {
- relPath[i] = createRelPath(5);
- addBinaryPropertyOnly(relPath[i], "n_", size, files);
- }
-
- Thread.sleep(20000);
-
- }
-
- private StringBuffer addBinaryPropertyOnly(String repoPath, String nodeName, Long size, long iterations)
- throws Exception
- {
- StringBuffer sb = new StringBuffer();
-
- long start, end;
- byte[] buf = new byte[BUFFER_SIZE];
-
- File tempFile = null;
- try
- {
- tempFile = File.createTempFile("tempF", "_");
- FileOutputStream fos = new FileOutputStream(tempFile);
-
- for (int i = 0; i < buf.length; i++)
- buf[i] = (byte)(i % 255);
-
- for (long i = 0; i < size / BUFFER_SIZE; i++)
- fos.write(buf);
- fos.write(buf, 0, (int)(size % BUFFER_SIZE));
- fos.close();
-
- start = System.currentTimeMillis(); // to get the time of start
- for (int i = 0; i < iterations; i++)
- {
- Node baseNode = addNodePath(repoPath);
- baseNode.setProperty("d", new FileInputStream(tempFile));
-
- session.save();
-
- // Thread.sleep(10);
- }
-
- end = System.currentTimeMillis();
-
- log.info("The time of the adding of nt:file + " + iterations + "( " + tempFile.length() + " B ) : "
- + ((end - start) / 1000) + " sec");
-
- sb.append("ok");
- }
- catch (Exception e)
- {
- sb.append("fail");
- throw new Exception("Can't save the binary value : ", e);
- }
- finally
- {
- tempFile.delete();
- }
-
- return sb;
- }
-
- protected Node addNodePath(String repoPath) throws RepositoryException
- {
- Node resultNode = rootNode;
- String[] sArray = repoPath.split("[::]");
-
- for (String nodeName : sArray)
- if(!nodeName.equals(""))
- if (resultNode.hasNode(nodeName))
- resultNode = resultNode.getNode(nodeName);
- else
- resultNode = resultNode.addNode(nodeName, "nt:unstructured");
-
- return resultNode;
- }
-
- protected String createRelPath(long fSize)
- {
- String alphabet = "abcdefghijklmnopqrstuvwxyz";
- String relPath = "";
- long pathDepth = (fSize % 7) + 5;
-
- for (long i = 0; i < pathDepth; i++)
- {
- int index1 = (int)(Math.random() * 1000) % alphabet.length();
- int index2 = (int)(Math.random() * 1000) % alphabet.length();
- String s = alphabet.substring(index1, index1 + 1) + alphabet.substring(index2, index2 + 1);
- // s+=(int) (Math.random() * 100000);
-
- relPath += ("::" + s);
- }
-
- return relPath;
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationLockTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationLockTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationLockTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication;
-
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-
-import javax.jcr.Node;
-import javax.jcr.lock.Lock;
-import javax.jcr.lock.LockException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
- * @version $Id: ReplicationLockTest.java 34445 2009-07-24 07:51:18Z dkatayev $
- */
-
-public class ReplicationLockTest extends BaseReplicationTest
-{
-
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.ext.ReplicationLockTest");
-
- public void testLock() throws Exception
- {
- Node nodeLocked = root.addNode("Node Locked");
- nodeLocked.setProperty("jcr:data", "node data");
- nodeLocked.addMixin("mix:lockable");
- session.save();
-
- Thread.sleep(4 * 1000);
-
- Node destNodeLocked = root2.getNode("Node Locked");
- assertEquals("node data", destNodeLocked.getProperty("jcr:data").getString());
- assertEquals("mix:lockable", destNodeLocked.getMixinNodeTypes()[0].getName());
- assertEquals(false, destNodeLocked.isLocked());
-
- Lock lock = nodeLocked.lock(false, false);
- session.save();
-
- Thread.sleep(8 * 1000);
-
- assertEquals(true, destNodeLocked.isLocked());
-
- try
- {
- destNodeLocked.setProperty("jcr:data", "dd");
- session2.save();
- fail("Errore: Node is not locked");
- }
- catch (LockException e)
- {
- // ok
- }
-
- // unlock source node
- nodeLocked.unlock();
-
- Thread.sleep(8 * 1000);
-
- assertEquals(false, destNodeLocked.isLocked());
-
- // TODO
- // unlock destination node
- // lock = nodeLocked.lock(false, false);
- // session.save();
- //
- // Thread.sleep(4 * 1000);
- //
- // assertEquals(true, destNodeLocked.isLocked());
- //
- // destNodeLocked.unlock();
- //
- // Thread.sleep(4 * 1000);
- //
- // assertEquals(false, nodeLocked.isLocked());
- }
-
- public void test10Lock() throws Exception
- {
- for (int i = 0; i < 10; i++)
- {
- log.info("Lock node #" + i + " ...");
- String lockName = "Node Locked";
-
- Node nodeLocked = root.addNode(lockName + i);
- nodeLocked.setProperty("jcr:data", "node data");
- nodeLocked.addMixin("mix:lockable");
- session.save();
-
- Thread.sleep(2 * 1000);
-
- Node destNodeLocked = root2.getNode(lockName + i);
- assertEquals("node data", destNodeLocked.getProperty("jcr:data").getString());
- assertEquals("mix:lockable", destNodeLocked.getMixinNodeTypes()[0].getName());
- assertEquals(false, destNodeLocked.isLocked());
-
- log.info("Set lock");
- Lock lock = nodeLocked.lock(false, false);
- session.save();
-
- Thread.sleep(2 * 1000);
-
- assertEquals(true, destNodeLocked.isLocked());
-
- try
- {
- destNodeLocked.setProperty("jcr:data", "dd");
- session2.save();
- fail("Errore: Node is not locked");
- }
- catch (LockException e)
- {
- // ok
- }
-
- log.info("Set unlock");
- // unlock source node
- nodeLocked.unlock();
-
- Thread.sleep(2 * 1000);
-
- assertEquals(false, destNodeLocked.isLocked());
- }
- }
-
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationStreamTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationStreamTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationStreamTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication;
-
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.util.Calendar;
-
-import javax.jcr.Node;
-import javax.jcr.PathNotFoundException;
-
-/**
- * Created by The eXo Platform SAS Author : Alex Reshetnyak alex.reshetnyak at exoplatform.com.ua
- * 16.01.2007 15:21:45
- *
- * @version $Id: TestReplicationStream.java 16.01.2007 15:21:45 rainf0x
- */
-
-public class ReplicationStreamTest extends BaseReplicationTest
-{
-
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.ext.ReplicationStreamTest");
-
- public void testAddNode() throws Exception
- {
- long start, end;
- byte[] buf = new byte[1024];
- int fileSize = 50000; // KB
-
- File tempFile = File.createTempFile("tempF", "_");
- FileOutputStream fos = new FileOutputStream(tempFile);
-
- for (int i = 0; i < buf.length; i++)
- buf[i] = (byte)(i % 255);
-
- for (int i = 0; i < fileSize; i++)
- fos.write(buf);
- fos.close();
-
- Node test = root.addNode("cms2").addNode("test");
- start = System.currentTimeMillis(); // to get the time of start
-
- Node cool = test.addNode("nnn", "nt:file");
- Node contentNode = cool.addNode("jcr:content", "nt:resource");
- contentNode.setProperty("jcr:encoding", "UTF-8");
- contentNode.setProperty("jcr:data", new FileInputStream(tempFile));
- contentNode.setProperty("jcr:mimeType", "application/octet-stream");
- contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
-
- try
- {
- session.save();
- }
- catch (Exception e)
- {
- log.error(e);
- fail("Error Save!!!");
- }
-
- end = System.currentTimeMillis();
-
- System.out.println("The time of the adding of nt:file : " + ((end - start) / 1000) + " sec");
-
- // COMPARE REPLICATION DATA
- Node sourceNode = root.getNode("cms2").getNode("test").getNode("nnn").getNode("jcr:content");
- InputStream fis = sourceNode.getProperty("jcr:data").getStream();
-
- Thread.sleep(25 * 1000);
-
- Node desinationNode = root2.getNode("cms2").getNode("test").getNode("nnn").getNode("jcr:content");
- InputStream fis2 = desinationNode.getProperty("jcr:data").getStream();
-
- compareStream(fis, fis2);
-
- assertEquals(sourceNode.getProperty("jcr:encoding").getString(), desinationNode.getProperty("jcr:encoding")
- .getString());
-
- assertEquals(sourceNode.getProperty("jcr:lastModified").getString(), desinationNode.getProperty(
- "jcr:lastModified").getString());
-
- // delete
-
- Node srcParent = sourceNode.getParent();
- srcParent.remove();
- session.save();
-
- Thread.sleep(5 * 1000);
-
- try
- {
- Node destinationRemovablesNode = (Node)session2.getItem("/cms2/test/nnn");
- fail("The node " + destinationRemovablesNode.getPath() + "must be removed");
- }
- catch (PathNotFoundException pe)
- {
- // ok
- }
- }
-
- public void tearDown() throws Exception
- {
- Thread.sleep(10 * 1000);
- log.info("Sleep 10 sec");
- super.tearDown();
- }
-
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationSysViewImportTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationSysViewImportTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationSysViewImportTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-
-import javax.jcr.Node;
-
-/**
- * Created by The eXo Platform SAS Author : Alex Reshetnyak alex.reshetnyak at exoplatform.com.ua
- * 21.08.2009 10:59:36
- *
- * @version $Id: ReplicationSysViewImportTest.java 25.08.2009 10:49:36 rainfox
- */
-
-public class ReplicationSysViewImportTest
- extends BaseReplicationTest
-{
-
- public void testSysViewImportOverSession() throws Exception
- {
- Node nl1 = root.addNode("s_sys_view_node_l1");
- nl1.addNode("s_sys_view_node_l2");
- root.save();
-
- File f = File.createTempFile("s_sys_view", ".xml");
- f.deleteOnExit();
-
- // export
- session.exportSystemView(nl1.getPath(), new FileOutputStream(f), false, false);
-
- Node parentImportPath = root.addNode("s_imported_sys_view_node");
- root.save();
-
- //import
- session.importXML(parentImportPath.getPath(), new FileInputStream(f), 0);
- root.save();
-
- Thread.sleep(5 * 1000);
-
- // check
- root.getNode("s_imported_sys_view_node").getNode("s_sys_view_node_l1").getNode("s_sys_view_node_l2");
- root2.getNode("s_imported_sys_view_node").getNode("s_sys_view_node_l1").getNode("s_sys_view_node_l2");
- }
-
- public void testSysViewImportOverWorkspace() throws Exception
- {
- Node nl1 = root.addNode("w_sys_view_node_l1");
- nl1.addNode("w_sys_view_node_l2");
- root.save();
-
- File f = File.createTempFile("w_sys_view", ".xml");
- f.deleteOnExit();
-
- // export
- session.exportSystemView(nl1.getPath(), new FileOutputStream(f), false, false);
-
- Node parentImportPath = root.addNode("w_imported_sys_view_node");
- root.save();
-
- //import
- session.getWorkspace().importXML(parentImportPath.getPath(), new FileInputStream(f), 0);
- root.save();
-
- Thread.sleep(5 * 1000);
-
- // check
- root.getNode("w_imported_sys_view_node").getNode("w_sys_view_node_l1").getNode("w_sys_view_node_l2");
- root2.getNode("w_imported_sys_view_node").getNode("w_sys_view_node_l1").getNode("w_sys_view_node_l2");
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationVersionRestoreTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationVersionRestoreTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/ReplicationVersionRestoreTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,216 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication;
-
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.Calendar;
-
-import javax.jcr.Node;
-import javax.jcr.version.Version;
-
-/**
- * Created by The eXo Platform SAS Author : Alex Reshetnyak alex.reshetnyak at exoplatform.com.ua
- * 02.03.2007 14:31:17
- *
- * @version $Id: TestReplicationVersionRestore.java 02.03.2007 14:31:17 rainfox
- */
-
-public class ReplicationVersionRestoreTest extends BaseReplicationTest
-{
-
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.ext.ReplicationVersionRestoreTest");
-
- public void testRestore() throws Exception
- {
- Node srcVersionNode = root.addNode("Version node 1");
- srcVersionNode.setProperty("jcr:data", "Base version");
- srcVersionNode.addMixin("mix:versionable");
- session.save();
-
- Thread.sleep(5 * 1000);
-
- Node destVersionNode = root2.getNode("Version node 1");
- assertEquals("Base version", destVersionNode.getProperty("jcr:data").getString());
-
- srcVersionNode.checkin();
- session.save();
-
- srcVersionNode.checkout();
- srcVersionNode.setProperty("jcr:data", "version 1");
- session.save();
-
- Thread.sleep(5 * 1000);
-
- assertEquals("version 1", destVersionNode.getProperty("jcr:data").getString());
-
- srcVersionNode.checkin();
- session.save();
-
- srcVersionNode.checkout();
- srcVersionNode.setProperty("jcr:data", "version 2");
- session.save();
-
- Thread.sleep(5 * 1000);
-
- assertEquals("version 2", destVersionNode.getProperty("jcr:data").getString());
-
- Version baseVersion = srcVersionNode.getBaseVersion();
- srcVersionNode.restore(baseVersion, true);
- session.save();
-
- Thread.sleep(5 * 1000);
-
- assertEquals("version 1", destVersionNode.getProperty("jcr:data").getString());
-
- Version baseVersion1 = srcVersionNode.getBaseVersion();
- Version[] predesessors = baseVersion1.getPredecessors();
- Version restoreToBaseVersion = predesessors[0];
-
- srcVersionNode.restore(restoreToBaseVersion, true);
- session.save();
-
- Thread.sleep(5 * 1000);
-
- assertEquals("Base version", destVersionNode.getProperty("jcr:data").getString());
- }
-
- public void testBigFileRestore() throws Exception
- {
-
- File tempFile = File.createTempFile("tempFile", "doc");
- File tempFile2 = File.createTempFile("tempFile", "doc");
- File tempFile3 = File.createTempFile("tempFile", "doc");
- tempFile.deleteOnExit();
- tempFile2.deleteOnExit();
- tempFile3.deleteOnExit();
-
- FileOutputStream fos = new FileOutputStream(tempFile);
- FileOutputStream fos2 = new FileOutputStream(tempFile2);
- FileOutputStream fos3 = new FileOutputStream(tempFile3);
-
- String content = "this is the content #1";
- String content2 = "this is the content #2_";
- String content3 = "this is the content #3__";
-
- for (int i = 0; i < 15000; i++)
- {
- fos.write((i + " " + content).getBytes());
- fos2.write((i + " " + content2).getBytes());
- fos3.write((i + " " + content3).getBytes());
- }
-
- fos.close();
- fos2.close();
- fos3.close();
-
- log.info("FILE for VERSION #1 : file size = " + tempFile.length() + " bytes");
- log.info("FILE for VERSION #2 : file size = " + tempFile2.length() + " bytes");
- log.info("FILE for VERSION #3 : file size = " + tempFile3.length() + " bytes");
-
- Node srcVersionNode = root.addNode("nt_file_node", "nt:file");
- Node contentNode = srcVersionNode.addNode("jcr:content", "nt:resource");
- contentNode.setProperty("jcr:data", new FileInputStream(tempFile));
- contentNode.setProperty("jcr:mimeType", "text/plain");
- contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
- srcVersionNode.addMixin("mix:versionable");
-
- session.save();
-
- log.info("SAVED");
-
- Node srcVersion = root.getNode("nt_file_node");
- log.info("GET");
-
- long time = 10 * 1000;
-
- Thread.sleep(time);
-
- Node destVersionNode = root2.getNode("nt_file_node").getNode("jcr:content");
- log.info("ADD VERSION #1 : file size = " + destVersionNode.getProperty("jcr:data").getStream().available()
- + " bytes");
- compareStream(new FileInputStream(tempFile), destVersionNode.getProperty("jcr:data").getStream());
-
- srcVersion.checkin();
- session.save();
-
- srcVersion.checkout();
- srcVersionNode.getNode("jcr:content").setProperty("jcr:data", new FileInputStream(tempFile2));
- session.save();
-
- Thread.sleep(time);
-
- log.info("ADD VERSION #2 : file size = " + destVersionNode.getProperty("jcr:data").getStream().available()
- + " bytes");
- compareStream(new FileInputStream(tempFile2), destVersionNode.getProperty("jcr:data").getStream());
-
- srcVersion.checkin();
- session.save();
-
- Thread.sleep(time);
-
- srcVersion.checkout();
- srcVersionNode.getNode("jcr:content").setProperty("jcr:data", new FileInputStream(tempFile3));
- session.save();
-
- Thread.sleep(time);
-
- log.info("ADD VERSION #3 : file size = " + destVersionNode.getProperty("jcr:data").getStream().available()
- + " bytes");
- compareStream(new FileInputStream(tempFile3), destVersionNode.getProperty("jcr:data").getStream());
-
- Version baseVersion = srcVersion.getBaseVersion();
- srcVersion.restore(baseVersion, true);
- session.save();
-
- Thread.sleep(time);
-
- compareStream(new FileInputStream(tempFile2), destVersionNode.getProperty("jcr:data").getStream());
-
- Version baseVersion1 = srcVersion.getBaseVersion();
- Version[] predesessors = baseVersion1.getPredecessors();
- Version restoreToBaseVersion = predesessors[0];
-
- srcVersion.restore(restoreToBaseVersion, true); // HERE
- session.save();
-
- Thread.sleep(time);
-
- compareStream(new FileInputStream(tempFile), destVersionNode.getProperty("jcr:data").getStream());
-
- // restore from destination node
- Node destVersion = destVersionNode.getParent();
-
- Version baseVersion2 = destVersion.getBaseVersion();
- Version[] predesessors2 = baseVersion2.getSuccessors();
- Version restoreToBaseVersion_2 = predesessors2[0];
-
- destVersion.restore(restoreToBaseVersion_2, true);
- session.save();
-
- Thread.sleep(time);
-
- compareStream(new FileInputStream(tempFile2), srcVersionNode.getNode("jcr:content").getProperty("jcr:data")
- .getStream());
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/AddNTFileCheckerTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/AddNTFileCheckerTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/AddNTFileCheckerTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication.external;
-
-import org.exoplatform.services.jcr.ext.replication.test.ReplicationTestService;
-
-/**
- * Created by The eXo Platform SAS
- *
- * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
- * @version $Id: AddNTFileCheckerTest.java 34445 2009-07-24 07:51:18Z dkatayev $
- */
-public class AddNTFileCheckerTest extends BaseTestCaseChecker
-{
- public void testAddNTFile() throws Exception
- {
-
- long[] filesSize = new long[]{12314, 652125, 5212358, 2106584, 305682};
- String relPathArray[] = new String[filesSize.length];
- String fileNameArray[] = new String[filesSize.length];
-
- // add nt:file to masterMember
- randomizeMembers();
- MemberInfo masterMember = getCurrentMasterMember();
-
- for (int i = 0; i < filesSize.length; i++)
- {
- long fSize = filesSize[i];
- String relPath = createRelPath(fSize);
- relPathArray[i] = relPath;
- fileNameArray[i] = "nt_file_" + fSize + "_" + (int)(Math.random() * MAX_RANDOM_VALUE);
-
- String url =
- "http://" + masterMember.getIpAddress() + ":" + masterMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + masterMember.getLogin() + "/" + masterMember.getPassword() + "/" + relPath + "/" + fileNameArray[i]
- + "/" + fSize + "/" + ReplicationTestService.Constants.OperationType.ADD_NT_FILE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(masterMember);
- String result = client.execute(url);
- System.out.println(url);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
-
- // check nt:file in slaveMember
-
- for (int i = 0; i < filesSize.length; i++)
- {
- long fSize = filesSize[i];
- String relPath = relPathArray[i];
-
- for (MemberInfo slaveMember : getCurrentSlaveMembers())
- {
- String checkUrl =
- "http://" + slaveMember.getIpAddress() + ":" + slaveMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + slaveMember.getLogin() + "/" + slaveMember.getPassword() + "/" + relPath + "/" + fileNameArray[i]
- + "/" + fSize + "/" + ReplicationTestService.Constants.OperationType.CHECK_NT_FILE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(slaveMember, 4000);
- String result = client.execute(checkUrl);
- System.out.println(checkUrl);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
- }
-
- // delete nt:file from masterMember
-
- for (int i = 0; i < filesSize.length; i++)
- {
- String relPath = relPathArray[i];
-
- String url =
- "http://" + masterMember.getIpAddress() + ":" + masterMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + masterMember.getLogin() + "/" + masterMember.getPassword() + "/" + relPath + "/" + fileNameArray[i]
- + "/" + ReplicationTestService.Constants.OperationType.DELETE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(masterMember);
- String result = client.execute(url);
- System.out.println(url);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
-
- // check deleted node in slaveMember
-
- for (int i = 0; i < filesSize.length; i++)
- {
- long fSize = filesSize[i];
- String relPath = relPathArray[i];
-
- for (MemberInfo slaveMember : getCurrentSlaveMembers())
- {
- String checkUrl =
- "http://" + slaveMember.getIpAddress() + ":" + slaveMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + slaveMember.getLogin() + "/" + slaveMember.getPassword() + "/" + relPath + "/" + fileNameArray[i]
- + "/" + ReplicationTestService.Constants.OperationType.CHECK_DELETE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(slaveMember, 4000);
- String result = client.execute(checkUrl);
- System.out.println(checkUrl);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
- }
-
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/BaseTestCaseChecker.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/BaseTestCaseChecker.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/BaseTestCaseChecker.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication.external;
-
-import junit.framework.TestCase;
-
-/**
- * Created by The eXo Platform SAS
- *
- * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
- * @version $Id: BaseTestCaseChecker.java 34445 2009-07-24 07:51:18Z dkatayev $
- */
-public abstract class BaseTestCaseChecker extends TestCase
-{
-
- // for exo-application
- public final static String TEST_REALM = "eXo REST services";
-
- // for ECM
- // public final static String TEST_REALM = "exo-domain";
-
- protected static int MAX_RANDOM_VALUE = 1000000;
-
- protected final String workingRepository = "repository";
-
- protected final String workingWorkspace = "production";
-
- private final MemberInfo[] members =
- new MemberInfo[]{new MemberInfo("192.168.0.102", 8080, "root", "exo", 100),
- new MemberInfo("192.168.0.102", 8080, "root", "exo", 50),
- new MemberInfo("192.168.0.102", 8080, "root", "exo", 30)};
-
- private int maxPriorityMemberIndex;
-
- private int minPriorityMemberIndex;
-
- private MemberInfo masterMember;
-
- private MemberInfo[] slaveMembers;
-
- protected void setUp() throws Exception
- {
- // check max and min priority members;
- int min = Integer.MAX_VALUE;
- int max = Integer.MIN_VALUE;
- int minIndex = -1, maxIndex = -1;
-
- for (int mIndex = 0; mIndex < members.length; mIndex++)
- {
- MemberInfo memberInfo = members[mIndex];
-
- if (min > memberInfo.getPriority())
- {
- min = memberInfo.getPriority();
- minIndex = mIndex;
- }
-
- if (max < memberInfo.getPriority())
- {
- max = memberInfo.getPriority();
- maxIndex = mIndex;
- }
- }
-
- minPriorityMemberIndex = minIndex;
- maxPriorityMemberIndex = maxIndex;
- }
-
- protected String createRelPath(long fSize)
- {
- String alphabet = "abcdefghijklmnopqrstuvwxyz";
- String relPath = "";
- long pathDepth = (fSize % 7) + 5;
-
- for (long i = 0; i < pathDepth; i++)
- {
- int index1 = (int)(Math.random() * 1000) % alphabet.length();
- int index2 = (int)(Math.random() * 1000) % alphabet.length();
- String s = alphabet.substring(index1, index1 + 1) + alphabet.substring(index2, index2 + 1);
- // s+=(int) (Math.random() * 100000);
-
- relPath += ("::" + s);
- }
-
- return relPath;
- }
-
- public MemberInfo getCurrentMasterMember()
- {
- return masterMember;
- }
-
- public MemberInfo getMaxPriorityMember()
- {
- return members[maxPriorityMemberIndex];
- }
-
- public MemberInfo getMinPriorityMember()
- {
- return members[minPriorityMemberIndex];
- }
-
- public MemberInfo getMiddlePriorityMember()
- {
- for (MemberInfo memberInfo : members)
- if (!memberInfo.equals(members[maxPriorityMemberIndex]) && !memberInfo.equals(members[minPriorityMemberIndex]))
- {
- return memberInfo;
- }
- return members[minPriorityMemberIndex];
- }
-
- public MemberInfo[] getCurrentSlaveMembers()
- {
- return slaveMembers;
- }
-
- public MemberInfo[] getAllMembers()
- {
- return members;
- }
-
- public void randomizeMembers()
- {
- int masterIndex = (int)(Math.random() * 1000) % members.length;
-
- masterMember = members[masterIndex];
-
- slaveMembers = new MemberInfo[members.length - 1];
-
- int slaveMembersIndex = 0;
-
- for (int i = 0; i < members.length; i++)
- if (i != masterIndex)
- slaveMembers[slaveMembersIndex++] = members[i];
- }
-
- public long getRandomLong()
- {
- return (long)(Math.random() * MAX_RANDOM_VALUE);
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/BasicAuthenticationHttpClient.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/BasicAuthenticationHttpClient.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/BasicAuthenticationHttpClient.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication.external;
-
-import org.exoplatform.common.http.client.CookieModule;
-import org.exoplatform.common.http.client.HTTPConnection;
-import org.exoplatform.common.http.client.HTTPResponse;
-
-import java.net.URL;
-
-/**
- * Created by The eXo Platform SAS
- *
- * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
- * @version $Id: BasicAuthenticationHttpClient.java 34445 2009-07-24 07:51:18Z dkatayev $
- */
-public class BasicAuthenticationHttpClient
-{
- private HTTPConnection connection;
-
- private long waitTime = 0;
-
- private final String ipAdress;
-
- private final int port;
-
- private final String login;
-
- private final String password;
-
- public BasicAuthenticationHttpClient(String ipAdress, int port, String login, String password)
- {
- this.ipAdress = ipAdress;
- this.port = port;
- this.login = login;
- this.password = password;
- }
-
- public BasicAuthenticationHttpClient(MemberInfo info)
- {
- this(info.getIpAddress(), info.getPort(), info.getLogin(), info.getPassword());
- }
-
- public BasicAuthenticationHttpClient(MemberInfo info, long waitTime)
- {
- this(info.getIpAddress(), info.getPort(), info.getLogin(), info.getPassword());
- this.waitTime = waitTime;
- }
-
- public String execute(String sURL)
- {
- String result = "fail";
-
- try
- {
- Thread.sleep(waitTime);
-
- // execute the GET
- URL url = new URL(sURL);
- connection = new HTTPConnection(url);
- connection.removeModule(CookieModule.class);
-
- connection.addBasicAuthorization(BaseTestCaseChecker.TEST_REALM, login, password);
-
- HTTPResponse resp = connection.Get(url.getFile());
-
- // print the status and response
- if (resp.getStatusCode() != 200)
- System.out.println(resp.getStatusCode() + "\n" + resp.getText());
-
- result = resp.getText();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- return result;
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/CopyMoveCheckerTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/CopyMoveCheckerTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/CopyMoveCheckerTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,151 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication.external;
-
-import org.exoplatform.services.jcr.ext.replication.test.ReplicationTestService;
-
-/**
- * Created by The eXo Platform SAS
- *
- * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
- * @version $Id: CopyMoveCheckerTest.java 34445 2009-07-24 07:51:18Z dkatayev $
- */
-public class CopyMoveCheckerTest extends BaseTestCaseChecker
-{
-
- static long[] filesSize = new long[]{12314, 2106584, 305682};
-
- public void testWorkspaceCopy() throws Exception
- {
- String srcRepoPathArray[] = new String[filesSize.length];
- String nodeNameArray[] = new String[filesSize.length];
- String destNodeNameArray[] = new String[filesSize.length];
-
- // copy nt:file in masterMember
- randomizeMembers();
- MemberInfo masterMember = getCurrentMasterMember();
-
- for (int i = 0; i < filesSize.length; i++)
- {
- long contentSize = filesSize[i];
- String srcRepoPath = createRelPath(contentSize);
- srcRepoPathArray[i] = srcRepoPath;
- nodeNameArray[i] = "source_nt_file_" + contentSize + "_" + (int)(Math.random() * MAX_RANDOM_VALUE);
- destNodeNameArray[i] = "destination_nt_file_" + contentSize + "_" + (int)(Math.random() * MAX_RANDOM_VALUE);
-
- String url =
- "http://" + masterMember.getIpAddress() + ":" + masterMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + masterMember.getLogin() + "/" + masterMember.getPassword() + "/" + srcRepoPath + "/"
- + nodeNameArray[i] + "/" + destNodeNameArray[i] + "/" + contentSize + "/"
- + ReplicationTestService.Constants.OperationType.WORKSPACE_COPY;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(masterMember, 4000);
- String result = client.execute(url);
- System.out.println(url);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
-
- // check copy node in slaveMember
-
- for (int i = 0; i < filesSize.length; i++)
- {
- long contentSize = filesSize[i];
- String srcRepoPath = srcRepoPathArray[i];
-
- for (MemberInfo slaveMember : getCurrentSlaveMembers())
- {
- String checkUrl =
- "http://" + slaveMember.getIpAddress() + ":" + slaveMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + slaveMember.getLogin() + "/" + slaveMember.getPassword() + "/" + srcRepoPath + "/"
- + nodeNameArray[i] + "/" + destNodeNameArray[i] + "/" + contentSize + "/"
- + ReplicationTestService.Constants.OperationType.CHECK_COPY_MOVE_NODE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(slaveMember, 4000);
- String result = client.execute(checkUrl);
- System.out.println(checkUrl);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
- }
- }
-
- public void testSessionMove() throws Exception
- {
- String srcRepoPathArray[] = new String[filesSize.length];
- String nodeNameArray[] = new String[filesSize.length];
- String destNodeNameArray[] = new String[filesSize.length];
-
- // move nt:file in masterMember
- randomizeMembers();
- MemberInfo masterMember = getCurrentMasterMember();
-
- for (int i = 0; i < filesSize.length; i++)
- {
- long contentSize = filesSize[i];
- String srcRepoPath = createRelPath(contentSize);
- srcRepoPathArray[i] = srcRepoPath;
- nodeNameArray[i] = "source_nt_file_" + contentSize + "_" + (int)(Math.random() * MAX_RANDOM_VALUE);
- destNodeNameArray[i] = "destination_nt_file_" + contentSize + "_" + (int)(Math.random() * MAX_RANDOM_VALUE);
-
- String url =
- "http://" + masterMember.getIpAddress() + ":" + masterMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + masterMember.getLogin() + "/" + masterMember.getPassword() + "/" + srcRepoPath + "/"
- + nodeNameArray[i] + "/" + destNodeNameArray[i] + "/" + contentSize + "/"
- + ReplicationTestService.Constants.OperationType.SESSION_MOVE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(masterMember, 4000);
- String result = client.execute(url);
- System.out.println(url);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
-
- // check moved node in slaveMember
-
- for (int i = 0; i < filesSize.length; i++)
- {
- long contentSize = filesSize[i];
- String srcRepoPath = srcRepoPathArray[i];
-
- for (MemberInfo slaveMember : getCurrentSlaveMembers())
- {
- String checkUrl =
- "http://" + slaveMember.getIpAddress() + ":" + slaveMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + slaveMember.getLogin() + "/" + slaveMember.getPassword() + "/" + srcRepoPath + "/"
- + nodeNameArray[i] + "/" + destNodeNameArray[i] + "/" + contentSize + "/"
- + ReplicationTestService.Constants.OperationType.CHECK_COPY_MOVE_NODE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(slaveMember, 4000);
- String result = client.execute(checkUrl);
- System.out.println(checkUrl);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
- }
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/LockCheckerTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/LockCheckerTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/LockCheckerTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication.external;
-
-import org.exoplatform.services.jcr.ext.replication.test.ReplicationTestService;
-
-/**
- * Created by The eXo Platform SAS
- *
- * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
- * @version $Id: LockCheckerTest.java 34445 2009-07-24 07:51:18Z dkatayev $
- */
-public class LockCheckerTest extends BaseTestCaseChecker
-{
- public void testLock() throws Exception
- {
- int MANY_TEST = 2;
- String relPathArray[] = new String[MANY_TEST];
-
- // set lock to masterMember
- randomizeMembers();
- MemberInfo masterMember = getCurrentMasterMember();
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- int rendomValue = (int)(Math.random() * MAX_RANDOM_VALUE);
- String relPath = createRelPath(rendomValue) + "::" + "locked_node" + rendomValue;
- relPathArray[i] = relPath;
-
- String url =
- "http://" + masterMember.getIpAddress() + ":" + masterMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + masterMember.getLogin() + "/" + masterMember.getPassword() + "/" + relPath + "/"
- + ReplicationTestService.Constants.OperationType.SET_LOCK;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(masterMember, 500);
- String result = client.execute(url);
- System.out.println(url);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
-
- // check lock in slaveMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- String relPath = relPathArray[i];
-
- for (MemberInfo slaveMember : getCurrentSlaveMembers())
- {
- String checkUrl =
- "http://" + slaveMember.getIpAddress() + ":" + slaveMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + slaveMember.getLogin() + "/" + slaveMember.getPassword() + "/" + relPath + "/"
- + ReplicationTestService.Constants.OperationType.CECK_LOCK;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(slaveMember, 500);
- String result = client.execute(checkUrl);
- System.out.println(checkUrl);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
- }
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/MemberInfo.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/MemberInfo.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/MemberInfo.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication.external;
-
-/**
- * Created by The eXo Platform SAS
- *
- * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
- * @version $Id: MemberInfo.java 34445 2009-07-24 07:51:18Z dkatayev $
- */
-public class MemberInfo
-{
- private final String ipAddress;
-
- private final int port;
-
- private final String login;
-
- private final String password;
-
- private final int priority;
-
- public MemberInfo(String ipAddress, int port, String login, String password, int priority)
- {
- this.ipAddress = ipAddress;
- this.port = port;
- this.login = login;
- this.password = password;
- this.priority = priority;
- }
-
- public String getIpAddress()
- {
- return ipAddress;
- }
-
- public int getPort()
- {
- return port;
- }
-
- public String getLogin()
- {
- return login;
- }
-
- public String getPassword()
- {
- return password;
- }
-
- public int getPriority()
- {
- return priority;
- }
-
- public boolean equals(MemberInfo memberInfo)
- {
- return (ipAddress.equals(memberInfo.getIpAddress()) && port == memberInfo.getPort() && priority == memberInfo
- .getPriority());
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/VersionCheckerTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/VersionCheckerTest.java 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/replication/external/VersionCheckerTest.java 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,282 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.replication.external;
-
-import org.exoplatform.services.jcr.ext.replication.test.ReplicationTestService;
-
-/**
- * Created by The eXo Platform SAS
- *
- * @author <a href="mailto:alex.reshetnyak at exoplatform.com.ua">Alex Reshetnyak</a>
- * @version $Id: VersionCheckerTest.java 34445 2009-07-24 07:51:18Z dkatayev $
- */
-public class VersionCheckerTest extends BaseTestCaseChecker
-{
- private static int MANY_TEST = 5;
-
- private static String relPathArray[] = new String[MANY_TEST];
-
- private static String baseVersionValue[] = new String[MANY_TEST];
-
- private static String versionValue_1[] = new String[MANY_TEST];
-
- private static String versionValue_2[] = new String[MANY_TEST];
-
- public void testCreateVersionNode() throws Exception
- {
- randomizeMembers();
- MemberInfo masterMember = getCurrentMasterMember();
-
- // create version node in masterMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- int rendomValue = (int)(Math.random() * MAX_RANDOM_VALUE);
- String relPath = createRelPath(rendomValue) + "::" + "version_node" + rendomValue;
- relPathArray[i] = relPath;
- baseVersionValue[i] = "base_version_value" + (int)(Math.random() * MAX_RANDOM_VALUE);
-
- String url =
- "http://" + masterMember.getIpAddress() + ":" + masterMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + masterMember.getLogin() + "/" + masterMember.getPassword() + "/" + relPath + "/" + baseVersionValue[i]
- + "/" + ReplicationTestService.Constants.OperationType.ADD_VERSIONODE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(masterMember);
- String result = client.execute(url);
- System.out.println(url);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
-
- // check version value in slaveMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- String relPath = relPathArray[i];
-
- for (MemberInfo slaveMember : getCurrentSlaveMembers())
- {
- String checkUrl =
- "http://" + slaveMember.getIpAddress() + ":" + slaveMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + slaveMember.getLogin() + "/" + slaveMember.getPassword() + "/" + relPath + "/"
- + baseVersionValue[i] + "/" + ReplicationTestService.Constants.OperationType.CHECK_VERSION_NODE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(slaveMember, 500);
- String result = client.execute(checkUrl);
- System.out.println(checkUrl);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
- }
- }
-
- public void testAddNewVersionValue() throws Exception
- {
- randomizeMembers();
- MemberInfo masterMember = getCurrentMasterMember();
- // create version node in masterMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- versionValue_1[i] = "version_value_1_" + (int)(Math.random() * MAX_RANDOM_VALUE);
-
- String url =
- "http://" + masterMember.getIpAddress() + ":" + masterMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + masterMember.getLogin() + "/" + masterMember.getPassword() + "/" + relPathArray[i] + "/"
- + versionValue_1[i] + "/" + ReplicationTestService.Constants.OperationType.ADD_NEW_VERSION;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(masterMember);
- String result = client.execute(url);
- System.out.println(url);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
-
- // check version value in slaveMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- String relPath = relPathArray[i];
-
- for (MemberInfo slaveMember : getCurrentSlaveMembers())
- {
- String checkUrl =
- "http://" + slaveMember.getIpAddress() + ":" + slaveMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + slaveMember.getLogin() + "/" + slaveMember.getPassword() + "/" + relPath + "/" + versionValue_1[i]
- + "/" + ReplicationTestService.Constants.OperationType.CHECK_VERSION_NODE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(slaveMember, 500);
- String result = client.execute(checkUrl);
- System.out.println(checkUrl);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
- }
- }
-
- public void testAddNewVersionValue2() throws Exception
- {
- randomizeMembers();
- MemberInfo masterMember = getCurrentMasterMember();
-
- // create version node in masterMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- versionValue_2[i] = "version_value_2_" + (int)(Math.random() * MAX_RANDOM_VALUE);
-
- String url =
- "http://" + masterMember.getIpAddress() + ":" + masterMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + masterMember.getLogin() + "/" + masterMember.getPassword() + "/" + relPathArray[i] + "/"
- + versionValue_2[i] + "/" + ReplicationTestService.Constants.OperationType.ADD_NEW_VERSION;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(masterMember);
- String result = client.execute(url);
- System.out.println(url);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
-
- // check version value in slaveMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- String relPath = relPathArray[i];
-
- for (MemberInfo slaveMember : getCurrentSlaveMembers())
- {
- String checkUrl =
- "http://" + slaveMember.getIpAddress() + ":" + slaveMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + slaveMember.getLogin() + "/" + slaveMember.getPassword() + "/" + relPath + "/" + versionValue_2[i]
- + "/" + ReplicationTestService.Constants.OperationType.CHECK_VERSION_NODE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(slaveMember, 500);
- String result = client.execute(checkUrl);
- System.out.println(checkUrl);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
- }
- }
-
- public void testRestorePreviousVersion() throws Exception
- {
- randomizeMembers();
- MemberInfo masterMember = getCurrentMasterMember();
-
- // create version node in masterMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- String url =
- "http://" + masterMember.getIpAddress() + ":" + masterMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + masterMember.getLogin() + "/" + masterMember.getPassword() + "/" + relPathArray[i] + "/"
- + ReplicationTestService.Constants.OperationType.RESTORE_RPEVIOUS_VERSION;
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(masterMember);
- String result = client.execute(url);
- System.out.println(url);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
-
- // check version value in slaveMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- String relPath = relPathArray[i];
-
- for (MemberInfo slaveMember : getCurrentSlaveMembers())
- {
- String checkUrl =
- "http://" + slaveMember.getIpAddress() + ":" + slaveMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + slaveMember.getLogin() + "/" + slaveMember.getPassword() + "/" + relPath + "/" + versionValue_1[i]
- + "/" + ReplicationTestService.Constants.OperationType.CHECK_VERSION_NODE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(slaveMember, 500);
- String result = client.execute(checkUrl);
- System.out.println(checkUrl);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
- }
- }
-
- public void testRestoreBaseVersion() throws Exception
- {
- randomizeMembers();
- MemberInfo masterMember = getCurrentMasterMember();
-
- // create version node in masterMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- String url =
- "http://" + masterMember.getIpAddress() + ":" + masterMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + masterMember.getLogin() + "/" + masterMember.getPassword() + "/" + relPathArray[i] + "/"
- + ReplicationTestService.Constants.OperationType.RESTORE_BASE_VERSION;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(masterMember);
- String result = client.execute(url);
- System.out.println(url);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
-
- // check version value in slaveMember
-
- for (int i = 0; i < relPathArray.length; i++)
- {
- String relPath = relPathArray[i];
-
- for (MemberInfo slaveMember : getCurrentSlaveMembers())
- {
- String checkUrl =
- "http://" + slaveMember.getIpAddress() + ":" + slaveMember.getPort()
- + ReplicationTestService.Constants.BASE_URL + "/" + workingRepository + "/" + workingWorkspace + "/"
- + slaveMember.getLogin() + "/" + slaveMember.getPassword() + "/" + relPath + "/"
- + baseVersionValue[i] + "/" + ReplicationTestService.Constants.OperationType.CHECK_VERSION_NODE;
-
- BasicAuthenticationHttpClient client = new BasicAuthenticationHttpClient(slaveMember, 500);
- String result = client.execute(checkUrl);
- System.out.println(checkUrl);
- System.out.println(result);
-
- assertEquals(result, "ok");
- }
- }
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-replication.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-replication.xml 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration-replication.xml 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,355 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
- xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
-
- <!-- config replication for IPv4 -->
- <!-- for persistent mode -->
- <component>
- <type>org.exoplatform.services.jcr.ext.replication.ReplicationService</type>
- <init-params>
- <values-param>
- <name>repositories</name>
- <value>db1</value>
- <value>db2</value>
- </values-param>
- <properties-param>
- <name>replication-properties</name>
- <property name="test-mode" value="true" />
- <property name="enabled" value="true" />
- <property name="mode" value="persistent" />
- <property name="bind-ip-address" value="127.0.0.1" />
- <property name="channel-config"
- value="TCP(start_port=7700;oob_thread_pool.queue_max_size=100;thread_naming_pattern=cl;use_concurrent_stack=true;oob_thread_pool.rejection_policy=Run;discard_incompatible_packets=true;thread_pool.max_threads=40;oob_thread_pool.enabled=true;oob_thread_pool.max_threads=20;loopback=false;oob_thread_pool.keep_alive_time=5000;thread_pool.queue_enabled=false;oob_thread_pool.queue_enabled=false;max_bundle_size=64000;thread_pool.queue_max_size=100;thread_pool.enabled=true;enable_diagnostics=true;max_bundle_timeout=30;oob_thread_pool.min_threads=8;use_incoming_packet_handler=true;thread_pool.rejection_policy=Run;bind_addr=$bind-ip-address;thread_pool.min_threads=8;thread_pool.keep_alive_time=5000;enable_bundling=true):MPING(timeout=2000;num_initial_members=8;mcast_port=34526;mcast_addr=224.0.0.1;bind_addr=$bind-ip-address):FD_SOCK:VERIFY_SUSPECT(timeout=1500):pbcast.NAKACK(max_xmit_size=60000;print_stability_history_on_failed_xmit=true;use_mcast_xmit=false;gc_lag=0;di!
scard_delivered_msgs=true;retransmit_timeout=300,600,1200,2400,4800):pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=8000000):pbcast.GMS(print_local_addr=true;join_timeout=3000;view_bundling=true;join_retry_timeout=2000;shun=false)" />
- <property name="recovery-dir" value="target/replication/recovery" />
- <property name="node-name" value="cluster_node1" />
- <property name="other-participants" value="cluster_node2" />
- <property name="wait-confirmation" value="2000" />
- </properties-param>
- <properties-param>
- <name>replication-priority-properties</name>
- <property name="priority-type" value="static" /><!-- {static, dynamic} -->
- <property name="node-priority" value="100" /><!-- max == 100 -->
- </properties-param>
- </init-params>
- </component>
-
- <!-- for proxy mode -->
- <!-- component>
- <type>org.exoplatform.services.jcr.ext.replication.ReplicationService</type>
- <init-params>
- <values-param>
- <name>repositories</name>
- <value>db1</value>
- <value>db2</value>
- </values-param>
- <properties-param>
- <name>replication-properties</name>
- <property name="test-mode" value="true" />
- <property name="enabled" value="true" />
- <property name="mode" value="proxy" />
- <property name="bind-ip-address" value="192.168.0.15" />
- <property name="channel-config"
- value="TCP(start_port=7700;oob_thread_pool.queue_max_size=100;thread_naming_pattern=cl;use_concurrent_stack=true;oob_thread_pool.rejection_policy=Run;discard_incompatible_packets=true;thread_pool.max_threads=40;oob_thread_pool.enabled=true;oob_thread_pool.max_threads=20;loopback=false;oob_thread_pool.keep_alive_time=5000;thread_pool.queue_enabled=false;oob_thread_pool.queue_enabled=false;max_bundle_size=64000;thread_pool.queue_max_size=100;thread_pool.enabled=true;enable_diagnostics=true;max_bundle_timeout=30;oob_thread_pool.min_threads=8;use_incoming_packet_handler=true;thread_pool.rejection_policy=Run;bind_addr=$bind-ip-address;thread_pool.min_threads=8;thread_pool.keep_alive_time=5000;enable_bundling=true):MPING(timeout=2000;num_initial_members=8;mcast_port=34526;mcast_addr=224.0.0.1;bind_addr=$bind-ip-address):FD_SOCK:VERIFY_SUSPECT(timeout=1500):pbcast.NAKACK(max_xmit_size=60000;print_stability_history_on_failed_xmit=true;use_mcast_xmit=false;gc_lag=0;di!
scard_delivered_msgs=true;retransmit_timeout=300,600,1200,2400,4800):pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=8000000):pbcast.GMS(print_local_addr=true;join_timeout=3000;view_bundling=true;join_retry_timeout=2000;shun=false)" />
- <property name="recovery-dir" value="target/replication/recovery" />
- <property name="node-name" value="cluster_node1" />
- <property name="other-participants" value="cluster_node2" />
- <property name="wait-confirmation" value="2000" />
- </properties-param>
- <properties-param>
- <name>replication-priority-properties</name>
- <property name="priority-type" value="static" />
- <property name="node-priority" value="100" />
- </properties-param>
- </init-params>
- </component -->
-
- <!-- config replication for IPv6 -->
- <!-- component>
- <type>org.exoplatform.services.jcr.ext.replication.ReplicationService</type>
- <init-params>
- <values-param>
- <name>repositories</name>
- <value>db1</value>
- <value>db2</value>
- </values-param>
- <properties-param>
- <name>replication-properties</name>
- <property name="test-mode" value="true" />
- <property name="enabled" value="true" />
- <property name="mode" value="persistent" />
- <property name="bind-ip-address" value="fe80::215:f2ff:febe:3343%4" />
- <property name="channel-config"
- value="TCP(start_port=7700;oob_thread_pool.queue_max_size=100;thread_naming_pattern=cl;use_concurrent_stack=true;oob_thread_pool.rejection_policy=Run;discard_incompatible_packets=true;thread_pool.max_threads=40;oob_thread_pool.enabled=true;oob_thread_pool.max_threads=20;loopback=false;oob_thread_pool.keep_alive_time=5000;thread_pool.queue_enabled=false;oob_thread_pool.queue_enabled=false;max_bundle_size=64000;thread_pool.queue_max_size=100;thread_pool.enabled=true;enable_diagnostics=true;max_bundle_timeout=30;oob_thread_pool.min_threads=8;use_incoming_packet_handler=true;thread_pool.rejection_policy=Run;bind_addr=$bind-ip-address;thread_pool.min_threads=8;thread_pool.keep_alive_time=5000;enable_bundling=true):MPING(timeout=2000;num_initial_members=8;mcast_port=34526;mcast_addr=ff18:eb72:479f::2:3;bind_addr=$bind-ip-address):FD_SOCK:VERIFY_SUSPECT(timeout=1500):pbcast.NAKACK(max_xmit_size=60000;print_stability_history_on_failed_xmit=true;use_mcast_xmit=false;g!
c_lag=0;discard_delivered_msgs=true;retransmit_timeout=300,600,1200,2400,4800):pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=8000000):pbcast.GMS(print_local_addr=true;join_timeout=3000;view_bundling=true;join_retry_timeout=2000;shun=false)" />
- <property name="recovery-dir" value="target/replication/recovery" />
- <property name="node-name" value="cluster_node1" />
- <property name="other-participants" value="cluster_node2" />
- <property name="wait-confirmation" value="2000" />
- </properties-param>
- <properties-param>
- <name>replication-priority-properties</name>
- <property name="priority-type" value="static" />
- <property name="node-priority" value="100" />
- </properties-param>
- </component -->
-
- <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.DBInitializer" value="DEBUG"/ -->
- <!-- property name="log4j.category.ext.AbstractWorkspaceDataReceiver" value="DEBUG"/ -->
-
- </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" />
- </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-impl.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>file:src/test/resources/conf/standalone/test-jcr-ext-config-replication.xml</value>
- </value-param>
- </init-params>
- </component>
-
- <component>
- <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
- </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.hsqldb.jdbcDriver" />
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/portal1" />
- <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>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.hsqldb.jdbcDriver" />
- <property name="url" value="jdbc:hsqldb:file:target/temp2/data/portal2" />
- <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>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.hsqldb.jdbcDriver" />
- <property name="url" value="jdbc:hsqldb:file:target/temp1/data/portal1" />
- <property name="username" value="sa" />
- <property name="password" value="" />
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>jotm.tx</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>UserTransaction</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.transaction.UserTransaction</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.objectweb.jotm.UserTransactionFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="jotm.timeout" value="60" />
- </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" />
- </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>
-
-</configuration>
Deleted: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-replication.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-replication.xml 2012-01-10 12:39:15 UTC (rev 5432)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-replication.xml 2012-01-10 13:39:25 UTC (rev 5433)
@@ -1,200 +0,0 @@
-<!--
-
- 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.
-
--->
-<!-- for persistent mode -->
-
-<repository-service default-repository="db1">
- <repositories>
-
- <repository name="db1" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <access-control>optional</access-control>
-
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws" auto-init-root-nodetype="nt:unstructured" auto-init-permissions="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr2" />
- <property name="dialect" value="generic" />
- <property name="multi-db" value="true" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp1/swap/ws" />
- </properties>
- <value-storages>
- <value-storage id="Storage #1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp1/values/ws" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100000" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="1000" />
- <property name="live-time" value="1800" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp1/index" />
- </properties>
- </query-handler>
- </workspace>
- </workspaces>
- </repository>
-
- <repository name="db2" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <access-control>optional</access-control>
-
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws" auto-init-root-nodetype="nt:unstructured" auto-init-permissions="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr1" />
- <property name="dialect" value="generic" />
- <property name="multi-db" value="true" />
- <property name="max-buffer-size" value="204800" />
- <property name="swap-directory" value="target/temp2/swap/ws" />
- </properties>
- <value-storages>
- <value-storage id="Storage #1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp2/values/ws" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100000" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="1000" />
- <property name="live-time" value="1800" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp2/index" />
- </properties>
- </query-handler>
- </workspace>
- </workspaces>
- </repository>
-
- </repositories>
-</repository-service>
-
-
-<!-- for proxy mode -->
-
-<!-- repository-service default-repository="db1">
- <repositories>
-
- <repository name="db1" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <access-control>optional</access-control>
-
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws" auto-init-root-nodetype="nt:unstructured" auto-init-permissions="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr1" />
- <property name="dialect" value="generic" />
- <property name="multi-db" value="true" />
- <property name="max-buffer-size" value="204800" />
- <property name="swap-directory" value="target/temp1/swap/ws" />
- </properties>
- <value-storages>
- <value-storage id="Storage #1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp1/values/ws" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100000" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="1000" />
- <property name="live-time" value="1800" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp1/index" />
- </properties>
- </query-handler>
- </workspace>
- </workspaces>
- </repository>
-
- <repository name="db2" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <access-control>optional</access-control>
-
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws" auto-init-root-nodetype="nt:unstructured" auto-init-permissions="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr1" />
- <property name="dialect" value="generic" />
- <property name="multi-db" value="true" />
- <property name="max-buffer-size" value="204800" />
- <property name="swap-directory" value="target/temp1/swap/ws" />
- </properties>
- <value-storages>
- <value-storage id="Storage #1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp1/values/ws" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100000" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="1000" />
- <property name="live-time" value="1800" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp2/index" />
- </properties>
- </query-handler>
- </workspace>
- </workspaces>
- </repository>
-
- </repositories>
-</repository-service -->
\ No newline at end of file
More information about the exo-jcr-commits
mailing list