Esempio n. 1
0
  /**
   * testSubmitResultsEvilFactory
   *
   * @throws Exception
   */
  public void testSubmitResultsEvilFactory() throws Exception {
    action = new LabProcLTAction(new EvilDAOFactory());
    LabProcedureBean lp = new LabProcedureBean();
    lp.setLoinc("10763-1");
    lp.setCommentary("");
    lp.setOvID(902L);
    lp.setPid(2L);
    lp.setResults("");
    lp.allow();
    lp.statusReceived();
    lp.setLTID(5000000005L);
    long id = lpDAO.addLabProcedure(lp);
    lp.setProcedureID(id);

    assertFalse(action.submitResults("" + id, "12", "grams", "13", "14"));
  }
Esempio n. 2
0
  /**
   * testSubmiteResults
   *
   * @throws Exception
   */
  public void testSubmitResults() throws Exception {
    LabProcedureBean lp = new LabProcedureBean();
    lp.setLoinc("10763-1");
    lp.setCommentary("");
    lp.setOvID(902L);
    lp.setPid(2L);
    lp.setResults("");
    lp.allow();
    lp.statusReceived();
    lp.setLTID(5000000005L);
    long id = lpDAO.addLabProcedure(lp);
    lp.setProcedureID(id);

    assertTrue(action.submitResults("" + id, "12", "grams", "13", "14"));

    LabProcedureBean procedures = lpDAO.getLabProcedure(id);

    assertEquals("Pending", procedures.getStatus());
    assertEquals("12", procedures.getNumericalResult());
    assertEquals("grams", procedures.getNumericalResultUnit());
    assertEquals("13", procedures.getUpperBound());
    assertEquals("14", procedures.getLowerBound());
  }
Esempio n. 3
0
  /**
   * testSubmiteResultsWronIDNumberFormat
   *
   * @throws FormValidationException
   */
  public void testSubmitResultsWrongIDNumberFormat() throws FormValidationException {

    boolean successfulSubmit = action.submitResults("Test", "99", "99", "100", "0");
    assertFalse(successfulSubmit);
  }