Package siena.base.test.model

Examples of siena.base.test.model.PersonLongAutoIDModel


    Batch<DiscoveryModel> batch2 = DiscoveryModel.batch();
    batch2.insert(discs);
  }

  public void testGet() {
    PersonLongAutoIDModel person = PersonLongAutoIDModel.all().filter("lastName", "Tesla").get();
    assertEquals(PERSON_LONGAUTOID_TESLA, person);
  }
View Full Code Here


    assertEquals(200, res.size());
    for(int i=0; i<200; i++){
      assertEquals(discs[i], res.get(i));
    }
   
    PersonLongAutoIDModel person = futurep1.get();
    assertEquals(PERSON_LONGAUTOID_TESLA, person);
    PersonLongAutoIDModel person2 = futurep2.get();
    assertEquals(PERSON_LONGAUTOID_CURIE, person2);
  }
View Full Code Here

    assertEquals(200, res.size());
    for(int i=0; i<200; i++){
      assertEquals(discs[i], res.get(i));
    }
   
    PersonLongAutoIDModel person = futurep1.get();
    assertEquals(PERSON_LONGAUTOID_TESLA, person);
    PersonLongAutoIDModel person2 = futurep2.get();
    assertEquals(PERSON_LONGAUTOID_CURIE, person2);
  }
