You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/06/05 22:32:03 UTC
incubator-usergrid git commit: Adds mark tests to graph
Repository: incubator-usergrid
Updated Branches:
refs/heads/USERGRID-688 62525861c -> f9f853429
Adds mark tests to graph
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/f9f85342
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/f9f85342
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/f9f85342
Branch: refs/heads/USERGRID-688
Commit: f9f8534294dfe4bc2edbf2be02ba71fa31075e33
Parents: 6252586
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Jun 5 14:31:55 2015 -0600
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Jun 5 14:31:55 2015 -0600
----------------------------------------------------------------------
.../persistence/graph/GraphManagerIT.java | 56 +++++++++++++++++++-
1 file changed, 54 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f9f85342/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerIT.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerIT.java
index e512608..be37edc 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerIT.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerIT.java
@@ -1169,7 +1169,7 @@ public class GraphManagerIT {
gm.deleteEdge( edge2 ).toBlocking().lastOrDefault( null );
edges = gm.loadEdgesFromSource(
- createSearchByEdgeUnfiltered( edge1.getSourceNode(), edge1.getType(), maxVersion, null ) );
+ createSearchByEdgeUnfiltered( edge1.getSourceNode(), edge1.getType(), maxVersion, null ) );
results = edges.toBlocking().getIterator();
@@ -1714,6 +1714,14 @@ public class GraphManagerIT {
assertFalse( "No more edges", results.hasNext() );
+ //read filtered, should not be returned
+ results =
+ gm.loadEdgesFromSource( createSearchByEdge( sourceId, edge1.getType(), maxVersion, null ) ).toBlocking()
+ .getIterator();
+
+ assertFalse( "No more edges", results.hasNext() );
+
+
results = gm.loadEdgesFromSourceByType(
createSearchByEdgeAndIdUnfiltered( sourceId, edge1.getType(), maxVersion, targetId1.getType(), null ) )
.toBlocking().getIterator();
@@ -1723,6 +1731,16 @@ public class GraphManagerIT {
assertFalse( "No more edges", results.hasNext() );
+ //read filtered, should not be returned.
+
+ results = gm.loadEdgesFromSourceByType(
+ createSearchByEdgeAndId( sourceId, edge1.getType(), maxVersion, targetId1.getType(), null ) ).toBlocking()
+ .getIterator();
+
+
+ assertFalse( "No more edges", results.hasNext() );
+
+
results = gm.loadEdgesFromSourceByType(
createSearchByEdgeAndIdUnfiltered( sourceId, edge2.getType(), maxVersion, targetId2.getType(), null ) )
.toBlocking().getIterator();
@@ -1732,9 +1750,16 @@ public class GraphManagerIT {
assertFalse( "No more edges", results.hasNext() );
- //now delete them
+ //read filtered, should not be returned
+ results = gm.loadEdgesFromSourceByType(
+ createSearchByEdgeAndId( sourceId, edge2.getType(), maxVersion, targetId2.getType(), null ) ).toBlocking()
+ .getIterator();
+
+
+ assertFalse( "No more edges", results.hasNext() );
+ //now delete them
gm.compactNode( sourceId ).toBlocking().last();
results = gm.loadEdgesFromSource( createSearchByEdgeUnfiltered( sourceId, edge1.getType(), maxVersion, null ) )
@@ -1832,6 +1857,15 @@ public class GraphManagerIT {
assertFalse( "No more edges", results.hasNext() );
+ //now test they come back when unfiltered
+
+ results = gm.loadEdgesToTarget( createSearchByEdge( targetId, edge1.getType(), maxVersion, null ) ).toBlocking()
+ .getIterator();
+
+
+ assertFalse( "No more edges", results.hasNext() );
+
+
//get our 2 edges
results = gm.loadEdgesToTargetByType(
createSearchByEdgeAndIdUnfiltered( targetId, edge1.getType(), maxVersion, sourceId1.getType(), null ) )
@@ -1842,6 +1876,15 @@ public class GraphManagerIT {
assertFalse( "No more edges", results.hasNext() );
+
+ //search filtered
+ results = gm.loadEdgesToTargetByType(
+ createSearchByEdgeAndId( targetId, edge1.getType(), maxVersion, sourceId1.getType(), null ) ).toBlocking()
+ .getIterator();
+
+
+ assertFalse( "No more edges", results.hasNext() );
+
//now delete one of the edges
results = gm.loadEdgesToTargetByType(
createSearchByEdgeAndIdUnfiltered( targetId, edge2.getType(), maxVersion, sourceId2.getType(), null ) )
@@ -1852,6 +1895,15 @@ public class GraphManagerIT {
assertFalse( "No more edges", results.hasNext() );
+
+ //search filtered
+ results = gm.loadEdgesToTargetByType(
+ createSearchByEdgeAndId( targetId, edge2.getType(), maxVersion, sourceId2.getType(), null ) ).toBlocking()
+ .getIterator();
+
+
+ assertFalse( "No more edges", results.hasNext() );
+
//now compact, everything should be removed
gm.compactNode( targetId ).toBlocking().last();