admin
2021-04-12 5129d2c63fbef70c6ee45ba5ec12654937e05231
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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();
        }
    }
 
 
}