Package siena.base.test.model

Examples of siena.base.test.model.PersonLongAutoIDExtended


      assertEquals(mods[i], res.get(i));
    }
  }
 
  public void testSimpleInheritance() {
    PersonLongAutoIDExtended bob =
      new PersonLongAutoIDExtended("Bob", "Doe", "Oklahoma", 1, "the_dog1");
    PersonLongAutoIDExtended ben =
      new PersonLongAutoIDExtended("Ben", "Smith", "Wichita", 2, "the_dog2");
    PersonLongAutoIDExtended john =
      new PersonLongAutoIDExtended("John", "Wells", "Buffalo", 3, "the_dog3");
   
    final PersonLongAutoIDExtended.Image img1 = new PersonLongAutoIDExtended.Image();
    img1.filename = "test.file";
    img1.title = "title";
    final PersonLongAutoIDExtended.Image img2 = new PersonLongAutoIDExtended.Image();
    img2.filename = "test.file";
    img2.title = "title";
    final PersonLongAutoIDExtended.Image img3 = new PersonLongAutoIDExtended.Image();
    img3.filename = "test.file";
    img3.title = "title";
   
    List<PersonLongAutoIDExtended.Image> imgList = new ArrayList<PersonLongAutoIDExtended.Image>()
    {{
      add(img1);
      add(img2);
      add(img3);     
    }};
   
    Map<String, PersonLongAutoIDExtended.Image> imgMap =
      new HashMap<String, PersonLongAutoIDExtended.Image>()
    {{
      put("img1", img1);
      put("img2", img2);
      put("img3", img3);     
    }};
       
    bob.boss = john;
    bob.profileImage = img1;
    bob.otherImages = imgList;
    bob.stillImages = imgMap;
   
    ben.boss = john;
    ben.profileImage = img2;
    ben.otherImages = imgList;
    ben.stillImages = imgMap;
   
    john.profileImage = img3;
    john.otherImages = imgList;
    john.stillImages = imgMap;
   
    pm.save(john);
    pm.save(bob);
    pm.save(ben);
       
    PersonLongAutoIDExtended bob1 =
      pm.getByKey(PersonLongAutoIDExtended.class, bob.id);
    PersonLongAutoIDExtended ben1 =
      pm.getByKey(PersonLongAutoIDExtended.class, ben.id);
    PersonLongAutoIDExtended john1 =
      pm.getByKey(PersonLongAutoIDExtended.class, john.id);
   
    assertEquals(bob, bob1);
    assertEquals(john.id, bob1.boss.id);
    assertEquals(ben, ben1);
View Full Code Here

TOP

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

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.