Author: areshetnyak
Date: 2009-12-29 09:04:26 -0500 (Tue, 29 Dec 2009)
New Revision: 1237
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavCreatePropertyTest.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavLockNodeTest.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavRemovePropertyTest.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavSetPropertyTest.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavVersionTest.java
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/BaseClusteringFunctionalTest.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavAddBLOBTest.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavAddNodeTest.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavMoveNodeTest.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavRemoveNodeTest.java
Log:
EXOJCR-330 : Add new functional cluster tests and changed existing tests.
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/BaseClusteringFunctionalTest.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/BaseClusteringFunctionalTest.java 2009-12-29
14:02:02 UTC (rev 1236)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/BaseClusteringFunctionalTest.java 2009-12-29
14:04:26 UTC (rev 1237)
@@ -18,7 +18,6 @@
import junit.framework.TestCase;
-import org.exoplatform.common.http.client.CookieModule;
import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
import java.io.File;
@@ -36,32 +35,18 @@
*/
public abstract class BaseClusteringFunctionalTest extends TestCase
{
- protected JCRWebdavConnection connection1;
-
- protected JCRWebdavConnection connection2;
-
- protected JCRWebdavConnection connection3;
-
- protected JCRWebdavConnection connection4;
-
- private String host = "localhost";
-
- private int port1 = 8081;//8080;
-
- private int port2 = 8082;
-
- private int port3 = 8083;
-
- private int port4 = 8084;
-
+
private String realm = "eXo REST services";
- private String user = "root";
-
- private String password = "exo";
-
private String workspacePath = "/rest/jcr/repository/production/";
+ private JCRWebdavConnection[] connections = new JCRWebdavConnection[] {
+ new JCRWebdavConnection("localhost", 8080, "root",
"exo", realm, workspacePath)/*,
+ new JCRWebdavConnection("localhost", 8082, "root",
"exo", realm, workspacePath),
+ new JCRWebdavConnection("localhost", 8083, "root",
"exo", realm, workspacePath),
+ new JCRWebdavConnection("localhost", 8084, "root",
"exo", realm, workspacePath)*/
+ };
+
protected String nodeName;
/**
@@ -71,12 +56,6 @@
{
super.setUp();
- CookieModule.setCookiePolicyHandler(null);
- connection1 = new JCRWebdavConnection(host, port1, user, password, realm,
workspacePath);
- connection2 = new JCRWebdavConnection(host, port2, user, password, realm,
workspacePath);
- connection3 = new JCRWebdavConnection(host, port3, user, password, realm,
workspacePath);
- connection4 = new JCRWebdavConnection(host, port4, user, password, realm,
workspacePath);
-
nodeName = generateUniqueName("removed_node_over_webdav");
}
@@ -92,10 +71,28 @@
{
super.tearDown();
- connection1.removeNode(nodeName);
- connection1.stop();
+ connections[0].removeNode(nodeName);
+ connections[0].stop();
}
+
+ protected JCRWebdavConnection[] getConnections()
+ {
+ return connections;
+ }
+
+ protected JCRWebdavConnection getConnection()
+ {
+ return connections[(int) (Math.random() * 100) % connections.length];
+ }
+ /**
+ * Create BLOB.
+ *
+ * @param prefix
+ * @param sizeInKb
+ * @return
+ * @throws IOException
+ */
protected File createBLOBTempFile(String prefix, int sizeInKb) throws IOException
{
// create test file
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavAddBLOBTest.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavAddBLOBTest.java 2009-12-29
14:02:02 UTC (rev 1236)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavAddBLOBTest.java 2009-12-29
14:04:26 UTC (rev 1237)
@@ -19,6 +19,7 @@
import org.exoplatform.common.http.client.HTTPResponse;
import org.exoplatform.common.http.client.HttpOutputStream;
import org.exoplatform.services.jcr.cluster.BaseClusteringFunctionalTest;
+import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -48,42 +49,24 @@
Random random = new Random();
random.nextBytes(data);
+ JCRWebdavConnection conn = getConnection();
+
// add node with blob data
HttpOutputStream stream = new HttpOutputStream();
- HTTPResponse response = connection1.addNode(nodeName, stream);
+ HTTPResponse response = conn.addNode(nodeName, stream);
loadStream(stream, new ByteArrayInputStream(data));
stream.close();
response.getStatusCode();
// check results
- // cluster-node1
- response = connection1.getNode(nodeName);
- assertEquals(200, response.getStatusCode());
- byte[] respData = response.getData();
- assertEquals(data.length, respData.length);
- assertTrue(java.util.Arrays.equals(data, respData));
-
- // cluster-node2
- response = connection2.getNode(nodeName);
- assertEquals(200, response.getStatusCode());
- respData = response.getData();
- assertEquals(data.length, respData.length);
- assertTrue(java.util.Arrays.equals(data, respData));
-
- // cluster-node3
- response = connection3.getNode(nodeName);
- assertEquals(200, response.getStatusCode());
- respData = response.getData();
- assertEquals(data.length, respData.length);
- assertTrue(java.util.Arrays.equals(data, respData));
-
- // cluster-node4
- response = connection4.getNode(nodeName);
- assertEquals(200, response.getStatusCode());
- respData = response.getData();
- assertEquals(data.length, respData.length);
- assertTrue(java.util.Arrays.equals(data, respData));
-
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ response = connection.getNode(nodeName);
+ assertEquals(200, response.getStatusCode());
+ byte[] respData = response.getData();
+ assertEquals(data.length, respData.length);
+ assertTrue(java.util.Arrays.equals(data, respData));
+ }
}
protected void loadStream(HttpOutputStream stream, InputStream in) throws IOException
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavAddNodeTest.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavAddNodeTest.java 2009-12-29
14:02:02 UTC (rev 1236)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavAddNodeTest.java 2009-12-29
14:04:26 UTC (rev 1237)
@@ -18,6 +18,7 @@
import org.exoplatform.common.http.client.HTTPResponse;
import org.exoplatform.services.jcr.cluster.BaseClusteringFunctionalTest;
+import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
/**
* Created by The eXo Platform SAS.
@@ -32,30 +33,18 @@
public void testAddNode() throws Exception
{
+ JCRWebdavConnection conn = getConnection();
+
// add node
- connection1.addNode(nodeName, "_data_".getBytes());
+ conn.addNode(nodeName, "_data_".getBytes());
// check is node exist
- // cluster-node1
- HTTPResponse response = connection1.getNode(nodeName);
- assertEquals(200, response.getStatusCode());
- assertTrue("_data_".equals(new String(response.getData())));
-
- // cluster-node2
- HTTPResponse response2 = connection2.getNode(nodeName);
- assertEquals(200, response2.getStatusCode());
- assertTrue("_data_".equals(new String(response2.getData())));
-
- // cluster-node3
- HTTPResponse response3 = connection3.getNode(nodeName);
- assertEquals(200, response3.getStatusCode());
- assertTrue("_data_".equals(new String(response3.getData())));
-
- // cluster-node4
- HTTPResponse response4 = connection4.getNode(nodeName);
- assertEquals(200, response4.getStatusCode());
- assertTrue("_data_".equals(new String(response4.getData())));
-
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ HTTPResponse response = connection.getNode(nodeName);
+ assertEquals(200, response.getStatusCode());
+ assertTrue("_data_".equals(new String(response.getData())));
+ }
}
}
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavCreatePropertyTest.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavCreatePropertyTest.java
(rev 0)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavCreatePropertyTest.java 2009-12-29
14:04:26 UTC (rev 1237)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2003-2009 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.jcr.cluster.functional;
+
+import org.exoplatform.common.http.client.HTTPResponse;
+import org.exoplatform.services.jcr.cluster.BaseClusteringFunctionalTest;
+import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 2009
+ *
+ * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex
Reshetnyak</a>
+ * @version $Id$
+ */
+public class WebdavCreatePropertyTest
+ extends BaseClusteringFunctionalTest
+{
+
+ public void testCreatePropertyTest() throws Exception
+ {
+ JCRWebdavConnection conn = getConnection();
+
+ String property = "D:testProp";
+
+ conn.addNode(nodeName, "nt:untstructured","".getBytes());
+ conn.addProperty(nodeName, property);
+ conn.setProperty(nodeName, property, "prop_value");
+
+ // check is property exist
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ HTTPResponse response = connection.getProperty(nodeName, property);
+ assertEquals(207, response.getStatusCode());
+ assertTrue("_data_".equals(new String(response.getData())));
+ }
+
+ }
+}
Property changes on:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavCreatePropertyTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavLockNodeTest.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavLockNodeTest.java
(rev 0)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavLockNodeTest.java 2009-12-29
14:04:26 UTC (rev 1237)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2003-2009 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.jcr.cluster.functional;
+
+import org.exoplatform.common.http.client.HTTPResponse;
+import org.exoplatform.services.jcr.cluster.BaseClusteringFunctionalTest;
+import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 2009
+ *
+ * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex
Reshetnyak</a>
+ * @version $Id$
+ */
+public class WebdavLockNodeTest
+ extends BaseClusteringFunctionalTest
+{
+ public void testLock() throws Exception
+ {
+ JCRWebdavConnection conn = getConnection();
+
+ // prepare
+ String lockedNodeName = "locked_node";
+
+ conn.addDir(nodeName);
+ conn.addNode(nodeName + "/" + lockedNodeName, "".getBytes());
+
+ // lock
+ String lockToken = conn.lock(nodeName);
+
+ // check
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ HTTPResponse response = connection.addNode(nodeName + "/" +
"subnode", "should not be added".getBytes());
+
+ assertEquals(403, response.getStatusCode());
+ }
+
+ // unloc
+ conn.unlock(nodeName, lockToken);
+
+ // ckeck
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ HTTPResponse response = connection.addNode(nodeName + "/" +
"subnode", "should be added".getBytes());
+
+ assertEquals(200, response.getStatusCode());
+ assertTrue("should be added".equals(new String(response.getData())));
+ }
+ }
+}
Property changes on:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavLockNodeTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavMoveNodeTest.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavMoveNodeTest.java 2009-12-29
14:02:02 UTC (rev 1236)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavMoveNodeTest.java 2009-12-29
14:04:26 UTC (rev 1237)
@@ -18,6 +18,7 @@
import org.exoplatform.common.http.client.HTTPResponse;
import org.exoplatform.services.jcr.cluster.BaseClusteringFunctionalTest;
+import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
/**
* Created by The eXo Platform SAS.
@@ -31,64 +32,38 @@
{
public void testMoveNode() throws Exception
{
+ JCRWebdavConnection conn = getConnection();
+
String newNodeName = nodeName + "new";
// add node
- connection1.addNode(nodeName, "".getBytes());
+ conn.addNode(nodeName, "".getBytes());
+
// check is node exist
- // cluster-node1
- HTTPResponse response = connection1.getNode(nodeName);
- assertEquals(200, response.getStatusCode());
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ HTTPResponse response = connection.getNode(nodeName);
+ assertEquals(200, response.getStatusCode());
+ }
- // cluster-node2
- HTTPResponse response2 = connection2.getNode(nodeName);
- assertEquals(200, response2.getStatusCode());
-
- // cluster-node3
- HTTPResponse response3 = connection3.getNode(nodeName);
- assertEquals(200, response3.getStatusCode());
-
- // cluster-node4
- HTTPResponse response4 = connection4.getNode(nodeName);
- assertEquals(200, response4.getStatusCode());
-
- // move node on cluster-node3
-
- response = connection3.Move(nodeName, newNodeName);
+ // move node
+ conn = getConnection();
+
+ HTTPResponse response = conn.Move(nodeName, newNodeName);
response.getStatusCode();
// check is node not exist
- // cluster-node1
- response = connection1.getNode(nodeName);
- assertEquals(404, response.getStatusCode());
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ response = connection.getNode(nodeName);
+ assertEquals(404, response.getStatusCode());
+ }
- // cluster-node2
- response2 = connection2.getNode(nodeName);
- assertEquals(404, response2.getStatusCode());
-
- // cluster-node3
- response3 = connection3.getNode(nodeName);
- assertEquals(404, response3.getStatusCode());
-
- // cluster-node4
- response4 = connection4.getNode(nodeName);
- assertEquals(404, response4.getStatusCode());
-
// check is node exist
- // cluster-node1
- response = connection1.getNode(newNodeName);
- assertEquals(200, response.getStatusCode());
-
- // cluster-node2
- response2 = connection2.getNode(newNodeName);
- assertEquals(200, response2.getStatusCode());
-
- // cluster-node3
- response3 = connection3.getNode(newNodeName);
- assertEquals(200, response3.getStatusCode());
-
- // cluster-node4
- response4 = connection4.getNode(newNodeName);
- assertEquals(200, response4.getStatusCode());
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ response = connection.getNode(newNodeName);
+ assertEquals(200, response.getStatusCode());
+ }
}
}
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavRemoveNodeTest.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavRemoveNodeTest.java 2009-12-29
14:02:02 UTC (rev 1236)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavRemoveNodeTest.java 2009-12-29
14:04:26 UTC (rev 1237)
@@ -18,6 +18,7 @@
import org.exoplatform.common.http.client.HTTPResponse;
import org.exoplatform.services.jcr.cluster.BaseClusteringFunctionalTest;
+import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
/**
* Created by The eXo Platform SAS.
@@ -31,41 +32,26 @@
{
public void testRemoveNode() throws Exception
{
+
// add test node
- connection1.addNode(nodeName, "".getBytes());
+ getConnection().addNode(nodeName, "".getBytes());
- // check is exist cluster-node1
- HTTPResponse response = connection1.getNode(nodeName);
- assertEquals(200, response.getStatusCode());
- //cluster-node2
- response = connection2.getNode(nodeName);
- assertEquals(200, response.getStatusCode());
- //cluster-node3
- response = connection3.getNode(nodeName);
- assertEquals(200, response.getStatusCode());
- //cluster-node4
- response = connection4.getNode(nodeName);
- assertEquals(200, response.getStatusCode());
+ // check is exist
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ HTTPResponse response = connection.getNode(nodeName);
+ assertEquals(200, response.getStatusCode());
+ }
- // remove node on cluster-node2
- connection2.removeNode(nodeName);
+ // remove node
+
+ getConnection().removeNode(nodeName);
- // check cluster-node1
- response = connection1.getNode(nodeName);
- assertEquals(404, response.getStatusCode());
-
- // cluster-node2
- response = connection2.getNode(nodeName);
- assertEquals(404, response.getStatusCode());
-
- // cluster-node3
- response = connection3.getNode(nodeName);
- assertEquals(404, response.getStatusCode());
-
- // cluster-node4
- response = connection4.getNode(nodeName);
- assertEquals(404, response.getStatusCode());
-
+ // check
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ HTTPResponse response = connection.getNode(nodeName);
+ assertEquals(404, response.getStatusCode());
+ }
}
-
}
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavRemovePropertyTest.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavRemovePropertyTest.java
(rev 0)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavRemovePropertyTest.java 2009-12-29
14:04:26 UTC (rev 1237)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2003-2009 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.jcr.cluster.functional;
+
+import org.exoplatform.services.jcr.cluster.BaseClusteringFunctionalTest;
+import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 2009
+ *
+ * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex
Reshetnyak</a>
+ * @version $Id$
+ */
+public class WebdavRemovePropertyTest
+ extends BaseClusteringFunctionalTest
+{
+ public void testRemoveProperty() throws Exception
+ {
+ JCRWebdavConnection conn = getConnection();
+
+ // prepare
+ conn.addNode(nodeName, "nt:untstructured", "".getBytes());
+ conn.setProperty(nodeName, "D:testProp", "the_value");
+
+ //check
+
+
+ //remove
+ conn.removeProperty(nodeName, "D:testProp");
+
+ //check
+
+ }
+}
Property changes on:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavRemovePropertyTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavSetPropertyTest.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavSetPropertyTest.java
(rev 0)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavSetPropertyTest.java 2009-12-29
14:04:26 UTC (rev 1237)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2003-2009 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.jcr.cluster.functional;
+
+import org.exoplatform.services.jcr.cluster.BaseClusteringFunctionalTest;
+import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 2009
+ *
+ * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex
Reshetnyak</a>
+ * @version $Id$
+ */
+public class WebdavSetPropertyTest
+ extends BaseClusteringFunctionalTest
+{
+ public void testSetProperty() throws Exception
+ {
+ JCRWebdavConnection conn = getConnection();
+
+ // prepare
+ conn.addNode(nodeName, "nt:untstructured", "".getBytes());
+ conn.addProperty(nodeName, "D:testProp");
+
+ // check
+
+
+ // set property
+ conn.setProperty(nodeName, "D:testProp", "testValue");
+
+
+ // check
+ }
+}
Property changes on:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavSetPropertyTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavVersionTest.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavVersionTest.java
(rev 0)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavVersionTest.java 2009-12-29
14:04:26 UTC (rev 1237)
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2003-2009 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.jcr.cluster.functional;
+
+import org.exoplatform.common.http.client.HTTPResponse;
+import org.exoplatform.services.jcr.cluster.BaseClusteringFunctionalTest;
+import org.exoplatform.services.jcr.cluster.JCRWebdavConnection;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 2009
+ *
+ * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex
Reshetnyak</a>
+ * @version $Id$
+ */
+public class WebdavVersionTest
+ extends BaseClusteringFunctionalTest
+{
+ public void testVersioning() throws Exception
+ {
+ JCRWebdavConnection conn = getConnection();
+
+ conn.addNode(nodeName, "v1".getBytes());
+
+ conn.addVersionControl(nodeName);
+
+ conn.checkIn(nodeName);
+ conn.checkOut(nodeName);
+
+ // check
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ HTTPResponse response = connection.getNode(nodeName);
+ assertEquals(200, response.getStatusCode());
+ assertTrue("v1".equals(new String(response.getData())));
+ }
+
+ conn.checkIn(nodeName);
+ conn.addNode(nodeName, "v2".getBytes());
+ conn.checkOut(nodeName);
+
+ // check
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ HTTPResponse response = connection.getNode(nodeName);
+ assertEquals(200, response.getStatusCode());
+ assertTrue("v2".equals(new String(response.getData())));
+ }
+
+ // restore
+ conn.restore(nodeName, "1");
+
+ //check
+ for (JCRWebdavConnection connection : getConnections())
+ {
+ HTTPResponse response = connection.getNode(nodeName);
+ assertEquals(200, response.getStatusCode());
+ assertTrue("v1".equals(new String(response.getData())));
+ }
+ }
+}
Property changes on:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/WebdavVersionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native