提交 91f1cd59 编写于 作者: Z zhangxin10

1.添加测试用例

上级 3bab15ef
package com.ai.cloud.skywalking.plugin.spring;
package com.ai.cloud.skywalking.plugin.spring.test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class TestBean {
private String value;
......
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://10.1.241.20:31306/sw_db
jdbc.username=sw_dbusr01
jdbc.password=sw_dbusr01
jdbc.maxTotal=200
jdbc.maxIdle=50
jdbc.maxWaitMillis=1000
jdbc.defaultAutoCommit=false
\ No newline at end of file
......@@ -3,14 +3,48 @@
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:skywalking="http://cloud.asiainfo.com/schema/skywalking"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://cloud.asiainfo.com/schema/skywalking
http://cloud.asiainfo.com/schema/skywalking/skywalking.xsd">
http://cloud.asiainfo.com/schema/skywalking/skywalking.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">
<skywalking:trace className="TestBean" method="testPrintln*" packageName="*"/>
<bean class="com.ai.cloud.skywalking.plugin.spring.TestBean">
<property name="value" value="Hello World"/>
<context:component-scan base-package="com.ai.cloud.skywalking.plugin.spring.test"/>
<bean id="jdbcConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="order" value="1" />
<property name="ignoreUnresolvablePlaceholders" value="true" />
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="locations" value="classpath:jdbc.properties" />
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 注解事务类 -->
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
<!--AOP 事务配置-->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<skywalking:trace className="TestBean*" method="*" packageName="*"/>
</beans>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册