zoukankan      html  css  js  c++  java
  • javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——测试

    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("	"+emp.getJob());
    			System.out.print("	"+emp.getComm());
    			System.out.print("	"+emp.getDept().getDname());
    		}
    	}
    	
    	@Test
    	public void testGetEmpById() {
    		Emp emp = empService.getEmpById(7369);
    	
    			System.out.println(emp.getEname()+"*********"+emp.getEmpno()+"*********"+emp.getDept().getDname());
    		
    	}
    


  • 相关阅读:
    TCP/IP详解卷:协议 第八章简要总结
    渗透测试1
    以前的实验博客地址,以前使用csdn
    day03---Node (05)
    day03---Vue(04)
    day03---Vue(03)
    day03---ES6入门(02)
    day03---前端开发和前端开发工具(01)
    Docker实战总结
    ETL之Kettle入门
  • 原文地址:https://www.cnblogs.com/a1111/p/12816226.html
Copyright © 2011-2022 走看看