View Full Code Here

  public void testFetchAsyncAndGetAndResetSync2Models() {
    QueryAsync<DiscoveryModel> qd = DiscoveryModel.all().async();
    Query<PersonLongAutoIDModel> qp = PersonLongAutoIDModel.all();
    SienaFuture<List<DiscoveryModel>> futured = qd.fetch();
   
    PersonLongAutoIDModel person = qp.filter("lastName", "Tesla").get();
    assertEquals(PERSON_LONGAUTOID_TESLA, person);
    PersonLongAutoIDModel person2 = qp.resetData().filter("lastName", "Curie").get();   
    assertEquals(PERSON_LONGAUTOID_CURIE, person2);
   
    List<DiscoveryModel> res = futured.get();
    assertEquals(200, res.size());
    for(int i=0; i<200; i++){
View Full Code Here

    QueryAsync<DiscoveryModel> qd = DiscoveryModel.all().async();
    QueryAsync<PersonLongAutoIDModel> qp = PersonLongAutoIDModel.all().async();
    SienaFuture<List<DiscoveryModel>> futured = qd.paginate(50).fetch();

    SienaFuture<PersonLongAutoIDModel> futurep1 = qp.filter("lastName", "Tesla").get();
    PersonLongAutoIDModel person = futurep1.get();
    assertEquals(PERSON_LONGAUTOID_TESLA, person);
   
    List<DiscoveryModel> res = futured.get();
    assertEquals(50, res.size());
    for(int i=0; i<50; i++){
      assertEquals(discs[i], res.get(i));
    }

    futured = qd.nextPage().fetch();
   
    SienaFuture<PersonLongAutoIDModel> futurep2 = qp.resetData().filter("lastName", "Curie").get();
    PersonLongAutoIDModel person2 = futurep2.get();
    assertEquals(PERSON_LONGAUTOID_CURIE, person2);
   
    res = futured.get();
    assertEquals(50, res.size());
    for(int i=0; i<50; i++){
View Full Code Here

    QueryAsync<DiscoveryModel> qd = DiscoveryModel.all().async().stateful();
    QueryAsync<PersonLongAutoIDModel> qp = PersonLongAutoIDModel.all().async();
    SienaFuture<List<DiscoveryModel>> futured = qd.paginate(50).fetch();

    SienaFuture<PersonLongAutoIDModel> futurep1 = qp.filter("lastName", "Tesla").get();
    PersonLongAutoIDModel person = futurep1.get();
    assertEquals(PERSON_LONGAUTOID_TESLA, person);
   
    List<DiscoveryModel> res = futured.get();
    assertEquals(50, res.size());
    for(int i=0; i<50; i++){
      assertEquals(discs[i], res.get(i));
    }

    futured = qd.nextPage().fetch();
   
    SienaFuture<PersonLongAutoIDModel> futurep2 = qp.resetData().filter("lastName", "Curie").get();
    PersonLongAutoIDModel person2 = futurep2.get();
    assertEquals(PERSON_LONGAUTOID_CURIE, person2);
   
    res = futured.get();
    assertEquals(50, res.size());
    for(int i=0; i<50; i++){
View Full Code Here

    QueryAsync<DiscoveryModel> qd = DiscoveryModel.all().stateful().async();
    QueryAsync<PersonLongAutoIDModel> qp = PersonLongAutoIDModel.all().async();
    SienaFuture<List<DiscoveryModel>> futured = qd.paginate(50).fetch();

    SienaFuture<PersonLongAutoIDModel> futurep1 = qp.filter("lastName", "Tesla").get();
    PersonLongAutoIDModel person = futurep1.get();
    assertEquals(PERSON_LONGAUTOID_TESLA, person);
   
    List<DiscoveryModel> res = futured.get();
    assertEquals(50, res.size());
    for(int i=0; i<50; i++){
      assertEquals(discs[i], res.get(i));
    }

    futured = qd.nextPage().fetch();
   
    SienaFuture<PersonLongAutoIDModel> futurep2 = qp.resetData().filter("lastName", "Curie").get();
    PersonLongAutoIDModel person2 = futurep2.get();
    assertEquals(PERSON_LONGAUTOID_CURIE, person2);
   
    res = futured.get();
    assertEquals(50, res.size());
    for(int i=0; i<50; i++){
View Full Code Here

  public void testFetchPaginateStatefulAsyncAndGetAndResetSync2Models() {
    QueryAsync<DiscoveryModel> qd = DiscoveryModel.all().stateful().async();
    Query<PersonLongAutoIDModel> qp = PersonLongAutoIDModel.all();
    SienaFuture<List<DiscoveryModel>> futured = qd.paginate(50).fetch();

    PersonLongAutoIDModel person = qp.filter("lastName", "Tesla").get();
    assertEquals(PERSON_LONGAUTOID_TESLA, person);
   
    List<DiscoveryModel> res = futured.get();
    assertEquals(50, res.size());
    for(int i=0; i<50; i++){
      assertEquals(discs[i], res.get(i));
    }

    futured = qd.nextPage().fetch();
   
    PersonLongAutoIDModel person2 = qp.resetData().filter("lastName", "Curie").get();
    assertEquals(PERSON_LONGAUTOID_CURIE, person2);
   
    res = futured.get();
    assertEquals(50, res.size());
    for(int i=0; i<50; i++){
View Full Code Here

  public void testFetchPaginateAsync2Sync2AsyncAndGetAndResetSync2Models() {
    QueryAsync<DiscoveryModel> qd = DiscoveryModel.all().async();
    Query<PersonLongAutoIDModel> qp = PersonLongAutoIDModel.all();
    SienaFuture<List<DiscoveryModel>> futured = qd.paginate(50).fetch();

    PersonLongAutoIDModel person = qp.filter("lastName", "Tesla").get();
    assertEquals(PERSON_LONGAUTOID_TESLA, person);
   
    List<DiscoveryModel> res = futured.get();
    assertEquals(50, res.size());
    for(int i=0; i<50; i++){
      assertEquals(discs[i], res.get(i));
    }

    PersonLongAutoIDModel person2 = qp.resetData().filter("lastName", "Curie").get();
    assertEquals(PERSON_LONGAUTOID_CURIE, person2);
   
    res = qd.sync().nextPage().fetch();
    assertEquals(50, res.size());
    for(int i=0; i<50; i++){
      assertEquals(discs[i+50], res.get(i));
    }

    PersonLongAutoIDModel person3 = qp.resetData().filter("lastName", "Einstein").get();
    assertEquals(PERSON_LONGAUTOID_EINSTEIN, person3);

    futured = qd.nextPage().fetch();
    res = futured.get();
    assertEquals(50, res.size());
View Full Code Here

TOP

Related Classes of siena.base.test.model.PersonLongAutoIDModel

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.