exo-jcr SVN: r4731 - ws/branches/2.1.x/patch/2.1.10-GA/WS-269.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-08-10 04:16:58 -0400 (Wed, 10 Aug 2011)
New Revision: 4731
Added:
ws/branches/2.1.x/patch/2.1.10-GA/WS-269/WS-269.patch
Removed:
ws/branches/2.1.x/patch/2.1.10-GA/WS-269/JCR-1656-ws.patch
Log:
WS-269 : Name of file with patch was changed WS-269.patch
Deleted: ws/branches/2.1.x/patch/2.1.10-GA/WS-269/JCR-1656-ws.patch
===================================================================
--- ws/branches/2.1.x/patch/2.1.10-GA/WS-269/JCR-1656-ws.patch 2011-08-10 08:01:55 UTC (rev 4730)
+++ ws/branches/2.1.x/patch/2.1.10-GA/WS-269/JCR-1656-ws.patch 2011-08-10 08:16:58 UTC (rev 4731)
@@ -1,12 +0,0 @@
-Index: exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
-===================================================================
---- exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java (revision 4722)
-+++ exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java (working copy)
-@@ -192,7 +192,6 @@
- // try to get rid of any unencoded passwords in memory
-
- answer = null;
-- System.gc();
-
- // Done
-
Added: ws/branches/2.1.x/patch/2.1.10-GA/WS-269/WS-269.patch
===================================================================
--- ws/branches/2.1.x/patch/2.1.10-GA/WS-269/WS-269.patch (rev 0)
+++ ws/branches/2.1.x/patch/2.1.10-GA/WS-269/WS-269.patch 2011-08-10 08:16:58 UTC (rev 4731)
@@ -0,0 +1,12 @@
+Index: exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
+===================================================================
+--- exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java (revision 4722)
++++ exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java (working copy)
+@@ -192,7 +192,6 @@
+ // try to get rid of any unencoded passwords in memory
+
+ answer = null;
+- System.gc();
+
+ // Done
+
12 years, 10 months
exo-jcr SVN: r4730 - in ws/branches/2.1.x/patch/2.1.10-GA: WS-269 and 1 other directory.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-08-10 04:01:55 -0400 (Wed, 10 Aug 2011)
New Revision: 4730
Added:
ws/branches/2.1.x/patch/2.1.10-GA/WS-269/
ws/branches/2.1.x/patch/2.1.10-GA/WS-269/JCR-1656-ws.patch
Log:
WS-269 : Patch for remove all explicit calls System.gc() was committed.
Added: ws/branches/2.1.x/patch/2.1.10-GA/WS-269/JCR-1656-ws.patch
===================================================================
--- ws/branches/2.1.x/patch/2.1.10-GA/WS-269/JCR-1656-ws.patch (rev 0)
+++ ws/branches/2.1.x/patch/2.1.10-GA/WS-269/JCR-1656-ws.patch 2011-08-10 08:01:55 UTC (rev 4730)
@@ -0,0 +1,12 @@
+Index: exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
+===================================================================
+--- exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java (revision 4722)
++++ exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java (working copy)
+@@ -192,7 +192,6 @@
+ // try to get rid of any unencoded passwords in memory
+
+ answer = null;
+- System.gc();
+
+ // Done
+
12 years, 10 months
exo-jcr SVN: r4729 - ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-08-10 04:00:37 -0400 (Wed, 10 Aug 2011)
New Revision: 4729
Modified:
ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
Log:
WS-269 : Remove all explicit calls System.gc()
Modified: ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
===================================================================
--- ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java 2011-08-10 07:57:05 UTC (rev 4728)
+++ ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java 2011-08-10 08:00:37 UTC (rev 4729)
@@ -198,7 +198,6 @@
// try to get rid of any unencoded passwords in memory
answer = null;
- System.gc();
// Done
12 years, 10 months
exo-jcr SVN: r4728 - ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-08-10 03:57:05 -0400 (Wed, 10 Aug 2011)
New Revision: 4728
Modified:
ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
Log:
EXOJCR-1476 : Changes in WS project was reverted. This changes wil be committed in issue WS-269
Modified: ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
===================================================================
--- ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java 2011-08-09 15:05:43 UTC (rev 4727)
+++ ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java 2011-08-10 07:57:05 UTC (rev 4728)
@@ -198,6 +198,7 @@
// try to get rid of any unencoded passwords in memory
answer = null;
+ System.gc();
// Done
12 years, 10 months
exo-jcr SVN: r4727 - jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-08-09 11:05:43 -0400 (Tue, 09 Aug 2011)
New Revision: 4727
Modified:
jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656.patch
Log:
JCR-1656 : Patch JCR-1656.patch was updated.
Modified: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656.patch 2011-08-09 14:58:57 UTC (rev 4726)
+++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656.patch 2011-08-09 15:05:43 UTC (rev 4727)
@@ -2,7 +2,15 @@
===================================================================
--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionItemPool.java (revision 4711)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionItemPool.java (working copy)
-@@ -47,7 +47,6 @@
+@@ -34,6 +34,7 @@
+ * @author <a href="mailto:geaz@users.sourceforge.net">Gennady Azarenkov</a>
+ * @version $Id: SessionItemPool.java 11907 2008-03-13 15:36:21Z ksm $
+ */
++@Deprecated
+ final class SessionItemPool
+ {
+
+@@ -47,7 +48,6 @@
void remove(String identifier)
{
items.remove(identifier);
12 years, 10 months
exo-jcr SVN: r4726 - jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-08-09 10:58:57 -0400 (Tue, 09 Aug 2011)
New Revision: 4726
Removed:
jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656-ws.patch
Log:
JCR-1656 : Patch JCR-1656-ws.patch with changes of project WS was removed. This changes will be commited in separate issue.
Deleted: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656-ws.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656-ws.patch 2011-08-09 14:38:58 UTC (rev 4725)
+++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656-ws.patch 2011-08-09 14:58:57 UTC (rev 4726)
@@ -1,12 +0,0 @@
-Index: exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
-===================================================================
---- exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java (revision 4722)
-+++ exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java (working copy)
-@@ -192,7 +192,6 @@
- // try to get rid of any unencoded passwords in memory
-
- answer = null;
-- System.gc();
-
- // Done
-
12 years, 10 months
exo-jcr SVN: r4725 - in jcr/branches/1.12.x/patch/1.12.10-GA: JCR-1656 and 1 other directory.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-08-09 10:38:58 -0400 (Tue, 09 Aug 2011)
New Revision: 4725
Added:
jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/
jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656-ws.patch
jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656.patch
Log:
JCR-1656 : Patch to remove all calls Sysstem.gc() was attached. Changes for JCR is contains in patch JCR-1656.patch. Changes for WS is contains in patch JCR-1656-ws.patch
Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656-ws.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656-ws.patch (rev 0)
+++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656-ws.patch 2011-08-09 14:38:58 UTC (rev 4725)
@@ -0,0 +1,12 @@
+Index: exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
+===================================================================
+--- exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java (revision 4722)
++++ exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java (working copy)
+@@ -192,7 +192,6 @@
+ // try to get rid of any unencoded passwords in memory
+
+ answer = null;
+- System.gc();
+
+ // Done
+
Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656.patch (rev 0)
+++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1656/JCR-1656.patch 2011-08-09 14:38:58 UTC (rev 4725)
@@ -0,0 +1,12 @@
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionItemPool.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionItemPool.java (revision 4711)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionItemPool.java (working copy)
+@@ -47,7 +47,6 @@
+ void remove(String identifier)
+ {
+ items.remove(identifier);
+- System.gc();
+ }
+
+ void put(ItemImpl item)
12 years, 10 months
exo-jcr SVN: r4724 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-08-09 10:30:01 -0400 (Tue, 09 Aug 2011)
New Revision: 4724
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionItemPool.java
Log:
EXOJCR-1476 : SessionItemPool was removed. Only in SessionItemPool was calles System.gc().
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionItemPool.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionItemPool.java 2011-08-09 14:29:28 UTC (rev 4723)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionItemPool.java 2011-08-09 14:30:01 UTC (rev 4724)
@@ -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.dataflow.session;
-
-import org.exoplatform.services.jcr.datamodel.QPath;
-import org.exoplatform.services.jcr.impl.core.ItemImpl;
-import org.exoplatform.services.jcr.impl.core.NodeImpl;
-import org.exoplatform.services.jcr.impl.core.PropertyImpl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.WeakHashMap;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * @author <a href="mailto:geaz@users.sourceforge.net">Gennady Azarenkov</a>
- * @version $Id: SessionItemPool.java 11907 2008-03-13 15:36:21Z ksm $
- */
-final class SessionItemPool
-{
-
- private WeakHashMap<String, ItemImpl> items;
-
- SessionItemPool()
- {
- items = new WeakHashMap<String, ItemImpl>();
- }
-
- void remove(String identifier)
- {
- items.remove(identifier);
- System.gc();
- }
-
- void put(ItemImpl item)
- {
- if (!items.containsKey(item.getInternalIdentifier()))
- items.put(item.getInternalIdentifier(), item);
- }
-
- ItemImpl get(String identifier)
- {
- return items.get(identifier);
- }
-
- ItemImpl get(QPath path)
- {
- for (Iterator<ItemImpl> i = items.values().iterator(); i.hasNext();)
- {
- ItemImpl item = i.next();
- if (item.getInternalPath().equals(path))
- return item;
- }
- return null;
- }
-
- List<NodeImpl> getChildNodes(String parentIdentifier)
- {
- List<NodeImpl> children = new ArrayList<NodeImpl>();
- for (Iterator<ItemImpl> i = items.values().iterator(); i.hasNext();)
- {
- ItemImpl item = i.next();
- if (item.getParentIdentifier().equals(parentIdentifier) && item.isNode())
- children.add((NodeImpl)item);
- }
- return children;
- }
-
- List<PropertyImpl> getChildProperties(String parentIdentifier)
- {
- List<PropertyImpl> children = new ArrayList<PropertyImpl>();
- for (Iterator<ItemImpl> i = items.values().iterator(); i.hasNext();)
- {
- ItemImpl item = i.next();
- if (item.getParentIdentifier().equals(parentIdentifier) && item.isNode())
- children.add((PropertyImpl)item);
- }
- return children;
- }
-
-}
12 years, 10 months
exo-jcr SVN: r4723 - ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-08-09 10:29:28 -0400 (Tue, 09 Aug 2011)
New Revision: 4723
Modified:
ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
Log:
EXOJCR-1476 : Remove all calls System.gc().
Modified: ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java
===================================================================
--- ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java 2011-08-09 14:09:17 UTC (rev 4722)
+++ ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/DefaultAuthHandler.java 2011-08-09 14:29:28 UTC (rev 4723)
@@ -198,7 +198,6 @@
// try to get rid of any unencoded passwords in memory
answer = null;
- System.gc();
// Done
12 years, 10 months
exo-jcr SVN: r4722 - in jcr/trunk/exo.jcr.component.webdav/src: test/java/org/exoplatform/services/jcr/webdav/command and 1 other directories.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-08-09 10:09:17 -0400 (Tue, 09 Aug 2011)
New Revision: 4722
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java
jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java
jcr/trunk/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml
Log:
EXOJCR-1457: fixed empty multi-valued property processing for PROPFIND requests
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java 2011-08-09 14:08:31 UTC (rev 4721)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/FileResource.java 2011-08-09 14:09:17 UTC (rev 4722)
@@ -329,7 +329,18 @@
String propertyValue;
if (property.getDefinition().isMultiple())
{
- propertyValue = property.getValues()[0].getString();
+ if (property.getValues().length >= 1)
+ {
+ propertyValue = property.getValues()[0].getString();
+ }
+ else
+ {
+ // this means that we return empty value, because according to WebDAV spec:
+ // this is a property whose semantics and syntax are not enforced by the server
+ // the server only records the value of a dead property;
+ // the client is responsible for maintaining the consistency of the syntax and semantics of a dead property.
+ propertyValue = "";
+ }
}
else
{
@@ -337,7 +348,6 @@
}
return new HierarchicalProperty(name, propertyValue);
}
-
}
}
Modified: jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java 2011-08-09 14:08:31 UTC (rev 4721)
+++ jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command/TestPropFind.java 2011-08-09 14:09:17 UTC (rev 4722)
@@ -61,23 +61,33 @@
protected Node testPropFind;
- private final String author = "eXoPlatform";
+ private final static String AUTHOR = "eXoPlatform";
+
+ private final static String WEBDAV_AUTHOR_PROPERTY = "webdav:Author";
+
+ private final static String WEBDAV_NT_FILE = "webdav:file";
+
+ private final static String WEBDAV_NT_RESOURCE = "exo:testResource";
- private final String authorProp = "webdav:Author";
+ private final static String WEBDAV_TEST_PROPERTY = "webdav:test-property";
- private final String nt_webdave_file = "webdav:file";
+ private final static String CONTENT_TYPE = "text/xml";
- private final String USER_ROOT = "root";
+ private final static String USER_ROOT = "root";
- private final String USER_JOHN = "john";
+ private final static String USER_JOHN = "john";
- private final String BASE_URI = "http://localhost";
+ private final static String BASE_URI = "http://localhost";
private String propFindXML =
"<?xml version=\"1.0\" encoding=\"utf-8\" ?><D:propfind xmlns:D=\"DAV:\">"
+ "<D:prop xmlns:webdav=\"http://www.exoplatform.org/jcr/webdav\">"
+ "<webdav:Author/><webdav:author/><webdave:DingALing/></D:prop></D:propfind>";
+ private String multiPropFindXML = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><D:propfind xmlns:D=\"DAV:\">"
+ + "<D:prop xmlns:webdav=\"http://www.exoplatform.org/jcr/webdav\">" + "<" + WEBDAV_TEST_PROPERTY
+ + "/></D:prop></D:propfind>";
+
private String propnameXML =
"<?xml version=\"1.0\" encoding=\"utf-8\" ?><propfind xmlns=\"DAV:\"><propname/></propfind>";
@@ -121,7 +131,7 @@
{
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
ContainerResponse containerResponseFind = service(WebDAVMethods.PROPFIND, getPathWS() + file, "", null, null);
assertEquals(HTTPStatus.MULTISTATUS, containerResponseFind.getStatus());
}
@@ -140,8 +150,8 @@
String encodedfileName = "%e3%81%82%e3%81%84%e3%81%86%e3%81%88%e3%81%8a";
String decodedfileName = URLDecoder.decode(encodedfileName, "UTF-8");
String content = TestUtils.getFileContent();
- TestUtils.addContent(session, decodedfileName, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
- TestUtils.addNodeProperty(session, decodedfileName, authorProp, author);
+ TestUtils.addContent(session, decodedfileName, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
+ TestUtils.addNodeProperty(session, decodedfileName, WEBDAV_AUTHOR_PROPERTY, AUTHOR);
ContainerResponse response =
service(WebDAVMethods.PROPFIND, getPathWS() + "/" + encodedfileName, "", null, allPropsXML.getBytes());
@@ -166,8 +176,8 @@
{
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
- TestUtils.addNodeProperty(session, file, authorProp, author);
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
+ TestUtils.addNodeProperty(session, file, WEBDAV_AUTHOR_PROPERTY, AUTHOR);
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
headers.add(HttpHeaders.CONTENT_TYPE, "text/xml");
ContainerResponse responseFind =
@@ -177,16 +187,87 @@
PropFindResponseEntity entity = (PropFindResponseEntity)responseFind.getEntity();
entity.write(outputStream);
String find = outputStream.toString();
- assertTrue(find.contains(authorProp));
- assertTrue(find.contains(author));
+ assertTrue(find.contains(WEBDAV_AUTHOR_PROPERTY));
+ assertTrue(find.contains(AUTHOR));
}
+ /**
+ * Here we test WebDAV PROPFIND method implementation for correct response
+ * in case we are asking for a multi-valued property. It is expected
+ * to receive first value of a values list. That is basicly because WebDAV
+ * actually does not support multi-valued properties in the way JCR does,
+ * though it supports nested (hierarchical) properties.
+ * @throws Exception
+ */
+ public void testNonEmptyMultiPropFind() throws Exception
+ {
+ String content = TestUtils.getFileContent();
+ String file = TestUtils.getFileName();
+ String[] propValues =
+ new String[]{"No sacrifice is too great in the service of freedom.",
+ "Freedom is the right of all sentient beings."};
+
+ Node node =
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE,
+ WEBDAV_NT_RESOURCE, CONTENT_TYPE);
+
+ // set multi-valued property
+ node.getNode("jcr:content").setProperty(WEBDAV_TEST_PROPERTY, propValues);
+ session.save();
+
+ MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ headers.add(HttpHeaders.CONTENT_TYPE, CONTENT_TYPE);
+
+ ContainerResponse responseFind =
+ service(WebDAVMethods.PROPFIND, getPathWS() + file, "", headers, multiPropFindXML.getBytes());
+ assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus());
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ PropFindResponseEntity entity = (PropFindResponseEntity)responseFind.getEntity();
+ entity.write(outputStream);
+ String find = outputStream.toString();
+ assertTrue("Response should contain requested property element.", find.contains(WEBDAV_TEST_PROPERTY));
+ assertTrue("Property element should contain value data.",
+ find.contains("No sacrifice is too great in the service of freedom."));
+ }
+
+ /**
+ * Here we test WebDAV PROPFIND method implementation for correct response
+ * in case we are asking for an empty multi-valued property. It is expected
+ * to receive an empty value in response xml representation as it is 'dead'
+ * property and it is not a server responsibility to support its consistency.
+ * @throws Exception
+ */
+ public void testEmptyMultiPropFind() throws Exception
+ {
+ String content = TestUtils.getFileContent();
+ String file = TestUtils.getFileName();
+
+ Node node =
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE,
+ WEBDAV_NT_RESOURCE, CONTENT_TYPE);
+ // set empty multi-valued property
+ node.getNode("jcr:content").setProperty(WEBDAV_TEST_PROPERTY, new String[]{});
+ session.save();
+
+ MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ headers.add(HttpHeaders.CONTENT_TYPE, CONTENT_TYPE);
+
+ ContainerResponse responseFind =
+ service(WebDAVMethods.PROPFIND, getPathWS() + file, "", headers, multiPropFindXML.getBytes());
+ assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus());
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ PropFindResponseEntity entity = (PropFindResponseEntity)responseFind.getEntity();
+ entity.write(outputStream);
+ String find = outputStream.toString();
+ assertTrue("Response should contain requested property element.", find.contains(WEBDAV_TEST_PROPERTY));
+ }
+
public void testPropNames() throws Exception
{
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
- TestUtils.addNodeProperty(session, file, authorProp, author);
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
+ TestUtils.addNodeProperty(session, file, WEBDAV_AUTHOR_PROPERTY, AUTHOR);
ContainerResponse responseFind =
service(WebDAVMethods.PROPFIND, getPathWS() + file, "", null, propnameXML.getBytes());
assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus());
@@ -194,7 +275,7 @@
PropFindResponseEntity entity = (PropFindResponseEntity)responseFind.getEntity();
entity.write(outputStream);
String find = outputStream.toString();
- assertTrue(find.contains(authorProp));
+ assertTrue(find.contains(WEBDAV_AUTHOR_PROPERTY));
assertTrue(find.contains("D:getlastmodified"));
assertFalse(find.contains("jcr:lockOwner"));
assertFalse(find.contains("D:lockdiscovery"));
@@ -204,8 +285,8 @@
{
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
- TestUtils.addNodeProperty(session, file, authorProp, author);
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
+ TestUtils.addNodeProperty(session, file, WEBDAV_AUTHOR_PROPERTY, AUTHOR);
ContainerResponse responseFind =
service(WebDAVMethods.PROPFIND, getPathWS() + file, "", null, allPropsXML.getBytes());
assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus());
@@ -214,8 +295,8 @@
entity.write(outputStream);
String find = outputStream.toString();
assertTrue(find.contains("D:getlastmodified"));
- assertTrue(find.contains(authorProp));
- assertTrue(find.contains(author));
+ assertTrue(find.contains(WEBDAV_AUTHOR_PROPERTY));
+ assertTrue(find.contains(AUTHOR));
}
public void testAllPropsWithInclusion() throws Exception
@@ -224,7 +305,7 @@
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
Node node =
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
node.addMixin("mix:lockable");
node.save();
@@ -282,9 +363,9 @@
{
String content = TestUtils.getFileContent();
String file = TestUtils.getFileName();
- TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), nt_webdave_file, "");
+ TestUtils.addContent(session, file, new ByteArrayInputStream(content.getBytes()), WEBDAV_NT_FILE, "");
String authorValue = "bla % bla";
- TestUtils.addNodeProperty(session, file, authorProp, authorValue);
+ TestUtils.addNodeProperty(session, file, WEBDAV_AUTHOR_PROPERTY, authorValue);
ContainerResponse responseFind =
service(WebDAVMethods.PROPFIND, getPathWS() + file, "", null, allPropsXML.getBytes());
assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus());
@@ -293,7 +374,7 @@
entity.write(outputStream);
String find = outputStream.toString();
assertTrue(find.contains("D:getlastmodified"));
- assertTrue(find.contains(authorProp));
+ assertTrue(find.contains(WEBDAV_AUTHOR_PROPERTY));
assertTrue(find.contains(authorValue));
}
Modified: jcr/trunk/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml 2011-08-09 14:08:31 UTC (rev 4721)
+++ jcr/trunk/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml 2011-08-09 14:09:17 UTC (rev 4722)
@@ -113,6 +113,18 @@
<supertype>nt:unstructured</supertype>
</supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false"
+
+ multiple="false">
+ <valueConstraints />
+ </propertyDefinition>
+ <propertyDefinition name="webdav:test-property" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false"
+ multiple="true">
+ <valueConstraints />
+ </propertyDefinition>
+ </propertyDefinitions>
+
</nodeType>
<nodeType name="exo:testContentResource" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
12 years, 10 months