admin
2025-02-20 f537abe9f3646c739beaf15076246a2f71a347e9
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
package com.hxh.spring.test.dubbo;
 
import com.ks.goldcorn.pojo.DO.GoldCornAppInfo;
import com.ks.goldcorn.service.remote.GoldCornAppService;
import org.apache.dubbo.config.annotation.Reference;
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;
 
@RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试
@ContextConfiguration(locations = {"classpath:spring.xml"})
@WebAppConfiguration
public class GoldCornTest {
 
 
    @Reference(version = "1.0")
    private GoldCornAppService goldCornAppService;
 
    @Test
    public void getApp() {
        GoldCornAppInfo app = goldCornAppService.selectByCode("buwan");
        System.out.println(app);
    }
 
 
}