コード例 #1
0
  /** testRemoveWard2 */
  public void testRemoveWard2() {
    try {
      assertNotNull(wd1.removeWard(1L, 1L));
    } catch (DBException e) {
      // TODO
    }

    try {
      expect(factory2.getConnection()).andThrow(new SQLException());
      ctrl.replay();
      wd2.removeWard(1L, 1L);
      fail();
    } catch (Exception e) {
      // TODO
    }
  }
コード例 #2
0
  /** testUpdateWardRoom */
  public void testUpdateWardRoom() {
    WardRoomBean wb = new WardRoomBean(0, 0, 0, "name1", "status");
    try {
      assertEquals(0, wd1.updateWardRoom(wb));
    } catch (DBException e) {
      // TODO
    }

    try {
      expect(factory2.getConnection()).andThrow(new SQLException());
      ctrl.replay();
      wd2.updateWardRoom(wb);
      fail();
    } catch (Exception e) {
      // TODO
    }
  }
コード例 #3
0
  /** testAssignHCPToWard */
  public void testAssignHCPToWard() {
    try {
      assertTrue(wd1.assignHCPToWard(1L, 1L));
    } catch (DBException e) {
      // TODO
    } catch (ITrustException e) {
      // TODO
    }

    try {
      expect(factory2.getConnection()).andThrow(new SQLException());
      ctrl.replay();
      wd2.assignHCPToWard(1L, 1L);
      fail();
    } catch (Exception e) {
      // TODO
    }
  }
コード例 #4
0
  /** testgetAllWardsByHospitalID */
  public void testgetAllWardsByHospitalID() {
    List<WardBean> list = new ArrayList<WardBean>();

    try {
      list = wd1.getAllWardsByHospitalID("1");
      assertNotNull(list);
    } catch (DBException e) {
      // TODO
    }

    try {
      expect(factory2.getConnection()).andThrow(new SQLException());
      ctrl.replay();
      wd2.getAllWardsByHospitalID("1");
      fail();
    } catch (Exception e) {
      // TODO
    }
  }
コード例 #5
0
  /** testGetHospitalByWard */
  public void testGetHospitalByWard() {
    HospitalBean hb = new HospitalBean();

    try {
      hb = wd1.getHospitalByWard("name");
      assertNull(hb);
    } catch (DBException e) {
      // TODO
    }

    try {
      expect(factory2.getConnection()).andThrow(new SQLException());
      ctrl.replay();
      wd2.getHospitalByWard("name");
      fail();
    } catch (Exception e) {
      // TODO
    }
  }
コード例 #6
0
  /** testGetWardRoom */
  public void testGetWardRoom() {
    WardRoomBean wrb = new WardRoomBean(0, 0, 0, "name", "status");

    try {
      wrb = wd1.getWardRoom("0");
      assertNull(wrb);
    } catch (DBException e) {
      // TODO
    }

    try {
      expect(factory2.getConnection()).andThrow(new SQLException());
      ctrl.replay();
      wd2.getWardRoom("0");
      fail();
    } catch (Exception e) {
      // TODO
    }
  }
コード例 #7
0
  /** testgetAllHCPsAssignedToWard */
  public void testgetAllHCPsAssignedToWard() {
    List<PersonnelBean> list = new ArrayList<PersonnelBean>();

    try {
      list = wd1.getAllHCPsAssignedToWard(1L);
      assertNotNull(list);
    } catch (DBException e) {
      // TODO
    }

    try {
      expect(factory2.getConnection()).andThrow(new SQLException());
      ctrl.replay();
      wd2.getAllHCPsAssignedToWard(1L);
      fail();
    } catch (Exception e) {
      // TODO
    }
  }
コード例 #8
0
  /** testAddWard */
  public void testAddWard() {
    WardBean wb = new WardBean(0L, "name", 0L);

    try {
      assertTrue(wd1.addWard(wb));
    } catch (DBException e) {
      // TODO
    } catch (ITrustException e) {
      // TODO
    }

    try {
      expect(factory2.getConnection()).andThrow(new SQLException());
      ctrl.replay();
      wd2.addWard(wb);
      fail();
    } catch (Exception e) {
      // TODO
    }
  }
コード例 #9
0
  /** testGetWardRoomsByStatus */
  public void testGetWardRoomsByStatus() {

    List<WardRoomBean> list = new ArrayList<WardRoomBean>();

    try {
      list = wd1.getWardRoomsByStatus("status", 1L);
      assertNotNull(list);
    } catch (DBException e) {
      // TODO
    }

    try {
      expect(factory2.getConnection()).andThrow(new SQLException());
      ctrl.replay();
      wd2.getWardRoomsByStatus("status", 1L);
      fail();
    } catch (Exception e) {
      // TODO
    }
  }