Package siena.base.test.model

Examples of siena.base.test.model.Discovery4Search


  }
 
  public void testSearchMultipleSingleFieldCount() {
    Discovery4Search[] discs = new Discovery4Search[10];
    for(int i=0; i<10; i++){
      if(i%2==0) discs[i] = new Discovery4Search("even_"+i, LongAutoID_CURIE);
      else discs[i] = new Discovery4Search("odd_"+i, LongAutoID_CURIE);
      pm.insert(discs[i]);
    }
   
    Query<Discovery4Search> query =
      pm.createQuery(Discovery4Search.class).search("even_*", "name").order("name");
View Full Code Here


    assertEquals(5, res);
 
  }
 
  public void testSearchMultipleWordsSingleField() {
    Discovery4Search AB = new Discovery4Search("alpha beta", LongAutoID_CURIE);
    Discovery4Search GB = new Discovery4Search("gamma beta", LongAutoID_CURIE);
    Discovery4Search GD = new Discovery4Search("gamma delta", LongAutoID_CURIE);
    Discovery4Search ET = new Discovery4Search("epsilon theta", LongAutoID_CURIE);
    pm.insert(AB);
    pm.insert(GB);
    pm.insert(GD);
    pm.insert(ET);
View Full Code Here

  // 2 searches in the same query is not available in Postgres for the time being
  public void testSearchSingleTwiceInTheSameQuery() {
    Discovery4Search[] discs = new Discovery4Search[100];
    for(int i=0; i<100; i++){
      discs[i] = new Discovery4Search("Disc_"+i+" "+(100-i)+"_csid", LongAutoID_CURIE);
    }
    pm.insert((Object[])discs);

    Query<Discovery4Search> query =
      pm.createQuery(Discovery4Search.class).search("Disc_5", "name").search("95_csid");
View Full Code Here

 
 
  public void testSearchSingle() {
    Discovery4Search[] discs = new Discovery4Search[100];
    for(int i=0; i<100; i++){
      discs[i] = new Discovery4Search("Disc_"+i, LongAutoID_CURIE);
    }
    pm.insert((Object[])discs).get();

    QueryAsync<Discovery4Search> query =
      pm.createQuery(Discovery4Search.class).search("Disc_5", "name");
View Full Code Here

 
 
  public void testSearchSingleKeysOnly() {
    Discovery4Search[] discs = new Discovery4Search[100];
    for(int i=0; i<100; i++){
      discs[i] = new Discovery4Search("Disc_"+i, LongAutoID_CURIE);
    }
    pm.insert((Object[])discs).get();

    QueryAsync<Discovery4Search> query =
      pm.createQuery(Discovery4Search.class).search("Disc_5", "name");
View Full Code Here

  }
 
  public void testSearchSingleTwice() {
    Discovery4Search[] discs = new Discovery4Search[100];
    for(int i=0; i<100; i++){
      discs[i] = new Discovery4Search("Disc_"+i, LongAutoID_CURIE);
    }
    pm.insert((Object[])discs).get();

    QueryAsync<Discovery4Search> query =
      pm.createQuery(Discovery4Search.class).search("Disc_5", "name");
View Full Code Here

  }

  public void testSearchSingleCount() {
    Discovery4Search[] discs = new Discovery4Search[100];
    for(int i=0; i<100; i++){
      discs[i] = new Discovery4Search("Disc_"+i, LongAutoID_CURIE);
    }
    pm.insert((Object[])discs).get();

    QueryAsync<Discovery4Search> query =
      pm.createQuery(Discovery4Search.class).search("Disc_5", "name");
View Full Code Here

  }
 
  public void testSearchSingleFieldEqualsSingleResult() {
    Discovery4Search[] discs = new Discovery4Search[10];
    for(int i=0; i<10; i++){
      if(i%2==0) discs[i] = new Discovery4Search("even_"+i, LongAutoID_CURIE);
      else discs[i] = new Discovery4Search("odd_"+i, LongAutoID_CURIE);
    }
    pm.insert((Object[])discs);
   
    Query<Discovery4Search> query =
      pm.createQuery(Discovery4Search.class).search("even_4", "name").order("name");
View Full Code Here

    assertEquals(discs[4], res.get(0));
  }

  public void testSearchSingleFieldEqualsSeveralResults() {
    Discovery4Search[] discs = new Discovery4Search[5];
    discs[0] = new Discovery4Search("alpha", LongAutoID_CURIE);
    discs[1] = new Discovery4Search("beta", LongAutoID_CURIE);
    discs[2] = new Discovery4Search("gamma", LongAutoID_CURIE);
    discs[3] = new Discovery4Search("delta", LongAutoID_CURIE);
    discs[4] = new Discovery4Search("eta", LongAutoID_CURIE);
    pm.insert((Object[])discs);   
   
    Query<Discovery4Search> query =
      pm.createQuery(Discovery4Search.class).search("beta eta", "name");
   
View Full Code Here

    assertEquals(discs[4], res.get(1));
  }
 
  public void testSearchSingleFieldBeginSingleResults() {
    Discovery4Search[] discs = new Discovery4Search[5];
    discs[0] = new Discovery4Search("alpha", LongAutoID_CURIE);
    discs[1] = new Discovery4Search("beta", LongAutoID_CURIE);
    discs[2] = new Discovery4Search("gamma", LongAutoID_CURIE);
    discs[3] = new Discovery4Search("delta", LongAutoID_CURIE);
    discs[4] = new Discovery4Search("eta", LongAutoID_CURIE);
    pm.insert((Object[])discs);   
   
    Query<Discovery4Search> query =
      pm.createQuery(Discovery4Search.class).search("gamma*", "name");
   
View Full Code Here

TOP

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

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.