Author: tolusha
Date: 2010-08-25 10:44:46 -0400 (Wed, 25 Aug 2010)
New Revision: 2989
Modified:
jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/ext/TestCaching.java
Log:
EXOJCR-879: test fixed
Modified:
jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/ext/TestCaching.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/ext/TestCaching.java 2010-08-25
14:39:42 UTC (rev 2988)
+++
jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/ext/TestCaching.java 2010-08-25
14:44:46 UTC (rev 2989)
@@ -63,39 +63,39 @@
{
Node contentNode = node.getNode("jcr:content");
Property lastModifiedProperty =
contentNode.getProperty("jcr:lastModified");
-
+
SimpleDateFormat dateFormat = new
SimpleDateFormat(WebDavConst.DateFormat.IF_MODIFIED_SINCE_PATTERN, Locale.US);
Calendar lastModifiedDate = lastModifiedProperty.getDate();
- lastModifiedDate.roll(Calendar.SECOND, -10);
+ lastModifiedDate.add(Calendar.SECOND, -10);
// Rollback If-Modified-Since 10 seconds earlier.
String ifModifiedDate = dateFormat.format(lastModifiedDate.getTime());
-
+
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
headers.add(ExtHttpHeaders.IF_MODIFIED_SINCE, ifModifiedDate);
ContainerResponse response = service(WebDAVMethods.GET, getPathWS() + path,
"", headers, null);
-
+
assertEquals(HTTPStatus.OK, response.getStatus());
}
-
+
public void testIfModifiedSince() throws Exception
{
Node contentNode = node.getNode("jcr:content");
Property lastModifiedProperty =
contentNode.getProperty("jcr:lastModified");
-
+
SimpleDateFormat dateFormat = new
SimpleDateFormat(WebDavConst.DateFormat.IF_MODIFIED_SINCE_PATTERN, Locale.US);
Calendar lastModifiedDate = lastModifiedProperty.getDate();
-
+
lastModifiedDate.add(Calendar.WEEK_OF_MONTH, 1);
String ifModifiedDate = dateFormat.format(lastModifiedDate.getTime());
-
+
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
headers.add(ExtHttpHeaders.IF_MODIFIED_SINCE, ifModifiedDate);
ContainerResponse response = service(WebDAVMethods.GET, getPathWS() + path,
"", headers, null);
-
+
assertEquals(HTTPStatus.NOT_MODIFIED, response.getStatus());
}
-
+
public void testCacheConf() throws Exception
{
ArrayList<CacheControlType> testValues = new
ArrayList<CacheControlType>();
Show replies by date