Skip to content

Commit

Permalink
fix ttl tests with start time error by using graph.now()
Browse files Browse the repository at this point in the history
Change-Id: I27579319df0f732c9a5ee580e47144a63566fb0a
  • Loading branch information
zhoney committed Jun 3, 2021
1 parent 461948e commit 47f6768
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
import com.baidu.hugegraph.type.HugeType;
import com.baidu.hugegraph.type.define.Directions;
import com.baidu.hugegraph.type.define.HugeKeys;
import com.baidu.hugegraph.util.DateUtil;
import com.baidu.hugegraph.util.Events;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -726,7 +725,7 @@ public void testAddEdgeWithTtlAndTtlStartTime() {
Vertex java = graph().addVertex(T.label, "book",
"name", "Java in action");
Edge edge = baby.addEdge("borrow", java, "place", "library of school",
"date", DateUtil.now().getTime() - 2000L);
"date", graph().now() - 2000L);
graph().tx().commit();

Iterator<Edge> edges = graph().edges(edge);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
Expand Down Expand Up @@ -55,7 +54,6 @@
import com.baidu.hugegraph.backend.id.SnowflakeIdGenerator;
import com.baidu.hugegraph.backend.id.SplicingIdGenerator;
import com.baidu.hugegraph.backend.page.PageInfo;
import com.baidu.hugegraph.backend.page.PageState;
import com.baidu.hugegraph.backend.query.Condition;
import com.baidu.hugegraph.backend.query.ConditionQuery;
import com.baidu.hugegraph.backend.query.Query;
Expand All @@ -79,7 +77,6 @@
import com.baidu.hugegraph.type.define.HugeKeys;
import com.baidu.hugegraph.util.Blob;
import com.baidu.hugegraph.util.CollectionUtil;
import com.baidu.hugegraph.util.DateUtil;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;

Expand Down Expand Up @@ -933,7 +930,7 @@ public void testAddVertexWithTtlAndTtlStartTime() {
Vertex vertex = graph().addVertex(
T.label, "follower", "name",
"Baby", "age", 3, "city", "Beijing",
"birth", DateUtil.now().getTime() - 1000L);
"birth", graph().now() - 1000L);
graph().tx().commit();

Iterator<Vertex> vertices = graph().vertices(vertex);
Expand Down

0 comments on commit 47f6768

Please sign in to comment.