pnever 2003/03/24 10:02:36
Modified: 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
proposals/wvcm/test/junit/src/org/apache/webdav
test.properties
Added: proposals/wvcm/test/junit/src/org/apache/webdav/resources
expandpropReportResponse.xml
expandpropReportResponse_SUPPORT.xml
Removed: proposals/wvcm/test/junit/src/org/apache/wvcm
test.properties
proposals/wvcm/test/junit/src/org/apache/wvcm/resources
expandpropReportResponse.xml test.xml
Log:
Next portion for wvcm testsuite
Revision Changes Path
1.2 +47 -7
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractTest.java 13 Mar 2003 14:59:37 -0000 1.1
+++ AbstractTest.java 24 Mar 2003 18:02:34 -0000 1.2
@@ -87,9 +87,16 @@
protected String host = null;
protected int port = 0;
protected String context = null;
+ protected String rootfolder = null;
+ protected String realm = null;
protected String username = null;
protected String password = null;
+
protected HttpClient client = null;
+
+ // caches
+ private String contextPath = null;
+ private String rootFolderPath = null;
/**
@@ -105,9 +112,12 @@
catch (NumberFormatException e) {
port = 8080;
}
- context = webdavprops.getProperty( "org.apache.webdav.test.context",
"webdav" );
- username = webdavprops.getProperty( "org.apache.webdav.test.username",
"guest" );
- password = webdavprops.getProperty( "org.apache.webdav.test.password",
"guest" );
+ context = webdavprops.getProperty( "org.apache.webdav.test.context",
"slide" );
+ rootfolder = webdavprops.getProperty( "org.apache.webdav.test.rootfolder",
"files" );
+ realm = webdavprops.getProperty( "org.apache.webdav.test.realm", null );
+ username = webdavprops.getProperty( "org.apache.webdav.test.username",
"root" );
+ password = webdavprops.getProperty( "org.apache.webdav.test.password",
"root" );
+
client = new HttpClient();
client.getHostConfiguration().setHost(host, port, "http");
HttpState state = new HttpState();
@@ -142,5 +152,35 @@
HttpMethod method = new HeadMethod( resourcePath );
client.executeMethod( method );
return( method.getStatusCode() == 200 );
+ }
+
+ /**
+ * Get context path
+ *
+ * @return a String
+ */
+ protected synchronized String contextPath() {
+ if( contextPath == null ) {
+ if( context != null && context.length() > 0 )
+ contextPath = "/"+context;
+ else
+ contextPath = "/";
+ }
+ return contextPath;
+ }
+
+ /**
+ * Get rootfolder path
+ *
+ * @return a String
+ */
+ protected synchronized String rootFolderPath() {
+ if( rootFolderPath == null ) {
+ if( rootfolder != null && rootfolder.length() > 0 )
+ rootFolderPath = contextPath()+"/"+rootfolder;
+ else
+ rootFolderPath = contextPath();
+ }
+ return rootFolderPath;
}
}
1.2 +5 -5
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PropfindMethodTest.java 13 Mar 2003 14:59:37 -0000 1.1
+++ PropfindMethodTest.java 24 Mar 2003 18:02:34 -0000 1.2
@@ -85,7 +85,7 @@
*/
public PropfindMethodTest(String testName) {
super(testName);
- resourcePath = "/"+context+"/test.xml";
+ resourcePath = rootFolderPath()+"/test.xml";
}
/**
1.2 +6 -6
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PutMethodTest.java 13 Mar 2003 14:59:37 -0000 1.1
+++ PutMethodTest.java 24 Mar 2003 18:02:34 -0000 1.2
@@ -81,7 +81,7 @@
*/
public PutMethodTest(String testName) {
super(testName);
- resourcePath = "/"+context+"/test.xml";
+ resourcePath = rootFolderPath()+"/test.xml";
}
/**
@@ -138,7 +138,7 @@
getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml")
);
client.executeMethod( method );
assertEquals( 201, method.getStatusCode() );
-
+
method = new PutMethod( resourcePath );
method.setRequestBody(
getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml")
);
1.2 +5 -5
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ReportMethodTest.java 13 Mar 2003 14:59:37 -0000 1.1
+++ ReportMethodTest.java 24 Mar 2003 18:02:34 -0000 1.2
@@ -86,7 +86,7 @@
*/
public ReportMethodTest(String testName) {
super(testName);
- resourcePath = "/"+context+"/test.xml";
+ resourcePath = rootFolderPath()+"/test.xml";
}
/**
1.2 +5 -5
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- VersionControlMethodTest.java 13 Mar 2003 14:59:37 -0000 1.1
+++ VersionControlMethodTest.java 24 Mar 2003 18:02:34 -0000 1.2
@@ -81,7 +81,7 @@
*/
public VersionControlMethodTest(String testName) {
super(testName);
- resourcePath = "/"+context+"/test.xml";
+ resourcePath = rootFolderPath()+"/test.xml";
}
/**
1.2 +6 -31
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractTest.java 13 Mar 2003 14:59:39 -0000 1.1
+++ AbstractTest.java 24 Mar 2003 18:02:35 -0000 1.2
@@ -76,20 +76,7 @@
* @version $Revision$
*/
public abstract class AbstractTest extends org.apache.webdav.methods.AbstractTest {
-
- protected static Properties wvcmprops = new Properties();
- static {
- try {
- wvcmprops.load(
AbstractTest.class.getResourceAsStream("/org/apache/wvcm/test.properties") );
- } catch (java.io.IOException e) {}
- }
-
- protected String host = null;
- protected int port = 0;
- protected String username = null;
- protected String password = null;
- protected String realm = null;
- protected String context = null;
+
protected ProviderFactory.Callback callback = null;
protected Provider provider = null;
@@ -99,25 +86,13 @@
*/
public AbstractTest(String testName) throws Exception {
super(testName);
-
- host = wvcmprops.getProperty( "org.apache.wvcm.test.host", "localhost" );
- String portStr = wvcmprops.getProperty( "org.apache.wvcm.test.port", "8080"
);
- try {
- port = Integer.parseInt(portStr);
- }
- catch (NumberFormatException e) {
- port = 8080;
- }
- username = wvcmprops.getProperty( "org.apache.wvcm.test.username", "guest"
);
- password = wvcmprops.getProperty( "org.apache.wvcm.test.password", "guest"
);
- realm = wvcmprops.getProperty( "org.apache.wvcm.test.realm", null );
- context = wvcmprops.getProperty( "org.apache.wvcm.test.context", "webdav" );
callback = new CallbackImpl();
Hashtable h = new Hashtable();
h.put( "host", host );
h.put( "port", String.valueOf(port) );
h.put( "realm", realm );
h.put( "context", context );
+ h.put( "rootfolder", rootfolder );
provider = ProviderFactory.createProvider(
"org.apache.wvcm.ProviderImpl", callback, h );
}
1.2 +6 -6
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ControllableResourceTest.java 13 Mar 2003 14:59:39 -0000 1.1
+++ ControllableResourceTest.java 24 Mar 2003 18:02:35 -0000 1.2
@@ -84,8 +84,8 @@
*/
public ControllableResourceTest(String testName) throws Exception {
super(testName);
- resourcePath = "/"+context+"/test.xml";
- folderPath = "/"+context+"/foo";
+ resourcePath = rootFolderPath()+"/test.xml";
+ folderPath = rootFolderPath()+"/foo";
resourceInFolderPath = folderPath+"/test.xml";
}
1.2 +114 -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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FolderTest.java 13 Mar 2003 14:59:39 -0000 1.1
+++ FolderTest.java 24 Mar 2003 18:02:35 -0000 1.2
@@ -66,6 +66,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import javax.wvcm.*;
+import java.util.*;
+import javax.wvcm.PropertyNameList.*;
/**
* Tests FolderImpl.
@@ -82,7 +84,7 @@
*/
public FolderTest(String testName) throws Exception {
super(testName);
- folderPath = "/"+context+"/foo";
+ folderPath = rootFolderPath()+"/foo";
}
/**
@@ -139,5 +141,112 @@
assertEquals( WvcmException.CANNOT_CREATE_RESOURCE_MUST_BE_NULL,
e.getReasonCode() );
}
}
+
+ public void testDoReadMemberList() throws Exception {
+ deleteResourceOnServer( folderPath );
+ // create the resources: /foo/, /foo/a.xml, /foo/bar/, /foo/bar/b.xml,
/foo/bar/c.xml
+ Location location = provider.location( folderPath );
+ Folder folder = location.folder();
+ folder.doCreateResource();
+ assertTrue( resourceExistsOnServer(folderPath) );
+ location = provider.location( folderPath+"/a.xml" );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ resource.doControl();
+ assertTrue( resourceExistsOnServer(folderPath+"/a.xml") );
+ location = provider.location( folderPath+"/bar" );
+ Folder subfolder = location.folder();
+ subfolder.doCreateResource();
+ assertTrue( resourceExistsOnServer(folderPath+"/bar") );
+ location = provider.location( folderPath+"/bar/b.xml" );
+ resource = location.controllableResource();
+ resource.doCreateResource();
+ resource.doControl();
+ assertTrue( resourceExistsOnServer(folderPath+"/bar/b.xml") );
+ location = provider.location( folderPath+"/bar/c.xml" );
+ resource = location.controllableResource();
+ resource.doCreateResource();
+ resource.doControl();
+ assertTrue( resourceExistsOnServer(folderPath+"/bar/c.xml") );
+
+ PropertyName[] vrPnames = {
+ PropertyName.DISPLAY_NAME,
+ PropertyName.VERSION_NAME
+ };
+ PropertyName[] pnames = {
+ PropertyName.DISPLAY_NAME,
+ new NestedPropertyName(
+ PropertyName.CHECKED_IN, new PropertyNameList(vrPnames) )
+ };
+ PropertyNameList wantedprops = new PropertyNameList( pnames );
+
+ Iterator boundMembers = folder.doReadMemberList( wantedprops, false );
+ while( boundMembers.hasNext() ) {
+ Resource r = (Resource)boundMembers.next();
+ System.out.println(r);
+ if( r instanceof Folder ) {
+ assertTrue("foo".equals(r.getDisplayName()) ||
"bar".equals(r.getDisplayName()));
+ }
+ else if( r instanceof ControllableResource ) {
+ ControllableResource cr = (ControllableResource)r;
+ assertEquals("a.xml", cr.getDisplayName());
+ Version v = cr.getCheckedIn();
+ assertEquals("a.xml", v.getDisplayName());
+ assertEquals("1.0", v.getVersionName());
+ }
+ }
+
+ Iterator allMembers = folder.doReadMemberList( wantedprops, true );
+ while( allMembers.hasNext() ) {
+ Resource r = (Resource)allMembers.next();
+ System.out.println(r);
+ }
+
+ location = provider.location( rootFolderPath() );
+ Folder rootFolder = location.folder();
+ Iterator allMembersOfRoot = rootFolder.doReadMemberList( wantedprops, true
);
+ while( allMembersOfRoot.hasNext() ) {
+ Resource r = (Resource)allMembersOfRoot.next();
+ System.out.println(r);
+ }
+ }
+
+ public void testDoReadMemberListProperOnly() throws Exception {
+ deleteResourceOnServer( folderPath );
+ // create the resources: /foo/, /foo/a.xml, /foo/bar/, /foo/bar/b.xml,
/foo/bar/c.xml
+ Location location = provider.location( folderPath );
+ Folder folder = location.folder();
+ folder.doCreateResource();
+ assertTrue( resourceExistsOnServer(folderPath) );
+ location = provider.location( folderPath+"/a.xml" );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ resource.doControl();
+ assertTrue( resourceExistsOnServer(folderPath+"/a.xml") );
+ location = provider.location( folderPath+"/bar" );
+ Folder subfolder = location.folder();
+ subfolder.doCreateResource();
+ assertTrue( resourceExistsOnServer(folderPath+"/bar") );
+ location = provider.location( folderPath+"/bar/b.xml" );
+ resource = location.controllableResource();
+ resource.doCreateResource();
+ resource.doControl();
+ assertTrue( resourceExistsOnServer(folderPath+"/bar/b.xml") );
+ location = provider.location( folderPath+"/bar/c.xml" );
+ resource = location.controllableResource();
+ resource.doCreateResource();
+ resource.doControl();
+ assertTrue( resourceExistsOnServer(folderPath+"/bar/c.xml") );
+
+ String locStr = folder.location().string();
+ Iterator members = folder.doReadMemberList( null, true );
+ while( members.hasNext() ) {
+ Resource r = (Resource)members.next();
+ if( locStr.equals(r.location().string()) )
+ continue;
+ System.out.println(r);
+ }
+ }
}
+
1.2 +5 -5
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ProviderTest.java 13 Mar 2003 14:59:39 -0000 1.1
+++ ProviderTest.java 24 Mar 2003 18:02:35 -0000 1.2
@@ -83,7 +83,7 @@
*/
public ProviderTest(String testName) throws Exception {
super(testName);
- resourcePath = "/"+context+"/test.xml";
+ resourcePath = rootFolderPath()+"/test.xml";
}
/**
1.2 +97 -6
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ResourceTest.java 13 Mar 2003 14:59:39 -0000 1.1
+++ ResourceTest.java 24 Mar 2003 18:02:35 -0000 1.2
@@ -68,6 +68,7 @@
import javax.wvcm.*;
import javax.wvcm.PropertyNameList.*;
import java.util.*;
+import java.io.*;
/**
* Tests ResourceImpl.
@@ -84,7 +85,7 @@
*/
public ResourceTest(String testName) throws Exception {
super(testName);
- resourcePath = "/"+context+"/test.xml";
+ resourcePath = rootFolderPath()+"/test.xml";
}
/**
@@ -119,14 +120,36 @@
protected void tearDown() throws Exception {
}
+ public void testDoDelete() throws Exception {
+ deleteResourceOnServer( resourcePath );
+ Location location = provider.location( resourcePath );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ assertTrue( resourceExistsOnServer(resourcePath) );
+ resource.doDelete();
+ assertFalse( resourceExistsOnServer(resourcePath) );
+ }
+
public void testDoWriteContent() 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/wvcm/resources/test.xml"),
cid );
+
getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), cid );
+ }
+
+ public void testDoReadPropertiesWithNullList() throws Exception {
+ deleteResourceOnServer( resourcePath );
+ Location location = provider.location( resourcePath );
+ ControllableResource resource = location.controllableResource();
+ resource.doCreateResource();
+ PropertyNameList wantedprops = null;
+ Resource r = resource.doReadProperties(wantedprops);
}
public void testDoReadProperties() throws Exception {
@@ -165,7 +188,75 @@
Version v = (Version)vl.get(0);
assertEquals( "test.xml", v.getDisplayName() );
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 );
+ 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();
+
+ PropertyName[] vrPnames = {
+ PropertyName.DISPLAY_NAME,
+ PropertyName.VERSION_NAME
+ };
+ PropertyName[] vhrPnames = {
+ PropertyName.DISPLAY_NAME,
+ new NestedPropertyName(
+ PropertyName.VERSION_LIST, new PropertyNameList(vrPnames) )
+ };
+ PropertyName[] pnames = {
+ PropertyName.DISPLAY_NAME,
+ PropertyName.CONTENT_IDENTIFIER,
+ new NestedPropertyName(
+ PropertyName.VERSION_HISTORY, new PropertyNameList(vhrPnames) )
+ };
+ wantedprops = new PropertyNameList( pnames );
+
+ ByteArrayOutputStream content = new ByteArrayOutputStream();
+ Resource r = resource.doReadContent(wantedprops, content);
+
+ assertTrue( "Expecting ControllableResource but got "+r, r instanceof
ControllableResource );
+ ControllableResource r2 = (ControllableResource)r;
+ assertEquals( "test.xml", r2.getDisplayName() );
+ VersionHistory vh = r2.getVersionHistory();
+ assertNotNull( vh );
+ System.out.println("vh.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() );
+ System.out.println("Content was: "+content.toString());
}
public void testDoReadPropertiesAndDetermineType() throws Exception {
1.3 +9 -7
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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WorkspaceTest.java 13 Mar 2003 15:31:21 -0000 1.2
+++ WorkspaceTest.java 24 Mar 2003 18:02:35 -0000 1.3
@@ -77,12 +77,14 @@
public class WorkspaceTest extends AbstractTest {
private String workspacePath = null;
+ private String invalidWorkspacePath = null;
/**
* Default cosntructor
*/
public WorkspaceTest(String testName) throws Exception {
super(testName);
+ this.invalidWorkspacePath = rootFolderPath()+"/foo";
}
/**
@@ -149,15 +151,15 @@
}
public void testPreWorkspaceLocationAllowed() throws Exception {
- deleteResourceOnServer( "/"+context+"/foo" );
- Location location = provider.location( "/"+context+"/foo" );
+ deleteResourceOnServer( invalidWorkspacePath );
+ Location location = provider.location( invalidWorkspacePath );
Workspace workspace = location.workspace();
try {
workspace.doCreateResource();
assertTrue( "Exception expected", false );
}
catch (WvcmException e) {
- assertEquals( WvcmException.CANNOT_CREATE_WORKSPACE_AT_LOCATION,
e.getReasonCode() );
+ assertEquals( WvcmException.CANNOT_CREATE_RESOURCE_AT_LOCATION,
e.getReasonCode() );
}
}
}
1.1
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/resources/expandpropReportResponse.xml
Index: expandpropReportResponse.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>/taminowebdavserver/mycoll/test.xml</D:href>
<D:propstat>
<D:prop>
<D:displayname>test.xml</D:displayname>
<D:version-history>
<D:response>
<D:href>/taminowebdavserver/history/mycoll/8</D:href>
<D:propstat>
<D:prop>
<D:displayname>8</D:displayname>
<D:version-set>
<D:response>
<D:href>/taminowebdavserver/history/mycoll/8/1.0</D:href>
<D:propstat>
<D:prop>
<D:displayname>test.xml</D:displayname>
<D:version-name>1.0</D:version-name>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:version-set>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:version-history>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>
1.1
jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/resources/expandpropReportResponse_SUPPORT.xml
Index: expandpropReportResponse_SUPPORT.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>/taminowebdavserver/content/administration</D:href>
<D:propstat>
<D:prop>
<D:resourcetype>
<D:collection />
</D:resourcetype>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
<D:propstat>
<D:prop>
<D:version-controlled-binding-set />
<D:baseline-collection />
<D:version-name />
<D:workspace-checkout-set />
<D:baseline-controlled-collection />
</D:prop>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>/taminowebdavserver/content/administration/test.txt</D:href>
<D:propstat>
<D:prop>
<D:resourcetype />
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
<D:propstat>
<D:prop>
<D:version-controlled-binding-set />
<D:baseline-collection />
<D:version-name />
<D:workspace-checkout-set />
<D:baseline-controlled-collection />
</D:prop>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>/taminowebdavserver/content/administration/myfile.txt</D:href>
<D:propstat>
<D:prop>
<D:resourcetype />
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
<D:propstat>
<D:prop>
<D:version-controlled-binding-set />
<D:baseline-collection />
<D:version-name />
<D:workspace-checkout-set />
<D:baseline-controlled-collection />
</D:prop>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>/taminowebdavserver/content/administration/test.doc</D:href>
<D:propstat>
<D:prop>
<D:resourcetype />
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
<D:propstat>
<D:prop>
<D:version-controlled-binding-set />
<D:baseline-collection />
<D:version-name />
<D:workspace-checkout-set />
<D:baseline-controlled-collection />
</D:prop>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:propstat>
</D:response>
<D:response>
<D:href>/taminowebdavserver/content/administration/filter</D:href>
<D:propstat>
<D:prop>
<D:resourcetype>
<D:collection />
</D:resourcetype>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
<D:propstat>
<D:prop>
<D:version-controlled-binding-set />
<D:baseline-collection />
<D:version-name />
<D:workspace-checkout-set />
<D:baseline-controlled-collection />
</D:prop>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:propstat>
</D:response>
</D:multistatus>
1.2 +17 -6
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MultistatusResponseTest.java 13 Mar 2003 14:59:39 -0000 1.1
+++ MultistatusResponseTest.java 24 Mar 2003 18:02:35 -0000 1.2
@@ -125,7 +125,7 @@
Location l = provider.location( resourcePath );
ControllableResource r = l.controllableResource();
MultistatusResponse mr = new MultistatusResponse(
- r,
getClass().getResourceAsStream("/org/apache/wvcm/resources/expandpropReportResponse.xml")
);
+ r,
getClass().getResourceAsStream("/org/apache/webdav/resources/expandpropReportResponse.xml")
);
List proxies = mr.createResourceProxies();
assertNotNull( proxies );
assertEquals( 1, proxies.size() );
@@ -140,7 +140,18 @@
Version v = (Version)vl.get(0);
assertEquals( "test.xml", v.getDisplayName() );
assertEquals( "1.0", v.getVersionName() );
-
+ }
+
+ public void testCreateResourceProxies_SUPPORT() throws Exception {
+ Location l = provider.location( resourcePath );
+ ControllableResource r = l.controllableResource();
+ MultistatusResponse mr = new MultistatusResponse(
+ r,
getClass().getResourceAsStream("/org/apache/webdav/resources/expandpropReportResponse_SUPPORT.xml")
);
+ List proxies = mr.createResourceProxies();
+ assertNotNull( proxies );
+ Iterator proxiesIt = proxies.iterator();
+ while( proxiesIt.hasNext() )
+ System.out.println(proxiesIt.next());
}
}
1.2 +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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
1.3 +3 -1
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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- test.properties 13 Mar 2003 15:31:07 -0000 1.2
+++ test.properties 24 Mar 2003 18:02:36 -0000 1.3
@@ -2,5 +2,7 @@
org.apache.webdav.test.port=8080
org.apache.webdav.test.username=root
org.apache.webdav.test.password=root
-org.apache.webdav.test.context=slide/files
+org.apache.webdav.test.context=slide
+org.apache.webdav.test.rootfolder=files
+org.apache.webdav.test.realm=Slide DAV Server
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]