remove useless testcase
This commit is contained in:
parent
7553dff4df
commit
2401428ece
|
|
@ -1,54 +0,0 @@
|
|||
#skyWalking用户ID
|
||||
skywalking.user_id=123
|
||||
#skyWalking应用编码
|
||||
skywalking.application_code=skywalking-sample-dubbo
|
||||
#skywalking auth的环境变量名字
|
||||
skywalking.auth_system_env_name=SKYWALKING_RUN
|
||||
#skywalking数据编码
|
||||
skywalking.charset=UTF-8
|
||||
skywalking.auth_override=true
|
||||
#是否使用STD替换日志输出
|
||||
skywalking.logger_std_out_override=false;
|
||||
|
||||
#是否打印数据
|
||||
buriedpoint.printf=true
|
||||
#埋点异常的最大长度
|
||||
buriedpoint.max_exception_stack_length=4000
|
||||
#业务字段的最大长度
|
||||
buriedpoint.businesskey_max_length=300
|
||||
#过滤异常
|
||||
buriedpoint.exclusive_exceptions=java.lang.RuntimeException
|
||||
|
||||
#最大发送者的连接数阀比例
|
||||
sender.connect_percent=100
|
||||
#发送服务端配置
|
||||
sender.servers_addr=127.0.0.1:34000
|
||||
#最大发送的副本数量
|
||||
sender.max_copy_num=2
|
||||
#发送的最大长度
|
||||
sender.max_send_length=20000
|
||||
#当没有Sender时,尝试获取sender的等待周期
|
||||
sender.retry_get_sender_wait_interval=2000
|
||||
|
||||
#最大消费线程数
|
||||
consumer.max_consumer=0
|
||||
#消费者最大等待时间
|
||||
consumer.max_wait_time=5
|
||||
#发送失败等待时间
|
||||
consumer.consumer_fail_retry_wait_interval=50
|
||||
|
||||
#每个Buffer的最大个数
|
||||
buffer.buffer_max_size=18000
|
||||
#Buffer池的最大长度
|
||||
buffer.pool_size=5
|
||||
|
||||
#发送检查线程检查周期
|
||||
senderchecker.check_polling_time=200
|
||||
|
||||
#自定义本地方法插件是否开启
|
||||
plugin.customlocalmethodinterceptorplugin.is_enable=true
|
||||
#自定义插件拦截的包前缀
|
||||
plugin.customlocalmethodinterceptorplugin.package_prefix=test.com.ai.cloud.skywalking.agent.test.custom.localmethod.*
|
||||
#自定义插件是否记录入参
|
||||
plugin.customlocalmethodinterceptorplugin.record_param_enable=true
|
||||
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-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">
|
||||
<parent>
|
||||
<artifactId>skywalking-agent-test</artifactId>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<version>2.0-2016</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>custom-local-method-test</artifactId>
|
||||
|
||||
|
||||
</project>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.a.eye.skywalking.agent.test.custom.localmethod;
|
||||
|
||||
import com.ai.skywalking.testframework.api.RequestSpanAssert;
|
||||
import test.com.a.eye.skywalking.agent.test.custom.localmethod.TestObject;
|
||||
import test.com.a.eye.skywalking.agent.test.custom.localmethod.TestParam;
|
||||
|
||||
public class CustomLocalMethodPluginTest {
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
TestObject testObject = new TestObject();
|
||||
TestObject.staticPrintlnHelloWorld("AAAA", new TestParam("A", "B"));
|
||||
testObject.printlnHelloWorld(new TestParam("B", "C"));
|
||||
|
||||
RequestSpanAssert.assertEquals(new String[][] {
|
||||
{"0", "test.com.a.eye.skywalking.agent.test.custom.localmethod.TestObject.printlnHelloWorld()", ""},
|
||||
{"0", "test.com.a.eye.skywalking.agent.test.custom.localmethod.TestObject.staticPrintlnHelloWorld()", ""}
|
||||
},true);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package test.com.a.eye.skywalking.agent.test.custom.localmethod;
|
||||
|
||||
public class TestObject {
|
||||
|
||||
public static void staticPrintlnHelloWorld(String aa, TestParam param){
|
||||
System.out.println("Hello World" + aa);
|
||||
}
|
||||
|
||||
public void printlnHelloWorld(TestParam... params){
|
||||
System.out.println("Hello World");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package test.com.a.eye.skywalking.agent.test.custom.localmethod;
|
||||
|
||||
/**
|
||||
* Created by xin on 16/8/12.
|
||||
*/
|
||||
public class TestParam {
|
||||
private String a;
|
||||
private String b;
|
||||
|
||||
public TestParam(String a, String b) {
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<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>skywalking-agent-test</artifactId>
|
||||
<groupId>com.a.eye</groupId>
|
||||
<version>2.0-2016</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jdbc-test</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>jdbc-test</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.36</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.oracle</groupId>
|
||||
<artifactId>ojdbc14</artifactId>
|
||||
<version>10.2.0.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
package com.a.eye.skywalking.agent.test.mysql;
|
||||
|
||||
import com.ai.skywalking.testframework.api.RequestSpanAssert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Created by xin on 16-6-15.
|
||||
*/
|
||||
public class JDBCPluginTest {
|
||||
|
||||
@Test
|
||||
public void testMysqlJDBC() throws ClassNotFoundException, SQLException {
|
||||
Class.forName("com.mysql.jdbc.Driver");
|
||||
String url = "jdbc:mysql://127.0.0.1:3306/test?user=root&password=root";
|
||||
Connection con = DriverManager.getConnection(url);
|
||||
con.setAutoCommit(false);
|
||||
|
||||
PreparedStatement p0 = con.prepareStatement("select 1 from dual where 1=?");
|
||||
p0.setInt(1, 1);
|
||||
p0.execute();
|
||||
con.commit();
|
||||
con.close();
|
||||
RequestSpanAssert.assertEquals(
|
||||
new String[][] {{"0", "jdbc:mysql://127.0.0.1:3306/test?user=root&password=root(null)", "preaparedStatement.executeUpdate:select 1 from dual where 1=?"},
|
||||
{"0", "jdbc:mysql://127.0.0.1:3306/test?user=root&password=root(null)", "connection.commit"},
|
||||
{"0", "jdbc:mysql://127.0.0.1:3306/test?user=root&password=root(null)", "connection.close"},}, true);
|
||||
|
||||
RequestSpanAssert.clearTraceData();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOracleJDBC() throws ClassNotFoundException, SQLException {
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
String url = "jdbc:oracle:thin:@10.1.130.239:1521:ora";
|
||||
Connection con = DriverManager.getConnection(url, "edc_export", "edc_export");
|
||||
con.setAutoCommit(false);
|
||||
|
||||
PreparedStatement p0 = con.prepareStatement("select 1 from dual where 1=?");
|
||||
p0.setInt(1, 1);
|
||||
p0.execute();
|
||||
con.commit();
|
||||
con.close();
|
||||
RequestSpanAssert.assertEquals(
|
||||
new String[][] {{"0", "jdbc:oracle:thin:@10.1.130.239:1521:ora(edc_export)", "preaparedStatement.executeUpdate:select 1 from dual where 1=?"},
|
||||
{"0", "jdbc:oracle:thin:@10.1.130.239:1521:ora(edc_export)", "connection.commit"},
|
||||
{"0", "jdbc:oracle:thin:@10.1.130.239:1521:ora(edc_export)", "connection.close"},}, true);
|
||||
|
||||
RequestSpanAssert.clearTraceData();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="debug">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="debug">
|
||||
<AppenderRef ref="Console"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
buriedpoint.businesskey_max_length=300
|
||||
sender.retry_get_sender_wait_interval=2000
|
||||
buffer.pool_size=5
|
||||
senderchecker.check_polling_time=200
|
||||
sender.max_send_length=20000
|
||||
consumer.max_consumer=0
|
||||
consumer.max_wait_time=5
|
||||
sender.max_copy_num=2
|
||||
skywalking.application_code=jdbc-plugin-test
|
||||
consumer.consumer_fail_retry_wait_interval=50
|
||||
skywalking.user_id=6
|
||||
buriedpoint.printf=true
|
||||
buriedpoint.exclusive_exceptions=
|
||||
buriedpoint.max_exception_stack_length=4000
|
||||
sender.connect_percent=100
|
||||
buffer.buffer_max_size=18000
|
||||
sender.servers_addr=10.1.235.197:34000;10.1.235.197:35000;
|
||||
skywalking.sdk_version=1.0a2
|
||||
skywalking.auth_override=true
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
<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>com.a.eye</groupId>
|
||||
<artifactId>skywalking-agent-test</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.0-2016</version>
|
||||
|
||||
<name>skywalking-agent-test</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<modules>
|
||||
<module>redis-test</module>
|
||||
<module>jdbc-test</module>
|
||||
<module>custom-local-method-test</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.4.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
#Redis agent test project
|
||||
|
||||
##目标 Target
|
||||
主要是为了测试Redis插件在agent模式下是否正常工作. Redis agent test project test redis plugin work well on agent model
|
||||
|
||||
##结构
|
||||
Redis agent test project主要包含Redis的两个功能的测试. Redis agent test project contain two function test
|
||||
1. 单机的Redis的测试. Single redis model
|
||||
2. 集群的Redis的测试. Cluster redis model
|
||||
|
||||
##测试环境搭建 Build test environment
|
||||
###安装单机版的Redis Install single redis
|
||||
1. 下载 Download
|
||||
[下载地址](http://download.redis.io/releases/redis-3.2.0.tar.gz) [Download Link](http://download.redis.io/releases/redis-3.2.0.tar.gz)
|
||||
2. 解压 Unpack
|
||||
```shell
|
||||
$> tar -cvf redis-3.2.0.tar.gz
|
||||
```
|
||||
3. 运行下列命令 Run the command as follow
|
||||
```shell
|
||||
$> cd REDIS_HOME
|
||||
$> ./src/redis-server ../redis.conf
|
||||
```
|
||||
|
||||
###安装集群版的Redis Install the cluster redis
|
||||
1. 下载 Download
|
||||
[下载地址](http://download.redis.io/releases/redis-3.2.0.tar.gz) [Download Link](http://download.redis.io/releases/redis-3.2.0.tar.gz)
|
||||
2. 解压 Unpack
|
||||
```shell
|
||||
$> tar -cvf redis-3.2.0.tar.gz
|
||||
```
|
||||
3. 创建并启动集群节点 Create and run cluster node
|
||||
例如创建一个7000端口的节点,需要根据实际情况修改redis.conf参数, For example create cluster node that the port is 7000, and
|
||||
Redis.conf need to modify the parameters according to the actual situation
|
||||
```
|
||||
$>cd REDIS_HOME
|
||||
$>mkdir -p cluster/7000
|
||||
$>cp redis.conf cluster/7000
|
||||
$> cd cluster/7000/
|
||||
$> ../../src/redis-server redis.conf
|
||||
```
|
||||
4. 启动集群 Start the cluster
|
||||
```shell
|
||||
redis-trib.rb create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005
|
||||
```
|
||||
|
||||
## 启动测试 Run test case
|
||||
启动测试用例时,VM参数中需要添加以下的vm参数。**注意**:测试中的环境参数可能跟随机器变化,所以可能需要进行修改。
|
||||
When you start the test case, VM parameters need to add the following parameters vm. **Notice** :The test environment parameters may change following the machine, it may need to be modified.
|
||||
```
|
||||
-javaagent:${SKYWALKING_AGENT_TEST_PROJECT_PATH}/lib/skywalking-agent-2.0-2016.jar
|
||||
```
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<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>com.a.eye</groupId>
|
||||
<artifactId>skywalking-agent-test</artifactId>
|
||||
<version>2.0-2016</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>redis-test</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>redis-test</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>2.8.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
package com.a.eye.skywalking.agent.test;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import redis.clients.jedis.HostAndPort;
|
||||
import redis.clients.jedis.JedisCluster;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashSet;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Created by xin on 16-6-13.
|
||||
*/
|
||||
public class RedisClusterOperator {
|
||||
|
||||
private static Logger logger = LogManager.getLogger(RedisClusterOperator.class);
|
||||
private static JedisCluster jedisCluster = null;
|
||||
|
||||
static {
|
||||
InputStream inputStream = RedisOperator.class.getResourceAsStream("/redis.conf");
|
||||
Properties properties = new Properties();
|
||||
try {
|
||||
properties.load(inputStream);
|
||||
} catch (IOException e) {
|
||||
logger.error("Failed to load redis.conf", e);
|
||||
System.exit(-1);
|
||||
}
|
||||
jedisCluster = new JedisCluster(getHostAndPorts(properties.getProperty("redis.cluster.host", "127.0.0.1:7000")));
|
||||
}
|
||||
|
||||
private static Set<HostAndPort> getHostAndPorts(String property) {
|
||||
Set<HostAndPort> redisEnv = new HashSet<HostAndPort>();
|
||||
String[] hosts = property.split(";");
|
||||
for (String host : hosts) {
|
||||
String[] hostAndPort = host.split(":");
|
||||
redisEnv.add(new HostAndPort(hostAndPort[0], Integer.parseInt(hostAndPort[1])));
|
||||
}
|
||||
return redisEnv;
|
||||
}
|
||||
|
||||
|
||||
public static void setData(String key, String value) {
|
||||
jedisCluster.set(key, value);
|
||||
}
|
||||
|
||||
public static String getData(String key) {
|
||||
return jedisCluster.get(key);
|
||||
}
|
||||
|
||||
public static void delData(String key) {
|
||||
jedisCluster.del(key);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
package com.a.eye.skywalking.agent.test;
|
||||
|
||||
import com.ai.skywalking.testframework.api.RequestSpanAssert;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
public class RedisClusterPluginTest {
|
||||
|
||||
@After
|
||||
public void clearData() {
|
||||
RequestSpanAssert.clearTraceData();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testSetData() {
|
||||
RedisClusterOperator.setData("key1", "value1");
|
||||
RequestSpanAssert.assertEquals(new String[][] {
|
||||
// 根据实际情况进行修改
|
||||
{"0.0", "127.0.0.1:7001 set", "key=key1"}, {"0", "127.0.0.1:7001;127.0.0.1:7000; set", "key=key1"},});
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetData() {
|
||||
RedisClusterOperator.getData("key1");
|
||||
RequestSpanAssert.assertEquals(new String[][] {
|
||||
// 根据实际情况进行修改
|
||||
{"0.0", "127.0.0.1:7001 get", "key=key1"}, {"0", "127.0.0.1:7001;127.0.0.1:7000; get", "key=key1"},});
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testDelData() {
|
||||
RedisClusterOperator.delData("key1");
|
||||
RequestSpanAssert.assertEquals(new String[][] {
|
||||
// 根据实际情况进行修改
|
||||
{"0.0", "127.0.0.1:7001 del", "key=key1"}, {"0", "127.0.0.1:7001;127.0.0.1:7000; del", "key=key1"},});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
package com.a.eye.skywalking.agent.test;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisPool;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Created by xin on 16-6-5.
|
||||
*/
|
||||
public class RedisOperator {
|
||||
|
||||
private static Logger logger = LogManager.getLogger(RedisOperator.class);
|
||||
private static JedisPool jedisPool = null;
|
||||
|
||||
static {
|
||||
InputStream inputStream = RedisOperator.class.getResourceAsStream("/redis.conf");
|
||||
Properties properties = new Properties();
|
||||
try {
|
||||
properties.load(inputStream);
|
||||
} catch (IOException e) {
|
||||
logger.error("Failed to load redis.conf", e);
|
||||
System.exit(-1);
|
||||
}
|
||||
jedisPool = new JedisPool(properties.getProperty("redis.ip", "127.0.0.1"),
|
||||
Integer.parseInt(properties.getProperty("redis.port", "6379")));
|
||||
}
|
||||
|
||||
|
||||
public static void setData(String key, String value) throws Exception {
|
||||
Jedis jedis = null;
|
||||
try {
|
||||
jedis = jedisPool.getResource();
|
||||
jedis.set(key, value);
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (jedis != null)
|
||||
jedis.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static String getData(String key) throws Exception {
|
||||
Jedis jedis = null;
|
||||
try {
|
||||
jedis = jedisPool.getResource();
|
||||
return jedis.get(key);
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (jedis != null)
|
||||
jedis.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void delData(String key) throws Exception {
|
||||
Jedis jedis = null;
|
||||
try {
|
||||
jedis = jedisPool.getResource();
|
||||
jedis.del(key);
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (jedis != null)
|
||||
jedis.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package com.a.eye.skywalking.agent.test;
|
||||
|
||||
|
||||
import com.ai.skywalking.testframework.api.RequestSpanAssert;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
public class RedisPluginTest {
|
||||
|
||||
@After
|
||||
public void clearData() {
|
||||
RequestSpanAssert.clearTraceData();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetData() throws Exception {
|
||||
RedisOperator.setData("key1", "value1");
|
||||
RequestSpanAssert.assertEquals(new String[][] {{"0", "127.0.0.1:6379 set", "key=key1"},});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetData() throws Exception {
|
||||
RedisOperator.getData("key1");
|
||||
RequestSpanAssert.assertEquals(new String[][] {{"0", "127.0.0.1:6379 get", "key=key1"},});
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testDelData() throws Exception {
|
||||
RedisOperator.delData("key1");
|
||||
RequestSpanAssert.assertEquals(new String[][] {{"0", "127.0.0.1:6379 del", "key=key1"},});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="debug">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="debug">
|
||||
<AppenderRef ref="Console"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
redis.ip=127.0.0.1
|
||||
redis.port=6379
|
||||
redis.cluster.host=127.0.0.1:7000;127.0.0.1:7001;127.0.0.1:7000;127.0.0.1:7000;127.0.0.1:7000;127.0.0.1:7000;
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#test
|
||||
#Mon Dec 28 11:30:29 CST 2015
|
||||
buriedpoint.businesskey_max_length=300
|
||||
sender.retry_get_sender_wait_interval=2000
|
||||
buffer.pool_size=5
|
||||
senderchecker.check_polling_time=200
|
||||
sender.max_send_length=20000
|
||||
consumer.max_consumer=0
|
||||
consumer.max_wait_time=5
|
||||
sender.max_copy_num=2
|
||||
skywalking.application_code=redis-plugin-test
|
||||
consumer.consumer_fail_retry_wait_interval=50
|
||||
skywalking.user_id=6
|
||||
buriedpoint.printf=true
|
||||
buriedpoint.exclusive_exceptions=
|
||||
buriedpoint.max_exception_stack_length=4000
|
||||
sender.connect_percent=100
|
||||
buffer.buffer_max_size=18000
|
||||
sender.servers_addr=10.1.235.197:34000;10.1.235.197:35000;
|
||||
skywalking.sdk_version=1.0a2
|
||||
skywalking.auth_override=true
|
||||
Loading…
Reference in New Issue