Package siena.base.test.model

Examples of siena.base.test.model.RelatedSimpleOwnedParent


  }
   
  public void testRelatedSimpleOwned() {
    RelatedSimpleOwnedChild adam1 = new RelatedSimpleOwnedChild("adam1");
   
    RelatedSimpleOwnedParent god = new RelatedSimpleOwnedParent("god");
    god.child.set(adam1);
    god.insert();

    assertNotNull(god.id);
    assertEquals(god.id, adam1.owner.id);
   
    RelatedSimpleOwnedParent godbis = Model.getByKey(RelatedSimpleOwnedParent.class, god.id);
   
    assertEquals(god, godbis);
    assertEquals(adam1, godbis.child.get());
  }
View Full Code Here


  }
 
  public void testRelatedSimpleOwnedNull() {
    RelatedSimpleOwnedChild adam1 = new RelatedSimpleOwnedChild("adam1");
   
    RelatedSimpleOwnedParent god = new RelatedSimpleOwnedParent("god");
    god.child.set(null);
    god.insert();

    assertNotNull(god.id);
    assertNull(adam1.owner);
   
    RelatedSimpleOwnedParent godbis = Model.getByKey(RelatedSimpleOwnedParent.class, god.id);
   
    assertEquals(god, godbis);
    assertNull(godbis.child.get());
  }
View Full Code Here

  }
 
  public void testRelatedSimpleOwnedUpdate() {
    RelatedSimpleOwnedChild adam1 = new RelatedSimpleOwnedChild("adam1");
    RelatedSimpleOwnedChild adam2 = new RelatedSimpleOwnedChild("adam2");
    RelatedSimpleOwnedParent god = new RelatedSimpleOwnedParent("god");
    god.child.set(adam1);
    god.insert();

    assertNotNull(god.id);
    assertEquals(god.id, adam1.owner.id);
   
    RelatedSimpleOwnedParent godbis = Model.getByKey(RelatedSimpleOwnedParent.class, god.id);
   
    adam2.insert();
    god.child.set(adam2);
    god.update();

    RelatedSimpleOwnedParent godbis2 = Model.getByKey(RelatedSimpleOwnedParent.class, godbis.id);

    assertEquals(god, godbis2);
    assertEquals(adam2, godbis2.child.get());
    adam1.get();
    assertNull(adam1.owner);
View Full Code Here

  }
 
  public void testRelatedSimpleOwnedUpdate2null() {
    RelatedSimpleOwnedChild adam1 = new RelatedSimpleOwnedChild("adam1");
   
    RelatedSimpleOwnedParent god = new RelatedSimpleOwnedParent("god");
    god.child.set(adam1);
    god.insert();

    assertNotNull(god.id);
    assertEquals(god.id, adam1.owner.id);
   
    RelatedSimpleOwnedParent godbis = Model.getByKey(RelatedSimpleOwnedParent.class, god.id);
   
    god.child.set(null);
    god.update();

    RelatedSimpleOwnedParent godbis2 = Model.getByKey(RelatedSimpleOwnedParent.class, godbis.id);

    assertEquals(god, godbis2);
    assertNull(godbis2.child.get());
  }
View Full Code Here

TOP

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

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.