package cn.com.countrygarden.bi.main.util;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = "classpath*:spring/applicationContext.xml")
public class AxisUtilsTest {
    /** 社区创新接口url **/
    @Value("${iWebService.url}")
    private String wsUrl;
    /** 社区创新接口方法 **/
    @Value("${iWebService.method.communityReview}")
    private String wsMetodCommunityReview;
//    /** 社区创新接口命名空间 **/
//    @Value("${iWebService.namespaceUri.one}")
//    private String wsNamespaceUriOne;
//    @Value("${iWebService.localPart}")
//    private String wsLocalPart;

    @Test
    public void callService() throws Exception {
        Object[] args = new Object[2];
        args[0] = "2019-01-01";
        args[1] = "2019-12-12";
        String res = AxisUtils.callService(wsUrl, wsMetodCommunityReview, args);
        System.out.println("res:" + res);
    }

    @Test
    public void callService2() throws Exception {
        Object[] args = new Object[2];
        args[0] = "2018-01-01";
        args[1] = "2019-12-12";
        String res = AxisUtils.callService(wsUrl, wsMetodCommunityReview, args);
        System.out.println("res:" + res);
    }

}