Esempio n. 1
0
  // Test the change plan when trying to change a student plan
  @Test
  public void transferpairtest() {
    Backend b = new Backend();
    String[] args = new String[1];
    args[0] = "MasterBankAccounts.txt";

    tlist.clear();

    Transaction t = new Transaction();
    t.setCode("10");
    t.setMisc("A");
    t.setName("");

    Transaction t2 = new Transaction();
    t2.setCode("02");
    t2.setNum("00005");

    Transaction t3 = new Transaction();
    t3.setCode("00");

    tlist.add(t);
    tlist.add(t2);
    tlist.add(t3);

    b.load(args);
    b.setTransactions(tlist);
    b.handletransactions();
    assertEquals("Transfer transactions must come in pairs\n", outContent.toString());
  }
Esempio n. 2
0
  // The method doInit is called prior to the others.
  @Override
  protected void doInit() throws ResourceException {
    // On recupere l'id passee dans l'URL
    int id = Integer.valueOf((String) getRequestAttributes().get("people-id"));

    festivalier = backend.getDatabase().getFestivalier(id);
    if (festivalier == null) {
      getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND);
    }
  }