usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [15/50] [abbrv] git commit: Added two tests proving issue 3011. The tests create a connection between two objects and tries to delete the entities associated with the connection without disbanding the connection.
Date Thu, 30 Jan 2014 01:20:55 GMT
Added two tests proving issue 3011. The tests create a connection between two objects and tries
to delete the entities associated with the connection without disbanding the connection.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4a28f6bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4a28f6bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4a28f6bc

Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 4a28f6bcd79c0ecebdddde04568fcda5b0f6b6f6
Parents: 79a34a2
Author: GERey <greyes@apigee.com>
Authored: Wed Jan 15 13:05:44 2014 -0800
Committer: GERey <greyes@apigee.com>
Committed: Wed Jan 15 13:05:44 2014 -0800

----------------------------------------------------------------------
 .../users/ConnectionResourceTest.java           | 23 +++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4a28f6bc/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
b/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
index a9495c4..7850b68 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
@@ -207,8 +207,29 @@ public class ConnectionResourceTest extends AbstractRestIT {
 
         JsonNode response = things.entity( "thing2" ).delete();
 
-        assertNull (things.entity( thing1Id).connection("likes").entity( thing2Id).get());
+        JsonNode node = things.entity ( "thing2" ).get();
 
+        assertNull(node);
+
+    }
+
+    @Test //USERGRID-3011
+    public void connectionsDeleteFirstEntityInConnectionTest() {
+
+        CustomCollection things = context.collection( "things" );
+
+        UUID thing1Id = getEntityId( things.create( hashMap( "name", "thing1" ) ), 0 );
+
+        UUID thing2Id = getEntityId( things.create( hashMap( "name", "thing2" ) ), 0 );
+
+        //create the connection
+        things.entity( thing1Id ).connection( "likes" ).entity( thing2Id ).post();
+
+        JsonNode response = things.entity( "thing1" ).delete();
+
+        JsonNode node = things.entity ( "thing1" ).get();
+
+        assertNull(node);
 
     }
 


Mime
View raw message