javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——测试
2017-06-02 17:16
453 查看
Dept测试
@Test
public 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测试
IEmpService empService;
@Before
public void init(){
ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
empService=(IEmpService)ctx.getBean("wsClientEmp");
}
@Test
public 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());
}
}
@Test
public void testGetEmpById() {
Emp emp = empService.getEmpById(7369);
System.out.println(emp.getEname()+"*********"+emp.getEmpno()+"*********"+emp.getDept().getDname());
}
@Test
public 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测试
IEmpService empService;
@Before
public void init(){
ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
empService=(IEmpService)ctx.getBean("wsClientEmp");
}
@Test
public 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());
}
}
@Test
public void testGetEmpById() {
Emp emp = empService.getEmpById(7369);
System.out.println(emp.getEname()+"*********"+emp.getEmpno()+"*********"+emp.getDept().getDname());
}
相关文章推荐
- javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——Emp实体类
- javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——DeptService层
- javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——applicationContext.xml
- javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——EmpService层
- javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——Dept实体类
- javaWeb服务详解(含源代码,测试通过,注释) ——Dept的Dao层
- javaWeb服务详解(含源代码,测试通过,注释) ——Dept实体类
- javaWeb服务详解(含源代码,测试通过,注释) ——Emp的Service层
- javaWeb服务详解(含源代码,测试通过,注释) ——applicationContext-dao.xml
- javaWeb服务详解(含源代码,测试通过,注释) ——web.xml
- javaWeb服务详解(含源代码,测试通过,注释) ——Emp实体类
- javaWeb服务详解(含源代码,测试通过,注释)
- javaWeb服务详解(含源代码,测试通过,注释) ——Dept的Service层
- javaWeb服务详解(含源代码,测试通过,注释) ——applicationContext.xml
- javaWeb服务详解(含源代码,测试通过,注释) ——applicationContext-Service.xml
- [置顶] arcgis api for js入门开发系列十三 通过Ajax的调用执行GP服务 (含源代码)
- 通过Jersey客户端API调用RestFul风格的Web服务
- 用Jersey构建RESTful服务4--通过jersey-client客户端调用Jersey的Web服务模拟CURD
- EJB客户端应用通过JNDI调用远程EJB的方法详解
- 通过 Jersey 客户端 API 调用 REST 风格的 Web 服务