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/12 01:14:25 UTC
[skywalking] branch master updated: [test/plugin] support
jvm-container (#3584)
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 530804d [test/plugin] support jvm-container (#3584)
530804d is described below
commit 530804d0fd8e758346e9943adc9c7082f7a7cf3c
Author: Daming <zt...@foxmail.com>
AuthorDate: Sat Oct 12 09:14:12 2019 +0800
[test/plugin] support jvm-container (#3584)
* provides a jvm-container
---
Jenkinsfile-Agent-Test | 37 +++--
.../containers/jvm-container/docker/Dockerfile | 17 ++-
.../docker/run.sh | 43 +++---
.../containers/tomcat-container/docker/run.sh | 2 +-
test/plugin/run.sh | 28 ++--
.../plugin/test/helper/ConfigurationImpl.java | 5 +
.../helper/DockerContainerRunningGenerator.java | 3 +-
.../plugin/test/helper/IConfiguration.java | 6 +-
.../main/resources/container-start-script.template | 3 +
.../src/main/resources/docker-compose.template | 5 +
.../jetty-scenario/config/expectedData.yaml | 89 ++++++++++++
.../jetty-scenario/configuration.yml} | 13 +-
.../jetty-scenario/jetty-dist/bin/startup.sh} | 20 ++-
.../scenarios/jetty-scenario/jetty-dist/pom.xml | 54 ++++++++
.../jetty-dist/src/main/assembly/assembly.xml | 46 +++++++
.../jetty-scenario/jettyclient-scenario/pom.xml | 107 +++++++++++++++
.../apm/testcase/jettyclient/Application.java | 38 ++++++
.../jettyclient/controller/CaseController.java | 57 ++++++++
.../src/main/resources/application.properties} | 10 +-
.../src/main/resources/log4j2.xml} | 42 +++---
.../jetty-scenario/jettyserver-scenario/pom.xml | 80 +++++++++++
.../apm/testcase/jettyserver/Application.java | 37 +++++
.../testcase/jettyserver/servlet/CaseServlet.java} | 54 +++-----
test/plugin/scenarios/jetty-scenario/pom.xml | 63 +++++++++
.../scenarios/jetty-scenario/support-version.list | 79 +++++++++++
test/plugin/script/run.m4 | 149 ---------------------
26 files changed, 807 insertions(+), 280 deletions(-)
diff --git a/Jenkinsfile-Agent-Test b/Jenkinsfile-Agent-Test
index 8cc864c..bf898c2 100755
--- a/Jenkinsfile-Agent-Test
+++ b/Jenkinsfile-Agent-Test
@@ -54,23 +54,40 @@ pipeline {
sh './mvnw -f test/plugin/pom.xml clean package -DskipTests -Dbuild_id=${BUILD_ID} docker:build'
}
}
+ stage ('Run Agent Plugin Tests') {
+ parallel {
+ stage ('Group1') {
+ stages {
+ stage('httpclient 4.3.x-4.5.x') {
+ steps {
+ sh 'bash test/plugin/run.sh --build_id=${BUILD_ID} httpclient-4.3.x-scenario'
+ }
+ }
- stage('httpclient 4.3.x-4.5.x') {
- steps {
- sh 'bash test/plugin/run.sh --build_id=${BUILD_ID} httpclient-4.3.x-scenario'
- }
- }
-
- stage('ehcache 2.8.x-2.10.x') {
- steps {
- sh 'bash test/plugin/run.sh --build_id=${BUILD_ID} ehcache-2.x-scenario'
+ stage('ehcache 2.8.x-2.10.x') {
+ steps {
+ sh 'bash test/plugin/run.sh --build_id=${BUILD_ID} ehcache-2.x-scenario'
+ }
+ }
+ }
+ }
+ stage ('Group2') {
+ stages {
+ stage('jetty 9.x') {
+ steps {
+ sh 'bash test/plugin/run.sh --build_id=${BUILD_ID} jetty-scenario'
+ }
+ }
+ }
+ }
}
}
}
post {
always {
+ sh 'bash test/plugin/run.sh --build_id=${BUILD_ID} --cleanup'
deleteDir()
}
}
-}
+}
\ No newline at end of file
diff --git a/test/plugin/containers/jvm-container/docker/Dockerfile b/test/plugin/containers/jvm-container/docker/Dockerfile
index 60131b5..175eb53 100644
--- a/test/plugin/containers/jvm-container/docker/Dockerfile
+++ b/test/plugin/containers/jvm-container/docker/Dockerfile
@@ -14,11 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM openjdk:7
+FROM openjdk:8
MAINTAINER zhangxin@apache.org
-ADD docker-entrypoint.sh /
-RUN chmod +x /docker-entrypoint.sh
+WORKDIR /usr/local/skywalking/tools
-ENTRYPOINT ["/docker-entrypoint.sh"]
-RUN ["/bin/bash"]
+COPY run.sh /
+RUN chmod +x /run.sh
+
+COPY skywalking-validator-tools.jar /usr/local/skywalking/tools
+COPY skywalking-mock-collector.tar.gz /usr/local/skywalking/tools
+RUN tar -xvf skywalking-mock-collector.tar.gz -C /usr/local/skywalking/tools
+
+WORKDIR /usr/local/skywalking/scenario
+
+CMD ["/run.sh"]
diff --git a/test/plugin/containers/tomcat-container/docker/run.sh b/test/plugin/containers/jvm-container/docker/run.sh
similarity index 67%
copy from test/plugin/containers/tomcat-container/docker/run.sh
copy to test/plugin/containers/jvm-container/docker/run.sh
index dc27bb6..4ba21aa 100644
--- a/test/plugin/containers/tomcat-container/docker/run.sh
+++ b/test/plugin/containers/jvm-container/docker/run.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -16,6 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+
function exitOnError() {
echo -e "\033[31m[ERROR] $1\033[0m">&2
exitAndClean 1
@@ -24,13 +25,14 @@ function exitOnError() {
function exitAndClean() {
[[ -f ${SCENARIO_HOME}/data/actualData.yaml ]] && rm -rf ${SCENARIO_HOME}/data/actualData.yaml
[[ -d ${SCENARIO_HOME}/logs ]] && rm -rf ${SCENARIO_HOME}/logs
+ [[ -d ${SCENARIO_HOME}/package ]] && rm -rf ${SCENARIO_HOME}/package
exit $1
}
function healthCheck() {
HEALTH_CHECK_URL=$1
- for ((i=1; i<=10; i++));
+ for ((i=1; i<=30; i++));
do
STATUS_CODE="$(curl -Is ${HEALTH_CHECK_URL} | head -n 1)"
if [[ $STATUS_CODE == *"200"* ]]; then
@@ -43,23 +45,32 @@ function healthCheck() {
exitOnError "${SCENARIO_NAME}-${SCENARIO_VERSION} health check failed!"
}
+if [[ -z "${SCENARIO_START_SCRIPT}" ]]; then
+ exitOnError "The name of startup script cannot be empty!"
+fi
+
TOOLS_HOME=/usr/local/skywalking/tools
SCENARIO_HOME=/usr/local/skywalking/scenario
-# Speed up launch tomcat
-rm /usr/local/tomcat/webapps/* -rf # remove needn't app
-sed -i "s%securerandom.source=file:/dev/random%securerandom.source=file:/dev/urandom%g" $JAVA_HOME/jre/lib/security/java.security
-
-# To deploy testcase
-cp ${SCENARIO_HOME}/*.war /usr/local/tomcat/webapps/
+unzip -q ${SCENARIO_HOME}/*.zip -d /var/run/
+if [[ ! -f /var/run/${SCENARIO_NAME}/${SCENARIO_START_SCRIPT} ]]; then
+ exitOnError "The required startup script not exists!"
+fi
-# start mock collector
echo "To start mock collector"
${TOOLS_HOME}/skywalking-mock-collector/bin/collector-startup.sh 1>/dev/null &
healthCheck http://localhost:12800/receiveData
-echo "To start tomcat"
-/usr/local/tomcat/bin/catalina.sh start 1>/dev/null &
+# start applications
+export agent_opts="-javaagent:${SCENARIO_HOME}/agent/skywalking-agent.jar
+ -Dskywalking.collector.grpc_channel_check_interval=2
+ -Dskywalking.collector.app_and_service_register_check_interval=2
+ -Dskywalking.collector.discovery_check_interval=2
+ -Dskywalking.collector.backend_service=localhost:19876
+ -Dskywalking.agent.service_name=${SCENARIO_NAME}
+ -Dskywalking.logging.dir=/usr/local/skywalking/scenario/logs
+ -Xms256m -Xmx256m ${agent_opts}"
+exec /var/run/${SCENARIO_NAME}/${SCENARIO_START_SCRIPT} 1>/dev/null &
healthCheck ${SCENARIO_HEALTH_CHECK_URL}
echo "To visit entry service"
@@ -72,11 +83,11 @@ curl -s http://localhost:12800/receiveData > ${SCENARIO_HOME}/data/actualData.ya
echo "To validate"
java -jar \
- -Dv2=true \
- -Xmx256m -Xms256m \
- -DtestDate="`date +%Y-%m-%d-%H-%M`" \
- -DtestCasePath=${SCENARIO_HOME}/data/ \
- ${TOOLS_HOME}/skywalking-validator-tools.jar 1>/dev/null
+ -Dv2=true \
+ -Xmx256m -Xms256m \
+ -DtestDate="`date +%Y-%m-%d-%H-%M`" \
+ -DtestCasePath=${SCENARIO_HOME}/data/ \
+ ${TOOLS_HOME}/skywalking-validator-tools.jar 1>/dev/null
status=$?
if [[ $status -eq 0 ]]; then
diff --git a/test/plugin/containers/tomcat-container/docker/run.sh b/test/plugin/containers/tomcat-container/docker/run.sh
index dc27bb6..6448643 100644
--- a/test/plugin/containers/tomcat-container/docker/run.sh
+++ b/test/plugin/containers/tomcat-container/docker/run.sh
@@ -30,7 +30,7 @@ function exitAndClean() {
function healthCheck() {
HEALTH_CHECK_URL=$1
- for ((i=1; i<=10; i++));
+ for ((i=1; i<=30; i++));
do
STATUS_CODE="$(curl -Is ${HEALTH_CHECK_URL} | head -n 1)"
if [[ $STATUS_CODE == *"200"* ]]; then
diff --git a/test/plugin/run.sh b/test/plugin/run.sh
index 896da3a..a49f1a3 100644
--- a/test/plugin/run.sh
+++ b/test/plugin/run.sh
@@ -21,6 +21,7 @@ scenario_name=""
parallel_run_size=1
force_build="off"
build_id="latest"
+cleanup="off"
mvnw=${home}/../../mvnw
agent_home=${home}"/../../skywalking-agent"
@@ -32,6 +33,7 @@ print_help() {
echo -e "\t-f, --force_build \t\t do force to build Plugin-Test tools and images"
echo -e "\t--build_id, \t\t\t specify Plugin_Test's image tag. Defalt: latest"
echo -e "\t--parallel_run_size, \t\t parallel size of test cases. Default: 1"
+ echo -e "\t--cleanup, \t\t\t remove the related images and directories"
}
parse_commandline() {
@@ -44,6 +46,10 @@ parse_commandline() {
force_build="on"
shift
;;
+ --cleanup)
+ cleanup="on"
+ shift
+ ;;
--build_id)
test $# -lt 2 && exitWithMessage "Missing value for the optional argument '$_key'."
build_id="$2"
@@ -82,10 +88,6 @@ exitWithMessage() {
}
exitAndClean() {
- if [[ "${build_id}" =~ "latest" ]]; then
- docker images -q "skywalking/agent-test-*:${build_id}" | xargs -r docker rmi -f
- fi
-
elapsed=$(( `date +%s` - $start_stamp ))
num_of_testcases="`ls -l ${task_state_house} |grep -c FINISH`"
printf "Scenarios: %s, Testcases: %d, parallel_run_size: %d, Elapsed: %02d:%02d:%02d \n" \
@@ -105,9 +107,20 @@ waitForAvailable() {
fi
}
-start_stamp=`date +%s` ### start
+do_cleanup() {
+ docker images -q "skywalking/agent-test-*:${build_id}" | xargs -r docker rmi -f
+ [[ -d ${home}/dist ]] && rm -rf ${home}/dist
+ [[ -d ${home}/workspce ]] && rm -rf ${home}/workspace
+}
+
+start_stamp=`date +%s`
parse_commandline "$@"
+if [[ "$cleanup" == "on" ]]; then
+ do_cleanup
+ exit 0
+fi
+
if [[ ! -d ${agent_home} ]]; then
echo "[WARN] SkyWalking Agent not exists"
${mvnw} -f ${home}/../../pom.xml -Pagent -DskipTests clean package
@@ -149,9 +162,8 @@ do
cp ./config/expectedData.yaml ${case_work_base}/data
# echo "build ${testcase_name}"
- ${mvnw} clean package -Dtest.framework.version=${version}
-
- mv ./target/${scenario_name}.war ${case_work_base}
+ ${mvnw} clean package -Dtest.framework.version=${version} && \
+ mv ./target/${scenario_name}.* ${case_work_base}
java -jar \
-Xmx256m -Xms256m \
diff --git a/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/ConfigurationImpl.java b/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/ConfigurationImpl.java
index c83e054..9a81d98 100644
--- a/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/ConfigurationImpl.java
+++ b/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/ConfigurationImpl.java
@@ -87,6 +87,11 @@ public class ConfigurationImpl implements IConfiguration {
return this.configuration.getHealthCheck();
}
+ @Override
+ public String startScript() {
+ return this.configuration.getStartScript();
+ }
+
@Override public String dockerImageName() {
switch (this.configuration.getType().toLowerCase()) {
case "tomcat" :
diff --git a/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/DockerContainerRunningGenerator.java b/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/DockerContainerRunningGenerator.java
index 57158ad..b9d4355 100644
--- a/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/DockerContainerRunningGenerator.java
+++ b/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/DockerContainerRunningGenerator.java
@@ -43,8 +43,9 @@ public class DockerContainerRunningGenerator extends AbstractRunningGenerator {
root.put("scenario_name", configuration.scenarioName());
root.put("scenario_version", configuration.scenarioVersion());
- root.put("entry_service", configuration.entryService());
root.put("health_check", configuration.healthCheck());
+ root.put("start_script", configuration.startScript());
+ root.put("entry_service", configuration.entryService());
root.put("test_framework", configuration.testFramework());
root.put("docker_image_name", configuration.dockerImageName());
root.put("docker_image_version", configuration.dockerImageVersion());
diff --git a/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java b/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java
index 416ea85..038e2f5 100644
--- a/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java
+++ b/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java
@@ -34,10 +34,12 @@ public interface IConfiguration {
@Deprecated
String testFramework();
- String entryService();
-
String healthCheck();
+ String startScript();
+
+ String entryService();
+
String dockerImageName();
String dockerContainerName();
diff --git a/test/plugin/runner/src/main/resources/container-start-script.template b/test/plugin/runner/src/main/resources/container-start-script.template
index 7a07fa3..4c599af 100644
--- a/test/plugin/runner/src/main/resources/container-start-script.template
+++ b/test/plugin/runner/src/main/resources/container-start-script.template
@@ -21,6 +21,9 @@ docker run \
--env SCENARIO_NAME=${scenario_name} \
--env SCENARIO_VERSION=${scenario_version} \
--env SCENARIO_SUPPORT_FRAMEWORK=${scenario_name} \
+ <#if start_script??>
+ --env SCENARIO_START_SCRIPT=${start_script} \
+ </#if>
--env SCENARIO_ENTRY_SERVICE=${entry_service} \
--env SCENARIO_HEALTH_CHECK_URL=${health_check} \
-v ${agent_home}:/usr/local/skywalking/scenario/agent \
diff --git a/test/plugin/runner/src/main/resources/docker-compose.template b/test/plugin/runner/src/main/resources/docker-compose.template
index 41cd5e3..cdecb5c 100644
--- a/test/plugin/runner/src/main/resources/docker-compose.template
+++ b/test/plugin/runner/src/main/resources/docker-compose.template
@@ -25,6 +25,11 @@ services:
</#list>
</#if>
environment:
+ <#if environments?size \gt 0>
+ <#list environments as env>
+ - ${env}
+ </#list>
+ </#if>
- SCENARIO_NAME:${scenario_name}
- SCENARIO_VERSION:${scenario_version}
- SCENARIO_ENTRY_SERVICE:${entry_service}
diff --git a/test/plugin/scenarios/jetty-scenario/config/expectedData.yaml b/test/plugin/scenarios/jetty-scenario/config/expectedData.yaml
new file mode 100644
index 0000000..247ff97
--- /dev/null
+++ b/test/plugin/scenarios/jetty-scenario/config/expectedData.yaml
@@ -0,0 +1,89 @@
+# 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:
+ - {jettyserver-scenario: nq 0}
+ - {jettyclient-scenario: nq 0}
+ instances:
+ - {jettyserver-scenario: 1}
+ - {jettyclient-scenario: 1}
+ operationNames:
+ - jettyserver-scenario: [/jettyserver-case/case/receiveContext-0]
+ - jettyclient-scenario: [/jettyserver-case/case/receiveContext-0,
+ /jettyclient-case/case/jettyclient-case,
+ /jettyclient-case/case/healthCheck]
+segmentItems:
+- applicationCode: jettyserver-scenario
+ segmentSize: 1
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: /jettyserver-case/case/receiveContext-0
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 19
+ componentName: ''
+ isError: false
+ spanType: Entry
+ peer: ''
+ peerId: 0
+ tags:
+ - {key: url, value: 'http://localhost:18080/jettyserver-case/case/receiveContext-0'}
+ - {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
+ segmentSize: 2
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: /jettyserver-case/case/receiveContext-0
+ operationId: 0
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 18
+ componentName: null
+ isError: false
+ spanType: Exit
+ peer: localhost:18080
+ peerId: 0
+ tags:
+ - {key: http.method, value: GET}
+ - {key: url, value: 'http://localhost:18080/jettyserver-case/case/receiveContext-0'}
+ - operationName: /jettyclient-case/case/jettyclient-case
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: gt 0
+ componentName: ''
+ isError: false
+ spanType: Entry
+ peer: null
+ peerId: 0
+ tags:
+ - {key: url, value: 'http://localhost:8080/jettyclient-case/case/jettyclient-case'}
+ - {key: http.method, value: GET}
+
diff --git a/test/plugin/containers/jvm-container/docker/Dockerfile b/test/plugin/scenarios/jetty-scenario/configuration.yml
similarity index 79%
copy from test/plugin/containers/jvm-container/docker/Dockerfile
copy to test/plugin/scenarios/jetty-scenario/configuration.yml
index 60131b5..e0dc577 100644
--- a/test/plugin/containers/jvm-container/docker/Dockerfile
+++ b/test/plugin/scenarios/jetty-scenario/configuration.yml
@@ -14,11 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM openjdk:7
-MAINTAINER zhangxin@apache.org
-
-ADD docker-entrypoint.sh /
-RUN chmod +x /docker-entrypoint.sh
-
-ENTRYPOINT ["/docker-entrypoint.sh"]
-RUN ["/bin/bash"]
+type: jvm
+entryService: http://localhost:8080/jettyclient-case/case/jettyclient-case
+healthCheck: http://localhost:8080/jettyclient-case/case/healthCheck
+startScript: ./bin/startup.sh
+framework: jettyclient
diff --git a/test/plugin/containers/jvm-container/docker/docker-entrypoint.sh b/test/plugin/scenarios/jetty-scenario/jetty-dist/bin/startup.sh
similarity index 67%
rename from test/plugin/containers/jvm-container/docker/docker-entrypoint.sh
rename to test/plugin/scenarios/jetty-scenario/jetty-dist/bin/startup.sh
index 9446ea6..32666b7 100644
--- a/test/plugin/containers/jvm-container/docker/docker-entrypoint.sh
+++ b/test/plugin/scenarios/jetty-scenario/jetty-dist/bin/startup.sh
@@ -1,5 +1,5 @@
-#!/bin/sh
-
+#!/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
@@ -16,13 +16,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-/usr/local/skywalking-agent-scenario/skywalking-mock-collector/collector-startup.sh &
-sleep 30
-# start applications
-exec "$@" &
-sleep 60
-curl ${SCENARIO_ENTRY_SERVICE}
-sleep 40
-curl http://localhost:12800/receiveData > ${SCENARIO_DATA}/${SCENARIO_NAME}_${SCENARIO_VERSION}/actualData.yaml
-#
-echo "Scenario[${SCENARIO_NAME}, ${SCENARIO_VERSION}] build successfully!"
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} "-Dskywalking.agent.service_name=jettyserver-scenario" ${home}/../libs/jettyserver-scenario.jar &
+sleep 1
+
+java -jar ${agent_opts} "-Dskywalking.agent.service_name=jettyclient-scenario" ${home}/../libs/jettyclient-scenario.jar &
diff --git a/test/plugin/scenarios/jetty-scenario/jetty-dist/pom.xml b/test/plugin/scenarios/jetty-scenario/jetty-dist/pom.xml
new file mode 100644
index 0000000..eaf44f9
--- /dev/null
+++ b/test/plugin/scenarios/jetty-scenario/jetty-dist/pom.xml
@@ -0,0 +1,54 @@
+<?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">
+ <parent>
+ <groupId>org.apache.skywalking</groupId>
+ <artifactId>jetty-scenario</artifactId>
+ <version>5.0.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jetty-dist</artifactId>
+
+ <build>
+ <plugins>
+ <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>
+</project>
diff --git a/test/plugin/scenarios/jetty-scenario/jetty-dist/src/main/assembly/assembly.xml b/test/plugin/scenarios/jetty-scenario/jetty-dist/src/main/assembly/assembly.xml
new file mode 100644
index 0000000..6c159e3
--- /dev/null
+++ b/test/plugin/scenarios/jetty-scenario/jetty-dist/src/main/assembly/assembly.xml
@@ -0,0 +1,46 @@
+<?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>../jettyclient-scenario/target/jettyclient-scenario.jar</source>
+ <outputDirectory>./libs</outputDirectory>
+ <fileMode>0775</fileMode>
+ </file>
+ <file>
+ <source>../jettyserver-scenario/target/jettyserver-scenario.jar</source>
+ <outputDirectory>./libs</outputDirectory>
+ <fileMode>0775</fileMode>
+ </file>
+ </files>
+</assembly>
\ No newline at end of file
diff --git a/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/pom.xml b/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/pom.xml
new file mode 100644
index 0000000..1f20c7d
--- /dev/null
+++ b/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/pom.xml
@@ -0,0 +1,107 @@
+<?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">
+ <parent>
+ <groupId>org.apache.skywalking</groupId>
+ <artifactId>jetty-scenario</artifactId>
+ <version>5.0.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jettyclient-scenario</artifactId>
+ <properties>
+ <spring.version>4.3.8.RELEASE</spring.version>
+ <spring-boot-version>1.5.2.RELEASE</spring-boot-version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-client</artifactId>
+ <version>${jettyclient.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-jcl</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-tomcat</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>jettyclient-scenario</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>1.5.9.RELEASE</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </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/jetty-scenario/jettyclient-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyclient/Application.java b/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyclient/Application.java
new file mode 100644
index 0000000..9cd7321
--- /dev/null
+++ b/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyclient/Application.java
@@ -0,0 +1,38 @@
+/*
+ * 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.testcase.jettyclient;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.support.SpringBootServletInitializer;
+import org.springframework.context.annotation.ComponentScan;
+
+@EnableAutoConfiguration
+@SpringBootApplication
+@ComponentScan("org.apache.skywalking.apm.testcase.jettyclient")
+public class Application extends SpringBootServletInitializer {
+
+ public static void main(String[] args) {
+ try {
+ SpringApplication.run(Application.class, args);
+ } catch (Exception e) {
+ // Never do this
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyclient/controller/CaseController.java b/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyclient/controller/CaseController.java
new file mode 100644
index 0000000..fea948a
--- /dev/null
+++ b/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyclient/controller/CaseController.java
@@ -0,0 +1,57 @@
+/*
+ * 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.testcase.jettyclient.controller;
+
+import javax.annotation.PostConstruct;
+import org.eclipse.jetty.client.HttpClient;
+import org.eclipse.jetty.client.api.Response;
+import org.eclipse.jetty.client.api.Result;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+@Controller
+@RequestMapping("/case")
+@PropertySource("classpath:application.properties")
+public class CaseController {
+
+ @Value(value = "${jettyServer.host:localhost}")
+ private String jettyServerHost;
+
+ private HttpClient client = new HttpClient();
+
+ @PostConstruct
+ public void init() throws Exception {
+ client.start();
+ }
+
+ @RequestMapping("/jettyclient-case")
+ @ResponseBody
+ public String jettyClientScenario() throws Exception {
+ client.newRequest("http://" + jettyServerHost + ":18080/jettyserver-case/case/receiveContext-0").send();
+ return "Success";
+ }
+
+ @RequestMapping("/healthCheck")
+ @ResponseBody
+ public String healthCheck() throws Exception {
+ return "Success";
+ }
+}
diff --git a/test/plugin/containers/jvm-container/docker/Dockerfile b/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/resources/application.properties
similarity index 82%
copy from test/plugin/containers/jvm-container/docker/Dockerfile
copy to test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/resources/application.properties
index 60131b5..bf20bf2 100644
--- a/test/plugin/containers/jvm-container/docker/Dockerfile
+++ b/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/resources/application.properties
@@ -14,11 +14,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM openjdk:7
-MAINTAINER zhangxin@apache.org
-
-ADD docker-entrypoint.sh /
-RUN chmod +x /docker-entrypoint.sh
-
-ENTRYPOINT ["/docker-entrypoint.sh"]
-RUN ["/bin/bash"]
+server.port=8080
+server.contextPath=/jettyclient-case
\ No newline at end of file
diff --git a/test/plugin/runner/src/main/resources/container-start-script.template b/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/resources/log4j2.xml
similarity index 50%
copy from test/plugin/runner/src/main/resources/container-start-script.template
copy to test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/resources/log4j2.xml
index 7a07fa3..35159a6 100644
--- a/test/plugin/runner/src/main/resources/container-start-script.template
+++ b/test/plugin/scenarios/jetty-scenario/jettyclient-scenario/src/main/resources/log4j2.xml
@@ -1,4 +1,5 @@
-<#--
+<?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.
@@ -13,28 +14,17 @@
~ 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.
--->
-
-docker run \
- --memory=1024m \
- --name ${docker_container_name} \
- --env SCENARIO_NAME=${scenario_name} \
- --env SCENARIO_VERSION=${scenario_version} \
- --env SCENARIO_SUPPORT_FRAMEWORK=${scenario_name} \
- --env SCENARIO_ENTRY_SERVICE=${entry_service} \
- --env SCENARIO_HEALTH_CHECK_URL=${health_check} \
- -v ${agent_home}:/usr/local/skywalking/scenario/agent \
- -v ${scenario_home}:/usr/local/skywalking/scenario \
- ${docker_image_name}:${docker_image_version} 1>${scenario_home}/logs/container.log
-
-status="$?"
-
-container_name=`docker ps -aqf "name=${docker_container_name}"`
-
-<#noparse>
-if [[ -z ${container_name} ]]; then
- status=1
-else
- docker container rm -f $container_name
-fi
-</#noparse>
+ ~
+ -->
+<Configuration status="debug">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout charset="UTF-8" pattern="[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="debug">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
diff --git a/test/plugin/scenarios/jetty-scenario/jettyserver-scenario/pom.xml b/test/plugin/scenarios/jetty-scenario/jettyserver-scenario/pom.xml
new file mode 100644
index 0000000..e443811
--- /dev/null
+++ b/test/plugin/scenarios/jetty-scenario/jettyserver-scenario/pom.xml
@@ -0,0 +1,80 @@
+<?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">
+ <parent>
+ <artifactId>jetty-scenario</artifactId>
+ <groupId>org.apache.skywalking</groupId>
+ <version>5.0.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jettyserver-scenario</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>${jettyserver.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ <version>${jettyserver.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>jettyserver-scenario</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>3.1.0</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <filters>
+ <filter>
+ <artifact>*:*</artifact>
+ <excludes>
+ <exclude>META-INF/*.SF</exclude>
+ <exclude>META-INF/*.DSA</exclude>
+ <exclude>META-INF/*.RSA</exclude>
+ </excludes>
+ </filter>
+ </filters>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+ <mainClass>org.apache.skywalking.apm.testcase.jettyserver.Application</mainClass>
+ </transformer>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/test/plugin/scenarios/jetty-scenario/jettyserver-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyserver/Application.java b/test/plugin/scenarios/jetty-scenario/jettyserver-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyserver/Application.java
new file mode 100644
index 0000000..8fb2622
--- /dev/null
+++ b/test/plugin/scenarios/jetty-scenario/jettyserver-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyserver/Application.java
@@ -0,0 +1,37 @@
+/*
+ * 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.testcase.jettyserver;
+
+import java.net.InetSocketAddress;
+import org.apache.skywalking.apm.testcase.jettyserver.servlet.CaseServlet;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+
+public class Application {
+
+ public static void main(String[] args) throws Exception {
+ Server jettyServer = new Server(new InetSocketAddress("0.0.0.0",
+ Integer.valueOf(18080)));
+ String contextPath = "/jettyserver-case";
+ ServletContextHandler servletContextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
+ servletContextHandler.setContextPath(contextPath);
+ servletContextHandler.addServlet(CaseServlet.class, CaseServlet.SERVLET_PATH);
+ jettyServer.setHandler(servletContextHandler);
+ jettyServer.start();
+ }
+}
diff --git a/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java b/test/plugin/scenarios/jetty-scenario/jettyserver-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyserver/servlet/CaseServlet.java
similarity index 53%
copy from test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java
copy to test/plugin/scenarios/jetty-scenario/jettyserver-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyserver/servlet/CaseServlet.java
index 416ea85..f44bad2 100644
--- a/test/plugin/runner/src/main/java/org/apache/skywalking/plugin/test/helper/IConfiguration.java
+++ b/test/plugin/scenarios/jetty-scenario/jettyserver-scenario/src/main/java/org/apache/skywalking/apm/testcase/jettyserver/servlet/CaseServlet.java
@@ -6,45 +6,31 @@
* (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.helper;
-
-import org.apache.skywalking.plugin.test.helper.vo.CaseConfiguration;
-
-public interface IConfiguration {
- String agentHome();
-
- RunningType runningType();
-
- ScenarioRunningScriptGenerator scenarioGenerator();
-
- CaseConfiguration caseConfiguration();
-
- String scenarioName();
-
- String scenarioVersion();
-
- @Deprecated
- String testFramework();
-
- String entryService();
-
- String healthCheck();
-
- String dockerImageName();
-
- String dockerContainerName();
-
- String dockerImageVersion();
-
- String scenarioHome();
-
- String outputDir();
+package org.apache.skywalking.apm.testcase.jettyserver.servlet;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class CaseServlet extends HttpServlet{
+ public static String SERVLET_PATH = "/case/receiveContext-0";
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ }
+ }
}
diff --git a/test/plugin/scenarios/jetty-scenario/pom.xml b/test/plugin/scenarios/jetty-scenario/pom.xml
new file mode 100644
index 0000000..ff315e9
--- /dev/null
+++ b/test/plugin/scenarios/jetty-scenario/pom.xml
@@ -0,0 +1,63 @@
+<?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>jetty-scenario</artifactId>
+ <packaging>pom</packaging>
+ <version>5.0.0</version>
+ <modules>
+ <module>jettyclient-scenario</module>
+ <module>jettyserver-scenario</module>
+ <module>jetty-dist</module>
+ </modules>
+
+ <name>skywalking-jetty-scenario</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+ <test.framework.version>9.0.0.v20130308</test.framework.version>
+
+ <jettyserver.version>${test.framework.version}</jettyserver.version>
+ <jettyclient.version>${test.framework.version}</jettyclient.version>
+
+ <log4j.version>2.6.2</log4j.version>
+ </properties>
+
+ <build>
+ <finalName>jetty-scenario</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.6.0</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/test/plugin/scenarios/jetty-scenario/support-version.list b/test/plugin/scenarios/jetty-scenario/support-version.list
new file mode 100644
index 0000000..8479160
--- /dev/null
+++ b/test/plugin/scenarios/jetty-scenario/support-version.list
@@ -0,0 +1,79 @@
+# 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.
+
+9.4.8.v20171121
+9.4.7.v20170914
+9.4.6.v20170531
+9.4.5.v20170502
+9.4.4.v20170414
+9.4.3.v20170317
+9.4.2.v20170220
+9.4.1.v20170120
+9.4.0.v20161208
+9.3.22.v20171030
+9.3.21.v20170918
+9.3.20.v20170531
+9.3.19.v20170502
+9.3.18.v20170406
+9.3.17.v20170317
+9.3.16.v20170120
+9.3.15.v20161220
+9.3.14.v20161028
+9.3.13.v20161014
+9.3.12.v20160915
+9.3.11.v20160721
+9.3.10.v20160621
+9.3.9.v20160517
+9.3.8.v20160314
+9.3.7.v20160115
+9.3.6.v20151106
+9.3.5.v20151012
+9.3.4.v20151007
+9.3.3.v20150827
+9.3.2.v20150730
+9.3.1.v20150714
+9.3.0.v20150612
+9.2.23.v20171218
+9.2.22.v20170606
+9.2.21.v20170120
+9.2.20.v20161216
+9.2.19.v20160908
+9.2.18.v20160721
+9.2.17.v20160517
+9.2.16.v20160414
+9.2.15.v20160210
+9.2.14.v20151106
+9.2.13.v20150730
+9.2.12.v20150709
+9.2.11.v20150529
+9.2.10.v20150310
+9.2.9.v20150224
+9.2.8.v20150217
+9.2.7.v20150116
+9.2.6.v20141205
+9.2.5.v20141112
+9.2.4.v20141103
+9.2.3.v20140905
+9.2.2.v20140723
+9.2.1.v20140609
+9.2.0.v20140526
+9.1.6.v20160112
+9.1.5.v20140505
+9.1.4.v20140401
+9.1.3.v20140225
+9.1.2.v20140210
+9.1.1.v20140108
+9.1.0.v20131115
diff --git a/test/plugin/script/run.m4 b/test/plugin/script/run.m4
deleted file mode 100644
index dd7441d..0000000
--- a/test/plugin/script/run.m4
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/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.
-#
-# ARG_OPTIONAL_BOOLEAN([build_agent], [], [no comment], [off])
-# ARG_OPTIONAL_BOOLEAN([build_scenario], [], [no comment], [off])
-# ARG_OPTIONAL_SINGLE([agent_home], [], [no comment])
-# ARG_OPTIONAL_SINGLE([parallel_run_size], [], [The size of running testcase at the same time], 1)
-# ARG_POSITIONAL_INF([scenarios], [The scenario that you want to running])
-# DEFINE_SCRIPT_DIR([scenarios_home], [SCENARIO HOME])
-# ARG_HELP([The general script's help msg])
-# ARGBASH_GO
-# [
-
-home="$(cd "$(dirname $0)"; pwd)"
-
-mvnw=${home}/../../mvnw
-agent_home=${home}"/../../skywalking-agent"
-scenarios_home="${home}/scenarios"
-
-workspace="${home}/workspace"
-task_state_house="${workspace}/.states"
-
-
-plugin_autotest_helper="${home}/dist/plugin-autotest-helper.jar"
-
-prepareAndClean() {
- echo "prepare and clear"
- [[ -d ${workspace} ]] && rm -fr ${workspace}
-
- mkdir -p ${workspace}/{.states,testcases}
-
- if [[ ${#_arg_scenarios[@]} -lt 1 ]]; then
- _arg_scenarios=`ls ./scenarios/|sed -e "s/\t/\n/g"`
- fi
-
- # docker prune
- docker container prune -f
- docker network prune -f
- docker volume prune -f
-# docker image prune -f
-
- # build plugin/test
- ${mvnw} clean package -DskipTests docker:build
- if [[ ! -f ${plugin_autotest_helper} ]]; then
- echo -e "\033[31mplugin/test build failure\033[0m" # ]]
- exit 1;
- fi
-}
-
-waitForAvailable() {
- while [[ `ls -l ${task_state_house} |grep -c RUNNING` -ge ${_arg_parallel_run_size} ]]
- do
- sleep 2
- done
-
- if [[ `ls -l ${task_state_house} |grep -c FAILURE` -gt 0 ]]; then
- exit 1
- fi
-}
-
-################################################
-start_stamp=`date +%s`
-
-prepareAndClean ## prepare to start
-
-echo "start submit job"
-num_of_scenarios=0
-for scenario_name in ${_arg_scenarios}
-do
- scenario_home=${scenarios_home}/${scenario_name} && cd ${scenario_home}
-
- supported_version_file=${scenario_home}/support-version.list
- if [[ ! -f $supported_version_file ]]; then
- echo -e "\033[31m[ERROR] cannot found 'support-version.list' in directory ${scenario_name}\033[0m" # to escape ]]
- continue
- fi
-
- echo "scenario.name=${scenario_name}"
- num_of_scenarios=$((num_of_scenarios+1))
-
- supported_versions=`grep -v -E "^$|^#" ${supported_version_file}`
- for version in ${supported_versions}
- do
- testcase_name="${scenario_name}-${version}"
-
- # testcase working directory, there are logs, reports, and packages.
- case_work_base=${workspace}/testcases/${scenario_name}/${testcase_name}
- mkdir -p ${case_work_base}/{data,packages,logs,reports}
-
- case_work_logs_dir=${case_work_base}/logs
-
- # copy expectedData.yml
- cp ./config/expectedData.yaml ${case_work_base}/data
-
-# echo "build ${testcase_name}"
- ${mvnw} clean package -P${testcase_name} > ${case_work_logs_dir}/build.log
-
- mv ./target/${scenario_name}.war ${case_work_base}/packages
-
- java -Dconfigure.file=${scenario_home}/configuration.yml \
- -Dscenario.home=${case_work_base} \
- -Dscenario.name=${scenario_name} \
- -Dscenario.version=${version} \
- -Doutput.dir=${case_work_base} \
- -Dagent.dir=${agent_home} \
- -jar ${plugin_autotest_helper} 1>${case_work_logs_dir}/helper.log 2>&2
-
- [[ $? -ne 0 ]] && echo -e "\033[31m[ERROR] ${testcase_name}, generate script failure! \033[0m" && continue # ]]
-
- waitForAvailable
- echo "start container of testcase.name=${testcase_name}"
- bash ${case_work_base}/scenario.sh ${task_state_house} 1>${case_work_logs_dir}/${testcase_name}.log 2>&2 &
- done
-
- echo -e "\033[33m${scenario_name} has already sumbitted\033[0m" # to escape ]]
-done
-
-# wait to finish
-while [[ `ls -l ${task_state_house} |grep -c RUNNING` -gt 0 ]]; do
- sleep 1
-done
-
-if [[ `ls -l ${task_state_house} |grep -c FAILURE` -gt 0 ]]; then
- exit 1
-fi
-
-elapsed=$(( `date +%s` - $start_stamp ))
-num_of_testcases="`ls -l ${task_state_house} |grep -c FINISH`"
-
-printf "Scenarios: %d, Testcases: %d, parallel_run_size: %d, Elapsed: %02d:%02d:%02d \n" \
- ${num_of_scenarios} "${num_of_testcases}" "${_arg_parallel_run_size}" \
- $(( ${elapsed}/3600 )) $(( ${elapsed}%3600/60 )) $(( ${elapsed}%60 ))
-
-# ]