public void testIdentityCalculator() throws Exception {
    execute("CRUD.new");
    assertNoErrors();
    setValue("number", "-1"); // needed in this case because 0 is an existing key
    setValue("name", "JUNIT COLOR " + (int) (Math.random() * 200));
    execute("TypicalNotResetOnSave.save");
    assertNoErrors();
    String last = getValue("number");

    execute("CRUD.new");
    assertNoErrors();
    setValue("number", "-1"); // needed in this case because 0 is an existing key
    setValue("name", "JUNIT COLOR " + (int) (Math.random() * 200));
    execute("TypicalNotResetOnSave.save");
    assertNoErrors();
    String next = String.valueOf(Integer.parseInt(last) + 1);
    assertValue("number", next);
  }
Exemple #2
0
  public void setUp() throws Exception {

    String time = String.valueOf((new Date()).getTime()).substring(8);
    String random = String.valueOf(Math.random()).substring(2);
    unique = (time + random);
    serviceName = "javaTastyTest-" + unique;

    JTastyDAO dao = new JTastyMockDAO();

    TastyBean tb = new TastyBean();
    tb.setDao(dao);
    tc = new TastyClient(tastyServerUrl, serviceName);
    tc.setTastyBean(tb);

    logger.debug(tastyServerUrl + "/service/" + serviceName);
    // create the service:
    tc.post(tastyServerUrl + "/service/" + serviceName);
    // add the user:

    tc.beanstatus();
  }