You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/03/05 01:56:30 UTC
[skywalking-agent-test-tool] branch master updated: Remove protocol
v1 and fix checkstyle (#5)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-agent-test-tool.git
The following commit(s) were added to refs/heads/master by this push:
new ae923da Remove protocol v1 and fix checkstyle (#5)
ae923da is described below
commit ae923da35e7e940241498fbc3c8b57bb460bde17
Author: 吴晟 Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Mar 5 09:56:23 2020 +0800
Remove protocol v1 and fix checkstyle (#5)
* remove protocol v1, and fix checkstyle
* rename application -> service
* rename application -> service
* rename
* fix
---
mock-collector/bin/collector-startup.sh | 1 -
mock-collector/pom.xml | 4 +-
.../skywalking/plugin/test/mockcollector/Main.java | 8 +--
.../test/mockcollector/entity/RegistryItem.java | 62 +++++++++++-----------
.../entity/RegistryItemSerializer.java | 24 ++++-----
.../plugin/test/mockcollector/entity/Segment.java | 5 +-
.../test/mockcollector/entity/SegmentItem.java | 10 ++--
.../test/mockcollector/entity/SegmentItems.java | 10 ++--
.../entity/SegmentItemsSerializer.java | 10 ++--
.../plugin/test/mockcollector/entity/Span.java | 36 ++-----------
.../service/MockInstanceDiscoveryService.java | 52 ------------------
.../service/MockNetworkAddressRegisterService.java | 33 ------------
.../mockcollector/service/MockRegisterService.java | 36 +++++++------
.../service/MockTraceSegmentService.java | 7 ++-
.../mockcollector/service/ReceiveDataService.java | 2 +-
.../src/{main => test}/resources/expect-data.yaml | 20 +++----
.../src/{main => test}/resources/sample-data.yaml | 20 +++----
validator/README.md | 12 ++---
.../ActualRegistryOperationNameEmptyException.md | 2 +-
.../exception/ActualSegmentItemEmptyException.md | 2 +-
.../RegistryApplicationNotFoundException.md | 27 ----------
.../RegistryApplicationSizeNotEqualsException.md | 13 -----
...gistryInstanceOfApplicationNotFoundException.md | 25 ---------
.../RegistryInstanceOfServiceNotFoundException.md | 25 +++++++++
.../RegistryInstanceSizeNotEqualsException.md | 4 +-
.../RegistryOperationNameNotFoundException.md | 2 +-
.../RegistryOperationNamesNotFoundException.md | 4 +-
...OperationNamesOfApplicationNotFoundException.md | 6 +--
.../exception/RegistryServiceNotFoundException.md | 27 ++++++++++
.../RegistryServiceSizeNotEqualsException.md | 13 +++++
.../docs/exception/SegmentItemNotFoundException.md | 2 +-
.../exception/SegmentSizeNotEqualsException.md | 2 +-
.../skywalking/plugin/test/agent/tool/Main.java | 12 +++--
.../tool/validator/assertor/InstanceAssert.java | 23 ++++----
.../validator/assertor/OperationNameAssert.java | 19 +++----
.../assertor/ParentSegmentIdExpressParser.java | 4 +-
.../validator/assertor/RegistryItemsAssert.java | 4 +-
.../validator/assertor/SegmentItemsAssert.java | 7 +--
.../tool/validator/assertor/SegmentRefAssert.java | 4 +-
.../{ApplicationAssert.java => ServiceAssert.java} | 32 +++++------
.../ActualRegistryOperationNameEmptyException.java | 5 +-
...egistryInstanceOfServiceNotFoundException.java} | 13 +++--
.../RegistryInstanceSizeNotEqualsException.java | 11 ++--
.../RegistryOperationNameNotFoundException.java | 11 ++--
...yOperationNamesOfServiceNotFoundException.java} | 13 ++---
....java => RegistryServiceNotFoundException.java} | 11 ++--
... => RegistryServiceSizeNotEqualsException.java} | 13 ++---
.../exception/SegmentItemNotFoundException.java | 8 +--
.../exception/SegmentNotFoundException.java | 15 ++++--
.../exception/SegmentSizeNotEqualsException.java | 9 ++--
.../tool/validator/entity/RegistryInstance.java | 12 ++---
.../agent/tool/validator/entity/RegistryItems.java | 2 +-
.../validator/entity/RegistryItemsForRead.java | 38 ++++++-------
.../validator/entity/RegistryOperationName.java | 12 ++---
...gistryApplication.java => RegistryService.java} | 16 +++---
.../tool/validator/entity/SegmentForRead.java | 3 +-
.../agent/tool/validator/entity/SegmentItem.java | 2 +-
.../tool/validator/entity/SegmentItemForRead.java | 16 +++---
.../tool/validator/assertor/DataAssertTest.java | 5 +-
validator/src/test/resources/actualData.yaml | 4 +-
validator/src/test/resources/expectedData.yaml | 4 +-
61 files changed, 378 insertions(+), 456 deletions(-)
diff --git a/mock-collector/bin/collector-startup.sh b/mock-collector/bin/collector-startup.sh
index 419e345..efdd5fe 100644
--- a/mock-collector/bin/collector-startup.sh
+++ b/mock-collector/bin/collector-startup.sh
@@ -30,6 +30,5 @@ do
done
JAVA_OPTS="${JAVA_OPTS} -Xmx256m -Xms256m"
-JAVA_OPTS="${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 "
$_RUNJAVA ${JAVA_OPTS} -classpath $CLASSPATH org.apache.skywalking.plugin.test.mockcollector.Main
diff --git a/mock-collector/pom.xml b/mock-collector/pom.xml
index f448334..05c67f0 100644
--- a/mock-collector/pom.xml
+++ b/mock-collector/pom.xml
@@ -34,7 +34,7 @@
<url>http://maven.apache.org</url>
<properties>
- <protocol.version>7e135257720bd61e70d12ba69bda9c90c131e09f</protocol.version>
+ <protocol.version>b512211334db26a9c1031ce7bacfa2bef99b1d89</protocol.version>
<protocol.workingDirectory>${project.basedir}/target/protocol</protocol.workingDirectory>
<protocol.repos>https://github.com/apache/skywalking-data-collect-protocol.git</protocol.repos>
</properties>
@@ -83,7 +83,7 @@
</dependencies>
<build>
- <finalName>mock-collector</finalName>
+ <finalName>skywalking-mock-collector</finalName>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/Main.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/Main.java
index dead944..14b45ce 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/Main.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/Main.java
@@ -28,10 +28,8 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData;
import org.apache.skywalking.plugin.test.mockcollector.service.ClearReceiveDataService;
import org.apache.skywalking.plugin.test.mockcollector.service.GrpcAddressHttpService;
-import org.apache.skywalking.plugin.test.mockcollector.service.MockInstanceDiscoveryService;
import org.apache.skywalking.plugin.test.mockcollector.service.MockInstancePingService;
import org.apache.skywalking.plugin.test.mockcollector.service.MockJVMMetricReportService;
-import org.apache.skywalking.plugin.test.mockcollector.service.MockNetworkAddressRegisterService;
import org.apache.skywalking.plugin.test.mockcollector.service.MockRegisterService;
import org.apache.skywalking.plugin.test.mockcollector.service.MockTraceSegmentService;
import org.apache.skywalking.plugin.test.mockcollector.service.ReceiveDataService;
@@ -47,8 +45,6 @@ public class Main {
.maxMessageSize(16777216)
.addService(new MockRegisterService())
.addService(new MockInstancePingService())
- .addService(new MockInstanceDiscoveryService())
- .addService(new MockNetworkAddressRegisterService())
.addService(new MockTraceSegmentService())
.addService(new MockJVMMetricReportService())
.build()
@@ -61,8 +57,8 @@ public class Main {
servletContextHandler.addServlet(new ServletHolder(new HttpServlet() {
@Override
protected void doGet(HttpServletRequest req,
- HttpServletResponse resp) throws ServletException, IOException {
- if (ValidateData.INSTANCE.getRegistryItem().getApplications().isEmpty()) {
+ HttpServletResponse resp) throws ServletException, IOException {
+ if (ValidateData.INSTANCE.getRegistryItem().getServices().isEmpty()) {
resp.setStatus(500);
return;
}
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItem.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItem.java
index 668c00c..be76657 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItem.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItem.java
@@ -26,49 +26,49 @@ import java.util.concurrent.ConcurrentHashMap;
public class RegistryItem {
/**
- * applicationCode, applicationId
+ * serviceName, serviceId
*/
- private final Map<String, Integer> applications;
+ private final Map<String, Integer> services;
/**
- * applicationCode, operationName
+ * serviceName, operationName
*/
private final Map<String, Set<String>> operationNames;
/**
- * applicationCode, instanceId
+ * serviceName, instanceId
*/
private final Map<String, List<Integer>> instanceMapping;
/**
- * applicationCode, count
+ * serviceName, count
*/
private final Map<String, Integer> heartBeats;
public RegistryItem() {
- applications = new ConcurrentHashMap<>();
+ services = new ConcurrentHashMap<>();
operationNames = new ConcurrentHashMap<>();
instanceMapping = new ConcurrentHashMap<>();
heartBeats = new ConcurrentHashMap<>();
}
- public void registryApplication(Application application) {
- applications.putIfAbsent(application.applicationCode, application.applicationId);
+ public void registryService(Service service) {
+ services.putIfAbsent(service.serviceName, service.serviceId);
}
public void registryOperationName(OperationName operationName) {
- String applicationCode = findApplicationCode(operationName.applicationId);
- Set<String> operationNameList = operationNames.get(applicationCode);
+ String serviceName = findServiceName(operationName.serviceId);
+ Set<String> operationNameList = operationNames.get(serviceName);
if (operationNameList == null) {
operationNameList = new HashSet<>();
- operationNames.put(applicationCode, operationNameList);
+ operationNames.put(serviceName, operationNameList);
}
operationNameList.add(operationName.operationName);
}
public void registryInstance(Instance instance) {
- String applicationCode = findApplicationCode(instance.applicationId);
- List<Integer> instances = instanceMapping.get(applicationCode);
+ String serviceName = findServiceName(instance.serviceId);
+ List<Integer> instances = instanceMapping.get(serviceName);
if (instances == null) {
instances = new ArrayList<>();
- instanceMapping.put(applicationCode, instances);
+ instanceMapping.put(serviceName, instances);
}
if (!instances.contains(instance)) {
@@ -76,13 +76,13 @@ public class RegistryItem {
}
}
- public String findApplicationCode(int id) {
- for (Map.Entry<String, Integer> entry : applications.entrySet()) {
+ public String findServiceName(int id) {
+ for (Map.Entry<String, Integer> entry : services.entrySet()) {
if (entry.getValue() == id) {
return entry.getKey();
}
}
- throw new RuntimeException("Cannot found the code of applicationID[" + id + "].");
+ throw new RuntimeException("Cannot found the name of serviceId [" + id + "].");
}
public void registryHeartBeat(HeartBeat heartBeat) {
@@ -98,31 +98,31 @@ public class RegistryItem {
}
public static class OperationName {
- int applicationId;
+ int serviceId;
String operationName;
- public OperationName(int applicationId, String operationName) {
- this.applicationId = applicationId;
+ public OperationName(int serviceId, String operationName) {
+ this.serviceId = serviceId;
this.operationName = operationName;
}
}
- public static class Application {
- String applicationCode;
- int applicationId;
+ public static class Service {
+ String serviceName;
+ int serviceId;
- public Application(String applicationCode, int applicationId) {
- this.applicationCode = applicationCode;
- this.applicationId = applicationId;
+ public Service(String serviceName, int serviceId) {
+ this.serviceName = serviceName;
+ this.serviceId = serviceId;
}
}
public static class Instance {
- int applicationId;
+ int serviceId;
int instanceId;
- public Instance(int applicationId, int instanceId) {
- this.applicationId = applicationId;
+ public Instance(int serviceId, int instanceId) {
+ this.serviceId = serviceId;
this.instanceId = instanceId;
}
}
@@ -135,8 +135,8 @@ public class RegistryItem {
}
}
- public Map<String, Integer> getApplications() {
- return applications;
+ public Map<String, Integer> getServices() {
+ return services;
}
public Map<String, Set<String>> getOperationNames() {
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItemSerializer.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItemSerializer.java
index f022bbf..9affc07 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItemSerializer.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItemSerializer.java
@@ -29,34 +29,34 @@ public class RegistryItemSerializer implements JsonSerializer<RegistryItem> {
@Override
public JsonElement serialize(RegistryItem src, Type typeOfSrc, JsonSerializationContext context) {
JsonObject jsonObject = new JsonObject();
- JsonArray applicationArrays = new JsonArray();
- src.getApplications().forEach((applicationCode, applicationId) -> {
- JsonObject applicationJson = new JsonObject();
- applicationJson.addProperty(applicationCode, applicationId);
- applicationArrays.add(applicationJson);
+ JsonArray serviceArrays = new JsonArray();
+ src.getServices().forEach((serviceName, serviceId) -> {
+ JsonObject serviceJson = new JsonObject();
+ serviceJson.addProperty(serviceName, serviceId);
+ serviceArrays.add(serviceJson);
});
- jsonObject.add("applications", applicationArrays);
+ jsonObject.add("services", serviceArrays);
JsonArray instanceArrays = new JsonArray();
- src.getInstanceMapping().forEach((applicationCode, instanceIds) -> {
+ src.getInstanceMapping().forEach((serviceName, instanceIds) -> {
JsonObject instanceJson = new JsonObject();
- instanceJson.addProperty(applicationCode, instanceIds.size());
+ instanceJson.addProperty(serviceName, instanceIds.size());
instanceArrays.add(instanceJson);
});
jsonObject.add("instances", instanceArrays);
JsonArray operationNameArrays = new JsonArray();
- src.getOperationNames().forEach((applicationCode, operationNames) -> {
+ src.getOperationNames().forEach((serviceName, operationNames) -> {
JsonObject instanceJson = new JsonObject();
- instanceJson.add(applicationCode, new Gson().toJsonTree(operationNames));
+ instanceJson.add(serviceName, new Gson().toJsonTree(operationNames));
operationNameArrays.add(instanceJson);
});
jsonObject.add("operationNames", operationNameArrays);
JsonArray heartBeatArrays = new JsonArray();
- src.getHeartBeats().forEach((applicationCode, count) -> {
+ src.getHeartBeats().forEach((serviceName, count) -> {
JsonObject instanceJson = new JsonObject();
- instanceJson.addProperty(applicationCode, count);
+ instanceJson.addProperty(serviceName, count);
heartBeatArrays.add(instanceJson);
});
jsonObject.add("heartbeat", heartBeatArrays);
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Segment.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Segment.java
index 407f01e..a86fd2e 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Segment.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Segment.java
@@ -43,8 +43,9 @@ public class Segment {
}
public SegmentBuilder segmentId(UniqueId segmentUniqueId) {
- segmentId = String.join(".", Long.toString(segmentUniqueId.getIdParts(0)), Long.toString(segmentUniqueId.getIdParts(1)), Long
- .toString(segmentUniqueId.getIdParts(2)));
+ segmentId = String.join(
+ ".", Long.toString(segmentUniqueId.getIdParts(0)), Long.toString(segmentUniqueId.getIdParts(1)), Long
+ .toString(segmentUniqueId.getIdParts(2)));
return this;
}
}
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItem.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItem.java
index 8730b46..c6fde3f 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItem.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItem.java
@@ -21,11 +21,11 @@ import java.util.ArrayList;
import java.util.List;
public class SegmentItem {
- private String applicationCode;
+ private String serviceName;
private List<Segment> segments;
- public SegmentItem(String applicationCode) {
- this.applicationCode = applicationCode;
+ public SegmentItem(String serviceName) {
+ this.serviceName = serviceName;
segments = new ArrayList<>();
}
@@ -33,8 +33,8 @@ public class SegmentItem {
segments.add(item);
}
- public String getApplicationCode() {
- return applicationCode;
+ public String getServiceName() {
+ return serviceName;
}
public List<Segment> getSegments() {
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItems.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItems.java
index 60e07f1..d54df13 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItems.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItems.java
@@ -27,12 +27,12 @@ public class SegmentItems {
this.segmentItems = new HashMap<>();
}
- public SegmentItems addSegmentItem(int applicationId, Segment segment) {
- String applicationCode = ValidateData.INSTANCE.getRegistryItem().findApplicationCode(applicationId);
- SegmentItem segmentItem = segmentItems.get(applicationCode);
+ public SegmentItems addSegmentItem(int serviceId, Segment segment) {
+ String serviceName = ValidateData.INSTANCE.getRegistryItem().findServiceName(serviceId);
+ SegmentItem segmentItem = segmentItems.get(serviceName);
if (segmentItem == null) {
- segmentItem = new SegmentItem(applicationCode);
- segmentItems.put(applicationCode, segmentItem);
+ segmentItem = new SegmentItem(serviceName);
+ segmentItems.put(serviceName, segmentItem);
}
segmentItem.addSegments(segment);
return this;
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItemsSerializer.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItemsSerializer.java
index 7dc66c9..c714ab8 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItemsSerializer.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItemsSerializer.java
@@ -29,19 +29,19 @@ public class SegmentItemsSerializer implements JsonSerializer<SegmentItems> {
@Override
public JsonElement serialize(SegmentItems src, Type typeOfSrc, JsonSerializationContext context) {
- JsonArray applicationSegmentItems = new JsonArray();
- src.getSegmentItems().forEach((applicationCode, segmentItem) -> {
+ JsonArray serviceSegmentItems = new JsonArray();
+ src.getSegmentItems().forEach((serviceName, segmentItem) -> {
JsonObject segmentJson = new JsonObject();
- segmentJson.addProperty("applicationCode", applicationCode);
+ segmentJson.addProperty("serviceName", serviceName);
segmentJson.addProperty("segmentSize", segmentItem.getSegments().size());
JsonArray segments = new JsonArray();
segmentItem.getSegments().forEach(segment -> {
segments.add(new Gson().toJsonTree(segment));
});
segmentJson.add("segments", segments);
- applicationSegmentItems.add(segmentJson);
+ serviceSegmentItems.add(segmentJson);
});
- return applicationSegmentItems;
+ return serviceSegmentItems;
}
}
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Span.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Span.java
index b4fbb53..dceabee 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Span.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Span.java
@@ -41,8 +41,6 @@ import lombok.Builder;
import lombok.Getter;
import lombok.ToString;
import org.apache.skywalking.apm.network.common.KeyStringValuePair;
-import org.apache.skywalking.apm.network.language.agent.KeyWithStringValue;
-import org.apache.skywalking.apm.network.language.agent.TraceSegmentReference;
import org.apache.skywalking.apm.network.language.agent.UniqueId;
import org.apache.skywalking.apm.network.language.agent.v2.SegmentReference;
@@ -107,18 +105,6 @@ public class Span {
return this;
}
- public SpanBuilder logEventV1(List<KeyWithStringValue> dataList) {
- if (logs == null) {
- logs = new ArrayList<>();
- }
-
- LogEvent event = new LogEvent();
- for (KeyWithStringValue value : dataList) {
- event.logEvent.add(new KeyValuePair(value.getKey(), value.getValue()));
- }
- logs.add(event);
- return this;
- }
}
public static class KeyValuePair {
@@ -160,8 +146,11 @@ public class Span {
public SegmentRef(SegmentReference ref) {
UniqueId segmentUniqueId = ref.getParentTraceSegmentId();
- this.parentTraceSegmentId = String.join(".", Long.toString(segmentUniqueId.getIdParts(0)), Long.toString(segmentUniqueId
- .getIdParts(1)), Long.toString(segmentUniqueId.getIdParts(2)));
+ this.parentTraceSegmentId = String.join(
+ ".", Long.toString(segmentUniqueId.getIdParts(0)), Long.toString(segmentUniqueId
+ .getIdParts(1)),
+ Long.toString(segmentUniqueId.getIdParts(2))
+ );
this.refType = ref.getRefType().toString();
this.parentSpanId = ref.getParentSpanId();
this.entryEndpointId = ref.getEntryEndpointId();
@@ -174,20 +163,5 @@ public class Span {
this.entryServiceInstanceId = ref.getEntryServiceInstanceId();
}
- public SegmentRef(TraceSegmentReference ref) {
- UniqueId segmentUniqueId = ref.getParentTraceSegmentId();
- this.parentTraceSegmentId = String.join(".", Long.toString(segmentUniqueId.getIdParts(0)), Long.toString(segmentUniqueId
- .getIdParts(1)), Long.toString(segmentUniqueId.getIdParts(2)));
- this.refType = ref.getRefType().toString();
- this.parentSpanId = ref.getParentSpanId();
- this.entryEndpointId = ref.getEntryServiceId();
- this.networkAddressId = ref.getNetworkAddressId();
- this.parentServiceInstanceId = ref.getParentApplicationInstanceId();
- this.parentEndpointId = ref.getParentServiceId();
- this.parentEndpoint = ref.getParentServiceName();
- this.networkAddress = ref.getNetworkAddress();
- this.entryEndpoint = ref.getEntryServiceName();
- this.entryServiceInstanceId = ref.getEntryApplicationInstanceId();
- }
}
}
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockInstanceDiscoveryService.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockInstanceDiscoveryService.java
deleted file mode 100644
index 8ee0901..0000000
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockInstanceDiscoveryService.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.skywalking.plugin.test.mockcollector.service;
-
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstance;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceHeartbeat;
-import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceMapping;
-import org.apache.skywalking.apm.network.language.agent.Downstream;
-import org.apache.skywalking.apm.network.language.agent.InstanceDiscoveryServiceGrpc;
-import org.apache.skywalking.plugin.test.mockcollector.entity.RegistryItem;
-import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData;
-
-public class MockInstanceDiscoveryService extends InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceImplBase {
-
- @Override
- public void heartbeat(ApplicationInstanceHeartbeat request, StreamObserver<Downstream> responseObserver) {
- ValidateData.INSTANCE.getRegistryItem()
- .registryHeartBeat(new RegistryItem.HeartBeat(request.getApplicationInstanceId()));
- responseObserver.onNext(Downstream.getDefaultInstance());
- responseObserver.onCompleted();
- }
-
- @Override
- public void registerInstance(ApplicationInstance request,
- StreamObserver<ApplicationInstanceMapping> responseObserver) {
- int instanceId = Sequences.INSTANCE_SEQUENCE.incrementAndGet();
- ValidateData.INSTANCE.getRegistryItem()
- .registryInstance(new RegistryItem.Instance(request.getApplicationId(), instanceId));
-
- responseObserver.onNext(ApplicationInstanceMapping.newBuilder()
- .setApplicationId(request.getApplicationId())
- .setApplicationInstanceId(instanceId)
- .build());
- responseObserver.onCompleted();
- }
-}
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockNetworkAddressRegisterService.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockNetworkAddressRegisterService.java
deleted file mode 100644
index 7e620d4..0000000
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockNetworkAddressRegisterService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.skywalking.plugin.test.mockcollector.service;
-
-import io.grpc.stub.StreamObserver;
-import org.apache.skywalking.apm.network.language.agent.NetworkAddressMappings;
-import org.apache.skywalking.apm.network.language.agent.NetworkAddressRegisterServiceGrpc;
-import org.apache.skywalking.apm.network.language.agent.NetworkAddresses;
-
-public class MockNetworkAddressRegisterService extends NetworkAddressRegisterServiceGrpc.NetworkAddressRegisterServiceImplBase {
-
- @Override
- public void batchRegister(NetworkAddresses request, StreamObserver<NetworkAddressMappings> responseObserver) {
- responseObserver.onNext(NetworkAddressMappings.getDefaultInstance());
- responseObserver.onCompleted();
- }
-}
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockRegisterService.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockRegisterService.java
index 9374fa9..1bb115a 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockRegisterService.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockRegisterService.java
@@ -27,7 +27,6 @@ import org.apache.skywalking.apm.network.register.v2.Endpoints;
import org.apache.skywalking.apm.network.register.v2.NetAddressMapping;
import org.apache.skywalking.apm.network.register.v2.NetAddresses;
import org.apache.skywalking.apm.network.register.v2.RegisterGrpc;
-import org.apache.skywalking.apm.network.register.v2.Service;
import org.apache.skywalking.apm.network.register.v2.ServiceInstance;
import org.apache.skywalking.apm.network.register.v2.ServiceInstanceRegisterMapping;
import org.apache.skywalking.apm.network.register.v2.ServiceInstances;
@@ -59,7 +58,7 @@ public class MockRegisterService extends RegisterGrpc.RegisterImplBase {
@Override
public void doServiceInstanceRegister(ServiceInstances request,
- StreamObserver<ServiceInstanceRegisterMapping> responseObserver) {
+ StreamObserver<ServiceInstanceRegisterMapping> responseObserver) {
if (request.getInstancesCount() <= 0) {
responseObserver.onNext(ServiceInstanceRegisterMapping.getDefaultInstance());
responseObserver.onCompleted();
@@ -69,13 +68,16 @@ public class MockRegisterService extends RegisterGrpc.RegisterImplBase {
for (ServiceInstance serviceInstance : request.getInstancesList()) {
int instanceId = Sequences.INSTANCE_SEQUENCE.incrementAndGet();
ValidateData.INSTANCE.getRegistryItem()
- .registryInstance(new RegistryItem.Instance(serviceInstance.getServiceId(), instanceId));
+ .registryInstance(
+ new RegistryItem.Instance(serviceInstance.getServiceId(), instanceId));
responseObserver.onNext(ServiceInstanceRegisterMapping.newBuilder()
.addServiceInstances(KeyIntValuePair.newBuilder()
- .setKey(serviceInstance
- .getInstanceUUID())
- .setValue(instanceId)
+ .setKey(
+ serviceInstance
+ .getInstanceUUID())
+ .setValue(
+ instanceId)
.build())
.build());
responseObserver.onCompleted();
@@ -84,7 +86,7 @@ public class MockRegisterService extends RegisterGrpc.RegisterImplBase {
@Override
public void doServiceRegister(Services request, StreamObserver<ServiceRegisterMapping> responseObserver) {
- logger.debug("receive application register.");
+ logger.debug("receive service register.");
if (request.getServicesCount() <= 0) {
logger.warn("The service count is empty. return the default service register mapping");
responseObserver.onNext(ServiceRegisterMapping.getDefaultInstance());
@@ -92,26 +94,26 @@ public class MockRegisterService extends RegisterGrpc.RegisterImplBase {
return;
}
- for (Service service : request.getServicesList()) {
- String applicationCode = service.getServiceName();
+ for (org.apache.skywalking.apm.network.register.v2.Service service : request.getServicesList()) {
+ String serviceName = service.getServiceName();
ServiceRegisterMapping.Builder builder = ServiceRegisterMapping.newBuilder();
- if (applicationCode.startsWith("localhost") || applicationCode.startsWith("127.0.0.1") || applicationCode.contains(":") || applicationCode
- .contains("/")) {
+ if (serviceName.startsWith("localhost") || serviceName.startsWith("127.0.0.1")
+ || serviceName.contains(":") || serviceName.contains("/")) {
responseObserver.onNext(builder.build());
responseObserver.onCompleted();
return;
}
- Integer applicationId = Sequences.SERVICE_MAPPING.get(applicationCode);
- if (applicationId == null) {
- applicationId = Sequences.ENDPOINT_SEQUENCE.incrementAndGet();
- Sequences.SERVICE_MAPPING.put(applicationCode, applicationId);
+ Integer serviceId = Sequences.SERVICE_MAPPING.get(serviceName);
+ if (serviceId == null) {
+ serviceId = Sequences.ENDPOINT_SEQUENCE.incrementAndGet();
+ Sequences.SERVICE_MAPPING.put(serviceName, serviceId);
ValidateData.INSTANCE.getRegistryItem()
- .registryApplication(new RegistryItem.Application(applicationCode, applicationId));
+ .registryService(new RegistryItem.Service(serviceName, serviceId));
}
- builder.addServices(KeyIntValuePair.newBuilder().setKey(applicationCode).setValue(applicationId).build());
+ builder.addServices(KeyIntValuePair.newBuilder().setKey(serviceName).setValue(serviceId).build());
responseObserver.onNext(builder.build());
responseObserver.onCompleted();
}
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockTraceSegmentService.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockTraceSegmentService.java
index fb5cbd7..e0a48a3 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockTraceSegmentService.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockTraceSegmentService.java
@@ -46,8 +46,11 @@ public class MockTraceSegmentService extends TraceSegmentReportServiceGrpc.Trace
SegmentObject traceSegmentObject = SegmentObject.parseFrom(value.getSegment());
Segment.SegmentBuilder segmentBuilder = Segment.builder()
.segmentId(traceSegmentObject.getTraceSegmentId());
- logger.debug("Receive segment: ServiceID[{}], TraceSegmentId[{}]", traceSegmentObject.getServiceId(), traceSegmentObject
- .getTraceSegmentId());
+ logger.debug(
+ "Receive segment: ServiceID[{}], TraceSegmentId[{}]", traceSegmentObject.getServiceId(),
+ traceSegmentObject
+ .getTraceSegmentId()
+ );
for (SpanObjectV2 spanObject : traceSegmentObject.getSpansList()) {
Span.SpanBuilder spanBuilder = Span.builder()
diff --git a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ReceiveDataService.java b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ReceiveDataService.java
index f9b0378..065b506 100644
--- a/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ReceiveDataService.java
+++ b/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ReceiveDataService.java
@@ -38,7 +38,7 @@ public class ReceiveDataService extends HttpServlet {
resp.setCharacterEncoding("utf-8");
resp.setStatus(200);
Gson gson = new GsonBuilder().registerTypeAdapter(ValidateData.class, new ValidateDataSerializer()).create();
- System.out.println();
+
Yaml yaml = new Yaml();
Writer out = resp.getWriter();
out.write(yaml.dump(yaml.load(gson.toJson(ValidateData.INSTANCE))));
diff --git a/mock-collector/src/main/resources/expect-data.yaml b/mock-collector/src/test/resources/expect-data.yaml
similarity index 73%
rename from mock-collector/src/main/resources/expect-data.yaml
rename to mock-collector/src/test/resources/expect-data.yaml
index ed70818..5a9d8e9 100644
--- a/mock-collector/src/main/resources/expect-data.yaml
+++ b/mock-collector/src/test/resources/expect-data.yaml
@@ -15,26 +15,26 @@
# limitations under the License.
expectData:
- registryItem:
- - applications:
- - test-applicationCode1: nq 0 // the application id of test-applicationCode is 3
- - test-applicationCode2: nq 0
+ - services:
+ - test-serviceName1: nq 0 // the service id of test-serviceName is 3
+ - test-serviceName2: nq 0
- operationNames:
- - test-applicationCode1: {testOperationName, testOperationName1} // there are three operation names in test-applicationCode1 has been registery
+ - test-serviceName1: {testOperationName, testOperationName1} // there are three operation names in test-serviceName1 has been registery
- instances:
- - test-applicationCode1: eq 3 // test-applicationCode1 has 3 instances
- - test-applicationCode2: 1 // test-applicationCode2 has 1 instance
+ - test-serviceName1: eq 3 // test-serviceName1 has 3 instances
+ - test-serviceName2: 1 // test-serviceName2 has 1 instance
- heartbeat:
- - test-applicationCode1: gt 2 // there are 3 instance of test-applicationCode has been send heartbeat
+ - test-serviceName1: gt 2 // there are 3 instance of test-serviceName has been send heartbeat
- segmentsItems:
-
- test-applicationCode: 1 // test-applicationCode has seend 1 segment.
+ test-serviceName: 1 // test-serviceName has seend 1 segment.
segments:
-
segmentId: not null
refs:
- parentSpanId: 1
- - parentTraceSegmentId: ${test-applicationCode2[0]}
+ - parentTraceSegmentId: ${test-serviceName2[0]}
- networkAddress: xxx
- parentServiceId: 1
- parentServiceName: not null
@@ -62,7 +62,7 @@ expectData:
spanType: Entry
isError: false
-
- test-applicationCode2: 2
+ test-serviceName2: 2
segments:
-
segmentId: not null
diff --git a/mock-collector/src/main/resources/sample-data.yaml b/mock-collector/src/test/resources/sample-data.yaml
similarity index 70%
rename from mock-collector/src/main/resources/sample-data.yaml
rename to mock-collector/src/test/resources/sample-data.yaml
index a648290..154838e 100644
--- a/mock-collector/src/main/resources/sample-data.yaml
+++ b/mock-collector/src/test/resources/sample-data.yaml
@@ -16,26 +16,26 @@
#
validateData:
- registryItem:
- - applications:
- - test-applicationCode1: 3 // the application id of test-applicationCode is 3
- - test-applicationCode2: 1
+ - services:
+ - test-serviceName1: 3 // the service id of test-serviceName is 3
+ - test-serviceName2: 1
- operationNames:
- - test-applicationCode1: {testOperationName, testOperationName1} // there are three operation names in test-applicationCode1 has been registery
+ - test-serviceName1: {testOperationName, testOperationName1} // there are three operation names in test-serviceName1 has been registery
- instances:
- - test-applicationCode1: 3 // test-applicationCode1 has 3 instances
- - test-applicationCode2: 1 // test-applicationCode2 has 1 instance
+ - test-serviceName1: 3 // test-serviceName1 has 3 instances
+ - test-serviceName2: 1 // test-serviceName2 has 1 instance
- heartbeat:
- - test-applicationCode1: 3 // there are 3 instance of test-applicationCode has been send heartbeat
+ - test-serviceName1: 3 // there are 3 instance of test-serviceName has been send heartbeat
- segmentsItems:
-
- test-applicationCode: 1 // test-applicationCode has seend 1 segment.
+ test-serviceName: 1 // test-serviceName has seend 1 segment.
segments:
-
segmentId: xxxx
refs:
- parentSpanId: 1
- - parentTraceSegmentId: ${test-applicationCode2[0]}
+ - parentTraceSegmentId: ${test-serviceName2[0]}
- networkAddress: xxx
- parentServiceId: 1
- parentServiceName: not null
@@ -63,6 +63,6 @@ validateData:
spanType: Entry
isError: false
-
- test-applicationCode2: 2
+ test-serviceName2: 2
segments:
//.....
diff --git a/validator/README.md b/validator/README.md
index c40707b..f092d7f 100644
--- a/validator/README.md
+++ b/validator/README.md
@@ -8,13 +8,13 @@ The following are the exceptions that may occur in the validate tools.
* [IllegalDataFileException](./docs/exception/IllegalDataFileException.md)
### Registry Item
-#### Application
-* [RegistryInstanceOfApplicationNotFoundException](./docs/exception/RegistryInstanceOfApplicationNotFoundException.md)
-* [RegistryApplicationNotFoundException](./docs/exception/RegistryApplicationNotFoundException.md)
-* [RegistryApplicationSizeNotEqualsException](./docs/exception/RegistryApplicationSizeNotEqualsException.md)
+#### Service
+* [RegistryInstanceOfServiceNotFoundException](./docs/exception/RegistryInstanceOfServiceNotFoundException.md)
+* [RegistryServiceNotFoundException](docs/exception/RegistryServiceNotFoundException.md)
+* [RegistryServiceSizeNotEqualsException](docs/exception/RegistryServiceSizeNotEqualsException.md)
#### Instance
-* [RegistryInstanceOfApplicationNotFoundException](./docs/exception/RegistryInstanceOfApplicationNotFoundException.md)
+* [RegistryInstanceOfServiceNotFoundException](./docs/exception/RegistryInstanceOfServiceNotFoundException.md)
* [RegistryInstanceSizeNotEqualsException](./docs/exception/RegistryInstanceSizeNotEqualsException.md)
* [RegistryInstancesNotEqualsException](./docs/exception/RegistryInstancesNotEqualsException.md)
@@ -22,7 +22,7 @@ The following are the exceptions that may occur in the validate tools.
* [ActualRegistryOperationNameEmptyException](./docs/exception/ActualRegistryOperationNameEmptyException.md)
* [RegistryOperationNameNotFoundException](./docs/exception/RegistryOperationNameNotFoundException.md)
* [RegistryOperationNamesNotFoundException](./docs/exception/RegistryOperationNamesNotFoundException.md)
-* [RegistryOperationNamesOfApplicationNotFoundException](./docs/exception/RegistryOperationNamesOfApplicationNotFoundException.md)
+* [RegistryOperationNamesOfServiceNotFoundException](./docs/exception/RegistryOperationNamesOfServiceNotFoundException.md)
### Segment
* [ActualSegmentItemEmptyException](./docs/exception/ActualSegmentItemEmptyException.md)
diff --git a/validator/docs/exception/ActualRegistryOperationNameEmptyException.md b/validator/docs/exception/ActualRegistryOperationNameEmptyException.md
index 5f4c884..55de795 100644
--- a/validator/docs/exception/ActualRegistryOperationNameEmptyException.md
+++ b/validator/docs/exception/ActualRegistryOperationNameEmptyException.md
@@ -1,7 +1,7 @@
# ActualRegistryOperationNameEmptyException
## Format
-ActualRegistryOperationNameEmptyException APPLICATION<br/>
+ActualRegistryOperationNameEmptyException SERVICE_ID<br/>
expected: [ OPERATION_NAME_A, OPERATION_NAME_B, ... ]<br/>
actual: Empty
diff --git a/validator/docs/exception/ActualSegmentItemEmptyException.md b/validator/docs/exception/ActualSegmentItemEmptyException.md
index bf3b186..3cc3289 100644
--- a/validator/docs/exception/ActualSegmentItemEmptyException.md
+++ b/validator/docs/exception/ActualSegmentItemEmptyException.md
@@ -3,7 +3,7 @@
## Format
ActualSegmentItemEmptyException<br/>
expected:<br/>
-Segment Item[APPLICATION]<br/>
+Segment Item[SERVICE_NAME]<br/>
- segment size: EXPECTED_SIZE<br/>
actual: Empty<br/>
diff --git a/validator/docs/exception/RegistryApplicationNotFoundException.md b/validator/docs/exception/RegistryApplicationNotFoundException.md
deleted file mode 100644
index 07e57b2..0000000
--- a/validator/docs/exception/RegistryApplicationNotFoundException.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# RegistryApplicationNotFoundException
-
-## Format
-RegistryApplicationNotFoundException<br/>
-expected: EXPECTED_SERVICE<br/>
-actual: NOT FOUND
-
-## Cause by
-The `RegistryApplicationNotFoundException` caused by one of application code that you write in the expected data file
-cannot found in the actual data file.
-
-
-## Check points
-1. Check the application code is the value of `agent.service_name` that you configured.
-
-e.g.,
-the application that you write in the expected data file:
-```
-registryItems: {
- "test_application": {
- }
-}
-```
-the application of `agent.service_name` that you configured:
-`-Dskywalking.agent.service_name=another_application`
-
-2. Check the agent of someone project in the test case if it works.
\ No newline at end of file
diff --git a/validator/docs/exception/RegistryApplicationSizeNotEqualsException.md b/validator/docs/exception/RegistryApplicationSizeNotEqualsException.md
deleted file mode 100644
index 56f0099..0000000
--- a/validator/docs/exception/RegistryApplicationSizeNotEqualsException.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# RegistryApplicationSizeNotEqualsException
-
-## Format
-RegistryApplicationSizeNotEqualsException APPLICATION<br/>
-expected: EXPECTED_SIZE<br/>
-actual: ACTUAL_SIZE
-
-## Cause
-The `RegistryApplicationSizeNotEqualsException` caused by the size of the registry application is different between expected and actual.
-
-## Check Points
-1. Check if the size of the registry application that you expected
-2. Check if the `agent.service_name` is duplicated in the test case project
\ No newline at end of file
diff --git a/validator/docs/exception/RegistryInstanceOfApplicationNotFoundException.md b/validator/docs/exception/RegistryInstanceOfApplicationNotFoundException.md
deleted file mode 100644
index 23f3d5f..0000000
--- a/validator/docs/exception/RegistryInstanceOfApplicationNotFoundException.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# RegistryInstanceOfApplicationNotFoundException
-
-## Format
-RegistryInstanceOfApplicationNotFoundException<br/>
-expected: Instances of Service(APPLICATION)<br/>
-actual: NOT FOUND
-
-## Cause
-The `RegistryApplicationNotFoundException` caused by one of application code that you write in the expected data file
-cannot found in the actual data file.
-
-
-## Check Points
-1. Check the application code is the value of `agent.service_name` that you configured.<br/>
-e.g.,
-the application that you write in the expected data file:
-```
-registryItems: {
- "test_application": {
- }
-}
-```
-the application of `agent.service_name` that you configured: `-Dskywalking.agent.service_name=another_application`
-
-2. Check the agent of someone project in the test case if it works.
\ No newline at end of file
diff --git a/validator/docs/exception/RegistryInstanceOfServiceNotFoundException.md b/validator/docs/exception/RegistryInstanceOfServiceNotFoundException.md
new file mode 100644
index 0000000..b11575c
--- /dev/null
+++ b/validator/docs/exception/RegistryInstanceOfServiceNotFoundException.md
@@ -0,0 +1,25 @@
+# RegistryInstanceOfServiceNotFoundException
+
+## Format
+RegistryInstanceOfServiceNotFoundException<br/>
+expected: Instances of Service(ServiceId)<br/>
+actual: NOT FOUND
+
+## Cause
+The `RegistryServiceNotFoundException` caused by one of service code that you write in the expected data file
+cannot found in the actual data file.
+
+
+## Check Points
+1. Check the service code is the value of `agent.service_name` that you configured.<br/>
+e.g.,
+the service that you write in the expected data file:
+```
+registryItems: {
+ "test_servce_name": {
+ }
+}
+```
+the service of `agent.service_name` that you configured: `-Dskywalking.agent.service_name=other_servce_name`
+
+2. Check the agent of someone project in the test case if it works.
\ No newline at end of file
diff --git a/validator/docs/exception/RegistryInstanceSizeNotEqualsException.md b/validator/docs/exception/RegistryInstanceSizeNotEqualsException.md
index 19739a9..050e23b 100644
--- a/validator/docs/exception/RegistryInstanceSizeNotEqualsException.md
+++ b/validator/docs/exception/RegistryInstanceSizeNotEqualsException.md
@@ -1,12 +1,12 @@
# RegistryInstanceSizeNotEqualsException
## Format
-RegistryInstanceSizeNotEqualsException APPLICATION<br/>
+RegistryInstanceSizeNotEqualsException SERVICE_NAME<br/>
expected: EXPECTED_SIZE<br/>
actual: ACTUAL_SIZE
## Cause
-The `RegistryInstanceSizeNotEqualsException` caused by the size of the registry instance of one application is different between you expected and the actual
+The `RegistryInstanceSizeNotEqualsException` caused by the size of the registry instance of one service is different between you expected and the actual
## Check Points
1. Check the size of the registry instance that you expected
diff --git a/validator/docs/exception/RegistryOperationNameNotFoundException.md b/validator/docs/exception/RegistryOperationNameNotFoundException.md
index 39ecbfc..eb05652 100644
--- a/validator/docs/exception/RegistryOperationNameNotFoundException.md
+++ b/validator/docs/exception/RegistryOperationNameNotFoundException.md
@@ -1,7 +1,7 @@
# RegistryOperationNameNotFoundException
## Format
-RegistryOperationNameNotFoundException APPLICATION<br/>
+RegistryOperationNameNotFoundException SERVICE_NAME<br/>
expected: OPERATION_NAME<br/>
actual: NOT FOUND
diff --git a/validator/docs/exception/RegistryOperationNamesNotFoundException.md b/validator/docs/exception/RegistryOperationNamesNotFoundException.md
index 13c5764..368a105 100644
--- a/validator/docs/exception/RegistryOperationNamesNotFoundException.md
+++ b/validator/docs/exception/RegistryOperationNamesNotFoundException.md
@@ -1,12 +1,12 @@
# RegistryOperationNamesNotFoundException
## Format
-RegistryOperationNamesNotFoundException <APPLICATION><br/>
+RegistryOperationNamesNotFoundException <SERVICE_NAME><br/>
expected: <OPERATION_NAME_1, OPERATION_NAME_2, ....><br/>
actual: Not Found<br/>
## Cause by
-The RegistryOperationNamesNotFoundException cause by the registry operation names of someone application cannot found
+The RegistryOperationNamesNotFoundException cause by the registry operation names of someone service cannot found
in the actual data file.
## Check Points
diff --git a/validator/docs/exception/RegistryOperationNamesOfApplicationNotFoundException.md b/validator/docs/exception/RegistryOperationNamesOfApplicationNotFoundException.md
index 45136e6..66da425 100644
--- a/validator/docs/exception/RegistryOperationNamesOfApplicationNotFoundException.md
+++ b/validator/docs/exception/RegistryOperationNamesOfApplicationNotFoundException.md
@@ -1,12 +1,12 @@
-# RegistryOperationNamesOfApplicationNotFoundException
+# RegistryOperationNamesOfServiceNotFoundException
## Format
-RegistryOperationNamesOfApplicationNotFoundException<br/>
+RegistryOperationNamesOfServiceNotFoundException<br/>
expected: [ OPERATION_NAME_A, OPERATION_NAME_B, ...]<br/>
actual: NOT FOUND
## Cause
-The `RegistryOperationNamesOfApplicationNotFoundException` caused by the registry operation name of someone application does not exist in the actual data file.
+The `RegistryOperationNamesOfServiceNotFoundException` caused by the registry operation name of someone service does not exist in the actual data file.
## Check Points
1. Check if the execute time of entry service of test case more than 40 seconds, Please make it less than 40 seconds.
\ No newline at end of file
diff --git a/validator/docs/exception/RegistryServiceNotFoundException.md b/validator/docs/exception/RegistryServiceNotFoundException.md
new file mode 100644
index 0000000..34023a4
--- /dev/null
+++ b/validator/docs/exception/RegistryServiceNotFoundException.md
@@ -0,0 +1,27 @@
+# RegistryServiceNotFoundException
+
+## Format
+RegistryServiceNotFoundException<br/>
+expected: EXPECTED_SERVICE<br/>
+actual: NOT FOUND
+
+## Cause by
+The `RegistryServiceNotFoundException` caused by one of service code that you write in the expected data file
+cannot found in the actual data file.
+
+
+## Check points
+1. Check the service code is the value of `agent.service_name` that you configured.
+
+e.g.,
+the service that you write in the expected data file:
+```
+registryItems: {
+ "test_servce_name": {
+ }
+}
+```
+the service of `agent.service_name` that you configured:
+`-Dskywalking.agent.service_name=another_service_name`
+
+2. Check the agent of someone project in the test case if it works.
\ No newline at end of file
diff --git a/validator/docs/exception/RegistryServiceSizeNotEqualsException.md b/validator/docs/exception/RegistryServiceSizeNotEqualsException.md
new file mode 100644
index 0000000..5f41adc
--- /dev/null
+++ b/validator/docs/exception/RegistryServiceSizeNotEqualsException.md
@@ -0,0 +1,13 @@
+# RegistryServiceSizeNotEqualsException
+
+## Format
+RegistryServiceSizeNotEqualsException SERVICE_NAME<br/>
+expected: EXPECTED_SIZE<br/>
+actual: ACTUAL_SIZE
+
+## Cause
+The `RegistryServiceSizeNotEqualsException` caused by the size of the registry service is different between expected and actual.
+
+## Check Points
+1. Check if the size of the registry service that you expected
+2. Check if the `agent.service_name` is duplicated in the test case project
\ No newline at end of file
diff --git a/validator/docs/exception/SegmentItemNotFoundException.md b/validator/docs/exception/SegmentItemNotFoundException.md
index 2f08dcc..788151c 100644
--- a/validator/docs/exception/SegmentItemNotFoundException.md
+++ b/validator/docs/exception/SegmentItemNotFoundException.md
@@ -3,7 +3,7 @@
## Format
SegmentItemNotFoundException<br/>
expected:<br/>
-Segment Item[APPLICATION]<br/>
+Segment Item[SERVICE_NAME]<br/>
- segment size: EXPECTED_SIZE<br/>
actual: NOT FOUND
diff --git a/validator/docs/exception/SegmentSizeNotEqualsException.md b/validator/docs/exception/SegmentSizeNotEqualsException.md
index a03868e..39153ce 100644
--- a/validator/docs/exception/SegmentSizeNotEqualsException.md
+++ b/validator/docs/exception/SegmentSizeNotEqualsException.md
@@ -1,7 +1,7 @@
# SegmentSizeNotEqualsException
## Format
-SegmentSizeNotEqualsException APPLICATION<br/>
+SegmentSizeNotEqualsException SERVICE_NAME<br/>
expected: EXPECTED_SIZE<br/>
actual: ACTUAL_SIZE<br/>
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/Main.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/Main.java
index 2f31015..423c45e 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/Main.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/Main.java
@@ -45,14 +45,20 @@ public class Main {
if (actualData.exists() && expectedData.exists()) {
try {
- DataAssert.assertEquals(Data.Loader.loadData("expectedData.yaml", expectedData), Data.Loader.loadData("actualData.yaml", actualData));
+ DataAssert.assertEquals(
+ Data.Loader.loadData("expectedData.yaml", expectedData),
+ Data.Loader.loadData("actualData.yaml", actualData)
+ );
return true;
} catch (AssertFailedException e) {
logger.error("\nassert failed.\n{}\n", e.getCauseMessage());
}
} else {
- logger.error("assert failed. because actual data {} and expected data {}", actualData.exists() ? "founded" : "not founded", expectedData
- .exists() ? "founded" : "not founded");
+ logger.error(
+ "assert failed. because actual data {} and expected data {}",
+ actualData.exists() ? "founded" : "not founded", expectedData
+ .exists() ? "founded" : "not founded"
+ );
}
} catch (Exception e) {
logger.error("assert test case {} failed.", ConfigHelper.caseName(), e);
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/InstanceAssert.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/InstanceAssert.java
index c4af5e6..dfde4a4 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/InstanceAssert.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/InstanceAssert.java
@@ -18,7 +18,7 @@
package org.apache.skywalking.plugin.test.agent.tool.validator.assertor;
import java.util.List;
-import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RegistryInstanceOfApplicationNotFoundException;
+import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RegistryInstanceOfServiceNotFoundException;
import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RegistryInstanceSizeNotEqualsException;
import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException;
import org.apache.skywalking.plugin.test.agent.tool.validator.entity.RegistryInstance;
@@ -31,23 +31,26 @@ public class InstanceAssert {
}
for (RegistryInstance instance : expected) {
- RegistryInstance actualInstance = getMatchApplication(actual, instance);
+ RegistryInstance actualInstance = getMatchService(actual, instance);
try {
ExpressParser.parse(actualInstance.expressValue())
- .assertValue(String.format("The registry instance of %s", instance.applicationCode()), actualInstance
- .expressValue());
+ .assertValue(
+ String.format("The registry instance of %s", instance.serviceName()),
+ actualInstance
+ .expressValue()
+ );
} catch (ValueAssertFailedException e) {
- throw new RegistryInstanceSizeNotEqualsException(instance.applicationCode(), e);
+ throw new RegistryInstanceSizeNotEqualsException(instance.serviceName(), e);
}
}
}
- private static RegistryInstance getMatchApplication(List<RegistryInstance> actual, RegistryInstance application) {
- for (RegistryInstance registryApplication : actual) {
- if (registryApplication.applicationCode().equals(application.applicationCode())) {
- return registryApplication;
+ private static RegistryInstance getMatchService(List<RegistryInstance> actual, RegistryInstance service) {
+ for (RegistryInstance registryInstance : actual) {
+ if (registryInstance.serviceName().equals(service.serviceName())) {
+ return registryInstance;
}
}
- throw new RegistryInstanceOfApplicationNotFoundException(application.applicationCode());
+ throw new RegistryInstanceOfServiceNotFoundException(service.serviceName());
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/OperationNameAssert.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/OperationNameAssert.java
index cb21391..cec6b3e 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/OperationNameAssert.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/OperationNameAssert.java
@@ -20,7 +20,7 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.assertor;
import java.util.List;
import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ActualRegistryOperationNameEmptyException;
import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RegistryOperationNameNotFoundException;
-import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RegistryOperationNamesOfApplicationNotFoundException;
+import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RegistryOperationNamesOfServiceNotFoundException;
import org.apache.skywalking.plugin.test.agent.tool.validator.entity.RegistryOperationName;
public class OperationNameAssert {
@@ -31,32 +31,33 @@ public class OperationNameAssert {
for (RegistryOperationName operationName : expected) {
RegistryOperationName actualOperationName = findActualRegistryOperationName(actual, operationName);
- assertOperationEquals(actualOperationName.applicationCode(), operationName.operationName(), actualOperationName
- .operationName());
+ assertOperationEquals(
+ actualOperationName.serviceName(), operationName.operationName(), actualOperationName
+ .operationName());
}
}
- private static void assertOperationEquals(String applicationCode, List<String> expectedOperationName,
- List<String> actualOperationName) {
+ private static void assertOperationEquals(String serviceName, List<String> expectedOperationName,
+ List<String> actualOperationName) {
for (String operationName : expectedOperationName) {
if (!actualOperationName.contains(operationName)) {
- throw new RegistryOperationNameNotFoundException(applicationCode, operationName);
+ throw new RegistryOperationNameNotFoundException(serviceName, operationName);
}
}
}
private static RegistryOperationName findActualRegistryOperationName(List<RegistryOperationName> actual,
- RegistryOperationName registryOperationName) {
+ RegistryOperationName registryOperationName) {
if (actual == null) {
throw new ActualRegistryOperationNameEmptyException(registryOperationName);
}
for (RegistryOperationName operationName : actual) {
- if (operationName.applicationCode().equals(registryOperationName.applicationCode())) {
+ if (operationName.serviceName().equals(registryOperationName.serviceName())) {
return operationName;
}
}
- throw new RegistryOperationNamesOfApplicationNotFoundException(registryOperationName);
+ throw new RegistryOperationNamesOfServiceNotFoundException(registryOperationName);
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ParentSegmentIdExpressParser.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ParentSegmentIdExpressParser.java
index d6a71cb..6cae845 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ParentSegmentIdExpressParser.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ParentSegmentIdExpressParser.java
@@ -30,11 +30,11 @@ public class ParentSegmentIdExpressParser {
String parentSegmentExpress = express.trim().substring(2, express.trim().length() - 1);
int startIndexOfIndex = parentSegmentExpress.indexOf("[");
- String applicationCode = parentSegmentExpress.substring(0, startIndexOfIndex);
+ String serviceName = parentSegmentExpress.substring(0, startIndexOfIndex);
int endIndexOfIndex = parentSegmentExpress.indexOf("]", startIndexOfIndex);
int expectedSize = Integer.parseInt(parentSegmentExpress.substring(startIndexOfIndex + 1, endIndexOfIndex));
for (SegmentItem segmentItem : actual) {
- if (segmentItem.applicationCode().equals(applicationCode)) {
+ if (segmentItem.serviceName().equals(serviceName)) {
if (segmentItem.segments().size() <= expectedSize) {
throw new ParentSegmentNotFoundException(parentSegmentExpress);
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/RegistryItemsAssert.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/RegistryItemsAssert.java
index 5c5e791..1ff9d62 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/RegistryItemsAssert.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/RegistryItemsAssert.java
@@ -25,8 +25,8 @@ public class RegistryItemsAssert {
private static Logger logger = LogManager.getLogger(RegistryItemsAssert.class);
public static void assertEquals(RegistryItems excepted, RegistryItems actual) {
- ApplicationAssert.assertEquals(excepted.applications(), actual.applications());
- logger.info("{} assert successful.", "registry applications");
+ ServiceAssert.assertEquals(excepted.services(), actual.services());
+ logger.info("{} assert successful.", "registry services");
InstanceAssert.assertEquals(excepted.instances(), actual.instances());
logger.info("{} assert successful.", "registry instances");
OperationNameAssert.assertEquals(excepted.operationNames(), actual.operationNames());
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentItemsAssert.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentItemsAssert.java
index 2a32b3e..47227ea 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentItemsAssert.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentItemsAssert.java
@@ -43,7 +43,8 @@ public class SegmentItemsAssert {
try {
assertSegmentSize(item.segmentSize(), actualSegmentItem.segmentSize());
} catch (ValueAssertFailedException e) {
- throw new SegmentSizeNotEqualsException(item.applicationCode(), item.segmentSize(), actualSegmentItem.segmentSize());
+ throw new SegmentSizeNotEqualsException(
+ item.serviceName(), item.segmentSize(), actualSegmentItem.segmentSize());
}
SegmentAssert.assertEquals(item, actualSegmentItem);
}
@@ -92,11 +93,11 @@ public class SegmentItemsAssert {
}
for (SegmentItem segmentItem : actual) {
- if (expected.applicationCode().equals(segmentItem.applicationCode())) {
+ if (expected.serviceName().equals(segmentItem.serviceName())) {
return segmentItem;
}
}
- throw new SegmentItemNotFoundException(expected.applicationCode());
+ throw new SegmentItemNotFoundException(expected.serviceName());
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssert.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssert.java
index 7e6b2d6..41820c4 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssert.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssert.java
@@ -67,14 +67,14 @@ public class SegmentRefAssert {
ExpressParser.parse(expected.networkAddressId())
.assertValue("network address id", actual.networkAddressId());
ExpressParser.parse(expected.parentServiceInstanceId())
- .assertValue("parent application instance id", actual.parentServiceInstanceId());
+ .assertValue("parent service instance id", actual.parentServiceInstanceId());
ExpressParser.parse(expected.parentEndpointId())
.assertValue("parent endpoint id", actual.parentEndpointId());
ExpressParser.parse(expected.parentEndpointName())
.assertValue("parent endpoint name", actual.parentEndpointName());
ExpressParser.parse(expected.refType()).assertValue("ref type", actual.refType());
ExpressParser.parse(expected.entryServiceInstanceId())
- .assertValue("entry application instance id", actual.entryServiceInstanceId());
+ .assertValue("entry service instance id", actual.entryServiceInstanceId());
return true;
} catch (ValueAssertFailedException e) {
throw new SegmentRefAssertFailedException(e, expected, actual);
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ApplicationAssert.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ServiceAssert.java
similarity index 55%
rename from validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ApplicationAssert.java
rename to validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ServiceAssert.java
index c59bd6c..332cc94 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ApplicationAssert.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ServiceAssert.java
@@ -18,36 +18,36 @@
package org.apache.skywalking.plugin.test.agent.tool.validator.assertor;
import java.util.List;
-import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RegistryApplicationNotFoundException;
-import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RegistryApplicationSizeNotEqualsException;
+import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RegistryServiceNotFoundException;
+import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RegistryServiceSizeNotEqualsException;
import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException;
-import org.apache.skywalking.plugin.test.agent.tool.validator.entity.RegistryApplication;
+import org.apache.skywalking.plugin.test.agent.tool.validator.entity.RegistryService;
-public class ApplicationAssert {
- public static void assertEquals(List<RegistryApplication> expected, List<RegistryApplication> actual) {
+public class ServiceAssert {
+ public static void assertEquals(List<RegistryService> expected, List<RegistryService> actual) {
if (expected == null) {
return;
}
- for (RegistryApplication application : expected) {
- RegistryApplication actualApplication = getMatchApplication(actual, application);
+ for (RegistryService service : expected) {
+ RegistryService actualService = getMatchService(actual, service);
try {
- ExpressParser.parse(application.expressValue())
- .assertValue("registry application", actualApplication.expressValue());
+ ExpressParser.parse(service.expressValue())
+ .assertValue("registry service", actualService.expressValue());
} catch (ValueAssertFailedException e) {
- throw new RegistryApplicationSizeNotEqualsException(application.applicationCode(), e);
+ throw new RegistryServiceSizeNotEqualsException(service.serviceName(), e);
}
}
}
- private static RegistryApplication getMatchApplication(List<RegistryApplication> actual,
- RegistryApplication application) {
- for (RegistryApplication registryApplication : actual) {
- if (registryApplication.applicationCode().equals(application.applicationCode())) {
- return registryApplication;
+ private static RegistryService getMatchService(List<RegistryService> actual,
+ RegistryService service) {
+ for (RegistryService registryService : actual) {
+ if (registryService.serviceName().equals(service.serviceName())) {
+ return registryService;
}
}
- throw new RegistryApplicationNotFoundException(application.applicationCode());
+ throw new RegistryServiceNotFoundException(service.serviceName());
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualRegistryOperationNameEmptyException.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualRegistryOperationNameEmptyException.java
index 6600b63..2524e79 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualRegistryOperationNameEmptyException.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualRegistryOperationNameEmptyException.java
@@ -30,7 +30,8 @@ public class ActualRegistryOperationNameEmptyException extends AssertFailedExcep
@Override
public String getCauseMessage() {
- return String.format("ActualRegistryOperationNameEmptyException\nexpected:%s\nactual:%s\n", registryOperationName
- .operationName(), "Empty");
+ return String.format(
+ "ActualRegistryOperationNameEmptyException\nexpected:%s\nactual:%s\n", registryOperationName
+ .operationName(), "Empty");
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceOfApplicationNotFoundException.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceOfServiceNotFoundException.java
similarity index 70%
rename from validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceOfApplicationNotFoundException.java
rename to validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceOfServiceNotFoundException.java
index ba41bd1..c604fb8 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceOfApplicationNotFoundException.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceOfServiceNotFoundException.java
@@ -19,16 +19,19 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exceptio
import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException;
-public class RegistryInstanceOfApplicationNotFoundException extends AssertFailedException {
+public class RegistryInstanceOfServiceNotFoundException extends AssertFailedException {
- private final String applicationCode;
+ private final String serviceName;
- public RegistryInstanceOfApplicationNotFoundException(String applicationCode) {
- this.applicationCode = applicationCode;
+ public RegistryInstanceOfServiceNotFoundException(String serviceName) {
+ this.serviceName = serviceName;
}
@Override
public String getCauseMessage() {
- return String.format("RegistryInstanceOfApplicationNotFoundException\nexpected: Instances of Service(%s)" + "\nactual: %s\n", applicationCode, "NOT FOUND");
+ return String.format(
+ "RegistryInstanceOfServiceNotFoundException\nexpected: Instances of Service(%s)" + "\nactual: %s\n",
+ serviceName, "NOT FOUND"
+ );
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceSizeNotEqualsException.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceSizeNotEqualsException.java
index 283e72a..8311214 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceSizeNotEqualsException.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceSizeNotEqualsException.java
@@ -21,17 +21,18 @@ import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFa
public class RegistryInstanceSizeNotEqualsException extends AssertFailedException {
- private final String applicationCode;
+ private final String serviceName;
private final ValueAssertFailedException cause;
- public RegistryInstanceSizeNotEqualsException(String applicationCode, ValueAssertFailedException cause) {
- this.applicationCode = applicationCode;
+ public RegistryInstanceSizeNotEqualsException(String serviceName, ValueAssertFailedException cause) {
+ this.serviceName = serviceName;
this.cause = cause;
}
@Override
public String getCauseMessage() {
- return String.format("RegistryInstanceSizeNotEqualsException %s\nexpected: %s\nactual: %s\n", applicationCode, cause
- .getExpected(), cause.getActual());
+ return String.format(
+ "RegistryInstanceSizeNotEqualsException %s\nexpected: %s\nactual: %s\n", serviceName, cause
+ .getExpected(), cause.getActual());
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNameNotFoundException.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNameNotFoundException.java
index 1cf2ec7..4647c26 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNameNotFoundException.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNameNotFoundException.java
@@ -20,16 +20,19 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exceptio
import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException;
public class RegistryOperationNameNotFoundException extends AssertFailedException {
- private final String applicationCode;
+ private final String serviceName;
private final String operationName;
- public RegistryOperationNameNotFoundException(String applicationCode, String operationName) {
- this.applicationCode = applicationCode;
+ public RegistryOperationNameNotFoundException(String serviceName, String operationName) {
+ this.serviceName = serviceName;
this.operationName = operationName;
}
@Override
public String getCauseMessage() {
- return String.format("RegistryOperationNameNotFoundException %s\nexpected: %s\nactual: %s\n", applicationCode, operationName, "NOT FOUND");
+ return String.format(
+ "RegistryOperationNameNotFoundException %s\nexpected: %s\nactual: %s\n", serviceName, operationName,
+ "NOT FOUND"
+ );
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNamesOfApplicationNotFoundException.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNamesOfServiceNotFoundException.java
similarity index 67%
rename from validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNamesOfApplicationNotFoundException.java
rename to validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNamesOfServiceNotFoundException.java
index 98f6c82..f8adf42 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNamesOfApplicationNotFoundException.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNamesOfServiceNotFoundException.java
@@ -20,16 +20,17 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exceptio
import org.apache.skywalking.plugin.test.agent.tool.validator.entity.RegistryOperationName;
import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException;
-public class RegistryOperationNamesOfApplicationNotFoundException extends AssertFailedException {
- private final RegistryOperationName applicationCode;
+public class RegistryOperationNamesOfServiceNotFoundException extends AssertFailedException {
+ private final RegistryOperationName registryOperationName;
- public RegistryOperationNamesOfApplicationNotFoundException(RegistryOperationName applicationCode) {
- this.applicationCode = applicationCode;
+ public RegistryOperationNamesOfServiceNotFoundException(RegistryOperationName registryOperationName) {
+ this.registryOperationName = registryOperationName;
}
@Override
public String getCauseMessage() {
- return String.format("RegistryOperationNamesOfApplicationNotFoundException %s\nexpected: %s\nactual: %s\n", applicationCode
- .applicationCode(), applicationCode.operationName(), "NOT FOUND");
+ return String.format(
+ "RegistryOperationNamesOfServiceNotFoundException %s\nexpected: %s\nactual: %s\n", registryOperationName
+ .serviceName(), registryOperationName.operationName(), "NOT FOUND");
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationNotFoundException.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryServiceNotFoundException.java
similarity index 73%
rename from validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationNotFoundException.java
rename to validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryServiceNotFoundException.java
index 449207c..f5335d8 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationNotFoundException.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryServiceNotFoundException.java
@@ -19,15 +19,16 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exceptio
import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException;
-public class RegistryApplicationNotFoundException extends AssertFailedException {
- private final String applicationCode;
+public class RegistryServiceNotFoundException extends AssertFailedException {
+ private final String serviceName;
- public RegistryApplicationNotFoundException(String applicationCode) {
- this.applicationCode = applicationCode;
+ public RegistryServiceNotFoundException(String serviceName) {
+ this.serviceName = serviceName;
}
@Override
public String getCauseMessage() {
- return String.format("RegistryApplicationNotFoundException\nexpected: %s\nactual: %s\n", applicationCode, "Not Found");
+ return String.format(
+ "RegistryServiceNotFoundException\nexpected: %s\nactual: %s\n", serviceName, "Not Found");
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationSizeNotEqualsException.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryServiceSizeNotEqualsException.java
similarity index 70%
rename from validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationSizeNotEqualsException.java
rename to validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryServiceSizeNotEqualsException.java
index b6e17ee..2d7fd25 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationSizeNotEqualsException.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryServiceSizeNotEqualsException.java
@@ -19,18 +19,19 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exceptio
import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException;
-public class RegistryApplicationSizeNotEqualsException extends AssertFailedException {
- private final String applicationCode;
+public class RegistryServiceSizeNotEqualsException extends AssertFailedException {
+ private final String serviceName;
private final ValueAssertFailedException cause;
- public RegistryApplicationSizeNotEqualsException(String applicationCode, ValueAssertFailedException cause) {
- this.applicationCode = applicationCode;
+ public RegistryServiceSizeNotEqualsException(String serviceName, ValueAssertFailedException cause) {
+ this.serviceName = serviceName;
this.cause = cause;
}
@Override
public String getCauseMessage() {
- return String.format("RegistryApplicationSizeNotEqualsException: %s\nexpected: %s\nactual: %s\n", applicationCode, cause
- .getExpected(), cause.getActual());
+ return String.format(
+ "RegistryServiceSizeNotEqualsException: %s\nexpected: %s\nactual: %s\n", serviceName, cause
+ .getExpected(), cause.getActual());
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentItemNotFoundException.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentItemNotFoundException.java
index 038fd41..7373943 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentItemNotFoundException.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentItemNotFoundException.java
@@ -20,14 +20,14 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exceptio
import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException;
public class SegmentItemNotFoundException extends AssertFailedException {
- private final String applicationCode;
+ private final String serviceName;
- public SegmentItemNotFoundException(String applicationCode) {
- this.applicationCode = applicationCode;
+ public SegmentItemNotFoundException(String serviceName) {
+ this.serviceName = serviceName;
}
@Override
public String getCauseMessage() {
- return String.format("SegmentItemNotFoundException\nexpected: %s\nactual: %s", applicationCode, "Not Found");
+ return String.format("SegmentItemNotFoundException\nexpected: %s\nactual: %s", serviceName, "Not Found");
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentNotFoundException.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentNotFoundException.java
index 28ba9db..9ba942f 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentNotFoundException.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentNotFoundException.java
@@ -36,7 +36,8 @@ public class SegmentNotFoundException extends AssertFailedException {
public String getCauseMessage() {
StringBuilder expectedMessage = new StringBuilder("\n Segment:\n");
for (Span span : expectedSegment.spans()) {
- expectedMessage.append(String.format(" - span[%s, %s] %s\n", span.parentSpanId(), span.spanId(), span.operationName()));
+ expectedMessage.append(
+ String.format(" - span[%s, %s] %s\n", span.parentSpanId(), span.spanId(), span.operationName()));
}
StringBuilder causeMessage = new StringBuilder();
@@ -45,10 +46,14 @@ public class SegmentNotFoundException extends AssertFailedException {
Span actualSpan = cause.getSpanAssertFailedCause().getActualSpan();
Span expectedSpan = cause.getSpanAssertFailedCause().getExceptedSpan();
- causeMessage.append(String.format("\n Segment[%s] e\n expected:\tSpan[%s, %s] %s\n " + "actual:" + "\tspan[%s, %s] %s\n reason:\t%s\n", actualSegment
- .segmentId(), expectedSpan.parentSpanId(), expectedSpan.spanId(), expectedSpan.operationName(), actualSpan
- .parentSpanId(), actualSpan.spanId(), actualSpan.operationName(), cause.getSpanAssertFailedCause()
- .getCauseMessage()));
+ causeMessage.append(String.format(
+ "\n Segment[%s] e\n expected:\tSpan[%s, %s] %s\n " + "actual:" + "\tspan[%s, %s] %s\n reason:\t%s\n",
+ actualSegment
+ .segmentId(), expectedSpan.parentSpanId(), expectedSpan.spanId(), expectedSpan.operationName(),
+ actualSpan
+ .parentSpanId(), actualSpan.spanId(), actualSpan.operationName(), cause.getSpanAssertFailedCause()
+ .getCauseMessage()
+ ));
}
return String.format("SegmentNotFoundException:\nexpected: %s\nactual: %s\n", expectedMessage, causeMessage);
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentSizeNotEqualsException.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentSizeNotEqualsException.java
index 6ec8e56..5a5e898 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentSizeNotEqualsException.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentSizeNotEqualsException.java
@@ -20,18 +20,19 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exceptio
import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException;
public class SegmentSizeNotEqualsException extends AssertFailedException {
- private final String applicationCode;
+ private final String serviceName;
private final String expected;
private final String actual;
- public SegmentSizeNotEqualsException(String applicationCode, String expected, String actual) {
- this.applicationCode = applicationCode;
+ public SegmentSizeNotEqualsException(String serviceName, String expected, String actual) {
+ this.serviceName = serviceName;
this.expected = expected;
this.actual = actual;
}
@Override
public String getCauseMessage() {
- return String.format("SegmentSizeNotEqualsException:\t%s\nexpected:\t%s\nactual:\t\t%s\n", applicationCode, expected, actual);
+ return String.format(
+ "SegmentSizeNotEqualsException:\t%s\nexpected:\t%s\nactual:\t\t%s\n", serviceName, expected, actual);
}
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryInstance.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryInstance.java
index 766fdf0..ab50500 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryInstance.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryInstance.java
@@ -19,23 +19,23 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.entity;
public interface RegistryInstance {
- String applicationCode();
+ String serviceName();
String expressValue();
class Impl implements RegistryInstance {
- private final String code;
+ private final String serviceName;
private final String express;
- Impl(String code, String express) {
- this.code = code;
+ Impl(String serviceName, String express) {
+ this.serviceName = serviceName;
this.express = express;
}
@Override
- public String applicationCode() {
- return code;
+ public String serviceName() {
+ return serviceName;
}
@Override
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItems.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItems.java
index 279f41a..8825ae3 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItems.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItems.java
@@ -20,7 +20,7 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.entity;
import java.util.List;
public interface RegistryItems {
- List<RegistryApplication> applications();
+ List<RegistryService> services();
List<RegistryInstance> instances();
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItemsForRead.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItemsForRead.java
index ccc906d..4afe2d6 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItemsForRead.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItemsForRead.java
@@ -22,16 +22,16 @@ import java.util.List;
import java.util.Map;
public class RegistryItemsForRead implements RegistryItems {
- private List<Map<String, String>> applications;
+ private List<Map<String, String>> services;
private List<Map<String, String>> instances;
private List<Map<String, List<String>>> operationNames;
- public List<Map<String, String>> getApplications() {
- return applications;
+ public List<Map<String, String>> getServices() {
+ return services;
}
- public void setApplications(List<Map<String, String>> applications) {
- this.applications = applications;
+ public void setServices(List<Map<String, String>> services) {
+ this.services = services;
}
public List<Map<String, String>> getInstances() {
@@ -51,18 +51,18 @@ public class RegistryItemsForRead implements RegistryItems {
}
@Override
- public List<RegistryApplication> applications() {
- if (this.applications == null) {
+ public List<RegistryService> services() {
+ if (this.services == null) {
return null;
}
- List<RegistryApplication> registryApplications = new ArrayList<>();
- for (Map<String, String> registryApplication : applications) {
- String applicationCode = new ArrayList<String>(registryApplication.keySet()).get(0);
- String express = String.valueOf(registryApplication.get(applicationCode));
- registryApplications.add(new RegistryApplication.Impl(applicationCode, express));
+ List<RegistryService> registryServices = new ArrayList<>();
+ for (Map<String, String> registryService : services) {
+ String serviceName = new ArrayList<String>(registryService.keySet()).get(0);
+ String express = String.valueOf(registryService.get(serviceName));
+ registryServices.add(new RegistryService.Impl(serviceName, express));
}
- return registryApplications;
+ return registryServices;
}
@Override
@@ -73,9 +73,9 @@ public class RegistryItemsForRead implements RegistryItems {
List<RegistryInstance> registryInstances = new ArrayList<>();
instances.forEach((registryInstance) -> {
- String applicationCode = new ArrayList<String>(registryInstance.keySet()).get(0);
- String express = String.valueOf(registryInstance.get(applicationCode));
- registryInstances.add(new RegistryInstance.Impl(applicationCode, express));
+ String serviceName = new ArrayList<String>(registryInstance.keySet()).get(0);
+ String express = String.valueOf(registryInstance.get(serviceName));
+ registryInstances.add(new RegistryInstance.Impl(serviceName, express));
});
return registryInstances;
}
@@ -88,9 +88,9 @@ public class RegistryItemsForRead implements RegistryItems {
List<RegistryOperationName> registryOperationNames = new ArrayList<>();
operationNames.forEach((registryInstance) -> {
- String applicationCode = new ArrayList<String>(registryInstance.keySet()).get(0);
- List<String> express = registryInstance.get(applicationCode);
- registryOperationNames.add(new RegistryOperationName.Impl(applicationCode, express));
+ String serviceName = new ArrayList<String>(registryInstance.keySet()).get(0);
+ List<String> express = registryInstance.get(serviceName);
+ registryOperationNames.add(new RegistryOperationName.Impl(serviceName, express));
});
return registryOperationNames;
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryOperationName.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryOperationName.java
index 3f09557..4914437 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryOperationName.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryOperationName.java
@@ -20,22 +20,22 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.entity;
import java.util.List;
public interface RegistryOperationName {
- String applicationCode();
+ String serviceName();
List<String> operationName();
class Impl implements RegistryOperationName {
- private final String code;
+ private final String serviceName;
private final List<String> express;
- Impl(String code, List<String> express) {
- this.code = code;
+ Impl(String serviceName, List<String> express) {
+ this.serviceName = serviceName;
this.express = express;
}
@Override
- public String applicationCode() {
- return code;
+ public String serviceName() {
+ return serviceName;
}
@Override
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryApplication.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryService.java
similarity index 77%
rename from validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryApplication.java
rename to validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryService.java
index 760fa70..1a59b57 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryApplication.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryService.java
@@ -17,23 +17,23 @@
package org.apache.skywalking.plugin.test.agent.tool.validator.entity;
-public interface RegistryApplication {
- String applicationCode();
+public interface RegistryService {
+ String serviceName();
String expressValue();
- class Impl implements RegistryApplication {
- private String applicationCode;
+ class Impl implements RegistryService {
+ private String serviceName;
private String express;
- Impl(String code, String express) {
- this.applicationCode = code;
+ Impl(String serviceName, String express) {
+ this.serviceName = serviceName;
this.express = express;
}
@Override
- public String applicationCode() {
- return applicationCode;
+ public String serviceName() {
+ return serviceName;
}
@Override
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentForRead.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentForRead.java
index 3fb7681..a4af081 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentForRead.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentForRead.java
@@ -65,7 +65,8 @@ public class SegmentForRead implements Segment {
this.entryEndpointId = ref.get("entryEndpointId") == null ? null : ref.get("entryEndpointId").toString();
this.parentEndpointId = ref.get("parentEndpointId") == null ? null : ref.get("parentEndpointId").toString();
this.networkAddressId = ref.get("networkAddressId") == null ? null : ref.get("networkAddressId").toString();
- this.parentServiceInstanceId = ref.get("parentServiceInstanceId") == null ? null : ref.get("parentServiceInstanceId")
+ this.parentServiceInstanceId = ref.get("parentServiceInstanceId") == null ? null : ref.get(
+ "parentServiceInstanceId")
.toString();
}
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItem.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItem.java
index 8a4a4b6..7b0bc67 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItem.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItem.java
@@ -20,7 +20,7 @@ package org.apache.skywalking.plugin.test.agent.tool.validator.entity;
import java.util.List;
public interface SegmentItem {
- String applicationCode();
+ String serviceName();
String segmentSize();
diff --git a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItemForRead.java b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItemForRead.java
index 5f1b4bf..4481f39 100644
--- a/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItemForRead.java
+++ b/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItemForRead.java
@@ -21,7 +21,7 @@ import java.util.ArrayList;
import java.util.List;
public class SegmentItemForRead implements SegmentItem {
- private String applicationCode;
+ private String serviceName;
private String segmentSize;
private List<SegmentForRead> segments;
@@ -33,12 +33,12 @@ public class SegmentItemForRead implements SegmentItem {
this.segments = segments;
}
- public String getApplicationCode() {
- return applicationCode;
+ public String getServiceName() {
+ return serviceName;
}
- public void setApplicationCode(String applicationCode) {
- this.applicationCode = applicationCode;
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
}
public String getSegmentSize() {
@@ -50,8 +50,8 @@ public class SegmentItemForRead implements SegmentItem {
}
@Override
- public String applicationCode() {
- return applicationCode;
+ public String serviceName() {
+ return serviceName;
}
@Override
@@ -69,7 +69,7 @@ public class SegmentItemForRead implements SegmentItem {
@Override
public String toString() {
- StringBuilder message = new StringBuilder(String.format("\nSegment Item[%s]", applicationCode));
+ StringBuilder message = new StringBuilder(String.format("\nSegment Item[%s]", serviceName));
message.append(String.format(" - segment size:\t\t%s\n", segmentSize));
return message.toString();
}
diff --git a/validator/src/test/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssertTest.java b/validator/src/test/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssertTest.java
index 3d730e6..028fd56 100644
--- a/validator/src/test/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssertTest.java
+++ b/validator/src/test/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssertTest.java
@@ -30,7 +30,10 @@ public class DataAssertTest {
File actualData = new File(DataAssertTest.class.getResource("/actualData.yaml").getFile());
File expectedData = new File(DataAssertTest.class.getResource("/expectedData.yaml").getFile());
- DataAssert.assertEquals(Data.Loader.loadData("expectedData.yaml", expectedData), Data.Loader.loadData("actualData.yaml", actualData));
+ DataAssert.assertEquals(
+ Data.Loader.loadData("expectedData.yaml", expectedData),
+ Data.Loader.loadData("actualData.yaml", actualData)
+ );
} catch (AssertFailedException e) {
System.out.println(String.format("\nassert failed.\n%s\n", e.getCauseMessage()));
diff --git a/validator/src/test/resources/actualData.yaml b/validator/src/test/resources/actualData.yaml
index 7eaa18e..76d6c8b 100644
--- a/validator/src/test/resources/actualData.yaml
+++ b/validator/src/test/resources/actualData.yaml
@@ -14,7 +14,7 @@
# limitations under the License.
{
"registryItems": {
- "applications": [
+ "services": [
{
"vertx-core-3.x-scenario": 2
}
@@ -36,7 +36,7 @@
},
"segmentItems": [
{
- "applicationCode": "vertx-core-3.x-scenario",
+ "serviceName": "vertx-core-3.x-scenario",
"segmentSize": "8",
"segments": [
{
diff --git a/validator/src/test/resources/expectedData.yaml b/validator/src/test/resources/expectedData.yaml
index f3bdefd..a24a846 100644
--- a/validator/src/test/resources/expectedData.yaml
+++ b/validator/src/test/resources/expectedData.yaml
@@ -14,7 +14,7 @@
# limitations under the License.
{
"registryItems": {
- "applications": [
+ "services": [
{
"vertx-core-3.x-scenario": 2
}
@@ -36,7 +36,7 @@
},
"segmentItems": [
{
- "applicationCode": "vertx-core-3.x-scenario",
+ "serviceName": "vertx-core-3.x-scenario",
"segmentSize": "8",
"segments": [
{