You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/10/30 03:36:27 UTC
[skywalking] branch master updated: toolkit-scenario (#3739)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new bcaa8be toolkit-scenario (#3739)
bcaa8be is described below
commit bcaa8be0aac3d0036bba45ba7b09027079ecd86f
Author: zhangwei <pk...@outlook.com>
AuthorDate: Wed Oct 30 11:36:16 2019 +0800
toolkit-scenario (#3739)
---
Jenkinsfile-Agent-Test-2 | 8 +-
.../service/MockTraceSegmentService.java | 2 +-
.../apm-toolkit-trace-scenario/bin/startup.sh | 21 ++
.../config/expectedData.yaml | 264 +++++++++++++++++++++
.../apm-toolkit-trace-scenario/configuration.yml | 21 ++
.../scenarios/apm-toolkit-trace-scenario/pom.xml | 118 +++++++++
.../src/main/assembly/assembly.xml | 41 ++++
.../skywalking/apm/toolkit/trace/ActiveSpan.java} | 59 ++---
.../apm/toolkit/trace/CallableWrapper.java} | 64 ++---
.../apm/toolkit/trace/RunnableWrapper.java} | 56 ++---
.../apache/skywalking/apm/toolkit/trace/Trace.java | 41 ++++
.../apm/toolkit/trace/TraceContext.java} | 59 ++---
.../apm/toolkit/trace/TraceCrossThread.java} | 53 ++---
.../apm/testcase/toolkit/Application.java} | 47 +---
.../toolkit/controller/TestController.java | 97 ++++++++
.../testcase/toolkit/controller/TestService.java | 81 +++++++
.../src/main/resources/application.yaml | 22 ++
.../support-version.list | 17 ++
.../tool/validator/assertor/SegmentAssert.java | 2 +
.../tool/validator/entity/SegmentForRead.java | 6 +-
.../test/agent/tool/validator/entity/Span.java | 2 +-
21 files changed, 850 insertions(+), 231 deletions(-)
diff --git a/Jenkinsfile-Agent-Test-2 b/Jenkinsfile-Agent-Test-2
index c3b0f37..a081d12 100755
--- a/Jenkinsfile-Agent-Test-2
+++ b/Jenkinsfile-Agent-Test-2
@@ -66,7 +66,7 @@ pipeline {
sh './mvnw -f test/plugin/pom.xml clean package -DskipTests -Dbuild_id=wl2_${BUILD_ID} docker:build'
}
}
- stage('Test Cases Report (155)') {
+ stage('Test Cases Report (156)') {
steps {
echo "reserve."
}
@@ -110,6 +110,12 @@ pipeline {
sh 'bash test/plugin/run.sh --build_id=wl2_${BUILD_ID} spring-4.1.x-scenario'
}
}
+
+ stage('apm-toolkit-trace (1)') {
+ steps {
+ sh 'bash test/plugin/run.sh --build_id=wl2_${BUILD_ID} apm-toolkit-trace-scenario'
+ }
+ }
}
}
stage('Group2') {
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
index 095f372..fb7fd35 100644
--- 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
@@ -46,7 +46,7 @@ public class MockTraceSegmentService extends TraceSegmentReportServiceGrpc.Trace
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())
+ .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());
diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/bin/startup.sh b/test/plugin/scenarios/apm-toolkit-trace-scenario/bin/startup.sh
new file mode 100644
index 0000000..57f910d
--- /dev/null
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/bin/startup.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# 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.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} ${home}/../libs/apm-toolkit-trace-scenario.jar &
\ No newline at end of file
diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/config/expectedData.yaml b/test/plugin/scenarios/apm-toolkit-trace-scenario/config/expectedData.yaml
new file mode 100644
index 0000000..4f4f865
--- /dev/null
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/config/expectedData.yaml
@@ -0,0 +1,264 @@
+# 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:
+ - {apm-toolkit-trace-scenario: 2}
+ instances:
+ - {apm-toolkit-trace-scenario: 1}
+ operationNames:
+ - apm-toolkit-trace-scenario: [/apm-toolkit-trace-scenario/case/asyncVisit/runnable,
+ /case/asyncVisit/runnable, /case/asyncVisit/callable, /apm-toolkit-trace-scenario/case/asyncVisit/callable,
+ /case/tool-kit]
+ heartbeat: []
+segmentItems:
+ - applicationCode: apm-toolkit-trace-scenario
+ segmentSize: gt 5
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testTag()
+ operationId: 0
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: Unknown
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 0
+ componentName: ''
+ isError: false
+ spanType: Local
+ peer: ''
+ peerId: 0
+ tags:
+ - {key: key, value: value}
+ - operationName: test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testInfo()
+ operationId: 0
+ parentSpanId: 0
+ spanId: 2
+ spanLayer: Unknown
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 0
+ componentName: ''
+ isError: false
+ spanType: Local
+ peer: ''
+ peerId: 0
+ logs:
+ - logEvent:
+ - {key: event, value: info}
+ - {key: message, value: TestInfoMsg}
+ - operationName: test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testDebug()
+ operationId: 0
+ parentSpanId: 0
+ spanId: 3
+ spanLayer: Unknown
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 0
+ componentName: ''
+ isError: false
+ spanType: Local
+ peer: ''
+ peerId: 0
+ logs:
+ - logEvent:
+ - {key: event, value: debug}
+ - {key: message, value: TestDebugMsg}
+ - operationName: test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testError()
+ operationId: 0
+ parentSpanId: 0
+ spanId: 4
+ spanLayer: Unknown
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 0
+ componentName: ''
+ isError: true
+ spanType: Local
+ peer: ''
+ peerId: 0
+ - operationName: test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testErrorMsg()
+ operationId: 0
+ parentSpanId: 0
+ spanId: 5
+ spanLayer: Unknown
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 0
+ componentName: ''
+ isError: true
+ spanType: Local
+ peer: ''
+ peerId: 0
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: message, value: TestErrorMsg}
+ - operationName: test.org.apache.skywalking.apm.testcase.toolkit.controller.TestService.testErrorThrowable()
+ operationId: 0
+ parentSpanId: 0
+ spanId: 6
+ spanLayer: Unknown
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 0
+ componentName: ''
+ isError: true
+ spanType: Local
+ peer: ''
+ peerId: 0
+ logs:
+ - logEvent:
+ - {key: event, value: error}
+ - {key: error.kind, value: java.lang.RuntimeException}
+ - {key: message, value: Test-Exception}
+ - {key: stack, value: not null}
+ - operationName: /case/tool-kit
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ componentName: ''
+ isError: false
+ spanType: Entry
+ peer: ''
+ peerId: 0
+ tags:
+ - {key: url, value: 'http://localhost:8080/apm-toolkit-trace-scenario/case/tool-kit'}
+ - {key: http.method, value: GET}
+ - segmentId: not null
+ spans:
+ - operationName: /case/asyncVisit/callable
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ componentName: ''
+ isError: false
+ spanType: Entry
+ peer: ''
+ peerId: 0
+ tags:
+ - {key: url, value: 'http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/callable'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpointId: 0, parentEndpoint: Thread/org.apache.skywalking.apm.toolkit.trace.CallableWrapper/call,
+ networkAddressId: 0, entryEndpointId: 0, refType: CrossProcess, parentSpanId: 1,
+ parentTraceSegmentId: not null, parentServiceInstanceId: 1,
+ networkAddress: 'localhost:8080', entryEndpoint: /case/tool-kit, entryServiceInstanceId: 1}
+ - segmentId: not null
+ spans:
+ - operationName: /apm-toolkit-trace-scenario/case/asyncVisit/runnable
+ operationId: 0
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 2
+ componentName: ''
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ peerId: 0
+ tags:
+ - {key: url, value: 'http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/runnable'}
+ - {key: http.method, value: GET}
+ - operationName: Thread/org.apache.skywalking.apm.toolkit.trace.RunnableWrapper/run
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Unknown
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 0
+ componentName: ''
+ isError: false
+ spanType: Local
+ peer: ''
+ peerId: 0
+ refs:
+ - {parentEndpointId: 0, parentEndpoint: /case/tool-kit, networkAddressId: 0,
+ entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null,
+ parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /case/tool-kit,
+ entryServiceInstanceId: 1}
+ - segmentId: not null
+ spans:
+ - operationName: /apm-toolkit-trace-scenario/case/asyncVisit/callable
+ operationId: 0
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 2
+ componentName: ''
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ peerId: 0
+ tags:
+ - {key: url, value: 'http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/callable'}
+ - {key: http.method, value: GET}
+ - operationName: Thread/org.apache.skywalking.apm.toolkit.trace.CallableWrapper/call
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Unknown
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 0
+ componentName: ''
+ isError: false
+ spanType: Local
+ peer: ''
+ peerId: 0
+ refs:
+ - {parentEndpointId: 0, parentEndpoint: /case/tool-kit, networkAddressId: 0,
+ entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null,
+ parentServiceInstanceId: 1, networkAddress: '', entryEndpoint: /case/tool-kit,
+ entryServiceInstanceId: 1}
+ - segmentId: not null
+ spans:
+ - operationName: /case/asyncVisit/runnable
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ componentName: ''
+ isError: false
+ spanType: Entry
+ peer: ''
+ peerId: 0
+ tags:
+ - {key: url, value: 'http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/runnable'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpointId: 0, parentEndpoint: Thread/org.apache.skywalking.apm.toolkit.trace.RunnableWrapper/run,
+ networkAddressId: 0, entryEndpointId: 0, refType: CrossProcess, parentSpanId: 1,
+ parentTraceSegmentId: not null, parentServiceInstanceId: 1,
+ networkAddress: 'localhost:8080', entryEndpoint: /case/tool-kit, entryServiceInstanceId: 1}
\ No newline at end of file
diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/configuration.yml b/test/plugin/scenarios/apm-toolkit-trace-scenario/configuration.yml
new file mode 100644
index 0000000..fc164d0
--- /dev/null
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/configuration.yml
@@ -0,0 +1,21 @@
+# 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.
+
+type: jvm
+entryService: http://localhost:8080/apm-toolkit-trace-scenario/case/tool-kit
+healthCheck: http://localhost:8080/apm-toolkit-trace-scenario/case/healthCheck
+startScript: ./bin/startup.sh
+framework: apm-toolkit-trace
diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/pom.xml b/test/plugin/scenarios/apm-toolkit-trace-scenario/pom.xml
new file mode 100644
index 0000000..b8ddd59
--- /dev/null
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/pom.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ ~
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.skywalking</groupId>
+ <artifactId>apm-toolkit-trace-scenario</artifactId>
+ <version>5.0.0</version>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <compiler.version>1.8</compiler.version>
+ <spring.boot.version>2.1.6.RELEASE</spring.boot.version>
+
+ <test.framework>apm-toolkit-trace</test.framework>
+ <test.framework.version>1.0.0</test.framework.version>
+ </properties>
+
+ <name>skywalking-apm-toolkit-trace-scenario</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring.boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.3</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>apm-toolkit-trace-scenario</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${compiler.version}</source>
+ <target>${compiler.version}</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>assemble</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
+ </descriptors>
+ <outputDirectory>./target/</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>spring-snapshots</id>
+ <url>http://repo.spring.io/snapshot</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>spring-milestones</id>
+ <url>http://repo.spring.io/milestone</url>
+ </pluginRepository>
+ </pluginRepositories>
+</project>
\ No newline at end of file
diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/assembly/assembly.xml
new file mode 100644
index 0000000..746b483
--- /dev/null
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/assembly/assembly.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ ~
+ -->
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+ <fileSet>
+ <directory>./bin</directory>
+ <fileMode>0775</fileMode>
+ </fileSet>
+ </fileSets>
+
+ <files>
+ <file>
+ <source>./target/apm-toolkit-trace-scenario.jar</source>
+ <outputDirectory>./libs</outputDirectory>
+ <fileMode>0775</fileMode>
+ </file>
+ </files>
+</assembly>
\ No newline at end of file
diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/ActiveSpan.java
similarity index 53%
copy from test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
copy to test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/ActiveSpan.java
index b175967..c9ec935 100644
--- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/ActiveSpan.java
@@ -6,52 +6,43 @@
* (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
+ * 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<KeyValuePair> tags();
- List<LogEvent> logs();
+package org.apache.skywalking.apm.toolkit.trace;
- String startTime();
-
- String endTime();
-
- String componentId();
-
- String componentName();
-
- boolean error();
-
- String spanType();
+/**
+ * provide custom api that set tag for current active span.
+ *
+ * @author zhangxin
+ */
+public class ActiveSpan {
+ /**
+ * @param key tag key
+ * @param value tag value
+ */
+ public static void tag(String key, String value) {
+ }
- String peer();
+ public static void error() {
+ }
- String peerId();
+ public static void error(String errorMsg) {
+ }
- List<SegmentRef> refs();
+ public static void error(Throwable throwable) {
+ }
- void setActualRefs(List<SegmentRef> refs);
+ public static void debug(String debugMsg) {
+ }
- List<SegmentRef> actualRefs();
+ public static void info(String infoMsg) {
+ }
}
diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/CallableWrapper.java
similarity index 53%
copy from test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
copy to test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/CallableWrapper.java
index b175967..32c8f31 100644
--- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/CallableWrapper.java
@@ -6,52 +6,36 @@
* (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
+ * 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<KeyValuePair> tags();
-
- List<LogEvent> logs();
-
- String startTime();
+package org.apache.skywalking.apm.toolkit.trace;
- String endTime();
+import java.util.concurrent.Callable;
- String componentId();
-
- String componentName();
-
- boolean error();
-
- String spanType();
-
- String peer();
-
- String peerId();
-
- List<SegmentRef> refs();
-
- void setActualRefs(List<SegmentRef> refs);
-
- List<SegmentRef> actualRefs();
-}
+/**
+ * @author carlvine500
+ */
+@TraceCrossThread
+public class CallableWrapper<V> implements Callable<V> {
+ final Callable<V> callable;
+
+ public static <V> CallableWrapper of(Callable<V> r) {
+ return new CallableWrapper<V>(r);
+ }
+
+ public CallableWrapper(Callable<V> callable) {
+ this.callable = callable;
+ }
+
+ @Override
+ public V call() throws Exception {
+ return callable.call();
+ }
+}
\ No newline at end of file
diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/RunnableWrapper.java
similarity index 53%
copy from test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
copy to test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/RunnableWrapper.java
index b175967..60cd912 100644
--- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/RunnableWrapper.java
@@ -6,7 +6,7 @@
* (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
+ * 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,
@@ -14,44 +14,26 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.skywalking.plugin.test.agent.tool.validator.entity;
+package org.apache.skywalking.apm.toolkit.trace;
-import java.util.List;
-
-public interface Span {
- String operationName();
-
- String operationId();
-
- String parentSpanId();
-
- String spanId();
-
- String spanLayer();
-
- List<KeyValuePair> tags();
-
- List<LogEvent> logs();
-
- String startTime();
-
- String endTime();
-
- String componentId();
-
- String componentName();
-
- boolean error();
-
- String spanType();
-
- String peer();
+/**
+ * @author lican
+ */
+@TraceCrossThread
+public class RunnableWrapper implements Runnable {
+ final Runnable runnable;
- String peerId();
+ public RunnableWrapper(Runnable runnable) {
+ this.runnable = runnable;
+ }
- List<SegmentRef> refs();
+ public static RunnableWrapper of(Runnable r) {
+ return new RunnableWrapper(r);
+ }
- void setActualRefs(List<SegmentRef> refs);
- List<SegmentRef> actualRefs();
-}
+ @Override
+ public void run() {
+ this.runnable.run();
+ }
+}
\ No newline at end of file
diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/Trace.java b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/Trace.java
new file mode 100644
index 0000000..b76236d
--- /dev/null
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/Trace.java
@@ -0,0 +1,41 @@
+/*
+ * 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.apm.toolkit.trace;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * The agent create local span if the method that annotation with {@link Trace}. The value of span operation name will
+ * fetch by {@link #operationName()}. if the value of {@link #operationName()} is blank string. the operation name will
+ * be set the class name + method name.
+ *
+ * @author zhangxin
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Trace {
+ /**
+ * @return operation name, the default value is blank string.
+ */
+ String operationName() default "";
+}
diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/TraceContext.java
similarity index 53%
copy from test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
copy to test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/TraceContext.java
index b175967..a890b6f 100644
--- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/TraceContext.java
@@ -6,52 +6,35 @@
* (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
+ * 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<KeyValuePair> tags();
-
- List<LogEvent> logs();
- String startTime();
- String endTime();
+package org.apache.skywalking.apm.toolkit.trace;
- String componentId();
-
- String componentName();
-
- boolean error();
-
- String spanType();
-
- String peer();
-
- String peerId();
-
- List<SegmentRef> refs();
-
- void setActualRefs(List<SegmentRef> refs);
-
- List<SegmentRef> actualRefs();
+/**
+ * Try to access the sky-walking tracer context.
+ * The context is not existed, always.
+ * only the middleware, component, or rpc-framework are supported in the current invoke stack, in the same thread,
+ * the context will be available.
+ * <p>
+ * Created by xin on 2016/12/15.
+ */
+public class TraceContext {
+
+ /**
+ * Try to get the traceId of current trace context.
+ *
+ * @return traceId, if it exists, or empty {@link String}.
+ */
+ public static String traceId() {
+ return "";
+ }
}
diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/TraceCrossThread.java
similarity index 53%
copy from test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
copy to test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/TraceCrossThread.java
index b175967..1eaf87a 100644
--- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/TraceCrossThread.java
@@ -6,52 +6,27 @@
* (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
+ * 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<KeyValuePair> tags();
-
- List<LogEvent> logs();
+package org.apache.skywalking.apm.toolkit.trace;
- String startTime();
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
- String endTime();
-
- String componentId();
-
- String componentName();
-
- boolean error();
-
- String spanType();
-
- String peer();
-
- String peerId();
-
- List<SegmentRef> refs();
-
- void setActualRefs(List<SegmentRef> refs);
+/**
+ * @author carlvine500
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface TraceCrossThread {
- List<SegmentRef> actualRefs();
-}
+}
\ No newline at end of file
diff --git a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/Application.java
similarity index 53%
copy from test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
copy to test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/Application.java
index b175967..77fc5be 100644
--- a/test/plugin/validator/src/main/java/org/apache/skywalking/plugin/test/agent/tool/validator/entity/Span.java
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/Application.java
@@ -6,52 +6,25 @@
* (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
+ * 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<KeyValuePair> tags();
-
- List<LogEvent> logs();
-
- String startTime();
-
- String endTime();
-
- String componentId();
-
- String componentName();
-
- boolean error();
-
- String spanType();
-
- String peer();
- String peerId();
+package test.org.apache.skywalking.apm.testcase.toolkit;
- List<SegmentRef> refs();
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
- void setActualRefs(List<SegmentRef> refs);
+@SpringBootApplication
+public class Application {
- List<SegmentRef> actualRefs();
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
}
diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/controller/TestController.java b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/controller/TestController.java
new file mode 100644
index 0000000..dc17214
--- /dev/null
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/controller/TestController.java
@@ -0,0 +1,97 @@
+/*
+ * 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 test.org.apache.skywalking.apm.testcase.toolkit.controller;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.client.ResponseHandler;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+
+/**
+ * @author caoyixiong
+ */
+@RestController
+@RequestMapping("/case")
+public class TestController {
+
+ private static final String SUCCESS = "Success";
+
+ @Autowired
+ private TestService testService;
+
+ @RequestMapping("/tool-kit")
+ public String toolKitCase() {
+ testService.testTag();
+ testService.testInfo();
+ testService.testDebug();
+ testService.testError();
+ testService.testErrorMsg();
+ testService.testErrorThrowable();
+ testService.asyncCallable(() -> {
+ visit("http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/callable");
+ return true;
+ });
+ testService.asyncRunnable(() -> {
+ try {
+ visit("http://localhost:8080/apm-toolkit-trace-scenario/case/asyncVisit/runnable");
+ } catch (IOException e) {
+ // ignore
+ }
+ });
+ return SUCCESS;
+ }
+
+ @RequestMapping("/healthCheck")
+ public String healthCheck() {
+ return SUCCESS;
+ }
+
+ @RequestMapping("/asyncVisit/runnable")
+ public String asyncVisitRunnable() {
+ return SUCCESS;
+ }
+
+ @RequestMapping("/asyncVisit/callable")
+ public String asyncVisitCallable() {
+ return SUCCESS;
+ }
+
+
+ private static void visit(String url) throws IOException {
+ CloseableHttpClient httpclient = HttpClients.createDefault();
+ try {
+ HttpGet httpget = new HttpGet(url);
+ ResponseHandler<String> responseHandler = response -> {
+ HttpEntity entity = response.getEntity();
+ return entity != null ? EntityUtils.toString(entity) : null;
+ };
+ httpclient.execute(httpget, responseHandler);
+ } finally {
+ httpclient.close();
+ }
+ }
+}
diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/controller/TestService.java b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/controller/TestService.java
new file mode 100644
index 0000000..b4b8228
--- /dev/null
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/toolkit/controller/TestService.java
@@ -0,0 +1,81 @@
+/*
+ * 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 test.org.apache.skywalking.apm.testcase.toolkit.controller;
+
+import org.apache.skywalking.apm.toolkit.trace.ActiveSpan;
+import org.apache.skywalking.apm.toolkit.trace.CallableWrapper;
+import org.apache.skywalking.apm.toolkit.trace.RunnableWrapper;
+import org.apache.skywalking.apm.toolkit.trace.Trace;
+import org.springframework.stereotype.Component;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * @author caoyixiong
+ */
+@Component
+public class TestService {
+
+ private static final ExecutorService SERVICE = Executors.newSingleThreadExecutor(r -> {
+ Thread thread = new Thread(r);
+ thread.setDaemon(true);
+ return thread;
+ });
+
+ @Trace
+ public void testTag() {
+ ActiveSpan.tag("key", "value");
+ }
+
+ @Trace
+ public void testError() {
+ ActiveSpan.error();
+ }
+
+ @Trace
+ public void testErrorMsg() {
+ ActiveSpan.error("TestErrorMsg");
+ }
+
+ @Trace
+ public void testErrorThrowable() {
+ ActiveSpan.error(new RuntimeException("Test-Exception"));
+ }
+
+ @Trace
+ public void testDebug() {
+ ActiveSpan.debug("TestDebugMsg");
+ }
+
+ @Trace
+ public void testInfo() {
+ ActiveSpan.info("TestInfoMsg");
+ }
+
+
+ public void asyncRunnable(Runnable runnable) {
+ SERVICE.submit(RunnableWrapper.of(runnable));
+ }
+
+ public void asyncCallable(Callable<Boolean> callable) {
+ SERVICE.submit(CallableWrapper.of(callable));
+ }
+}
diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/resources/application.yaml b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/resources/application.yaml
new file mode 100644
index 0000000..1678b3d
--- /dev/null
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/src/main/resources/application.yaml
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+#
+
+server:
+ port: 8080
+ servlet:
+ context-path: /apm-toolkit-trace-scenario
\ No newline at end of file
diff --git a/test/plugin/scenarios/apm-toolkit-trace-scenario/support-version.list b/test/plugin/scenarios/apm-toolkit-trace-scenario/support-version.list
new file mode 100644
index 0000000..5061adb
--- /dev/null
+++ b/test/plugin/scenarios/apm-toolkit-trace-scenario/support-version.list
@@ -0,0 +1,17 @@
+# 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.
+
+1.0.0
\ No newline at end of file
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
index 8ce49c6..68faf42 100644
--- 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
@@ -104,6 +104,8 @@ public class SegmentAssert {
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());
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
index 1a5dab6..6473a16 100644
--- 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
@@ -184,7 +184,7 @@ public class SegmentForRead implements Segment {
private String endTime;
private String componentId;
private String componentName;
- private boolean isError;
+ private String isError;
private String spanType;
private String peer;
private String peerId;
@@ -233,7 +233,7 @@ public class SegmentForRead implements Segment {
this.componentName = componentName;
}
- public void setError(boolean error) {
+ public void setError(String error) {
isError = error;
}
@@ -318,7 +318,7 @@ public class SegmentForRead implements Segment {
return componentName;
}
- @Override public boolean error() {
+ @Override public String error() {
return isError;
}
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
index b175967..aad4558 100644
--- 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
@@ -41,7 +41,7 @@ public interface Span {
String componentName();
- boolean error();
+ String error();
String spanType();