提交Sample工程中Dubbo接口的测试类

This commit is contained in:
ascrutae 2016-07-31 13:23:09 +08:00
parent a0ea987e93
commit ef98793f27
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,18 @@
package com.ai.cloud.skywalking.sample.dubbo.impl;
import com.ai.cloud.skywalking.sample.dubbo.interfaces.SampleDubboInterface;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* Created by xin on 16/7/31.
*/
public class SampleDubboInterfaceImplTest {
@Test
public void testSave(){
ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath*:consumer/dubbo-consumer.xml");
SampleDubboInterface sampleDubboInterface = classPathXmlApplicationContext.getBean(SampleDubboInterface.class);
System.out.println(sampleDubboInterface.callMethodByDubbox("Value"));
}
}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<dubbo:application name="skywalking-sample-dubbo-consumer"/>
<dubbo:registry protocol="zookeeper" address="127.0.0.1:2181"/>
<dubbo:reference id="sampleDubboInterface" interface="com.ai.cloud.skywalking.sample.dubbo.interfaces.SampleDubboInterface"/>
</beans>