javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——测试
生活随笔
收集整理的這篇文章主要介紹了
javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——测试
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Dept測(cè)試
@Testpublic void test() {ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");IDeptService deptService = (IDeptService) ctx.getBean("wsClient");List<Dept> depts = deptService.getDepts();for (Dept dept : depts) {System.out.println("部門名稱:"+dept.getDname()+",部門地址:"+dept.getLoc());System.out.println("員工表:"+dept.getEmps());}}Emp測(cè)試 IEmpService empService;@Beforepublic void init(){ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");empService=(IEmpService)ctx.getBean("wsClientEmp");}@Testpublic void testGetEmps() {List<Emp> getEmps= empService.getEmps();for (Emp emp : getEmps) {System.out.println(emp.getEname());System.out.print("\t"+emp.getJob());System.out.print("\t"+emp.getComm());System.out.print("\t"+emp.getDept().getDname());}}@Testpublic void testGetEmpById() {Emp emp = empService.getEmpById(7369);System.out.println(emp.getEname()+"*********"+emp.getEmpno()+"*********"+emp.getDept().getDname());}
總結(jié)
以上是生活随笔為你收集整理的javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——测试的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: javaWeb服务详解【客户端调用】(含
- 下一篇: 教你如何配置一台台式电脑?