public void testDepartmentService() { DeptService svc = null; try { Context ctx = getInitialContext(); svc = (DeptService) ctx.lookup(sessionBean); } catch (NamingException e) { fail("DeptService lookup failed: " + e); } defineXSD(); Dept dept = svc.getDept(30); if (dept == null) { fail("Department [30] was not returned by the service."); } dept.setDeptno(dept.getDeptno() + 1); dept.setDname(dept.getDname() + "'"); dept.setLoc(dept.getLoc() + "'"); assertTrue("Department [30] update was unsuccessful.", svc.updateDept(dept)); }
public void removeDept(Dept dept) { dept = em.find(Dept.class, dept.getDeptno()); em.remove(dept); }