Package org.springframework.samples.petclinic

Examples of org.springframework.samples.petclinic.PetType


        }
        return null;
    }
   
    private void initOwnersAndPets(PrevalentSystem system) {  
        PetType pt1 = new PetType();
        PetType pt2 = new PetType();
        pt1.setName("Cat");
        pt2.setName("Dog");
        pt1 = (PetType) system.save(pt1);
        pt2 = (PetType) system.save(pt2);
       
        Pet p1 = new Pet();
        Pet p2 = new Pet();
View Full Code Here


    public void afterPropertiesSet() throws Exception {
        Assert.notNull(clinic, "Clinic must be provided.");
        petTypes = new LinkedHashMap();
        for (Iterator i = clinic.getPetTypes().iterator(); i.hasNext();) {
            PetType petType = (PetType)i.next();
            petTypes.put(petType.getName(), petType);
        }
    }
View Full Code Here

  public void testGetPetTypes() {
    Collection<PetType> petTypes = this.clinic.getPetTypes();
    assertEquals("JDBC query must show the same number of pet types", super.countRowsInTable("TYPES"),
        petTypes.size());
    PetType t1 = EntityUtils.getById(petTypes, PetType.class, 1);
    assertEquals("cat", t1.getName());
    PetType t4 = EntityUtils.getById(petTypes, PetType.class, 4);
    assertEquals("snake", t4.getName());
  }
View Full Code Here

  private Feed feed;

  @Before
  public void setUp() {
    visitView = new VisitsAtomView();
    PetType dog = new PetType();
    dog.setName("dog");
    Pet bello = new Pet();
    bello.setName("Bello");
    bello.setType(dog);
    Visit belloVisit = new Visit();
    belloVisit.setPet(bello);
View Full Code Here

  public void testGetPetTypes() {
    Collection<PetType> petTypes = this.clinic.getPetTypes();
    assertEquals("JDBC query must show the same number of pet types", super.countRowsInTable("types"),
        petTypes.size());
    PetType t1 = EntityUtils.getById(petTypes, PetType.class, 1);
    assertEquals("cat", t1.getName());
    PetType t4 = EntityUtils.getById(petTypes, PetType.class, 4);
    assertEquals("snake", t4.getName());
  }
View Full Code Here

TOP

Related Classes of org.springframework.samples.petclinic.PetType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.