[prev in list] [next in list] [prev in thread] [next in thread]
List: slide-dev
Subject: cvs commit: jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav MultistatusResp
From: pnever () apache ! org
Date: 2003-03-26 16:22:46
[Download RAW message or body]
pnever 2003/03/26 08:22:46
Modified: proposals/wvcm/test/junit/src/org/apache/webdav
test.properties
proposals/wvcm/test/junit/src/org/apache/webdav/methods
AbstractTest.java PropfindMethodTest.java
PutMethodTest.java ReportMethodTest.java
VersionControlMethodTest.java
proposals/wvcm/test/junit/src/org/apache/wvcm
AbstractTest.java ControllableResourceTest.java
FolderTest.java ProviderTest.java ResourceTest.java
WorkspaceTest.java
proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav
MultistatusResponseTest.java ReportRequestTest.java
Added: proposals/wvcm/test/junit/src/org/apache/webdav/resources
test2.xml
Log:
More for WVCM
Revision Changes Path
1.4 +6 -6 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/test.properties
Index: test.properties
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/test.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- test.properties 24 Mar 2003 18:02:36 -0000 1.3
+++ test.properties 26 Mar 2003 16:22:44 -0000 1.4
@@ -1,8 +1,8 @@
org.apache.webdav.test.host=localhost
-org.apache.webdav.test.port=8080
-org.apache.webdav.test.username=root
-org.apache.webdav.test.password=root
-org.apache.webdav.test.context=slide
-org.apache.webdav.test.rootfolder=files
-org.apache.webdav.test.realm=Slide DAV Server
+org.apache.webdav.test.port=8888
+org.apache.webdav.test.username=davuser
+org.apache.webdav.test.password=davuser
+org.apache.webdav.test.context=taminowebdavserver
+org.apache.webdav.test.rootfolder=mycoll
+org.apache.webdav.test.realm=Tamino WebDAV Server
1.3 +0 -0 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/AbstractTest.java
Index: AbstractTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/AbstractTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/PropfindMethodTest.java
Index: PropfindMethodTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/PropfindMethodTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/PutMethodTest.java
Index: PutMethodTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/PutMethodTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/ReportMethodTest.java
Index: ReportMethodTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/ReportMethodTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/VersionControlMethodTest.java
Index: VersionControlMethodTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/VersionControlMethodTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.1 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/resources/test2.xml
Index: test2.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<test>Hello World!</test>
1.3 +0 -0 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/AbstractTest.java
Index: AbstractTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/AbstractTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +34 -0 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ControllableResourceTest.java
Index: ControllableResourceTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ControllableResourceTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ControllableResourceTest.java 24 Mar 2003 18:02:35 -0000 1.2
+++ ControllableResourceTest.java 26 Mar 2003 16:22:45 -0000 1.3
@@ -66,6 +66,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import javax.wvcm.*;
+import javax.wvcm.PropertyNameList.*;
/**
* Tests ControllableResourceImpl.
@@ -155,6 +156,39 @@
catch (WvcmException e) {
assertEquals( WvcmException.CANNOT_CREATE_RESOURCE_MUST_BE_NULL, \
e.getReasonCode() ); }
+ }
+
+ public void testDoCheckout() throws Exception {
+ deleteResourceOnServer( resourcePath );
+ Location location = provider.location( resourcePath );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ resource.doControl();
+ PropertyNameList wantedprops =
+ new PropertyNameList( new PropertyName[]{PropertyName.IS_CHECKED_OUT} \
); + resource = (ControllableResource)resource.doReadProperties( wantedprops \
); + assertFalse( resource.getIsCheckedOut() );
+ resource.doCheckout();
+ resource = (ControllableResource)resource.doReadProperties( wantedprops );
+ assertTrue( resource.getIsCheckedOut() );
+ }
+
+ public void testDoCheckin() throws Exception {
+ deleteResourceOnServer( resourcePath );
+ Location location = provider.location( resourcePath );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ resource.doControl();
+ PropertyNameList wantedprops =
+ new PropertyNameList( new PropertyName[]{PropertyName.IS_CHECKED_OUT} \
); + resource = (ControllableResource)resource.doReadProperties( wantedprops \
); + assertFalse( resource.getIsCheckedOut() );
+ resource.doCheckout();
+ resource = (ControllableResource)resource.doReadProperties( wantedprops );
+ assertTrue( resource.getIsCheckedOut() );
+ resource.doCheckin();
+ resource = (ControllableResource)resource.doReadProperties( wantedprops );
+ assertFalse( resource.getIsCheckedOut() );
}
}
1.3 +38 -5 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/FolderTest.java
Index: FolderTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/FolderTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FolderTest.java 24 Mar 2003 18:02:35 -0000 1.2
+++ FolderTest.java 26 Mar 2003 16:22:45 -0000 1.3
@@ -196,10 +196,43 @@
}
}
+ pnames = new PropertyName[]{
+ PropertyName.DISPLAY_NAME,
+ PropertyName.CONTENT_TYPE,
+ PropertyName.LAST_MODIFIED
+ };
+ wantedprops = new PropertyNameList( pnames );
Iterator allMembers = folder.doReadMemberList( wantedprops, true );
while( allMembers.hasNext() ) {
Resource r = (Resource)allMembers.next();
System.out.println(r);
+ System.out.print("- display-name: ");
+ try {
+ System.out.println(r.getDisplayName());
+ } catch (WvcmException e) {
+ if( e.getReasonCode() == WvcmException.VALUE_UNAVAILABLE )
+ System.out.println("<not available>");
+ else
+ throw e;
+ }
+ System.out.print("- content-type: ");
+ try {
+ System.out.println(r.getContentType());
+ } catch (WvcmException e) {
+ if( e.getReasonCode() == WvcmException.VALUE_UNAVAILABLE )
+ System.out.println("<not available>");
+ else
+ throw e;
+ }
+ System.out.print("- last-modified: ");
+ try {
+ System.out.println(r.getLastModified());
+ } catch (WvcmException e) {
+ if( e.getReasonCode() == WvcmException.VALUE_UNAVAILABLE )
+ System.out.println("<not available>");
+ else
+ throw e;
+ }
}
location = provider.location( rootFolderPath() );
@@ -243,7 +276,7 @@
while( members.hasNext() ) {
Resource r = (Resource)members.next();
if( locStr.equals(r.location().string()) )
- continue;
+ continue;
System.out.println(r);
}
}
1.3 +0 -0 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ProviderTest.java
Index: ProviderTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ProviderTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +134 -28 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ResourceTest.java
Index: ResourceTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ResourceTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ResourceTest.java 24 Mar 2003 18:02:35 -0000 1.2
+++ ResourceTest.java 26 Mar 2003 16:22:45 -0000 1.3
@@ -143,6 +143,32 @@
getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), \
cid ); }
+ public void testDoWriteContentWrongContentIdentifier() throws Exception {
+ deleteResourceOnServer( resourcePath );
+ Location location = provider.location( resourcePath );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ PropertyNameList wantedprops =
+ new PropertyNameList( new \
PropertyName[]{PropertyName.CONTENT_IDENTIFIER} ); + resource = \
(ControllableResource)resource.doReadProperties( wantedprops ); + String cid \
= resource.getContentIdentifier(); + resource.doWriteContent(
+ getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), \
cid ); + // should not update
+ resource.doWriteContent(
+ getClass().getResourceAsStream("/org/apache/webdav/resources/test2.xml"), \
"" ); +
+ ByteArrayOutputStream content = new ByteArrayOutputStream();
+ Resource r = resource.doReadContent(null, content);
+ assertTrue( "Expecting ControllableResource but got "+r, r instanceof \
ControllableResource ); + ControllableResource r2 = (ControllableResource)r;
+ String c = content.toString();
+ System.out.println("\nContent was: "+c);
+ assertTrue(
+ "This assertion failure my occur while the server does not yet process \
correctly the If: ([etag]) header", + c.indexOf("World!") < 0 );
+ }
+
public void testDoReadPropertiesWithNullList() throws Exception {
deleteResourceOnServer( resourcePath );
Location location = provider.location( resourcePath );
@@ -181,7 +207,7 @@
assertEquals( "test.xml", r2.getDisplayName() );
VersionHistory vh = r2.getVersionHistory();
assertNotNull( vh );
- System.out.println("vh.getDisplayName() = "+vh.getDisplayName());
+ System.out.println("\nvh.getDisplayName() = "+vh.getDisplayName());
List vl = vh.getVersionList();
assertNotNull( vl );
assertEquals( 1, vl.size() );
@@ -190,26 +216,6 @@
assertEquals( "1.0", v.getVersionName() );
}
- public void testDoReadPropertiesContentType() throws Exception {
- deleteResourceOnServer( resourcePath );
- Location location = provider.location( resourcePath );
- ControllableResource resource = location.controllableResource();
- resource.doCreateResource();
- PropertyNameList wantedprops =
- new PropertyNameList( new \
PropertyName[]{PropertyName.CONTENT_IDENTIFIER} );
- resource = (ControllableResource)resource.doReadProperties( wantedprops );
- String cid = resource.getContentIdentifier();
- resource.doWriteContent(
- getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), \
cid );
-
- wantedprops = new PropertyNameList( new \
PropertyName[]{PropertyName.CONTENT_TYPE} );
-
- Resource r = resource.doReadProperties(wantedprops);
- assertTrue( "Expecting ControllableResource but got "+r, r instanceof \
ControllableResource );
- ControllableResource r2 = (ControllableResource)r;
- System.out.println("r2.getContentType(): "+r2.getContentType());
- }
-
public void testDoReadContent() throws Exception {
deleteResourceOnServer( resourcePath );
Location location = provider.location( resourcePath );
@@ -248,7 +254,7 @@
assertEquals( "test.xml", r2.getDisplayName() );
VersionHistory vh = r2.getVersionHistory();
assertNotNull( vh );
- System.out.println("vh.getDisplayName() = "+vh.getDisplayName());
+ System.out.println("\nvh.getDisplayName() = "+vh.getDisplayName());
List vl = vh.getVersionList();
assertNotNull( vl );
assertEquals( 1, vl.size() );
@@ -256,7 +262,7 @@
assertEquals( "test.xml", v.getDisplayName() );
assertEquals( "1.0", v.getVersionName() );
- System.out.println("Content was: "+content.toString());
+ System.out.println("\nContent was: "+content.toString());
}
public void testDoReadPropertiesAndDetermineType() throws Exception {
@@ -289,14 +295,114 @@
assertEquals( "test.xml", r2.getDisplayName() );
VersionHistory vh = r2.getVersionHistory();
assertNotNull( vh );
- System.out.println("vh.getDisplayName() = "+vh.getDisplayName());
+ System.out.println("\nvh.getDisplayName() = "+vh.getDisplayName());
List vl = vh.getVersionList();
assertNotNull( vl );
assertEquals( 1, vl.size() );
Version v = (Version)vl.get(0);
assertEquals( "test.xml", v.getDisplayName() );
assertEquals( "1.0", v.getVersionName() );
+ }
+
+ public void testGetContentType() throws Exception {
+ deleteResourceOnServer( resourcePath );
+ Location location = provider.location( resourcePath );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ PropertyNameList wantedprops =
+ new PropertyNameList( new \
PropertyName[]{PropertyName.CONTENT_IDENTIFIER} ); + resource = \
(ControllableResource)resource.doReadProperties( wantedprops ); + String cid \
= resource.getContentIdentifier(); + resource.doWriteContent(
+ getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), \
cid ); +
+ wantedprops = new PropertyNameList( new \
PropertyName[]{PropertyName.CONTENT_TYPE} );
+ Resource r = resource.doReadProperties(wantedprops);
+ assertTrue( "Expecting ControllableResource but got "+r, r instanceof \
ControllableResource ); + ControllableResource r2 = (ControllableResource)r;
+ assertEquals( "text/xml", r2.getContentType() );
+ }
+
+ public void testGetCreatorDisplayName() throws Exception {
+ deleteResourceOnServer( resourcePath );
+ Location location = provider.location( resourcePath );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ PropertyNameList wantedprops =
+ new PropertyNameList( new \
PropertyName[]{PropertyName.CONTENT_IDENTIFIER} ); + resource = \
(ControllableResource)resource.doReadProperties( wantedprops ); + String cid \
= resource.getContentIdentifier(); + resource.doWriteContent(
+ getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), \
cid ); + resource.doControl();
+
+ wantedprops = new PropertyNameList( new \
PropertyName[]{PropertyName.CREATOR_DISPLAY_NAME} ); +
+ Resource r = resource.doReadProperties(wantedprops);
+ assertTrue( "Expecting ControllableResource but got "+r, r instanceof \
ControllableResource ); + ControllableResource r2 = (ControllableResource)r;
+ assertTrue(r2.getCreatorDisplayName().endsWith(username));
+ }
+
+ public void testGetCreationDate() throws Exception {
+ deleteResourceOnServer( resourcePath );
+ Location location = provider.location( resourcePath );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ PropertyNameList wantedprops =
+ new PropertyNameList( new \
PropertyName[]{PropertyName.CONTENT_IDENTIFIER} ); + resource = \
(ControllableResource)resource.doReadProperties( wantedprops ); + String cid \
= resource.getContentIdentifier(); + resource.doWriteContent(
+ getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), \
cid ); +
+ wantedprops = new PropertyNameList( new \
PropertyName[]{PropertyName.CREATION_DATE} ); +
+ Resource r = resource.doReadProperties(wantedprops);
+ assertTrue( "Expecting ControllableResource but got "+r, r instanceof \
ControllableResource ); + ControllableResource r2 = (ControllableResource)r;
+ System.out.println("\ncreation-date: "+r2.getCreationDate());
+ }
+
+ public void testGetLastModified() throws Exception {
+ deleteResourceOnServer( resourcePath );
+ Location location = provider.location( resourcePath );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ PropertyNameList wantedprops =
+ new PropertyNameList( new \
PropertyName[]{PropertyName.CONTENT_IDENTIFIER} ); + resource = \
(ControllableResource)resource.doReadProperties( wantedprops ); + String cid \
= resource.getContentIdentifier(); + resource.doWriteContent(
+ getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), \
cid ); +
+ wantedprops = new PropertyNameList( new \
PropertyName[]{PropertyName.LAST_MODIFIED} ); +
+ Resource r = resource.doReadProperties(wantedprops);
+ assertTrue( "Expecting ControllableResource but got "+r, r instanceof \
ControllableResource ); + ControllableResource r2 = (ControllableResource)r;
+ System.out.println("\nlast-modified: "+r2.getLastModified());
+ }
+
+ public void testGetContentLanguage() throws Exception {
+ deleteResourceOnServer( resourcePath );
+ Location location = provider.location( resourcePath );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ PropertyNameList wantedprops =
+ new PropertyNameList( new \
PropertyName[]{PropertyName.CONTENT_IDENTIFIER} ); + resource = \
(ControllableResource)resource.doReadProperties( wantedprops ); + String cid \
= resource.getContentIdentifier(); + resource.doWriteContent(
+ getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), \
cid ); +
+ wantedprops = new PropertyNameList( new \
PropertyName[]{PropertyName.CONTENT_LANGUAGE} ); +
+ Resource r = resource.doReadProperties(wantedprops);
+ assertTrue( "Expecting ControllableResource but got "+r, r instanceof \
ControllableResource ); + ControllableResource r2 = (ControllableResource)r;
+ System.out.println("\ncontent-language: "+r2.getContentLanguage());
}
}
1.4 +4 -4 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/WorkspaceTest.java
Index: WorkspaceTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/WorkspaceTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
1.3 +4 -4 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav/MultistatusResponseTest.java
Index: MultistatusResponseTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav/MultistatusResponseTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
1.3 +0 -0 \
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav/ReportRequestTest.java
Index: ReportRequestTest.java
===================================================================
RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav/ReportRequestTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic