You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by dc...@apache.org on 2009/10/13 19:23:51 UTC
svn commit: r824849 - in
/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test:
custom/ spec/
Author: dcaruana
Date: Tue Oct 13 17:23:50 2009
New Revision: 824849
URL: http://svn.apache.org/viewvc?rev=824849&view=rev
Log:
Addition of Move tests to AtomPub TCK (CMIS-88)
Fix validation of responses - validator now based on returned content type rather than explicitly defined.
Modified:
incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/custom/CMISCustomTypeTest.java
incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/AllowableActionsTest.java
incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RepositoryServiceTest.java
incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/UpdateTest.java
incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/VersionsTest.java
Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/custom/CMISCustomTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/custom/CMISCustomTypeTest.java?rev=824849&r1=824848&r2=824849&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/custom/CMISCustomTypeTest.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/custom/CMISCustomTypeTest.java Tue Oct 13 17:23:50 2009
@@ -111,7 +111,7 @@
String guid = System.currentTimeMillis() + "";
updateFile = updateFile.replace("${NAME}", guid);
Response res = client.executeRequest(new PatchRequest(document.getSelfLink().getHref().toString(), updateFile,
- CMISConstants.MIMETYPE_ENTRY), 200, client.getAtomValidator());
+ CMISConstants.MIMETYPE_ENTRY), 200);
assertNotNull(res);
Entry updated = model.parseEntry(new StringReader(res.getContentAsString()), null);
@@ -150,7 +150,7 @@
String guid = System.currentTimeMillis() + "";
updateFile = updateFile.replace("${NAME}", guid);
Response res = client.executeRequest(new PutRequest(document.getSelfLink().getHref().toString(), updateFile,
- CMISConstants.MIMETYPE_ENTRY), 200, client.getAtomValidator());
+ CMISConstants.MIMETYPE_ENTRY), 200);
assertNotNull(res);
Entry updated = model.parseEntry(new StringReader(res.getContentAsString()), null);
@@ -182,8 +182,7 @@
// create document for delete
Entry document = client.createDocument(childrenLink.getHref(), "testDeleteCustomDocument",
"/org/apache/chemistry/tck/atompub/test/createcustomdocument.atomentry.xml");
- Response documentRes = client.executeRequest(new GetRequest(document.getSelfLink().getHref().toString()), 200,
- client.getAtomValidator());
+ Response documentRes = client.executeRequest(new GetRequest(document.getSelfLink().getHref().toString()), 200);
assertNotNull(documentRes);
// ensure document has been created
Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/AllowableActionsTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/AllowableActionsTest.java?rev=824849&r1=824848&r2=824849&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/AllowableActionsTest.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/AllowableActionsTest.java Tue Oct 13 17:23:50 2009
@@ -47,7 +47,7 @@
Link allowableActionsLink = folder.getLink(CMISConstants.REL_ALLOWABLE_ACTIONS);
Request req = new GetRequest(allowableActionsLink.getHref().toString());
- Response allowableActionsRes = client.executeRequest(req, 200, client.getAtomValidator());
+ Response allowableActionsRes = client.executeRequest(req, 200);
Assert.assertNotNull(allowableActionsRes);
Element allowableActions = model.parse(new StringReader(allowableActionsRes.getContentAsString()), null);
Assert.assertNotNull(allowableActions);
@@ -75,7 +75,7 @@
Link allowableActionsLink = document.getLink(CMISConstants.REL_ALLOWABLE_ACTIONS);
Request req = new GetRequest(allowableActionsLink.getHref().toString());
- Response allowableActionsRes = client.executeRequest(req, 200, client.getAtomValidator());
+ Response allowableActionsRes = client.executeRequest(req, 200);
Assert.assertNotNull(allowableActionsRes);
Element allowableActions = model.parse(new StringReader(allowableActionsRes.getContentAsString()), null);
Assert.assertNotNull(allowableActions);
@@ -119,7 +119,7 @@
// retrieve allowable actions from link
Link allowableActionsLink = child.getLink(CMISConstants.REL_ALLOWABLE_ACTIONS);
Request req = new GetRequest(allowableActionsLink.getHref().toString());
- Response allowableActionsRes = client.executeRequest(req, 200, client.getAtomValidator());
+ Response allowableActionsRes = client.executeRequest(req, 200);
Assert.assertNotNull(allowableActionsRes);
Element allowableActions = model.parse(new StringReader(allowableActionsRes.getContentAsString()), null);
Assert.assertNotNull(allowableActions);
Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RepositoryServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RepositoryServiceTest.java?rev=824849&r1=824848&r2=824849&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RepositoryServiceTest.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RepositoryServiceTest.java Tue Oct 13 17:23:50 2009
@@ -36,7 +36,7 @@
public void testGetRootCollection() throws Exception {
IRI rootHREF = client.getRootCollection(client.getWorkspace());
- client.executeRequest(new GetRequest(rootHREF.toString()), 200, client.getAtomValidator());
+ client.executeRequest(new GetRequest(rootHREF.toString()), 200);
}
}
Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/UpdateTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/UpdateTest.java?rev=824849&r1=824848&r2=824849&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/UpdateTest.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/UpdateTest.java Tue Oct 13 17:23:50 2009
@@ -56,7 +56,7 @@
String guid = System.currentTimeMillis() + "";
updateFile = updateFile.replace("${NAME}", guid);
Request patchReq = new PatchRequest(document.getSelfLink().getHref().toString(), updateFile, CMISConstants.MIMETYPE_ENTRY);
- Response res = client.executeRequest(patchReq, 200, client.getAtomValidator());
+ Response res = client.executeRequest(patchReq, 200);
Assert.assertNotNull(res);
Entry updated = model.parseEntry(new StringReader(res.getContentAsString()), null);
@@ -90,7 +90,7 @@
updateFile = updateFile.replace("${NAME}", guid);
updateFile = updateFile.replace("${CMISCONTENT}", new String(Base64.encodeBase64(("updated content " + guid).getBytes())));
Request putReq = new PutRequest(document.getSelfLink().getHref().toString(), updateFile, CMISConstants.MIMETYPE_ENTRY);
- Response res = client.executeRequest(putReq, 200, client.getAtomValidator());
+ Response res = client.executeRequest(putReq, 200);
Assert.assertNotNull(res);
Entry updated = model.parseEntry(new StringReader(res.getContentAsString()), null);
@@ -123,7 +123,7 @@
String guid = System.currentTimeMillis() + "";
updateFile = updateFile.replace("${NAME}", guid);
Request putReq = new PutRequest(document.getSelfLink().getHref().toString(), updateFile, CMISConstants.MIMETYPE_ENTRY);
- Response res = client.executeRequest(putReq, 200, client.getAtomValidator());
+ Response res = client.executeRequest(putReq, 200);
Assert.assertNotNull(res);
Entry updated = model.parseEntry(new StringReader(res.getContentAsString()), null);
@@ -148,7 +148,7 @@
// put document
Request putReq = new PutRequest(document.getSelfLink().getHref().toString(), writer.toString(), CMISConstants.MIMETYPE_ENTRY);
- Response res = client.executeRequest(putReq, 200, client.getAtomValidator());
+ Response res = client.executeRequest(putReq, 200);
Assert.assertNotNull(res);
Entry updated = model.parseEntry(new StringReader(res.getContentAsString()), null);
Assert.assertEquals(updatedTitle, updated.getTitle());
Modified: incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/VersionsTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/VersionsTest.java?rev=824849&r1=824848&r2=824849&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/VersionsTest.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/VersionsTest.java Tue Oct 13 17:23:50 2009
@@ -83,7 +83,7 @@
Entry document = fixture.createTestDocument("testCheckout");
CMISObject docObject = document.getExtension(CMISConstants.OBJECT);
Request documentReq = new GetRequest(document.getSelfLink().getHref().toString());
- Response documentRes = client.executeRequest(documentReq, 200, client.getAtomValidator());
+ Response documentRes = client.executeRequest(documentReq, 200);
Assert.assertNotNull(documentRes);
String documentXML = documentRes.getContentAsString();
Assert.assertNotNull(documentXML);
@@ -91,7 +91,7 @@
// checkout
IRI checkedoutHREF = client.getCheckedOutCollection(client.getWorkspace());
Request checkoutReq = new PostRequest(checkedoutHREF.toString(), documentXML, CMISConstants.MIMETYPE_ENTRY);
- Response pwcRes = client.executeRequest(checkoutReq, 201, client.getAtomValidator());
+ Response pwcRes = client.executeRequest(checkoutReq, 201);
Assert.assertNotNull(pwcRes);
String pwcXml = pwcRes.getContentAsString();
Assert.assertNotNull(pwcXml);
@@ -132,7 +132,7 @@
// create document for checkout
Entry document = fixture.createTestDocument("testCancelCheckout");
Request documentReq = new GetRequest(document.getSelfLink().getHref().toString());
- Response documentRes = client.executeRequest(documentReq, 200, client.getAtomValidator());
+ Response documentRes = client.executeRequest(documentReq, 200);
Assert.assertNotNull(documentRes);
String xml = documentRes.getContentAsString();
Assert.assertNotNull(xml);
@@ -140,7 +140,7 @@
// checkout
IRI checkedoutHREF = client.getCheckedOutCollection(client.getWorkspace());
Request checkoutReq = new PostRequest(checkedoutHREF.toString(), xml, CMISConstants.MIMETYPE_ENTRY);
- Response pwcRes = client.executeRequest(checkoutReq, 201, client.getAtomValidator());
+ Response pwcRes = client.executeRequest(checkoutReq, 201);
Assert.assertNotNull(pwcRes);
String pwcXml = pwcRes.getContentAsString();
@@ -170,7 +170,7 @@
// create document for checkout
Entry document = fixture.createTestDocument("testCheckin");
Request documentReq = new GetRequest(document.getSelfLink().getHref().toString());
- Response documentRes = client.executeRequest(documentReq, 200, client.getAtomValidator());
+ Response documentRes = client.executeRequest(documentReq, 200);
Assert.assertNotNull(documentRes);
String xml = documentRes.getContentAsString();
Assert.assertNotNull(xml);
@@ -178,7 +178,7 @@
// checkout
IRI checkedoutHREF = client.getCheckedOutCollection(client.getWorkspace());
Request checkoutReq = new PostRequest(checkedoutHREF.toString(), xml, CMISConstants.MIMETYPE_ENTRY);
- Response pwcRes = client.executeRequest(checkoutReq, 201, client.getAtomValidator());
+ Response pwcRes = client.executeRequest(checkoutReq, 201);
Assert.assertNotNull(pwcRes);
Entry pwc = model.parseEntry(new StringReader(pwcRes.getContentAsString()), null);
Assert.assertNotNull(pwc);
@@ -211,7 +211,7 @@
String guid = System.currentTimeMillis() + "";
updateFile = updateFile.replace("${NAME}", guid);
Request updateReq = new PatchRequest(pwc.getEditLink().getHref().toString(), updateFile, CMISConstants.MIMETYPE_ENTRY);
- Response pwcUpdatedres = client.executeRequest(updateReq, 200, client.getAtomValidator());
+ Response pwcUpdatedres = client.executeRequest(updateReq, 200);
Assert.assertNotNull(pwcUpdatedres);
Entry updated = model.parseEntry(new StringReader(pwcUpdatedres.getContentAsString()), null);
// ensure update occurred
@@ -229,7 +229,7 @@
args2.put("checkinComment", guid);
args2.put("checkin", "true");
Request checkinReq = new PatchRequest(checkinUrl, checkinFile, CMISConstants.MIMETYPE_ENTRY).setArgs(args2);
- Response checkinRes = client.executeRequest(checkinReq, 200, client.getAtomValidator());
+ Response checkinRes = client.executeRequest(checkinReq, 200);
Assert.assertNotNull(checkinRes);
String checkinResXML = checkinRes.getContentAsString();
@@ -263,7 +263,7 @@
// create document for checkout
Entry document = fixture.createTestDocument("testUpdateOnCheckIn");
Request documentReq = new GetRequest(document.getSelfLink().getHref().toString());
- Response documentRes = client.executeRequest(documentReq, 200, client.getAtomValidator());
+ Response documentRes = client.executeRequest(documentReq, 200);
Assert.assertNotNull(documentRes);
String xml = documentRes.getContentAsString();
Assert.assertNotNull(xml);
@@ -271,7 +271,7 @@
// checkout
IRI checkedoutHREF = client.getCheckedOutCollection(client.getWorkspace());
Request checkoutReq = new PostRequest(checkedoutHREF.toString(), xml, CMISConstants.MIMETYPE_ENTRY);
- Response pwcRes = client.executeRequest(checkoutReq, 201, client.getAtomValidator());
+ Response pwcRes = client.executeRequest(checkoutReq, 201);
Assert.assertNotNull(pwcRes);
Entry pwc = model.parseEntry(new StringReader(pwcRes.getContentAsString()), null);
Assert.assertNotNull(pwc);
@@ -297,7 +297,7 @@
args2.put("checkinComment", guid);
args2.put("checkin", "true");
Request checkinReq = new PatchRequest(checkinUrl, checkinFile, CMISConstants.MIMETYPE_ENTRY).setArgs(args2);
- Response checkinRes = client.executeRequest(checkinReq, 200, client.getAtomValidator());
+ Response checkinRes = client.executeRequest(checkinReq, 200);
Assert.assertNotNull(checkinRes);
String checkinResXML = checkinRes.getContentAsString();
@@ -323,7 +323,7 @@
// create document for checkout
Entry document = fixture.createTestDocument("testGetAllVersions");
Request documentReq = new GetRequest(document.getSelfLink().getHref().toString());
- Response documentRes = client.executeRequest(documentReq, 200, client.getAtomValidator());
+ Response documentRes = client.executeRequest(documentReq, 200);
Assert.assertNotNull(documentRes);
String xml = documentRes.getContentAsString();
Assert.assertNotNull(xml);
@@ -332,7 +332,7 @@
for (int i = 0; i < NUMBER_OF_VERSIONS; i++) {
// checkout
Request checkoutReq = new PostRequest(checkedoutHREF.toString(), xml, CMISConstants.MIMETYPE_ENTRY);
- Response pwcRes = client.executeRequest(checkoutReq, 201, client.getAtomValidator());
+ Response pwcRes = client.executeRequest(checkoutReq, 201);
Assert.assertNotNull(pwcRes);
Entry pwc = model.parseEntry(new StringReader(pwcRes.getContentAsString()), null);
Assert.assertNotNull(pwc);
@@ -345,7 +345,7 @@
args2.put("checkinComment", "checkin" + i);
args2.put("checkin", "true");
Request checkinReq = new PutRequest(checkinUrl, checkinFile, CMISConstants.MIMETYPE_ENTRY).setArgs(args2);
- Response checkinRes = client.executeRequest(checkinReq, 200, client.getAtomValidator());
+ Response checkinRes = client.executeRequest(checkinReq, 200);
Assert.assertNotNull(checkinRes);
// use result of checkin (i.e. document returned), for next checkout