Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
c0c898cf
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c0c898cf
编写于
11月 30, 2019
作者:
A
Alan Lau
提交者:
wu-sheng
11月 30, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Immigrate test mysql scenario. (#3948)
* Add mysql scenario
上级
bdc06092
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
736 addition
and
1 deletion
+736
-1
.github/workflows/plugins-test.yaml
.github/workflows/plugins-test.yaml
+27
-1
test/plugin/scenarios/mysql-scenario/bin/startup.sh
test/plugin/scenarios/mysql-scenario/bin/startup.sh
+21
-0
test/plugin/scenarios/mysql-scenario/config/expectedData.yaml
.../plugin/scenarios/mysql-scenario/config/expectedData.yaml
+118
-0
test/plugin/scenarios/mysql-scenario/configuration.yml
test/plugin/scenarios/mysql-scenario/configuration.yml
+33
-0
test/plugin/scenarios/mysql-scenario/pom.xml
test/plugin/scenarios/mysql-scenario/pom.xml
+120
-0
test/plugin/scenarios/mysql-scenario/src/main/assembly/assembly.xml
...n/scenarios/mysql-scenario/src/main/assembly/assembly.xml
+41
-0
test/plugin/scenarios/mysql-scenario/src/main/java/org/apache/skywalking/apm/testcase/mysql/Application.java
...org/apache/skywalking/apm/testcase/mysql/Application.java
+35
-0
test/plugin/scenarios/mysql-scenario/src/main/java/org/apache/skywalking/apm/testcase/mysql/MysqlConfig.java
...org/apache/skywalking/apm/testcase/mysql/MysqlConfig.java
+58
-0
test/plugin/scenarios/mysql-scenario/src/main/java/org/apache/skywalking/apm/testcase/mysql/SQLExecutor.java
...org/apache/skywalking/apm/testcase/mysql/SQLExecutor.java
+64
-0
test/plugin/scenarios/mysql-scenario/src/main/java/org/apache/skywalking/apm/testcase/mysql/controller/CaseController.java
...walking/apm/testcase/mysql/controller/CaseController.java
+76
-0
test/plugin/scenarios/mysql-scenario/src/main/resources/application.yaml
...narios/mysql-scenario/src/main/resources/application.yaml
+23
-0
test/plugin/scenarios/mysql-scenario/src/main/resources/jdbc.properties
...enarios/mysql-scenario/src/main/resources/jdbc.properties
+19
-0
test/plugin/scenarios/mysql-scenario/src/main/resources/log4j2.xml
...in/scenarios/mysql-scenario/src/main/resources/log4j2.xml
+30
-0
test/plugin/scenarios/mysql-scenario/support-version.list
test/plugin/scenarios/mysql-scenario/support-version.list
+71
-0
未找到文件。
.github/workflows/plugins-test.yaml
浏览文件 @
c0c898cf
...
...
@@ -465,3 +465,29 @@ jobs:
run
:
./mvnw -f test/plugin/pom.xml clean package -DskipTests docker:build -DBUILD_NO=local >/dev/null
-
name
:
Run kafka 0.11.0.0-2.3.0 (16)
run
:
bash test/plugin/run.sh kafka-scenario
MySQL
:
runs-on
:
ubuntu-18.04
timeout-minutes
:
90
strategy
:
fail-fast
:
true
steps
:
-
uses
:
actions/checkout@v1
with
:
submodules
:
true
-
uses
:
actions/cache@v1
with
:
path
:
~/.m2/repository
key
:
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys
:
|
${{ runner.os }}-maven-
-
uses
:
actions/setup-java@v1
with
:
java-version
:
8
-
name
:
Build SkyWalking Agent
run
:
./mvnw clean package -DskipTests -Pagent >/dev/null
-
name
:
Build the Docker image
run
:
./mvnw -f test/plugin/pom.xml clean package -DskipTests docker:build -DBUILD_NO=local >/dev/null
-
name
:
Run mysql 5.1.2-8.0.15 (53)
run
:
bash test/plugin/run.sh mysql-scenario
test/plugin/scenarios/mysql-scenario/bin/startup.sh
0 → 100644
浏览文件 @
c0c898cf
#!/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/mysql-scenario.jar &
\ No newline at end of file
test/plugin/scenarios/mysql-scenario/config/expectedData.yaml
0 → 100644
浏览文件 @
c0c898cf
# 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
:
-
{
mysql-scenario
:
nq 0
}
instances
:
-
{
mysql-scenario
:
1
}
operationNames
:
-
mysql-scenario
:
[
Mysql/JDBI/Statement/execute
,
/mysql-scenario/case/healthCheck
,
Mysql/JDBI/PreparedStatement/execute
,
/mysql-scenario/case/mysql-scenario
,
Mysql/JDBI/Connection/close
]
segmentItems
:
-
applicationCode
:
mysql-scenario
segmentSize
:
ge
2
segments
:
-
segmentId
:
not
null
spans
:
-
operationName
:
Mysql/JDBI/PreparedStatement/execute
operationId
:
eq
0
parentSpanId
:
0
spanId
:
1
tags
:
-
{
key
:
"
db.type"
,
value
:
"
sql"
}
-
{
key
:
"
db.instance"
,
value
:
"
test"
}
-
{
key
:
"
db.statement"
,
value
:
"
CREATE
TABLE
test_007(
\n
id
VARCHAR(1)
PRIMARY
KEY,
\n
value
VARCHAR(1)
NOT
NULL)"
}
logs
:
[]
startTime
:
nq
0
endTime
:
nq
0
isError
:
false
spanLayer
:
Database
spanType
:
Exit
componentName
:
null
componentId
:
33
peer
:
mysql-server:3306
peerId
:
eq
0
-
operationName
:
Mysql/JDBI/PreparedStatement/execute
operationId
:
eq
0
parentSpanId
:
0
spanId
:
2
tags
:
-
{
key
:
"
db.type"
,
value
:
"
sql"
}
-
{
key
:
"
db.instance"
,
value
:
"
test"
}
-
{
key
:
"
db.statement"
,
value
:
"
INSERT
INTO
test_007(id,
value)
VALUES(?,?)"
}
logs
:
[]
startTime
:
nq
0
endTime
:
nq
0
isError
:
false
spanLayer
:
Database
spanType
:
Exit
componentName
:
null
componentId
:
33
peer
:
mysql-server:3306
peerId
:
eq
0
-
operationName
:
Mysql/JDBI/Statement/execute
operationId
:
eq
0
parentSpanId
:
0
spanId
:
3
tags
:
-
{
key
:
"
db.type"
,
value
:
"
sql"
}
-
{
key
:
"
db.instance"
,
value
:
"
test"
}
-
{
key
:
"
db.statement"
,
value
:
"
DROP
table
test_007"
}
logs
:
[]
startTime
:
nq
0
endTime
:
nq
0
isError
:
false
spanLayer
:
Database
spanType
:
Exit
componentName
:
null
componentId
:
33
peer
:
mysql-server:3306
peerId
:
eq
0
-
operationName
:
Mysql/JDBI/Connection/close
operationId
:
eq
0
parentSpanId
:
0
spanId
:
4
tags
:
-
{
key
:
"
db.type"
,
value
:
"
sql"
}
-
{
key
:
"
db.instance"
,
value
:
"
test"
}
-
{
key
:
"
db.statement"
,
value
:
"
"
}
logs
:
[]
startTime
:
nq
0
endTime
:
nq
0
isError
:
false
spanLayer
:
Database
spanType
:
Exit
componentName
:
null
componentId
:
33
peer
:
mysql-server:3306
peerId
:
eq
0
-
operationName
:
/mysql-scenario/case/mysql-scenario
operationId
:
eq
0
parentSpanId
:
-1
spanId
:
0
startTime
:
nq
0
endTime
:
nq
0
spanLayer
:
Http
isError
:
false
spanType
:
Entry
componentName
:
null
componentId
:
1
tags
:
-
{
key
:
url
,
value
:
'
http://localhost:8080/mysql-scenario/case/mysql-scenario'
}
-
{
key
:
http.method
,
value
:
GET
}
logs
:
[]
peer
:
null
peerId
:
eq
0
test/plugin/scenarios/mysql-scenario/configuration.yml
0 → 100644
浏览文件 @
c0c898cf
# 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/mysql-scenario/case/mysql-scenario
healthCheck
:
http://localhost:8080/mysql-scenario/case/healthCheck
startScript
:
./bin/startup.sh
framework
:
mysql-scenario
environment
:
depends_on
:
-
mysql-server
dependencies
:
mysql-server
:
image
:
mysql:5.7
hostname
:
mysql-server
expose
:
-
"
3306"
environment
:
-
MYSQL_ROOT_PASSWORD=root
-
MYSQL_DATABASE=test
\ No newline at end of file
test/plugin/scenarios/mysql-scenario/pom.xml
0 → 100644
浏览文件 @
c0c898cf
<?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>
mysql-scenario
</artifactId>
<version>
1.0.0
</version>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<compiler.version>
1.8
</compiler.version>
<test.framework.version>
5.1.5
</test.framework.version>
<docker.image.version>
${test.framework.version}
</docker.image.version>
<spring-boot-version>
2.1.6.RELEASE
</spring-boot-version>
</properties>
<name>
skywalking-mysql-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>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-log4j2
</artifactId>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
${test.framework.version}
</version>
</dependency>
</dependencies>
<build>
<finalName>
mysql-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>
</project>
\ No newline at end of file
test/plugin/scenarios/mysql-scenario/src/main/assembly/assembly.xml
0 → 100644
浏览文件 @
c0c898cf
<?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>
${project.build.directory}/mysql-scenario.jar
</source>
<outputDirectory>
./libs
</outputDirectory>
<fileMode>
0775
</fileMode>
</file>
</files>
</assembly>
test/plugin/scenarios/mysql-scenario/src/main/java/org/apache/skywalking/apm/testcase/mysql/Application.java
0 → 100644
浏览文件 @
c0c898cf
/*
* 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.mysql
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
try
{
SpringApplication
.
run
(
Application
.
class
,
args
);
}
catch
(
Exception
e
)
{
// Never do this
}
}
}
test/plugin/scenarios/mysql-scenario/src/main/java/org/apache/skywalking/apm/testcase/mysql/MysqlConfig.java
0 → 100644
浏览文件 @
c0c898cf
/*
* 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.mysql
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Properties
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
public
class
MysqlConfig
{
private
static
Logger
logger
=
LogManager
.
getLogger
(
MysqlConfig
.
class
);
private
static
String
url
;
private
static
String
userName
;
private
static
String
password
;
static
{
InputStream
inputStream
=
MysqlConfig
.
class
.
getClassLoader
().
getResourceAsStream
(
"/jdbc.properties"
);
Properties
properties
=
new
Properties
();
try
{
properties
.
load
(
inputStream
);
}
catch
(
IOException
e
)
{
logger
.
error
(
"Failed to load config"
,
e
);
}
url
=
properties
.
getProperty
(
"mysql.url"
);
userName
=
properties
.
getProperty
(
"mysql.username"
);
password
=
properties
.
getProperty
(
"mysql.password"
);
}
public
static
String
getUrl
()
{
return
url
;
}
public
static
String
getUserName
()
{
return
userName
;
}
public
static
String
getPassword
()
{
return
password
;
}
}
test/plugin/scenarios/mysql-scenario/src/main/java/org/apache/skywalking/apm/testcase/mysql/SQLExecutor.java
0 → 100644
浏览文件 @
c0c898cf
/*
* 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.mysql
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.PreparedStatement
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
public
class
SQLExecutor
{
private
Connection
connection
;
public
SQLExecutor
()
throws
SQLException
{
try
{
Class
.
forName
(
"com.mysql.jdbc.Driver"
);
}
catch
(
ClassNotFoundException
e
)
{
//
}
connection
=
DriverManager
.
getConnection
(
MysqlConfig
.
getUrl
(),
MysqlConfig
.
getUserName
(),
MysqlConfig
.
getPassword
());
}
public
void
createTable
(
String
sql
)
throws
SQLException
{
PreparedStatement
preparedStatement
=
connection
.
prepareStatement
(
sql
);
preparedStatement
.
execute
();
preparedStatement
.
close
();
}
public
void
insertData
(
String
sql
,
String
id
,
String
value
)
throws
SQLException
{
PreparedStatement
preparedStatement
=
connection
.
prepareStatement
(
sql
);
preparedStatement
.
setString
(
1
,
id
);
preparedStatement
.
setString
(
2
,
value
);
preparedStatement
.
execute
();
preparedStatement
.
close
();
}
public
void
dropTable
(
String
sql
)
throws
SQLException
{
Statement
preparedStatement
=
connection
.
createStatement
();
preparedStatement
.
execute
(
sql
);
preparedStatement
.
close
();
}
public
void
closeConnection
()
throws
SQLException
{
if
(
this
.
connection
!=
null
)
{
this
.
connection
.
close
();
}
}
}
test/plugin/scenarios/mysql-scenario/src/main/java/org/apache/skywalking/apm/testcase/mysql/controller/CaseController.java
0 → 100644
浏览文件 @
c0c898cf
/*
* 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.mysql.controller
;
import
java.sql.SQLException
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.skywalking.apm.testcase.mysql.SQLExecutor
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/case"
)
public
class
CaseController
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
CaseController
.
class
);
private
static
final
String
SUCCESS
=
"Success"
;
private
static
final
String
CREATE_TABLE_SQL
=
"CREATE TABLE test_007(\n"
+
"id VARCHAR(1) PRIMARY KEY, \n"
+
"value VARCHAR(1) NOT NULL)"
;
private
static
final
String
INSERT_DATA_SQL
=
"INSERT INTO test_007(id, value) VALUES(?,?)"
;
private
static
final
String
QUERY_DATA_SQL
=
"SELECT id, value FROM test_007 WHERE id=?"
;
private
static
final
String
DELETE_DATA_SQL
=
"DELETE FROM test_007 WHERE id=?"
;
private
static
final
String
DROP_TABLE_SQL
=
"DROP table test_007"
;
@RequestMapping
(
"/mysql-scenario"
)
@ResponseBody
public
String
testcase
()
{
SQLExecutor
sqlExecute
=
null
;
try
{
sqlExecute
=
new
SQLExecutor
();
sqlExecute
.
createTable
(
CREATE_TABLE_SQL
);
sqlExecute
.
insertData
(
INSERT_DATA_SQL
,
"1"
,
"1"
);
sqlExecute
.
dropTable
(
DROP_TABLE_SQL
);
}
catch
(
SQLException
e
)
{
logger
.
error
(
"Failed to execute sql."
,
e
);
}
finally
{
if
(
sqlExecute
!=
null
)
{
try
{
sqlExecute
.
closeConnection
();
}
catch
(
SQLException
e
)
{
logger
.
error
(
"Failed to close connection."
,
e
);
}
}
}
return
SUCCESS
;
}
@RequestMapping
(
"/healthCheck"
)
@ResponseBody
public
String
healthCheck
()
{
// your codes
return
SUCCESS
;
}
}
test/plugin/scenarios/mysql-scenario/src/main/resources/application.yaml
0 → 100644
浏览文件 @
c0c898cf
#
# 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
:
/mysql-scenario
logging
:
config
:
classpath:log4j2.xml
\ No newline at end of file
test/plugin/scenarios/mysql-scenario/src/main/resources/jdbc.properties
0 → 100644
浏览文件 @
c0c898cf
# 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
# "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.
mysql.url
=
jdbc:mysql://mysql-server:3306/test?serverTimezone=CST
mysql.username
=
root
mysql.password
=
root
test/plugin/scenarios/mysql-scenario/src/main/resources/log4j2.xml
0 → 100644
浏览文件 @
c0c898cf
<?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.
~
-->
<Configuration
status=
"WARN"
>
<Appenders>
<Console
name=
"Console"
target=
"SYSTEM_ERR"
>
<PatternLayout
charset=
"UTF-8"
pattern=
"[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%p] - %l - %m%n"
/>
</Console>
</Appenders>
<Loggers>
<Root
level=
"WARN"
>
<AppenderRef
ref=
"Console"
/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
test/plugin/scenarios/mysql-scenario/support-version.list
0 → 100644
浏览文件 @
c0c898cf
# 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
# "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.
# lists your version here
8.0.15
8.0.14
8.0.13
8.0.12
8.0.11
6.0.6
6.0.5
6.0.4
6.0.3
6.0.2
5.1.45
5.1.44
5.1.43
5.1.42
5.1.41
5.1.40
5.1.39
5.1.38
5.1.37
5.1.36
5.1.35
5.1.34
5.1.33
5.1.32
5.1.31
5.1.30
5.1.29
5.1.28
5.1.27
5.1.26
5.1.25
5.1.24
5.1.23
5.1.22
5.1.21
5.1.20
5.1.19
5.1.18
5.1.17
5.1.16
5.1.15
5.1.14
5.1.13
5.1.12
5.1.11
5.1.10
5.1.9
5.1.8
5.1.6
5.1.5
5.1.4
5.1.3
5.1.2
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录