Example #1
0
  @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);
  }
Example #2
0
  @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());
  }