cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
38
39
40
41
42
43
44
45
46
47
48
49
50
package cn.ksource.test.remote;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
 
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
import cn.ksource.core.remote.BaseRemote;
import cn.ksource.core.util.HttpRemoteException;
import cn.ksource.core.util.JsonUtil;
 
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/applicationContext_core.xml"})
public class TestRemote {
    
    @Autowired
    private BaseRemote baseRemote;
 
    @Test
    public void testHttp() throws HttpRemoteException {
//        Map map = new HashMap();
//        map.put("search_code", "12345");
//        map.put("remark", "放松放松");
//        map.put("reply_phone", "15803816250");
//        map.put("config_item_third", "seffsd");
//        map.put("search_code", "12345");
//        map.put("order_type", "1");
//        map.put("user_id", "aaaaff");
//        map.put("order_detail", "fsdfsafsd");
//        map.put("solve_time", "2014-05-15");
//        map.put("reply_user", "测试用");
////        Map map1 = baseRemote.queryForMap("http://localhost:8080/cloud_cmdb/business/remote.html", map);
////        System.out.println(JsonUtil.map2Json(map1));
//        String s=baseRemote.queryForString("http://192.168.1.100:8080/cmdb/interface/CI_queryCategory.html", null);
//        System.out.println("s==="+s);
//        JSONArray arr=JSONArray.fromObject(s);
//        System.out.println("==aarr=="+arr);
//        List list=JsonUtil.json2List(s);
//        System.out.println("==========>"+list);
    }
 
}