コード例 #1
0
  public void testAddAndRemoveCustomer() throws Exception {

    customer = new Customer();
    customer.setName("John Doe");
    customer.setPhone("928-234-4566");

    customer = mgr.save(customer);
    assertEquals("John Doe", customer.getName());
    Long id = customer.getId();
    log.debug("removing customer...");

    mgr.remove(customer.getId());

    try {
      customer = null;
      customer = mgr.get(id);
    } catch (ObjectRetrievalFailureException orgfe) {
      log.debug("Customer not there");
    }
    assertNull(customer);
  }
コード例 #2
0
  public void testGetItem() throws Exception {
    customer = mgr.get(new Long(1));
    assertNotNull(customer);

    log.debug(customer);
  }