Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ttl tests with start time error by using graph.now() #1478

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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