Package siena.base.test.model

Examples of siena.base.test.model.EmbeddedModel


    }

  }

  public void testEmbeddedModel() {
    EmbeddedModel embed = new EmbeddedModel();
    embed.id = "embed";
    embed.alpha = "test";
    embed.beta = 123;
    embed.setGamma(true);
    pm.insert(embed);
   
    EmbeddedModel embed2 = new EmbeddedModel();
    embed2.id = "embed2";
    embed2.alpha = "test2";
    embed2.beta = 1234;
    embed2.setGamma(true);
    pm.insert(embed2);
   
    EmbeddedContainerModel container = new EmbeddedContainerModel();
    container.id = "container";
    container.embed = embed;
View Full Code Here


    }
    assertEquals(embed.isGamma(), afterContainer.embed.isGamma());
  }
 
  public void testEmbeddedModelJava() {
    EmbeddedModel embed = new EmbeddedModel();
    embed.id = "embed";
    embed.alpha = "test";
    embed.beta = 123;
    embed.setGamma(true);
    pm.insert(embed);
   
    EmbeddedModel embed2 = new EmbeddedModel();
    embed2.id = "embed2";
    embed2.alpha = "test2";
    embed2.beta = 1234;
    embed2.setGamma(true);
    pm.insert(embed2);
   
    EmbeddedContainerModelJava container = new EmbeddedContainerModelJava();
    container.id = "container";
    container.embed = embed;
View Full Code Here

    assertEquals(containers.get(64).embed.nativeEmbed.str, afterContainer.embed.nativeEmbed.str);
    assertEquals(containers.get(64).embed.nativeEmbed.l, afterContainer.embed.nativeEmbed.l);
  }
 
  public void testEmbeddedModelNative() {
    EmbeddedModel embed = new EmbeddedModel();
    embed.id = "embed";
    embed.alpha = "test";
    embed.beta = 123;
    embed.setGamma(true);
    embed.sub = new EmbeddedSubModel();
    embed.sub.id = "sub";
    embed.sub.parent = embed;
   
    pm.insert(embed);
   
    EmbeddedContainerModelNative container = new EmbeddedContainerModelNative();
    container.id = "container";
    container.embed = embed;
    pm.insert(container);

    EmbeddedContainerModelNative afterContainer = pm.getByKey(EmbeddedContainerModelNative.class, container.id);
    assertNotNull(afterContainer);
    assertEquals(container.id, afterContainer.id);
    assertNotNull(afterContainer.embed);
    assertEquals(embed.id, afterContainer.embed.id);
   
    // doesn't ignore @EmbedIgnore as it is not possible to have fine grain in Java serialization
    assertEquals("test", afterContainer.embed.alpha);
    assertEquals(embed.beta, afterContainer.embed.beta);
    assertEquals(embed.isGamma(), afterContainer.embed.isGamma());
    assertEquals("sub", afterContainer.embed.sub.id);
    assertNull(afterContainer.embed.sub.parent);
  }
View Full Code Here

    PolymorphicModel<List<String>> poly2 = pm.getByKey(PolymorphicModel.class, poly.id);
    assertEquals(poly, poly2);
  }
 
  public void testEmbeddedModel() {
    EmbeddedModel embed = new EmbeddedModel();
    embed.id = "embed";
    embed.alpha = "test";
    embed.beta = 123;
    embed.setGamma(true);
    pm.insert(embed);
   
    EmbeddedModel embed2 = new EmbeddedModel();
    embed2.id = "embed2";
    embed2.alpha = "test2";
    embed2.beta = 1234;
    embed2.setGamma(true);
    pm.insert(embed2);
   
    EmbeddedContainerModel container = new EmbeddedContainerModel();
    container.id = "container";
    container.embed = embed;
View Full Code Here

   
    assertEquals(LifeCyclePhase.PRE_SAVE.toString()+" "+LifeCyclePhase.POST_SAVE.toString()+" ", lifeCyclePhase);
  }
 
  public void testSerializeEmbeddedModel() {
    EmbeddedModel embed = new EmbeddedModel();
    embed.id = "embed";
    embed.alpha = "test";
    embed.beta = 123;
    pm.insert(embed);
View Full Code Here

    PolymorphicModel<List<String>> poly2 = pm.getByKey(PolymorphicModel.class, poly.id).get();
    assertEquals(poly, poly2);
  }
 
  public void testEmbeddedModel() {
    EmbeddedModel embed = new EmbeddedModel();
    embed.id = "embed";
    embed.alpha = "test";
    embed.beta = 123;
    pm.insert(embed).get();
   
View Full Code Here

TOP

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

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.