package com.hxh.spring.test.dubbo;
|
|
import com.yeshi.buwan.service.manager.SeataManagerTest;
|
import org.junit.Test;
|
import org.junit.runner.RunWith;
|
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.web.WebAppConfiguration;
|
|
import javax.annotation.Resource;
|
|
@RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试
|
@ContextConfiguration(locations = {"classpath:spring.xml"})
|
@WebAppConfiguration
|
public class SeataTest {
|
|
|
@Resource
|
private SeataManagerTest seataManagerTest;
|
|
@Test
|
public void getApp() {
|
try {
|
seataManagerTest.addGetResource();
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
|
try {
|
Thread.sleep(10000);
|
} catch (InterruptedException e) {
|
e.printStackTrace();
|
}
|
}
|
|
|
}
|