usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [09/10] incubator-usergrid git commit: Fixes test that won't work when the system runs too quickly.
Date Fri, 20 Mar 2015 13:41:59 GMT
Fixes test that won't work when the system runs too quickly.


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

Branch: refs/heads/USERGRID-405
Commit: 6dc742e402bf75a8cf6bb0f2fa3ffc4c07367263
Parents: 5889a3b
Author: Todd Nine <tnine@apigee.com>
Authored: Fri Mar 20 07:30:55 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Fri Mar 20 07:30:55 2015 -0600

----------------------------------------------------------------------
 .../usergrid/persistence/graph/GraphManagerIT.java | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6dc742e4/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 ef5d69d..05b36fe 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
@@ -964,20 +964,25 @@ public abstract class GraphManagerIT {
         Id targetId2 = new SimpleId( "target2" );
 
 
-        Edge edge1 = createEdge( sourceId, "test", targetId1, System.currentTimeMillis()
);
+        long startTime = System.currentTimeMillis();
+
+        long edge1Time = startTime;
+        long edge2Time = edge1Time+1;
+
+        final long maxVersion= edge2Time;
+
+        Edge edge1 = createEdge( sourceId, "test", targetId1, edge1Time);
 
         gm.writeEdge( edge1 ).toBlocking().singleOrDefault( null );
 
-        Edge edge2 = createEdge( sourceId, "test", targetId2, System.currentTimeMillis()
);
+        Edge edge2 = createEdge( sourceId, "test", targetId2, edge2Time );
 
         gm.writeEdge( edge2 ).toBlocking().singleOrDefault( null );
 
 
-        final long maxVersion = System.currentTimeMillis();
-
 
-        assertTrue( Long.compare( maxVersion, edge2.getTimestamp() ) > 0 );
-        assertTrue( Long.compare( maxVersion, edge1.getTimestamp() ) > 0 );
+        assertTrue( Long.compare( maxVersion, edge2.getTimestamp() ) >= 0 );
+        assertTrue( Long.compare( maxVersion, edge1.getTimestamp() ) >= 0 );
 
 
         //get our 2 edges


Mime
View raw message