[exo-jcr-commits] exo-jcr SVN: r2995 - in jcr/trunk/exo.jcr.component.ftp/src/test: java/org/exoplatform/services/ftp/usecases and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Aug 26 11:30:32 EDT 2010


Author: sergiykarpenko
Date: 2010-08-26 11:30:31 -0400 (Thu, 26 Aug 2010)
New Revision: 2995

Added:
   jcr/trunk/exo.jcr.component.ftp/src/test/java/org/exoplatform/services/ftp/usecases/
   jcr/trunk/exo.jcr.component.ftp/src/test/java/org/exoplatform/services/ftp/usecases/TestCopyBetweenWorkspaces.java
Modified:
   jcr/trunk/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jcr-config.xml
Log:
EXOJCR-849: test created

Added: jcr/trunk/exo.jcr.component.ftp/src/test/java/org/exoplatform/services/ftp/usecases/TestCopyBetweenWorkspaces.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/test/java/org/exoplatform/services/ftp/usecases/TestCopyBetweenWorkspaces.java	                        (rev 0)
+++ jcr/trunk/exo.jcr.component.ftp/src/test/java/org/exoplatform/services/ftp/usecases/TestCopyBetweenWorkspaces.java	2010-08-26 15:30:31 UTC (rev 2995)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.ftp.usecases;
+
+import org.exoplatform.services.ftp.BaseFtpTest;
+import org.exoplatform.services.ftp.FtpConst;
+
+/**
+ * Created by The eXo Platform SAS.
+ * 
+ * <br/>Date: 
+ *
+ * @author <a href="karpenko.sergiy at gmail.com">Karpenko Sergiy</a> 
+ * @version $Id: TestCopyBetweenWorkspaces.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class TestCopyBetweenWorkspaces extends BaseFtpTest
+{
+
+   public void testCopyBetweenWorkspaces() throws Exception
+   {
+      String filename = "testCopy.txt";
+      String fileContent = "exo ftp test copy server test\n";
+      try
+      {
+         connect();
+         pwd();
+         cwd("ws");
+         pwd();
+         stor(fileContent.getBytes(), filename);
+         String retrieved = new String(retr(filename));
+         assertEquals(fileContent, retrieved);
+
+         // make move
+         sendCommand(FtpConst.Commands.CMD_RNFR + ' ' + filename);
+         String response = readResponse();
+         assertTrue("Must start with 350, but was [" + response + "]", response.startsWith("350 "));
+         sendCommand(FtpConst.Commands.CMD_RNTO + ' ' + "/ws2/" + filename);
+         response = readResponse();
+         assertTrue("Must start with 250, but was [" + response + "]", response.startsWith("250 "));
+
+      }
+      finally
+      {
+         disconnect();
+      }
+   }
+}

Modified: jcr/trunk/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jcr-config.xml	2010-08-26 14:32:29 UTC (rev 2994)
+++ jcr/trunk/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jcr-config.xml	2010-08-26 15:30:31 UTC (rev 2995)
@@ -32,10 +32,7 @@
                      <property name="sourceName" value="jdbcjcr" />
                      <property name="dialect" value="generic" />
                      <!-- example of direct jdbc connection usage (without JNDI), see docs for details -->
-                     <!-- property name="driverClassName" value="org.hsqldb.jdbcDriver" />
-                     <property name="url" value="jdbc:hsqldb:file:target/temp/data/portal" />
-                     <property name="username" value="sa" />
-                     <property name="password" value="" / -->
+
                      <property name="multi-db" value="false" />
                      <property name="update-storage" value="true" />
                      <property name="max-buffer-size" value="204800" />
@@ -50,18 +47,51 @@
                </cache>
                <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
                   <properties>
-                     <property name="indexDir" value="target/temp/index" />
+                     <property name="indexDir" value="target/temp/index/ws" />
                   </properties>
                </query-handler>
                <lock-manager>
                   <time-out>900000</time-out><!-- 15min -->
                   <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
                      <properties>
-                        <property name="path" value="target/temp/lock" />
+                        <property name="path" value="target/temp/lock/ws" />
                      </properties>
                   </persister>
                </lock-manager>
             </workspace>
+            <workspace name="ws2" auto-init-root-nodetype="nt:unstructured">
+               <!-- for system storage -->
+               <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+                  <properties>
+                     <property name="sourceName" value="jdbcjcr" />
+                     <property name="dialect" value="generic" />
+                     <!-- example of direct jdbc connection usage (without JNDI), see docs for details -->
+                     <property name="multi-db" value="false" />
+                     <property name="update-storage" value="true" />
+                     <property name="max-buffer-size" value="204800" />
+                     <property name="swap-directory" value="target/temp/swap/ws2" />
+                  </properties>
+               </container>
+               <cache enabled="true">
+                  <properties>
+                     <property name="maxSize" value="3000" />
+                     <property name="liveTime" value="300" /><!-- 30 sec -->
+                  </properties>
+               </cache>
+               <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+                  <properties>
+                     <property name="indexDir" value="target/temp/index/ws2" />
+                  </properties>
+               </query-handler>
+               <lock-manager>
+                  <time-out>900000</time-out><!-- 15min -->
+                  <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+                     <properties>
+                        <property name="path" value="target/temp/lock/ws2" />
+                     </properties>
+                  </persister>
+               </lock-manager>
+            </workspace>
          </workspaces>
       </repository>
    </repositories>



More information about the exo-jcr-commits mailing list