Author: dcaruana
Date: Fri Mar 19 17:30:26 2010
New Revision: 925346
URL: http://svn.apache.org/viewvc?rev=925346&view=rev
Log:
Extend Relationships test in AtomPub TCK.
- test get relationships with both relationshipType and
includeSubRelationshipTypes arguments
Modified:
incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RelationshipsTest.java
Modified:
incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RelationshipsTest.java
URL:
http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RelationshipsTest.java?rev=925346&r1=925345&r2=925346&view=diff
==============================================================================
---
incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RelationshipsTest.java
(original)
+++
incubator/chemistry/trunk/chemistry/chemistry-tck-atompub/src/main/java/org/apache/chemistry/tck/atompub/test/spec/RelationshipsTest.java
Fri Mar 19 17:30:26 2010
@@ -142,7 +142,14 @@ public class RelationshipsTest extends T
// retrieve relationships feed on source
Link relsLink = source.getLink(CMISConstants.REL_RELATIONSHIPS);
assertNotNull(relsLink);
-
+
+ // retrieve all relationships
+ Map<String, String> args = new HashMap<String, String>();
+ args.put("includeSubRelationshipTypes", "true");
+ Feed relsBeforeCreate = client.getFeed(relsLink.getHref(), args);
+ assertNotNull(relsBeforeCreate);
+ assertEquals(0, relsBeforeCreate.getEntries().size());
+
// create relationship between source and target documents
CMISObject sourceObject = source.getExtension(CMISConstants.OBJECT);
assertNotNull(sourceObject);
@@ -155,6 +162,12 @@ public class RelationshipsTest extends T
Entry rel = client.createRelationship(relsLink.getHref(),
options.getRelationshipType(), sourceId, targetId);
assertNotNull(rel);
+ // retrieve all relationships
+ args.put("relationshipType", options.getRelationshipType());
+ Feed relsAfterCreate = client.getFeed(relsLink.getHref(), args);
+ assertNotNull(relsAfterCreate);
+ assertEquals(1, relsAfterCreate.getEntries().size());
+
// get created relationship
Entry relEntry = client.getEntry(rel.getSelfLink().getHref());
CMISObject relEntryObject = rel.getExtension(CMISConstants.OBJECT);