Package siena.base.test.model

Examples of siena.base.test.model.DiscoveryStringId


 
  public void testOffsetLimitStatelessPaginateKeys(){
    DiscoveryStringId[] discs = new DiscoveryStringId[150];
    for(int i=0; i<150; i++){
      discs[i] = new DiscoveryStringId("Disc_"+String.format("%03d", i), StringID_CURIE);
    }
    pm.insert((Object[])discs);
   
    Query<DiscoveryStringId> query = pm.createQuery(DiscoveryStringId.class).order("name");
    List<DiscoveryStringId> res = query.paginate(50).fetchKeys();
View Full Code Here


  }
 
  public void testOffsetLimitStatefulPaginateKeys(){
    DiscoveryStringId[] discs = new DiscoveryStringId[300];
    for(int i=0; i<300; i++){
      discs[i] = new DiscoveryStringId("Disc_"+String.format("%03d", i), StringID_CURIE);
    }
    pm.insert((Object[])discs);
   
    Query<DiscoveryStringId> query = pm.createQuery(DiscoveryStringId.class).order("name").stateful();
    List<DiscoveryStringId> res = query.paginate(50).fetchKeys();
View Full Code Here

  }
 
  public void testOffsetLimitStatelessPaginate2Keys(){
    DiscoveryStringId[] discs = new DiscoveryStringId[300];
    for(int i=0; i<300; i++){
      discs[i] = new DiscoveryStringId("Disc_"+String.format("%03d", i), StringID_CURIE);
    }
    pm.insert((Object[])discs);
   
    Query<DiscoveryStringId> query = pm.createQuery(DiscoveryStringId.class).order("name");
    List<DiscoveryStringId> res = query.limit(50).offset(12).fetchKeys();
View Full Code Here

  }
 
  public void testOffsetLimitStatefulPaginate2Keys(){
    DiscoveryStringId[] discs = new DiscoveryStringId[300];
    for(int i=0; i<300; i++){
      discs[i] = new DiscoveryStringId("Disc_"+String.format("%03d", i), StringID_CURIE);
    }
    pm.insert((Object[])discs);
   
    Query<DiscoveryStringId> query = pm.createQuery(DiscoveryStringId.class).order("name").stateful();
    List<DiscoveryStringId> res = query.limit(50).offset(12).fetchKeys();
View Full Code Here

  }
 
  public void testFetchPaginateStatelessTwiceKeys() {
    DiscoveryStringId[] discs = new DiscoveryStringId[15];
    for(int i=0; i<15; i++){
      discs[i] = new DiscoveryStringId("Disc_"+String.format("%03d", i), StringID_CURIE);
    }
    pm.insert((Object[])discs);

    Query<DiscoveryStringId> query = pm.createQuery(DiscoveryStringId.class).paginate(5).order("name");
    List<DiscoveryStringId> res = query.fetchKeys();
View Full Code Here

  }
 
  public void testFetchPaginateStatefulTwiceKeys() {
    DiscoveryStringId[] discs = new DiscoveryStringId[15];
    for(int i=0; i<15; i++){
      discs[i] = new DiscoveryStringId("Disc_"+String.format("%03d", i), StringID_CURIE);
    }
    pm.insert((Object[])discs);

    Query<DiscoveryStringId> query = pm.createQuery(DiscoveryStringId.class).stateful().paginate(5).order("name");
    List<DiscoveryStringId> res = query.fetchKeys();
View Full Code Here

  }
 
  public void testLimitStatelessIter(){
    DiscoveryStringId[] discs = new DiscoveryStringId[150];
    for(int i=0; i<150; i++){
      discs[i] = new DiscoveryStringId("Disc_"+String.format("%03d", i), StringID_CURIE);
    }
    pm.insert((Object[])discs);
   
    Query<DiscoveryStringId> query = pm.createQuery(DiscoveryStringId.class).stateless().order("name");
    Iterable<DiscoveryStringId> iter = query.limit(50).iter();
    Iterator<DiscoveryStringId> it = iter.iterator();
    int i=0;
    while(it.hasNext()){
      DiscoveryStringId disc = it.next();
      assertEquals(discs[i++], disc);
   
    assertEquals(50, i)
   
    iter = query.limit(50).iter();
    it = iter.iterator();
    i=0;
    while(it.hasNext()){
      DiscoveryStringId disc = it.next();
      assertEquals(discs[i++], disc);
   
    assertEquals(50, i)
   
    iter = query.iter(50);
    it = iter.iterator();
    i=0;
    while(it.hasNext()){
      DiscoveryStringId disc = it.next();
      assertEquals(discs[i++], disc);
   
    assertEquals(50, i)

    iter = query.paginate(50).iter();
    it = iter.iterator();
    i=0;
    while(it.hasNext()){
      DiscoveryStringId disc = it.next();
      assertEquals(discs[i++], disc);
   
    assertEquals(50, i);
  }
View Full Code Here

  }
 
  public void testLimitStatefulIter(){
    DiscoveryStringId[] discs = new DiscoveryStringId[150];
    for(int i=0; i<150; i++){
      discs[i] = new DiscoveryStringId("Disc_"+String.format("%03d", i), StringID_CURIE);
    }
    pm.insert((Object[])discs);
   
    Query<DiscoveryStringId> query = pm.createQuery(DiscoveryStringId.class).stateful().order("name");
    Iterable<DiscoveryStringId> iter = query.limit(50).iter();
    Iterator<DiscoveryStringId> it = iter.iterator();
    int i=0;
    while(it.hasNext()){
      DiscoveryStringId disc = it.next();
      assertEquals(discs[i++], disc);
   
    assertEquals(50, i);
   
    iter = query.iter(50);
    it = iter.iterator();
    i=50;
    while(it.hasNext()){
      DiscoveryStringId disc = it.next();
      assertEquals(discs[i++], disc);
   
    assertEquals(100, i);
   
    iter = query.paginate(50).iter(25);
    it = iter.iterator();
    i=100;
    while(it.hasNext()){
      DiscoveryStringId disc = it.next();
      assertEquals(discs[i++], disc);
   
    assertEquals(150, i);
  }
View Full Code Here

  }
 
  public void testOffsetStatelessIter(){
    DiscoveryStringId[] discs = new DiscoveryStringId[150];
    for(int i=0; i<150; i++){
      discs[i] = new DiscoveryStringId("Disc_"+String.format("%03d", i), StringID_CURIE);
    }
    pm.insert((Object[])discs);
   
    Query<DiscoveryStringId> query = pm.createQuery(DiscoveryStringId.class).order("name");
    Iterable<DiscoveryStringId> iter = query.offset(50).iter();
    Iterator<DiscoveryStringId> it = iter.iterator();
    int i=50;
    while(it.hasNext()){
      DiscoveryStringId disc = it.next();
      assertEquals(discs[i++], disc);
   
    assertEquals(150, i);
  }
View Full Code Here

  }
 
  public void testOffsetStatefulIter(){
    DiscoveryStringId[] discs = new DiscoveryStringId[150];
    for(int i=0; i<150; i++){
      discs[i] = new DiscoveryStringId("Disc_"+String.format("%03d", i), StringID_CURIE);
    }
    pm.insert((Object[])discs);
   
    Query<DiscoveryStringId> query = pm.createQuery(DiscoveryStringId.class).stateful().order("name");
    Iterable<DiscoveryStringId> iter = query.offset(50).iter();
    Iterator<DiscoveryStringId> it = iter.iterator();
    int i=50;
    while(it.hasNext()){
      DiscoveryStringId disc = it.next();
      assertEquals(discs[i++], disc);
   
    assertEquals(150, i);
  }
View Full Code Here

TOP

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

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.