Package siena.base.test.model

Examples of siena.base.test.model.StringListModel


 
 
  public void testStringListProperty() {
    List<StringListModel> bobs = new ArrayList<StringListModel>();
    for(int i=0; i<100; i++) {
      StringListModel bob = new StringListModel("bob"+i);
      final int nb = i;
      bob.friends = new ArrayList<String>(){{
        add("robert"+nb);
        add("john"+nb);
        add("brutus"+nb);
      }};
      bob.insert();
      bobs.add(bob);
    }
   
    StringListModel bobAfter = Model.all(StringListModel.class).filter("friends", "robert27").filter("friends", "john27").get();
    assertEquals(bobs.get(27), bobAfter);
  }
View Full Code Here


  }
 
  public void testStringListProperty2() {
    List<StringListModel> bobs = new ArrayList<StringListModel>();
    for(int i=0; i<100; i++) {
      StringListModel bob = new StringListModel("bob"+i);
      final int nb = i;
      if(i == 27 || i == 65 || i == 89){
        bob.friends = new ArrayList<String>(){{
          add("robert"+nb);
          add("john_doe");
          add("brutus_smith");
        }};       
      }else {
        bob.friends = new ArrayList<String>(){{
          add("robert"+nb);
          add("john"+nb);
          add("brutus"+nb);
        }};
      }
      bob.insert();
      bobs.add(bob);
    }
   
    List<StringListModel> bobsAfter = Model.all(StringListModel.class).filter("friends", "brutus_smith").filter("friends", "john_doe").fetch();
    assertEquals(bobs.get(27), bobsAfter.get(0));
View Full Code Here

TOP

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

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.