Package siena.base.test.model

Examples of siena.base.test.model.SampleModel


    assertEquals(disc, res.get(0));
  }
 
 
  public void testInsert() {
    SampleModel mod = new SampleModel();
    mod.clazz = String.class;
    mod.foobar = "FOOBAR";
    mod.publicField = "PUBLIC_FIELD";
    mod.setPrivateField("PRIVATE_FIELD");
    mod.type = SampleModel.Type.FOO;
   
    mod.insert();
   
    List<SampleModel> res = SampleModel.all().fetch();
    for(SampleModel m: res){
      assertEquals(mod, m);
    }
View Full Code Here


    for(SampleModel m: res){
      assertEquals(mod, m);
    }
  }
  public void testInsertAsync() {
    SampleModel mod = new SampleModel();
    mod.clazz = String.class;
    mod.foobar = "FOOBAR";
    mod.publicField = "PUBLIC_FIELD";
    mod.setPrivateField("PRIVATE_FIELD");
    mod.type = SampleModel.Type.FOO;
   
    SienaFuture<Void> future = mod.async().insert();
    future.get();
   
    List<SampleModel> res = SampleModel.all().fetch();
    for(SampleModel m: res){
      assertEquals(mod, m);
View Full Code Here

    for(SampleModel m: res){
      assertEquals(mod, m);
    }
  }
  public void testInsertMany() {
    SampleModel mods[] = new SampleModel[100];
    for(int i=0; i<100; i++){
      SampleModel mod = new SampleModel();
      mod.clazz = String.class;
      mod.foobar = "FOOBAR";
      mod.publicField = "PUBLIC_FIELD";
      mod.setPrivateField("PRIVATE_FIELD");
      mod.type = SampleModel.Type.FOO;
      mods[i] = mod;
     
      mods[i].insert();
    }
View Full Code Here

      assertEquals(mods[i], res.get(i));
    }
  }
 
  public void testInsertManyAsync() {
    SampleModel mods[] = new SampleModel[100];
    for(int i=0; i<100; i++){
      SampleModel mod = new SampleModel();
      mod.clazz = String.class;
      mod.foobar = "FOOBAR";
      mod.publicField = "PUBLIC_FIELD";
      mod.setPrivateField("PRIVATE_FIELD");
      mod.type = SampleModel.Type.FOO;
      mods[i] = mod;
     
      mods[i].async().insert().get();
    }
View Full Code Here

      assertEquals(mods[i], res.get(i));
    }
  }
 
  public void testInsertAutoQuery() {
    SampleModel mod = new SampleModel();
    mod.clazz = String.class;
    mod.foobar = "FOOBAR";
    mod.publicField = "PUBLIC_FIELD";
    mod.setPrivateField("PRIVATE_FIELD");
    mod.type = SampleModel.Type.FOO;
   
    mod.insert();
   
    SampleModel2 mod2 = new SampleModel2();
    mod2.relationship = mod;
    mod2.insert();
   
View Full Code Here

      assertEquals(mod2, res2.get(0));
    }
  }
 
  public void testInsertAutoQueryAsyncFetchSync() {
    SampleModel mod = new SampleModel();
    mod.clazz = String.class;
    mod.foobar = "FOOBAR";
    mod.publicField = "PUBLIC_FIELD";
    mod.setPrivateField("PRIVATE_FIELD");
    mod.type = SampleModel.Type.FOO;
   
    mod.async().insert().get();
   
    SampleModel2 mod2 = new SampleModel2();
    mod2.relationship = mod;
    mod2.async().insert().get();
   
View Full Code Here

      assertEquals(mod2, res2.get(0));
    }
  }
 
  public void testInsertAutoQueryAsyncFetchAsync() {
    SampleModel mod = new SampleModel();
    mod.clazz = String.class;
    mod.foobar = "FOOBAR";
    mod.publicField = "PUBLIC_FIELD";
    mod.setPrivateField("PRIVATE_FIELD");
    mod.type = SampleModel.Type.FOO;
   
    mod.async().insert().get();
   
    SampleModel2 mod2 = new SampleModel2();
    mod2.relationship = mod;
    mod2.async().insert().get();
   
View Full Code Here

      assertEquals(mod2, res2.get(0));
    }
  }
 
  public void testInsertAutoQueryAsyncFetchAsyncQueryAsync() {
    SampleModel mod = new SampleModel();
    mod.clazz = String.class;
    mod.foobar = "FOOBAR";
    mod.publicField = "PUBLIC_FIELD";
    mod.setPrivateField("PRIVATE_FIELD");
    mod.type = SampleModel.Type.FOO;
   
    mod.async().insert().get();
   
    SampleModel2 mod2 = new SampleModel2();
    mod2.relationship = mod;
    mod2.async().insert().get();
   
View Full Code Here

    }
  }
 
 
  public void testInsertAutoQueryMany() {
    SampleModel mod = new SampleModel();
    mod.clazz = String.class;
    mod.foobar = "FOOBAR";
    mod.publicField = "PUBLIC_FIELD";
    mod.setPrivateField("PRIVATE_FIELD");
    mod.type = SampleModel.Type.FOO;
   
    mod.insert();
   
    SampleModel2 mods2[] = new SampleModel2[100];
    for(int i=0; i<100; i++){
      SampleModel2 mod2 = new SampleModel2();
      mod2.relationship = mod;
View Full Code Here

      }
    }
  }
 
  public void testInsertBatchAsync() {
    SampleModel mods[] = new SampleModel[100];
    for(int i=0; i<100; i++){
      SampleModel mod = new SampleModel();
      mod.clazz = String.class;
      mod.foobar = "FOOBAR";
      mod.publicField = "PUBLIC_FIELD";
      mod.setPrivateField("PRIVATE_FIELD");
      mod.type = SampleModel.Type.FOO;
      mods[i] = mod;
     
      mods[i].async().insert().get();
    }
View Full Code Here

TOP

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

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.