@Test public void testDelete() throws Exception { ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml"); ZaihouJiaobDAO zaihjDao = (ZaihouJiaobDAO) ctx.getBean("zaihoujiaobDao"); ZaihouJiaob z = new ZaihouJiaob(); z.setId(1); zaihjDao.delete(z); }
@Test public void testSearch() throws Exception { ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml"); ZaihouJiaobDAO zaihjDao = (ZaihouJiaobDAO) ctx.getBean("zaihoujiaobDao"); ZaihouJiaob z = new ZaihouJiaob(); z.setId(1); Assert.assertEquals(1, zaihjDao.search(z).size()); }