From da44d28547561634bebe21a202abcfdbc1cf4b21 Mon Sep 17 00:00:00 2001 From: Daming Date: Sun, 8 Mar 2020 09:15:41 +0800 Subject: [PATCH] Introduce Agent-Test-Tool suite (#4458) * Introduce Agent-Test-Tool suite * rename term --- .gitignore | 2 +- docs/en/guides/Plugin-test.md | 12 +- .../bin/fetch-code.sh} | 27 +- test/plugin/agent-test-tools/pom.xml | 73 +++ .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../jvm-container/docker/Dockerfile | 2 +- test/plugin/containers/jvm-container/pom.xml | 3 +- test/plugin/containers/pom.xml | 10 +- .../tomcat-container/docker/Dockerfile | 2 +- .../containers/tomcat-container/pom.xml | 4 +- test/plugin/mock-collector/pom.xml | 176 -------- .../src/main/assembly/assembly.xml | 57 --- .../plugin/test/mockcollector/Main.java | 80 ---- .../mockcollector/entity/RegistryItem.java | 153 ------- .../entity/RegistryItemSerializer.java | 65 --- .../test/mockcollector/entity/Segment.java | 52 --- .../mockcollector/entity/SegmentItem.java | 43 -- .../mockcollector/entity/SegmentItems.java | 44 -- .../entity/SegmentItemsSerializer.java | 47 -- .../test/mockcollector/entity/Span.java | 193 -------- .../mockcollector/entity/ValidateData.java | 43 -- .../entity/ValidateDataSerializer.java | 40 -- .../service/ClearReceiveDataService.java | 47 -- .../service/GrpcAddressHttpService.java | 51 --- .../service/MockCLRMetricReportService.java | 35 -- .../service/MockInstanceDiscoveryService.java | 52 --- .../service/MockInstancePingService.java | 36 -- .../service/MockJVMMetricReportService.java | 35 -- .../MockNetworkAddressRegisterService.java | 33 -- .../service/MockRegisterService.java | 119 ----- .../service/MockTraceSegmentService.java | 102 ----- .../service/ReceiveDataService.java | 53 --- .../test/mockcollector/service/Sequences.java | 30 -- .../test/mockcollector/util/ConfigReader.java | 44 -- .../mock-collector/src/main/proto/README.md | 5 - .../src/main/proto/common/CLR.proto | 46 -- .../src/main/proto/common/JVM.proto | 69 --- .../src/main/proto/common/common.proto | 55 --- .../src/main/proto/common/trace-common.proto | 52 --- .../proto/language-agent-v2/CLRMetric.proto | 36 -- .../proto/language-agent-v2/JVMMetric.proto | 36 -- .../main/proto/language-agent-v2/trace.proto | 77 ---- .../ApplicationRegisterService.proto | 39 -- .../language-agent/DiscoveryService.proto | 91 ---- .../proto/language-agent/Downstream.proto | 27 -- .../language-agent/JVMMetricsService.proto | 36 -- .../language-agent/KeyWithIntegerValue.proto | 28 -- .../language-agent/KeyWithStringValue.proto | 28 -- .../NetworkAddressRegisterService.proto | 38 -- .../language-agent/TraceSegmentService.proto | 78 ---- .../main/proto/register/InstancePing.proto | 36 -- .../src/main/proto/register/Register.proto | 124 ------ .../istio/skywalking.config.pb.html | 39 -- .../service-mesh-probe/service-mesh.proto | 56 --- .../src/main/resources/config.properties | 16 - .../src/main/resources/expect-data.yaml | 78 ---- .../src/main/resources/log4j2.xml | 30 -- .../src/main/resources/sample-data.yaml | 68 --- test/plugin/pom.xml | 3 +- test/plugin/runner-helper/pom.xml | 2 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../avro-scenario/config/expectedData.yaml | 6 +- .../canal-scenario/config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../feign-scenario/config/expectedData.yaml | 4 +- .../gateway-scenario/config/expectedData.yaml | 6 +- .../grpc-scenario/config/expectedData.yaml | 4 +- .../gson-scenario/config/expectedData.yaml | 4 +- .../h2-scenario/config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../hystrix-scenario/config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../jedis-scenario/config/expectedData.yaml | 4 +- .../jetty-scenario/config/expectedData.yaml | 6 +- .../kafka-scenario/config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../lettuce-scenario/config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../mysql-scenario/config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../okhttp-scenario/config/expectedData.yaml | 4 +- .../oracle-scenario/config/expectedData.yaml | 4 +- .../play-scenario/config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../pulsar-scenario/config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../sofarpc-scenario/config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../webflux-scenario/config/expectedData.yaml | 6 +- .../config/expectedData.yaml | 4 +- test/plugin/validator/README.md | 36 -- ...tualRegistryOperationNameEmptyException.md | 12 - .../ActualSegmentItemEmptyException.md | 15 - .../exception/IllegalDataFileException.md | 11 - .../ParentSegmentNotFoundException.md | 24 - .../RegistryApplicationNotFoundException.md | 27 -- ...gistryApplicationSizeNotEqualsException.md | 13 - ...yInstanceOfApplicationNotFoundException.md | 25 -- .../RegistryInstanceSizeNotEqualsException.md | 13 - .../RegistryInstancesNotEqualsException.md | 12 - .../RegistryOperationNameNotFoundException.md | 13 - ...RegistryOperationNamesNotFoundException.md | 13 - ...tionNamesOfApplicationNotFoundException.md | 12 - .../exception/SegmentItemNotFoundException.md | 15 - .../exception/SegmentNotFoundException.md | 31 -- .../exception/SegmentRefNotFoundException.md | 30 -- .../SegmentRefSizeNotEqualsException.md | 34 -- .../SegmentSizeNotEqualsException.md | 12 - test/plugin/validator/pom.xml | 81 ---- .../plugin/test/agent/tool/ConfigHelper.java | 32 -- .../plugin/test/agent/tool/Main.java | 63 --- .../validator/assertor/ApplicationAssert.java | 53 --- .../tool/validator/assertor/DataAssert.java | 35 -- .../validator/assertor/ExpressParser.java | 63 --- .../validator/assertor/InstanceAssert.java | 53 --- .../assertor/OperationNameAssert.java | 62 --- .../ParentSegmentIdExpressParser.java | 47 -- .../assertor/RegistryItemsAssert.java | 35 -- .../validator/assertor/SegmentAssert.java | 224 ---------- .../assertor/SegmentItemsAssert.java | 102 ----- .../SegmentPredictionFailedCause.java | 39 -- .../validator/assertor/SegmentRefAssert.java | 83 ---- .../assertor/SegmentRefAssertFailedCause.java | 39 -- .../assertor/element/ElementAssertor.java | 31 -- .../assertor/element/EqualsAssertor.java | 34 -- .../assertor/element/GreatThanAssertor.java | 34 -- .../assertor/element/GreetEqualAssertor.java | 34 -- .../assertor/element/NoopAssertor.java | 29 -- .../assertor/element/NotEqualsAssertor.java | 34 -- .../assertor/element/NotNullAssertor.java | 33 -- .../assertor/element/NullAssertor.java | 33 -- ...alRegistryOperationNameEmptyException.java | 36 -- .../ActualSegmentItemEmptyException.java | 35 -- .../ActualSegmentRefIsEmptyException.java | 33 -- .../exception/KeyValueNotEqualsException.java | 21 - .../LogEventKeyNotEqualsException.java | 35 -- .../LogEventSizeNotEqualsException.java | 35 -- .../LogEventValueNotEqualsException.java | 37 -- .../exception/LogSizeNotEqualsException.java | 35 -- .../ParentSegmentNotFoundException.java | 34 -- .../exception/RefSizeNotEqualsException.java | 36 -- .../RegistryApplicationNotFoundException.java | 33 -- ...stryApplicationSizeNotEqualsException.java | 36 -- ...nstanceOfApplicationNotFoundException.java | 34 -- ...egistryInstanceSizeNotEqualsException.java | 37 -- ...egistryOperationNameNotFoundException.java | 35 -- ...onNamesOfApplicationNotFoundException.java | 35 -- .../SegmentItemNotFoundException.java | 33 -- .../exception/SegmentNotFoundException.java | 56 --- .../SegmentRefAssertFailedException.java | 38 -- .../SegmentRefNotFoundException.java | 56 --- .../SegmentRefSizeNotEqualsException.java | 35 -- .../SegmentSizeNotEqualsException.java | 37 -- .../exception/SpanAssertFailedException.java | 46 -- .../exception/SpanSizeNotEqualsException.java | 36 -- .../exception/TagKeyNotEqualsException.java | 35 -- .../exception/TagSizeNotEqualsException.java | 35 -- .../exception/TagValueNotEqualsException.java | 37 -- .../exception/ValueAssertFailedException.java | 49 -- .../agent/tool/validator/entity/Data.java | 60 --- .../tool/validator/entity/DataForRead.java | 57 --- .../tool/validator/entity/KeyValuePair.java | 44 -- .../agent/tool/validator/entity/LogEvent.java | 42 -- .../validator/entity/RegistryApplication.java | 44 -- .../validator/entity/RegistryInstance.java | 46 -- .../tool/validator/entity/RegistryItems.java | 28 -- .../entity/RegistryItemsForRead.java | 97 ---- .../entity/RegistryOperationName.java | 46 -- .../agent/tool/validator/entity/Segment.java | 28 -- .../tool/validator/entity/SegmentForRead.java | 420 ------------------ .../tool/validator/entity/SegmentItem.java | 28 -- .../validator/entity/SegmentItemForRead.java | 76 ---- .../tool/validator/entity/SegmentRef.java | 45 -- .../agent/tool/validator/entity/Span.java | 58 --- .../exception/AssertFailedException.java | 29 -- .../exception/IllegalDataFileException.java | 31 -- .../validator/src/main/resources/log4j2.xml | 37 -- .../validator/assertor/DataAssertTest.java | 40 -- .../src/test/resources/actualData.yaml | 295 ------------ .../src/test/resources/expectedData.yaml | 292 ------------ 210 files changed, 235 insertions(+), 7479 deletions(-) rename test/plugin/{mock-collector/bin/collector-startup.sh => agent-test-tools/bin/fetch-code.sh} (60%) create mode 100644 test/plugin/agent-test-tools/pom.xml delete mode 100644 test/plugin/mock-collector/pom.xml delete mode 100644 test/plugin/mock-collector/src/main/assembly/assembly.xml delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/Main.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItem.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItemSerializer.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Segment.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItem.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItems.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItemsSerializer.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Span.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/ValidateData.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/ValidateDataSerializer.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ClearReceiveDataService.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/GrpcAddressHttpService.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockCLRMetricReportService.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockInstanceDiscoveryService.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockInstancePingService.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockJVMMetricReportService.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockNetworkAddressRegisterService.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockRegisterService.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockTraceSegmentService.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ReceiveDataService.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/Sequences.java delete mode 100644 test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/util/ConfigReader.java delete mode 100644 test/plugin/mock-collector/src/main/proto/README.md delete mode 100644 test/plugin/mock-collector/src/main/proto/common/CLR.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/common/JVM.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/common/common.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/common/trace-common.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent-v2/CLRMetric.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent-v2/JVMMetric.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent-v2/trace.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent/ApplicationRegisterService.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent/DiscoveryService.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent/Downstream.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent/JVMMetricsService.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent/KeyWithIntegerValue.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent/KeyWithStringValue.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent/NetworkAddressRegisterService.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/language-agent/TraceSegmentService.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/register/InstancePing.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/register/Register.proto delete mode 100644 test/plugin/mock-collector/src/main/proto/service-mesh-probe/istio/skywalking.config.pb.html delete mode 100644 test/plugin/mock-collector/src/main/proto/service-mesh-probe/service-mesh.proto delete mode 100644 test/plugin/mock-collector/src/main/resources/config.properties delete mode 100644 test/plugin/mock-collector/src/main/resources/expect-data.yaml delete mode 100644 test/plugin/mock-collector/src/main/resources/log4j2.xml delete mode 100644 test/plugin/mock-collector/src/main/resources/sample-data.yaml delete mode 100644 test/plugin/validator/README.md delete mode 100644 test/plugin/validator/docs/exception/ActualRegistryOperationNameEmptyException.md delete mode 100644 test/plugin/validator/docs/exception/ActualSegmentItemEmptyException.md delete mode 100644 test/plugin/validator/docs/exception/IllegalDataFileException.md delete mode 100644 test/plugin/validator/docs/exception/ParentSegmentNotFoundException.md delete mode 100644 test/plugin/validator/docs/exception/RegistryApplicationNotFoundException.md delete mode 100644 test/plugin/validator/docs/exception/RegistryApplicationSizeNotEqualsException.md delete mode 100644 test/plugin/validator/docs/exception/RegistryInstanceOfApplicationNotFoundException.md delete mode 100644 test/plugin/validator/docs/exception/RegistryInstanceSizeNotEqualsException.md delete mode 100644 test/plugin/validator/docs/exception/RegistryInstancesNotEqualsException.md delete mode 100644 test/plugin/validator/docs/exception/RegistryOperationNameNotFoundException.md delete mode 100644 test/plugin/validator/docs/exception/RegistryOperationNamesNotFoundException.md delete mode 100644 test/plugin/validator/docs/exception/RegistryOperationNamesOfApplicationNotFoundException.md delete mode 100644 test/plugin/validator/docs/exception/SegmentItemNotFoundException.md delete mode 100644 test/plugin/validator/docs/exception/SegmentNotFoundException.md delete mode 100644 test/plugin/validator/docs/exception/SegmentRefNotFoundException.md delete mode 100644 test/plugin/validator/docs/exception/SegmentRefSizeNotEqualsException.md delete mode 100644 test/plugin/validator/docs/exception/SegmentSizeNotEqualsException.md delete mode 100644 test/plugin/validator/pom.xml delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/ConfigHelper.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/Main.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ApplicationAssert.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssert.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ExpressParser.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/InstanceAssert.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/OperationNameAssert.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ParentSegmentIdExpressParser.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/RegistryItemsAssert.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentAssert.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentItemsAssert.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentPredictionFailedCause.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssert.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssertFailedCause.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/ElementAssertor.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/EqualsAssertor.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/GreatThanAssertor.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/GreetEqualAssertor.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NoopAssertor.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NotEqualsAssertor.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NotNullAssertor.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NullAssertor.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualRegistryOperationNameEmptyException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualSegmentItemEmptyException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualSegmentRefIsEmptyException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/KeyValueNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventKeyNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventSizeNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventValueNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogSizeNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ParentSegmentNotFoundException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RefSizeNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationNotFoundException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationSizeNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceOfApplicationNotFoundException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceSizeNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNameNotFoundException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNamesOfApplicationNotFoundException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentItemNotFoundException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentNotFoundException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefAssertFailedException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefNotFoundException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefSizeNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentSizeNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SpanAssertFailedException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SpanSizeNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagKeyNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagSizeNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagValueNotEqualsException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ValueAssertFailedException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Data.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/DataForRead.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/KeyValuePair.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/LogEvent.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryApplication.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryInstance.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItems.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItemsForRead.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryOperationName.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Segment.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentForRead.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItem.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItemForRead.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentRef.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/exception/AssertFailedException.java delete mode 100644 test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/exception/IllegalDataFileException.java delete mode 100644 test/plugin/validator/src/main/resources/log4j2.xml delete mode 100644 test/plugin/validator/src/test/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssertTest.java delete mode 100644 test/plugin/validator/src/test/resources/actualData.yaml delete mode 100644 test/plugin/validator/src/test/resources/expectedData.yaml diff --git a/.gitignore b/.gitignore index a5bd42a68..75936590b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ target/ packages/ **/dependency-reduced-pom.xml /skywalking-agent/ -/dist/ +**/dist/ /docker/snapshot/*.gz .mvn/wrapper/*.jar OALLexer.tokens diff --git a/docs/en/guides/Plugin-test.md b/docs/en/guides/Plugin-test.md index 8b7d538fd..c0d6b5a12 100644 --- a/docs/en/guides/Plugin-test.md +++ b/docs/en/guides/Plugin-test.md @@ -214,7 +214,7 @@ as the version number, it will be changed in the test for every version. **Register verify description format** ```yml registryItems: - applications: + services: - APPLICATION_CODE: APPLICATION_ID(int) ... instances: @@ -228,7 +228,7 @@ registryItems: | Field | Description | --- | --- -| applications | The registered service codes. Normally, not 0 should be enough. +| services | The registered service codes. Normally, not 0 should be enough. | instances | The number of service instances exists in this test case. | operationNames | All endpoint registered in this test case. Also means, the operation names of all entry spans. @@ -237,7 +237,7 @@ registryItems: ```yml segments: - - applicationCode: APPLICATION_CODE(string) + serviceName: APPLICATION_CODE(string) segmentSize: SEGMENT_SIZE(int) segments: - segmentId: SEGMENT_ID(string) @@ -248,7 +248,7 @@ segments: | Field | Description | --- | --- -| applicationCode | Service code. +| serviceName | Service code. | segmentSize | The number of segments is expected. | segmentId | trace ID. | spans | segment span list. Follow the next section to see how to describe every span. @@ -446,7 +446,7 @@ HttpClient test case is running in Tomcat container, only one instance exists, s ```yml registryItems: - applications: + services: - {httpclient-case: nq 0} instances: - {httpclient-case: 1} @@ -462,7 +462,7 @@ By following the flow of HttpClient case, there should be two segments created. ```yml segments: - - applicationCode: httpclient-case + - serviceName: httpclient-case segmentSize: ge 2 # Could have more than one health check segments, because, the dependency is not standby. ``` diff --git a/test/plugin/mock-collector/bin/collector-startup.sh b/test/plugin/agent-test-tools/bin/fetch-code.sh similarity index 60% rename from test/plugin/mock-collector/bin/collector-startup.sh rename to test/plugin/agent-test-tools/bin/fetch-code.sh index 419e34597..5189a4558 100644 --- a/test/plugin/mock-collector/bin/collector-startup.sh +++ b/test/plugin/agent-test-tools/bin/fetch-code.sh @@ -16,20 +16,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -PRG="$0" -PRGDIR=`dirname "$PRG"` -[ -z "$COLLECTOR_HOME" ] && COLLECTOR_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` +WORK_DIRECTORY=$1 +RESPOSITORY=$2 +COMMIT_ID=$3 +DIST_DIRECTORY=$4 -_RUNJAVA=${JAVA_HOME}/bin/java -[ -z "$JAVA_HOME" ] && _RUNJAVA=`java` +HOME_DIR="$(cd "$(dirname $0)"; pwd)" -CLASSPATH="$COLLECTOR_HOME/config:$CLASSPATH" -for i in "$COLLECTOR_HOME"/libs/*.jar -do - CLASSPATH="$i:$CLASSPATH" -done +git clone $RESPOSITORY $WORK_DIRECTORY -JAVA_OPTS="${JAVA_OPTS} -Xmx256m -Xms256m" -JAVA_OPTS="${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 " +cd $WORK_DIRECTORY -$_RUNJAVA ${JAVA_OPTS} -classpath $CLASSPATH org.apache.skywalking.plugin.test.mockcollector.Main +git checkout $COMMIT_ID + +mvn -B package -DskipTests + +[[ -d $DIST_DIRECTORY ]] || mkdir -p $DIST_DIRECTORY + +cp $WORK_DIRECTORY/dist/* $DIST_DIRECTORY/ \ No newline at end of file diff --git a/test/plugin/agent-test-tools/pom.xml b/test/plugin/agent-test-tools/pom.xml new file mode 100644 index 000000000..024dac62f --- /dev/null +++ b/test/plugin/agent-test-tools/pom.xml @@ -0,0 +1,73 @@ + + + + + + 4.0.0 + + + org.apache.skywalking.plugin + apache-skywalking-test-plugin + 1.0.0 + + + agent-test-tools + + SkyWalking Agent Test Tools + pom + + + d3acf65652b136b0ba0c23ce38168dd4a9830927 + ${project.basedir}/target/agent-test-tools + https://github.com/apache/skywalking-agent-test-tool.git + + + + skywalking-mock-collector + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + initialize + + exec + + + + + bash + + ${project.basedir}/bin/fetch-code.sh + ${agent-test-tools.workingDirectory} + ${agent-test-tools.repos} + ${agent-test-tools.version} + ${project.basedir}/dist + + + + + + + + \ No newline at end of file diff --git a/test/plugin/archetypes/jvm/src/main/resources/archetype-resources/config/expectedData.yaml b/test/plugin/archetypes/jvm/src/main/resources/archetype-resources/config/expectedData.yaml index 84a375ec5..56e815444 100644 --- a/test/plugin/archetypes/jvm/src/main/resources/archetype-resources/config/expectedData.yaml +++ b/test/plugin/archetypes/jvm/src/main/resources/archetype-resources/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {${scenario_name}: 2} instances: - {${scenario_name}: 1} @@ -22,6 +22,6 @@ registryItems: - ${scenario_name}: [] heartbeat: [] segmentItems: - - applicationCode: ${scenario_name} + - serviceName: ${scenario_name} segmentSize: segments: diff --git a/test/plugin/archetypes/tomcat/src/main/resources/archetype-resources/config/expectedData.yaml b/test/plugin/archetypes/tomcat/src/main/resources/archetype-resources/config/expectedData.yaml index 84a375ec5..56e815444 100644 --- a/test/plugin/archetypes/tomcat/src/main/resources/archetype-resources/config/expectedData.yaml +++ b/test/plugin/archetypes/tomcat/src/main/resources/archetype-resources/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {${scenario_name}: 2} instances: - {${scenario_name}: 1} @@ -22,6 +22,6 @@ registryItems: - ${scenario_name}: [] heartbeat: [] segmentItems: - - applicationCode: ${scenario_name} + - serviceName: ${scenario_name} segmentSize: segments: diff --git a/test/plugin/containers/jvm-container/docker/Dockerfile b/test/plugin/containers/jvm-container/docker/Dockerfile index 175eb53ef..5b6c28b53 100644 --- a/test/plugin/containers/jvm-container/docker/Dockerfile +++ b/test/plugin/containers/jvm-container/docker/Dockerfile @@ -22,7 +22,7 @@ WORKDIR /usr/local/skywalking/tools COPY run.sh / RUN chmod +x /run.sh -COPY skywalking-validator-tools.jar /usr/local/skywalking/tools +COPY validator.jar /usr/local/skywalking/tools/skywalking-validator-tools.jar COPY skywalking-mock-collector.tar.gz /usr/local/skywalking/tools RUN tar -xvf skywalking-mock-collector.tar.gz -C /usr/local/skywalking/tools diff --git a/test/plugin/containers/jvm-container/pom.xml b/test/plugin/containers/jvm-container/pom.xml index 511195585..754a70d0c 100644 --- a/test/plugin/containers/jvm-container/pom.xml +++ b/test/plugin/containers/jvm-container/pom.xml @@ -30,9 +30,10 @@ jvm-container - agent-test-jvm + name>SkyWalking JVM Runner Image false + skywalking/agent-test-jvm diff --git a/test/plugin/containers/pom.xml b/test/plugin/containers/pom.xml index f6f876db4..fd1e4daf1 100644 --- a/test/plugin/containers/pom.xml +++ b/test/plugin/containers/pom.xml @@ -30,6 +30,8 @@ containers + SkyWalking Plugin Test Runner Images + tomcat-container jvm-container @@ -37,6 +39,7 @@ true + skywalking/${project.name} @@ -46,15 +49,16 @@ docker-maven-plugin ${docker-maven-plugin.version} - skywalking/${project.name}:${BUILD_NO} + + ${docker.image.name}:${BUILD_NO} ${project.basedir}/docker ${skip.docker} / - ${project.basedir}/../../dist + ${project.basedir}/../../agent-test-tools/dist skywalking-mock-collector.tar.gz - skywalking-validator-tools.jar + validator.jar diff --git a/test/plugin/containers/tomcat-container/docker/Dockerfile b/test/plugin/containers/tomcat-container/docker/Dockerfile index ee2ed2de9..fd69110ec 100644 --- a/test/plugin/containers/tomcat-container/docker/Dockerfile +++ b/test/plugin/containers/tomcat-container/docker/Dockerfile @@ -23,7 +23,7 @@ ENV CATALINA_OPTS "" COPY run.sh / COPY catalina.sh /usr/local/tomcat/bin/ -COPY skywalking-validator-tools.jar /usr/local/skywalking/tools +COPY validator.jar /usr/local/skywalking/tools/skywalking-validator-tools.jar COPY skywalking-mock-collector.tar.gz /usr/local/skywalking/tools RUN tar -xvf skywalking-mock-collector.tar.gz -C /usr/local/skywalking/tools diff --git a/test/plugin/containers/tomcat-container/pom.xml b/test/plugin/containers/tomcat-container/pom.xml index d150cb989..9061f5538 100644 --- a/test/plugin/containers/tomcat-container/pom.xml +++ b/test/plugin/containers/tomcat-container/pom.xml @@ -30,11 +30,11 @@ tomcat-container - agent-test-tomcat + name>SkyWalking Tomcat Runner Image false + skywalking/agent-test-tomcat - diff --git a/test/plugin/mock-collector/pom.xml b/test/plugin/mock-collector/pom.xml deleted file mode 100644 index d3df6140a..000000000 --- a/test/plugin/mock-collector/pom.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - - - 4.0.0 - - - org.apache.skywalking.plugin - apache-skywalking-test-plugin - 1.0.0 - - - skywalking-mock-collector - 6.0.0-2018 - jar - - skywalking-mock-collector - http://maven.apache.org - - - UTF-8 - 1.4.0 - 4.1.12.Final - 9.4.2.v20170220 - 2.8.0 - 1.18 - skywalking/mock-collector - ${project.version} - - - - - io.grpc - grpc-netty - ${grpc.version} - - - io.netty - netty-codec-http2 - - - io.netty - netty-handler-proxy - - - - - io.grpc - grpc-protobuf - ${grpc.version} - - - io.grpc - grpc-stub - ${grpc.version} - - - io.netty - netty-codec-http2 - ${netty.version} - - - org.eclipse.jetty - jetty-server - ${jetty.version} - - - org.eclipse.jetty - jetty-servlet - ${jetty.version} - - - com.google.code.gson - gson - ${gson.version} - - - - - skywalking-mock-collector - - - kr.motd.maven - os-maven-plugin - 1.4.1.Final - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.4.3 - - ${project.build.sourceEncoding} - - - - org.xolstice.maven.plugins - protobuf-maven-plugin - 0.5.0 - - com.google.protobuf:protoc:3.3.0:exe:${os.detected.classifier} - - grpc-java - io.grpc:protoc-gen-grpc-java:1.4.0:exe:${os.detected.classifier} - - - - - - compile - compile-custom - - - - - - org.codehaus.mojo - versions-maven-plugin - 2.7 - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-assembly-plugin - - - assembly - package - - single - - - - src/main/assembly/assembly.xml - - ${project.basedir}/../dist - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.3.2 - - - *.properties - *.yaml - *.xml - - - - - - diff --git a/test/plugin/mock-collector/src/main/assembly/assembly.xml b/test/plugin/mock-collector/src/main/assembly/assembly.xml deleted file mode 100644 index 2ba07c126..000000000 --- a/test/plugin/mock-collector/src/main/assembly/assembly.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - tar.gz - - - - /libs - runtime - - - - - ${project.basedir}/bin - /bin - - *.sh - - 0755 - - - src/main/resources - - collector.properties - log4j2.xml - - /config - - - ${project.build.directory} - /libs - - ${build.finalName}.jar - - - - diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/Main.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/Main.java deleted file mode 100644 index dead94497..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/Main.java +++ /dev/null @@ -1,80 +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; - -import io.grpc.netty.NettyServerBuilder; -import io.netty.channel.local.LocalAddress; -import java.io.IOException; -import java.net.InetSocketAddress; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -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; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.servlet.ServletHolder; - -public class Main { - public static void main(String[] args) throws Exception { - NettyServerBuilder.forAddress(LocalAddress.ANY) - .forPort(19876) - .maxConcurrentCallsPerConnection(12) - .maxMessageSize(16777216) - .addService(new MockRegisterService()) - .addService(new MockInstancePingService()) - .addService(new MockInstanceDiscoveryService()) - .addService(new MockNetworkAddressRegisterService()) - .addService(new MockTraceSegmentService()) - .addService(new MockJVMMetricReportService()) - .build() - .start(); - - Server jettyServer = new Server(new InetSocketAddress("0.0.0.0", Integer.valueOf(12800))); - String contextPath = "/"; - ServletContextHandler servletContextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS); - servletContextHandler.setContextPath(contextPath); - servletContextHandler.addServlet(new ServletHolder(new HttpServlet() { - @Override - protected void doGet(HttpServletRequest req, - HttpServletResponse resp) throws ServletException, IOException { - if (ValidateData.INSTANCE.getRegistryItem().getApplications().isEmpty()) { - resp.setStatus(500); - return; - } - resp.setStatus(200); - resp.getWriter().write("Success"); - resp.getWriter().flush(); - } - }), "/status"); - servletContextHandler.addServlet(GrpcAddressHttpService.class, GrpcAddressHttpService.SERVLET_PATH); - servletContextHandler.addServlet(ReceiveDataService.class, ReceiveDataService.SERVLET_PATH); - servletContextHandler.addServlet(ClearReceiveDataService.class, ClearReceiveDataService.SERVLET_PATH); - jettyServer.setHandler(servletContextHandler); - jettyServer.start(); - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItem.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItem.java deleted file mode 100644 index 668c00cc7..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItem.java +++ /dev/null @@ -1,153 +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.entity; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -public class RegistryItem { - /** - * applicationCode, applicationId - */ - private final Map applications; - /** - * applicationCode, operationName - */ - private final Map> operationNames; - /** - * applicationCode, instanceId - */ - private final Map> instanceMapping; - /** - * applicationCode, count - */ - private final Map heartBeats; - - public RegistryItem() { - applications = new ConcurrentHashMap<>(); - operationNames = new ConcurrentHashMap<>(); - instanceMapping = new ConcurrentHashMap<>(); - heartBeats = new ConcurrentHashMap<>(); - } - - public void registryApplication(Application application) { - applications.putIfAbsent(application.applicationCode, application.applicationId); - } - - public void registryOperationName(OperationName operationName) { - String applicationCode = findApplicationCode(operationName.applicationId); - Set operationNameList = operationNames.get(applicationCode); - if (operationNameList == null) { - operationNameList = new HashSet<>(); - operationNames.put(applicationCode, operationNameList); - } - operationNameList.add(operationName.operationName); - } - - public void registryInstance(Instance instance) { - String applicationCode = findApplicationCode(instance.applicationId); - List instances = instanceMapping.get(applicationCode); - if (instances == null) { - instances = new ArrayList<>(); - instanceMapping.put(applicationCode, instances); - } - - if (!instances.contains(instance)) { - instances.add(instance.instanceId); - } - } - - public String findApplicationCode(int id) { - for (Map.Entry entry : applications.entrySet()) { - if (entry.getValue() == id) { - return entry.getKey(); - } - } - throw new RuntimeException("Cannot found the code of applicationID[" + id + "]."); - } - - public void registryHeartBeat(HeartBeat heartBeat) { - for (Map.Entry> entry : instanceMapping.entrySet()) { - if (entry.getValue().contains(heartBeat.instanceID)) { - Integer count = heartBeats.get(entry.getKey()); - if (count != null) { - heartBeats.put(entry.getKey(), 0); - heartBeats.put(entry.getKey(), count++); - } - } - } - } - - public static class OperationName { - int applicationId; - String operationName; - - public OperationName(int applicationId, String operationName) { - this.applicationId = applicationId; - this.operationName = operationName; - } - } - - public static class Application { - String applicationCode; - int applicationId; - - public Application(String applicationCode, int applicationId) { - this.applicationCode = applicationCode; - this.applicationId = applicationId; - } - } - - public static class Instance { - int applicationId; - int instanceId; - - public Instance(int applicationId, int instanceId) { - this.applicationId = applicationId; - this.instanceId = instanceId; - } - } - - public static class HeartBeat { - private int instanceID; - - public HeartBeat(int instanceID) { - this.instanceID = instanceID; - } - } - - public Map getApplications() { - return applications; - } - - public Map> getOperationNames() { - return operationNames; - } - - public Map> getInstanceMapping() { - return instanceMapping; - } - - public Map getHeartBeats() { - return heartBeats; - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItemSerializer.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItemSerializer.java deleted file mode 100644 index f022bbf60..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/RegistryItemSerializer.java +++ /dev/null @@ -1,65 +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.entity; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import java.lang.reflect.Type; - -public class RegistryItemSerializer implements JsonSerializer { - @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); - }); - jsonObject.add("applications", applicationArrays); - - JsonArray instanceArrays = new JsonArray(); - src.getInstanceMapping().forEach((applicationCode, instanceIds) -> { - JsonObject instanceJson = new JsonObject(); - instanceJson.addProperty(applicationCode, instanceIds.size()); - instanceArrays.add(instanceJson); - }); - jsonObject.add("instances", instanceArrays); - - JsonArray operationNameArrays = new JsonArray(); - src.getOperationNames().forEach((applicationCode, operationNames) -> { - JsonObject instanceJson = new JsonObject(); - instanceJson.add(applicationCode, new Gson().toJsonTree(operationNames)); - operationNameArrays.add(instanceJson); - }); - jsonObject.add("operationNames", operationNameArrays); - - JsonArray heartBeatArrays = new JsonArray(); - src.getHeartBeats().forEach((applicationCode, count) -> { - JsonObject instanceJson = new JsonObject(); - instanceJson.addProperty(applicationCode, count); - heartBeatArrays.add(instanceJson); - }); - jsonObject.add("heartbeat", heartBeatArrays); - return jsonObject; - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Segment.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Segment.java deleted file mode 100644 index 407f01e32..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Segment.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.entity; - -import java.util.ArrayList; -import java.util.List; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.ToString; -import org.apache.skywalking.apm.network.language.agent.UniqueId; - -@ToString -@Builder -@AllArgsConstructor -public class Segment { - private String segmentId; - private List spans; - - public static class SegmentBuilder { - - public SegmentBuilder addSpan(Span.SpanBuilder spanBuilder) { - if (spans == null) { - this.spans = new ArrayList<>(); - } - - spans.add(spanBuilder.build()); - return this; - } - - public SegmentBuilder segmentId(UniqueId segmentUniqueId) { - segmentId = String.join(".", Long.toString(segmentUniqueId.getIdParts(0)), Long.toString(segmentUniqueId.getIdParts(1)), Long - .toString(segmentUniqueId.getIdParts(2))); - return this; - } - } - -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItem.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItem.java deleted file mode 100644 index 8730b4613..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItem.java +++ /dev/null @@ -1,43 +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.entity; - -import java.util.ArrayList; -import java.util.List; - -public class SegmentItem { - private String applicationCode; - private List segments; - - public SegmentItem(String applicationCode) { - this.applicationCode = applicationCode; - segments = new ArrayList<>(); - } - - public void addSegments(Segment item) { - segments.add(item); - } - - public String getApplicationCode() { - return applicationCode; - } - - public List getSegments() { - return segments; - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItems.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItems.java deleted file mode 100644 index 60e07f14b..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItems.java +++ /dev/null @@ -1,44 +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.entity; - -import java.util.HashMap; -import java.util.Map; - -public class SegmentItems { - private Map segmentItems; - - public SegmentItems() { - this.segmentItems = new HashMap<>(); - } - - public SegmentItems addSegmentItem(int applicationId, Segment segment) { - String applicationCode = ValidateData.INSTANCE.getRegistryItem().findApplicationCode(applicationId); - SegmentItem segmentItem = segmentItems.get(applicationCode); - if (segmentItem == null) { - segmentItem = new SegmentItem(applicationCode); - segmentItems.put(applicationCode, segmentItem); - } - segmentItem.addSegments(segment); - return this; - } - - public Map getSegmentItems() { - return segmentItems; - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItemsSerializer.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItemsSerializer.java deleted file mode 100644 index 7dc66c945..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/SegmentItemsSerializer.java +++ /dev/null @@ -1,47 +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.entity; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import java.lang.reflect.Type; - -public class SegmentItemsSerializer implements JsonSerializer { - - @Override - public JsonElement serialize(SegmentItems src, Type typeOfSrc, JsonSerializationContext context) { - JsonArray applicationSegmentItems = new JsonArray(); - src.getSegmentItems().forEach((applicationCode, segmentItem) -> { - JsonObject segmentJson = new JsonObject(); - segmentJson.addProperty("applicationCode", applicationCode); - 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); - }); - - return applicationSegmentItems; - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Span.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Span.java deleted file mode 100644 index b4fbb5319..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/Span.java +++ /dev/null @@ -1,193 +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. - */ -/* - * Copyright 2017, OpenSkywalking Organization All rights reserved. - * - * Licensed 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. - * - * Project repository: https://github.com/OpenSkywalking/skywalking - */ - -package org.apache.skywalking.plugin.test.mockcollector.entity; - -import java.util.ArrayList; -import java.util.List; -import lombok.AllArgsConstructor; -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; - -@Builder -@ToString -@AllArgsConstructor -public class Span { - private String operationName; - private int operationId; - private int parentSpanId; - private int spanId; - private String spanLayer; - private long startTime; - private long endTime; - private int componentId; - private String componentName; - private boolean isError; - private String spanType; - private String peer; - private int peerId; - private List tags = new ArrayList<>(); - private List logs = new ArrayList<>(); - private List refs = new ArrayList<>(); - - public static class LogEvent { - private List logEvent; - - public LogEvent() { - this.logEvent = new ArrayList<>(); - } - } - - public static class SpanBuilder { - public SpanBuilder logEvent(List eventMessage) { - if (logs == null) { - logs = new ArrayList<>(); - } - - LogEvent event = new LogEvent(); - for (KeyStringValuePair value : eventMessage) { - event.logEvent.add(new KeyValuePair(value.getKey(), value.getValue())); - } - logs.add(event); - return this; - } - - public SpanBuilder tags(String key, String value) { - if (tags == null) { - tags = new ArrayList<>(); - } - - tags.add(new KeyValuePair(key, value)); - return this; - } - - public SpanBuilder ref(SegmentRef segmentRefBuilder) { - if (refs == null) { - refs = new ArrayList<>(); - } - - refs.add(segmentRefBuilder); - return this; - } - - public SpanBuilder logEventV1(List 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 { - @Getter - private String key; - @Getter - private String value; - - public KeyValuePair(String key, String value) { - this.key = key; - this.value = value; - } - } - - @ToString - public static class SegmentRef { - @Getter - private int parentEndpointId; - @Getter - private String parentEndpoint; - @Getter - private int networkAddressId; - @Getter - private int entryEndpointId; - @Getter - private String refType; - @Getter - private int parentSpanId; - @Getter - private String parentTraceSegmentId; - @Getter - private int parentServiceInstanceId; - @Getter - private String networkAddress; - @Getter - private String entryEndpoint; - @Getter - private int entryServiceInstanceId; - - 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.refType = ref.getRefType().toString(); - this.parentSpanId = ref.getParentSpanId(); - this.entryEndpointId = ref.getEntryEndpointId(); - this.networkAddressId = ref.getNetworkAddressId(); - this.parentServiceInstanceId = ref.getParentServiceInstanceId(); - this.parentEndpointId = ref.getParentEndpointId(); - this.parentEndpoint = ref.getParentEndpoint(); - this.networkAddress = ref.getNetworkAddress(); - this.entryEndpoint = ref.getEntryEndpoint(); - 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/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/ValidateData.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/ValidateData.java deleted file mode 100644 index 28b78b7a2..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/ValidateData.java +++ /dev/null @@ -1,43 +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.entity; - -public class ValidateData { - public static ValidateData INSTANCE = new ValidateData(); - private RegistryItem registryItem; - private SegmentItems segmentItem; - - public ValidateData() { - registryItem = new RegistryItem(); - segmentItem = new SegmentItems(); - } - - public RegistryItem getRegistryItem() { - return registryItem; - } - - public SegmentItems getSegmentItem() { - return segmentItem; - } - - public static void clearData() { - System.out.println("Clear Data"); - INSTANCE.segmentItem = new SegmentItems(); - INSTANCE.registryItem.getOperationNames().clear(); - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/ValidateDataSerializer.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/ValidateDataSerializer.java deleted file mode 100644 index d6fabf5df..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/entity/ValidateDataSerializer.java +++ /dev/null @@ -1,40 +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.entity; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import java.lang.reflect.Type; - -public class ValidateDataSerializer implements JsonSerializer { - @Override - public JsonElement serialize(ValidateData src, Type typeOfSrc, JsonSerializationContext context) { - Gson gson = new GsonBuilder().registerTypeAdapter(RegistryItem.class, new RegistryItemSerializer()) - .registerTypeAdapter(SegmentItems.class, new SegmentItemsSerializer()) - .create(); - - JsonObject jsonObject = new JsonObject(); - jsonObject.add("registryItems", gson.toJsonTree(src.getRegistryItem())); - jsonObject.add("segmentItems", gson.toJsonTree(src.getSegmentItem())); - return jsonObject; - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ClearReceiveDataService.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ClearReceiveDataService.java deleted file mode 100644 index 3c4298401..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ClearReceiveDataService.java +++ /dev/null @@ -1,47 +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 java.io.IOException; -import java.io.Writer; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData; - -public class ClearReceiveDataService extends HttpServlet { - - public static final String SERVLET_PATH = "/receiveData/clear"; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/json"); - resp.setCharacterEncoding("utf-8"); - resp.setStatus(200); - ValidateData.clearData(); - Writer out = resp.getWriter(); - out.flush(); - out.close(); - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - doGet(req, resp); - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/GrpcAddressHttpService.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/GrpcAddressHttpService.java deleted file mode 100644 index 264e148c5..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/GrpcAddressHttpService.java +++ /dev/null @@ -1,51 +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 com.google.gson.JsonArray; -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.skywalking.plugin.test.mockcollector.util.ConfigReader; - -public class GrpcAddressHttpService extends HttpServlet { - - public static String SERVLET_PATH = "/agent/gRPC"; - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - JsonArray jsonArray = new JsonArray(); - jsonArray.add(ConfigReader.getGrpcBindHost() + ":" + ConfigReader.getGrpcBindPort()); - resp.setContentType("text/json"); - resp.setCharacterEncoding("utf-8"); - resp.setStatus(200); - - PrintWriter out = resp.getWriter(); - out.print(jsonArray.toString()); - out.flush(); - out.close(); - } - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - doPost(req, resp); - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockCLRMetricReportService.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockCLRMetricReportService.java deleted file mode 100644 index dc969b745..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockCLRMetricReportService.java +++ /dev/null @@ -1,35 +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.common.Commands; -import org.apache.skywalking.apm.network.language.agent.v2.CLRMetricCollection; -import org.apache.skywalking.apm.network.language.agent.v2.CLRMetricReportServiceGrpc; - -/** - * Author Daming Email zteny@foxmail.com - **/ -public class MockCLRMetricReportService extends CLRMetricReportServiceGrpc.CLRMetricReportServiceImplBase { - - @Override - public void collect(CLRMetricCollection request, StreamObserver responseObserver) { - responseObserver.onNext(Commands.newBuilder().build()); - responseObserver.onCompleted(); - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockInstanceDiscoveryService.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockInstanceDiscoveryService.java deleted file mode 100644 index 8ee09015b..000000000 --- a/test/plugin/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 responseObserver) { - ValidateData.INSTANCE.getRegistryItem() - .registryHeartBeat(new RegistryItem.HeartBeat(request.getApplicationInstanceId())); - responseObserver.onNext(Downstream.getDefaultInstance()); - responseObserver.onCompleted(); - } - - @Override - public void registerInstance(ApplicationInstance request, - StreamObserver 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/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockInstancePingService.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockInstancePingService.java deleted file mode 100644 index a58a70a91..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockInstancePingService.java +++ /dev/null @@ -1,36 +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.common.Commands; -import org.apache.skywalking.apm.network.register.v2.ServiceInstancePingGrpc; -import org.apache.skywalking.apm.network.register.v2.ServiceInstancePingPkg; -import org.apache.skywalking.plugin.test.mockcollector.entity.RegistryItem; -import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData; - -public class MockInstancePingService extends ServiceInstancePingGrpc.ServiceInstancePingImplBase { - - @Override - public void doPing(ServiceInstancePingPkg request, StreamObserver responseObserver) { - ValidateData.INSTANCE.getRegistryItem() - .registryHeartBeat(new RegistryItem.HeartBeat(request.getServiceInstanceId())); - responseObserver.onNext(Commands.getDefaultInstance()); - responseObserver.onCompleted(); - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockJVMMetricReportService.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockJVMMetricReportService.java deleted file mode 100644 index 1b5d1193e..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockJVMMetricReportService.java +++ /dev/null @@ -1,35 +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.common.Commands; -import org.apache.skywalking.apm.network.language.agent.v2.JVMMetricCollection; -import org.apache.skywalking.apm.network.language.agent.v2.JVMMetricReportServiceGrpc; - -/** - * Author Daming Email zteny@foxmail.com - **/ -public class MockJVMMetricReportService extends JVMMetricReportServiceGrpc.JVMMetricReportServiceImplBase { - - @Override - public void collect(JVMMetricCollection request, StreamObserver responseObserver) { - responseObserver.onNext(Commands.newBuilder().build()); - responseObserver.onCompleted(); - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockNetworkAddressRegisterService.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockNetworkAddressRegisterService.java deleted file mode 100644 index 7e620d453..000000000 --- a/test/plugin/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 responseObserver) { - responseObserver.onNext(NetworkAddressMappings.getDefaultInstance()); - responseObserver.onCompleted(); - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockRegisterService.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockRegisterService.java deleted file mode 100644 index 33df6f89e..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockRegisterService.java +++ /dev/null @@ -1,119 +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.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.skywalking.apm.network.common.KeyIntValuePair; -import org.apache.skywalking.apm.network.register.v2.Endpoint; -import org.apache.skywalking.apm.network.register.v2.EndpointMapping; -import org.apache.skywalking.apm.network.register.v2.Enpoints; -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; -import org.apache.skywalking.apm.network.register.v2.ServiceRegisterMapping; -import org.apache.skywalking.apm.network.register.v2.Services; -import org.apache.skywalking.plugin.test.mockcollector.entity.RegistryItem; -import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData; - -public class MockRegisterService extends RegisterGrpc.RegisterImplBase { - - private Logger logger = LogManager.getLogger(MockTraceSegmentService.class); - - @Override - public void doEndpointRegister(Enpoints request, StreamObserver responseObserver) { - for (Endpoint endpoint : request.getEndpointsList()) { - ValidateData.INSTANCE.getRegistryItem() - .registryOperationName(new RegistryItem.OperationName(endpoint.getServiceId(), endpoint - .getEndpointName())); - } - responseObserver.onNext(EndpointMapping.getDefaultInstance()); - responseObserver.onCompleted(); - } - - @Override - public void doNetworkAddressRegister(NetAddresses request, StreamObserver responseObserver) { - responseObserver.onNext(NetAddressMapping.getDefaultInstance()); - responseObserver.onCompleted(); - } - - @Override - public void doServiceInstanceRegister(ServiceInstances request, - StreamObserver responseObserver) { - if (request.getInstancesCount() <= 0) { - responseObserver.onNext(ServiceInstanceRegisterMapping.getDefaultInstance()); - responseObserver.onCompleted(); - return; - } - - for (ServiceInstance serviceInstance : request.getInstancesList()) { - int instanceId = Sequences.INSTANCE_SEQUENCE.incrementAndGet(); - ValidateData.INSTANCE.getRegistryItem() - .registryInstance(new RegistryItem.Instance(serviceInstance.getServiceId(), instanceId)); - - responseObserver.onNext(ServiceInstanceRegisterMapping.newBuilder() - .addServiceInstances(KeyIntValuePair.newBuilder() - .setKey(serviceInstance - .getInstanceUUID()) - .setValue(instanceId) - .build()) - .build()); - responseObserver.onCompleted(); - } - } - - @Override - public void doServiceRegister(Services request, StreamObserver responseObserver) { - logger.debug("receive application register."); - if (request.getServicesCount() <= 0) { - logger.warn("The service count is empty. return the default service register mapping"); - responseObserver.onNext(ServiceRegisterMapping.getDefaultInstance()); - responseObserver.onCompleted(); - return; - } - - for (Service service : request.getServicesList()) { - String applicationCode = service.getServiceName(); - ServiceRegisterMapping.Builder builder = ServiceRegisterMapping.newBuilder(); - - if (applicationCode.startsWith("localhost") || applicationCode.startsWith("127.0.0.1") || applicationCode.contains(":") || applicationCode - .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); - ValidateData.INSTANCE.getRegistryItem() - .registryApplication(new RegistryItem.Application(applicationCode, applicationId)); - } - - builder.addServices(KeyIntValuePair.newBuilder().setKey(applicationCode).setValue(applicationId).build()); - responseObserver.onNext(builder.build()); - responseObserver.onCompleted(); - } - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockTraceSegmentService.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockTraceSegmentService.java deleted file mode 100644 index fb5cbd720..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/MockTraceSegmentService.java +++ /dev/null @@ -1,102 +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 com.google.protobuf.InvalidProtocolBufferException; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.skywalking.apm.network.common.Commands; -import org.apache.skywalking.apm.network.common.KeyStringValuePair; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; -import org.apache.skywalking.apm.network.language.agent.v2.Log; -import org.apache.skywalking.apm.network.language.agent.v2.SegmentObject; -import org.apache.skywalking.apm.network.language.agent.v2.SegmentReference; -import org.apache.skywalking.apm.network.language.agent.v2.SpanObjectV2; -import org.apache.skywalking.apm.network.language.agent.v2.TraceSegmentReportServiceGrpc; -import org.apache.skywalking.plugin.test.mockcollector.entity.Segment; -import org.apache.skywalking.plugin.test.mockcollector.entity.Span; -import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData; - -public class MockTraceSegmentService extends TraceSegmentReportServiceGrpc.TraceSegmentReportServiceImplBase { - - private Logger logger = LogManager.getLogger(MockTraceSegmentService.class); - - @Override - public StreamObserver collect(StreamObserver responseObserver) { - return new StreamObserver() { - @Override - public void onNext(UpstreamSegment value) { - try { - SegmentObject traceSegmentObject = SegmentObject.parseFrom(value.getSegment()); - Segment.SegmentBuilder segmentBuilder = Segment.builder() - .segmentId(traceSegmentObject.getTraceSegmentId()); - logger.debug("Receive segment: ServiceID[{}], TraceSegmentId[{}]", traceSegmentObject.getServiceId(), traceSegmentObject - .getTraceSegmentId()); - - for (SpanObjectV2 spanObject : traceSegmentObject.getSpansList()) { - Span.SpanBuilder spanBuilder = Span.builder() - .operationName(spanObject.getOperationName()) - .parentSpanId(spanObject.getParentSpanId()) - .spanId(spanObject.getSpanId()) - .componentId(spanObject.getComponentId()) - .componentName(spanObject.getComponent()) - .spanLayer(spanObject.getSpanLayer().toString()) - .endTime(spanObject.getEndTime()) - .isError(spanObject.getIsError()) - .startTime(spanObject.getStartTime()) - .spanType(spanObject.getSpanType().toString()) - .peer(spanObject.getPeer()) - .peerId(spanObject.getPeerId()) - .operationId(spanObject.getOperationNameId()); - - for (Log logMessage : spanObject.getLogsList()) { - spanBuilder.logEvent(logMessage.getDataList()); - } - - for (KeyStringValuePair tags : spanObject.getTagsList()) { - spanBuilder.tags(tags.getKey(), tags.getValue()); - } - - for (SegmentReference ref : spanObject.getRefsList()) { - spanBuilder.ref(new Span.SegmentRef(ref)); - } - - segmentBuilder.addSpan(spanBuilder); - } - - ValidateData.INSTANCE.getSegmentItem() - .addSegmentItem(traceSegmentObject.getServiceId(), segmentBuilder.build()); - } catch (InvalidProtocolBufferException e) { - e.printStackTrace(); - } - } - - @Override - public void onError(Throwable t) { - - } - - @Override - public void onCompleted() { - responseObserver.onNext(Commands.newBuilder().build()); - responseObserver.onCompleted(); - } - }; - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ReceiveDataService.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ReceiveDataService.java deleted file mode 100644 index f9b037870..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/ReceiveDataService.java +++ /dev/null @@ -1,53 +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 com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.IOException; -import java.io.Writer; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData; -import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateDataSerializer; -import org.yaml.snakeyaml.Yaml; - -public class ReceiveDataService extends HttpServlet { - public static final String SERVLET_PATH = "/receiveData"; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/json"); - 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)))); - out.flush(); - out.close(); - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - doGet(req, resp); - } -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/Sequences.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/Sequences.java deleted file mode 100644 index 415a52d42..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/service/Sequences.java +++ /dev/null @@ -1,30 +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 java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicInteger; - -public class Sequences { - - public static final AtomicInteger INSTANCE_SEQUENCE = new AtomicInteger(); - - public static final AtomicInteger ENDPOINT_SEQUENCE = new AtomicInteger(1); - - public static final ConcurrentHashMap SERVICE_MAPPING = new ConcurrentHashMap(); -} diff --git a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/util/ConfigReader.java b/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/util/ConfigReader.java deleted file mode 100644 index 89cef7559..000000000 --- a/test/plugin/mock-collector/src/main/java/org/apache/skywalking/plugin/test/mockcollector/util/ConfigReader.java +++ /dev/null @@ -1,44 +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.util; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -public class ConfigReader { - private static Properties config = new Properties(); - - static { - InputStream inputStream = ConfigReader.class.getClassLoader().getResourceAsStream("config.properties"); - try { - config.load(inputStream); - } catch (IOException e) { - System.err.println("Failed to load config."); - System.exit(-1); - } - } - - public static String getGrpcBindHost() { - return config.getProperty("grpc_bind_host", "127.0.0.1"); - } - - public static int getGrpcBindPort() { - return Integer.parseInt(config.getProperty("grpc_bind_port", "19876")); - } -} diff --git a/test/plugin/mock-collector/src/main/proto/README.md b/test/plugin/mock-collector/src/main/proto/README.md deleted file mode 100644 index 536bc1f2e..000000000 --- a/test/plugin/mock-collector/src/main/proto/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Apache SkyWalking data collect protocol -Apache SkyWalking can collect data from different sources. Each kind of source should follow the protocols in this repo. - -## License -Apache 2.0 diff --git a/test/plugin/mock-collector/src/main/proto/common/CLR.proto b/test/plugin/mock-collector/src/main/proto/common/CLR.proto deleted file mode 100644 index 57bc8600f..000000000 --- a/test/plugin/mock-collector/src/main/proto/common/CLR.proto +++ /dev/null @@ -1,46 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "common/common.proto"; - -message CLRMetric { - int64 time = 1; - CPU cpu = 2; - ClrGC gc = 3; - ClrThread thread = 4; -} - -message ClrGC { - int64 Gen0CollectCount = 1; - int64 Gen1CollectCount = 2; - int64 Gen2CollectCount = 3; - int64 HeapMemory = 4; -} - -message ClrThread { - int32 AvailableCompletionPortThreads = 1; - int32 AvailableWorkerThreads = 2; - int32 MaxCompletionPortThreads = 3; - int32 MaxWorkerThreads = 4; -} \ No newline at end of file diff --git a/test/plugin/mock-collector/src/main/proto/common/JVM.proto b/test/plugin/mock-collector/src/main/proto/common/JVM.proto deleted file mode 100644 index 543c640dc..000000000 --- a/test/plugin/mock-collector/src/main/proto/common/JVM.proto +++ /dev/null @@ -1,69 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "common/common.proto"; - -message JVMMetric { - int64 time = 1; - CPU cpu = 2; - repeated Memory memory = 3; - repeated MemoryPool memoryPool = 4; - repeated GC gc = 5; -} - -message Memory { - bool isHeap = 1; - int64 init = 2; - int64 max = 3; - int64 used = 4; - int64 committed = 5; -} - -message MemoryPool { - PoolType type = 1; - int64 init = 2; - int64 max = 3; - int64 used = 4; - int64 commited = 5; -} - -enum PoolType { - CODE_CACHE_USAGE = 0; - NEWGEN_USAGE = 1; - OLDGEN_USAGE = 2; - SURVIVOR_USAGE = 3; - PERMGEN_USAGE = 4; - METASPACE_USAGE = 5; -} - -message GC { - GCPhrase phrase = 1; - int64 count = 2; - int64 time = 3; -} - -enum GCPhrase { - NEW = 0; - OLD = 1; -} diff --git a/test/plugin/mock-collector/src/main/proto/common/common.proto b/test/plugin/mock-collector/src/main/proto/common/common.proto deleted file mode 100644 index ce50c7662..000000000 --- a/test/plugin/mock-collector/src/main/proto/common/common.proto +++ /dev/null @@ -1,55 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.common"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -message KeyStringValuePair { - string key = 1; - string value = 2; -} - -message KeyIntValuePair { - string key = 1; - int32 value = 2; -} - -message CPU { - double usagePercent = 2; -} - -// In most cases, detect point should be `server` or `client`. -// Even in service mesh, this means `server`/`client` side sidecar -// `proxy` is reserved only. -enum DetectPoint { - client = 0; - server = 1; - proxy = 2; -} - -message Commands { - repeated Command commands = 1; -} - -message Command { - string command = 1; - repeated KeyStringValuePair args = 2; -} diff --git a/test/plugin/mock-collector/src/main/proto/common/trace-common.proto b/test/plugin/mock-collector/src/main/proto/common/trace-common.proto deleted file mode 100644 index dcbe03d16..000000000 --- a/test/plugin/mock-collector/src/main/proto/common/trace-common.proto +++ /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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -message UpstreamSegment { - repeated UniqueId globalTraceIds = 1; - bytes segment = 2; // the byte array of TraceSegmentObject -} - -enum SpanType { - Entry = 0; - Exit = 1; - Local = 2; -} - -message UniqueId { - repeated int64 idParts = 1; -} - -enum RefType { - CrossProcess = 0; - CrossThread = 1; -} - -enum SpanLayer { - Unknown = 0; - Database = 1; - RPCFramework = 2; - Http = 3; - MQ = 4; - Cache = 5; -} diff --git a/test/plugin/mock-collector/src/main/proto/language-agent-v2/CLRMetric.proto b/test/plugin/mock-collector/src/main/proto/language-agent-v2/CLRMetric.proto deleted file mode 100644 index da023b6a2..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent-v2/CLRMetric.proto +++ /dev/null @@ -1,36 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent.v2"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "common/common.proto"; -import "common/CLR.proto"; - -service CLRMetricReportService { - rpc collect (CLRMetricCollection) returns (Commands) { - } -} - -message CLRMetricCollection { - repeated CLRMetric metrics = 1; - int32 serviceInstanceId = 2; -} \ No newline at end of file diff --git a/test/plugin/mock-collector/src/main/proto/language-agent-v2/JVMMetric.proto b/test/plugin/mock-collector/src/main/proto/language-agent-v2/JVMMetric.proto deleted file mode 100644 index 845624cdf..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent-v2/JVMMetric.proto +++ /dev/null @@ -1,36 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent.v2"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "common/common.proto"; -import "common/JVM.proto"; - -service JVMMetricReportService { - rpc collect (JVMMetricCollection) returns (Commands) { - } -} - -message JVMMetricCollection { - repeated JVMMetric metrics = 1; - int32 serviceInstanceId = 2; -} diff --git a/test/plugin/mock-collector/src/main/proto/language-agent-v2/trace.proto b/test/plugin/mock-collector/src/main/proto/language-agent-v2/trace.proto deleted file mode 100644 index c6120c585..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent-v2/trace.proto +++ /dev/null @@ -1,77 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent.v2"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "common/common.proto"; -import "common/trace-common.proto"; - -service TraceSegmentReportService { - rpc collect (stream UpstreamSegment) returns (Commands) { - } -} - -message SegmentObject { - UniqueId traceSegmentId = 1; - repeated SpanObjectV2 spans = 2; - int32 serviceId = 3; - int32 serviceInstanceId = 4; - bool isSizeLimited = 5; -} - -message SegmentReference { - RefType refType = 1; - UniqueId parentTraceSegmentId = 2; - int32 parentSpanId = 3; - int32 parentServiceInstanceId = 4; - string networkAddress = 5; - int32 networkAddressId = 6; - int32 entryServiceInstanceId = 7; - string entryEndpoint = 8; - int32 entryEndpointId = 9; - string parentEndpoint = 10; - int32 parentEndpointId = 11; -} - -message SpanObjectV2 { - int32 spanId = 1; - int32 parentSpanId = 2; - int64 startTime = 3; - int64 endTime = 4; - repeated SegmentReference refs = 5; - int32 operationNameId = 6; - string operationName = 7; - int32 peerId = 8; - string peer = 9; - SpanType spanType = 10; - SpanLayer spanLayer = 11; - int32 componentId = 12; - string component = 13; - bool isError = 14; - repeated KeyStringValuePair tags = 15; - repeated Log logs = 16; -} - -message Log { - int64 time = 1; - repeated KeyStringValuePair data = 2; -} diff --git a/test/plugin/mock-collector/src/main/proto/language-agent/ApplicationRegisterService.proto b/test/plugin/mock-collector/src/main/proto/language-agent/ApplicationRegisterService.proto deleted file mode 100644 index fd8ee0d4d..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent/ApplicationRegisterService.proto +++ /dev/null @@ -1,39 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "language-agent/KeyWithIntegerValue.proto"; - -//register service for ApplicationCode, this service is called when service starts. -service ApplicationRegisterService { - rpc applicationCodeRegister (Application) returns (ApplicationMapping) { - } -} - -message Application { - string applicationCode = 1; -} - -message ApplicationMapping { - KeyWithIntegerValue application = 1; -} diff --git a/test/plugin/mock-collector/src/main/proto/language-agent/DiscoveryService.proto b/test/plugin/mock-collector/src/main/proto/language-agent/DiscoveryService.proto deleted file mode 100644 index bc392a72c..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent/DiscoveryService.proto +++ /dev/null @@ -1,91 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "language-agent/Downstream.proto"; -import "common/trace-common.proto"; - -service InstanceDiscoveryService { - rpc registerInstance (ApplicationInstance) returns (ApplicationInstanceMapping) { - } - - rpc heartbeat (ApplicationInstanceHeartbeat) returns (Downstream) { - } - -} - -message ApplicationInstance { - int32 applicationId = 1; - string agentUUID = 2; - int64 registerTime = 3; - OSInfo osinfo = 4; -} - -message ApplicationInstanceMapping { - int32 applicationId = 1; - int32 applicationInstanceId = 2; -} - -message ApplicationInstanceRecover { - int32 applicationId = 1; - int32 applicationInstanceId = 2; - int64 registerTime = 3; - OSInfo osinfo = 4; -} - -message ApplicationInstanceHeartbeat { - int32 applicationInstanceId = 1; - int64 heartbeatTime = 2; -} - -message OSInfo { - string osName = 1; - string hostname = 2; - int32 processNo = 3; - repeated string ipv4s = 4; -} - -//discovery service for ServiceName by Network address or application code -service ServiceNameDiscoveryService { - rpc discovery (ServiceNameCollection) returns (ServiceNameMappingCollection) { - } -} - -message ServiceNameCollection { - repeated ServiceNameElement elements = 1; -} - -message ServiceNameMappingCollection { - repeated ServiceNameMappingElement elements = 1; -} - -message ServiceNameMappingElement { - int32 serviceId = 1; - ServiceNameElement element = 2; -} - -message ServiceNameElement { - string serviceName = 1; - int32 applicationId = 2; - SpanType srcSpanType = 3; -} diff --git a/test/plugin/mock-collector/src/main/proto/language-agent/Downstream.proto b/test/plugin/mock-collector/src/main/proto/language-agent/Downstream.proto deleted file mode 100644 index e7bbb39a2..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent/Downstream.proto +++ /dev/null @@ -1,27 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -// nothing down stream from collector yet. -message Downstream { -} diff --git a/test/plugin/mock-collector/src/main/proto/language-agent/JVMMetricsService.proto b/test/plugin/mock-collector/src/main/proto/language-agent/JVMMetricsService.proto deleted file mode 100644 index 229f41a96..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent/JVMMetricsService.proto +++ /dev/null @@ -1,36 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "language-agent/Downstream.proto"; -import "common/JVM.proto"; - -service JVMMetricsService { - rpc collect (JVMMetrics) returns (Downstream) { - } -} - -message JVMMetrics { - repeated JVMMetric metrics = 1; - int32 applicationInstanceId = 2; -} diff --git a/test/plugin/mock-collector/src/main/proto/language-agent/KeyWithIntegerValue.proto b/test/plugin/mock-collector/src/main/proto/language-agent/KeyWithIntegerValue.proto deleted file mode 100644 index ed48a5485..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent/KeyWithIntegerValue.proto +++ /dev/null @@ -1,28 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -message KeyWithIntegerValue { - string key = 1; - int32 value = 2; -} diff --git a/test/plugin/mock-collector/src/main/proto/language-agent/KeyWithStringValue.proto b/test/plugin/mock-collector/src/main/proto/language-agent/KeyWithStringValue.proto deleted file mode 100644 index 111426775..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent/KeyWithStringValue.proto +++ /dev/null @@ -1,28 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -message KeyWithStringValue { - string key = 1; - string value = 2; -} diff --git a/test/plugin/mock-collector/src/main/proto/language-agent/NetworkAddressRegisterService.proto b/test/plugin/mock-collector/src/main/proto/language-agent/NetworkAddressRegisterService.proto deleted file mode 100644 index a299edcf6..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent/NetworkAddressRegisterService.proto +++ /dev/null @@ -1,38 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "language-agent/KeyWithIntegerValue.proto"; - -service NetworkAddressRegisterService { - rpc batchRegister (NetworkAddresses) returns (NetworkAddressMappings) { - } -} - -message NetworkAddresses { - repeated string addresses = 1; -} - -message NetworkAddressMappings { - repeated KeyWithIntegerValue addressIds = 1; -} diff --git a/test/plugin/mock-collector/src/main/proto/language-agent/TraceSegmentService.proto b/test/plugin/mock-collector/src/main/proto/language-agent/TraceSegmentService.proto deleted file mode 100644 index f8566b2da..000000000 --- a/test/plugin/mock-collector/src/main/proto/language-agent/TraceSegmentService.proto +++ /dev/null @@ -1,78 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.language.agent"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "language-agent/Downstream.proto"; -import "language-agent/KeyWithStringValue.proto"; -import "common/trace-common.proto"; - -service TraceSegmentService { - rpc collect (stream UpstreamSegment) returns (Downstream) { - } -} - -message TraceSegmentObject { - UniqueId traceSegmentId = 1; - repeated SpanObject spans = 2; - int32 applicationId = 3; - int32 applicationInstanceId = 4; - bool isSizeLimited = 5; -} - -message TraceSegmentReference { - RefType refType = 1; - UniqueId parentTraceSegmentId = 2; - int32 parentSpanId = 3; - int32 parentApplicationInstanceId = 4; - string networkAddress = 5; - int32 networkAddressId = 6; - int32 entryApplicationInstanceId = 7; - string entryServiceName = 8; - int32 entryServiceId = 9; - string parentServiceName = 10; - int32 parentServiceId = 11; -} - -message SpanObject { - int32 spanId = 1; - int32 parentSpanId = 2; - int64 startTime = 3; - int64 endTime = 4; - repeated TraceSegmentReference refs = 5; - int32 operationNameId = 6; - string operationName = 7; - int32 peerId = 8; - string peer = 9; - SpanType spanType = 10; - SpanLayer spanLayer = 11; - int32 componentId = 12; - string component = 13; - bool isError = 14; - repeated KeyWithStringValue tags = 15; - repeated LogMessage logs = 16; -} - -message LogMessage { - int64 time = 1; - repeated KeyWithStringValue data = 2; -} diff --git a/test/plugin/mock-collector/src/main/proto/register/InstancePing.proto b/test/plugin/mock-collector/src/main/proto/register/InstancePing.proto deleted file mode 100644 index 3a8ffe16c..000000000 --- a/test/plugin/mock-collector/src/main/proto/register/InstancePing.proto +++ /dev/null @@ -1,36 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.register.v2"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "common/common.proto"; - -service ServiceInstancePing { - rpc doPing (ServiceInstancePingPkg) returns (Commands) { - } -} - -message ServiceInstancePingPkg { - int32 serviceInstanceId = 1; - int64 time = 2; - string serviceInstanceUUID = 3; -} diff --git a/test/plugin/mock-collector/src/main/proto/register/Register.proto b/test/plugin/mock-collector/src/main/proto/register/Register.proto deleted file mode 100644 index aff9ea5be..000000000 --- a/test/plugin/mock-collector/src/main/proto/register/Register.proto +++ /dev/null @@ -1,124 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.register.v2"; -option csharp_namespace = "SkyWalking.NetworkProtocol"; - -import "common/common.proto"; - -//register service for ApplicationCode, this service is called when service starts. -service Register { - rpc doServiceRegister (Services) returns (ServiceRegisterMapping) { - } - - rpc doServiceInstanceRegister (ServiceInstances) returns (ServiceInstanceRegisterMapping) { - } - - rpc doEndpointRegister (Enpoints) returns (EndpointMapping) { - } - - rpc doNetworkAddressRegister (NetAddresses) returns (NetAddressMapping) { - } - - rpc doServiceAndNetworkAddressMappingRegister (ServiceAndNetworkAddressMappings) returns(Commands) { - } -} - -// Service register -message Services { - repeated Service services = 1; -} - -message Service { - string serviceName = 1; - repeated KeyStringValuePair tags = 3; - repeated KeyStringValuePair properties = 4; -} - -message ServiceRegisterMapping { - repeated KeyIntValuePair services = 1; -} - -// Service Instance register -message ServiceInstances { - repeated ServiceInstance instances = 1; -} - -message ServiceInstance { - int32 serviceId = 1; - string instanceUUID = 2; - int64 time = 3; - repeated KeyStringValuePair tags = 4; - repeated KeyStringValuePair properties = 5; -} - -message ServiceInstanceRegisterMapping { - repeated KeyIntValuePair serviceInstances = 1; -} - -// Network address register - -// Only known use case is the language agent. -// Network address represents the ip/hostname:port, which is usually used at client side of RPC. -message NetAddresses { - repeated string addresses = 1; -} - -message NetAddressMapping { - repeated KeyIntValuePair addressIds = 1; -} - -// Endpint register -message Enpoints { - repeated Endpoint endpoints = 1; -} - -message Endpoint { - int32 serviceId = 1; - string endpointName = 2; - repeated KeyStringValuePair tags = 3; - repeated KeyStringValuePair properties = 4; - // For endpoint - // from DetectPoint is either `client` or `server`. No chance to be `proxy`. - DetectPoint from = 5; -} - -message EndpointMapping { - repeated EndpointMappingElement elements = 1; -} - -message EndpointMappingElement { - int32 serviceId = 1; - string endpointName = 2; - int32 endpointId = 3; - DetectPoint from = 4; -} - -message ServiceAndNetworkAddressMappings { - repeated ServiceAndNetworkAddressMapping mappings = 1; -} - -message ServiceAndNetworkAddressMapping { - int32 serviceId = 1; - int32 serviceInstanceId = 2; - string networkAddress = 3; - int32 networkAddressId = 4; -} diff --git a/test/plugin/mock-collector/src/main/proto/service-mesh-probe/istio/skywalking.config.pb.html b/test/plugin/mock-collector/src/main/proto/service-mesh-probe/istio/skywalking.config.pb.html deleted file mode 100644 index a92c80407..000000000 --- a/test/plugin/mock-collector/src/main/proto/service-mesh-probe/istio/skywalking.config.pb.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: Apache SkyWalking -description: Adapter to deliver metrics to Apache SkyWalking. -location: https://istio.io/docs/reference/config/policy-and-telemetry/adapters/apache-skywalking.html -layout: protoc-gen-docs -generator: protoc-gen-docs -provider: Apache SkyWalking -contact_email: dev@skywalking.apache.org -support_link: -source_link: https://github.com/apache/skywalking -latest_release_link: https://skywalking.apache.org/downloads/ -helm_chart_link: -istio_versions: "1.0.3, 1.0.4, 1.1.0, 1.1.1" -supported_templates: metric -logo_link: https://github.com/apache/skywalking-website/raw/master/docs/.vuepress/public/assets/logo.svg -number_of_entries: 1 ---- - - - -

The SkyWalking adapter uses the Istio bypass adapter to collect metrics and make them available to -Apache SkyWalking. SkyWalking provides a topology map and metrics graph -to visualize the whole mesh.

- -

This adapter supports the metric template.

- -

Follow the official Apache SkyWalking documentation -and SkyWalking k8s documentation for details on configuring SkyWalking and the Istio bypass adapter.

diff --git a/test/plugin/mock-collector/src/main/proto/service-mesh-probe/service-mesh.proto b/test/plugin/mock-collector/src/main/proto/service-mesh-probe/service-mesh.proto deleted file mode 100644 index 87e0b70d4..000000000 --- a/test/plugin/mock-collector/src/main/proto/service-mesh-probe/service-mesh.proto +++ /dev/null @@ -1,56 +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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.network.servicemesh"; - -import "common/common.proto"; - -service ServiceMeshMetricService { - rpc collect(stream ServiceMeshMetric) returns (MeshProbeDownstream) { - } -} - -message ServiceMeshMetric { - int64 startTime = 1; - int64 endTime = 2; - string sourceServiceName = 3; - int32 sourceServiceId = 4; - string sourceServiceInstance = 5; - int32 sourceServiceInstanceId = 6; - string destServiceName = 7; - int32 destServiceId = 8; - string destServiceInstance = 9; - int32 destServiceInstanceId = 10; - string endpoint = 11; - int32 latency = 12; - int32 responseCode = 13; - bool status = 14; - Protocol protocol = 15; - DetectPoint detectPoint = 16; -} - -enum Protocol { - HTTP = 0; - gRPC = 1; -} - -message MeshProbeDownstream { -} diff --git a/test/plugin/mock-collector/src/main/resources/config.properties b/test/plugin/mock-collector/src/main/resources/config.properties deleted file mode 100644 index 4f290cafb..000000000 --- a/test/plugin/mock-collector/src/main/resources/config.properties +++ /dev/null @@ -1,16 +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. -grpc_bind_host=127.0.0.1 -grpc_bind_port=19876 diff --git a/test/plugin/mock-collector/src/main/resources/expect-data.yaml b/test/plugin/mock-collector/src/main/resources/expect-data.yaml deleted file mode 100644 index ed70818f5..000000000 --- a/test/plugin/mock-collector/src/main/resources/expect-data.yaml +++ /dev/null @@ -1,78 +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. -expectData: - - registryItem: - - applications: - - test-applicationCode1: nq 0 // the application id of test-applicationCode is 3 - - test-applicationCode2: nq 0 - - operationNames: - - test-applicationCode1: {testOperationName, testOperationName1} // there are three operation names in test-applicationCode1 has been registery - - instances: - - test-applicationCode1: eq 3 // test-applicationCode1 has 3 instances - - test-applicationCode2: 1 // test-applicationCode2 has 1 instance - - heartbeat: - - test-applicationCode1: gt 2 // there are 3 instance of test-applicationCode has been send heartbeat - - - segmentsItems: - - - test-applicationCode: 1 // test-applicationCode has seend 1 segment. - segments: - - - segmentId: not null - refs: - - parentSpanId: 1 - - parentTraceSegmentId: ${test-applicationCode2[0]} - - networkAddress: xxx - - parentServiceId: 1 - - parentServiceName: not null - - networkAddressId: 1 - - entryServiceId: 1 - - refType: xx - - parentApplicationInstanceId: 1 - - entryServiceName: xx - spans: - - - operationName: testOperationName - parentSpanId: 0 - spanId: 1 - spanLayer: HTTP - logs: - - xx: xx - - bb: bb - tags: - - xx: xx - - aa: aa - stattime: not empty - endtime: not empty - componentId: 1 - componentName: - spanType: Entry - isError: false - - - test-applicationCode2: 2 - segments: - - - segmentId: not null - spans: - - - operationName: testOperationName - parentSpanId: 0 - spanId: 1 - spanLayer: HTTP - logs: - - xx: xx - - bb: bb - globalSegmentId: diff --git a/test/plugin/mock-collector/src/main/resources/log4j2.xml b/test/plugin/mock-collector/src/main/resources/log4j2.xml deleted file mode 100644 index 2d119182e..000000000 --- a/test/plugin/mock-collector/src/main/resources/log4j2.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - diff --git a/test/plugin/mock-collector/src/main/resources/sample-data.yaml b/test/plugin/mock-collector/src/main/resources/sample-data.yaml deleted file mode 100644 index a648290d3..000000000 --- a/test/plugin/mock-collector/src/main/resources/sample-data.yaml +++ /dev/null @@ -1,68 +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. -# -validateData: - - registryItem: - - applications: - - test-applicationCode1: 3 // the application id of test-applicationCode is 3 - - test-applicationCode2: 1 - - operationNames: - - test-applicationCode1: {testOperationName, testOperationName1} // there are three operation names in test-applicationCode1 has been registery - - instances: - - test-applicationCode1: 3 // test-applicationCode1 has 3 instances - - test-applicationCode2: 1 // test-applicationCode2 has 1 instance - - heartbeat: - - test-applicationCode1: 3 // there are 3 instance of test-applicationCode has been send heartbeat - - - segmentsItems: - - - test-applicationCode: 1 // test-applicationCode has seend 1 segment. - segments: - - - segmentId: xxxx - refs: - - parentSpanId: 1 - - parentTraceSegmentId: ${test-applicationCode2[0]} - - networkAddress: xxx - - parentServiceId: 1 - - parentServiceName: not null - - networkAddressId: 1 - - entryServiceId: 1 - - refType: xx - - parentApplicationInstanceId: 1 - - entryServiceName: xx - spans: - - - operationName: testOperationName - parentSpanId: 0 - spanId: 1 - spanLayer: HTTP - logs: - - xx: xx - - bb: bb - tags: - - xx: xx - - aa: aa - stattime: 141 - endtime: 141 - componentId: 1 - componentName: - spanType: Entry - isError: false - - - test-applicationCode2: 2 - segments: - //..... diff --git a/test/plugin/pom.xml b/test/plugin/pom.xml index aacb7b438..d93df7bb4 100644 --- a/test/plugin/pom.xml +++ b/test/plugin/pom.xml @@ -32,8 +32,7 @@ runner-helper - validator - mock-collector + agent-test-tools containers diff --git a/test/plugin/runner-helper/pom.xml b/test/plugin/runner-helper/pom.xml index a1814e017..39ea2fe85 100644 --- a/test/plugin/runner-helper/pom.xml +++ b/test/plugin/runner-helper/pom.xml @@ -28,7 +28,7 @@ 4.0.0 runner-helper - plugin-runner-helper + SkyWalking Plugin Test Runner Helper diff --git a/test/plugin/scenarios/activemq-scenario/config/expectedData.yaml b/test/plugin/scenarios/activemq-scenario/config/expectedData.yaml index a987e05f2..13614f547 100644 --- a/test/plugin/scenarios/activemq-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/activemq-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {activemq-scenario: nq 0} instances: - {activemq-scenario: nq 0} @@ -22,7 +22,7 @@ registryItems: - activemq-scenario: [ActiveMQ/Queue/test/Consumer, /activemq-scenario/case/activemq] heartbeat: [] segmentItems: -- applicationCode: activemq-scenario +- serviceName: activemq-scenario segmentSize: ge 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/config/expectedData.yaml b/test/plugin/scenarios/apm-toolkit-trace-scenario/config/expectedData.yaml index 683c3dd21..1f3d596e3 100644 --- a/test/plugin/scenarios/apm-toolkit-trace-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {apm-toolkit-trace-scenario: 2} instances: - {apm-toolkit-trace-scenario: 1} @@ -24,7 +24,7 @@ registryItems: /case/tool-kit, /case/asyncVisit/supplier] heartbeat: [] segmentItems: - - applicationCode: apm-toolkit-trace-scenario + - serviceName: apm-toolkit-trace-scenario segmentSize: gt 5 segments: - segmentId: not null diff --git a/test/plugin/scenarios/armeria-0.96minus-scenario/config/expectedData.yaml b/test/plugin/scenarios/armeria-0.96minus-scenario/config/expectedData.yaml index 7ad070c57..7038128a8 100644 --- a/test/plugin/scenarios/armeria-0.96minus-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/armeria-0.96minus-scenario/config/expectedData.yaml @@ -16,7 +16,7 @@ registryItems: - applications: + services: - {'armeria-0.96minus-scenario': 2} instances: - {'armeria-0.96minus-scenario': 1} @@ -24,7 +24,7 @@ registryItems: - 'armeria-0.96minus-scenario': [/greet/skywalking] heartbeat: [] segmentItems: - - applicationCode: armeria-0.96minus-scenario + - serviceName: armeria-0.96minus-scenario segmentSize: ge 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/armeria-0.96plus-scenario/config/expectedData.yaml b/test/plugin/scenarios/armeria-0.96plus-scenario/config/expectedData.yaml index 56c7be3bc..44e8a10f1 100644 --- a/test/plugin/scenarios/armeria-0.96plus-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/armeria-0.96plus-scenario/config/expectedData.yaml @@ -16,7 +16,7 @@ registryItems: - applications: + services: - {'armeria-0.96plus-scenario': 2} instances: - {'armeria-0.96plus-scenario': 1} @@ -24,7 +24,7 @@ registryItems: - 'armeria-0.96plus-scenario': [/greet/skywalking] heartbeat: [] segmentItems: - - applicationCode: armeria-0.96plus-scenario + - serviceName: armeria-0.96plus-scenario segmentSize: ge 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/avro-scenario/config/expectedData.yaml b/test/plugin/scenarios/avro-scenario/config/expectedData.yaml index a2f16d7d0..489067417 100644 --- a/test/plugin/scenarios/avro-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/avro-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {avro-server: 2} - {avro-client: 3} instances: @@ -25,7 +25,7 @@ registryItems: - avro-client: [/avro-scenario/case/healthCheck, /avro-scenario/case/avro-scenario] heartbeat: [] segmentItems: - - applicationCode: avro-server + - serviceName: avro-server segmentSize: 1 segments: - segmentId: not null @@ -48,7 +48,7 @@ segmentItems: entryEndpointId: 0, refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstanceId: 2, networkAddress: 'localhost/127.0.0.1:9018', entryEndpoint: /avro-scenario/case/avro-scenario, entryServiceInstanceId: 2} - - applicationCode: avro-client + - serviceName: avro-client segmentSize: ge 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/canal-scenario/config/expectedData.yaml b/test/plugin/scenarios/canal-scenario/config/expectedData.yaml index de5e7c29e..020f6a544 100644 --- a/test/plugin/scenarios/canal-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/canal-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {canal-scenario: 2} instances: - {canal-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - canal-scenario: [/canal-scenario/case/canal-case] heartbeat: [] segmentItems: - - applicationCode: canal-scenario + - serviceName: canal-scenario segmentSize: gt 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/cassandra-java-driver-3.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/cassandra-java-driver-3.x-scenario/config/expectedData.yaml index 233019790..45dcc1bb6 100644 --- a/test/plugin/scenarios/cassandra-java-driver-3.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/cassandra-java-driver-3.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {cassandra-java-driver-3.x-scenario: 2} instances: - {cassandra-java-driver-3.x-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - cassandra-java-driver-3.x-scenario: [/cassandra-java-driver-3.x-scenario/case/cassandra] heartbeat: [] segmentItems: - - applicationCode: cassandra-java-driver-3.x-scenario + - serviceName: cassandra-java-driver-3.x-scenario segmentSize: ge 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/customize-scenario/config/expectedData.yaml b/test/plugin/scenarios/customize-scenario/config/expectedData.yaml index 77c95dc30..34f1eddc4 100644 --- a/test/plugin/scenarios/customize-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/customize-scenario/config/expectedData.yaml @@ -15,14 +15,14 @@ # limitations under the License. registryItems: - applications: + services: - {customize-scenario: nq 0} instances: - {customize-scenario: 1} operationNames: - customize-scenario: [/case/customize] segmentItems: - - applicationCode: customize-scenario + - serviceName: customize-scenario segmentSize: gt 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/dubbo-2.5.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/dubbo-2.5.x-scenario/config/expectedData.yaml index 5fa2275fc..6c4d00912 100644 --- a/test/plugin/scenarios/dubbo-2.5.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/dubbo-2.5.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {dubbo-2.5.x-scenario: 2} instances: - {dubbo-2.5.x-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - dubbo-2.5.x-scenario: [/dubbo-2.5.x-scenario/case/dubbo, org.apache.skywalking.apm.testcase.dubbo.services.GreetService.doBusiness()] heartbeat: [] segmentItems: - - applicationCode: dubbo-2.5.x-scenario + - serviceName: dubbo-2.5.x-scenario segmentSize: ge 3 segments: - segmentId: not null diff --git a/test/plugin/scenarios/dubbo-2.7.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/dubbo-2.7.x-scenario/config/expectedData.yaml index b48b542dd..62548c5c5 100644 --- a/test/plugin/scenarios/dubbo-2.7.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/dubbo-2.7.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {dubbo-2.7.x-scenario: 2} instances: - {dubbo-2.7.x-scenario: 1} @@ -23,7 +23,7 @@ registryItems: org.apache.skywalking.apm.testcase.dubbo.services.GreetService.doBusiness()] heartbeat: [] segmentItems: - - applicationCode: dubbo-2.7.x-scenario + - serviceName: dubbo-2.7.x-scenario segmentSize: ge 3 segments: - segmentId: not null diff --git a/test/plugin/scenarios/ehcache-2.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/ehcache-2.x-scenario/config/expectedData.yaml index 94e7a9e93..02e22562e 100644 --- a/test/plugin/scenarios/ehcache-2.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/ehcache-2.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {ehcache-2.x-scenario: 2} instances: - {ehcache-2.x-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - ehcache-2.x-scenario: [/ehcache-2.x-scenario/case/ehcache] heartbeat: [] segmentItems: - - applicationCode: ehcache-2.x-scenario + - serviceName: ehcache-2.x-scenario segmentSize: ge 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/elasticsearch-5.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/elasticsearch-5.x-scenario/config/expectedData.yaml index 36058787b..dbe2c45d1 100644 --- a/test/plugin/scenarios/elasticsearch-5.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/elasticsearch-5.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {elasticsearch-5.x-scenario: nq 0} instances: - {elasticsearch-5.x-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - elasticsearch-5.x-scenario: [/case/elasticsearch] heartbeat: [] segmentItems: -- applicationCode: elasticsearch-5.x-scenario +- serviceName: elasticsearch-5.x-scenario segmentSize: ge 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/elasticsearch-6.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/elasticsearch-6.x-scenario/config/expectedData.yaml index 38fb50b1b..9a2c16b27 100644 --- a/test/plugin/scenarios/elasticsearch-6.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/elasticsearch-6.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {elasticsearch-6.x-scenario: nq 0} instances: - {elasticsearch-6.x-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - elasticsearch-6.x-scenario: [/elasticsearch-case/case/elasticsearch] heartbeat: [] segmentItems: -- applicationCode: elasticsearch-6.x-scenario +- serviceName: elasticsearch-6.x-scenario segmentSize: ge 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/elasticsearch-7.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/elasticsearch-7.x-scenario/config/expectedData.yaml index 0b40177c1..c45972fb1 100644 --- a/test/plugin/scenarios/elasticsearch-7.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/elasticsearch-7.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {elasticsearch-7.x-scenario: nq 0} instances: - {elasticsearch-7.x-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - elasticsearch-7.x-scenario: [/elasticsearch-case/case/elasticsearch] heartbeat: [] segmentItems: -- applicationCode: elasticsearch-7.x-scenario +- serviceName: elasticsearch-7.x-scenario segmentSize: ge 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/feign-scenario/config/expectedData.yaml b/test/plugin/scenarios/feign-scenario/config/expectedData.yaml index e01e4e2a8..f2a411802 100644 --- a/test/plugin/scenarios/feign-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/feign-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {feign-scenario: nq 0} instances: - {feign-scenario: 1} @@ -23,7 +23,7 @@ registryItems: /feign-scenario/case/feign-scenario, /feign-scenario/delete/1] heartbeat: [] segmentItems: -- applicationCode: feign-scenario +- serviceName: feign-scenario segmentSize: ge 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/gateway-scenario/config/expectedData.yaml b/test/plugin/scenarios/gateway-scenario/config/expectedData.yaml index 395be6df9..b48b2f130 100644 --- a/test/plugin/scenarios/gateway-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/gateway-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {gateway-projectB-scenario: nq 0} - {gateway-projectA-scenario: nq 0} instances: @@ -26,7 +26,7 @@ registryItems: - gateway-projectA-scenario: [WEBFLUX.handle] heartbeat: [] segmentItems: - - applicationCode: gateway-projectB-scenario + - serviceName: gateway-projectB-scenario segmentSize: nq 0 segments: - segmentId: not null @@ -52,7 +52,7 @@ segmentItems: entryEndpointId: 0, refType: CrossProcess, parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstanceId: not null, networkAddress: 'localhost:18070', entryEndpoint: WEBFLUX.handle, entryServiceInstanceId: not null} - - applicationCode: gateway-projectA-scenario + - serviceName: gateway-projectA-scenario segmentSize: nq 0 segments: - segmentId: not null diff --git a/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml b/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml index b0a870ca2..dbbec6041 100644 --- a/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - { grpc-scenario: 2 } instances: - { grpc-scenario: 1 } @@ -22,7 +22,7 @@ registryItems: - grpc-scenario: [Greeter.sayHello, GreeterBlocking.sayHello, GreeterBlockingError.sayHello, /grpc-scenario/case/grpc-scenario] heartbeat: [] segmentItems: -- applicationCode: grpc-scenario +- serviceName: grpc-scenario segmentSize: gt 10 segments: - segmentId: not null diff --git a/test/plugin/scenarios/gson-scenario/config/expectedData.yaml b/test/plugin/scenarios/gson-scenario/config/expectedData.yaml index f5126cb31..95ea037db 100644 --- a/test/plugin/scenarios/gson-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/gson-scenario/config/expectedData.yaml @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {gson-scenario: nq 0} instances: - {gson-scenario: nq 0} operationNames: - gson-scenario: [/gson-scenario/case/gson-scenario] segmentItems: -- applicationCode: gson-scenario +- serviceName: gson-scenario segmentSize: ge 2 segments: - segmentId: nq 0 diff --git a/test/plugin/scenarios/h2-scenario/config/expectedData.yaml b/test/plugin/scenarios/h2-scenario/config/expectedData.yaml index 052ac92cc..bd9da8aa1 100644 --- a/test/plugin/scenarios/h2-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/h2-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {h2-scenario: 2} instances: - {h2-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - h2-scenario: [/h2-scenario/case/h2-scenario] heartbeat: [] segmentItems: - - applicationCode: h2-scenario + - serviceName: h2-scenario segmentSize: gt 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/httpasyncclient-scenario/config/expectedData.yaml b/test/plugin/scenarios/httpasyncclient-scenario/config/expectedData.yaml index 985001db4..a5ecd3395 100644 --- a/test/plugin/scenarios/httpasyncclient-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/httpasyncclient-scenario/config/expectedData.yaml @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {httpasyncclient-scenario: nq 0} instances: - {httpasyncclient-scenario: 1} operationNames: - httpasyncclient-scenario: [/httpasyncclient/case/httpasyncclient, /httpasyncclient/back] segmentItems: -- applicationCode: httpasyncclient-scenario +- serviceName: httpasyncclient-scenario segmentSize: ge 4 segments: - segmentId: not null diff --git a/test/plugin/scenarios/httpclient-3.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/httpclient-3.x-scenario/config/expectedData.yaml index 42388b7af..c0e154f31 100644 --- a/test/plugin/scenarios/httpclient-3.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/httpclient-3.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {httpclient-3.x-scenario: 2} instances: - {httpclient-3.x-scenario: 1} @@ -23,7 +23,7 @@ registryItems: /httpclient-3.x-scenario/case/context-propagate] heartbeat: [] segmentItems: - - applicationCode: httpclient-3.x-scenario + - serviceName: httpclient-3.x-scenario segmentSize: ge 3 segments: - segmentId: not null diff --git a/test/plugin/scenarios/httpclient-4.3.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/httpclient-4.3.x-scenario/config/expectedData.yaml index 6ffec1b23..af156bcb5 100644 --- a/test/plugin/scenarios/httpclient-4.3.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/httpclient-4.3.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {httpclient-4.3.x-scenario: 2} instances: - {httpclient-4.3.x-scenario: 1} @@ -24,7 +24,7 @@ registryItems: /httpclient-4.3.x-scenario/case/context-propagate] heartbeat: [] segmentItems: - - applicationCode: httpclient-4.3.x-scenario + - serviceName: httpclient-4.3.x-scenario segmentSize: ge 3 segments: - segmentId: not null diff --git a/test/plugin/scenarios/hystrix-scenario/config/expectedData.yaml b/test/plugin/scenarios/hystrix-scenario/config/expectedData.yaml index e1a1c9e24..f02c033b8 100644 --- a/test/plugin/scenarios/hystrix-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/hystrix-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {hystrix-scenario: 2} instances: - {hystrix-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - hystrix-scenario: [/case/hystrix-scenario] heartbeat: [] segmentItems: -- applicationCode: hystrix-scenario +- serviceName: hystrix-scenario segmentSize: ge 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/jdk-http-scenario/config/expectedData.yaml b/test/plugin/scenarios/jdk-http-scenario/config/expectedData.yaml index de4357b0e..a22022924 100644 --- a/test/plugin/scenarios/jdk-http-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/jdk-http-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {jdk-http-scenario: 2} instances: - {jdk-http-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - jdk-http-scenario: [/jdk-http-scenario/case/receiveContext-0, /jdk-http-scenario/case/jdk-http-scenario] heartbeat: [] segmentItems: - - applicationCode: jdk-http-scenario + - serviceName: jdk-http-scenario segmentSize: gt 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/jdk-threading-scenario/config/expectedData.yaml b/test/plugin/scenarios/jdk-threading-scenario/config/expectedData.yaml index c4c492d3d..e5be08ef7 100644 --- a/test/plugin/scenarios/jdk-threading-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/jdk-threading-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {jdk-threading-scenario: 2} instances: - {jdk-threading-scenario: 1} @@ -24,7 +24,7 @@ registryItems: heartbeat: [] segmentItems: - - applicationCode: jdk-threading-scenario + - serviceName: jdk-threading-scenario segmentSize: ge 4 segments: - segmentId: not null diff --git a/test/plugin/scenarios/jedis-scenario/config/expectedData.yaml b/test/plugin/scenarios/jedis-scenario/config/expectedData.yaml index 181927b4d..aacdf80f6 100644 --- a/test/plugin/scenarios/jedis-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/jedis-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {jedis-scenario: 2} instances: - {jedis-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - jedis-scenario: [/jedis-scenario/case/jedis-scenario] heartbeat: [] segmentItems: - - applicationCode: jedis-scenario + - serviceName: jedis-scenario segmentSize: gt 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/jetty-scenario/config/expectedData.yaml b/test/plugin/scenarios/jetty-scenario/config/expectedData.yaml index ecfa7dd49..b4bcafed6 100644 --- a/test/plugin/scenarios/jetty-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/jetty-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {jettyserver-scenario: nq 0} - {jettyclient-scenario: nq 0} instances: @@ -25,7 +25,7 @@ registryItems: - jettyclient-scenario: [/jettyclient-case/case/jettyclient-case, /jettyclient-case/case/healthCheck] segmentItems: -- applicationCode: jettyserver-scenario +- serviceName: jettyserver-scenario segmentSize: 1 segments: - segmentId: not null @@ -48,7 +48,7 @@ segmentItems: - {key: http.method, value: GET} refs: - {parentEndpointId: 0, parentEndpoint: /jettyclient-case/case/jettyclient-case, networkAddressId: 0, entryEndpointId: 0, refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: "${jettyclient-scenario[0]}", parentServiceInstanceId: nq 0, networkAddress: 'localhost:18080', entryEndpoint: /jettyclient-case/case/jettyclient-case, entryServiceInstanceId: nq 0 } -- applicationCode: jettyclient-scenario +- serviceName: jettyclient-scenario segmentSize: 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/kafka-scenario/config/expectedData.yaml b/test/plugin/scenarios/kafka-scenario/config/expectedData.yaml index b85df953f..eb2b7dafa 100644 --- a/test/plugin/scenarios/kafka-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/kafka-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {kafka-scenario: 2} instances: - {kafka-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - kafka-scenario: [Kafka/test/Consumer/testGroup, /case/kafka-case] heartbeat: [] segmentItems: - - applicationCode: kafka-scenario + - serviceName: kafka-scenario segmentSize: gt 3 segments: - segmentId: not null diff --git a/test/plugin/scenarios/kotlin-coroutine-scenario/config/expectedData.yaml b/test/plugin/scenarios/kotlin-coroutine-scenario/config/expectedData.yaml index d46e352c7..6a882e97f 100644 --- a/test/plugin/scenarios/kotlin-coroutine-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/kotlin-coroutine-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {kotlin-coroutine-scenario: 2} instances: - {kotlin-coroutine-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - kotlin-coroutine-scenario: [/kotlin-coroutine-scenario/case/h2] heartbeat: [] segmentItems: - - applicationCode: kotlin-coroutine-scenario + - serviceName: kotlin-coroutine-scenario segmentSize: gt 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/lettuce-scenario/config/expectedData.yaml b/test/plugin/scenarios/lettuce-scenario/config/expectedData.yaml index a5eebc583..df6fe7ee1 100644 --- a/test/plugin/scenarios/lettuce-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/lettuce-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {lettuce-scenario: 2} instances: - {lettuce-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - lettuce-scenario: [/lettuce-scenario/case/lettuce-case, /lettuce-scenario/case/healthCheck] heartbeat: [] segmentItems: - - applicationCode: lettuce-scenario + - serviceName: lettuce-scenario segmentSize: nq 0 segments: - segmentId: not null diff --git a/test/plugin/scenarios/mongodb-3.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/mongodb-3.x-scenario/config/expectedData.yaml index 20bce04a0..1ddcd60c0 100644 --- a/test/plugin/scenarios/mongodb-3.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/mongodb-3.x-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {mongodb-3.x-scenario: nq 0} instances: - {mongodb-3.x-scenario: 1} @@ -24,7 +24,7 @@ registryItems: heartbeat: [] segmentItems: -- applicationCode: mongodb-3.x-scenario +- serviceName: mongodb-3.x-scenario segmentSize: ge 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/mysql-scenario/config/expectedData.yaml b/test/plugin/scenarios/mysql-scenario/config/expectedData.yaml index be73e68b3..929b7ef07 100644 --- a/test/plugin/scenarios/mysql-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/mysql-scenario/config/expectedData.yaml @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {mysql-scenario: nq 0} instances: - {mysql-scenario: 1} operationNames: - mysql-scenario: [/mysql-scenario/case/healthCheck, /mysql-scenario/case/mysql-scenario] segmentItems: - - applicationCode: mysql-scenario + - serviceName: mysql-scenario segmentSize: ge 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/netty-socketio-scenario/config/expectedData.yaml b/test/plugin/scenarios/netty-socketio-scenario/config/expectedData.yaml index 021e00c2d..233fb3d50 100644 --- a/test/plugin/scenarios/netty-socketio-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/netty-socketio-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {netty-socketio-scenario: 2} instances: - {netty-socketio-scenario: 1} @@ -24,7 +24,7 @@ registryItems: /netty-socketio-scenario/healthCheck, SocketIO/onConnect, SocketIO/send_data/receive] heartbeat: [] segmentItems: - - applicationCode: netty-socketio-scenario + - serviceName: netty-socketio-scenario segmentSize: ge 5 segments: - segmentId: not null diff --git a/test/plugin/scenarios/okhttp-scenario/config/expectedData.yaml b/test/plugin/scenarios/okhttp-scenario/config/expectedData.yaml index 6d4af0cfc..8b5f782f1 100644 --- a/test/plugin/scenarios/okhttp-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/okhttp-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {okhttp-scenario: nq 0} instances: - {okhttp-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - okhttp-scenario: [/case/receiveContext-0, /case/healthCheck, /case/okhttp-case, /case/receiveContext-1] heartbeat: [] segmentItems: -- applicationCode: okhttp-scenario +- serviceName: okhttp-scenario segmentSize: ge 5 segments: - segmentId: not null diff --git a/test/plugin/scenarios/oracle-scenario/config/expectedData.yaml b/test/plugin/scenarios/oracle-scenario/config/expectedData.yaml index c85f2f792..1a209b457 100644 --- a/test/plugin/scenarios/oracle-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/oracle-scenario/config/expectedData.yaml @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {oracle-scenario: nq 0} instances: - {oracle-scenario: 1} operationNames: - oracle-scenario: [/oracle-scenario/case/oracle] segmentItems: -- applicationCode: oracle-scenario +- serviceName: oracle-scenario segmentSize: ge 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/play-scenario/config/expectedData.yaml b/test/plugin/scenarios/play-scenario/config/expectedData.yaml index 1ee937227..e9c7668c9 100644 --- a/test/plugin/scenarios/play-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/play-scenario/config/expectedData.yaml @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {play-scenario: 2} instances: - {play-scenario: 1} operationNames: - play-scenario: ["/play-scenario/case/play-scenario/projects/{projectId}"] segmentItems: - - applicationCode: play-scenario + - serviceName: play-scenario segmentSize: gt 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/postgresql-above9.4.1207-scenario/config/expectedData.yaml b/test/plugin/scenarios/postgresql-above9.4.1207-scenario/config/expectedData.yaml index 2fa965b4a..a374546a6 100644 --- a/test/plugin/scenarios/postgresql-above9.4.1207-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/postgresql-above9.4.1207-scenario/config/expectedData.yaml @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {postgresql-above9.4.1207-scenario: nq 0} instances: - {postgresql-above9.4.1207-scenario: 1} operationNames: - postgresql-above9.4.1207-scenario: [/postgresql-scenario/case/postgres] segmentItems: -- applicationCode: postgresql-above9.4.1207-scenario +- serviceName: postgresql-above9.4.1207-scenario segmentSize: ge 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/postgresql-scenario/config/expectedData.yaml b/test/plugin/scenarios/postgresql-scenario/config/expectedData.yaml index 064057673..44493b731 100644 --- a/test/plugin/scenarios/postgresql-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/postgresql-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {postgresql-scenario: nq 0} instances: - {postgresql-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - postgresql-scenario: [/postgresql-scenario/case/postgres] heartbeat: [] segmentItems: -- applicationCode: postgresql-scenario +- serviceName: postgresql-scenario segmentSize: ge 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/pulsar-scenario/config/expectedData.yaml b/test/plugin/scenarios/pulsar-scenario/config/expectedData.yaml index 559082791..a7316759d 100644 --- a/test/plugin/scenarios/pulsar-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/pulsar-scenario/config/expectedData.yaml @@ -15,14 +15,14 @@ # limitations under the License. registryItems: - applications: + services: - {pulsar-scenario: nq 0} instances: - {pulsar-scenario: nq 0} operationNames: - pulsar-scenario: [/case/pulsar-case, Pulsar/test/Consumer/test] segmentItems: -- applicationCode: pulsar-scenario +- serviceName: pulsar-scenario segmentSize: ge 3 segments: - segmentId: not null diff --git a/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml b/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml index 8b6b964b8..a1d9a8959 100644 --- a/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/rabbitmq-scenario/config/expectedData.yaml @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {rabbitmq-scenario: nq 0} instances: - {rabbitmq-scenario: 1} operationNames: - rabbitmq-scenario: [/rabbitmq-scenario/case/rabbitmq, RabbitMQ/Topic/Queue/test/Consumer] segmentItems: -- applicationCode: rabbitmq-scenario +- serviceName: rabbitmq-scenario segmentSize: gt 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/redisson-scenario/config/expectedData.yaml b/test/plugin/scenarios/redisson-scenario/config/expectedData.yaml index aac27237e..d1c33a9be 100644 --- a/test/plugin/scenarios/redisson-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/redisson-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {redisson-scenario: 2} instances: - {redisson-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - redisson-scenario: [/case/healthCheck, /case/redisson-case] heartbeat: [] segmentItems: - - applicationCode: redisson-scenario + - serviceName: redisson-scenario segmentSize: nq 0 segments: - segmentId: not null diff --git a/test/plugin/scenarios/servicecomb-0.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/servicecomb-0.x-scenario/config/expectedData.yaml index a7089410f..6b6dae582 100644 --- a/test/plugin/scenarios/servicecomb-0.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/servicecomb-0.x-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {servicecomb-0.x-scenario: 2} instances: - {servicecomb-0.x-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - servicecomb-0.x-scenario: [codefirst.codeFirstSpringmvcHelloClient.say, codefirst.codeFirstHello.sayHi] heartbeat: [] segmentItems: - - applicationCode: servicecomb-0.x-scenario + - serviceName: servicecomb-0.x-scenario segmentSize: gt 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/servicecomb-1.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/servicecomb-1.x-scenario/config/expectedData.yaml index 95ab9d664..21816a9c7 100644 --- a/test/plugin/scenarios/servicecomb-1.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/servicecomb-1.x-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {servicecomb-1.x-scenario: 2} instances: - {servicecomb-1.x-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - servicecomb-1.x-scenario: [codefirst.codeFirstSpringmvcHelloClient.say, codefirst.codeFirstHello.sayHi] heartbeat: [] segmentItems: - - applicationCode: servicecomb-1.x-scenario + - serviceName: servicecomb-1.x-scenario segmentSize: gt 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/shardingsphere-3.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/shardingsphere-3.x-scenario/config/expectedData.yaml index 5e02e7819..f02c68bd7 100644 --- a/test/plugin/scenarios/shardingsphere-3.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/shardingsphere-3.x-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {shardingsphere-3.x-scenario: nq 0} instances: - {shardingsphere-3.x-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - shardingsphere-3.x-scenario: [/shardingsphere-3.x-scenario/case/execute] heartbeat: [] segmentItems: - - applicationCode: shardingsphere-3.x-scenario + - serviceName: shardingsphere-3.x-scenario segmentSize: not null segments: - segmentId: not null diff --git a/test/plugin/scenarios/shardingsphere-4.x-RC1-RC2-scenario/config/expectedData.yaml b/test/plugin/scenarios/shardingsphere-4.x-RC1-RC2-scenario/config/expectedData.yaml index 125281168..b45895a0d 100644 --- a/test/plugin/scenarios/shardingsphere-4.x-RC1-RC2-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/shardingsphere-4.x-RC1-RC2-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {shardingsphere-4.x-RC1-RC2-scenario: nq 0} instances: - {shardingsphere-4.x-RC1-RC2-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - shardingsphere-4.x-RC1-RC2-scenario: [/shardingsphere-4.x-RC1-RC2-scenario/case/execute] heartbeat: [] segmentItems: - - applicationCode: shardingsphere-4.x-RC1-RC2-scenario + - serviceName: shardingsphere-4.x-RC1-RC2-scenario segmentSize: not null segments: - segmentId: not null diff --git a/test/plugin/scenarios/shardingsphere-4.x-RC3-scenario/config/expectedData.yaml b/test/plugin/scenarios/shardingsphere-4.x-RC3-scenario/config/expectedData.yaml index fb9137134..a4990cb6a 100644 --- a/test/plugin/scenarios/shardingsphere-4.x-RC3-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/shardingsphere-4.x-RC3-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {shardingsphere-4.x-RC3-scenario: nq 0} instances: - {shardingsphere-4.x-RC3-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - shardingsphere-4.x-RC3-scenario: [/shardingsphere-4.x-RC3-scenario/case/execute] heartbeat: [] segmentItems: - - applicationCode: shardingsphere-4.x-RC3-scenario + - serviceName: shardingsphere-4.x-RC3-scenario segmentSize: not null segments: - segmentId: not null diff --git a/test/plugin/scenarios/sofarpc-scenario/config/expectedData.yaml b/test/plugin/scenarios/sofarpc-scenario/config/expectedData.yaml index 08b15f6b6..d48c5b1fd 100644 --- a/test/plugin/scenarios/sofarpc-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/sofarpc-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {sofarpc-scenario: 2} instances: - {sofarpc-scenario: 1} @@ -24,7 +24,7 @@ registryItems: /sofarpc-scenario/case/sofarpc] heartbeat: [] segmentItems: - - applicationCode: sofarpc-scenario + - serviceName: sofarpc-scenario segmentSize: gt 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/solrj-7.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/solrj-7.x-scenario/config/expectedData.yaml index efe708f2d..b9781b473 100644 --- a/test/plugin/scenarios/solrj-7.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/solrj-7.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {solrj-7.x-scenario: nq 0} instances: - {solrj-7.x-scenario: nq 0} @@ -22,7 +22,7 @@ registryItems: - solrj-7.x-scenario: [/solrj-scenario/case/solrj] heartbeat: [] segmentItems: - - applicationCode: solrj-7.x-scenario + - serviceName: solrj-7.x-scenario segmentSize: gt 1 segments: - segmentId: not null diff --git a/test/plugin/scenarios/spring-3.0.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/spring-3.0.x-scenario/config/expectedData.yaml index 6390235ed..322a19168 100644 --- a/test/plugin/scenarios/spring-3.0.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/spring-3.0.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {spring-3.0.x-scenario: 2} instances: - {spring-3.0.x-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - spring-3.0.x-scenario: [/healthCheck, /case/spring3] heartbeat: [] segmentItems: - - applicationCode: spring-3.0.x-scenario + - serviceName: spring-3.0.x-scenario segmentSize: ge 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/spring-3.1.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/spring-3.1.x-scenario/config/expectedData.yaml index a6192ada2..3e3bedbd3 100644 --- a/test/plugin/scenarios/spring-3.1.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/spring-3.1.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {spring-3.1.x-scenario: 2} instances: - {spring-3.1.x-scenario: 1} @@ -24,7 +24,7 @@ registryItems: '{PUT}/update/{id}'] heartbeat: [] segmentItems: - - applicationCode: spring-3.1.x-scenario + - serviceName: spring-3.1.x-scenario segmentSize: ge 7 segments: - segmentId: not null diff --git a/test/plugin/scenarios/spring-4.1.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/spring-4.1.x-scenario/config/expectedData.yaml index 0f4931bb4..14cfa9ae3 100644 --- a/test/plugin/scenarios/spring-4.1.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/spring-4.1.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {spring-4.1.x-scenario: 2} instances: - {spring-4.1.x-scenario: 1} @@ -23,7 +23,7 @@ registryItems: '{POST}/create/', /healthCheck, /case/spring3, '{PUT}/update/{id}'] heartbeat: [] segmentItems: - - applicationCode: spring-4.1.x-scenario + - serviceName: spring-4.1.x-scenario segmentSize: ge 7 segments: - segmentId: not null diff --git a/test/plugin/scenarios/spring-4.3.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/spring-4.3.x-scenario/config/expectedData.yaml index cc2ac080a..2d7776deb 100644 --- a/test/plugin/scenarios/spring-4.3.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/spring-4.3.x-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {spring-4.3.x-scenario: 2} instances: - {spring-4.3.x-scenario: 1} @@ -24,7 +24,7 @@ registryItems: /case/spring3, /impl/requestmapping, /impl/restmapping] heartbeat: [] segmentItems: - - applicationCode: spring-4.3.x-scenario + - serviceName: spring-4.3.x-scenario segmentSize: ge 10 segments: - segmentId: not null diff --git a/test/plugin/scenarios/spring-async-scenario/config/expectedData.yaml b/test/plugin/scenarios/spring-async-scenario/config/expectedData.yaml index e2377b747..ea4056c0c 100644 --- a/test/plugin/scenarios/spring-async-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/spring-async-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {spring-async-scenario: 2} instances: - {spring-async-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - spring-async-scenario: [/spring-async-scenario/case/asyncVisit, /spring-async-scenario/case/spring-async] heartbeat: [] segmentItems: - - applicationCode: spring-async-scenario + - serviceName: spring-async-scenario segmentSize: gt 5 segments: - segmentId: not null diff --git a/test/plugin/scenarios/spring-tx-scenario/config/expectedData.yaml b/test/plugin/scenarios/spring-tx-scenario/config/expectedData.yaml index 46a42e601..3f7a4f227 100644 --- a/test/plugin/scenarios/spring-tx-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/spring-tx-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {spring-tx-scenario: 2} instances: - {spring-tx-scenario: 1} @@ -23,7 +23,7 @@ registryItems: - spring-tx-scenario: [/case/spring-tx-case, /case/healthCheck] heartbeat: [] segmentItems: - - applicationCode: spring-tx-scenario + - serviceName: spring-tx-scenario segmentSize: nq 0 segments: - segmentId: not null diff --git a/test/plugin/scenarios/struts2.3-scenario/config/expectedData.yaml b/test/plugin/scenarios/struts2.3-scenario/config/expectedData.yaml index c7e5e8b45..5d400a0a1 100644 --- a/test/plugin/scenarios/struts2.3-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/struts2.3-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {struts2.3-scenario: 2} instances: - {struts2.3-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - struts2.3-scenario: [/struts2.3-scenario/struts-scenario/case1.action, /struts2.3-scenario/struts-scenario/case.action] heartbeat: [] segmentItems: - - applicationCode: struts2.3-scenario + - serviceName: struts2.3-scenario segmentSize: gt 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/struts2.5-scenario/config/expectedData.yaml b/test/plugin/scenarios/struts2.5-scenario/config/expectedData.yaml index 3e274b130..bf3c2c63b 100644 --- a/test/plugin/scenarios/struts2.5-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/struts2.5-scenario/config/expectedData.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. registryItems: - applications: + services: - {struts2.5-scenario: 2} instances: - {struts2.5-scenario: 1} @@ -22,7 +22,7 @@ registryItems: - struts2.5-scenario: [/struts2.5-scenario/struts-scenario/case1.action, /struts2.5-scenario/struts-scenario/case.action] heartbeat: [] segmentItems: - - applicationCode: struts2.5-scenario + - serviceName: struts2.5-scenario segmentSize: gt 2 segments: - segmentId: not null diff --git a/test/plugin/scenarios/undertow-scenario/config/expectedData.yaml b/test/plugin/scenarios/undertow-scenario/config/expectedData.yaml index a600a80ab..4f811c245 100644 --- a/test/plugin/scenarios/undertow-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/undertow-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {undertow-scenario: 2} instances: - {undertow-scenario: 1} @@ -24,7 +24,7 @@ registryItems: '/undertow-routing-scenario/case/{context}'] heartbeat: [] segmentItems: - - applicationCode: undertow-scenario + - serviceName: undertow-scenario segmentSize: gt 5 segments: - segmentId: not null diff --git a/test/plugin/scenarios/webflux-scenario/config/expectedData.yaml b/test/plugin/scenarios/webflux-scenario/config/expectedData.yaml index e84b03b5a..91b194fee 100644 --- a/test/plugin/scenarios/webflux-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/webflux-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {webflux-projectB-scenario: nq 0} - {webflux-projectA-scenario: nq 0} instances: @@ -26,7 +26,7 @@ registryItems: - webflux-projectA-scenario: [/projectA/testcase] heartbeat: [] segmentItems: - - applicationCode: webflux-projectB-scenario + - serviceName: webflux-projectB-scenario segmentSize: nq 0 segments: - segmentId: not null @@ -221,7 +221,7 @@ segmentItems: entryEndpointId: 0, refType: CrossProcess, parentSpanId: 8, parentTraceSegmentId: not null, parentServiceInstanceId: not null, networkAddress: 'localhost:18080', entryEndpoint: /projectA/testcase, entryServiceInstanceId: not null} - - applicationCode: webflux-projectA-scenario + - serviceName: webflux-projectA-scenario segmentSize: nq 0 segments: - segmentId: not null diff --git a/test/plugin/scenarios/zookeeper-scenario/config/expectedData.yaml b/test/plugin/scenarios/zookeeper-scenario/config/expectedData.yaml index 6fb9f3750..6ed7304f2 100644 --- a/test/plugin/scenarios/zookeeper-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/zookeeper-scenario/config/expectedData.yaml @@ -15,7 +15,7 @@ # limitations under the License. registryItems: - applications: + services: - {zookeeper-scenario: 2} instances: - {zookeeper-scenario: 1} @@ -24,7 +24,7 @@ registryItems: /zookeeper-scenario/case/healthCheck] heartbeat: [] segmentItems: - - applicationCode: zookeeper-scenario + - serviceName: zookeeper-scenario segmentSize: nq 0 segments: - segmentId: not null diff --git a/test/plugin/validator/README.md b/test/plugin/validator/README.md deleted file mode 100644 index c40707bc8..000000000 --- a/test/plugin/validator/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# agent-integration-testtool -The agent-integration-testtool project is used that to validate the different of Skywalking Java Agent generate -data item between you expect and the actual generate. - -## Assert Exceptions -The following are the exceptions that may occur in the validate tools. -### Data file -* [IllegalDataFileException](./docs/exception/IllegalDataFileException.md) - -### Registry Item -#### Application -* [RegistryInstanceOfApplicationNotFoundException](./docs/exception/RegistryInstanceOfApplicationNotFoundException.md) -* [RegistryApplicationNotFoundException](./docs/exception/RegistryApplicationNotFoundException.md) -* [RegistryApplicationSizeNotEqualsException](./docs/exception/RegistryApplicationSizeNotEqualsException.md) - -#### Instance -* [RegistryInstanceOfApplicationNotFoundException](./docs/exception/RegistryInstanceOfApplicationNotFoundException.md) -* [RegistryInstanceSizeNotEqualsException](./docs/exception/RegistryInstanceSizeNotEqualsException.md) -* [RegistryInstancesNotEqualsException](./docs/exception/RegistryInstancesNotEqualsException.md) - -#### Operation name -* [ActualRegistryOperationNameEmptyException](./docs/exception/ActualRegistryOperationNameEmptyException.md) -* [RegistryOperationNameNotFoundException](./docs/exception/RegistryOperationNameNotFoundException.md) -* [RegistryOperationNamesNotFoundException](./docs/exception/RegistryOperationNamesNotFoundException.md) -* [RegistryOperationNamesOfApplicationNotFoundException](./docs/exception/RegistryOperationNamesOfApplicationNotFoundException.md) - -### Segment -* [ActualSegmentItemEmptyException](./docs/exception/ActualSegmentItemEmptyException.md) -* [SegmentItemNotFoundException](./docs/exception/SegmentItemNotFoundException.md) -* [SegmentNotFoundException](./docs/exception/SegmentNotFoundException.md) - -### Segment Ref -* [SegmentRefNotFoundException](./docs/exception/SegmentRefNotFoundException.md) -* [ParentSegmentNotFoundException](./docs/exception/ParentSegmentNotFoundException.md) -* [SegmentRefSizeNotEqualsException](./docs/exception/SegmentRefSizeNotEqualsException.md) -* [SegmentSizeNotEqualsException](./docs/exception/SegmentSizeNotEqualsException.md) diff --git a/test/plugin/validator/docs/exception/ActualRegistryOperationNameEmptyException.md b/test/plugin/validator/docs/exception/ActualRegistryOperationNameEmptyException.md deleted file mode 100644 index 5f4c8841e..000000000 --- a/test/plugin/validator/docs/exception/ActualRegistryOperationNameEmptyException.md +++ /dev/null @@ -1,12 +0,0 @@ -# ActualRegistryOperationNameEmptyException - -## Format -ActualRegistryOperationNameEmptyException APPLICATION
-expected: [ OPERATION_NAME_A, OPERATION_NAME_B, ... ]
-actual: Empty - -## Cause -The `ActualRegistryOperationNameEmptyException` caused by there is any registry operation name 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/test/plugin/validator/docs/exception/ActualSegmentItemEmptyException.md b/test/plugin/validator/docs/exception/ActualSegmentItemEmptyException.md deleted file mode 100644 index bf3b186a3..000000000 --- a/test/plugin/validator/docs/exception/ActualSegmentItemEmptyException.md +++ /dev/null @@ -1,15 +0,0 @@ -# ActualSegmentItemEmptyException - -## Format -ActualSegmentItemEmptyException
-expected:
-Segment Item[APPLICATION]
- - segment size: EXPECTED_SIZE
- -actual: Empty
- -## Cause -The `ActualSegmentItemEmptyException` caused by the segment item is empty 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/test/plugin/validator/docs/exception/IllegalDataFileException.md b/test/plugin/validator/docs/exception/IllegalDataFileException.md deleted file mode 100644 index 1a30dc2a1..000000000 --- a/test/plugin/validator/docs/exception/IllegalDataFileException.md +++ /dev/null @@ -1,11 +0,0 @@ -# IllegalDataFileException - -## Format -IllegalDataFileException - -## Cause by -The IllegalDataFileException cause by the data file is an illegal format. - -## Check Points -1. Check the format of data file if the file name is `expectedData.yaml`. -2. Check the build status of the test case if the file name is `actualData.yaml`. You can get it from the `testcase-build.log` file diff --git a/test/plugin/validator/docs/exception/ParentSegmentNotFoundException.md b/test/plugin/validator/docs/exception/ParentSegmentNotFoundException.md deleted file mode 100644 index fcf75594a..000000000 --- a/test/plugin/validator/docs/exception/ParentSegmentNotFoundException.md +++ /dev/null @@ -1,24 +0,0 @@ -# ParentSegmentNotFoundException - -## Format -ParentSegmentNotFoundException
-expected: PARENT_SEGMENT_EXPRESS
-actual: NOT FOUND - -## Cause -The `ParentSegmentNotFoundException` caused by the parent segment express cannot found in the actual data file.
-e.g., -expected: -``` -"refs": [ - { - "parentTraceSegmentId": "${other_application[10]}", - ... - } -] -``` -actual: -The segment size of `other_application` less than 10 - -## Check Points -1. Check if the parent segment express is correct \ No newline at end of file diff --git a/test/plugin/validator/docs/exception/RegistryApplicationNotFoundException.md b/test/plugin/validator/docs/exception/RegistryApplicationNotFoundException.md deleted file mode 100644 index 07e57b275..000000000 --- a/test/plugin/validator/docs/exception/RegistryApplicationNotFoundException.md +++ /dev/null @@ -1,27 +0,0 @@ -# RegistryApplicationNotFoundException - -## Format -RegistryApplicationNotFoundException
-expected: EXPECTED_SERVICE
-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/test/plugin/validator/docs/exception/RegistryApplicationSizeNotEqualsException.md b/test/plugin/validator/docs/exception/RegistryApplicationSizeNotEqualsException.md deleted file mode 100644 index 56f00999d..000000000 --- a/test/plugin/validator/docs/exception/RegistryApplicationSizeNotEqualsException.md +++ /dev/null @@ -1,13 +0,0 @@ -# RegistryApplicationSizeNotEqualsException - -## Format -RegistryApplicationSizeNotEqualsException APPLICATION
-expected: EXPECTED_SIZE
-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/test/plugin/validator/docs/exception/RegistryInstanceOfApplicationNotFoundException.md b/test/plugin/validator/docs/exception/RegistryInstanceOfApplicationNotFoundException.md deleted file mode 100644 index 23f3d5f4c..000000000 --- a/test/plugin/validator/docs/exception/RegistryInstanceOfApplicationNotFoundException.md +++ /dev/null @@ -1,25 +0,0 @@ -# RegistryInstanceOfApplicationNotFoundException - -## Format -RegistryInstanceOfApplicationNotFoundException
-expected: Instances of Service(APPLICATION)
-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.
-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/test/plugin/validator/docs/exception/RegistryInstanceSizeNotEqualsException.md b/test/plugin/validator/docs/exception/RegistryInstanceSizeNotEqualsException.md deleted file mode 100644 index 19739a937..000000000 --- a/test/plugin/validator/docs/exception/RegistryInstanceSizeNotEqualsException.md +++ /dev/null @@ -1,13 +0,0 @@ -# RegistryInstanceSizeNotEqualsException - -## Format -RegistryInstanceSizeNotEqualsException APPLICATION
-expected: EXPECTED_SIZE
-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 - -## Check Points -1. Check the size of the registry instance that you expected - diff --git a/test/plugin/validator/docs/exception/RegistryInstancesNotEqualsException.md b/test/plugin/validator/docs/exception/RegistryInstancesNotEqualsException.md deleted file mode 100644 index b52ecb572..000000000 --- a/test/plugin/validator/docs/exception/RegistryInstancesNotEqualsException.md +++ /dev/null @@ -1,12 +0,0 @@ -# RegistryInstancesNotEqualsException - -## Format -RegistryInstancesNotEqualsException
-expected: EXPECTED_INSTANCE_SIZE
-actual: ACTUAL_INSTANCE_SIZE - -## Cause by -The RegistryInstancesNotEqualsException cause by the instance size is different between expected and actual - -## Check Points -1. Check the instance size that your write if it is your expected. \ No newline at end of file diff --git a/test/plugin/validator/docs/exception/RegistryOperationNameNotFoundException.md b/test/plugin/validator/docs/exception/RegistryOperationNameNotFoundException.md deleted file mode 100644 index 39ecbfcb4..000000000 --- a/test/plugin/validator/docs/exception/RegistryOperationNameNotFoundException.md +++ /dev/null @@ -1,13 +0,0 @@ -# RegistryOperationNameNotFoundException - -## Format -RegistryOperationNameNotFoundException APPLICATION
-expected: OPERATION_NAME
-actual: NOT FOUND - -## Cause -The `RegistryOperationNameNotFoundException` caused by the registry operation name that you expected cannot found in the actual data file - -## Check Points -1. Check if the registry operation name that you expected is correct -2. Check if the instrumentation that it generates the operation name works \ No newline at end of file diff --git a/test/plugin/validator/docs/exception/RegistryOperationNamesNotFoundException.md b/test/plugin/validator/docs/exception/RegistryOperationNamesNotFoundException.md deleted file mode 100644 index 13c5764b2..000000000 --- a/test/plugin/validator/docs/exception/RegistryOperationNamesNotFoundException.md +++ /dev/null @@ -1,13 +0,0 @@ -# RegistryOperationNamesNotFoundException - -## Format -RegistryOperationNamesNotFoundException
-expected:
-actual: Not Found
- -## Cause by -The RegistryOperationNamesNotFoundException cause by the registry operation names of someone application cannot found - in the actual data file. - -## Check Points -1. Check all the instrumentations about test case if it works. \ No newline at end of file diff --git a/test/plugin/validator/docs/exception/RegistryOperationNamesOfApplicationNotFoundException.md b/test/plugin/validator/docs/exception/RegistryOperationNamesOfApplicationNotFoundException.md deleted file mode 100644 index 45136e690..000000000 --- a/test/plugin/validator/docs/exception/RegistryOperationNamesOfApplicationNotFoundException.md +++ /dev/null @@ -1,12 +0,0 @@ -# RegistryOperationNamesOfApplicationNotFoundException - -## Format -RegistryOperationNamesOfApplicationNotFoundException
-expected: [ OPERATION_NAME_A, OPERATION_NAME_B, ...]
-actual: NOT FOUND - -## Cause -The `RegistryOperationNamesOfApplicationNotFoundException` caused by the registry operation name of someone application 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/test/plugin/validator/docs/exception/SegmentItemNotFoundException.md b/test/plugin/validator/docs/exception/SegmentItemNotFoundException.md deleted file mode 100644 index 2f08dccee..000000000 --- a/test/plugin/validator/docs/exception/SegmentItemNotFoundException.md +++ /dev/null @@ -1,15 +0,0 @@ -# SegmentItemNotFoundException - -## Format -SegmentItemNotFoundException
-expected:
-Segment Item[APPLICATION]
- - segment size: EXPECTED_SIZE
- -actual: NOT FOUND - -## Cause -The `SegmentItemNotFoundException` caused by the segment item of you expected cannot found 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/test/plugin/validator/docs/exception/SegmentNotFoundException.md b/test/plugin/validator/docs/exception/SegmentNotFoundException.md deleted file mode 100644 index c3c3e749b..000000000 --- a/test/plugin/validator/docs/exception/SegmentNotFoundException.md +++ /dev/null @@ -1,31 +0,0 @@ -# SegmentNotFoundException - -## Format -SegmentNotFoundException
-expected
-Segment:
- - span[PARENT_SPAN_ID, SPAN_ID] OPERATION_NAME_A
- - span[PARENT_SPAN_ID, SPAN_ID] OPERATION_NAME_B
- - ......
- -actual:
-Segment[SEGMENT_ID_A] validate failed:
-expected: span[PARENT_SPAN_ID, SPAN_ID] OPERATION_NAME
-actual: span[PARENT_SPAN_ID, SPAN_ID] OPERATION_NAME
-reason: [SPAN_FIELD] expected=>{EXPECTED_VALUE}, actual=>{ACTUAL_VALUE}
- -Segment[SEGMENT_ID_B] validate failed:
-expected: span[PARENT_SPAN_ID, SPAN_ID] OPERATION_NAME
-actual: span[PARENT_SPAN_ID, SPAN_ID] OPERATION_NAME
-reason: [SPAN_FIELD] expected=>{EXPECTED_VALUE}, actual=>{ACTUAL_VALUE}
- -......
- -**NOTE**: The validate tool validates all similar segment similar to what you expect in the actual data file. The rule that the validate tool to check if the segment similar to what you expect is the span size equals. - -## Cause -The `SegmentNotFoundException` caused by the segment what you expect cannot found in the actual data file. - -## Check Points -1. Check if the span sequence of a segment is right -2. Check if the field value of the span is right \ No newline at end of file diff --git a/test/plugin/validator/docs/exception/SegmentRefNotFoundException.md b/test/plugin/validator/docs/exception/SegmentRefNotFoundException.md deleted file mode 100644 index cd8e22fe9..000000000 --- a/test/plugin/validator/docs/exception/SegmentRefNotFoundException.md +++ /dev/null @@ -1,30 +0,0 @@ -# SegmentRefNotFoundException - -## Format -SegmentRefNotFoundException
-expected:
-SegmentRef:
- - entryServiceName: ENTRY_SERVICE_NAME
- - networkAddress: NETWORK_ADDRESS
- - parentServiceName: PARENT_SERVICE_NAME
- - parentSpanId: PARENT_SPAN_ID
- - parentTraceSegmentId: PARENT_TRACE_SEGMENT_ID
- - refType: REF_TYPE
- -actual:
-SegmentRef: [SEGMENT_REF_FIELD] expected=>{EXPECTED_SIZE}, actual=>{ACTUAL_SIZE}
- - entryServiceName: ENTRY_SERVICE_NAME
- - networkAddress: NETWORK_ADDRESS
- - parentServiceName: PARENT_SERVICE_NAME
- - parentSpanId: PARENT_SPAN_ID
- - parentTraceSegmentId: PARENT_TRACE_SEGMENT_ID
- - refType: REF_TYPE
-...... - -**NOTE**: The validate tool check all the segment ref of the span. - -## Cause -The `SegmentRefNotFoundException` caused by the segment ref cannot found in the actual data file - -## Check Points -1. Check if the field value of segment ref what you expect is correct \ No newline at end of file diff --git a/test/plugin/validator/docs/exception/SegmentRefSizeNotEqualsException.md b/test/plugin/validator/docs/exception/SegmentRefSizeNotEqualsException.md deleted file mode 100644 index 7005df4ec..000000000 --- a/test/plugin/validator/docs/exception/SegmentRefSizeNotEqualsException.md +++ /dev/null @@ -1,34 +0,0 @@ -# SegmentRefSizeNotEqualsException -## Format -SegmentRefSizeNotEqualsException
-expected: EXPECTED_SIZE
-actual: ACUTAL_SIZE - -## Cause -The `SegmentRefSizeNotEqualsException` caused by the size of `refs` is different between you expect and actual. - -e.g., -expected: -``` -"refs": [ - { - "parentTraceSegmentId": "${other_application[1]}", - ... - } -] -``` -actual: -``` -"refs": [ - { - "parentTraceSegmentId": "${other_application[1]}", - ... - }, - { - "parentTraceSegmentId": "${other_application[2]}", - ... - } -] -``` -## Check Points -1. Check if the size of segment ref is correct \ No newline at end of file diff --git a/test/plugin/validator/docs/exception/SegmentSizeNotEqualsException.md b/test/plugin/validator/docs/exception/SegmentSizeNotEqualsException.md deleted file mode 100644 index a03868e4a..000000000 --- a/test/plugin/validator/docs/exception/SegmentSizeNotEqualsException.md +++ /dev/null @@ -1,12 +0,0 @@ -# SegmentSizeNotEqualsException - -## Format -SegmentSizeNotEqualsException APPLICATION
-expected: EXPECTED_SIZE
-actual: ACTUAL_SIZE
- -## Cause -The `SegmentSizeNotEqualsException` caused by the size is different between the size that you expected and the actual's - -## Check Points -1. Check if the size that you expected is right \ No newline at end of file diff --git a/test/plugin/validator/pom.xml b/test/plugin/validator/pom.xml deleted file mode 100644 index 874aadbbd..000000000 --- a/test/plugin/validator/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - 4.0.0 - - - org.apache.skywalking.plugin - apache-skywalking-test-plugin - 1.0.0 - - - validator - jar - - skywalking-validator-tools - http://maven.apache.org - - - - com.google.code.gson - gson - 2.8.0 - - - - org.freemarker - freemarker - 2.3.23 - - - - - skywalking-validator-tools - - - org.apache.maven.plugins - maven-shade-plugin - 3.0.0 - - - package - - shade - - - - - - - org.apache.skywalking.plugin.test.agent.tool.Main - - - ../dist/${project.build.finalName}.jar - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - - - diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/ConfigHelper.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/ConfigHelper.java deleted file mode 100644 index fbe642513..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/ConfigHelper.java +++ /dev/null @@ -1,32 +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.agent.tool; - -public class ConfigHelper { - - private ConfigHelper() { - } - - public static String caseName() { - return System.getProperty("caseName", ""); - } - - public static String testCaseBaseDir() { - return System.getProperty("testCasePath", ""); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/Main.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/Main.java deleted file mode 100644 index 2f3101539..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/Main.java +++ /dev/null @@ -1,63 +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.agent.tool; - -import java.io.File; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.DataAssert; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Data; -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class Main { - private static Logger logger = LogManager.getLogger(Main.class); - - public static void main(String[] args) { - System.exit(verify() ? 0 : 1); - } - - static boolean verify() { - File casePath = new File(ConfigHelper.testCaseBaseDir()); - try { - if (!casePath.exists()) { - logger.error("test case dir is not exists or is not directory"); - return false; - } - - logger.info("start to assert data of test case[{}]", ConfigHelper.caseName()); - File actualData = new File(casePath, "actualData.yaml"); - File expectedData = new File(casePath, "expectedData.yaml"); - - if (actualData.exists() && expectedData.exists()) { - try { - 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"); - } - } catch (Exception e) { - logger.error("assert test case {} failed.", ConfigHelper.caseName(), e); - } - return false; - } - -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ApplicationAssert.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ApplicationAssert.java deleted file mode 100644 index c59bd6cec..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ApplicationAssert.java +++ /dev/null @@ -1,53 +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.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.ValueAssertFailedException; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.RegistryApplication; - -public class ApplicationAssert { - public static void assertEquals(List expected, List actual) { - - if (expected == null) { - return; - } - - for (RegistryApplication application : expected) { - RegistryApplication actualApplication = getMatchApplication(actual, application); - try { - ExpressParser.parse(application.expressValue()) - .assertValue("registry application", actualApplication.expressValue()); - } catch (ValueAssertFailedException e) { - throw new RegistryApplicationSizeNotEqualsException(application.applicationCode(), e); - } - } - } - - private static RegistryApplication getMatchApplication(List actual, - RegistryApplication application) { - for (RegistryApplication registryApplication : actual) { - if (registryApplication.applicationCode().equals(application.applicationCode())) { - return registryApplication; - } - } - throw new RegistryApplicationNotFoundException(application.applicationCode()); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssert.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssert.java deleted file mode 100644 index 59a412467..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssert.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor; - -import com.google.gson.GsonBuilder; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Data; - -public class DataAssert { - private static Logger logger = LogManager.getLogger(DataAssert.class); - - public static void assertEquals(Data excepted, Data actual) { - logger.info("excepted data:\n{}", new GsonBuilder().setPrettyPrinting().create().toJson(excepted)); - logger.info("actual data:\n{}", new GsonBuilder().setPrettyPrinting().create().toJson(actual)); - RegistryItemsAssert.assertEquals(excepted.registryItems(), actual.registryItems()); - SegmentItemsAssert.assertEquals(excepted.segmentItems(), actual.segmentItems()); - logger.info("{} assert successful.", "segment items"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ExpressParser.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ExpressParser.java deleted file mode 100644 index 84ff2d054..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ExpressParser.java +++ /dev/null @@ -1,63 +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.agent.tool.validator.assertor; - -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.element.ElementAssertor; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.element.EqualsAssertor; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.element.GreatThanAssertor; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.element.GreetEqualAssertor; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.element.NoopAssertor; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.element.NotEqualsAssertor; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.element.NotNullAssertor; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.element.NullAssertor; - -public class ExpressParser { - public static ElementAssertor parse(String express) { - if (express == null) { - return new NoopAssertor(); - } - - String expressTrim = express.trim(); - if (expressTrim.equals("not null")) { - return new NotNullAssertor(); - } - - if (expressTrim.equals("null")) { - return new NullAssertor(); - } - - String[] expressSegment = expressTrim.split(" "); - if (expressSegment.length == 1) { - return new EqualsAssertor(expressSegment[0]); - } else if (expressSegment.length == 2) { - String exceptedValue = expressSegment[1]; - switch (expressSegment[0].trim()) { - case "nq": - return new NotEqualsAssertor(exceptedValue); - case "eq": - return new EqualsAssertor(exceptedValue); - case "gt": - return new GreatThanAssertor(exceptedValue); - case "ge": - return new GreetEqualAssertor(exceptedValue); - } - } - - return new EqualsAssertor(express); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/InstanceAssert.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/InstanceAssert.java deleted file mode 100644 index c4af5e6fa..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/InstanceAssert.java +++ /dev/null @@ -1,53 +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.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.RegistryInstanceSizeNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.RegistryInstance; - -public class InstanceAssert { - public static void assertEquals(List expected, List actual) { - - if (expected == null) { - return; - } - - for (RegistryInstance instance : expected) { - RegistryInstance actualInstance = getMatchApplication(actual, instance); - try { - ExpressParser.parse(actualInstance.expressValue()) - .assertValue(String.format("The registry instance of %s", instance.applicationCode()), actualInstance - .expressValue()); - } catch (ValueAssertFailedException e) { - throw new RegistryInstanceSizeNotEqualsException(instance.applicationCode(), e); - } - } - } - - private static RegistryInstance getMatchApplication(List actual, RegistryInstance application) { - for (RegistryInstance registryApplication : actual) { - if (registryApplication.applicationCode().equals(application.applicationCode())) { - return registryApplication; - } - } - throw new RegistryInstanceOfApplicationNotFoundException(application.applicationCode()); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/OperationNameAssert.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/OperationNameAssert.java deleted file mode 100644 index cb2139192..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/OperationNameAssert.java +++ /dev/null @@ -1,62 +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.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.entity.RegistryOperationName; - -public class OperationNameAssert { - public static void assertEquals(List expected, List actual) { - if (expected == null) { - return; - } - - for (RegistryOperationName operationName : expected) { - RegistryOperationName actualOperationName = findActualRegistryOperationName(actual, operationName); - assertOperationEquals(actualOperationName.applicationCode(), operationName.operationName(), actualOperationName - .operationName()); - } - } - - private static void assertOperationEquals(String applicationCode, List expectedOperationName, - List actualOperationName) { - for (String operationName : expectedOperationName) { - if (!actualOperationName.contains(operationName)) { - throw new RegistryOperationNameNotFoundException(applicationCode, operationName); - } - } - } - - private static RegistryOperationName findActualRegistryOperationName(List actual, - RegistryOperationName registryOperationName) { - if (actual == null) { - throw new ActualRegistryOperationNameEmptyException(registryOperationName); - } - - for (RegistryOperationName operationName : actual) { - if (operationName.applicationCode().equals(registryOperationName.applicationCode())) { - return operationName; - } - } - - throw new RegistryOperationNamesOfApplicationNotFoundException(registryOperationName); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ParentSegmentIdExpressParser.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ParentSegmentIdExpressParser.java deleted file mode 100644 index d6a71cbbe..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/ParentSegmentIdExpressParser.java +++ /dev/null @@ -1,47 +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.agent.tool.validator.assertor; - -import java.util.List; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ParentSegmentNotFoundException; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.SegmentItem; - -public class ParentSegmentIdExpressParser { - public static String parse(String express, List actual) { - if (!express.trim().startsWith("${") && !express.trim().endsWith("}")) { - return express; - } - - String parentSegmentExpress = express.trim().substring(2, express.trim().length() - 1); - - int startIndexOfIndex = parentSegmentExpress.indexOf("["); - String applicationCode = 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.segments().size() <= expectedSize) { - throw new ParentSegmentNotFoundException(parentSegmentExpress); - } - - return segmentItem.segments().get(expectedSize).segmentId(); - } - } - return express; - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/RegistryItemsAssert.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/RegistryItemsAssert.java deleted file mode 100644 index 5c5e7912f..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/RegistryItemsAssert.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.RegistryItems; - -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"); - InstanceAssert.assertEquals(excepted.instances(), actual.instances()); - logger.info("{} assert successful.", "registry instances"); - OperationNameAssert.assertEquals(excepted.operationNames(), actual.operationNames()); - logger.info("{} assert successful.", "registry operation name"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentAssert.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentAssert.java deleted file mode 100644 index 1c50b589a..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentAssert.java +++ /dev/null @@ -1,224 +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.agent.tool.validator.assertor; - -import java.util.ArrayList; -import java.util.List; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ActualSegmentRefIsEmptyException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.KeyValueNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.LogEventKeyNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.LogEventSizeNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.LogEventValueNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.LogSizeNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.RefSizeNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SegmentNotFoundException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SegmentRefAssertFailedException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SegmentRefNotFoundException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SpanAssertFailedException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SpanSizeNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.TagKeyNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.TagSizeNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.TagValueNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.KeyValuePair; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.LogEvent; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Segment; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.SegmentItem; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.SegmentRef; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Span; -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class SegmentAssert { - public static void assertEquals(SegmentItem expected, SegmentItem actual) { - if (expected.segments() == null) { - return; - } - - for (Segment segment : expected.segments()) { - Segment actualSegment = findSegment(actual, segment); - segment.setSegmentId(actualSegment.segmentId()); - } - } - - private static Segment findSegment(SegmentItem actual, Segment expectedSegment) { - List exceptions = new ArrayList<>(); - for (Segment actualSegment : actual.segments()) { - try { - if (spansEquals(expectedSegment.spans(), actualSegment.spans())) { - return actualSegment; - } - } catch (SpanSizeNotEqualsException e) { - } catch (SpanAssertFailedException e) { - exceptions.add(new SegmentPredictionFailedCause(e, actualSegment)); - } - } - - throw new SegmentNotFoundException(expectedSegment, exceptions); - } - - private static boolean spansEquals(List excepted, List actual) { - if (excepted == null) { - return true; - } - - if (actual == null || excepted.size() != actual.size()) { - throw new SpanSizeNotEqualsException(excepted.size(), (actual != null) ? actual.size() : 0); - } - - int equalSpans = 0; - for (int index = 0; index < excepted.size(); index++, equalSpans++) { - Span exceptedSpan = excepted.get(index); - Span actualSpan = actual.get(index); - try { - spanEquals(exceptedSpan, actualSpan); - } catch (AssertFailedException e) { - throw new SpanAssertFailedException(e, exceptedSpan, actualSpan); - } - } - - return true; - } - - private static void spanEquals(Span excepted, Span actualSpan) { - ExpressParser.parse(excepted.operationName()).assertValue("operation name", actualSpan.operationName()); - ExpressParser.parse(excepted.componentId()).assertValue("component id", actualSpan.componentId()); - ExpressParser.parse(excepted.componentName()).assertValue("component name", actualSpan.componentName()); - ExpressParser.parse(excepted.startTime()).assertValue("start time", actualSpan.startTime()); - ExpressParser.parse(excepted.endTime()).assertValue("end time", actualSpan.endTime()); - ExpressParser.parse(excepted.parentSpanId()).assertValue("parent span id", actualSpan.parentSpanId()); - ExpressParser.parse(excepted.spanId()).assertValue("span id", actualSpan.spanId()); - ExpressParser.parse(excepted.operationId()).assertValue("operation id", actualSpan.operationId()); - ExpressParser.parse(excepted.peer()).assertValue("peer", actualSpan.peer()); - ExpressParser.parse(excepted.spanLayer()).assertValue("span layer", actualSpan.spanLayer()); - ExpressParser.parse(excepted.peerId()).assertValue("peer id", actualSpan.peerId()); - ExpressParser.parse(excepted.error()).assertValue("is error", actualSpan.error()); - ExpressParser.parse(excepted.spanType()).assertValue("span type", actualSpan.spanType()); - tagsEquals(excepted.tags(), actualSpan.tags()); - logsEquals(excepted.logs(), actualSpan.logs()); - refEquals(excepted.refs(), actualSpan.refs()); - excepted.setActualRefs(actualSpan.refs()); - - } - - private static void refEquals(List excepted, List actual) { - if (excepted == null) { - return; - } - - if (actual == null) { - throw new ActualSegmentRefIsEmptyException(excepted.size()); - } - - if (excepted.size() != actual.size()) { - throw new RefSizeNotEqualsException(excepted.size(), actual.size()); - } - - for (SegmentRef ref : excepted) { - findSegmentRef(actual, ref); - } - } - - private static void tagsEquals(List excepted, List actual) { - if (excepted.size() != actual.size()) { - throw new TagSizeNotEqualsException(excepted.size(), actual.size()); - } - - for (int index = 0; index < excepted.size(); index++) { - tagEquals(excepted.get(index), actual.get(index)); - } - } - - private static void logsEquals(List excepted, List actual) { - if (excepted.size() != actual.size()) { - throw new LogSizeNotEqualsException(excepted.size(), actual.size()); - } - - for (int index = 0; index < excepted.size(); index++) { - logEventEquals(excepted.get(index), actual.get(index)); - } - - } - - private static void logEventEquals(LogEvent exceptedEvent, LogEvent actualEvent) { - List exceptedKey = exceptedEvent.events(); - List actualKey = actualEvent.events(); - - if (exceptedKey.size() != actualKey.size()) { - throw new LogEventSizeNotEqualsException(exceptedKey.size(), actualKey.size()); - } - - for (int index = 0; index < exceptedKey.size(); index++) { - logEventPairEquals(exceptedKey.get(index), actualKey.get(index)); - } - } - - private static void keyValuePairEquals(KeyValuePair excepted, KeyValuePair actual) { - if (!excepted.key().equals(actual.key())) { - throw new KeyValueNotEqualsException(); - } - - ExpressParser.parse(excepted.value()).assertValue("", actual.value()); - } - - private static void logEventPairEquals(KeyValuePair excepted, KeyValuePair actual) { - try { - keyValuePairEquals(excepted, actual); - } catch (KeyValueNotEqualsException e) { - throw new LogEventKeyNotEqualsException(excepted.key(), actual.key()); - } catch (ValueAssertFailedException e) { - throw new LogEventValueNotEqualsException(excepted.key(), excepted.value(), actual.value()); - } - } - - private static void tagEquals(KeyValuePair excepted, KeyValuePair actual) { - try { - keyValuePairEquals(excepted, actual); - } catch (KeyValueNotEqualsException e) { - throw new TagKeyNotEqualsException(excepted.key(), actual.key()); - } catch (ValueAssertFailedException e) { - throw new TagValueNotEqualsException(excepted.key(), excepted.value(), actual.value()); - } - } - - private static SegmentRef findSegmentRef(List actual, SegmentRef expected) { - List causes = new ArrayList<>(); - for (SegmentRef segmentRef : actual) { - try { - if (simpleSegmentRefEquals(expected, segmentRef)) { - return segmentRef; - } - } catch (SegmentRefAssertFailedException e) { - causes.add(new SegmentRefAssertFailedCause(e, segmentRef)); - } - } - throw new SegmentRefNotFoundException(expected, causes); - } - - private static boolean simpleSegmentRefEquals(SegmentRef expected, SegmentRef actual) { - try { - ExpressParser.parse(expected.entryEndpointName()) - .assertValue("entry service name", actual.entryEndpointName()); - ExpressParser.parse(expected.parentEndpointName()) - .assertValue("parent service name", actual.parentEndpointName()); - ExpressParser.parse(expected.refType()).assertValue("ref type", actual.refType()); - return true; - } catch (ValueAssertFailedException e) { - throw new SegmentRefAssertFailedException(e, expected, actual); - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentItemsAssert.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentItemsAssert.java deleted file mode 100644 index 2a32b3e78..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentItemsAssert.java +++ /dev/null @@ -1,102 +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.agent.tool.validator.assertor; - -import java.util.List; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ActualSegmentItemEmptyException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SegmentItemNotFoundException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SegmentSizeNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Segment; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.SegmentItem; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.SegmentRef; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Span; - -public class SegmentItemsAssert { - private static Logger logger = LogManager.getLogger(SegmentItemsAssert.class); - - public static void assertEquals(List expected, List actual) { - if (expected == null) { - logger.info("ignore segment items. because expected segment item is null."); - return; - } - - for (SegmentItem item : expected) { - SegmentItem actualSegmentItem = findSegmentItem(actual, item); - try { - assertSegmentSize(item.segmentSize(), actualSegmentItem.segmentSize()); - } catch (ValueAssertFailedException e) { - throw new SegmentSizeNotEqualsException(item.applicationCode(), item.segmentSize(), actualSegmentItem.segmentSize()); - } - SegmentAssert.assertEquals(item, actualSegmentItem); - } - - for (SegmentItem item : expected) { - if (item.segments() == null) { - continue; - } - - for (Segment segment : item.segments()) { - convertParentSegmentId(segment, expected); - - for (Span span : segment.spans()) { - if (span.refs() == null || span.refs().size() == 0) { - continue; - } - SegmentRefAssert.assertEquals(span.refs(), span.actualRefs()); - } - } - } - } - - private static void convertParentSegmentId(Segment segment, List actual) { - for (Span span : segment.spans()) { - if (span.refs() == null || span.refs().size() == 0) { - continue; - } - - for (SegmentRef ref : span.refs()) { - String actualParentSegmentId = ParentSegmentIdExpressParser.parse(ref.parentTraceSegmentId(), actual); - ref.parentTraceSegmentId(actualParentSegmentId); - } - } - } - - private static void assertSegmentSize(String expected, String actual) { - if (expected == null) { - return; - } - ExpressParser.parse(expected).assertValue("segment size", actual); - } - - private static SegmentItem findSegmentItem(List actual, SegmentItem expected) { - if (actual == null) { - throw new ActualSegmentItemEmptyException(expected); - } - - for (SegmentItem segmentItem : actual) { - if (expected.applicationCode().equals(segmentItem.applicationCode())) { - return segmentItem; - } - } - - throw new SegmentItemNotFoundException(expected.applicationCode()); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentPredictionFailedCause.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentPredictionFailedCause.java deleted file mode 100644 index 9fa3efde8..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentPredictionFailedCause.java +++ /dev/null @@ -1,39 +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.agent.tool.validator.assertor; - -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SpanAssertFailedException; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Segment; - -public class SegmentPredictionFailedCause { - private final Segment actualSegment; - private final SpanAssertFailedException spanAssertFailedCause; - - public SegmentPredictionFailedCause(SpanAssertFailedException spanAssertFailedCause, Segment actualSegment) { - this.spanAssertFailedCause = spanAssertFailedCause; - this.actualSegment = actualSegment; - } - - public Segment getActualSegment() { - return actualSegment; - } - - public SpanAssertFailedException getSpanAssertFailedCause() { - return spanAssertFailedCause; - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssert.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssert.java deleted file mode 100644 index 7e6b2d6f6..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssert.java +++ /dev/null @@ -1,83 +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.agent.tool.validator.assertor; - -import java.util.ArrayList; -import java.util.List; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SegmentRefAssertFailedException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SegmentRefNotFoundException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SegmentRefSizeNotEqualsException; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.SegmentRef; - -public class SegmentRefAssert { - - public static void assertEquals(List excepted, List actual) { - if (excepted == null) { - return; - } - - if (actual == null || excepted.size() != actual.size()) { - throw new SegmentRefSizeNotEqualsException(excepted.size(), actual.size()); - } - - for (SegmentRef ref : excepted) { - findSegmentRef(actual, ref); - } - } - - private static SegmentRef findSegmentRef(List actual, SegmentRef expected) { - List causes = new ArrayList<>(); - for (SegmentRef segmentRef : actual) { - try { - if (segmentRefEquals(expected, segmentRef)) { - return segmentRef; - } - } catch (SegmentRefAssertFailedException e) { - causes.add(new SegmentRefAssertFailedCause(e, segmentRef)); - } - } - throw new SegmentRefNotFoundException(expected, causes); - } - - private static boolean segmentRefEquals(SegmentRef expected, SegmentRef actual) { - try { - ExpressParser.parse(expected.entryEndpointName()) - .assertValue("entry endpoint name", actual.entryEndpointName()); - ExpressParser.parse(expected.networkAddress()).assertValue("network address", actual.networkAddress()); - ExpressParser.parse(expected.parentTraceSegmentId()) - .assertValue("parent segment id", actual.parentTraceSegmentId()); - ExpressParser.parse(expected.parentSpanId()).assertValue("span id", actual.parentSpanId()); - ExpressParser.parse(expected.entryEndpointId()).assertValue("entry endpoint id", actual.entryEndpointId()); - ExpressParser.parse(expected.networkAddressId()) - .assertValue("network address id", actual.networkAddressId()); - ExpressParser.parse(expected.parentServiceInstanceId()) - .assertValue("parent application 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()); - return true; - } catch (ValueAssertFailedException e) { - throw new SegmentRefAssertFailedException(e, expected, actual); - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssertFailedCause.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssertFailedCause.java deleted file mode 100644 index 571a4c834..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/SegmentRefAssertFailedCause.java +++ /dev/null @@ -1,39 +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.agent.tool.validator.assertor; - -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.SegmentRefAssertFailedException; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.SegmentRef; - -public class SegmentRefAssertFailedCause { - private final SegmentRefAssertFailedException failedCause; - private final SegmentRef actual; - - public SegmentRefAssertFailedCause(SegmentRefAssertFailedException failedCause, SegmentRef actual) { - this.failedCause = failedCause; - this.actual = actual; - } - - public SegmentRefAssertFailedException getFailedCause() { - return failedCause; - } - - public SegmentRef getActual() { - return actual; - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/ElementAssertor.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/ElementAssertor.java deleted file mode 100644 index 452fe8f1f..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/ElementAssertor.java +++ /dev/null @@ -1,31 +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.agent.tool.validator.assertor.element; - -public abstract class ElementAssertor { - - public ElementAssertor(String exceptedValue) { - if (exceptedValue != null) { - this.exceptedValue = exceptedValue.trim(); - } - } - - protected String exceptedValue; - - public abstract void assertValue(String desc, String actualValue); -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/EqualsAssertor.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/EqualsAssertor.java deleted file mode 100644 index c7cd56816..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/EqualsAssertor.java +++ /dev/null @@ -1,34 +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.agent.tool.validator.assertor.element; - -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException; - -public class EqualsAssertor extends ElementAssertor { - - public EqualsAssertor(String exceptedValue) { - super(exceptedValue); - } - - @Override - public void assertValue(String desc, String actualValue) { - if (!exceptedValue.equals(actualValue)) { - throw new ValueAssertFailedException(desc, exceptedValue, actualValue); - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/GreatThanAssertor.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/GreatThanAssertor.java deleted file mode 100644 index ca2fecde3..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/GreatThanAssertor.java +++ /dev/null @@ -1,34 +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.agent.tool.validator.assertor.element; - -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException; - -public class GreatThanAssertor extends ElementAssertor { - - public GreatThanAssertor(String exceptedValue) { - super(exceptedValue); - } - - @Override - public void assertValue(String desc, String actualValue) { - if (Long.parseLong(actualValue) <= Long.parseLong(exceptedValue)) { - throw new ValueAssertFailedException(desc, " gt " + exceptedValue, actualValue); - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/GreetEqualAssertor.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/GreetEqualAssertor.java deleted file mode 100644 index 8c97fd62b..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/GreetEqualAssertor.java +++ /dev/null @@ -1,34 +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.agent.tool.validator.assertor.element; - -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException; - -public class GreetEqualAssertor extends ElementAssertor { - public GreetEqualAssertor(String exceptedValue) { - super(exceptedValue); - } - - @Override - public void assertValue(String desc, String actualValue) { - if (Long.parseLong(actualValue) < Long.parseLong(exceptedValue)) { - throw new ValueAssertFailedException(desc, " ge " + exceptedValue, actualValue); - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NoopAssertor.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NoopAssertor.java deleted file mode 100644 index bcec8f68f..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NoopAssertor.java +++ /dev/null @@ -1,29 +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.agent.tool.validator.assertor.element; - -public class NoopAssertor extends ElementAssertor { - public NoopAssertor() { - super(null); - } - - @Override - public void assertValue(String desc, String actualValue) { - - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NotEqualsAssertor.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NotEqualsAssertor.java deleted file mode 100644 index 9f85d76ed..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NotEqualsAssertor.java +++ /dev/null @@ -1,34 +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.agent.tool.validator.assertor.element; - -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException; - -public class NotEqualsAssertor extends ElementAssertor { - - public NotEqualsAssertor(String exceptedValue) { - super(exceptedValue); - } - - @Override - public void assertValue(String desc, String actualValue) { - if (exceptedValue.equals(actualValue.trim())) { - throw new ValueAssertFailedException(desc, " not eq " + exceptedValue, actualValue); - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NotNullAssertor.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NotNullAssertor.java deleted file mode 100644 index dcc5f2d1d..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NotNullAssertor.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.agent.tool.validator.assertor.element; - -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException; - -public class NotNullAssertor extends ElementAssertor { - public NotNullAssertor() { - super(null); - } - - @Override - public void assertValue(String desc, String actualValue) { - if (actualValue == null) { - throw new ValueAssertFailedException(desc, "not null", actualValue); - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NullAssertor.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NullAssertor.java deleted file mode 100644 index b30c3fa9e..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/element/NullAssertor.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.agent.tool.validator.assertor.element; - -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.exception.ValueAssertFailedException; - -public class NullAssertor extends ElementAssertor { - public NullAssertor() { - super(null); - } - - @Override - public void assertValue(String desc, String actualValue) { - if (actualValue != null && actualValue.length() > 0) { - throw new ValueAssertFailedException(desc, "null", actualValue); - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualRegistryOperationNameEmptyException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualRegistryOperationNameEmptyException.java deleted file mode 100644 index 6600b6322..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualRegistryOperationNameEmptyException.java +++ /dev/null @@ -1,36 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.RegistryOperationName; -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class ActualRegistryOperationNameEmptyException extends AssertFailedException { - - private final RegistryOperationName registryOperationName; - - public ActualRegistryOperationNameEmptyException(RegistryOperationName registryOperationName) { - this.registryOperationName = registryOperationName; - } - - @Override - public String getCauseMessage() { - return String.format("ActualRegistryOperationNameEmptyException\nexpected:%s\nactual:%s\n", registryOperationName - .operationName(), "Empty"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualSegmentItemEmptyException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualSegmentItemEmptyException.java deleted file mode 100644 index 4ce4c53ab..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualSegmentItemEmptyException.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.SegmentItem; -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class ActualSegmentItemEmptyException extends AssertFailedException { - - private final SegmentItem expected; - - public ActualSegmentItemEmptyException(SegmentItem expected) { - this.expected = expected; - } - - @Override - public String getCauseMessage() { - return String.format("ActualSegmentItemEmptyException\nexpected: %s\nactual: %s", expected, "Empty"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualSegmentRefIsEmptyException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualSegmentRefIsEmptyException.java deleted file mode 100644 index 23a55667b..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ActualSegmentRefIsEmptyException.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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class ActualSegmentRefIsEmptyException extends AssertFailedException { - private final int expectedSize; - - public ActualSegmentRefIsEmptyException(int expectedSize) { - this.expectedSize = expectedSize; - } - - @Override - public String getCauseMessage() { - return String.format("ActualSegmentRefIsEmptyException\nexpected: %d\nactual: %s\n", expectedSize, "Not found"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/KeyValueNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/KeyValueNotEqualsException.java deleted file mode 100644 index e3eb65f2c..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/KeyValueNotEqualsException.java +++ /dev/null @@ -1,21 +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.agent.tool.validator.assertor.exception; - -public class KeyValueNotEqualsException extends RuntimeException { -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventKeyNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventKeyNotEqualsException.java deleted file mode 100644 index c649c9674..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventKeyNotEqualsException.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class LogEventKeyNotEqualsException extends AssertFailedException { - private final String expected; - private final String actual; - - public LogEventKeyNotEqualsException(String expected, String actual) { - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return String.format("[log event key]: expected=>{%s}, actual=>{%s}\n", expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventSizeNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventSizeNotEqualsException.java deleted file mode 100644 index e79bb8938..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventSizeNotEqualsException.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class LogEventSizeNotEqualsException extends AssertFailedException { - private final int expected; - private final int actual; - - public LogEventSizeNotEqualsException(int expected, int actual) { - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return String.format("[log event size]: expected=>{%d}, actual=>{%d}\n", expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventValueNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventValueNotEqualsException.java deleted file mode 100644 index 407b27cb9..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogEventValueNotEqualsException.java +++ /dev/null @@ -1,37 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class LogEventValueNotEqualsException extends AssertFailedException { - private final String eventKey; - private final String expected; - private final String actual; - - public LogEventValueNotEqualsException(String eventKey, String expected, String actual) { - this.eventKey = eventKey; - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return String.format("[log(%s} value]: expected=>{%s}, actual=>{%s}\n", eventKey, expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogSizeNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogSizeNotEqualsException.java deleted file mode 100644 index 73f15734a..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/LogSizeNotEqualsException.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class LogSizeNotEqualsException extends AssertFailedException { - private final int expected; - private final int actual; - - public LogSizeNotEqualsException(int expected, int actual) { - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return String.format("[log size]: expected=>{%d}, actual=>{%d}", expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ParentSegmentNotFoundException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ParentSegmentNotFoundException.java deleted file mode 100644 index dc59c1319..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ParentSegmentNotFoundException.java +++ /dev/null @@ -1,34 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class ParentSegmentNotFoundException extends AssertFailedException { - - private final String express; - - public ParentSegmentNotFoundException(String express) { - this.express = express; - } - - @Override - public String getCauseMessage() { - return String.format("ParentSegmentNotFoundException\nexpected: %s\nactual: %s\n", express, "NOT FOUND"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RefSizeNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RefSizeNotEqualsException.java deleted file mode 100644 index c7a2c7b3d..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RefSizeNotEqualsException.java +++ /dev/null @@ -1,36 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class RefSizeNotEqualsException extends AssertFailedException { - - private final int expected; - private final int actual; - - public RefSizeNotEqualsException(int expected, int actual) { - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return String.format("[segment ref size]: expected=>{%s}, actual=>{%s}", expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationNotFoundException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationNotFoundException.java deleted file mode 100644 index 449207ccc..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationNotFoundException.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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class RegistryApplicationNotFoundException extends AssertFailedException { - private final String applicationCode; - - public RegistryApplicationNotFoundException(String applicationCode) { - this.applicationCode = applicationCode; - } - - @Override - public String getCauseMessage() { - return String.format("RegistryApplicationNotFoundException\nexpected: %s\nactual: %s\n", applicationCode, "Not Found"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationSizeNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationSizeNotEqualsException.java deleted file mode 100644 index b6e17eef0..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryApplicationSizeNotEqualsException.java +++ /dev/null @@ -1,36 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class RegistryApplicationSizeNotEqualsException extends AssertFailedException { - private final String applicationCode; - private final ValueAssertFailedException cause; - - public RegistryApplicationSizeNotEqualsException(String applicationCode, ValueAssertFailedException cause) { - this.applicationCode = applicationCode; - this.cause = cause; - } - - @Override - public String getCauseMessage() { - return String.format("RegistryApplicationSizeNotEqualsException: %s\nexpected: %s\nactual: %s\n", applicationCode, cause - .getExpected(), cause.getActual()); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceOfApplicationNotFoundException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceOfApplicationNotFoundException.java deleted file mode 100644 index ba41bd164..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceOfApplicationNotFoundException.java +++ /dev/null @@ -1,34 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class RegistryInstanceOfApplicationNotFoundException extends AssertFailedException { - - private final String applicationCode; - - public RegistryInstanceOfApplicationNotFoundException(String applicationCode) { - this.applicationCode = applicationCode; - } - - @Override - public String getCauseMessage() { - return String.format("RegistryInstanceOfApplicationNotFoundException\nexpected: Instances of Service(%s)" + "\nactual: %s\n", applicationCode, "NOT FOUND"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceSizeNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceSizeNotEqualsException.java deleted file mode 100644 index 283e72a3f..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryInstanceSizeNotEqualsException.java +++ /dev/null @@ -1,37 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class RegistryInstanceSizeNotEqualsException extends AssertFailedException { - - private final String applicationCode; - private final ValueAssertFailedException cause; - - public RegistryInstanceSizeNotEqualsException(String applicationCode, ValueAssertFailedException cause) { - this.applicationCode = applicationCode; - this.cause = cause; - } - - @Override - public String getCauseMessage() { - return String.format("RegistryInstanceSizeNotEqualsException %s\nexpected: %s\nactual: %s\n", applicationCode, cause - .getExpected(), cause.getActual()); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNameNotFoundException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNameNotFoundException.java deleted file mode 100644 index 1cf2ec7a7..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNameNotFoundException.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class RegistryOperationNameNotFoundException extends AssertFailedException { - private final String applicationCode; - private final String operationName; - - public RegistryOperationNameNotFoundException(String applicationCode, String operationName) { - this.applicationCode = applicationCode; - this.operationName = operationName; - } - - @Override - public String getCauseMessage() { - return String.format("RegistryOperationNameNotFoundException %s\nexpected: %s\nactual: %s\n", applicationCode, operationName, "NOT FOUND"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNamesOfApplicationNotFoundException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNamesOfApplicationNotFoundException.java deleted file mode 100644 index 98f6c8286..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/RegistryOperationNamesOfApplicationNotFoundException.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor.exception; - -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 RegistryOperationNamesOfApplicationNotFoundException(RegistryOperationName applicationCode) { - this.applicationCode = applicationCode; - } - - @Override - public String getCauseMessage() { - return String.format("RegistryOperationNamesOfApplicationNotFoundException %s\nexpected: %s\nactual: %s\n", applicationCode - .applicationCode(), applicationCode.operationName(), "NOT FOUND"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentItemNotFoundException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentItemNotFoundException.java deleted file mode 100644 index 038fd41d5..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentItemNotFoundException.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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class SegmentItemNotFoundException extends AssertFailedException { - private final String applicationCode; - - public SegmentItemNotFoundException(String applicationCode) { - this.applicationCode = applicationCode; - } - - @Override - public String getCauseMessage() { - return String.format("SegmentItemNotFoundException\nexpected: %s\nactual: %s", applicationCode, "Not Found"); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentNotFoundException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentNotFoundException.java deleted file mode 100644 index 28ba9db23..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentNotFoundException.java +++ /dev/null @@ -1,56 +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.agent.tool.validator.assertor.exception; - -import java.util.List; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.SegmentPredictionFailedCause; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Segment; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Span; -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class SegmentNotFoundException extends AssertFailedException { - private final Segment expectedSegment; - private final List failedCauses; - - public SegmentNotFoundException(Segment expectedSegment, List failedCauses) { - this.expectedSegment = expectedSegment; - this.failedCauses = failedCauses; - } - - @Override - 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())); - } - - StringBuilder causeMessage = new StringBuilder(); - for (SegmentPredictionFailedCause cause : failedCauses) { - Segment actualSegment = cause.getActualSegment(); - 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())); - } - - return String.format("SegmentNotFoundException:\nexpected: %s\nactual: %s\n", expectedMessage, causeMessage); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefAssertFailedException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefAssertFailedException.java deleted file mode 100644 index f61619043..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefAssertFailedException.java +++ /dev/null @@ -1,38 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.SegmentRef; -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class SegmentRefAssertFailedException extends AssertFailedException { - private final ValueAssertFailedException e; - private final SegmentRef expected; - private final SegmentRef actual; - - public SegmentRefAssertFailedException(ValueAssertFailedException e, SegmentRef expected, SegmentRef actual) { - this.e = e; - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return e.getCauseMessage(); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefNotFoundException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefNotFoundException.java deleted file mode 100644 index 49f4e1f0c..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefNotFoundException.java +++ /dev/null @@ -1,56 +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.agent.tool.validator.assertor.exception; - -import java.util.List; -import org.apache.skywalking.plugin.test.agent.tool.validator.assertor.SegmentRefAssertFailedCause; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.SegmentRef; -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class SegmentRefNotFoundException extends AssertFailedException { - private final SegmentRef expected; - private final List causes; - - public SegmentRefNotFoundException(SegmentRef expected, List causes) { - this.expected = expected; - this.causes = causes; - } - - @Override - public String getCauseMessage() { - - StringBuilder actualMessage = new StringBuilder(); - for (SegmentRefAssertFailedCause cause : causes) { - SegmentRef actual = cause.getActual(); - String reason = cause.getFailedCause().getCauseMessage(); - - StringBuilder actualSegmentRef = new StringBuilder(String.format("\nSegmentRef:\t%s\n", reason)); - actualSegmentRef.append(String.format(" - entryServiceName:\t\t%s\n", actual.entryEndpointName())) - .append(String.format(" - networkAddress:\t\t\t%s\n", actual.networkAddress())) - .append(String.format(" - parentServiceName:\t\t%s\n", actual.parentEndpointName())) - .append(String.format(" - parentSpanId:\t\t\t%s\n", actual.parentSpanId())) - .append(String.format(" - parentTraceSegmentId:\t%s\n", actual.parentTraceSegmentId())) - .append(String.format(" - refType:\t\t\t\t\t%s", actual.refType())) - .toString(); - - actualMessage.append(String.format("%s\n", actualSegmentRef)); - } - - return String.format("SegmentRefNotFoundException\nexpected: %s\nactual: %s\n", expected, actualMessage); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefSizeNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefSizeNotEqualsException.java deleted file mode 100644 index fa57496ed..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentRefSizeNotEqualsException.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class SegmentRefSizeNotEqualsException extends AssertFailedException { - private final int expected; - private final int actual; - - public SegmentRefSizeNotEqualsException(int expected, int actual) { - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return String.format("SegmentRefSizeNotEqualsException\nexpected:\t%s\nactual:\t%s\n", expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentSizeNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentSizeNotEqualsException.java deleted file mode 100644 index 6ec8e56f2..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SegmentSizeNotEqualsException.java +++ /dev/null @@ -1,37 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class SegmentSizeNotEqualsException extends AssertFailedException { - private final String applicationCode; - private final String expected; - private final String actual; - - public SegmentSizeNotEqualsException(String applicationCode, String expected, String actual) { - this.applicationCode = applicationCode; - 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); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SpanAssertFailedException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SpanAssertFailedException.java deleted file mode 100644 index e5ae43744..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SpanAssertFailedException.java +++ /dev/null @@ -1,46 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Span; -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class SpanAssertFailedException extends AssertFailedException { - private final AssertFailedException failedCause; - private final Span exceptedSpan; - private final Span actualSpan; - - public SpanAssertFailedException(AssertFailedException failedCause, Span exceptedSpan, Span actualSpan) { - this.failedCause = failedCause; - this.exceptedSpan = exceptedSpan; - this.actualSpan = actualSpan; - } - - public Span getExceptedSpan() { - return exceptedSpan; - } - - public Span getActualSpan() { - return actualSpan; - } - - @Override - public String getCauseMessage() { - return failedCause.getCauseMessage(); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SpanSizeNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SpanSizeNotEqualsException.java deleted file mode 100644 index 702ab4581..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/SpanSizeNotEqualsException.java +++ /dev/null @@ -1,36 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class SpanSizeNotEqualsException extends AssertFailedException { - - private final int expected; - private final int actual; - - public SpanSizeNotEqualsException(int expected, int actual) { - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return String.format("[span size]: expected=>{%s}, actual=>{%s}\n", expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagKeyNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagKeyNotEqualsException.java deleted file mode 100644 index 8eef92dd1..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagKeyNotEqualsException.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class TagKeyNotEqualsException extends AssertFailedException { - private final String expected; - private final String actual; - - public TagKeyNotEqualsException(String expected, String actual) { - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return String.format("[tag key]: expected=>{%s}, actual=>{%s}\n", expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagSizeNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagSizeNotEqualsException.java deleted file mode 100644 index b09e6bf04..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagSizeNotEqualsException.java +++ /dev/null @@ -1,35 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class TagSizeNotEqualsException extends AssertFailedException { - private final int expected; - private final int actual; - - public TagSizeNotEqualsException(int expected, int actual) { - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return String.format("[tag size]: expected=>{%s}, actual=>{%s}\n", expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagValueNotEqualsException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagValueNotEqualsException.java deleted file mode 100644 index 6c8d41fff..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/TagValueNotEqualsException.java +++ /dev/null @@ -1,37 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class TagValueNotEqualsException extends AssertFailedException { - private final String tagKey; - private final String expected; - private final String actual; - - public TagValueNotEqualsException(String tagKey, String expected, String actual) { - this.tagKey = tagKey; - this.expected = expected; - this.actual = actual; - } - - @Override - public String getCauseMessage() { - return String.format("[tag(%s) value]: expected=>{}, actual=>{%s}\n", tagKey, expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ValueAssertFailedException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ValueAssertFailedException.java deleted file mode 100644 index 7f7d1203a..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/exception/ValueAssertFailedException.java +++ /dev/null @@ -1,49 +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.agent.tool.validator.assertor.exception; - -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; - -public class ValueAssertFailedException extends AssertFailedException { - private final String desc; - private final String expected; - private final String actual; - - public ValueAssertFailedException(String desc, String expected, String actual) { - this.desc = desc; - this.expected = expected; - this.actual = actual; - } - - public String getDesc() { - return desc; - } - - public String getExpected() { - return expected; - } - - public String getActual() { - return actual; - } - - @Override - public String getCauseMessage() { - return String.format("[%s]: expected=>{%s}, actual=>{%s}", desc, expected, actual); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Data.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Data.java deleted file mode 100644 index c43f71ad0..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Data.java +++ /dev/null @@ -1,60 +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.agent.tool.validator.entity; - -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.util.List; -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.IllegalDataFileException; -import org.yaml.snakeyaml.TypeDescription; -import org.yaml.snakeyaml.Yaml; -import org.yaml.snakeyaml.constructor.Constructor; -import org.yaml.snakeyaml.representer.Representer; - -public interface Data { - RegistryItems registryItems(); - - List segmentItems(); - - class Loader { - public static Data loadData(String fileName, File file) { - try { - return loadData(new FileInputStream(file)); - } catch (Exception e) { - throw new IllegalDataFileException(fileName); - } - } - - public static Data loadData(InputStream inputStream) { - Constructor constructor = new Constructor(DataForRead.class); - TypeDescription configDescription = new TypeDescription(DataForRead.class); - configDescription.putListPropertyType("data", DataForRead.class); - - Representer representer = new Representer(); - representer.getPropertyUtils().setSkipMissingProperties(true); - Yaml yaml = new Yaml(constructor, representer); - Data result = yaml.loadAs(inputStream, DataForRead.class); - if (result == null) { - throw new RuntimeException(); - } else { - return result; - } - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/DataForRead.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/DataForRead.java deleted file mode 100644 index b2352796e..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/DataForRead.java +++ /dev/null @@ -1,57 +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.agent.tool.validator.entity; - -import java.util.ArrayList; -import java.util.List; - -public class DataForRead implements Data { - private RegistryItemsForRead registryItems; - private List segmentItems; - - public void setRegistryItems(RegistryItemsForRead registryItems) { - this.registryItems = registryItems; - } - - public RegistryItemsForRead getRegistryItems() { - return registryItems; - } - - public List getSegmentItems() { - return segmentItems; - } - - public void setSegmentItems(List segmentItems) { - this.segmentItems = segmentItems; - } - - @Override - public RegistryItemsForRead registryItems() { - return registryItems; - } - - @Override - public List segmentItems() { - if (this.segmentItems == null) { - return null; - } - - return new ArrayList<>(this.segmentItems); - } - -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/KeyValuePair.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/KeyValuePair.java deleted file mode 100644 index 8032baafc..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/KeyValuePair.java +++ /dev/null @@ -1,44 +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.agent.tool.validator.entity; - -public interface KeyValuePair { - String key(); - - String value(); - - class Impl implements KeyValuePair { - private String key; - private String value; - - public Impl(String key, String value) { - this.key = key; - this.value = value; - } - - @Override - public String key() { - return key; - } - - @Override - public String value() { - return value; - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/LogEvent.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/LogEvent.java deleted file mode 100644 index f4158f769..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/LogEvent.java +++ /dev/null @@ -1,42 +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.agent.tool.validator.entity; - -import java.util.ArrayList; -import java.util.List; - -public interface LogEvent { - List events(); - - class Impl implements LogEvent { - private List keyValuePairs; - - Impl() { - keyValuePairs = new ArrayList<>(); - } - - void add(String key, String value) { - keyValuePairs.add(new KeyValuePair.Impl(key, value)); - } - - @Override - public List events() { - return keyValuePairs; - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryApplication.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryApplication.java deleted file mode 100644 index 760fa7089..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryApplication.java +++ /dev/null @@ -1,44 +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.agent.tool.validator.entity; - -public interface RegistryApplication { - String applicationCode(); - - String expressValue(); - - class Impl implements RegistryApplication { - private String applicationCode; - private String express; - - Impl(String code, String express) { - this.applicationCode = code; - this.express = express; - } - - @Override - public String applicationCode() { - return applicationCode; - } - - @Override - public String expressValue() { - return express; - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryInstance.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryInstance.java deleted file mode 100644 index 766fdf0c1..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryInstance.java +++ /dev/null @@ -1,46 +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.agent.tool.validator.entity; - -public interface RegistryInstance { - - String applicationCode(); - - String expressValue(); - - class Impl implements RegistryInstance { - - private final String code; - private final String express; - - Impl(String code, String express) { - this.code = code; - this.express = express; - } - - @Override - public String applicationCode() { - return code; - } - - @Override - public String expressValue() { - return express; - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItems.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItems.java deleted file mode 100644 index 279f41a38..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItems.java +++ /dev/null @@ -1,28 +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.agent.tool.validator.entity; - -import java.util.List; - -public interface RegistryItems { - List applications(); - - List instances(); - - List operationNames(); -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItemsForRead.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItemsForRead.java deleted file mode 100644 index ccc906dde..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryItemsForRead.java +++ /dev/null @@ -1,97 +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.agent.tool.validator.entity; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class RegistryItemsForRead implements RegistryItems { - private List> applications; - private List> instances; - private List>> operationNames; - - public List> getApplications() { - return applications; - } - - public void setApplications(List> applications) { - this.applications = applications; - } - - public List> getInstances() { - return instances; - } - - public void setInstances(List> instances) { - this.instances = instances; - } - - public List>> getOperationNames() { - return operationNames; - } - - public void setOperationNames(List>> operationNames) { - this.operationNames = operationNames; - } - - @Override - public List applications() { - if (this.applications == null) { - return null; - } - - List registryApplications = new ArrayList<>(); - for (Map registryApplication : applications) { - String applicationCode = new ArrayList(registryApplication.keySet()).get(0); - String express = String.valueOf(registryApplication.get(applicationCode)); - registryApplications.add(new RegistryApplication.Impl(applicationCode, express)); - } - return registryApplications; - } - - @Override - public List instances() { - if (this.instances == null) { - return null; - } - - List registryInstances = new ArrayList<>(); - instances.forEach((registryInstance) -> { - String applicationCode = new ArrayList(registryInstance.keySet()).get(0); - String express = String.valueOf(registryInstance.get(applicationCode)); - registryInstances.add(new RegistryInstance.Impl(applicationCode, express)); - }); - return registryInstances; - } - - @Override - public List operationNames() { - if (this.operationNames == null) { - return null; - } - - List registryOperationNames = new ArrayList<>(); - operationNames.forEach((registryInstance) -> { - String applicationCode = new ArrayList(registryInstance.keySet()).get(0); - List express = registryInstance.get(applicationCode); - registryOperationNames.add(new RegistryOperationName.Impl(applicationCode, express)); - }); - return registryOperationNames; - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryOperationName.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryOperationName.java deleted file mode 100644 index 3f0955794..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/RegistryOperationName.java +++ /dev/null @@ -1,46 +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.agent.tool.validator.entity; - -import java.util.List; - -public interface RegistryOperationName { - String applicationCode(); - - List operationName(); - - class Impl implements RegistryOperationName { - private final String code; - private final List express; - - Impl(String code, List express) { - this.code = code; - this.express = express; - } - - @Override - public String applicationCode() { - return code; - } - - @Override - public List operationName() { - return express; - } - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Segment.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Segment.java deleted file mode 100644 index 6f42e22a2..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Segment.java +++ /dev/null @@ -1,28 +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.agent.tool.validator.entity; - -import java.util.List; - -public interface Segment { - String segmentId(); - - List spans(); - - void setSegmentId(String segmentId); -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentForRead.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentForRead.java deleted file mode 100644 index 3fb768158..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentForRead.java +++ /dev/null @@ -1,420 +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.agent.tool.validator.entity; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class SegmentForRead implements Segment { - private String segmentId; - private List spans; - - @Override - public String segmentId() { - return segmentId; - } - - @Override - public List spans() { - if (spans == null) { - return null; - } - return new ArrayList<>(spans); - } - - public static class SegmentRefForRead implements SegmentRef { - private String parentEndpointId; - private String parentEndpoint; - private String networkAddressId; - private String entryEndpointId; - private String refType; - private String parentSpanId; - private String parentTraceSegmentId; - private String parentServiceInstanceId; - private String networkAddress; - private String entryEndpoint; - private String entryServiceInstanceId; - - public SegmentRefForRead() { - } - - public SegmentRefForRead(Map ref) { - this.networkAddress = ref.get("networkAddress").toString(); - this.entryEndpoint = ref.get("entryEndpoint").toString(); - this.parentEndpoint = ref.get("parentEndpoint").toString(); - this.parentTraceSegmentId = ref.get("parentTraceSegmentId").toString(); - this.entryServiceInstanceId = ref.get("entryServiceInstanceId").toString(); - this.refType = ref.get("refType") == null ? null : ref.get("refType").toString(); - this.parentSpanId = ref.get("parentSpanId") == null ? null : ref.get("parentSpanId").toString(); - 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") - .toString(); - } - - public void setParentEndpointId(String parentEndpointId) { - this.parentEndpointId = parentEndpointId; - } - - public void setParentEndpoint(String parentEndpoint) { - this.parentEndpoint = parentEndpoint; - } - - public void setNetworkAddressId(String networkAddressId) { - this.networkAddressId = networkAddressId; - } - - public void setEntryEndpointId(String entryEndpointId) { - this.entryEndpointId = entryEndpointId; - } - - public void setRefType(String refType) { - this.refType = refType; - } - - public void setParentSpanId(String parentSpanId) { - this.parentSpanId = parentSpanId; - } - - public void setParentTraceSegmentId(String parentTraceSegmentId) { - this.parentTraceSegmentId = parentTraceSegmentId; - } - - public void setParentServiceInstanceId(String parentServiceInstanceId) { - this.parentServiceInstanceId = parentServiceInstanceId; - } - - public void setNetworkAddress(String networkAddress) { - this.networkAddress = networkAddress; - } - - public void setEntryEndpoint(String entryEndpoint) { - this.entryEndpoint = entryEndpoint; - } - - public void setEntryServiceInstanceId(String entryServiceInstanceId) { - this.entryServiceInstanceId = entryServiceInstanceId; - } - - @Override - public String parentEndpointId() { - return parentEndpointId; - } - - @Override - public String parentEndpointName() { - return parentEndpoint; - } - - @Override - public String networkAddressId() { - return networkAddressId; - } - - @Override - public String entryEndpointId() { - return entryEndpointId; - } - - @Override - public String refType() { - return refType; - } - - @Override - public String parentSpanId() { - return parentSpanId; - } - - @Override - public String parentTraceSegmentId() { - return parentTraceSegmentId; - } - - @Override - public String parentServiceInstanceId() { - return parentServiceInstanceId; - } - - @Override - public String networkAddress() { - return networkAddress; - } - - @Override - public String entryEndpointName() { - return entryEndpoint; - } - - @Override - public void parentTraceSegmentId(String parentTraceSegmentId) { - this.parentTraceSegmentId = parentTraceSegmentId; - } - - @Override - public String entryServiceInstanceId() { - return entryServiceInstanceId; - } - - @Override - public String toString() { - StringBuilder actualSegmentRef = new StringBuilder("\nSegmentRef:\n"); - return actualSegmentRef.append(String.format(" - entryServiceName:\t\t%s\n", entryEndpointName())) - .append(String.format(" - networkAddress:\t\t\t%s\n", networkAddress())) - .append(String.format(" - parentServiceName:\t\t%s\n", parentEndpointName())) - .append(String.format(" - parentSpanId:\t\t\t%s\n", parentSpanId())) - .append(String.format(" - parentTraceSegmentId:\t%s\n", parentTraceSegmentId())) - .append(String.format(" - refType:\t\t\t\t\t%s", refType())) - .toString(); - } - } - - public static class SpanForRead implements Span { - private String operationName; - private String operationId; - private String parentSpanId; - private String spanId; - private String spanLayer; - private List> tags; - private List>>> logs; - private List> refs; - private List formatedRefs; - private List actualRefs; - private String startTime; - private String endTime; - private String componentId; - private String componentName; - private String isError; - private String spanType; - private String peer; - private String peerId; - - public void setOperationName(String operationName) { - this.operationName = operationName; - } - - public void setOperationId(String operationId) { - this.operationId = operationId; - } - - public void setParentSpanId(String parentSpanId) { - this.parentSpanId = parentSpanId; - } - - public void setSpanId(String spanId) { - this.spanId = spanId; - } - - public void setSpanLayer(String spanLayer) { - this.spanLayer = spanLayer; - } - - public void setTags(List> tags) { - this.tags = tags; - } - - public void setLogs(List>>> logs) { - this.logs = logs; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public void setComponentId(String componentId) { - this.componentId = componentId; - } - - public void setComponentName(String componentName) { - this.componentName = componentName; - } - - public void setError(String error) { - isError = error; - } - - public void setSpanType(String spanType) { - this.spanType = spanType; - } - - public void setPeer(String peer) { - this.peer = peer; - } - - public void setPeerId(String peerId) { - this.peerId = peerId; - } - - public void setRefs(List> refs) { - this.refs = refs; - } - - @Override - public String operationName() { - return operationName; - } - - @Override - public String operationId() { - return operationId; - } - - @Override - public String parentSpanId() { - return parentSpanId; - } - - @Override - public String spanId() { - return spanId; - } - - @Override - public String spanLayer() { - return spanLayer; - } - - @Override - public List tags() { - if (tags == null) { - return new ArrayList<>(); - } - List result = new ArrayList<>(); - for (Map tag : tags) { - result.add(new KeyValuePair.Impl(tag.get("key"), tag.get("value"))); - } - return result; - } - - @Override - public List logs() { - if (logs == null) { - return new ArrayList<>(); - } - List result = new ArrayList<>(); - for (Map>> log : logs) { - List> events = log.get("logEvent"); - LogEvent.Impl logEvent = new LogEvent.Impl(); - for (Map event : events) { - logEvent.add(event.get("key"), event.get("value")); - } - result.add(logEvent); - } - - return result; - } - - @Override - public String startTime() { - return startTime; - } - - @Override - public String endTime() { - return endTime; - } - - @Override - public String componentId() { - return componentId; - } - - @Override - public String componentName() { - return componentName; - } - - @Override - public String error() { - return isError; - } - - @Override - public String spanType() { - return spanType; - } - - @Override - public String peer() { - return peer; - } - - @Override - public String peerId() { - return peerId; - } - - @Override - public List refs() { - if (formatedRefs == null && refs != null) { - List segmentRefs = new ArrayList<>(); - for (Map ref : refs) { - segmentRefs.add(new SegmentRefForRead(ref)); - } - - this.formatedRefs = segmentRefs; - } - return formatedRefs; - } - - @Override - public void setActualRefs(List refs) { - this.actualRefs = refs; - } - - @Override - public List actualRefs() { - return actualRefs; - } - } - - public static class LogEventForRead { - private List> logEvent; - - public List> getLogEvent() { - return logEvent; - } - - public void setLogEvent(List> logEvent) { - this.logEvent = logEvent; - } - } - - public String getSegmentId() { - return segmentId; - } - - public List getSpans() { - return spans; - } - - @Override - public void setSegmentId(String segmentId) { - this.segmentId = segmentId; - } - - public void setSpans(List spans) { - this.spans = spans; - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItem.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItem.java deleted file mode 100644 index 8a4a4b6ef..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItem.java +++ /dev/null @@ -1,28 +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.agent.tool.validator.entity; - -import java.util.List; - -public interface SegmentItem { - String applicationCode(); - - String segmentSize(); - - List segments(); -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItemForRead.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItemForRead.java deleted file mode 100644 index 5f1b4bf33..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentItemForRead.java +++ /dev/null @@ -1,76 +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.agent.tool.validator.entity; - -import java.util.ArrayList; -import java.util.List; - -public class SegmentItemForRead implements SegmentItem { - private String applicationCode; - private String segmentSize; - private List segments; - - public List getSegments() { - return segments; - } - - public void setSegments(List segments) { - this.segments = segments; - } - - public String getApplicationCode() { - return applicationCode; - } - - public void setApplicationCode(String applicationCode) { - this.applicationCode = applicationCode; - } - - public String getSegmentSize() { - return segmentSize; - } - - public void setSegmentSize(String segmentSize) { - this.segmentSize = segmentSize; - } - - @Override - public String applicationCode() { - return applicationCode; - } - - @Override - public String segmentSize() { - return segmentSize; - } - - @Override - public List segments() { - if (segments == null) { - return null; - } - return new ArrayList<>(segments); - } - - @Override - public String toString() { - StringBuilder message = new StringBuilder(String.format("\nSegment Item[%s]", applicationCode)); - message.append(String.format(" - segment size:\t\t%s\n", segmentSize)); - return message.toString(); - } -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentRef.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentRef.java deleted file mode 100644 index 77cf0b719..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/SegmentRef.java +++ /dev/null @@ -1,45 +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.agent.tool.validator.entity; - -public interface SegmentRef { - - String parentEndpointId(); - - String parentEndpointName(); - - String networkAddressId(); - - String entryEndpointId(); - - String refType(); - - String parentSpanId(); - - String parentTraceSegmentId(); - - String parentServiceInstanceId(); - - String networkAddress(); - - String entryEndpointName(); - - void parentTraceSegmentId(String parentTraceSegmentId); - - String entryServiceInstanceId(); -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java deleted file mode 100644 index ea1bc99bf..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java +++ /dev/null @@ -1,58 +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.agent.tool.validator.entity; - -import java.util.List; - -public interface Span { - String operationName(); - - String operationId(); - - String parentSpanId(); - - String spanId(); - - String spanLayer(); - - List tags(); - - List logs(); - - String startTime(); - - String endTime(); - - String componentId(); - - String componentName(); - - String error(); - - String spanType(); - - String peer(); - - String peerId(); - - List refs(); - - void setActualRefs(List refs); - - List actualRefs(); -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/exception/AssertFailedException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/exception/AssertFailedException.java deleted file mode 100644 index 902c346e0..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/exception/AssertFailedException.java +++ /dev/null @@ -1,29 +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.agent.tool.validator.exception; - -public abstract class AssertFailedException extends RuntimeException { - protected AssertFailedException(String message) { - super(message); - } - - protected AssertFailedException() { - } - - public abstract String getCauseMessage(); -} diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/exception/IllegalDataFileException.java b/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/exception/IllegalDataFileException.java deleted file mode 100644 index a80fa67e8..000000000 --- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/exception/IllegalDataFileException.java +++ /dev/null @@ -1,31 +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.agent.tool.validator.exception; - -public class IllegalDataFileException extends AssertFailedException { - private final String fileName; - - public IllegalDataFileException(String fileName) { - this.fileName = fileName; - } - - @Override - public String getCauseMessage() { - return String.format("IllegalDataFileException %s ", fileName); - } -} diff --git a/test/plugin/validator/src/main/resources/log4j2.xml b/test/plugin/validator/src/main/resources/log4j2.xml deleted file mode 100644 index 342bd6d3a..000000000 --- a/test/plugin/validator/src/main/resources/log4j2.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/plugin/validator/src/test/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssertTest.java b/test/plugin/validator/src/test/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssertTest.java deleted file mode 100644 index 3d730e6e1..000000000 --- a/test/plugin/validator/src/test/java/org/apache/skywalking/plugin/test/agent/tool/validator/assertor/DataAssertTest.java +++ /dev/null @@ -1,40 +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.agent.tool.validator.assertor; - -import java.io.File; -import org.apache.skywalking.plugin.test.agent.tool.validator.entity.Data; -import org.apache.skywalking.plugin.test.agent.tool.validator.exception.AssertFailedException; -import org.junit.Test; - -public class DataAssertTest { - - @Test - public void testAssertFunction() { - try { - 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)); - } catch (AssertFailedException e) { - System.out.println(String.format("\nassert failed.\n%s\n", e.getCauseMessage())); - - } - } - -} \ No newline at end of file diff --git a/test/plugin/validator/src/test/resources/actualData.yaml b/test/plugin/validator/src/test/resources/actualData.yaml deleted file mode 100644 index 7eaa18e68..000000000 --- a/test/plugin/validator/src/test/resources/actualData.yaml +++ /dev/null @@ -1,295 +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. -{ - "registryItems": { - "applications": [ - { - "vertx-core-3.x-scenario": 2 - } - ], - "instances": [ - { - "vertx-core-3.x-scenario": 1 - } - ], - "operationNames": [ - { - "vertx-core-3.x-scenario": [ - "/vertx-core-3-scenario/vertx-core/core-case", - "/vertx-core-3-scenario/vertx-core/executeTest", - "cluster-message-receiver" - ] - } - ] - }, - "segmentItems": [ - { - "applicationCode": "vertx-core-3.x-scenario", - "segmentSize": "8", - "segments": [ - { - "segmentId": "1.159.15542729582940000", - "spans": [ - { - "operationName": "#local-message-receiver", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "RPCFramework", - "refs": [ - { - "parentEndpointId": 0, - "parentEndpoint": "local-message-receiver", - "networkAddressId": 0, - "entryEndpointId": 0, - "refType": "CrossThread", - "parentSpanId": 0, - "parentTraceSegmentId": "1.158.15542729582900006", - "parentServiceInstanceId": 1, - "networkAddress": "", - "entryEndpoint": "local-message-receiver", - "entryServiceInstanceId": 1 - } - ], - "startTime": "1554272958294", - "endTime": "1554272958294", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Local", - "peer": "", - "peerId": "0" - } - ] - }, - { - "segmentId": "1.158.15542729582900006", - "spans": [ - { - "operationName": "local-message-receiver", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "RPCFramework", - "startTime": "1554272958290", - "endTime": "1554272958305", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Local", - "peer": "", - "peerId": "0" - } - ] - }, - { - "segmentId": "1.158.15542729581640000", - "spans": [ - { - "operationName": "/vertx-core-3-scenario/vertx-core/executeTest", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "Http", - "tags": [ - { - "key": "http.method", - "value": "GET" - }, - { - "key": "url", - "value": "http://localhost:8080/vertx-core-3-scenario/vertx-core/executeTest" - } - ], - "startTime": "1554272958168", - "endTime": "1554272958339", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Exit", - "peer": "/vertx-core-3-scenario/vertx-core/executeTest", - "peerId": "0" - } - ] - }, - { - "segmentId": "1.158.15542729581890002", - "spans": [ - { - "operationName": "/vertx-core-3-scenario/vertx-core/core-case", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "Http", - "tags": [ - { - "key": "http.method", - "value": "GET" - }, - { - "key": "url", - "value": "http://localhost:18080/vertx-core-3-scenario/vertx-core/core-case" - } - ], - "startTime": "1554272958190", - "endTime": "1554272958340", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Entry", - "peer": "", - "peerId": "0" - } - ] - }, - { - "segmentId": "1.81.15542729583180000", - "spans": [ - { - "operationName": "cluster-message-receiver", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "RPCFramework", - "refs": [ - { - "parentEndpointId": 0, - "parentEndpoint": "cluster-message-receiver", - "networkAddressId": 0, - "entryEndpointId": 0, - "refType": "CrossProcess", - "parentSpanId": 0, - "parentTraceSegmentId": "1.158.15542729582940008", - "parentServiceInstanceId": 1, - "networkAddress": "localhost:45171", - "entryEndpoint": "cluster-message-receiver", - "entryServiceInstanceId": 1 - } - ], - "startTime": "1554272958318", - "endTime": "1554272958320", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Entry", - "peer": "", - "peerId": "0" - } - ] - }, - { - "segmentId": "1.158.15542729583390010", - "spans": [ - { - "operationName": "#/vertx-core-3-scenario/vertx-core/executeTest", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "Http", - "refs": [ - { - "parentEndpointId": 0, - "parentEndpoint": "/vertx-core-3-scenario/vertx-core/executeTest", - "networkAddressId": 0, - "entryEndpointId": 0, - "refType": "CrossThread", - "parentSpanId": 0, - "parentTraceSegmentId": "1.158.15542729581640000", - "parentServiceInstanceId": 1, - "networkAddress": "", - "entryEndpoint": "/vertx-core-3-scenario/vertx-core/executeTest", - "entryServiceInstanceId": 1 - } - ], - "startTime": "1554272958339", - "endTime": "1554272958340", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Local", - "peer": "", - "peerId": "0" - } - ] - }, - { - "segmentId": "1.158.15542729582940008", - "spans": [ - { - "operationName": "cluster-message-receiver", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "RPCFramework", - "startTime": "1554272958294", - "endTime": "1554272958324", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Exit", - "peer": "localhost:45171", - "peerId": "0" - } - ] - }, - { - "segmentId": "1.158.15542729582860004", - "spans": [ - { - "operationName": "/vertx-core-3-scenario/vertx-core/executeTest", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "Http", - "tags": [ - { - "key": "http.method", - "value": "GET" - }, - { - "key": "url", - "value": "http://localhost:8080/vertx-core-3-scenario/vertx-core/executeTest" - } - ], - "refs": [ - { - "parentEndpointId": 0, - "parentEndpoint": "/vertx-core-3-scenario/vertx-core/executeTest", - "networkAddressId": 0, - "entryEndpointId": 0, - "refType": "CrossProcess", - "parentSpanId": 0, - "parentTraceSegmentId": "1.158.15542729581640000", - "parentServiceInstanceId": 1, - "networkAddress": "/vertx-core-3-scenario/vertx-core/executeTest", - "entryEndpoint": "/vertx-core-3-scenario/vertx-core/executeTest", - "entryServiceInstanceId": 1 - } - ], - "startTime": "1554272958286", - "endTime": "1554272958325", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Entry", - "peer": "", - "peerId": "0" - } - ] - } - ] - } - ] -} diff --git a/test/plugin/validator/src/test/resources/expectedData.yaml b/test/plugin/validator/src/test/resources/expectedData.yaml deleted file mode 100644 index f3bdefdd5..000000000 --- a/test/plugin/validator/src/test/resources/expectedData.yaml +++ /dev/null @@ -1,292 +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. -{ - "registryItems": { - "applications": [ - { - "vertx-core-3.x-scenario": 2 - } - ], - "instances": [ - { - "vertx-core-3.x-scenario": 1 - } - ], - "operationNames": [ - { - "vertx-core-3.x-scenario": [ - "/vertx-core-3-scenario/vertx-core/executeTest", - "/vertx-core-3-scenario/vertx-core/core-case", - "cluster-message-receiver" - ] - } - ] - }, - "segmentItems": [ - { - "applicationCode": "vertx-core-3.x-scenario", - "segmentSize": "8", - "segments": [ - { - "segmentId": "nq 0", - "spans": [ - { - "operationName": "#local-message-receiver", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "RPCFramework", - "refs": [ - { - "parentEndpointId": 0, - "parentEndpoint": "local-message-receiver", - "networkAddressId": 0, - "entryEndpointId": 0, - "refType": "CrossThread", - "parentSpanId": 0, - "parentTraceSegmentId": "not null", - "parentServiceInstanceId": 1, - "networkAddress": "", - "entryEndpoint": "local-message-receiver", - "entryServiceInstanceId": 1 - } - ], - "startTime": "nq 0", - "endTime": "nq 0", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Local", - "peer": "", - "peerId": "0" - } - ] - }, - { - "segmentId": "nq 0", - "spans": [ - { - "operationName": "local-message-receiver", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "RPCFramework", - "startTime": "nq 0", - "endTime": "nq 0", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Local", - "peer": "", - "peerId": "0" - } - ] - }, - { - "segmentId": "nq 0", - "spans": [ - { - "operationName": "/vertx-core-3-scenario/vertx-core/executeTest", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "Http", - "tags": [ - { - "key": "http.method", - "value": "GET" - }, - { - "key": "url", - "value": "http://localhost:8080/vertx-core-3-scenario/vertx-core/executeTest" - } - ], - "startTime": "nq 0", - "endTime": "nq 0", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Exit", - "peer": "/vertx-core-3-scenario/vertx-core/executeTest", - "peerId": "0" - } - ] - }, - { - "segmentId": "nq 0", - "spans": [ - { - "operationName": "/vertx-core-3-scenario/vertx-core/core-case", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "Http", - "tags": [ - { - "key": "http.method", - "value": "GET" - }, - { - "key": "url", - "value": "http://localhost:18080/vertx-core-3-scenario/vertx-core/core-case" - } - ], - "startTime": "nq 0", - "endTime": "nq 0", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Entry", - "peerId": "0" - } - ] - }, - { - "segmentId": "nq 0", - "spans": [ - { - "operationName": "cluster-message-receiver", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "RPCFramework", - "refs": [ - { - "parentEndpointId": 0, - "parentEndpoint": "cluster-message-receiver", - "networkAddressId": 0, - "entryEndpointId": 0, - "refType": "CrossProcess", - "parentSpanId": 0, - "parentTraceSegmentId": "not null", - "parentServiceInstanceId": 1, - "networkAddress": "not null", - "entryEndpoint": "cluster-message-receiver", - "entryServiceInstanceId": 1 - } - ], - "startTime": "nq 0", - "endTime": "nq 0", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Entry", - "peer": "", - "peerId": "0" - } - ] - }, - { - "segmentId": "nq 0", - "spans": [ - { - "operationName": "#/vertx-core-3-scenario/vertx-core/executeTest", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "Http", - "refs": [ - { - "parentEndpointId": 0, - "parentEndpoint": "/vertx-core-3-scenario/vertx-core/executeTest", - "networkAddressId": 0, - "entryEndpointId": 0, - "refType": "CrossThread", - "parentSpanId": 0, - "parentTraceSegmentId": "not null", - "parentServiceInstanceId": 1, - "networkAddress": "", - "entryEndpoint": "/vertx-core-3-scenario/vertx-core/executeTest", - "entryServiceInstanceId": 1 - } - ], - "startTime": "nq 0", - "endTime": "nq 0", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Local", - "peer": "", - "peerId": "0" - } - ] - }, - { - "segmentId": "nq 0", - "spans": [ - { - "operationName": "cluster-message-receiver", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "RPCFramework", - "startTime": "nq 0", - "endTime": "nq 0", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Exit", - "peerId": "0" - } - ] - }, - { - "segmentId": "nq 0", - "spans": [ - { - "operationName": "/vertx-core-3-scenario/vertx-core/executeTest", - "operationId": "0", - "parentSpanId": "-1", - "spanId": "0", - "spanLayer": "Http", - "tags": [ - { - "key": "http.method", - "value": "GET" - }, - { - "key": "url", - "value": "http://localhost:8080/vertx-core-3-scenario/vertx-core/executeTest" - } - ], - "refs": [ - { - "parentEndpointId": 0, - "parentEndpoint": "/vertx-core-3-scenario/vertx-core/executeTest", - "networkAddressId": 0, - "entryEndpointId": 0, - "refType": "CrossProcess", - "parentSpanId": 0, - "parentTraceSegmentId": "not null", - "parentServiceInstanceId": 1, - "networkAddress": "/vertx-core-3-scenario/vertx-core/executeTest", - "entryEndpoint": "/vertx-core-3-scenario/vertx-core/executeTest", - "entryServiceInstanceId": 1 - } - ], - "startTime": "nq 0", - "endTime": "nq 0", - "componentId": "59", - "componentName": "", - "isError": false, - "spanType": "Entry", - "peerId": "0" - } - ] - } - ] - } - ] -}