/**
   * Creates a pet.
   *
   * @param name the pet name
   * @param species the pet species
   * @return a new pet
   */
  private Party createPet(String name, String species) {
    Party pet = TestHelper.createPatient(false);

    pet.setName(name);
    IMObjectBean bean = new IMObjectBean(pet);
    Lookup lookup = TestHelper.getLookup("lookup.species", species.toUpperCase(), species, true);
    bean.setValue("species", lookup.getCode());
    return pet;
  }
Beispiel #2
0
 /**
  * Creates and saves a new stock location.
  *
  * @return a new stock location
  */
 public static Party createStockLocation() {
   Party stockLocation = (Party) create(StockArchetypes.STOCK_LOCATION);
   stockLocation.setName("STOCK-LOCATION-" + stockLocation.hashCode());
   save(stockLocation);
   return stockLocation;
 }
Beispiel #3
0
 /**
  * Helper to create a new <em>party.organisationTill</em>.
  *
  * @return a new till
  */
 public static Party createTill() {
   Party till = (Party) create("party.organisationTill");
   till.setName("XTill-" + System.currentTimeMillis());
   save(till);
   return till;
 }