Package siena.base.test.model

Examples of siena.base.test.model.Discovery


  }
 
  public void testFetchLimitReal() {
    Discovery[] discs = new Discovery[10];
    for(int i=0; i<10; i++){
      discs[i] = new Discovery("Disc_"+i, LongAutoID_CURIE);
    }

    pm.insert((Object[])discs).get();

    SienaFuture<List<Discovery>> future = pm.createQuery(Discovery.class).order("name").fetch(3);
View Full Code Here


  }

  public void testFetchLimitOffsetReal() {
    Discovery[] discs = new Discovery[10];
    for(int i=0; i<10; i++){
      discs[i] = new Discovery("Disc_"+i, LongAutoID_CURIE);
    }

    pm.insert((Object[])discs).get();
   
    SienaFuture<List<Discovery>> future = pm.createQuery(Discovery.class).order("name").fetch(3, 5);
View Full Code Here

   
    assertTrue(second.id > first.id);
  }
 
  public void testRelationship() {
    Discovery radioactivity = new Discovery("Radioactivity", LongAutoID_CURIE);
    Discovery relativity = new Discovery("Relativity", LongAutoID_EINSTEIN);
    Discovery teslaCoil = new Discovery("Tesla Coil", LongAutoID_TESLA);
    Discovery foo = new Discovery(null, LongAutoID_TESLA);
   
    pm.insert(radioactivity, relativity, teslaCoil, foo).get();

    SienaFuture<Discovery> relativity2 = pm.createQuery(Discovery.class).filter("discoverer", LongAutoID_EINSTEIN).get();
    SienaFuture<Discovery> foo2 = pm.createQuery(Discovery.class).filter("name", null).get();
View Full Code Here

      assertNull(same.typeEnum);
    }
  }
 
  public void testQueryDelete() {
    Discovery radioactivity = new Discovery("Radioactivity", LongAutoID_CURIE);
    Discovery relativity = new Discovery("Relativity", LongAutoID_EINSTEIN);
    Discovery teslaCoil = new Discovery("Tesla Coil", LongAutoID_TESLA);
   
    pm.insert(radioactivity, relativity, teslaCoil).get();

    int n = pm.createQuery(Discovery.class).delete().get();
    assertEquals(3, n);
View Full Code Here

    List<Discovery> res = pm.createQuery(Discovery.class).fetch().get();
    assertEquals(0, res.size());
  }
 
  public void testQueryDeleteFiltered() {
    Discovery radioactivity = new Discovery("Radioactivity", LongAutoID_CURIE);
    Discovery relativity = new Discovery("Relativity", LongAutoID_EINSTEIN);
    Discovery foo = new Discovery("Foo", LongAutoID_EINSTEIN);
    Discovery teslaCoil = new Discovery("Tesla Coil", LongAutoID_TESLA);
   
    pm.insert(radioactivity, relativity, foo, teslaCoil).get();

    int n = pm.createQuery(Discovery.class).filter("discoverer", LongAutoID_EINSTEIN).delete().get();
    assertEquals(2, n);
View Full Code Here

    assertEquals(radioactivity, res.get(0));
    assertEquals(teslaCoil, res.get(1));
  }
 
  public void testJoin() {
    Discovery radioactivity = new Discovery("Radioactivity", LongAutoID_CURIE);
    Discovery relativity = new Discovery("Relativity", LongAutoID_EINSTEIN);
    Discovery foo = new Discovery("Foo", LongAutoID_EINSTEIN);
    Discovery teslaCoil = new Discovery("Tesla Coil", LongAutoID_TESLA);
   
    pm.insert(radioactivity, relativity, foo, teslaCoil).get();
   
    SienaFuture<List<Discovery>> future = pm.createQuery(Discovery.class).join("discoverer").order("name").fetch();
   
View Full Code Here

    assertEquals(LongAutoID_EINSTEIN, res.get(2).discoverer);
    assertEquals(LongAutoID_TESLA, res.get(3).discoverer);
  }
 
  public void testJoinSortFields() {
    Discovery radioactivity = new Discovery("Radioactivity", LongAutoID_CURIE);
    Discovery relativity = new Discovery("Relativity", LongAutoID_EINSTEIN);
    Discovery foo = new Discovery("Foo", LongAutoID_EINSTEIN);
    Discovery teslaCoil = new Discovery("Tesla Coil", LongAutoID_TESLA);
   
    pm.insert(radioactivity, relativity, foo, teslaCoil).get();
   
    SienaFuture<List<Discovery>> future = pm.createQuery(Discovery.class).join("discoverer", "firstName").order("name").fetch();
    List<Discovery> res = future.get();
View Full Code Here

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

    QueryAsync<Discovery> query = pm.createQuery(Discovery.class).paginate(5).order("name");
    SienaFuture<List<Discovery>> future = query.fetch();
View Full Code Here

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

    QueryAsync<Discovery> query = pm.createQuery(Discovery.class).paginate(5).order("name");
    SienaFuture<List<Discovery>> future = query.fetch();
View Full Code Here

  }
 
  public void testFilterWithOperatorINLotsOfEntitiesStateful() {
    Discovery[] discs = new Discovery[200];
    for(int i=0; i<200; i++){
      discs[i] = new Discovery("Disc_"+i, LongAutoID_CURIE);
    }
    pm.insert((Object[])discs).get();
   
    QueryAsync<Discovery> query =
      pm.createQuery(Discovery.class)
View Full Code Here

TOP

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

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.