Package org.crank.crud.test.model

Examples of org.crank.crud.test.model.PetClinicInquiry


        paginator.filter();
       
        for (int index = 0; index < 10; index ++) {
          PetClinicLead lead = new PetClinicLead();
          lead.setName("testLead" + index);
          PetClinicInquiry inquiry = new PetClinicInquiry();
          inquiry.setName("testInquiry" + index);
          inquiry.setAnotherProp("testInquiryAP" + index);
          lead.setInquiry(inquiry);
          petClinicInquiryDao.store(inquiry);
          petClinicLeadDao.store(lead);
        }
       
View Full Code Here


    filterableProperty.getComparison().setValue("testLead");
    filterableProperty.getComparison().enable();
    List<Object []> page = (List<Object []>) paginator.getPage();
    for (Object [] row : page) {
      PetClinicLead lead = (PetClinicLead) row[0];
      PetClinicInquiry inquiry = (PetClinicInquiry) row[1];
      assert lead.getName().startsWith("testLead");
      assert inquiry.getName().startsWith("testInquiry");
    }
    System.out.println("----------------------------------------------------");
    assert page != null : "page was not null";
    assert page.size() > 0 : "page size was greater than 0";
    }
View Full Code Here

  }
   
  @Test (groups="reads")
    public void testFailure() {
    long time = System.currentTimeMillis();
    PetClinicInquiry inquiry = new PetClinicInquiry();
    inquiry.setName("inq1");
    inquiry.setBb("ricky" + time);
    this.petClinicInquiryDao.store(inquiry);
   
    PetClinicLead lead = new PetClinicLead();
    lead.setInquiry(inquiry);
   
View Full Code Here

    }

  @Test (groups="reads")
    public void testSuccess() {
    long time = System.currentTimeMillis();
    PetClinicInquiry inquiry = new PetClinicInquiry();
    inquiry.setName("inq1");
    inquiry.setBb("ticky" + time);
    petClinicInquiryDao.store(inquiry);
   
    PetClinicLead lead = new PetClinicLead();
    lead.setInquiry(inquiry);
    lead.setName("golden boy" + time);
   
    petClinicLeadDao.store(lead);
   
    List<Object[]> results = petClinicLeadDao.find(Select.select(Select.select("inquiry")),
          Join.join(Join.entityJoin("PetClinicInquiry", "inquiry")),
          null,
          0,
          1000,
          Comparison.eq("inquiry.bb", true, "ticky" + time));
   
    Object[] objects = results.get(0);
    lead = (PetClinicLead) objects[0];
    inquiry = (PetClinicInquiry) objects[1];
    assertEquals("golden boy" + time, lead.getName());
    assertEquals("inq1", inquiry.getName());
   
    //SELECT  o, inquiry FROM PetClinicLead o, PetClinicInquiry inquiry WHERE  inquiry.bb = :inquiry_bb
    petClinicLeadDao.delete(lead);
    petClinicInquiryDao.delete(inquiry);
   
View Full Code Here

TOP

Related Classes of org.crank.crud.test.model.PetClinicInquiry

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.