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/12/26 14:43:09 UTC

[skywalking] branch master updated: [test/plugin] immigrate test play framework scenario (#4128)

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 4aac329  [test/plugin] immigrate test play framework scenario (#4128)
4aac329 is described below

commit 4aac3293ca698898ee0bd1a0406c389d208ef759
Author: Andy Ai <ya...@gmail.com>
AuthorDate: Thu Dec 26 22:42:56 2019 +0800

    [test/plugin] immigrate test play framework scenario (#4128)
    
    * Add play-scenario
    
    * Set play plugin as default
    
    Co-authored-by: 吴晟 Wu Sheng <wu...@foxmail.com>
    Co-authored-by: Weiyi Liu <li...@cmss.chinamobile.com>
---
 .github/workflows/plugins-test.yaml                |   6 +-
 .../play-2.x-plugin/pom.xml                        |   3 +-
 .../plugin/play/v2x/HttpFiltersInterceptor.java    |   0
 .../apm/plugin/play/v2x/TracingFilter.java         |   0
 .../play/v2x/define/Play2xInstrumentation.java     |   0
 .../src/main/resources/skywalking-plugin.def       |   0
 .../play/v2x/HttpFiltersInterceptorTest.java       |   0
 .../plugin/play/v2x/Play2xInstrumentationTest.java |   0
 .../apm/plugin/play/v2x/TracingFilterTest.java     |   0
 apm-sniffer/apm-sdk-plugin/pom.xml                 |   1 +
 apm-sniffer/optional-plugins/pom.xml               |   1 -
 docs/en/setup/service-agent/java-agent/README.md   |   1 -
 .../service-agent/java-agent/Supported-list.md     |   2 +-
 .../app/controllers/HealthCheckController.scala    |  30 +++++
 .../app/controllers/ProjectsController.scala       |  30 +++++
 .../plugin/scenarios/play-scenario/bin/startup.sh  |   6 +-
 test/plugin/scenarios/play-scenario/build.sbt      |  31 +++++
 .../scenarios/play-scenario/conf/application.conf  |   4 +-
 .../scenarios/play-scenario/conf/logback.xml       |  41 ++++++
 .../plugin/scenarios/play-scenario/conf/routes     |   9 +-
 .../play-scenario/config/expectedData.yaml         |  44 +++++++
 .../scenarios/play-scenario/configuration.yml      |   6 +-
 test/plugin/scenarios/play-scenario/pom.xml        | 141 +++++++++++++++++++++
 .../play-scenario/project/build.properties         |   2 +-
 .../scenarios/play-scenario/project/plugins.sbt    |  19 +++
 .../play-scenario/src/main/assembly/assembly.xml   |  47 +++++++
 .../scenarios/play-scenario/support-version.list   |  16 ++-
 27 files changed, 426 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/plugins-test.yaml b/.github/workflows/plugins-test.yaml
index b5d286b..b746617 100644
--- a/.github/workflows/plugins-test.yaml
+++ b/.github/workflows/plugins-test.yaml
@@ -517,7 +517,7 @@ jobs:
       - name: Run mysql 5.1.2-8.0.15 (53)
         run: bash test/plugin/run.sh mysql-scenario
 
-  LETTUCE:
+  LETTUCE_PlayFramework:
     runs-on: ubuntu-18.04
     timeout-minutes: 90
     strategy:
@@ -540,4 +540,6 @@ jobs:
       - name: Build the Docker image
         run: ./mvnw -f test/plugin/pom.xml clean package -DskipTests docker:build -DBUILD_NO=local >/dev/null
       - name: Run lettuce-scenario 5.x (17)
-        run: bash test/plugin/run.sh lettuce-scenario
\ No newline at end of file
+        run: bash test/plugin/run.sh lettuce-scenario
+      - name: Run Play! Framework
+        run: bash test/plugin/run.sh play-scenario
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/pom.xml
similarity index 94%
rename from apm-sniffer/optional-plugins/play-2.x-plugin/pom.xml
rename to apm-sniffer/apm-sdk-plugin/play-2.x-plugin/pom.xml
index 49f47df..c8d40a8 100644
--- a/apm-sniffer/optional-plugins/play-2.x-plugin/pom.xml
+++ b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/pom.xml
@@ -20,8 +20,8 @@
 <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>
     <parent>
+        <artifactId>apm-sdk-plugin</artifactId>
         <groupId>org.apache.skywalking</groupId>
-        <artifactId>optional-plugins</artifactId>
         <version>7.0.0-SNAPSHOT</version>
     </parent>
 
@@ -32,7 +32,6 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <play2.version>2.7.3</play2.version>
-        <compiler.version>1.8</compiler.version>
     </properties>
 
     <dependencies>
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptor.java b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptor.java
similarity index 100%
rename from apm-sniffer/optional-plugins/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptor.java
rename to apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptor.java
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilter.java b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilter.java
similarity index 100%
rename from apm-sniffer/optional-plugins/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilter.java
rename to apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilter.java
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/define/Play2xInstrumentation.java b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/define/Play2xInstrumentation.java
similarity index 100%
rename from apm-sniffer/optional-plugins/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/define/Play2xInstrumentation.java
rename to apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/define/Play2xInstrumentation.java
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/resources/skywalking-plugin.def
similarity index 100%
copy from apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
copy to apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/resources/skywalking-plugin.def
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptorTest.java b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptorTest.java
similarity index 100%
rename from apm-sniffer/optional-plugins/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptorTest.java
rename to apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptorTest.java
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/Play2xInstrumentationTest.java b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/Play2xInstrumentationTest.java
similarity index 100%
rename from apm-sniffer/optional-plugins/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/Play2xInstrumentationTest.java
rename to apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/Play2xInstrumentationTest.java
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilterTest.java b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilterTest.java
similarity index 100%
rename from apm-sniffer/optional-plugins/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilterTest.java
rename to apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilterTest.java
diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/pom.xml
index 8c399b7..411479d 100644
--- a/apm-sniffer/apm-sdk-plugin/pom.xml
+++ b/apm-sniffer/apm-sdk-plugin/pom.xml
@@ -83,6 +83,7 @@
         <module>armeria-0.84.x-plugin</module>
         <module>armeria-0.85.x-plugin</module>
         <module>httpclient-3.x-plugin</module>
+        <module>play-2.x-plugin</module>
         <module>lettuce-5.x-plugin</module>
     </modules>
     <packaging>pom</packaging>
diff --git a/apm-sniffer/optional-plugins/pom.xml b/apm-sniffer/optional-plugins/pom.xml
index 193ccfb..c8534f9 100644
--- a/apm-sniffer/optional-plugins/pom.xml
+++ b/apm-sniffer/optional-plugins/pom.xml
@@ -46,7 +46,6 @@
         <module>gson-2.8.x-plugin</module>
         <module>zookeeper-3.4.x-plugin</module>
         <module>customize-enhance-plugin</module>
-        <module>play-2.x-plugin</module>
     </modules>
 
     <dependencies>
diff --git a/docs/en/setup/service-agent/java-agent/README.md b/docs/en/setup/service-agent/java-agent/README.md
index f237c2c..abae8b8 100755
--- a/docs/en/setup/service-agent/java-agent/README.md
+++ b/docs/en/setup/service-agent/java-agent/README.md
@@ -131,7 +131,6 @@ Now, we have the following known optional plugins.
 * Plugin of Zookeeper 3.4.x in optional plugin folder. The reason of being optional plugin is, many business irrelevant traces are generated, which cause extra payload to agents and backends. At the same time, those traces may be just heartbeat(s).
 * [Customize enhance](Customize-enhance-trace.md) Trace methods based on description files, rather than write plugin or change source codes.
 * Plugin of Spring Cloud Gateway 2.1.x in optional plugin folder. Please only active this plugin when you install agent in Spring Gateway. spring-cloud-gateway-2.x-plugin and spring-webflux-5.x-plugin are both required.
-* Plugin of [Play Framework](https://www.playframework.com/) 2.6+ (JDK 1.8 required & Scala 2.12/2.13) in optional plugin folder. Please only active this plugin when you install agent in [Play Framework](https://www.playframework.com/). 
 * Plugin of Spring Transaction in optional plugin folder. The reason of being optional plugin is, many local span are generated, which also spend more CPU, memory and network.
 
 ## Bootstrap class plugins
diff --git a/docs/en/setup/service-agent/java-agent/Supported-list.md b/docs/en/setup/service-agent/java-agent/Supported-list.md
index 6490c30..794e5b3 100644
--- a/docs/en/setup/service-agent/java-agent/Supported-list.md
+++ b/docs/en/setup/service-agent/java-agent/Supported-list.md
@@ -12,7 +12,7 @@
   * [Spring WebFlux](https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html) 5.x
   * [Undertow](http://undertow.io/)  1.3.0.Final -> 2.0.27.Final
   * [RESTEasy](https://resteasy.github.io/)  3.1.0.Final -> 3.7.0.Final
-  * [Play Framework](https://www.playframework.com/) 2.6.x -> 2.7.x (Optional²)
+  * [Play Framework](https://www.playframework.com/) 2.6.x -> 2.8.x
   * [Light4J Microservices Framework](https://doc.networknt.com/) 1.6.x -> 2.x
   * [Netty SocketIO](https://github.com/mrniko/netty-socketio) 1.x
 * HTTP Client
diff --git a/test/plugin/scenarios/play-scenario/app/controllers/HealthCheckController.scala b/test/plugin/scenarios/play-scenario/app/controllers/HealthCheckController.scala
new file mode 100644
index 0000000..7182769
--- /dev/null
+++ b/test/plugin/scenarios/play-scenario/app/controllers/HealthCheckController.scala
@@ -0,0 +1,30 @@
+/*
+ * 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 controllers
+
+import javax.inject._
+import play.api.mvc._
+
+@Singleton
+class HealthCheckController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {
+
+  def get: Action[AnyContent] = Action { implicit request: Request[AnyContent] =>
+    Ok("imok")
+  }
+
+}
diff --git a/test/plugin/scenarios/play-scenario/app/controllers/ProjectsController.scala b/test/plugin/scenarios/play-scenario/app/controllers/ProjectsController.scala
new file mode 100644
index 0000000..53dc440
--- /dev/null
+++ b/test/plugin/scenarios/play-scenario/app/controllers/ProjectsController.scala
@@ -0,0 +1,30 @@
+/*
+ * 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 controllers
+
+import javax.inject._
+import play.api.mvc._
+
+@Singleton
+class ProjectsController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {
+
+  def get(projectId: Int): Action[AnyContent] = Action { implicit request: Request[AnyContent] =>
+    Ok(s"Project id: $projectId")
+  }
+
+}
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def b/test/plugin/scenarios/play-scenario/bin/startup.sh
similarity index 86%
copy from apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
copy to test/plugin/scenarios/play-scenario/bin/startup.sh
index 7841124..c8b71d5 100644
--- a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
+++ b/test/plugin/scenarios/play-scenario/bin/startup.sh
@@ -1,3 +1,5 @@
+#!/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
@@ -14,4 +16,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-play-2.x=org.apache.skywalking.apm.plugin.play.v2x.define.Play2xInstrumentation
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -cp "${home}/../libs/*" ${agent_opts} play.core.server.ProdServerStart &
diff --git a/test/plugin/scenarios/play-scenario/build.sbt b/test/plugin/scenarios/play-scenario/build.sbt
new file mode 100644
index 0000000..6261a21
--- /dev/null
+++ b/test/plugin/scenarios/play-scenario/build.sbt
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ *
+ */
+
+name := """play-scenario"""
+
+organization := "org.apache.skywalking"
+
+version := "1.0-SNAPSHOT"
+
+lazy val root = (project in file(".")).enablePlugins(PlayScala)
+
+scalaVersion := "2.13.1"
+
+libraryDependencies += guice
+
+maintainer := "yanbo.ai@gmail.com"
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def b/test/plugin/scenarios/play-scenario/conf/application.conf
similarity index 83%
copy from apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
copy to test/plugin/scenarios/play-scenario/conf/application.conf
index 7841124..9437cb6 100644
--- a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
+++ b/test/plugin/scenarios/play-scenario/conf/application.conf
@@ -14,4 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-play-2.x=org.apache.skywalking.apm.plugin.play.v2x.define.Play2xInstrumentation
+# https://www.playframework.com/documentation/latest/Configuration
+
+play.http.secret.key = "QCY?tAnfk?aZ?iwrNwnxIlR6CTf:G3gf:90Latabg@5241AB`R5W:1uDFN];Ik@n"
diff --git a/test/plugin/scenarios/play-scenario/conf/logback.xml b/test/plugin/scenarios/play-scenario/conf/logback.xml
new file mode 100644
index 0000000..96ec52d
--- /dev/null
+++ b/test/plugin/scenarios/play-scenario/conf/logback.xml
@@ -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.
+  ~
+  -->
+
+<!-- https://www.playframework.com/documentation/latest/SettingsLogger -->
+<configuration>
+
+  <conversionRule conversionWord="coloredLevel" converterClass="play.api.libs.logback.ColoredLevel" />
+
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%coloredLevel %logger{15} - %message%n%xException{10}</pattern>
+    </encoder>
+  </appender>
+
+  <appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
+    <appender-ref ref="STDOUT" />
+  </appender>
+
+  <logger name="play" level="INFO" />
+  <logger name="application" level="DEBUG" />
+
+  <root level="WARN">
+    <appender-ref ref="ASYNCSTDOUT" />
+  </root>
+
+</configuration>
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def b/test/plugin/scenarios/play-scenario/conf/routes
similarity index 63%
copy from apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
copy to test/plugin/scenarios/play-scenario/conf/routes
index 7841124..8ecc28d 100644
--- a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
+++ b/test/plugin/scenarios/play-scenario/conf/routes
@@ -14,4 +14,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-play-2.x=org.apache.skywalking.apm.plugin.play.v2x.define.Play2xInstrumentation
+# Routes
+# This file defines all application routes (Higher priority routes first)
+# https://www.playframework.com/documentation/latest/ScalaRouting
+# ~~~~
+
+# An example controller showing a sample home page
+GET     /play-scenario/case/healthCheck                                  controllers.HealthCheckController.get
+GET     /play-scenario/case/play-scenario/projects/:projectId            controllers.ProjectsController.get(projectId: Int)
diff --git a/test/plugin/scenarios/play-scenario/config/expectedData.yaml b/test/plugin/scenarios/play-scenario/config/expectedData.yaml
new file mode 100644
index 0000000..1ee9372
--- /dev/null
+++ b/test/plugin/scenarios/play-scenario/config/expectedData.yaml
@@ -0,0 +1,44 @@
+# 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:
+    - {play-scenario: 2}
+  instances:
+    - {play-scenario: 1}
+  operationNames:
+    - play-scenario: ["/play-scenario/case/play-scenario/projects/{projectId}"]
+segmentItems:
+  - applicationCode: play-scenario
+    segmentSize: gt 1
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: "/play-scenario/case/play-scenario/projects/{projectId}"
+            operationId: 0
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 68
+            componentName: ''
+            isError: false
+            spanType: Entry
+            peer: ''
+            peerId: 0
+            tags:
+              - {key: url, value: 'localhost:9000/play-scenario/case/play-scenario/projects/1'}
+              - {key: http.method, value: GET}
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def b/test/plugin/scenarios/play-scenario/configuration.yml
similarity index 78%
copy from apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
copy to test/plugin/scenarios/play-scenario/configuration.yml
index 7841124..939ff63 100644
--- a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
+++ b/test/plugin/scenarios/play-scenario/configuration.yml
@@ -14,4 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-play-2.x=org.apache.skywalking.apm.plugin.play.v2x.define.Play2xInstrumentation
+type: jvm
+entryService: http://localhost:9000/play-scenario/case/play-scenario/projects/1
+healthCheck: http://localhost:9000/play-scenario/case/healthCheck
+startScript: ./bin/startup.sh
+framework: PlayFramework
diff --git a/test/plugin/scenarios/play-scenario/pom.xml b/test/plugin/scenarios/play-scenario/pom.xml
new file mode 100644
index 0000000..6d71a9c
--- /dev/null
+++ b/test/plugin/scenarios/play-scenario/pom.xml
@@ -0,0 +1,141 @@
+<?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">
+
+    <groupId>org.apache.skywalking.apm.testcase</groupId>
+    <artifactId>play-scenario</artifactId>
+    <version>1.0.0</version>
+    <packaging>play2</packaging>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <compiler.version>1.8</compiler.version>
+        <scala.version>2.12.9</scala.version>
+        <test.framework.version>2.8.0</test.framework.version>
+        <play2.version>${test.framework.version}</play2.version>
+    </properties>
+
+    <name>Play! Framework Scenario</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.scala-lang</groupId>
+            <artifactId>scala-library</artifactId>
+            <version>${scala.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.typesafe.play</groupId>
+            <artifactId>play_2.12</artifactId>
+            <version>${test.framework.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.typesafe.play</groupId>
+            <artifactId>play-guice_2.12</artifactId>
+            <version>${test.framework.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.typesafe.play</groupId>
+            <artifactId>play-logback_2.12</artifactId>
+            <version>${test.framework.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.typesafe.play</groupId>
+            <artifactId>play-akka-http-server_2.12</artifactId>
+            <version>${test.framework.version}</version>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>play-scenario</finalName>
+        <sourceDirectory>${project.basedir}/app</sourceDirectory>
+        <testSourceDirectory>${project.basedir}/test</testSourceDirectory>
+        <resources>
+            <resource>
+                <directory>${project.basedir}/conf</directory>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>com.google.code.play2-maven-plugin</groupId>
+                <artifactId>play2-maven-plugin</artifactId>
+                <version>1.0.0-rc5</version>
+                <extensions>true</extensions>
+            </plugin>
+
+            <plugin>
+                <groupId>com.google.code.sbt-compiler-maven-plugin</groupId>
+                <artifactId>sbt-compiler-maven-plugin</artifactId>
+                <version>1.0.0</version>
+            </plugin>
+
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/libs</outputDirectory>
+                        </configuration>
+                    </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>
+</project>
\ No newline at end of file
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def b/test/plugin/scenarios/play-scenario/project/build.properties
similarity index 90%
copy from apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
copy to test/plugin/scenarios/play-scenario/project/build.properties
index 7841124..a6a751a 100644
--- a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
+++ b/test/plugin/scenarios/play-scenario/project/build.properties
@@ -14,4 +14,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-play-2.x=org.apache.skywalking.apm.plugin.play.v2x.define.Play2xInstrumentation
+sbt.version=1.3.5
diff --git a/test/plugin/scenarios/play-scenario/project/plugins.sbt b/test/plugin/scenarios/play-scenario/project/plugins.sbt
new file mode 100644
index 0000000..0642ef7
--- /dev/null
+++ b/test/plugin/scenarios/play-scenario/project/plugins.sbt
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ *
+ */
+
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.0")
diff --git a/test/plugin/scenarios/play-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/play-scenario/src/main/assembly/assembly.xml
new file mode 100644
index 0000000..630e18b
--- /dev/null
+++ b/test/plugin/scenarios/play-scenario/src/main/assembly/assembly.xml
@@ -0,0 +1,47 @@
+<?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>
+        <fileSet>
+            <directory>${project.build.directory}/libs</directory>
+            <outputDirectory>./libs</outputDirectory>
+            <fileMode>0775</fileMode>
+        </fileSet>
+    </fileSets>
+
+    <files>
+        <file>
+            <source>${project.build.directory}/play-scenario.jar</source>
+            <outputDirectory>./libs</outputDirectory>
+            <fileMode>0775</fileMode>
+        </file>
+    </files>
+
+</assembly>
diff --git a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def b/test/plugin/scenarios/play-scenario/support-version.list
similarity index 83%
rename from apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
rename to test/plugin/scenarios/play-scenario/support-version.list
index 7841124..95261c5 100644
--- a/apm-sniffer/optional-plugins/play-2.x-plugin/src/main/resources/skywalking-plugin.def
+++ b/test/plugin/scenarios/play-scenario/support-version.list
@@ -2,7 +2,7 @@
 # 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
+# to you under the Apache License, Version
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
 #
@@ -14,4 +14,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-play-2.x=org.apache.skywalking.apm.plugin.play.v2x.define.Play2xInstrumentation
+# lists your version here
+2.6.0
+2.6.5
+2.6.10
+2.6.15
+2.6.20
+2.6.25
+2.7.0
+2.7.1
+2.7.2
+2.7.3
+2.7.4
+2.8.0