Package com.dtrules.samples.bookpreview.datamodel

Examples of com.dtrules.samples.bookpreview.datamodel.Customer


        return book;
    }
   
    public DataObj generate() throws Exception {
        request = new Request();
        request.setCustomer(new Customer());
        request.setBook(newBook());
        request.setAccess("turn_page");
        request.setCurrent_date(sdf.parse("01/02/2011"));
        request.setPage_number(randint(request.getBook().getPages())+1);
       
        Customer customer = request.getCustomer();
        int num_openbooks = randint(5)+1;
        for(int i=0; i<num_openbooks; i++){
            Open_Book ob = new Open_Book();
            ob.setBook(newBook());
            customer.getOpen_books().add(ob);
            ob.setBegin_date(getDate(randint(400)));
        }
        int index = randint(customer.getOpen_books().size());
        customer.getOpen_books().get(index).setBook(request.getBook()); // Make one of the open books match
                                                                        //   the request.
       
        for(int i=0; i<num_openbooks; i++){
            Open_Book  ob          = customer.getOpen_books().get(i);
            Book       b           = ob.getBook();
            int        pages_read  = randint(60);
            int        this_page   = randint(5)+1;
            Chapter    c           = b.getChapters().get(0);
           
View Full Code Here


      return book;
  }
 
  public DataObj generate() throws Exception {
      request = new Request();
      request.setCustomer(new Customer());
      request.setBook(newBook());
      request.setAccess("turn_page");
      request.setCurrent_date(sdf.parse("01/02/2011"));
      request.setPage_number(randint(request.getBook().getPages())+1);
     
      Customer customer = request.getCustomer();
      int num_openbooks = randint(5)+1;
      for(int i=0; i<num_openbooks; i++){
          Open_Book ob = new Open_Book();
          ob.setBook(newBook());
          customer.getOpen_books().add(ob);
          ob.setBegin_date(getDate(randint(400)));
      }
      int index = randint(customer.getOpen_books().size());
      customer.getOpen_books().get(index).setBook(request.getBook()); // Make one of the open books match
                                                                      //   the request.
     
      for(int i=0; i<num_openbooks; i++){
          Open_Book  ob          = customer.getOpen_books().get(i);
          Book       b           = ob.getBook();
          int        pages_read  = randint(60);
          int        this_page   = randint(5)+1;
          Chapter    c           = b.getChapters().get(0);
         
View Full Code Here

      return book;
  }
 
  public DataObj generate() throws Exception {
      request = new Request();
      request.setCustomer(new Customer());
      request.setBook(newBook());
      request.setAccess("turn_page");
      request.setCurrent_date(sdf.parse("01/02/2011"));
      request.setPage_number(randint(request.getBook().getPages())+1);
     
      Customer customer = request.getCustomer();
      int num_openbooks = randint(5)+1;
      for(int i=0; i<num_openbooks; i++){
          Open_Book ob = new Open_Book();
          ob.setBook(newBook());
          customer.getOpen_books().add(ob);
          ob.setBegin_date(getDate(randint(400)));
      }
      int index = randint(customer.getOpen_books().size());
      customer.getOpen_books().get(index).setBook(request.getBook()); // Make one of the open books match
                                                                      //   the request.
     
      for(int i=0; i<num_openbooks; i++){
          Open_Book  ob          = customer.getOpen_books().get(i);
          Book       b           = ob.getBook();
          int        pages_read  = randint(60);
          int        this_page   = randint(5)+1;
          Chapter    c           = b.getChapters().get(0);
         
View Full Code Here

TOP

Related Classes of com.dtrules.samples.bookpreview.datamodel.Customer

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.