You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by ji...@apache.org on 2022/11/18 17:31:56 UTC
[incubator-hugegraph-toolchain] branch master updated: refact(client): adapt import & style with latest code (#369)
This is an automated email from the ASF dual-hosted git repository.
jin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-toolchain.git
The following commit(s) were added to refs/heads/master by this push:
new 6bbaa21b refact(client): adapt import & style with latest code (#369)
6bbaa21b is described below
commit 6bbaa21ba0b53d3aafdaf8d8c76f6ebf18889d02
Author: imbajin <ji...@apache.org>
AuthorDate: Sat Nov 19 01:31:48 2022 +0800
refact(client): adapt import & style with latest code (#369)
* adopt align format in client
check all class manually
* tiny fix
---
.../org/apache/hugegraph/api/auth/GroupAPI.java | 1 +
.../org/apache/hugegraph/api/auth/LogoutAPI.java | 1 +
.../org/apache/hugegraph/api/auth/ProjectAPI.java | 1 +
.../org/apache/hugegraph/api/auth/TargetAPI.java | 1 +
.../org/apache/hugegraph/api/auth/UserAPI.java | 1 +
.../org/apache/hugegraph/api/graph/EdgeAPI.java | 9 +-
.../org/apache/hugegraph/api/graph/VertexAPI.java | 15 +-
.../org/apache/hugegraph/api/graphs/GraphsAPI.java | 15 +-
.../hugegraph/api/gremlin/GremlinRequest.java | 1 +
.../apache/hugegraph/api/schema/EdgeLabelAPI.java | 1 +
.../apache/hugegraph/api/schema/IndexLabelAPI.java | 1 +
.../hugegraph/api/schema/PropertyKeyAPI.java | 4 +-
.../hugegraph/api/schema/VertexLabelAPI.java | 1 +
.../org/apache/hugegraph/api/task/TaskAPI.java | 12 +-
.../apache/hugegraph/api/task/TasksWithPage.java | 1 +
.../apache/hugegraph/api/traverser/EdgesAPI.java | 1 +
.../hugegraph/api/traverser/NeighborRankAPI.java | 5 +-
.../hugegraph/api/traverser/PersonalRankAPI.java | 21 +-
.../hugegraph/api/traverser/VerticesAPI.java | 1 +
.../hugegraph/api/variables/VariablesAPI.java | 1 +
.../org/apache/hugegraph/client/RestClient.java | 9 +-
.../org/apache/hugegraph/driver/GraphManager.java | 13 +-
.../apache/hugegraph/driver/TraverserManager.java | 30 +-
.../exception/InvalidResponseException.java | 5 +-
.../hugegraph/exception/ServerException.java | 5 +-
.../hugegraph/serializer/PathDeserializer.java | 1 +
.../serializer/direct/HBaseSerializer.java | 4 +-
.../serializer/direct/RocksDBSerializer.java | 2 +-
.../serializer/direct/reuse/BytesDemo.java | 67 +-
.../serializer/direct/util/BytesBuffer.java | 68 +-
.../hugegraph/serializer/direct/util/LZ4Util.java | 5 +-
.../direct/util/SplicingIdGenerator.java | 18 +-
.../apache/hugegraph/structure/GraphElement.java | 1 +
.../java/org/apache/hugegraph/structure/Task.java | 1 +
.../apache/hugegraph/structure/auth/Access.java | 1 +
.../hugegraph/structure/auth/AuthElement.java | 1 +
.../apache/hugegraph/structure/auth/Belong.java | 1 +
.../org/apache/hugegraph/structure/auth/Group.java | 1 +
.../hugegraph/structure/auth/HugeResource.java | 1 +
.../apache/hugegraph/structure/auth/Project.java | 1 +
.../apache/hugegraph/structure/auth/Target.java | 1 +
.../org/apache/hugegraph/structure/auth/User.java | 1 +
.../hugegraph/structure/constant/Cardinality.java | 4 +-
.../hugegraph/structure/constant/DataType.java | 6 +-
.../hugegraph/structure/constant/Direction.java | 4 +-
.../hugegraph/structure/constant/Frequency.java | 4 +-
.../structure/constant/GraphAttachable.java | 2 +-
.../hugegraph/structure/constant/GraphMode.java | 4 +-
.../structure/constant/GraphReadMode.java | 2 +-
.../hugegraph/structure/constant/IdStrategy.java | 4 +-
.../hugegraph/structure/constant/IndexType.java | 4 +-
.../hugegraph/structure/constant/WriteType.java | 4 +-
.../structure/graph/BatchEdgeRequest.java | 3 +-
.../structure/graph/BatchOlapPropertyRequest.java | 1 +
.../structure/graph/BatchVertexRequest.java | 3 +-
.../org/apache/hugegraph/structure/graph/Edge.java | 26 +-
.../apache/hugegraph/structure/graph/Pageable.java | 1 +
.../org/apache/hugegraph/structure/graph/Path.java | 1 +
.../apache/hugegraph/structure/graph/Vertex.java | 6 +-
.../hugegraph/structure/gremlin/Response.java | 1 +
.../hugegraph/structure/gremlin/ResultSet.java | 3 +-
.../hugegraph/structure/schema/BuilderProxy.java | 6 +-
.../hugegraph/structure/schema/IndexLabel.java | 1 +
.../hugegraph/structure/schema/PropertyKey.java | 1 +
.../hugegraph/structure/schema/SchemaLabel.java | 1 +
.../hugegraph/structure/schema/VertexLabel.java | 1 +
.../structure/traverser/CountRequest.java | 1 +
.../structure/traverser/CrosspointsRequest.java | 1 +
.../structure/traverser/CustomizedCrosspoints.java | 1 +
.../traverser/CustomizedPathsRequest.java | 1 +
.../hugegraph/structure/traverser/EdgeStep.java | 1 +
.../structure/traverser/FusiformSimilarity.java | 1 +
.../traverser/FusiformSimilarityRequest.java | 1 +
.../hugegraph/structure/traverser/Kneighbor.java | 1 +
.../structure/traverser/KneighborRequest.java | 9 +-
.../apache/hugegraph/structure/traverser/Kout.java | 1 +
.../hugegraph/structure/traverser/KoutRequest.java | 1 +
.../traverser/MultiNodeShortestPathRequest.java | 5 +-
.../structure/traverser/PathsRequest.java | 1 +
.../structure/traverser/PathsWithVertices.java | 1 +
.../structure/traverser/RepeatEdgeStep.java | 3 +-
.../SingleSourceJaccardSimilarityRequest.java | 5 +-
.../structure/traverser/TemplatePathsRequest.java | 9 +-
.../structure/traverser/VerticesArgs.java | 2 +-
.../structure/traverser/WeightedPath.java | 1 +
.../structure/traverser/WeightedPaths.java | 1 +
.../java/org/apache/hugegraph/util/CommonUtil.java | 2 -
.../java/org/apache/hugegraph/util/IdUtil.java | 4 +-
.../java/org/apache/hugegraph/util/JsonUtil.java | 1 +
.../apache/hugegraph/util/SplicingIdGenerator.java | 18 +-
.../apache/hugegraph/version/ClientVersion.java | 3 +-
.../java/org/apache/hugegraph/BaseClientTest.java | 1 +
.../org/apache/hugegraph/api/ApiTestSuite.java | 83 +--
.../hugegraph/api/BatchUpdateElementApiTest.java | 3 +-
.../java/org/apache/hugegraph/api/EdgeApiTest.java | 8 +-
.../org/apache/hugegraph/api/EdgeLabelApiTest.java | 37 +-
.../org/apache/hugegraph/api/GraphsApiTest.java | 7 +-
.../apache/hugegraph/api/IndexLabelApiTest.java | 21 +-
.../apache/hugegraph/api/PropertyKeyApiTest.java | 3 +-
.../org/apache/hugegraph/api/SchemaApiTest.java | 2 +-
.../java/org/apache/hugegraph/api/TaskApiTest.java | 21 +-
.../org/apache/hugegraph/api/VariablesApiTest.java | 4 +-
.../org/apache/hugegraph/api/VertexApiTest.java | 17 +-
.../apache/hugegraph/api/VertexLabelApiTest.java | 17 +-
.../apache/hugegraph/api/auth/ProjectApiTest.java | 1 +
.../hugegraph/functional/AuthManagerTest.java | 1 +
.../apache/hugegraph/functional/EdgeLabelTest.java | 1 +
.../org/apache/hugegraph/functional/EdgeTest.java | 1 +
.../apache/hugegraph/functional/FuncTestSuite.java | 28 +-
.../hugegraph/functional/HugeClientHttpsTest.java | 4 +-
.../hugegraph/functional/IndexLabelTest.java | 1 +
.../hugegraph/functional/MetricsManagerTest.java | 1 +
.../hugegraph/functional/PropertyKeyTest.java | 1 +
.../hugegraph/functional/VertexLabelTest.java | 1 +
.../apache/hugegraph/functional/VertexTest.java | 1 +
.../java/org/apache/hugegraph/testutil/Utils.java | 22 +-
.../hugegraph/unit/BatchElementRequestTest.java | 1 +
.../org/apache/hugegraph/unit/CommonUtilTest.java | 1 +
.../org/apache/hugegraph/unit/IndexLabelTest.java | 14 +-
.../apache/hugegraph/unit/PathSerializerTest.java | 60 +-
.../org/apache/hugegraph/unit/RestResultTest.java | 731 +++++++++++----------
.../org/apache/hugegraph/unit/UnitTestSuite.java | 18 +-
.../hugegraph/unit/VertexSerializerTest.java | 11 +-
123 files changed, 831 insertions(+), 791 deletions(-)
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/GroupAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/GroupAPI.java
index 0853beab..1ff3523e 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/GroupAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/GroupAPI.java
@@ -26,6 +26,7 @@ import org.apache.hugegraph.client.RestClient;
import org.apache.hugegraph.rest.RestResult;
import org.apache.hugegraph.structure.auth.Group;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.google.common.collect.ImmutableMap;
public class GroupAPI extends AuthAPI {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/LogoutAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/LogoutAPI.java
index 9b955f65..8b4448fc 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/LogoutAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/LogoutAPI.java
@@ -21,6 +21,7 @@ package org.apache.hugegraph.api.auth;
import org.apache.hugegraph.client.RestClient;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.google.common.collect.ImmutableMap;
public class LogoutAPI extends AuthAPI {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/ProjectAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/ProjectAPI.java
index 80db3a8e..2c7f5200 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/ProjectAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/ProjectAPI.java
@@ -27,6 +27,7 @@ import org.apache.hugegraph.client.RestClient;
import org.apache.hugegraph.rest.RestResult;
import org.apache.hugegraph.structure.auth.Project;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.google.common.collect.ImmutableMap;
public class ProjectAPI extends AuthAPI {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/TargetAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/TargetAPI.java
index baf3f571..692b8d7e 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/TargetAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/TargetAPI.java
@@ -26,6 +26,7 @@ import org.apache.hugegraph.client.RestClient;
import org.apache.hugegraph.rest.RestResult;
import org.apache.hugegraph.structure.auth.Target;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.google.common.collect.ImmutableMap;
public class TargetAPI extends AuthAPI {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/UserAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/UserAPI.java
index fc36f583..51d9deb0 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/UserAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/auth/UserAPI.java
@@ -27,6 +27,7 @@ import org.apache.hugegraph.rest.RestResult;
import org.apache.hugegraph.structure.auth.User;
import org.apache.hugegraph.structure.auth.User.UserRole;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.google.common.collect.ImmutableMap;
public class UserAPI extends AuthAPI {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/graph/EdgeAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/graph/EdgeAPI.java
index 8b10c546..f66103ab 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/graph/EdgeAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/graph/EdgeAPI.java
@@ -31,7 +31,9 @@ import org.apache.hugegraph.structure.constant.HugeType;
import org.apache.hugegraph.structure.graph.BatchEdgeRequest;
import org.apache.hugegraph.structure.graph.Edge;
import org.apache.hugegraph.structure.graph.Edges;
+
import com.google.common.collect.ImmutableMap;
+
import jakarta.ws.rs.core.MultivaluedHashMap;
public class EdgeAPI extends GraphAPI {
@@ -59,10 +61,9 @@ public class EdgeAPI extends GraphAPI {
headers, params);
List<String> ids = result.readList(String.class);
if (edges.size() != ids.size()) {
- throw new NotAllCreatedException(
- "Not all edges are successfully created, " +
- "expect '%s', the actual is '%s'",
- ids, edges.size(), ids.size());
+ throw new NotAllCreatedException("Not all edges are successfully created, " +
+ "expect '%s', the actual is '%s'",
+ ids, edges.size(), ids.size());
}
return ids;
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/graph/VertexAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/graph/VertexAPI.java
index cb1acf10..add23c11 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/graph/VertexAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/graph/VertexAPI.java
@@ -31,8 +31,11 @@ import org.apache.hugegraph.structure.graph.BatchOlapPropertyRequest;
import org.apache.hugegraph.structure.graph.BatchVertexRequest;
import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.structure.graph.Vertices;
+
import com.google.common.collect.ImmutableMap;
+
import jakarta.ws.rs.core.MultivaluedHashMap;
+
import org.apache.hugegraph.rest.RestResult;
public class VertexAPI extends GraphAPI {
@@ -58,10 +61,9 @@ public class VertexAPI extends GraphAPI {
headers);
List<Object> ids = result.readList(Object.class);
if (vertices.size() != ids.size()) {
- throw new NotAllCreatedException(
- "Not all vertices are successfully created, " +
- "expect '%s', the actual is '%s'",
- ids, vertices.size(), ids.size());
+ throw new NotAllCreatedException("Not all vertices are successfully created, " +
+ "expect '%s', the actual is '%s'",
+ ids, vertices.size(), ids.size());
}
return ids;
}
@@ -83,9 +85,8 @@ public class VertexAPI extends GraphAPI {
RestResult result = this.client.put(path, null, request, headers);
Object size = result.readObject(Map.class).get("size");
if (!(size instanceof Integer)) {
- throw new InvalidResponseException(
- "The 'size' in response must be int, but got: %s(%s)",
- size, size.getClass());
+ throw new InvalidResponseException("The 'size' in response must be int, " +
+ "but got: %s(%s)", size, size.getClass());
}
return (int) size;
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/graphs/GraphsAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/graphs/GraphsAPI.java
index ac166ebc..0b04b129 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/graphs/GraphsAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/graphs/GraphsAPI.java
@@ -25,6 +25,7 @@ import java.util.Map;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.MultivaluedHashMap;
+
import org.apache.commons.lang3.StringUtils;
import org.apache.hugegraph.api.API;
@@ -34,6 +35,7 @@ import org.apache.hugegraph.rest.RestResult;
import org.apache.hugegraph.structure.constant.GraphMode;
import org.apache.hugegraph.structure.constant.GraphReadMode;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.google.common.collect.ImmutableMap;
public class GraphsAPI extends API {
@@ -104,14 +106,12 @@ public class GraphsAPI extends API {
Map<String, String> mode = result.readObject(Map.class);
String value = mode.get(MODE);
if (value == null) {
- throw new InvalidResponseException(
- "Invalid response, expect 'mode' in response");
+ throw new InvalidResponseException("Invalid response, expect 'mode' in response");
}
try {
return GraphMode.valueOf(value);
} catch (IllegalArgumentException e) {
- throw new InvalidResponseException(
- "Invalid GraphMode value '%s'", value);
+ throw new InvalidResponseException("Invalid GraphMode value '%s'", value);
}
}
@@ -132,14 +132,13 @@ public class GraphsAPI extends API {
Map<String, String> readMode = result.readObject(Map.class);
String value = readMode.get(GRAPH_READ_MODE);
if (value == null) {
- throw new InvalidResponseException(
- "Invalid response, expect 'graph_read_mode' in response");
+ throw new InvalidResponseException("Invalid response, expect 'graph_read_mode' " +
+ "in response");
}
try {
return GraphReadMode.valueOf(value);
} catch (IllegalArgumentException e) {
- throw new InvalidResponseException(
- "Invalid GraphReadMode value '%s'", value);
+ throw new InvalidResponseException("Invalid GraphReadMode value '%s'", value);
}
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/gremlin/GremlinRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/gremlin/GremlinRequest.java
index a673f407..88433988 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/gremlin/GremlinRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/gremlin/GremlinRequest.java
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.apache.hugegraph.driver.GremlinManager;
import org.apache.hugegraph.structure.gremlin.ResultSet;
+
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/EdgeLabelAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/EdgeLabelAPI.java
index 889d009e..28a040cf 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/EdgeLabelAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/EdgeLabelAPI.java
@@ -29,6 +29,7 @@ import org.apache.hugegraph.structure.SchemaElement;
import org.apache.hugegraph.structure.constant.HugeType;
import org.apache.hugegraph.structure.schema.EdgeLabel;
import org.apache.hugegraph.util.E;
+
import com.google.common.collect.ImmutableMap;
public class EdgeLabelAPI extends SchemaElementAPI {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/IndexLabelAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/IndexLabelAPI.java
index 7987966e..71251cbf 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/IndexLabelAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/IndexLabelAPI.java
@@ -31,6 +31,7 @@ import org.apache.hugegraph.structure.constant.HugeType;
import org.apache.hugegraph.structure.constant.IndexType;
import org.apache.hugegraph.structure.schema.IndexLabel;
import org.apache.hugegraph.util.E;
+
import com.google.common.collect.ImmutableMap;
public class IndexLabelAPI extends SchemaElementAPI {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/PropertyKeyAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/PropertyKeyAPI.java
index 43f3d2e4..1a4edc94 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/PropertyKeyAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/PropertyKeyAPI.java
@@ -31,6 +31,7 @@ import org.apache.hugegraph.structure.constant.HugeType;
import org.apache.hugegraph.structure.constant.WriteType;
import org.apache.hugegraph.structure.schema.PropertyKey;
import org.apache.hugegraph.util.E;
+
import com.google.common.collect.ImmutableMap;
public class PropertyKeyAPI extends SchemaElementAPI {
@@ -48,8 +49,7 @@ public class PropertyKeyAPI extends SchemaElementAPI {
Object pkey = this.checkCreateOrUpdate(propertyKey);
RestResult result = this.client.post(this.path(), pkey);
if (this.client.apiVersionLt("0.65")) {
- return new PropertyKey.PropertyKeyWithTask(
- result.readObject(PropertyKey.class), 0L);
+ return new PropertyKey.PropertyKeyWithTask(result.readObject(PropertyKey.class), 0L);
}
return result.readObject(PropertyKey.PropertyKeyWithTask.class);
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/VertexLabelAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/VertexLabelAPI.java
index ca1494e6..4a20318c 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/VertexLabelAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/schema/VertexLabelAPI.java
@@ -29,6 +29,7 @@ import org.apache.hugegraph.structure.SchemaElement;
import org.apache.hugegraph.structure.constant.HugeType;
import org.apache.hugegraph.structure.schema.VertexLabel;
import org.apache.hugegraph.util.E;
+
import com.google.common.collect.ImmutableMap;
public class VertexLabelAPI extends SchemaElementAPI {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/task/TaskAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/task/TaskAPI.java
index 47dac80a..48fe98cb 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/task/TaskAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/task/TaskAPI.java
@@ -31,6 +31,7 @@ import org.apache.hugegraph.rest.RestResult;
import org.apache.hugegraph.structure.Task;
import org.apache.hugegraph.structure.constant.HugeType;
import org.apache.hugegraph.util.E;
+
import com.google.common.collect.ImmutableMap;
public class TaskAPI extends API {
@@ -114,9 +115,8 @@ public class TaskAPI extends API {
if (task.success()) {
return task;
} else if (task.completed()) {
- throw new ClientException(
- "Task '%s' is %s, result is '%s'",
- taskId, task.status(), task.result());
+ throw new ClientException("Task '%s' is %s, result is '%s'",
+ taskId, task.status(), task.result());
}
if (pass >= passes) {
break;
@@ -129,10 +129,8 @@ public class TaskAPI extends API {
// Ignore
}
}
- throw new ClientException(
- "Task '%s' not completed in %s seconds, " +
- "it can still be queried by task-get API",
- taskId, seconds);
+ throw new ClientException("Task '%s' not completed in %s seconds, " +
+ "it can still be queried by task-get API", taskId, seconds);
} finally {
// Stop querying this task info whatever
this.removeFromCache(taskId);
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/task/TasksWithPage.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/task/TasksWithPage.java
index a5a4b4a5..59c985a0 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/task/TasksWithPage.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/task/TasksWithPage.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.api.task;
import java.util.List;
import org.apache.hugegraph.structure.Task;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class TasksWithPage {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/EdgesAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/EdgesAPI.java
index 41d65faf..4137c746 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/EdgesAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/EdgesAPI.java
@@ -29,6 +29,7 @@ import org.apache.hugegraph.structure.graph.Edge;
import org.apache.hugegraph.structure.graph.Edges;
import org.apache.hugegraph.structure.graph.Shard;
import org.apache.hugegraph.util.E;
+
import com.google.common.collect.ImmutableMap;
public class EdgesAPI extends TraversersAPI {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/NeighborRankAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/NeighborRankAPI.java
index 27c85683..7ff614f8 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/NeighborRankAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/NeighborRankAPI.java
@@ -29,6 +29,7 @@ import org.apache.hugegraph.structure.constant.Direction;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.structure.traverser.Ranks;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class NeighborRankAPI extends TraversersAPI {
@@ -87,8 +88,8 @@ public class NeighborRankAPI extends TraversersAPI {
}
public Builder source(Object source) {
- E.checkArgument(source != null, "The label of request " +
- "for neighbor rank can't be null");
+ E.checkArgument(source != null,
+ "The label of request for neighbor rank can't be null");
this.request.source = source;
return this;
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/PersonalRankAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/PersonalRankAPI.java
index f20bbfce..04917195 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/PersonalRankAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/PersonalRankAPI.java
@@ -24,6 +24,7 @@ import org.apache.hugegraph.rest.RestResult;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.structure.traverser.Ranks;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class PersonalRankAPI extends TraversersAPI {
@@ -90,15 +91,15 @@ public class PersonalRankAPI extends TraversersAPI {
}
public Builder source(Object source) {
- E.checkArgument(source != null, "The source of request " +
- "for personal rank can't be null");
+ E.checkArgument(source != null,
+ "The source of request for personal rank can't be null");
this.request.source = source;
return this;
}
public Builder label(String label) {
- E.checkArgument(label != null, "The label of request " +
- "for personal rank can't be null");
+ E.checkArgument(label != null,
+ "The label of request for personal rank can't be null");
this.request.label = label;
return this;
}
@@ -124,8 +125,7 @@ public class PersonalRankAPI extends TraversersAPI {
public Builder maxDepth(int maxDepth) {
E.checkArgument(maxDepth > 0 &&
maxDepth <= Traverser.DEFAULT_MAX_DEPTH,
- "The max depth must be in range (0, %s], " +
- "but got: %s",
+ "The max depth must be in range (0, %s], but got: %s",
Traverser.DEFAULT_MAX_DEPTH, maxDepth);
this.request.maxDepth = maxDepth;
return this;
@@ -151,12 +151,9 @@ public class PersonalRankAPI extends TraversersAPI {
TraversersAPI.checkDegree(this.request.degree);
TraversersAPI.checkLimit(this.request.limit);
E.checkArgument(this.request.maxDepth > 0 &&
- this.request.maxDepth <=
- Traverser.DEFAULT_MAX_DEPTH,
- "The max depth must be in range (0, %s], " +
- "but got: %s",
- Traverser.DEFAULT_MAX_DEPTH,
- this.request.maxDepth);
+ this.request.maxDepth <= Traverser.DEFAULT_MAX_DEPTH,
+ "The max depth must be in range (0, %s], but got: %s",
+ Traverser.DEFAULT_MAX_DEPTH, this.request.maxDepth);
return this.request;
}
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/VerticesAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/VerticesAPI.java
index be1eb195..638ca539 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/VerticesAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/traverser/VerticesAPI.java
@@ -31,6 +31,7 @@ import org.apache.hugegraph.structure.graph.Shard;
import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.structure.graph.Vertices;
import org.apache.hugegraph.util.E;
+
import com.google.common.collect.ImmutableMap;
public class VerticesAPI extends TraversersAPI {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/api/variables/VariablesAPI.java b/hugegraph-client/src/main/java/org/apache/hugegraph/api/variables/VariablesAPI.java
index 51216e4c..592c51d0 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/api/variables/VariablesAPI.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/api/variables/VariablesAPI.java
@@ -25,6 +25,7 @@ import org.apache.hugegraph.api.API;
import org.apache.hugegraph.client.RestClient;
import org.apache.hugegraph.rest.RestResult;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.google.common.collect.ImmutableMap;
public class VariablesAPI extends API {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/client/RestClient.java b/hugegraph-client/src/main/java/org/apache/hugegraph/client/RestClient.java
index 7fd1fa8d..b84bb664 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/client/RestClient.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/client/RestClient.java
@@ -28,7 +28,9 @@ import org.apache.hugegraph.rest.RestResult;
import org.apache.hugegraph.util.E;
import org.apache.hugegraph.util.VersionUtil;
import org.apache.hugegraph.util.VersionUtil.Version;
+
import com.fasterxml.jackson.databind.module.SimpleModule;
+
import jakarta.ws.rs.core.Response;
public class RestClient extends AbstractRestClient {
@@ -66,10 +68,9 @@ public class RestClient extends AbstractRestClient {
public void checkApiVersion(String minVersion, String message) {
if (this.apiVersionLt(minVersion)) {
- throw new ClientException(
- "HugeGraphServer API version must be >= %s to support " +
- "%s, but current HugeGraphServer API version is: %s",
- minVersion, message, this.apiVersion.get());
+ throw new ClientException("HugeGraphServer API version must be >= %s to support " +
+ "%s, but current HugeGraphServer API version is: %s",
+ minVersion, message, this.apiVersion.get());
}
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/driver/GraphManager.java b/hugegraph-client/src/main/java/org/apache/hugegraph/driver/GraphManager.java
index 4604acad..d1b10a9a 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/driver/GraphManager.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/driver/GraphManager.java
@@ -64,9 +64,9 @@ public class GraphManager {
public Vertex addVertex(Object... keyValues) {
Object label = this.getValue(T.LABEL, keyValues);
if (!(label instanceof String)) {
- throw new IllegalArgumentException(String.format(
- "Expect a string value as the vertex label " +
- "argument, but got: %s", label));
+ throw new IllegalArgumentException(String.format("Expect a string value as the " +
+ "vertex label argument, but got: %s",
+ label));
}
Vertex vertex = new Vertex(String.valueOf(label));
vertex.id(this.getValue(T.ID, keyValues));
@@ -189,7 +189,7 @@ public class GraphManager {
public List<Vertex> updateVertices(BatchVertexRequest request) {
List<Vertex> newVertices = this.vertexAPI.update(request);
- newVertices.forEach(vertex -> this.attachManager(vertex));
+ newVertices.forEach(this::attachManager);
return newVertices;
}
@@ -211,8 +211,7 @@ public class GraphManager {
public Edge addEdge(Edge edge) {
if (edge.id() != null) {
- throw new InvalidOperationException(
- "Not allowed to custom id for edge: '%s'", edge);
+ throw new InvalidOperationException("Not allowed to custom id for edge: '%s'", edge);
}
edge = this.edgeAPI.create(edge);
this.attachManager(edge);
@@ -434,7 +433,7 @@ public class GraphManager {
public List<Edge> updateEdges(BatchEdgeRequest request) {
List<Edge> newEdges = this.edgeAPI.update(request);
- newEdges.forEach(edge -> this.attachManager(edge));
+ newEdges.forEach(this::attachManager);
return newEdges;
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/driver/TraverserManager.java b/hugegraph-client/src/main/java/org/apache/hugegraph/driver/TraverserManager.java
index fa79d637..55904eba 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/driver/TraverserManager.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/driver/TraverserManager.java
@@ -108,12 +108,9 @@ public class TraverserManager {
this.sameNeighborsAPI = new SameNeighborsAPI(client, graph);
this.shortestPathAPI = new ShortestPathAPI(client, graph);
this.allShortestPathsAPI = new AllShortestPathsAPI(client, graph);
- this.singleSourceShortestPathAPI = new SingleSourceShortestPathAPI(
- client, graph);
- this.weightedShortestPathAPI = new WeightedShortestPathAPI(
- client, graph);
- this.multiNodeShortestPathAPI = new MultiNodeShortestPathAPI(
- client, graph);
+ this.singleSourceShortestPathAPI = new SingleSourceShortestPathAPI(client, graph);
+ this.weightedShortestPathAPI = new WeightedShortestPathAPI(client, graph);
+ this.multiNodeShortestPathAPI = new MultiNodeShortestPathAPI(client, graph);
this.pathsAPI = new PathsAPI(client, graph);
this.crosspointsAPI = new CrosspointsAPI(client, graph);
this.koutAPI = new KoutAPI(client, graph);
@@ -122,8 +119,7 @@ public class TraverserManager {
this.ringsAPI = new RingsAPI(client, graph);
this.raysAPI = new RaysAPI(client, graph);
this.customizedPathsAPI = new CustomizedPathsAPI(client, graph);
- this.customizedCrosspointsAPI = new CustomizedCrosspointsAPI(
- client, graph);
+ this.customizedCrosspointsAPI = new CustomizedCrosspointsAPI(client, graph);
this.templatePathsAPI = new TemplatePathsAPI(client, graph);
this.fusiformSimilarityAPI = new FusiformSimilarityAPI(client, graph);
this.neighborRankAPI = new NeighborRankAPI(client, graph);
@@ -149,8 +145,7 @@ public class TraverserManager {
label, degree);
}
- public Map<Object, Double> jaccardSimilarity(
- SingleSourceJaccardSimilarityRequest request) {
+ public Map<Object, Double> jaccardSimilarity(SingleSourceJaccardSimilarityRequest request) {
return this.jaccardSimilarityAPI.post(request);
}
@@ -295,14 +290,11 @@ public class TraverserManager {
String label, String weight,
long degree, long skipDegree,
long capacity, boolean withVertex) {
- return this.weightedShortestPathAPI.get(sourceId, targetId,direction,
- label, weight, degree,
- skipDegree, capacity,
- withVertex);
+ return this.weightedShortestPathAPI.get(sourceId, targetId, direction, label, weight,
+ degree, skipDegree, capacity, withVertex);
}
- public PathsWithVertices multiNodeShortestPath(
- MultiNodeShortestPathRequest request) {
+ public PathsWithVertices multiNodeShortestPath(MultiNodeShortestPathRequest request) {
return this.multiNodeShortestPathAPI.post(request);
}
@@ -448,8 +440,7 @@ public class TraverserManager {
return this.customizedPathsAPI.post(request);
}
- public CustomizedCrosspoints customizedCrosspointss(
- CrosspointsRequest request) {
+ public CustomizedCrosspoints customizedCrosspointss(CrosspointsRequest request) {
return this.customizedCrosspointsAPI.post(request);
}
@@ -457,8 +448,7 @@ public class TraverserManager {
return this.templatePathsAPI.post(request);
}
- public FusiformSimilarity fusiformSimilarity(
- FusiformSimilarityRequest request) {
+ public FusiformSimilarity fusiformSimilarity(FusiformSimilarityRequest request) {
return this.fusiformSimilarityAPI.post(request);
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/exception/InvalidResponseException.java b/hugegraph-client/src/main/java/org/apache/hugegraph/exception/InvalidResponseException.java
index 80e7c833..76db0c25 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/exception/InvalidResponseException.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/exception/InvalidResponseException.java
@@ -35,8 +35,7 @@ public class InvalidResponseException extends ClientException {
public static InvalidResponseException expectField(String expectField,
Object parentField) {
- return new InvalidResponseException(
- "Invalid response, expect '%s' in '%s'",
- expectField, parentField);
+ return new InvalidResponseException("Invalid response, expect '%s' in '%s'",
+ expectField, parentField);
}
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/exception/ServerException.java b/hugegraph-client/src/main/java/org/apache/hugegraph/exception/ServerException.java
index 14ccd8ca..253aaed6 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/exception/ServerException.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/exception/ServerException.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.exception;
import java.util.Map;
import org.apache.hugegraph.rest.RestResult;
+
import jakarta.ws.rs.core.Response;
public class ServerException extends RuntimeException {
@@ -49,8 +50,8 @@ public class ServerException extends RuntimeException {
@SuppressWarnings("unchecked")
Map<String, Object> json = rs.readObject(Map.class);
exception.exception = (String) getByKeys(json, EXCEPTION_KEYS);
- exception.message = (String) getByKeys(json, MESSAGE_KEYS);
- exception.cause = (String) getByKeys(json, CAUSE_KEYS);
+ exception.message = (String) getByKeys(json, MESSAGE_KEYS);
+ exception.cause = (String) getByKeys(json, CAUSE_KEYS);
exception.trace = getByKeys(json, TRACE_KEYS);
} catch (Exception ignored) {
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/PathDeserializer.java b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/PathDeserializer.java
index 9dffd3a1..c716d454 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/PathDeserializer.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/PathDeserializer.java
@@ -28,6 +28,7 @@ import org.apache.hugegraph.structure.graph.Edge;
import org.apache.hugegraph.structure.graph.Path;
import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.util.JsonUtil;
+
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/HBaseSerializer.java b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/HBaseSerializer.java
index 36d4a34c..27003580 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/HBaseSerializer.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/HBaseSerializer.java
@@ -37,8 +37,8 @@ import java.util.Map;
*/
public class HBaseSerializer {
- private int edgeLogicPartitions = 30;
- private int vertexLogicPartitions = 10;
+ private int edgeLogicPartitions;
+ private int vertexLogicPartitions;
private HugeClient client;
private GraphSchema graphSchema;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/RocksDBSerializer.java b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/RocksDBSerializer.java
index b5bb6adc..5015d0af 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/RocksDBSerializer.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/RocksDBSerializer.java
@@ -21,7 +21,7 @@ package org.apache.hugegraph.serializer.direct;
/**
* TODO: review later
- *
+ * <p>
* In this serializer, we only support normal type now:
* - number
* - string
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/reuse/BytesDemo.java b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/reuse/BytesDemo.java
index 63ce8d06..019849e1 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/reuse/BytesDemo.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/reuse/BytesDemo.java
@@ -65,40 +65,40 @@ public class BytesDemo {
schema.propertyKey("price").asText().ifNotExist().create();
schema.vertexLabel("person")
- .properties("name", "age")
- .useCustomizeStringId()
- .enableLabelIndex(false)
- .ifNotExist()
- .create();
+ .properties("name", "age")
+ .useCustomizeStringId()
+ .enableLabelIndex(false)
+ .ifNotExist()
+ .create();
schema.vertexLabel("personB")
- .properties("price")
- .nullableKeys("price")
- .useCustomizeNumberId()
- .enableLabelIndex(false)
- .ifNotExist()
- .create();
+ .properties("price")
+ .nullableKeys("price")
+ .useCustomizeNumberId()
+ .enableLabelIndex(false)
+ .ifNotExist()
+ .create();
schema.vertexLabel("software")
- .properties("name", "lang", "price")
- .useCustomizeStringId()
- .enableLabelIndex(false)
- .ifNotExist()
- .create();
+ .properties("name", "lang", "price")
+ .useCustomizeStringId()
+ .enableLabelIndex(false)
+ .ifNotExist()
+ .create();
schema.edgeLabel("knows")
- .link("person", "person")
- .properties("date")
- .enableLabelIndex(false)
- .ifNotExist()
- .create();
+ .link("person", "person")
+ .properties("date")
+ .enableLabelIndex(false)
+ .ifNotExist()
+ .create();
schema.edgeLabel("created")
- .link("person", "software")
- .properties("date")
- .enableLabelIndex(false)
- .ifNotExist()
- .create();
+ .link("person", "software")
+ .properties("date")
+ .enableLabelIndex(false)
+ .ifNotExist()
+ .create();
HBaseSer = new HBaseSerializer(client, vertexLogicPartitions, edgeLogicPartitions);
writeGraphElements();
@@ -124,14 +124,17 @@ public class BytesDemo {
vadasB.property("price", "120");
vadasB.id(12345);
- Edge peterCreateLop = new Edge("created").source(peter).target(lop).property("date", "2017-03-24");
+ Edge peterCreateLop = new Edge("created").source(peter).target(lop)
+ .property("date", "2017-03-24");
- List<Vertex> vertices = new ArrayList<Vertex>(){{
- add(peter);add(lop);add(vadasB);
+ List<Vertex> vertices = new ArrayList<Vertex>() {{
+ add(peter);
+ add(lop);
+ add(vadasB);
}};
- List<Edge> edges = new ArrayList<Edge>(){{
+ List<Edge> edges = new ArrayList<Edge>() {{
add(peterCreateLop);
}};
@@ -153,7 +156,7 @@ public class BytesDemo {
sendRpcToHBase("vertex", rowkey, values);
}
- for (Edge edge: edges) {
+ for (Edge edge : edges) {
byte[] rowkey = HBaseSer.getKeyBytes(edge);
byte[] values = HBaseSer.getValueBytes(edge);
sendRpcToHBase("edge", rowkey, values);
@@ -186,7 +189,7 @@ public class BytesDemo {
}
- boolean put (String type, byte[] rowkey, byte[] values) throws IOException {
+ boolean put(String type, byte[] rowkey, byte[] values) throws IOException {
// TODO: put to HBase
return true;
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/BytesBuffer.java b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/BytesBuffer.java
index 363fc1f7..e889db40 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/BytesBuffer.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/BytesBuffer.java
@@ -157,8 +157,8 @@ public final class BytesBuffer extends OutputStream {
// Extra capacity as buffer
int newcapacity = size + this.buffer.limit() + DEFAULT_CAPACITY;
E.checkArgument(newcapacity <= MAX_BUFFER_CAPACITY,
- "Capacity exceeds max buffer capacity: %s",
- MAX_BUFFER_CAPACITY);
+ "Capacity exceeds max buffer capacity: %s",
+ MAX_BUFFER_CAPACITY);
ByteBuffer newBuffer = ByteBuffer.allocate(newcapacity);
this.buffer.flip();
newBuffer.put(this.buffer);
@@ -279,8 +279,8 @@ public final class BytesBuffer extends OutputStream {
public BytesBuffer writeBytes(byte[] bytes) {
E.checkArgument(bytes.length <= UINT16_MAX,
- "The max length of bytes is %s, but got %s",
- UINT16_MAX, bytes.length);
+ "The max length of bytes is %s, but got %s",
+ UINT16_MAX, bytes.length);
require(SHORT_LEN + bytes.length);
this.writeVInt(bytes.length);
this.write(bytes);
@@ -296,8 +296,8 @@ public final class BytesBuffer extends OutputStream {
public BytesBuffer writeBigBytes(byte[] bytes) {
E.checkArgument(bytes.length <= BLOB_LEN_MAX,
- "The max length of bytes is %s, but got %s",
- BLOB_LEN_MAX, bytes.length);
+ "The max length of bytes is %s, but got %s",
+ BLOB_LEN_MAX, bytes.length);
require(BLOB_LEN + bytes.length);
this.writeVInt(bytes.length);
this.write(bytes);
@@ -339,8 +339,8 @@ public final class BytesBuffer extends OutputStream {
"Invalid UTF8 bytes: " + value;
if (Bytes.contains(bytes, STRING_ENDING_BYTE)) {
E.checkArgument(false,
- "Can't contains byte '0x00' in string: '%s'",
- value);
+ "Can't contains byte '0x00' in string: '%s'",
+ value);
}
this.write(bytes);
}
@@ -413,7 +413,7 @@ public final class BytesBuffer extends OutputStream {
this.write(0x80 | ((value >>> 14) & 0x7f));
}
if (value > 0x7f || value < 0) {
- this.write(0x80 | ((value >>> 7) & 0x7f));
+ this.write(0x80 | ((value >>> 7) & 0x7f));
}
this.write(value & 0x7f);
@@ -423,8 +423,8 @@ public final class BytesBuffer extends OutputStream {
public int readVInt() {
byte leading = this.read();
E.checkArgument(leading != 0x80,
- "Unexpected varint with leading byte '0x%s'",
- Bytes.toHex(leading));
+ "Unexpected varint with leading byte '0x%s'",
+ Bytes.toHex(leading));
int value = leading & 0x7f;
if (leading >= 0) {
assert (leading & 0x80) == 0;
@@ -443,11 +443,11 @@ public final class BytesBuffer extends OutputStream {
}
E.checkArgument(i < 5,
- "Unexpected varint %s with too many bytes(%s)",
- value, i + 1);
+ "Unexpected varint %s with too many bytes(%s)",
+ value, i + 1);
E.checkArgument(i < 4 || (leading & 0x70) == 0,
- "Unexpected varint %s with leading byte '0x%s'",
- value, Bytes.toHex(leading));
+ "Unexpected varint %s with leading byte '0x%s'",
+ value, Bytes.toHex(leading));
return value;
}
@@ -477,7 +477,7 @@ public final class BytesBuffer extends OutputStream {
this.write(0x80 | ((int) (value >>> 14) & 0x7f));
}
if (value > 0x7fL || value < 0L) {
- this.write(0x80 | ((int) (value >>> 7) & 0x7f));
+ this.write(0x80 | ((int) (value >>> 7) & 0x7f));
}
this.write((int) value & 0x7f);
@@ -487,8 +487,8 @@ public final class BytesBuffer extends OutputStream {
public long readVLong() {
byte leading = this.read();
E.checkArgument(leading != 0x80,
- "Unexpected varlong with leading byte '0x%s'",
- Bytes.toHex(leading));
+ "Unexpected varlong with leading byte '0x%s'",
+ Bytes.toHex(leading));
long value = leading & 0x7fL;
if (leading >= 0) {
assert (leading & 0x80) == 0;
@@ -507,11 +507,11 @@ public final class BytesBuffer extends OutputStream {
}
E.checkArgument(i < 10,
- "Unexpected varlong %s with too many bytes(%s)",
- value, i + 1);
+ "Unexpected varlong %s with too many bytes(%s)",
+ value, i + 1);
E.checkArgument(i < 9 || (leading & 0x7e) == 0,
- "Unexpected varlong %s with leading byte '0x%s'",
- value, Bytes.toHex(leading));
+ "Unexpected varlong %s with leading byte '0x%s'",
+ value, Bytes.toHex(leading));
return value;
}
@@ -540,14 +540,14 @@ public final class BytesBuffer extends OutputStream {
E.checkArgument(len > 0, "Can't write empty id");
if (!big) {
E.checkArgument(len <= ID_LEN_MAX,
- "Id max length is %s, but got %s {%s}",
- ID_LEN_MAX, len, id);
+ "Id max length is %s, but got %s {%s}",
+ ID_LEN_MAX, len, id);
len -= 1; // mapping [1, 128] to [0, 127]
this.writeUInt8(len | 0x80);
} else {
E.checkArgument(len <= BIG_ID_LEN_MAX,
- "Big id max length is %s, but got %s {%s}",
- BIG_ID_LEN_MAX, len, id);
+ "Big id max length is %s, but got %s {%s}",
+ BIG_ID_LEN_MAX, len, id);
len -= 1;
int high = len >> 8;
int low = len & 0xff;
@@ -574,10 +574,10 @@ public final class BytesBuffer extends OutputStream {
if (Bytes.contains(bytes, STRING_ENDING_BYTE)) {
// Not allow STRING_ENDING_BYTE exist in string index id
E.checkArgument(false,
- "The %s type index id can't contains " +
+ "The %s type index id can't contains " +
"byte '0x%s', but got: 0x%s", type,
- Bytes.toHex(STRING_ENDING_BYTE),
- Bytes.toHex(bytes));
+ Bytes.toHex(STRING_ENDING_BYTE),
+ Bytes.toHex(bytes));
}
if (withEnding) {
this.writeStringWithEnding("");
@@ -655,8 +655,8 @@ public final class BytesBuffer extends OutputStream {
private long readNumber(byte b) {
E.checkArgument((b & 0x80) == 0,
- "Not a number type with prefix byte '0x%s'",
- Bytes.toHex(b));
+ "Not a number type with prefix byte '0x%s'",
+ Bytes.toHex(b));
// Parse the kind from byte 0kkksxxx
int kind = b >>> 4;
boolean positive = (b & 0x08) > 0;
@@ -683,8 +683,8 @@ public final class BytesBuffer extends OutputStream {
break;
case 6:
value |= (long) this.readUInt8() << 48 |
- (long) this.readUInt16() << 32 |
- this.readUInt32();
+ (long) this.readUInt16() << 32 |
+ this.readUInt32();
break;
case 7:
assert high3bits == 0L;
@@ -712,7 +712,7 @@ public final class BytesBuffer extends OutputStream {
}
}
E.checkArgument(foundEnding, "Not found ending '0x%s'",
- Bytes.toHex(STRING_ENDING_BYTE));
+ Bytes.toHex(STRING_ENDING_BYTE));
int end = this.buffer.position() - 1;
int len = end - start;
byte[] bytes = new byte[len];
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/LZ4Util.java b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/LZ4Util.java
index 7a2dd96d..e08f6c34 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/LZ4Util.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/LZ4Util.java
@@ -69,10 +69,9 @@ public class LZ4Util {
LZ4FastDecompressor decompressor = factory.fastDecompressor();
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
int initBufferSize = Math.min(Math.round(bytes.length * ratio),
- BytesBuffer.MAX_BUFFER_CAPACITY);
+ BytesBuffer.MAX_BUFFER_CAPACITY);
BytesBuffer buf = new BytesBuffer(initBufferSize);
- LZ4BlockInputStream lzInput = new LZ4BlockInputStream(bais,
- decompressor);
+ LZ4BlockInputStream lzInput = new LZ4BlockInputStream(bais, decompressor);
int count;
byte[] buffer = new byte[blockSize];
try {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/SplicingIdGenerator.java b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/SplicingIdGenerator.java
index 495def67..7a5eaeba 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/SplicingIdGenerator.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/serializer/direct/util/SplicingIdGenerator.java
@@ -70,8 +70,9 @@ public class SplicingIdGenerator {
/**
* Concat multiple ids into one composite id with IDS_SPLITOR
+ *
* @param ids the string id values to be contacted
- * @return contacted string value
+ * @return contacted string value
*/
public static String concat(String... ids) {
// NOTE: must support string id when using this method
@@ -80,8 +81,9 @@ public class SplicingIdGenerator {
/**
* Split a composite id into multiple ids with IDS_SPLITOR
+ *
* @param ids the string id value to be split
- * @return split string values
+ * @return split string values
*/
public static String[] split(String ids) {
return IdUtil.unescape(ids, IDS_SPLITOR_STR, ESCAPE_STR);
@@ -89,8 +91,9 @@ public class SplicingIdGenerator {
/**
* Concat property values with NAME_SPLITOR
+ *
* @param values the property values to be concatted
- * @return concatted string value
+ * @return concatted string value
*/
public static String concatValues(List<?> values) {
// Convert the object list to string array
@@ -104,8 +107,9 @@ public class SplicingIdGenerator {
/**
* Concat property values with NAME_SPLITOR
+ *
* @param values the property values to be contacted
- * @return contacted string value
+ * @return contacted string value
*/
public static String concatValues(Object... values) {
return concatValues(Arrays.asList(values));
@@ -113,8 +117,9 @@ public class SplicingIdGenerator {
/**
* Concat multiple parts into a single id with ID_SPLITOR
+ *
* @param parts the string id values to be spliced
- * @return spliced id object
+ * @return spliced id object
*/
public static Id splicing(String... parts) {
String escaped = IdUtil.escape(ID_SPLITOR, ESCAPE, parts);
@@ -123,8 +128,9 @@ public class SplicingIdGenerator {
/**
* Parse a single id into multiple parts with ID_SPLITOR
+ *
* @param id the id object to be parsed
- * @return parsed string id parts
+ * @return parsed string id parts
*/
public static String[] parse(Id id) {
return IdUtil.unescape(id.asString(), ID_SPLITOR_STR, ESCAPE_STR);
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/GraphElement.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/GraphElement.java
index 4c10cf4f..ec5d3209 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/GraphElement.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/GraphElement.java
@@ -30,6 +30,7 @@ import org.apache.hugegraph.structure.constant.GraphAttachable;
import org.apache.hugegraph.driver.GraphManager;
import org.apache.hugegraph.util.E;
import org.apache.hugegraph.util.ReflectionUtil;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public abstract class GraphElement extends Element implements GraphAttachable {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/Task.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/Task.java
index 88ce3ff9..596385b6 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/Task.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/Task.java
@@ -24,6 +24,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableSet;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Access.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Access.java
index 4e14c5a1..5c93d474 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Access.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Access.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.auth;
import java.util.Date;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/AuthElement.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/AuthElement.java
index 18944561..7ce03bfd 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/AuthElement.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/AuthElement.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.auth;
import java.util.Date;
import org.apache.hugegraph.structure.Element;
+
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Belong.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Belong.java
index ded60368..1340020a 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Belong.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Belong.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.auth;
import java.util.Date;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Group.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Group.java
index 22a21c22..e8e115bb 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Group.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Group.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.auth;
import java.util.Date;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/HugeResource.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/HugeResource.java
index 355a2992..4e54c206 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/HugeResource.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/HugeResource.java
@@ -23,6 +23,7 @@ import java.util.Map;
import java.util.Objects;
import org.apache.hugegraph.util.JsonUtil;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class HugeResource {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Project.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Project.java
index ce99242a..af802b83 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Project.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Project.java
@@ -24,6 +24,7 @@ import java.util.HashSet;
import java.util.Set;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Target.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Target.java
index 20799450..7bf5799f 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Target.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/Target.java
@@ -25,6 +25,7 @@ import java.util.Date;
import java.util.List;
import org.apache.hugegraph.structure.constant.HugeType;
+
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/User.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/User.java
index 209d9c4e..43687a15 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/User.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/User.java
@@ -26,6 +26,7 @@ import java.util.Map;
import org.apache.hugegraph.structure.constant.HugeType;
import org.apache.hugegraph.util.JsonUtil;
+
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Cardinality.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Cardinality.java
index dcf2be34..4bef9c5c 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Cardinality.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Cardinality.java
@@ -28,8 +28,8 @@ public enum Cardinality {
SET(3, "set");
// HugeKeys define
- private byte code = 0;
- private String name = null;
+ private final byte code;
+ private final String name;
Cardinality(int code, String name) {
assert code < 256;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/DataType.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/DataType.java
index 86d693c7..8bafacb1 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/DataType.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/DataType.java
@@ -37,9 +37,9 @@ public enum DataType {
DATE(10, "date", Date.class),
UUID(11, "uuid", UUID.class);
- private byte code = 0;
- private String name = null;
- private Class<?> clazz = null;
+ private final byte code;
+ private final String name;
+ private final Class<?> clazz;
DataType(int code, String name, Class<?> clazz) {
assert code < 256;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Direction.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Direction.java
index d15f84cc..ffc2e346 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Direction.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Direction.java
@@ -27,8 +27,8 @@ public enum Direction {
BOTH(3, "both");
- private byte code;
- private String name;
+ private final byte code;
+ private final String name;
Direction(int code, String name) {
assert code < 256;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Frequency.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Frequency.java
index d7044164..0bcbbc85 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Frequency.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/Frequency.java
@@ -27,8 +27,8 @@ public enum Frequency {
MULTIPLE(2, "multiple");
- private byte code = 0;
- private String name = null;
+ private final byte code;
+ private final String name;
Frequency(int code, String name) {
assert code < 256;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphAttachable.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphAttachable.java
index b802f95e..f3f4c511 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphAttachable.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphAttachable.java
@@ -23,5 +23,5 @@ import org.apache.hugegraph.driver.GraphManager;
public interface GraphAttachable {
- public void attachManager(GraphManager manager);
+ void attachManager(GraphManager manager);
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphMode.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphMode.java
index 751a420e..fad1ff3d 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphMode.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphMode.java
@@ -23,7 +23,7 @@ public enum GraphMode {
/*
* None mode is regular mode
- * 1. Not allowed create schema with specified id
+ * 1. Not allowed to create schema with specified id
* 2. Not support create vertex with id for AUTOMATIC id strategy
*/
NONE(1, "none"),
@@ -37,7 +37,7 @@ public enum GraphMode {
/*
* MERGING mode is used to merge schema and graph data to an existing graph.
- * 1. Not allowed create schema with specified id
+ * 1. Not allowed to create schema with specified id
* 2. Support create vertex with id for AUTOMATIC id strategy
*/
MERGING(3, "merging"),
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphReadMode.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphReadMode.java
index 61652663..ee559828 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphReadMode.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/GraphReadMode.java
@@ -30,7 +30,7 @@ public enum GraphReadMode {
private final byte code;
private final String name;
- private GraphReadMode(int code, String name) {
+ GraphReadMode(int code, String name) {
assert code < 256;
this.code = (byte) code;
this.name = name;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/IdStrategy.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/IdStrategy.java
index c79a2a38..1bb6ff08 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/IdStrategy.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/IdStrategy.java
@@ -33,8 +33,8 @@ public enum IdStrategy {
CUSTOMIZE_UUID(5, "customize_uuid");
- private byte code = 0;
- private String name = null;
+ private final byte code;
+ private final String name;
IdStrategy(int code, String name) {
assert code < 256;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/IndexType.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/IndexType.java
index 7379014f..bb8b100b 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/IndexType.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/IndexType.java
@@ -36,8 +36,8 @@ public enum IndexType {
// For unique properties
UNIQUE(5, "unique");
- private byte code = 0;
- private String name = null;
+ private final byte code;
+ private final String name;
IndexType(int code, String name) {
assert code < 256;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/WriteType.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/WriteType.java
index edf50d04..b311809f 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/WriteType.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/constant/WriteType.java
@@ -33,8 +33,8 @@ public enum WriteType {
// OLAP property key with range index
OLAP_RANGE(4, "olap_range");
- private byte code = 0;
- private String name = null;
+ private final byte code;
+ private final String name;
WriteType(int code, String name) {
assert code < 256;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchEdgeRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchEdgeRequest.java
index 6dfc7a5b..bc326f26 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchEdgeRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchEdgeRequest.java
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Map;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class BatchEdgeRequest {
@@ -98,7 +99,7 @@ public class BatchEdgeRequest {
E.checkArgument(req.updateStrategies != null &&
!req.updateStrategies.isEmpty(),
"Parameter 'update_strategies' can't be empty");
- E.checkArgument(req.createIfNotExist == true,
+ E.checkArgument(req.createIfNotExist,
"Parameter 'create_if_not_exist' " +
"dose not support false now");
return this.req;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchOlapPropertyRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchOlapPropertyRequest.java
index 8dd62e9b..56bd3819 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchOlapPropertyRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchOlapPropertyRequest.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.graph;
import java.util.List;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class BatchOlapPropertyRequest {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchVertexRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchVertexRequest.java
index a9608d0b..34d784fa 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchVertexRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/BatchVertexRequest.java
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Map;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class BatchVertexRequest {
@@ -89,7 +90,7 @@ public class BatchVertexRequest {
E.checkArgument(req.updateStrategies != null &&
!req.updateStrategies.isEmpty(),
"Parameter 'update_strategies' can't be empty");
- E.checkArgument(req.createIfNotExist == true,
+ E.checkArgument(req.createIfNotExist,
"Parameter 'create_if_not_exist' " +
"dose not support false now");
return this.req;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Edge.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Edge.java
index c0327f2f..1abca968 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Edge.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Edge.java
@@ -23,6 +23,7 @@ import org.apache.hugegraph.util.SplicingIdGenerator;
import org.apache.hugegraph.exception.InvalidOperationException;
import org.apache.hugegraph.structure.GraphElement;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -70,9 +71,8 @@ public class Edge extends GraphElement {
this.sourceId = this.source.id();
}
if (this.sourceId == null) {
- throw new InvalidOperationException(
- "Must set source vertex id or add vertices " +
- "before add edges");
+ throw new InvalidOperationException("Must set source vertex id or add vertices " +
+ "before add edges");
}
return this.sourceId;
}
@@ -96,9 +96,8 @@ public class Edge extends GraphElement {
this.targetId = this.target.id();
}
if (this.targetId == null) {
- throw new InvalidOperationException(
- "Must set target vertex id or add vertices " +
- "before add edges");
+ throw new InvalidOperationException("Must set target vertex id or add vertices " +
+ "before add edges");
}
return this.targetId;
}
@@ -182,9 +181,8 @@ public class Edge extends GraphElement {
public Edge removeProperty(String key) {
E.checkNotNull(key, "The property name can not be null");
if (!this.properties.containsKey(key)) {
- throw new InvalidOperationException(
- "The edge '%s' doesn't have the property '%s'",
- this.id, key);
+ throw new InvalidOperationException("The edge '%s' doesn't have the property '%s'",
+ this.id, key);
}
Edge edge = new Edge(this.label);
edge.id(this.id);
@@ -201,11 +199,9 @@ public class Edge extends GraphElement {
@Override
public String toString() {
- return String.format("{id=%s, sourceId=%s, sourceLabel=%s, " +
- "targetId=%s, targetLabel=%s, " +
- "label=%s, properties=%s}",
- this.id, this.sourceId, this.sourceLabel,
- this.targetId, this.targetLabel,
- this.label, this.properties);
+ return String.format("{id=%s, sourceId=%s, sourceLabel=%s, targetId=%s, " +
+ "targetLabel=%s, label=%s, properties=%s}",
+ this.id, this.sourceId, this.sourceLabel, this.targetId,
+ this.targetLabel, this.label, this.properties);
}
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Pageable.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Pageable.java
index 9a8b8f02..a5895964 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Pageable.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Pageable.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.graph;
import java.util.List;
import org.apache.hugegraph.structure.GraphElement;
+
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Path.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Path.java
index 9da50cc6..9f2aa174 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Path.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Path.java
@@ -27,6 +27,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.hugegraph.structure.constant.GraphAttachable;
import org.apache.hugegraph.driver.GraphManager;
+
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Vertex.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Vertex.java
index 36111d15..777d7a52 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Vertex.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/graph/Vertex.java
@@ -24,6 +24,7 @@ import java.util.Map;
import org.apache.hugegraph.exception.InvalidOperationException;
import org.apache.hugegraph.structure.GraphElement;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -87,9 +88,8 @@ public class Vertex extends GraphElement {
public Vertex removeProperty(String key) {
E.checkNotNull(key, "The property name can not be null");
if (!this.properties.containsKey(key)) {
- throw new InvalidOperationException(
- "The vertex '%s' doesn't have the property '%s'",
- this.id, key);
+ throw new InvalidOperationException("The vertex '%s' doesn't have the property '%s'",
+ this.id, key);
}
Vertex vertex = new Vertex(this.label);
vertex.id(this.id);
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/gremlin/Response.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/gremlin/Response.java
index ea0f615f..b8a0b1bf 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/gremlin/Response.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/gremlin/Response.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.gremlin;
import java.util.Map;
import org.apache.hugegraph.driver.GraphManager;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class Response {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/gremlin/ResultSet.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/gremlin/ResultSet.java
index a3d4881e..63d7467a 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/gremlin/ResultSet.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/gremlin/ResultSet.java
@@ -33,6 +33,7 @@ import org.apache.hugegraph.structure.graph.Edge;
import org.apache.hugegraph.structure.graph.Path;
import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
@@ -91,7 +92,7 @@ public class ResultSet {
return new Result(object);
} catch (Exception e) {
throw new SerializeException(
- "Failed to deserialize: %s", e, object);
+ "Failed to deserialize: %s", e, object);
}
}
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/BuilderProxy.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/BuilderProxy.java
index ac088c2c..78724991 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/BuilderProxy.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/BuilderProxy.java
@@ -35,10 +35,8 @@ public class BuilderProxy<T> implements InvocationHandler {
public BuilderProxy(T builder) {
this.finished = false;
this.builder = builder;
- this.proxy = (T) Proxy.newProxyInstance(
- builder.getClass().getClassLoader(),
- builder.getClass().getInterfaces(),
- this);
+ this.proxy = (T) Proxy.newProxyInstance(builder.getClass().getClassLoader(),
+ builder.getClass().getInterfaces(), this);
}
public T proxy() {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/IndexLabel.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/IndexLabel.java
index 336078a7..bed77c5e 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/IndexLabel.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/IndexLabel.java
@@ -31,6 +31,7 @@ import org.apache.hugegraph.exception.NotSupportException;
import org.apache.hugegraph.structure.SchemaElement;
import org.apache.hugegraph.util.CollectionUtil;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/PropertyKey.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/PropertyKey.java
index 6bb70a9a..92a6dd54 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/PropertyKey.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/PropertyKey.java
@@ -27,6 +27,7 @@ import org.apache.hugegraph.structure.constant.DataType;
import org.apache.hugegraph.structure.constant.HugeType;
import org.apache.hugegraph.structure.constant.WriteType;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/SchemaLabel.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/SchemaLabel.java
index 07beecd7..c50d8f71 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/SchemaLabel.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/SchemaLabel.java
@@ -25,6 +25,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;
import org.apache.hugegraph.structure.SchemaElement;
+
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/VertexLabel.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/VertexLabel.java
index 68cac591..2f95bb03 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/VertexLabel.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/schema/VertexLabel.java
@@ -28,6 +28,7 @@ import org.apache.hugegraph.structure.constant.IdStrategy;
import org.apache.hugegraph.driver.SchemaManager;
import org.apache.hugegraph.util.CollectionUtil;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CountRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CountRequest.java
index 59350875..62341fcb 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CountRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CountRequest.java
@@ -25,6 +25,7 @@ import java.util.List;
import org.apache.hugegraph.api.API;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class CountRequest {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CrosspointsRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CrosspointsRequest.java
index 1ec6a1d6..d854469e 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CrosspointsRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CrosspointsRequest.java
@@ -28,6 +28,7 @@ import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Direction;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class CrosspointsRequest {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CustomizedCrosspoints.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CustomizedCrosspoints.java
index c22f55b1..ebbbc3af 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CustomizedCrosspoints.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CustomizedCrosspoints.java
@@ -24,6 +24,7 @@ import java.util.Set;
import org.apache.hugegraph.structure.graph.Path;
import org.apache.hugegraph.structure.graph.Vertex;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class CustomizedCrosspoints {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CustomizedPathsRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CustomizedPathsRequest.java
index 3beac7d2..b1582b88 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CustomizedPathsRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/CustomizedPathsRequest.java
@@ -30,6 +30,7 @@ import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Direction;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class CustomizedPathsRequest {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/EdgeStep.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/EdgeStep.java
index a3272926..e81896eb 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/EdgeStep.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/EdgeStep.java
@@ -28,6 +28,7 @@ import org.apache.hugegraph.api.API;
import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Direction;
import org.apache.hugegraph.structure.constant.Traverser;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class EdgeStep {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/FusiformSimilarity.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/FusiformSimilarity.java
index dac07d63..1ea79d68 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/FusiformSimilarity.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/FusiformSimilarity.java
@@ -23,6 +23,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.hugegraph.structure.graph.Vertex;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class FusiformSimilarity {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/FusiformSimilarityRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/FusiformSimilarityRequest.java
index 55ff5e01..98d7d237 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/FusiformSimilarityRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/FusiformSimilarityRequest.java
@@ -23,6 +23,7 @@ import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Direction;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class FusiformSimilarityRequest {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/Kneighbor.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/Kneighbor.java
index bb6dd6aa..0c22fdfc 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/Kneighbor.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/Kneighbor.java
@@ -24,6 +24,7 @@ import java.util.Set;
import org.apache.hugegraph.structure.graph.Path;
import org.apache.hugegraph.structure.graph.Vertex;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class Kneighbor {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/KneighborRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/KneighborRequest.java
index 71f34c41..a33f3811 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/KneighborRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/KneighborRequest.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.traverser;
import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class KneighborRequest {
@@ -33,13 +34,13 @@ public class KneighborRequest {
@JsonProperty("max_depth")
public int maxDepth;
@JsonProperty("count_only")
- public boolean countOnly = false;
+ public boolean countOnly;
@JsonProperty("limit")
- public int limit = Traverser.DEFAULT_LIMIT;
+ public int limit;
@JsonProperty("with_vertex")
- public boolean withVertex = false;
+ public boolean withVertex;
@JsonProperty("with_path")
- public boolean withPath = false;
+ public boolean withPath;
private KneighborRequest() {
this.source = null;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/Kout.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/Kout.java
index a04ec7fd..7c7c3dfd 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/Kout.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/Kout.java
@@ -24,6 +24,7 @@ import java.util.Set;
import org.apache.hugegraph.structure.graph.Path;
import org.apache.hugegraph.structure.graph.Vertex;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class Kout {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/KoutRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/KoutRequest.java
index c3fac8bb..c883458c 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/KoutRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/KoutRequest.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.traverser;
import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class KoutRequest {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/MultiNodeShortestPathRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/MultiNodeShortestPathRequest.java
index 4dd6b133..1c22090e 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/MultiNodeShortestPathRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/MultiNodeShortestPathRequest.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.traverser;
import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class MultiNodeShortestPathRequest {
@@ -33,9 +34,9 @@ public class MultiNodeShortestPathRequest {
@JsonProperty("max_depth")
public int maxDepth;
@JsonProperty("capacity")
- public long capacity = Traverser.DEFAULT_CAPACITY;
+ public long capacity;
@JsonProperty("with_vertex")
- public boolean withVertex = false;
+ public boolean withVertex;
private MultiNodeShortestPathRequest() {
this.vertices = null;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/PathsRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/PathsRequest.java
index 7f6cbb26..fd35bf8e 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/PathsRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/PathsRequest.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.traverser;
import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class PathsRequest {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/PathsWithVertices.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/PathsWithVertices.java
index 8d4df2dd..64508e50 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/PathsWithVertices.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/PathsWithVertices.java
@@ -23,6 +23,7 @@ import java.util.List;
import java.util.Set;
import org.apache.hugegraph.structure.graph.Vertex;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class PathsWithVertices {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/RepeatEdgeStep.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/RepeatEdgeStep.java
index 9ae90ad1..8c1f2df0 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/RepeatEdgeStep.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/RepeatEdgeStep.java
@@ -25,12 +25,13 @@ import java.util.Map;
import org.apache.hugegraph.api.API;
import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Direction;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class RepeatEdgeStep extends EdgeStep {
@JsonProperty("max_times")
- public int maxTimes = 1;
+ public int maxTimes;
private RepeatEdgeStep() {
super();
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/SingleSourceJaccardSimilarityRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/SingleSourceJaccardSimilarityRequest.java
index 9f0de0e5..e81705b9 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/SingleSourceJaccardSimilarityRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/SingleSourceJaccardSimilarityRequest.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.structure.traverser;
import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class SingleSourceJaccardSimilarityRequest {
@@ -31,9 +32,9 @@ public class SingleSourceJaccardSimilarityRequest {
@JsonProperty("step")
public EdgeStep step;
@JsonProperty("top")
- public int top = 10;
+ public int top;
@JsonProperty("capacity")
- public long capacity = Traverser.DEFAULT_CAPACITY;
+ public long capacity;
private SingleSourceJaccardSimilarityRequest() {
this.vertex = null;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/TemplatePathsRequest.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/TemplatePathsRequest.java
index 379e9b65..f2fd6fe8 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/TemplatePathsRequest.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/TemplatePathsRequest.java
@@ -25,6 +25,7 @@ import java.util.List;
import org.apache.hugegraph.api.traverser.TraversersAPI;
import org.apache.hugegraph.structure.constant.Traverser;
import org.apache.hugegraph.util.E;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class TemplatePathsRequest {
@@ -36,13 +37,13 @@ public class TemplatePathsRequest {
@JsonProperty("steps")
public List<RepeatEdgeStep> steps;
@JsonProperty("with_ring")
- public boolean withRing = false;
+ public boolean withRing;
@JsonProperty("capacity")
- public long capacity = Traverser.DEFAULT_CAPACITY;
+ public long capacity;
@JsonProperty("limit")
- public int limit = Traverser.DEFAULT_PATHS_LIMIT;
+ public int limit;
@JsonProperty("with_vertex")
- public boolean withVertex = false;
+ public boolean withVertex;
private TemplatePathsRequest() {
this.sources = null;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/VerticesArgs.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/VerticesArgs.java
index 75f0bf7e..636133ca 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/VerticesArgs.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/VerticesArgs.java
@@ -51,7 +51,7 @@ public class VerticesArgs {
public static class Builder {
- private VerticesArgs vertices;
+ private final VerticesArgs vertices;
private Builder() {
this.vertices = new VerticesArgs();
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/WeightedPath.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/WeightedPath.java
index 013f93c2..b8e396b1 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/WeightedPath.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/WeightedPath.java
@@ -23,6 +23,7 @@ import java.util.List;
import java.util.Set;
import org.apache.hugegraph.structure.graph.Vertex;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class WeightedPath {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/WeightedPaths.java b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/WeightedPaths.java
index bec563c2..140a5b77 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/WeightedPaths.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/structure/traverser/WeightedPaths.java
@@ -23,6 +23,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.hugegraph.structure.graph.Vertex;
+
import com.fasterxml.jackson.annotation.JsonProperty;
public class WeightedPaths {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java b/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java
index 4b131012..d7d6eec3 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/util/CommonUtil.java
@@ -19,8 +19,6 @@
package org.apache.hugegraph.util;
-import org.apache.hugegraph.util.E;
-
import java.util.Map;
public final class CommonUtil {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/util/IdUtil.java b/hugegraph-client/src/main/java/org/apache/hugegraph/util/IdUtil.java
index e8a06ba6..de03318c 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/util/IdUtil.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/util/IdUtil.java
@@ -22,7 +22,7 @@ package org.apache.hugegraph.util;
import org.apache.commons.lang3.StringUtils;
/**
- * Copied from HugeGraph(https://github.com/hugegraph/hugegraph)
+ * Copied from HugeGraph(<a href="https://github.com/hugegraph/hugegraph">...</a>)
*/
public final class IdUtil {
@@ -62,7 +62,7 @@ public final class IdUtil {
* execution, we forbid the use of special characters as delimiter
* or escape sign.
* The `limit` param -1 in split method can ensure empty string be
- * splited to a part.
+ * split to a part.
*/
String[] parts = id.split("(?<!" + escape + ")" + splitor, -1);
for (int i = 0; i < parts.length; i++) {
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/util/JsonUtil.java b/hugegraph-client/src/main/java/org/apache/hugegraph/util/JsonUtil.java
index a2df68d4..2511f75e 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/util/JsonUtil.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/util/JsonUtil.java
@@ -22,6 +22,7 @@ package org.apache.hugegraph.util;
import java.io.IOException;
import org.apache.hugegraph.rest.SerializeException;
+
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.Module;
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/util/SplicingIdGenerator.java b/hugegraph-client/src/main/java/org/apache/hugegraph/util/SplicingIdGenerator.java
index 8080891b..aee4c82f 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/util/SplicingIdGenerator.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/util/SplicingIdGenerator.java
@@ -23,7 +23,7 @@ import java.util.Arrays;
import java.util.List;
/**
- * Copied from HugeGraph(https://github.com/hugegraph/hugegraph)
+ * Copied from HugeGraph(<a href="https://github.com/hugegraph/hugegraph">...</a>)
*/
public class SplicingIdGenerator {
@@ -58,8 +58,8 @@ public class SplicingIdGenerator {
/**
* Concat multiple ids into one composite id with IDS_SPLITOR
- * @param ids the string id values to be concatted
- * @return concatted string value
+ * @param ids the string id values to be contacted
+ * @return contacted string value
*/
public static String concat(String... ids) {
// NOTE: must support string id when using this method
@@ -68,8 +68,8 @@ public class SplicingIdGenerator {
/**
* Split a composite id into multiple ids with IDS_SPLITOR
- * @param ids the string id value to be splitted
- * @return splitted string values
+ * @param ids the string id value to be split
+ * @return split string values
*/
public static String[] split(String ids) {
return IdUtil.unescape(ids, IDS_SPLITOR_STR, ESCAPE_STR);
@@ -77,8 +77,8 @@ public class SplicingIdGenerator {
/**
* Concat property values with NAME_SPLITOR
- * @param values the property values to be concatted
- * @return concatted string value
+ * @param values the property values to be contacted
+ * @return contacted string value
*/
public static String concatValues(List<?> values) {
// Convert the object list to string array
@@ -92,8 +92,8 @@ public class SplicingIdGenerator {
/**
* Concat property values with NAME_SPLITOR
- * @param values the property values to be concatted
- * @return concatted string value
+ * @param values the property values to be contacted
+ * @return contacted string value
*/
public static String concatValues(Object... values) {
return concatValues(Arrays.asList(values));
diff --git a/hugegraph-client/src/main/java/org/apache/hugegraph/version/ClientVersion.java b/hugegraph-client/src/main/java/org/apache/hugegraph/version/ClientVersion.java
index 99a53567..5cd84c3b 100644
--- a/hugegraph-client/src/main/java/org/apache/hugegraph/version/ClientVersion.java
+++ b/hugegraph-client/src/main/java/org/apache/hugegraph/version/ClientVersion.java
@@ -35,7 +35,6 @@ public class ClientVersion {
public static void check() {
// Check version of hugegraph-common
- VersionUtil.check(CommonVersion.VERSION, "2.1", "2.2",
- CommonVersion.NAME);
+ VersionUtil.check(CommonVersion.VERSION, "2.1", "2.2", CommonVersion.NAME);
}
}
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/BaseClientTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/BaseClientTest.java
index 454f3565..7ded4e58 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/BaseClientTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/BaseClientTest.java
@@ -47,6 +47,7 @@ import org.apache.hugegraph.structure.schema.IndexLabel;
import org.apache.hugegraph.structure.schema.PropertyKey;
import org.apache.hugegraph.structure.schema.VertexLabel;
import org.apache.hugegraph.testutil.Assert;
+
import com.google.common.collect.ImmutableMap;
public class BaseClientTest {
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/ApiTestSuite.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/ApiTestSuite.java
index 951fe160..3f73193a 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/ApiTestSuite.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/ApiTestSuite.java
@@ -52,51 +52,52 @@ import org.apache.hugegraph.api.traverser.WeightedShortestPathApiTest;
@RunWith(Suite.class)
@Suite.SuiteClasses({
- PropertyKeyApiTest.class,
- VertexLabelApiTest.class,
- EdgeLabelApiTest.class,
- IndexLabelApiTest.class,
- SchemaApiTest.class,
+ PropertyKeyApiTest.class,
+ VertexLabelApiTest.class,
+ EdgeLabelApiTest.class,
+ IndexLabelApiTest.class,
+ SchemaApiTest.class,
- VertexApiTest.class,
- EdgeApiTest.class,
- BatchUpdateElementApiTest.class,
+ VertexApiTest.class,
+ EdgeApiTest.class,
+ BatchUpdateElementApiTest.class,
- GremlinApiTest.class,
- VariablesApiTest.class,
- TaskApiTest.class,
- JobApiTest.class,
- RestoreApiTest.class,
- GraphsApiTest.class,
+ GremlinApiTest.class,
+ VariablesApiTest.class,
+ TaskApiTest.class,
+ JobApiTest.class,
+ RestoreApiTest.class,
+ GraphsApiTest.class,
- CommonTraverserApiTest.class,
- KoutApiTest.class,
- KneighborApiTest.class,
- PathsApiTest.class,
- CountApiTest.class,
- RingsRaysApiTest.class,
- SameNeighborsApiTest.class,
- JaccardSimilarityApiTest.class,
- ShortestPathApiTest.class,
- AllShortestPathsApiTest.class,
- SingleSourceShortestPathApiTest.class,
- WeightedShortestPathApiTest.class,
- MultiNodeShortestPathApiTest.class,
- CustomizedPathsApiTest.class,
- TemplatePathsApiTest.class,
- FusiformSimilarityApiTest.class,
- NeighborRankApiTest.class,
- PersonalRankApiTest.class,
+ CommonTraverserApiTest.class,
+ KoutApiTest.class,
+ KneighborApiTest.class,
+ PathsApiTest.class,
+ CountApiTest.class,
+ RingsRaysApiTest.class,
+ SameNeighborsApiTest.class,
+ JaccardSimilarityApiTest.class,
+ ShortestPathApiTest.class,
+ AllShortestPathsApiTest.class,
+ SingleSourceShortestPathApiTest.class,
+ WeightedShortestPathApiTest.class,
+ MultiNodeShortestPathApiTest.class,
+ CustomizedPathsApiTest.class,
+ TemplatePathsApiTest.class,
+ FusiformSimilarityApiTest.class,
+ NeighborRankApiTest.class,
+ PersonalRankApiTest.class,
- TargetApiTest.class,
- GroupApiTest.class,
- UserApiTest.class,
- AccessApiTest.class,
- BelongApiTest.class,
- ProjectApiTest.class,
- LoginApiTest.class,
- LogoutApiTest.class,
- TokenApiTest.class
+ TargetApiTest.class,
+ GroupApiTest.class,
+ UserApiTest.class,
+ AccessApiTest.class,
+ BelongApiTest.class,
+ ProjectApiTest.class,
+ LoginApiTest.class,
+ LogoutApiTest.class,
+ TokenApiTest.class
})
+
public class ApiTestSuite {
}
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/BatchUpdateElementApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/BatchUpdateElementApiTest.java
index e3053a9a..0ca7ab83 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/BatchUpdateElementApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/BatchUpdateElementApiTest.java
@@ -41,6 +41,7 @@ import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.structure.schema.VertexLabel;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.testutil.Whitebox;
+
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
@@ -500,7 +501,7 @@ public class BatchUpdateElementApiTest extends BaseApiTest {
@Test
public void testEdgeBatchUpdateWithInvalidArgs() {
BatchEdgeRequest req1 = batchEdgeRequest("list", "old", "old",
- UpdateStrategy.ELIMINATE);
+ UpdateStrategy.ELIMINATE);
Assert.assertThrows(ServerException.class, () -> {
List<Edge> edges = Whitebox.getInternalState(req1, "edges");
edges.set(1, null);
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/EdgeApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/EdgeApiTest.java
index 67ee0794..1d39f30e 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/EdgeApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/EdgeApiTest.java
@@ -37,6 +37,7 @@ import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.structure.schema.VertexLabel;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.util.DateUtil;
+
import com.google.common.collect.ImmutableMap;
public class EdgeApiTest extends BaseApiTest {
@@ -211,9 +212,8 @@ public class EdgeApiTest extends BaseApiTest {
Assert.assertEquals("software", edge.targetLabel());
Assert.assertEquals(outVId, edge.sourceId());
Assert.assertEquals(inVId, edge.targetId());
- Map<String, Object> props = ImmutableMap.of(
- "date", Utils.date("2017-03-24"),
- "city", "Beijing");
+ Map<String, Object> props = ImmutableMap.of("date", Utils.date("2017-03-24"),
+ "city", "Beijing");
Assert.assertEquals(props, edge.properties());
}
@@ -581,7 +581,7 @@ public class EdgeApiTest extends BaseApiTest {
/**
* Note: When the vertex of an edge is dirty (id), g.E() will
- * construct the vertex, and then throw a illegal exception.
+ * construct the vertex, and then throw an illegal exception.
* That will lead clearData error.
* (Icafe: HugeGraph-768)
*/
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/EdgeLabelApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/EdgeLabelApiTest.java
index 6a56a412..55ec7fb4 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/EdgeLabelApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/EdgeLabelApiTest.java
@@ -34,12 +34,13 @@ import org.apache.hugegraph.structure.constant.Frequency;
import org.apache.hugegraph.structure.schema.EdgeLabel;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.util.DateUtil;
+
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
public class EdgeLabelApiTest extends BaseApiTest {
- private static Function<String, EdgeLabel> fillEdgeLabel =
+ private static final Function<String, EdgeLabel> fillEdgeLabel =
(name) -> schema().edgeLabel(name)
.sourceLabel("person")
.targetLabel("software")
@@ -59,7 +60,7 @@ public class EdgeLabelApiTest extends BaseApiTest {
edgeLabelAPI.list().forEach(el -> {
taskIds.add(edgeLabelAPI.delete(el.name()));
});
- taskIds.forEach(taskId -> waitUntilTaskCompleted(taskId));
+ taskIds.forEach(BaseApiTest::waitUntilTaskCompleted);
}
@Test
@@ -71,9 +72,9 @@ public class EdgeLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", edgeLabel.sourceLabel());
Assert.assertEquals("software", edgeLabel.targetLabel());
Assert.assertEquals(Frequency.SINGLE, edgeLabel.frequency());
- Assert.assertEquals(true, edgeLabel.enableLabelIndex());
+ Assert.assertTrue(edgeLabel.enableLabelIndex());
Set<String> props = ImmutableSet.of("date", "city");
- Assert.assertTrue(props.size() == edgeLabel.properties().size());
+ Assert.assertEquals(props.size(), edgeLabel.properties().size());
Assert.assertTrue(props.containsAll(edgeLabel.properties()));
}
@@ -91,9 +92,9 @@ public class EdgeLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", edgeLabel.sourceLabel());
Assert.assertEquals("software", edgeLabel.targetLabel());
Assert.assertEquals(Frequency.SINGLE, edgeLabel.frequency());
- Assert.assertEquals(false, edgeLabel.enableLabelIndex());
+ Assert.assertFalse(edgeLabel.enableLabelIndex());
Set<String> props = ImmutableSet.of("date", "city");
- Assert.assertTrue(props.size() == edgeLabel.properties().size());
+ Assert.assertEquals(props.size(), edgeLabel.properties().size());
Assert.assertTrue(props.containsAll(edgeLabel.properties()));
}
@@ -111,9 +112,9 @@ public class EdgeLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", edgeLabel.sourceLabel());
Assert.assertEquals("software", edgeLabel.targetLabel());
Assert.assertEquals(Frequency.SINGLE, edgeLabel.frequency());
- Assert.assertEquals(false, edgeLabel.enableLabelIndex());
+ Assert.assertFalse(edgeLabel.enableLabelIndex());
Set<String> props = ImmutableSet.of("date", "city");
- Assert.assertTrue(props.size() == edgeLabel.properties().size());
+ Assert.assertEquals(props.size(), edgeLabel.properties().size());
Assert.assertTrue(props.containsAll(edgeLabel.properties()));
}
@@ -231,9 +232,9 @@ public class EdgeLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", edgeLabel.sourceLabel());
Assert.assertEquals("software", edgeLabel.targetLabel());
Assert.assertEquals(Frequency.SINGLE, edgeLabel.frequency());
- Assert.assertEquals(true, edgeLabel.enableLabelIndex());
+ Assert.assertTrue(edgeLabel.enableLabelIndex());
Set<String> props = ImmutableSet.of("date", "city");
- Assert.assertTrue(props.size() == edgeLabel.properties().size());
+ Assert.assertEquals(props.size(), edgeLabel.properties().size());
Assert.assertTrue(props.containsAll(edgeLabel.properties()));
Assert.assertEquals(0L, edgeLabel.ttl());
Assert.assertNull(edgeLabel.ttlStartTime());
@@ -251,8 +252,8 @@ public class EdgeLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", edgeLabel.sourceLabel());
Assert.assertEquals("software", edgeLabel.targetLabel());
Assert.assertEquals(Frequency.SINGLE, edgeLabel.frequency());
- Assert.assertEquals(true, edgeLabel.enableLabelIndex());
- Assert.assertTrue(props.size() == edgeLabel.properties().size());
+ Assert.assertTrue(edgeLabel.enableLabelIndex());
+ Assert.assertEquals(props.size(), edgeLabel.properties().size());
Assert.assertTrue(props.containsAll(edgeLabel.properties()));
Assert.assertEquals(3000L, edgeLabel.ttl());
Assert.assertNull(edgeLabel.ttlStartTime());
@@ -271,8 +272,8 @@ public class EdgeLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", edgeLabel.sourceLabel());
Assert.assertEquals("software", edgeLabel.targetLabel());
Assert.assertEquals(Frequency.SINGLE, edgeLabel.frequency());
- Assert.assertEquals(true, edgeLabel.enableLabelIndex());
- Assert.assertTrue(props.size() == edgeLabel.properties().size());
+ Assert.assertTrue(edgeLabel.enableLabelIndex());
+ Assert.assertEquals(props.size(), edgeLabel.properties().size());
Assert.assertTrue(props.containsAll(edgeLabel.properties()));
Assert.assertEquals(3000L, edgeLabel.ttl());
Assert.assertEquals("date", edgeLabel.ttlStartTime());
@@ -356,7 +357,7 @@ public class EdgeLabelApiTest extends BaseApiTest {
Assert.assertEquals(props, edgeLabel1.properties());
EdgeLabel edgeLabel2 = schema().edgeLabel("created")
- .nullableKeys("undefined").build();
+ .nullableKeys("undefined").build();
Utils.assertResponseError(400, () -> {
edgeLabelAPI.append(edgeLabel2);
});
@@ -407,7 +408,7 @@ public class EdgeLabelApiTest extends BaseApiTest {
Assert.assertEquals(props, edgeLabel1.properties());
EdgeLabel edgeLabel2 = schema().edgeLabel("created")
- .properties("city").build();
+ .properties("city").build();
Utils.assertResponseError(400, () -> {
edgeLabelAPI.eliminate(edgeLabel2);
});
@@ -415,9 +416,7 @@ public class EdgeLabelApiTest extends BaseApiTest {
@Test
public void testGet() {
- EdgeLabel edgeLabel1 = edgeLabelAPI.create(
- fillEdgeLabel.apply("created"));
-
+ EdgeLabel edgeLabel1 = edgeLabelAPI.create(fillEdgeLabel.apply("created"));
EdgeLabel edgeLabel2 = edgeLabelAPI.get("created");
Assert.assertEquals(edgeLabel1.name(), edgeLabel2.name());
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/GraphsApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/GraphsApiTest.java
index b2863c38..c72e2503 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/GraphsApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/GraphsApiTest.java
@@ -37,18 +37,17 @@ import org.apache.hugegraph.structure.graph.Edge;
import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.structure.gremlin.ResultSet;
import org.apache.hugegraph.testutil.Assert;
+
import com.google.common.collect.ImmutableSet;
//@Ignore
public class GraphsApiTest extends BaseApiTest {
private static final String GRAPH2 = "hugegraph2";
- private static final String CONFIG2_PATH =
- "src/test/resources/hugegraph-create.properties";
+ private static final String CONFIG2_PATH = "src/test/resources/hugegraph-create.properties";
private static final String GRAPH3 = "hugegraph3";
- private static final String CONFIG3_PATH =
- "src/test/resources/hugegraph-clone.properties";
+ private static final String CONFIG3_PATH = "src/test/resources/hugegraph-clone.properties";
@Override
@After
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/IndexLabelApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/IndexLabelApiTest.java
index d09b7752..6b3db10e 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/IndexLabelApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/IndexLabelApiTest.java
@@ -40,12 +40,13 @@ import org.apache.hugegraph.structure.schema.IndexLabel;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.util.DateUtil;
import org.apache.hugegraph.util.VersionUtil;
+
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
public class IndexLabelApiTest extends BaseApiTest {
- private static Function<String, IndexLabel> fillIndexLabel =
+ private static final Function<String, IndexLabel> fillIndexLabel =
(name) -> schema().indexLabel(name)
.onV("person")
.by("age")
@@ -66,21 +67,20 @@ public class IndexLabelApiTest extends BaseApiTest {
indexLabelAPI.list().forEach(il -> {
taskIds.add(indexLabelAPI.delete(il.name()));
});
- taskIds.forEach(taskId -> waitUntilTaskCompleted(taskId));
+ taskIds.forEach(BaseApiTest::waitUntilTaskCompleted);
}
@Test
public void testCreate() {
- IndexLabel indexLabel = indexLabelAPI.create(
- fillIndexLabel.apply("personByAge"))
- .indexLabel();
+ IndexLabel indexLabel = indexLabelAPI.create(fillIndexLabel.apply("personByAge"))
+ .indexLabel();
Assert.assertEquals("personByAge", indexLabel.name());
Assert.assertEquals(HugeType.VERTEX_LABEL, indexLabel.baseType());
Assert.assertEquals("person", indexLabel.baseValue());
Assert.assertEquals(IndexType.RANGE, indexLabel.indexType());
List<String> fields = ImmutableList.of("age");
- Assert.assertTrue(fields.size() == indexLabel.indexFields().size());
+ Assert.assertEquals(fields.size(), indexLabel.indexFields().size());
Assert.assertTrue(fields.containsAll(indexLabel.indexFields()));
}
@@ -97,7 +97,7 @@ public class IndexLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", indexLabel.baseValue());
Assert.assertEquals(IndexType.RANGE, indexLabel.indexType());
List<String> fields = ImmutableList.of("age");
- Assert.assertTrue(fields.size() == indexLabel.indexFields().size());
+ Assert.assertEquals(fields.size(), indexLabel.indexFields().size());
Assert.assertTrue(fields.containsAll(indexLabel.indexFields()));
}
@@ -244,7 +244,7 @@ public class IndexLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", indexLabel.baseValue());
Assert.assertEquals(IndexType.UNIQUE, indexLabel.indexType());
List<String> fields = ImmutableList.of("city");
- Assert.assertTrue(fields.size() == indexLabel.indexFields().size());
+ Assert.assertEquals(fields.size(), indexLabel.indexFields().size());
Assert.assertTrue(fields.containsAll(indexLabel.indexFields()));
}
@@ -277,9 +277,8 @@ public class IndexLabelApiTest extends BaseApiTest {
@Test
public void testList() {
- IndexLabel indexLabel1 = indexLabelAPI.create(
- fillIndexLabel.apply("personByAge"))
- .indexLabel();
+ IndexLabel indexLabel1 = indexLabelAPI.create(fillIndexLabel.apply("personByAge"))
+ .indexLabel();
IndexLabel indexLabel2 = schema().indexLabel("personByCity")
.onV("person")
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/PropertyKeyApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/PropertyKeyApiTest.java
index b8eb8328..09bbdc61 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/PropertyKeyApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/PropertyKeyApiTest.java
@@ -34,6 +34,7 @@ import org.apache.hugegraph.structure.constant.WriteType;
import org.apache.hugegraph.structure.schema.PropertyKey;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.util.DateUtil;
+
import com.google.common.collect.ImmutableList;
public class PropertyKeyApiTest extends BaseApiTest {
@@ -44,7 +45,7 @@ public class PropertyKeyApiTest extends BaseApiTest {
propertyKeyAPI.list().forEach(propertyKey -> {
pkTaskIds.add(propertyKeyAPI.delete(propertyKey.name()));
});
- pkTaskIds.forEach(taskId -> waitUntilTaskCompleted(taskId));
+ pkTaskIds.forEach(BaseApiTest::waitUntilTaskCompleted);
}
@Test
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/SchemaApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/SchemaApiTest.java
index 8fcd5540..d0907bf9 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/SchemaApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/SchemaApiTest.java
@@ -30,7 +30,7 @@ import org.apache.hugegraph.testutil.Assert;
public class SchemaApiTest extends BaseApiTest {
@Test
- public void testlist() {
+ public void testList() {
BaseApiTest.initPropertyKey();
BaseApiTest.initVertexLabel();
BaseApiTest.initEdgeLabel();
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/TaskApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/TaskApiTest.java
index 8691f298..0f985d66 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/TaskApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/TaskApiTest.java
@@ -212,8 +212,8 @@ public class TaskApiTest extends BaseApiTest {
schema().vertexLabel("man").useAutomaticId().ifNotExist().create();
String groovy = "for (int i = 0; i < 10; i++) {" +
- "hugegraph.addVertex(T.label, 'man');" +
- "hugegraph.tx().commit();" +
+ "hugegraph.addVertex(T.label, 'man');" +
+ "hugegraph.tx().commit();" +
"}";
// Insert 10 records in sync mode
GremlinRequest request = new GremlinRequest(groovy);
@@ -233,13 +233,13 @@ public class TaskApiTest extends BaseApiTest {
* otherwise they cannot be cancelled
*/
groovy = "for (int i = 0; i < 10; i++) {" +
- "hugegraph.addVertex(T.label, 'man');" +
- "hugegraph.tx().commit();" +
- "try {" +
- "sleep(1000);" +
- "} catch (InterruptedException e) {" +
- "break;" +
- "}" +
+ " hugegraph.addVertex(T.label, 'man');" +
+ " hugegraph.tx().commit();" +
+ " try {" +
+ " sleep(1000);" +
+ " } catch (InterruptedException e) {" +
+ " break;" +
+ " }" +
"}";
request = new GremlinRequest(groovy);
long taskId = gremlin().executeAsTask(request);
@@ -254,7 +254,8 @@ public class TaskApiTest extends BaseApiTest {
} else {
try {
Thread.sleep(1000);
- } catch (InterruptedException ignored) {}
+ } catch (InterruptedException ignored) {
+ }
}
}
// Cancel async task
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/VariablesApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/VariablesApiTest.java
index 25664e3a..0cc745d2 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/VariablesApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/VariablesApiTest.java
@@ -138,12 +138,12 @@ public class VariablesApiTest extends BaseApiTest {
Assert.assertTrue(value instanceof Collection);
Collection<?> expect = (Collection<?>) value;
Collection<?> actual = (Collection<?>) variables.get(key);
- Assert.assertTrue(expect.size()== actual.size());
+ Assert.assertEquals(expect.size(), actual.size());
actual.forEach(elem -> {
Assert.assertTrue((expect.contains(elem)));
});
} else {
- Assert.assertTrue(variables.get(key).equals(value));
+ Assert.assertEquals(variables.get(key), value);
}
}
}
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/VertexApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/VertexApiTest.java
index e74c2c0c..22d430c3 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/VertexApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/VertexApiTest.java
@@ -41,6 +41,7 @@ import org.apache.hugegraph.structure.gremlin.ResultSet;
import org.apache.hugegraph.structure.schema.PropertyKey;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.util.DateUtil;
+
import com.google.common.collect.ImmutableMap;
public class VertexApiTest extends BaseApiTest {
@@ -435,13 +436,11 @@ public class VertexApiTest extends BaseApiTest {
}
// Query vertices by olap properties
- GremlinRequest request = new GremlinRequest(
- "g.V().has(\"pagerank\", P.gte(5))");
+ GremlinRequest request = new GremlinRequest("g.V().has(\"pagerank\", P.gte(5))");
ResultSet resultSet = gremlin().execute(request);
Assert.assertEquals(50, resultSet.size());
- request = new GremlinRequest(
- "g.V().has(\"wcc\", P.within(\"wcc10\", \"wcc20\"))");
+ request = new GremlinRequest("g.V().has(\"wcc\", P.within(\"wcc10\", \"wcc20\"))");
resultSet = gremlin().execute(request);
Assert.assertEquals(2, resultSet.size());
@@ -467,8 +466,7 @@ public class VertexApiTest extends BaseApiTest {
resultSet = gremlin().execute(request);
Assert.assertEquals(0, resultSet.size());
- request = new GremlinRequest(
- "g.V().has(\"wcc\", P.within(\"wcc10\", \"wcc20\"))");
+ request = new GremlinRequest("g.V().has(\"wcc\", P.within(\"wcc10\", \"wcc20\"))");
resultSet = gremlin().execute(request);
Assert.assertEquals(0, resultSet.size());
@@ -488,16 +486,15 @@ public class VertexApiTest extends BaseApiTest {
// Query after delete olap property key
Assert.assertThrows(ServerException.class, () -> {
- gremlin().execute(new GremlinRequest(
- "g.V().has(\"pagerank\", P.gte(5))"));
+ gremlin().execute(new GremlinRequest("g.V().has(\"pagerank\", P.gte(5))"));
}, e -> {
Assert.assertContains("Undefined property key: 'pagerank'",
e.getMessage());
});
Assert.assertThrows(ServerException.class, () -> {
- gremlin().execute(new GremlinRequest(
- "g.V().has(\"wcc\", P.within(\"wcc10\", \"wcc20\"))"));
+ gremlin().execute(new GremlinRequest("g.V().has(\"wcc\", " +
+ "P.within(\"wcc10\", \"wcc20\"))"));
}, e -> {
Assert.assertContains("Undefined property key: 'wcc'",
e.getMessage());
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/VertexLabelApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/VertexLabelApiTest.java
index 6251a384..47bab6c8 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/VertexLabelApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/VertexLabelApiTest.java
@@ -33,6 +33,7 @@ import org.apache.hugegraph.structure.constant.IdStrategy;
import org.apache.hugegraph.structure.schema.VertexLabel;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.util.DateUtil;
+
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
@@ -50,7 +51,7 @@ public class VertexLabelApiTest extends BaseApiTest {
vertexLabelAPI.list().forEach(vl -> {
taskIds.add(vertexLabelAPI.delete(vl.name()));
});
- taskIds.forEach(taskId -> waitUntilTaskCompleted(taskId));
+ taskIds.forEach(BaseApiTest::waitUntilTaskCompleted);
}
@Test
@@ -64,7 +65,7 @@ public class VertexLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", vertexLabel.name());
Assert.assertEquals(IdStrategy.AUTOMATIC, vertexLabel.idStrategy());
- Assert.assertEquals(true, vertexLabel.enableLabelIndex());
+ Assert.assertTrue(vertexLabel.enableLabelIndex());
Set<String> props = ImmutableSet.of("name", "age", "city");
Assert.assertEquals(props, vertexLabel.properties());
}
@@ -81,7 +82,7 @@ public class VertexLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", vertexLabel.name());
Assert.assertEquals(IdStrategy.AUTOMATIC, vertexLabel.idStrategy());
- Assert.assertEquals(false, vertexLabel.enableLabelIndex());
+ Assert.assertFalse(vertexLabel.enableLabelIndex());
Set<String> props = ImmutableSet.of("name", "age", "city");
Assert.assertEquals(props, vertexLabel.properties());
}
@@ -97,7 +98,7 @@ public class VertexLabelApiTest extends BaseApiTest {
Assert.assertEquals("person", vertexLabel.name());
Assert.assertEquals(IdStrategy.CUSTOMIZE_UUID, vertexLabel.idStrategy());
- Assert.assertEquals(true, vertexLabel.enableLabelIndex());
+ Assert.assertTrue(vertexLabel.enableLabelIndex());
Set<String> props = ImmutableSet.of("name", "age", "city");
Assert.assertEquals(props, vertexLabel.properties());
@@ -110,7 +111,7 @@ public class VertexLabelApiTest extends BaseApiTest {
Assert.assertEquals("person1", vertexLabel.name());
Assert.assertEquals(IdStrategy.CUSTOMIZE_UUID, vertexLabel.idStrategy());
- Assert.assertEquals(true, vertexLabel.enableLabelIndex());
+ Assert.assertTrue(vertexLabel.enableLabelIndex());
props = ImmutableSet.of("name", "age", "city");
Assert.assertEquals(props, vertexLabel.properties());
}
@@ -248,7 +249,7 @@ public class VertexLabelApiTest extends BaseApiTest {
Assert.assertEquals("person1", vertexLabel.name());
Assert.assertEquals(IdStrategy.AUTOMATIC, vertexLabel.idStrategy());
- Assert.assertEquals(true, vertexLabel.enableLabelIndex());
+ Assert.assertTrue(vertexLabel.enableLabelIndex());
Set<String> props = ImmutableSet.of("name", "age", "date");
Assert.assertEquals(props, vertexLabel.properties());
Assert.assertEquals(0L, vertexLabel.ttl());
@@ -263,7 +264,7 @@ public class VertexLabelApiTest extends BaseApiTest {
Assert.assertEquals("person2", vertexLabel.name());
Assert.assertEquals(IdStrategy.AUTOMATIC, vertexLabel.idStrategy());
- Assert.assertEquals(true, vertexLabel.enableLabelIndex());
+ Assert.assertTrue(vertexLabel.enableLabelIndex());
Assert.assertEquals(props, vertexLabel.properties());
Assert.assertEquals(3000L, vertexLabel.ttl());
Assert.assertNull(vertexLabel.ttlStartTime());
@@ -278,7 +279,7 @@ public class VertexLabelApiTest extends BaseApiTest {
Assert.assertEquals("person3", vertexLabel.name());
Assert.assertEquals(IdStrategy.AUTOMATIC, vertexLabel.idStrategy());
- Assert.assertEquals(true, vertexLabel.enableLabelIndex());
+ Assert.assertTrue(vertexLabel.enableLabelIndex());
Assert.assertEquals(props, vertexLabel.properties());
Assert.assertEquals(3000L, vertexLabel.ttl());
Assert.assertEquals("date", vertexLabel.ttlStartTime());
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/api/auth/ProjectApiTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/api/auth/ProjectApiTest.java
index 460e4cdc..f45f6400 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/api/auth/ProjectApiTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/api/auth/ProjectApiTest.java
@@ -34,6 +34,7 @@ import org.junit.Test;
import org.apache.hugegraph.exception.ServerException;
import org.apache.hugegraph.structure.auth.Project;
import org.apache.hugegraph.testutil.Assert;
+
import com.google.common.collect.ImmutableSet;
public class ProjectApiTest extends AuthApiTest {
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/AuthManagerTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/AuthManagerTest.java
index 830fa707..693e2a07 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/AuthManagerTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/AuthManagerTest.java
@@ -42,6 +42,7 @@ import org.apache.hugegraph.structure.auth.TokenPayload;
import org.apache.hugegraph.structure.auth.User;
import org.apache.hugegraph.structure.auth.User.UserRole;
import org.apache.hugegraph.testutil.Assert;
+
import com.google.common.collect.ImmutableSet;
public class AuthManagerTest extends BaseFuncTest {
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeLabelTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeLabelTest.java
index aba625f6..d2e31e41 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeLabelTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeLabelTest.java
@@ -34,6 +34,7 @@ import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.util.DateUtil;
import org.apache.hugegraph.testutil.Utils;
+
import com.google.common.collect.ImmutableList;
public class EdgeLabelTest extends BaseFuncTest {
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeTest.java
index fc990a32..142a2835 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeTest.java
@@ -42,6 +42,7 @@ import org.apache.hugegraph.structure.gremlin.ResultSet;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.testutil.Utils;
import org.apache.hugegraph.util.DateUtil;
+
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterators;
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/FuncTestSuite.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/FuncTestSuite.java
index 97426837..94a4b0d5 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/FuncTestSuite.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/FuncTestSuite.java
@@ -24,20 +24,20 @@ import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses({
- PropertyKeyTest.class,
- VertexLabelTest.class,
- EdgeLabelTest.class,
- IndexLabelTest.class,
- SchemaTest.class,
- VertexTest.class,
- EdgeTest.class,
- BatchInsertTest.class,
- GraphManagerTest.class,
- AuthManagerTest.class,
- TraverserManagerTest.class,
- MetricsManagerTest.class,
- HugeClientHttpsTest.class,
- HugeClientTest.class
+ PropertyKeyTest.class,
+ VertexLabelTest.class,
+ EdgeLabelTest.class,
+ IndexLabelTest.class,
+ SchemaTest.class,
+ VertexTest.class,
+ EdgeTest.class,
+ BatchInsertTest.class,
+ GraphManagerTest.class,
+ AuthManagerTest.class,
+ TraverserManagerTest.class,
+ MetricsManagerTest.class,
+ HugeClientHttpsTest.class,
+ HugeClientTest.class
})
public class FuncTestSuite {
}
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java
index 08c46404..ec595247 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/HugeClientHttpsTest.java
@@ -30,6 +30,7 @@ import org.apache.hugegraph.driver.SchemaManager;
import org.apache.hugegraph.structure.constant.T;
import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.testutil.Assert;
+
import com.google.common.collect.ImmutableMap;
public class HugeClientHttpsTest {
@@ -42,8 +43,7 @@ public class HugeClientHttpsTest {
private static final int MAX_CONNS_PER_ROUTE = 10;
private static final int MAX_CONNS = 10;
private static final int IDLE_TIME = 30;
- private static final String TRUST_STORE_FILE =
- "src/test/resources/hugegraph.truststore";
+ private static final String TRUST_STORE_FILE = "src/test/resources/hugegraph.truststore";
private static final String TRUST_STORE_PASSWORD = "hugegraph";
private static HugeClient client;
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/IndexLabelTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/IndexLabelTest.java
index 72c597ea..15aff85f 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/IndexLabelTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/IndexLabelTest.java
@@ -33,6 +33,7 @@ import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.util.DateUtil;
import org.apache.hugegraph.testutil.Utils;
+
import com.google.common.collect.ImmutableList;
public class IndexLabelTest extends BaseFuncTest {
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/MetricsManagerTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/MetricsManagerTest.java
index 9894cf74..6aec9bee 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/MetricsManagerTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/MetricsManagerTest.java
@@ -24,6 +24,7 @@ import java.util.Map;
import org.junit.Test;
import org.apache.hugegraph.testutil.Assert;
+
import com.google.common.collect.ImmutableSet;
public class MetricsManagerTest extends BaseFuncTest {
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/PropertyKeyTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/PropertyKeyTest.java
index 069d106b..6d87d6c9 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/PropertyKeyTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/PropertyKeyTest.java
@@ -32,6 +32,7 @@ import org.apache.hugegraph.structure.constant.WriteType;
import org.apache.hugegraph.structure.schema.PropertyKey;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.util.DateUtil;
+
import com.google.common.collect.ImmutableList;
public class PropertyKeyTest extends BaseFuncTest {
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/VertexLabelTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/VertexLabelTest.java
index 0cebfc26..589493c5 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/VertexLabelTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/VertexLabelTest.java
@@ -34,6 +34,7 @@ import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.util.DateUtil;
import org.apache.hugegraph.testutil.Utils;
+
import com.google.common.collect.ImmutableList;
public class VertexLabelTest extends BaseFuncTest {
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/VertexTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/VertexTest.java
index 98d6b7f2..0456e885 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/functional/VertexTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/functional/VertexTest.java
@@ -35,6 +35,7 @@ import org.apache.hugegraph.structure.constant.T;
import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.testutil.Utils;
+
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterators;
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/testutil/Utils.java b/hugegraph-client/src/test/java/org/apache/hugegraph/testutil/Utils.java
index 2d1df3c1..5ad86c4e 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/testutil/Utils.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/testutil/Utils.java
@@ -41,6 +41,7 @@ import org.apache.hugegraph.structure.schema.PropertyKey;
import org.apache.hugegraph.structure.schema.VertexLabel;
import org.apache.hugegraph.testutil.Assert.ThrowableRunnable;
import org.apache.hugegraph.util.DateUtil;
+
import com.google.common.collect.ImmutableList;
public final class Utils {
@@ -158,11 +159,8 @@ public final class Utils {
!left.properties().containsAll(right.properties())) {
return false;
}
- if (left.primaryKeys().size() != right.primaryKeys().size() ||
- !left.primaryKeys().containsAll(right.primaryKeys())) {
- return false;
- }
- return true;
+ return left.primaryKeys().size() == right.primaryKeys().size() &&
+ left.primaryKeys().containsAll(right.primaryKeys());
}
public static boolean equalEdgeLabel(EdgeLabel left, EdgeLabel right) {
@@ -185,11 +183,8 @@ public final class Utils {
!left.properties().containsAll(right.properties())) {
return false;
}
- if (left.sortKeys().size() != right.sortKeys().size() ||
- !left.sortKeys().containsAll(right.sortKeys())) {
- return false;
- }
- return true;
+ return left.sortKeys().size() == right.sortKeys().size() &&
+ left.sortKeys().containsAll(right.sortKeys());
}
private static boolean equalIndexLabel(IndexLabel left,
@@ -209,11 +204,8 @@ public final class Utils {
if (left.indexType() != right.indexType()) {
return false;
}
- if (left.indexFields().size() != right.indexFields().size() ||
- !left.indexFields().containsAll(right.indexFields())) {
- return false;
- }
- return true;
+ return left.indexFields().size() == right.indexFields().size() &&
+ left.indexFields().containsAll(right.indexFields());
}
private static boolean equalVertex(Vertex left, Vertex right) {
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/BatchElementRequestTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/BatchElementRequestTest.java
index 9972e196..2ae60503 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/BatchElementRequestTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/BatchElementRequestTest.java
@@ -33,6 +33,7 @@ import org.apache.hugegraph.structure.graph.UpdateStrategy;
import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.testutil.Assert;
import org.apache.hugegraph.testutil.Whitebox;
+
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/CommonUtilTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/CommonUtilTest.java
index 48112df9..170a3ceb 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/CommonUtilTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/CommonUtilTest.java
@@ -23,6 +23,7 @@ import org.apache.hugegraph.util.CommonUtil;
import org.junit.Test;
import org.apache.hugegraph.testutil.Assert;
+
import com.google.common.collect.ImmutableMap;
public class CommonUtilTest {
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/IndexLabelTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/IndexLabelTest.java
index f2f38965..55e62e58 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/IndexLabelTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/IndexLabelTest.java
@@ -67,9 +67,7 @@ public class IndexLabelTest {
Assert.assertEquals(HugeType.INDEX_LABEL.string(),
indexLabelV49.type());
- Assert.assertThrows(NotSupportException.class, () -> {
- indexLabelV49.userdata();
- });
+ Assert.assertThrows(NotSupportException.class, indexLabelV49::userdata);
}
@Test
@@ -84,15 +82,13 @@ public class IndexLabelTest {
IndexLabel.IndexLabelV56 indexLabelV56 = indexLabel.switchV56();
String json = "{\"id\":0,\"name\":\"personByAge\"," +
- "\"check_exist\":true,\"user_data\":{}," +
- "\"base_type\":\"VERTEX_LABEL\",\"base_value\":\"person\"," +
- "\"index_type\":\"SECONDARY\",\"fields\":[\"age\"]}";
+ "\"check_exist\":true,\"user_data\":{}," +
+ "\"base_type\":\"VERTEX_LABEL\",\"base_value\":\"person\"," +
+ "\"index_type\":\"SECONDARY\",\"fields\":[\"age\"]}";
Assert.assertEquals(json, JsonUtil.toJson(indexLabelV56));
Assert.assertEquals(HugeType.INDEX_LABEL.string(),
indexLabelV56.type());
- Assert.assertThrows(NotSupportException.class, () -> {
- indexLabelV56.rebuild();
- });
+ Assert.assertThrows(NotSupportException.class, indexLabelV56::rebuild);
}
}
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/PathSerializerTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/PathSerializerTest.java
index 807a5235..bd98102a 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/PathSerializerTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/PathSerializerTest.java
@@ -26,6 +26,7 @@ import org.apache.hugegraph.structure.graph.Edge;
import org.apache.hugegraph.structure.graph.Path;
import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.testutil.Assert;
+
import com.google.common.collect.ImmutableList;
public class PathSerializerTest extends BaseUnitTest {
@@ -65,15 +66,15 @@ public class PathSerializerTest extends BaseUnitTest {
@Test
public void testDeserializePathWithSimpleType() {
String json = "{"
- + "\"labels\":["
- + "[],"
- + "[]"
- + "],"
- + "\"objects\":["
- + "\"marko\","
- + "\"lop\""
- + "]"
- + "}";
+ + "\"labels\":["
+ + "[],"
+ + "[]"
+ + "],"
+ + "\"objects\":["
+ + "\"marko\","
+ + "\"lop\""
+ + "]"
+ + "}";
Path path = deserialize(json, Path.class);
@@ -86,15 +87,15 @@ public class PathSerializerTest extends BaseUnitTest {
path.objects().toArray());
json = "{"
- + "\"labels\":["
- + "[],"
- + "[]"
- + "],"
- + "\"objects\":["
- + "29,"
- + "32"
- + "]"
- + "}";
+ + "\"labels\":["
+ + "[],"
+ + "[]"
+ + "],"
+ + "\"objects\":["
+ + "29,"
+ + "32"
+ + "]"
+ + "}";
path = deserialize(json, Path.class);
@@ -106,15 +107,15 @@ public class PathSerializerTest extends BaseUnitTest {
@Test
public void testDeserializePathWithListType() {
String json = "{"
- + "\"labels\":["
- + "[],"
- + "[]"
- + "],"
- + "\"objects\":["
- + "[\"Beijing\", \"Beijing\"],"
- + "[\"Wuhan\", \"Hongkong\"]"
- + "]"
- + "}";
+ + "\"labels\":["
+ + "[],"
+ + "[]"
+ + "],"
+ + "\"objects\":["
+ + "[\"Beijing\", \"Beijing\"],"
+ + "[\"Wuhan\", \"Hongkong\"]"
+ + "]"
+ + "}";
Path path = BaseUnitTest.deserialize(json, Path.class);
@@ -123,9 +124,8 @@ public class PathSerializerTest extends BaseUnitTest {
Assert.assertEquals(ImmutableList.of(), path.labels().get(1));
Assert.assertEquals(2, path.objects().size());
- Assert.assertArrayEquals(new Object[]{
- ImmutableList.of("Beijing", "Beijing"),
- ImmutableList.of("Wuhan", "Hongkong")},
+ Assert.assertArrayEquals(new Object[]{ImmutableList.of("Beijing", "Beijing"),
+ ImmutableList.of("Wuhan", "Hongkong")},
path.objects().toArray());
}
}
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/RestResultTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/RestResultTest.java
index ae5772e9..5251ab5f 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/RestResultTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/RestResultTest.java
@@ -50,6 +50,7 @@ import org.apache.hugegraph.structure.schema.IndexLabel;
import org.apache.hugegraph.structure.schema.PropertyKey;
import org.apache.hugegraph.structure.schema.VertexLabel;
import org.apache.hugegraph.testutil.Assert;
+
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -87,12 +88,12 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadPropertyKey() {
String json = "{"
- + "\"id\": 3,"
- + "\"data_type\": \"INT\","
- + "\"name\": \"id\","
- + "\"cardinality\": \"SINGLE\","
- + "\"properties\": []"
- + "}";
+ + "\"id\": 3,"
+ + "\"data_type\": \"INT\","
+ + "\"name\": \"id\","
+ + "\"cardinality\": \"SINGLE\","
+ + "\"properties\": []"
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -113,20 +114,20 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadPropertyKeys() {
String json = "{\"propertykeys\": ["
- + "{"
- + "\"id\": 3,"
- + "\"data_type\": \"TEXT\","
- + "\"name\": \"id\","
- + "\"cardinality\": \"SINGLE\","
- + "\"properties\": []"
- + "},"
- + "{\"id\": 4,"
- + "\"data_type\": \"FLOAT\","
- + "\"name\": \"date\","
- + "\"cardinality\": \"SET\","
- + "\"properties\": []"
- + "}"
- + "]}";
+ + "{"
+ + "\"id\": 3,"
+ + "\"data_type\": \"TEXT\","
+ + "\"name\": \"id\","
+ + "\"cardinality\": \"SINGLE\","
+ + "\"properties\": []"
+ + "},"
+ + "{\"id\": 4,"
+ + "\"data_type\": \"FLOAT\","
+ + "\"name\": \"date\","
+ + "\"cardinality\": \"SET\","
+ + "\"properties\": []"
+ + "}"
+ + "]}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -156,13 +157,13 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadVertexLabel() {
String json = "{"
- + "\"id\": 1,"
- + "\"primary_keys\": [\"name\"],"
- + "\"index_labels\": [],"
- + "\"name\": \"software\","
- + "\"id_strategy\": \"PRIMARY_KEY\","
- + "\"properties\": [\"price\", \"name\", \"lang\"]"
- + "}";
+ + "\"id\": 1,"
+ + "\"primary_keys\": [\"name\"],"
+ + "\"index_labels\": [],"
+ + "\"name\": \"software\","
+ + "\"id_strategy\": \"PRIMARY_KEY\","
+ + "\"properties\": [\"price\", \"name\", \"lang\"]"
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -185,23 +186,23 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadVertexLabels() {
String json = "{\"vertexlabels\": ["
- + "{"
- + "\"id\": 1,"
- + "\"primary_keys\": [\"name\"],"
- + "\"index_labels\": [],"
- + "\"name\": \"software\","
- + "\"id_strategy\": \"PRIMARY_KEY\","
- + "\"properties\": [\"price\", \"name\", \"lang\"]"
- + "},"
- + "{"
- + "\"id\": 2,"
- + "\"primary_keys\": [],"
- + "\"index_labels\": [],"
- + "\"name\": \"person\","
- + "\"id_strategy\": \"CUSTOMIZE_STRING\","
- + "\"properties\": [\"city\", \"name\", \"age\"]"
- + "}"
- + "]}";
+ + "{"
+ + "\"id\": 1,"
+ + "\"primary_keys\": [\"name\"],"
+ + "\"index_labels\": [],"
+ + "\"name\": \"software\","
+ + "\"id_strategy\": \"PRIMARY_KEY\","
+ + "\"properties\": [\"price\", \"name\", \"lang\"]"
+ + "},"
+ + "{"
+ + "\"id\": 2,"
+ + "\"primary_keys\": [],"
+ + "\"index_labels\": [],"
+ + "\"name\": \"person\","
+ + "\"id_strategy\": \"CUSTOMIZE_STRING\","
+ + "\"properties\": [\"city\", \"name\", \"age\"]"
+ + "}"
+ + "]}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -235,15 +236,15 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadEdgeLabel() {
String json = "{"
- + "\"id\": 2,"
- + "\"source_label\": \"person\","
- + "\"index_labels\": [\"createdByDate\"],"
- + "\"name\": \"created\","
- + "\"target_label\": \"software\","
- + "\"sort_keys\": [],"
- + "\"properties\": [\"date\"],"
- + "\"frequency\": \"SINGLE\""
- + "}";
+ + "\"id\": 2,"
+ + "\"source_label\": \"person\","
+ + "\"index_labels\": [\"createdByDate\"],"
+ + "\"name\": \"created\","
+ + "\"target_label\": \"software\","
+ + "\"sort_keys\": [],"
+ + "\"properties\": [\"date\"],"
+ + "\"frequency\": \"SINGLE\""
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -266,26 +267,26 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadEdgeLabels() {
String json = "{\"edgelabels\": ["
- + "{"
- + "\"id\": 2,"
- + "\"source_label\": \"person\","
- + "\"index_labels\": [\"createdByDate\"],"
- + "\"name\": \"created\","
- + "\"target_label\": \"software\","
- + "\"sort_keys\": [],"
- + "\"properties\": [\"date\"],"
- + "\"frequency\": \"SINGLE\""
- + "},"
- + "{\"id\": 3,"
- + "\"source_label\": \"person\","
- + "\"index_labels\": [],"
- + "\"name\": \"knows\","
- + "\"target_label\": \"person\","
- + "\"sort_keys\": [],"
- + "\"properties\": [\"date\", \"city\"],"
- + "\"frequency\": \"SINGLE\""
- + "}"
- + "]}";
+ + "{"
+ + "\"id\": 2,"
+ + "\"source_label\": \"person\","
+ + "\"index_labels\": [\"createdByDate\"],"
+ + "\"name\": \"created\","
+ + "\"target_label\": \"software\","
+ + "\"sort_keys\": [],"
+ + "\"properties\": [\"date\"],"
+ + "\"frequency\": \"SINGLE\""
+ + "},"
+ + "{\"id\": 3,"
+ + "\"source_label\": \"person\","
+ + "\"index_labels\": [],"
+ + "\"name\": \"knows\","
+ + "\"target_label\": \"person\","
+ + "\"sort_keys\": [],"
+ + "\"properties\": [\"date\", \"city\"],"
+ + "\"frequency\": \"SINGLE\""
+ + "}"
+ + "]}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -320,13 +321,13 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadIndexLabel() {
String json = "{"
- + "\"id\": \"4\","
- + "\"index_type\": \"SEARCH\","
- + "\"base_value\": \"software\","
- + "\"name\": \"softwareByPrice\","
- + "\"fields\": [\"price\"],"
- + "\"base_type\": \"VERTEX_LABEL\""
- + "}";
+ + "\"id\": \"4\","
+ + "\"index_type\": \"SEARCH\","
+ + "\"base_value\": \"software\","
+ + "\"name\": \"softwareByPrice\","
+ + "\"fields\": [\"price\"],"
+ + "\"base_type\": \"VERTEX_LABEL\""
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -349,23 +350,23 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadIndexLabels() {
String json = "{\"indexlabels\": ["
- + "{"
- + "\"id\": \"4\","
- + "\"index_type\": \"SEARCH\","
- + "\"base_value\": \"software\","
- + "\"name\": \"softwareByPrice\","
- + "\"fields\": [\"price\"],"
- + "\"base_type\": \"VERTEX_LABEL\""
- + "},"
- + "{"
- + "\"id\": \"4\","
- + "\"index_type\": \"SECONDARY\","
- + "\"base_value\": \"person\","
- + "\"name\": \"personByName\","
- + "\"fields\": [\"name\"],"
- + "\"base_type\": \"VERTEX_LABEL\""
- + "}"
- + "]}";
+ + "{"
+ + "\"id\": \"4\","
+ + "\"index_type\": \"SEARCH\","
+ + "\"base_value\": \"software\","
+ + "\"name\": \"softwareByPrice\","
+ + "\"fields\": [\"price\"],"
+ + "\"base_type\": \"VERTEX_LABEL\""
+ + "},"
+ + "{"
+ + "\"id\": \"4\","
+ + "\"index_type\": \"SECONDARY\","
+ + "\"base_value\": \"person\","
+ + "\"name\": \"personByName\","
+ + "\"fields\": [\"name\"],"
+ + "\"base_type\": \"VERTEX_LABEL\""
+ + "}"
+ + "]}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -399,13 +400,13 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadVertex() {
String json = "{"
- + "\"id\": \"person:marko\","
- + "\"label\": \"person\","
- + "\"type\": \"vertex\","
- + "\"properties\": {"
- + "\"name\": \"marko\""
- + "}"
- + "}";
+ + "\"id\": \"person:marko\","
+ + "\"label\": \"person\","
+ + "\"type\": \"vertex\","
+ + "\"properties\": {"
+ + "\"name\": \"marko\""
+ + "}"
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -426,37 +427,37 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadVertices() {
String json = "{\"vertices\": ["
- + "{"
- + "\"id\": \"person:marko\","
- + "\"label\": \"person\","
- + "\"type\": \"vertex\","
- + "\"properties\": {"
- + "\"city\": [\"Beijing\",\"Wuhan\",\"Beijing\"],"
- + "\"name\": \"marko\","
- + "\"age\": 29"
- + "}"
- + "},"
- + "{"
- + "\"id\": \"software:lop\","
- + "\"label\": \"software\","
- + "\"type\": \"vertex\","
- + "\"properties\": {"
- + "\"price\": 328,"
- + "\"name\": \"lop\","
- + "\"lang\": [\"java\",\"python\",\"c++\"]"
- + "}"
- + "},"
- + "{"
- + "\"id\": \"person:peter\","
- + "\"label\": \"person\","
- + "\"type\": \"vertex\","
- + "\"properties\": {"
- + "\"city\": [\"Shanghai\"],"
- + "\"name\": \"peter\","
- + "\"age\": 29"
- + "}"
- + "}"
- + "]}";
+ + "{"
+ + "\"id\": \"person:marko\","
+ + "\"label\": \"person\","
+ + "\"type\": \"vertex\","
+ + "\"properties\": {"
+ + "\"city\": [\"Beijing\",\"Wuhan\",\"Beijing\"],"
+ + "\"name\": \"marko\","
+ + "\"age\": 29"
+ + "}"
+ + "},"
+ + "{"
+ + "\"id\": \"software:lop\","
+ + "\"label\": \"software\","
+ + "\"type\": \"vertex\","
+ + "\"properties\": {"
+ + "\"price\": 328,"
+ + "\"name\": \"lop\","
+ + "\"lang\": [\"java\",\"python\",\"c++\"]"
+ + "}"
+ + "},"
+ + "{"
+ + "\"id\": \"person:peter\","
+ + "\"label\": \"person\","
+ + "\"type\": \"vertex\","
+ + "\"properties\": {"
+ + "\"city\": [\"Shanghai\"],"
+ + "\"name\": \"peter\","
+ + "\"age\": 29"
+ + "}"
+ + "}"
+ + "]}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -475,45 +476,45 @@ public class RestResultTest extends BaseUnitTest {
Assert.assertEquals("person:marko", vertex1.id());
Assert.assertEquals("person", vertex1.label());
Assert.assertEquals(ImmutableMap.of(
- "name", "marko",
- "age", 29,
- "city", ImmutableList.of("Beijing", "Wuhan",
- "Beijing")
+ "name", "marko",
+ "age", 29,
+ "city", ImmutableList.of("Beijing", "Wuhan",
+ "Beijing")
),
vertex1.properties());
Assert.assertEquals("software:lop", vertex2.id());
Assert.assertEquals("software", vertex2.label());
Assert.assertEquals(ImmutableMap.of(
- "name", "lop",
- "lang", ImmutableList.of("java", "python", "c++"),
- "price", 328),
+ "name", "lop",
+ "lang", ImmutableList.of("java", "python", "c++"),
+ "price", 328),
vertex2.properties());
Assert.assertEquals("person:peter", vertex3.id());
Assert.assertEquals("person", vertex3.label());
Assert.assertEquals(ImmutableMap.of(
- "name", "peter",
- "age", 29,
- "city", ImmutableList.of("Shanghai")),
+ "name", "peter",
+ "age", 29,
+ "city", ImmutableList.of("Shanghai")),
vertex3.properties());
}
@Test
public void testReadEdge() {
String json = "{"
- + "\"id\": \"person:peter>created>>software:lop\","
- + "\"label\": \"created\","
- + "\"type\": \"edge\","
- + "\"outV\": \"person:peter\","
- + "\"inV\": \"software:lop\","
- + "\"outVLabel\": \"person\","
- + "\"inVLabel\": \"software\","
- + "\"properties\": {"
- + "\"city\": \"Hongkong\","
- + "\"date\": 1495036800000"
- + "}"
- + "}";
+ + "\"id\": \"person:peter>created>>software:lop\","
+ + "\"label\": \"created\","
+ + "\"type\": \"edge\","
+ + "\"outV\": \"person:peter\","
+ + "\"inV\": \"software:lop\","
+ + "\"outVLabel\": \"person\","
+ + "\"inVLabel\": \"software\","
+ + "\"properties\": {"
+ + "\"city\": \"Hongkong\","
+ + "\"date\": 1495036800000"
+ + "}"
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -539,32 +540,32 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadEdges() {
String json = "{\"edges\": ["
- + "{"
- + "\"id\": \"person:peter>created>>software:lop\","
- + "\"label\": \"created\","
- + "\"type\": \"edge\","
- + "\"inVLabel\": \"software\","
- + "\"outVLabel\": \"person\","
- + "\"inV\": \"software:lop\","
- + "\"outV\": \"person:peter\","
- + "\"properties\": {"
- + "\"date\": 1495036800000,"
- + "\"city\": \"Hongkong\""
- + "}"
- + "},"
- + "{"
- + "\"id\": \"person:peter>knows>>person:marko\","
- + "\"label\": \"knows\","
- + "\"type\": \"edge\","
- + "\"inVLabel\": \"person\","
- + "\"outVLabel\": \"person\","
- + "\"inV\": \"person:marko\","
- + "\"outV\": \"person:peter\","
- + "\"properties\": {"
- + "\"date\": 1476720000000"
- + "}"
- + "}"
- + "]}";
+ + "{"
+ + "\"id\": \"person:peter>created>>software:lop\","
+ + "\"label\": \"created\","
+ + "\"type\": \"edge\","
+ + "\"inVLabel\": \"software\","
+ + "\"outVLabel\": \"person\","
+ + "\"inV\": \"software:lop\","
+ + "\"outV\": \"person:peter\","
+ + "\"properties\": {"
+ + "\"date\": 1495036800000,"
+ + "\"city\": \"Hongkong\""
+ + "}"
+ + "},"
+ + "{"
+ + "\"id\": \"person:peter>knows>>person:marko\","
+ + "\"label\": \"knows\","
+ + "\"type\": \"edge\","
+ + "\"inVLabel\": \"person\","
+ + "\"outVLabel\": \"person\","
+ + "\"inV\": \"person:marko\","
+ + "\"outV\": \"person:peter\","
+ + "\"properties\": {"
+ + "\"date\": 1476720000000"
+ + "}"
+ + "}"
+ + "]}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -602,48 +603,48 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadGremlinVertices() {
String json = "{"
- + "\"requestId\": \"b0fd8ead-333f-43ac-97b0-4d78784726ae\","
- + "\"status\": {"
- + "\"message\": \"\","
- + "\"code\": 200,"
- + "\"attributes\": {}"
- + "},"
- + "\"result\": {"
- + "\"data\": ["
- + "{"
- + "\"id\": \"person:marko\","
- + "\"label\": \"person\","
- + "\"type\": \"vertex\","
- + "\"properties\": {"
- + "\"city\": [\"Beijing\",\"Wuhan\",\"Beijing\"],"
- + "\"name\": \"marko\","
- + "\"age\": 29"
- + "}"
- + "},"
- + "{"
- + "\"id\": \"software:lop\","
- + "\"label\": \"software\","
- + "\"type\": \"vertex\","
- + "\"properties\": {"
- + "\"price\": 328,"
- + "\"name\": \"lop\","
- + "\"lang\": [\"java\",\"python\",\"c++\"]"
- + "}"
- + "},"
- + "{"
- + "\"id\": \"person:peter\","
- + "\"label\": \"person\","
- + "\"type\": \"vertex\","
- + "\"properties\": {"
- + "\"city\": [\"Shanghai\"],"
- + "\"name\": \"peter\","
- + "\"age\": 35"
- + "}"
- + "}"
- + "],"
- + "\"meta\": {}"
- + "}"
- + "}";
+ + "\"requestId\": \"b0fd8ead-333f-43ac-97b0-4d78784726ae\","
+ + "\"status\": {"
+ + "\"message\": \"\","
+ + "\"code\": 200,"
+ + "\"attributes\": {}"
+ + "},"
+ + "\"result\": {"
+ + "\"data\": ["
+ + "{"
+ + "\"id\": \"person:marko\","
+ + "\"label\": \"person\","
+ + "\"type\": \"vertex\","
+ + "\"properties\": {"
+ + "\"city\": [\"Beijing\",\"Wuhan\",\"Beijing\"],"
+ + "\"name\": \"marko\","
+ + "\"age\": 29"
+ + "}"
+ + "},"
+ + "{"
+ + "\"id\": \"software:lop\","
+ + "\"label\": \"software\","
+ + "\"type\": \"vertex\","
+ + "\"properties\": {"
+ + "\"price\": 328,"
+ + "\"name\": \"lop\","
+ + "\"lang\": [\"java\",\"python\",\"c++\"]"
+ + "}"
+ + "},"
+ + "{"
+ + "\"id\": \"person:peter\","
+ + "\"label\": \"person\","
+ + "\"type\": \"vertex\","
+ + "\"properties\": {"
+ + "\"city\": [\"Shanghai\"],"
+ + "\"name\": \"peter\","
+ + "\"age\": 35"
+ + "}"
+ + "}"
+ + "],"
+ + "\"meta\": {}"
+ + "}"
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -694,44 +695,44 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadGremlinEdges() {
String json = "{"
- + "\"requestId\": \"cd4cfc17-1ee4-4e9e-af40-cb18b115a8dc\","
- + "\"status\": {"
- + "\"message\": \"\","
- + "\"code\": 200,"
- + "\"attributes\": {}"
- + "},"
- + "\"result\": {"
- + "\"data\": ["
- + "{"
- + "\"id\": \"person:peter>created>>software:lop\","
- + "\"label\": \"created\","
- + "\"type\": \"edge\","
- + "\"inVLabel\": \"software\","
- + "\"outVLabel\": \"person\","
- + "\"inV\": \"software:lop\","
- + "\"outV\": \"person:peter\","
- + "\"properties\": {"
- + "\"date\": 1490284800000,"
- + "\"weight\": 0.2"
- + "}"
- + "},"
- + "{"
- + "\"id\": \"person:peter>knows>>person:marko\","
- + "\"label\": \"knows\","
- + "\"type\": \"edge\","
- + "\"inVLabel\": \"person\","
- + "\"outVLabel\": \"person\","
- + "\"inV\": \"person:marko\","
- + "\"outV\": \"person:peter\","
- + "\"properties\": {"
- + "\"date\": 1452355200000,"
- + "\"weight\": 0.5"
- + "}"
- + "}"
- + "],"
- + "\"meta\": {}"
- + "}"
- + "}";
+ + "\"requestId\": \"cd4cfc17-1ee4-4e9e-af40-cb18b115a8dc\","
+ + "\"status\": {"
+ + "\"message\": \"\","
+ + "\"code\": 200,"
+ + "\"attributes\": {}"
+ + "},"
+ + "\"result\": {"
+ + "\"data\": ["
+ + "{"
+ + "\"id\": \"person:peter>created>>software:lop\","
+ + "\"label\": \"created\","
+ + "\"type\": \"edge\","
+ + "\"inVLabel\": \"software\","
+ + "\"outVLabel\": \"person\","
+ + "\"inV\": \"software:lop\","
+ + "\"outV\": \"person:peter\","
+ + "\"properties\": {"
+ + "\"date\": 1490284800000,"
+ + "\"weight\": 0.2"
+ + "}"
+ + "},"
+ + "{"
+ + "\"id\": \"person:peter>knows>>person:marko\","
+ + "\"label\": \"knows\","
+ + "\"type\": \"edge\","
+ + "\"inVLabel\": \"person\","
+ + "\"outVLabel\": \"person\","
+ + "\"inV\": \"person:marko\","
+ + "\"outV\": \"person:peter\","
+ + "\"properties\": {"
+ + "\"date\": 1452355200000,"
+ + "\"weight\": 0.5"
+ + "}"
+ + "}"
+ + "],"
+ + "\"meta\": {}"
+ + "}"
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -779,47 +780,47 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadGremlinPathWithVertexAndEdge() {
String json = "{"
- + "\"requestId\": \"238c74ca-18f7-4377-b8e1-2bb3b165e5d6\","
- + "\"status\":{"
- + "\"message\": \"\","
- + "\"code\": 200,"
- + "\"attributes\":{}"
- + "},"
- + "\"result\":{"
- + "\"data\":["
- + "{"
- + "\"labels\":[[], []],"
- + "\"objects\":["
- + "{"
- + "\"id\": \"person:marko\","
- + "\"label\": \"person\","
- + "\"type\": \"vertex\","
- + "\"properties\":{"
- + "\"city\":\"Beijing\","
- + "\"name\":\"marko\","
- + "\"age\":29"
- + "}"
- + "},"
- + "{"
- + "\"id\": \"person:marko>knows>>person:vadas\","
- + "\"label\": \"knows\","
- + "\"type\": \"edge\","
- + "\"inVLabel\": \"person\","
- + "\"outVLabel\": \"person\","
- + "\"inV\": \"person:vadas\","
- + "\"outV\": \"person:marko\","
- + "\"properties\":{"
- + "\"date\": 1452355200000,"
- + "\"weight\": 0.5"
- + "}"
- + "}"
- + "]"
- + "}"
- + "],"
- + "\"meta\":{"
- + "}"
- + "}"
- + "}";
+ + "\"requestId\": \"238c74ca-18f7-4377-b8e1-2bb3b165e5d6\","
+ + "\"status\":{"
+ + "\"message\": \"\","
+ + "\"code\": 200,"
+ + "\"attributes\":{}"
+ + "},"
+ + "\"result\":{"
+ + "\"data\":["
+ + "{"
+ + "\"labels\":[[], []],"
+ + "\"objects\":["
+ + "{"
+ + "\"id\": \"person:marko\","
+ + "\"label\": \"person\","
+ + "\"type\": \"vertex\","
+ + "\"properties\":{"
+ + "\"city\":\"Beijing\","
+ + "\"name\":\"marko\","
+ + "\"age\":29"
+ + "}"
+ + "},"
+ + "{"
+ + "\"id\": \"person:marko>knows>>person:vadas\","
+ + "\"label\": \"knows\","
+ + "\"type\": \"edge\","
+ + "\"inVLabel\": \"person\","
+ + "\"outVLabel\": \"person\","
+ + "\"inV\": \"person:vadas\","
+ + "\"outV\": \"person:marko\","
+ + "\"properties\":{"
+ + "\"date\": 1452355200000,"
+ + "\"weight\": 0.5"
+ + "}"
+ + "}"
+ + "]"
+ + "}"
+ + "],"
+ + "\"meta\":{"
+ + "}"
+ + "}"
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -867,17 +868,17 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadGremlinNullData() {
String json = "{"
- + "\"requestId\": \"d95ac131-24b5-4140-a3ff-91b0c020764a\","
- + "\"status\": {"
- + "\"message\": \"\","
- + "\"code\": 200,"
- + "\"attributes\": {}"
- + "},"
- + "\"result\": {"
- + "\"data\": [null],"
- + "\"meta\": {}"
- + "}"
- + "}";
+ + "\"requestId\": \"d95ac131-24b5-4140-a3ff-91b0c020764a\","
+ + "\"status\": {"
+ + "\"message\": \"\","
+ + "\"code\": 200,"
+ + "\"attributes\": {}"
+ + "},"
+ + "\"result\": {"
+ + "\"data\": [null],"
+ + "\"meta\": {}"
+ + "}"
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
@@ -900,34 +901,34 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadGremlinNullAndVertex() {
String json = "{"
- + "\"requestId\": \"d95ac131-24b5-4140-a3ff-91b0c020764a\","
- + "\"status\": {"
- + "\"message\": \"\","
- + "\"code\": 200,"
- + "\"attributes\": {}"
- + "},"
- + "\"result\": {"
- + "\"data\": ["
- + "null,"
- + "{"
- + "\"id\": \"person:marko\","
- + "\"label\": \"person\","
- + "\"type\": \"vertex\","
- + "\"properties\": {"
- + "\"city\": \"Beijing\","
- + "\"name\": \"marko\","
- + "\"age\": 29"
- + "}"
- + "}"
- + "],"
- + "\"meta\": {}"
- + "}"
- + "}";
+ + "\"requestId\": \"d95ac131-24b5-4140-a3ff-91b0c020764a\","
+ + "\"status\": {"
+ + "\"message\": \"\","
+ + "\"code\": 200,"
+ + "\"attributes\": {}"
+ + "},"
+ + "\"result\": {"
+ + "\"data\": ["
+ + "null,"
+ + "{"
+ + "\"id\": \"person:marko\","
+ + "\"label\": \"person\","
+ + "\"type\": \"vertex\","
+ + "\"properties\": {"
+ + "\"city\": \"Beijing\","
+ + "\"name\": \"marko\","
+ + "\"age\": 29"
+ + "}"
+ + "}"
+ + "],"
+ + "\"meta\": {}"
+ + "}"
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
Mockito.when(this.mockResponse.readEntity(String.class))
- .thenReturn(json);
+ .thenReturn(json);
RestResult restResult = new RestResult(this.mockResponse);
Assert.assertEquals(200, restResult.status());
Assert.assertNull(restResult.headers());
@@ -957,32 +958,32 @@ public class RestResultTest extends BaseUnitTest {
@Test
public void testReadGremlinEdgeAndNull() {
String json = "{"
- + "\"requestId\": \"d95ac131-24b5-4140-a3ff-91b0c020764a\","
- + "\"status\": {"
- + "\"message\": \"\","
- + "\"code\": 200,"
- + "\"attributes\": {}"
- + "},"
- + "\"result\": {"
- + "\"data\": ["
- + "{"
- + "\"id\": \"person:peter>created>>software:lop\","
- + "\"label\": \"created\","
- + "\"type\": \"edge\","
- + "\"inVLabel\": \"software\","
- + "\"outVLabel\": \"person\","
- + "\"inV\": \"software:lop\","
- + "\"outV\": \"person:peter\","
- + "\"properties\": {"
- + "\"date\": 1490284800000,"
- + "\"weight\": 0.2"
- + "}"
- + "},"
- + "null"
- + "],"
- + "\"meta\": {}"
- + "}"
- + "}";
+ + "\"requestId\": \"d95ac131-24b5-4140-a3ff-91b0c020764a\","
+ + "\"status\": {"
+ + "\"message\": \"\","
+ + "\"code\": 200,"
+ + "\"attributes\": {}"
+ + "},"
+ + "\"result\": {"
+ + "\"data\": ["
+ + "{"
+ + "\"id\": \"person:peter>created>>software:lop\","
+ + "\"label\": \"created\","
+ + "\"type\": \"edge\","
+ + "\"inVLabel\": \"software\","
+ + "\"outVLabel\": \"person\","
+ + "\"inV\": \"software:lop\","
+ + "\"outV\": \"person:peter\","
+ + "\"properties\": {"
+ + "\"date\": 1490284800000,"
+ + "\"weight\": 0.2"
+ + "}"
+ + "},"
+ + "null"
+ + "],"
+ + "\"meta\": {}"
+ + "}"
+ + "}";
Mockito.when(this.mockResponse.getStatus()).thenReturn(200);
Mockito.when(this.mockResponse.getHeaders()).thenReturn(null);
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/UnitTestSuite.java b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/UnitTestSuite.java
index fe204709..fee3d457 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/UnitTestSuite.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/UnitTestSuite.java
@@ -24,15 +24,15 @@ import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses({
- VertexSerializerTest.class,
- PathSerializerTest.class,
- RestResultTest.class,
- BatchElementRequestTest.class,
- PropertyKeyTest.class,
- IndexLabelTest.class,
- CommonUtilTest.class,
- IdUtilTest.class,
- SplicingIdGeneratorTest.class
+ VertexSerializerTest.class,
+ PathSerializerTest.class,
+ RestResultTest.class,
+ BatchElementRequestTest.class,
+ PropertyKeyTest.class,
+ IndexLabelTest.class,
+ CommonUtilTest.class,
+ IdUtilTest.class,
+ SplicingIdGeneratorTest.class
})
public class UnitTestSuite {
}
diff --git a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/VertexSerializerTest.java b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/VertexSerializerTest.java
index 616aed5d..2feb2ecd 100644
--- a/hugegraph-client/src/test/java/org/apache/hugegraph/unit/VertexSerializerTest.java
+++ b/hugegraph-client/src/test/java/org/apache/hugegraph/unit/VertexSerializerTest.java
@@ -25,6 +25,7 @@ import org.junit.Test;
import org.apache.hugegraph.structure.graph.Vertex;
import org.apache.hugegraph.testutil.Assert;
+
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
@@ -65,9 +66,8 @@ public class VertexSerializerTest extends BaseUnitTest {
Assert.assertEquals("person:marko", vertexCopy.id());
Assert.assertEquals("person", vertexCopy.label());
Assert.assertEquals("vertex", vertexCopy.type());
- Map<String, Object> props = ImmutableMap.of(
- "name", "marko", "age", 29,
- "city", ImmutableList.of("Hefei", "Wuhan"));
+ Map<String, Object> props = ImmutableMap.of("name", "marko", "age", 29,
+ "city", ImmutableList.of("Hefei", "Wuhan"));
Assert.assertEquals(props, vertexCopy.properties());
}
@@ -86,9 +86,8 @@ public class VertexSerializerTest extends BaseUnitTest {
Assert.assertEquals("person", vertexCopy.label());
Assert.assertEquals("vertex", vertexCopy.type());
// TODO: Set properties should deserialize to Set instead of List
- Map<String, Object> props = ImmutableMap.of(
- "name", "marko", "age", 29,
- "city", ImmutableList.of("Hefei", "Wuhan"));
+ Map<String, Object> props = ImmutableMap.of("name", "marko", "age", 29,
+ "city", ImmutableList.of("Hefei", "Wuhan"));
Assert.assertEquals(props, vertexCopy.properties());
}
}