Package org.objectweb.speedo.pobjects.fetchgroup

Examples of org.objectweb.speedo.pobjects.fetchgroup.Node


   * <field name="map#key">
   * <field name="map#value">
   */
  public void testRefreshMapKeyValue() {
    logger.log(BasicLevel.DEBUG, "************testRefreshMapKeyValue**************");
    Node n1 = new Node("n1");
    Node n2 = new Node("n2");
    Node n3 = new Node("n3");
    Node n4 = new Node("n4");
    Node n5 = new Node("n5");
   
    n1.addEdge(n2.getName(), new EdgeWeight(1));
    n1.addEdge(n3.getName(), new EdgeWeight(2));
   
    n2.addEdge(n4.getName(), new EdgeWeight(7));
    n2.addEdge(n5.getName(), new EdgeWeight(4));
   
    PersistenceManager pm = pmf.getPersistenceManager();
    FetchPlan fp = pm.getFetchPlan();
    fp.clearGroups();
    fp.addGroup("keyValue").removeGroup("default");
    pm.currentTransaction().begin();
    logger.log(BasicLevel.DEBUG, "make persistent the nodes " + n1.toString() + ", " + n2.toString()
        + ", " + n3.toString() + ", " + n4.toString() + ", " + n5.toString());
    pm.makePersistent(n1);
    pm.makePersistent(n2);
    pm.makePersistent(n3);
    pm.makePersistent(n4);
    pm.makePersistent(n5);
View Full Code Here


   * <field name="map#key">
   */
  public void testRefreshMapKeyOnly() {
    logger.log(BasicLevel.DEBUG, "************testRefreshMapKeyOnly**************");
 
    Node n1 = new Node("n11");
    Node n2 = new Node("n21");
    Node n3 = new Node("n31");
    Node n4 = new Node("n41");
    Node n5 = new Node("n51");
   
    n1.addEdge(n2.getName(), new EdgeWeight(1));
    n1.addEdge(n3.getName(), new EdgeWeight(2));
   
    n2.addEdge(n4.getName(), new EdgeWeight(7));
    n2.addEdge(n5.getName(), new EdgeWeight(4));
   
    PersistenceManager pm = pmf.getPersistenceManager();
    FetchPlan fp = pm.getFetchPlan();
    fp.clearGroups();
    fp.addGroup("keyOnly").removeGroup("default");
    pm.currentTransaction().begin();
    logger.log(BasicLevel.DEBUG, "make persistent the nodes " + n1.toString() + ", " + n2.toString()
        + ", " + n3.toString() + ", " + n4.toString() + ", " + n5.toString());
    pm.makePersistent(n1);
    pm.makePersistent(n2);
    pm.makePersistent(n3);
    pm.makePersistent(n4);
    pm.makePersistent(n5);
View Full Code Here

   * <field name="map#key">
   * <field name="map#value">
   */
  public void testLoadingMapKeyValue() {
    logger.log(BasicLevel.DEBUG, "************testLoadingMapKeyValue**************");
    Node n1 = new Node("n1");
    Node n2 = new Node("n2");
    Node n3 = new Node("n3");
    Node n4 = new Node("n4");
    Node n5 = new Node("n5");
   
    n1.addEdge(n2.getName(), new EdgeWeight(1));
    n1.addEdge(n3.getName(), new EdgeWeight(2));
   
    n2.addEdge(n4.getName(), new EdgeWeight(7));
    n2.addEdge(n5.getName(), new EdgeWeight(4));
   
    PersistenceManager pm = pmf.getPersistenceManager();
    FetchPlan fp = pm.getFetchPlan();
    fp.clearGroups();
    fp.addGroup("keyValue").removeGroup("default");
    pm.currentTransaction().begin();
    logger.log(BasicLevel.DEBUG, "make persistent the nodes " + n1.toString() + ", " + n2.toString()
        + ", " + n3.toString() + ", " + n4.toString() + ", " + n5.toString());
    pm.makePersistent(n1);
    pm.makePersistent(n2);
    pm.makePersistent(n3);
    pm.makePersistent(n4);
    pm.makePersistent(n5);
    pm.currentTransaction().commit();
    logger.log(BasicLevel.DEBUG, "FG: " + fp.getGroups());
   
    try {
      Node detachedN1 = (Node) pm.detachCopy(n1);
      assertEquals(n1.getName(), detachedN1.getName());
      assertEquals(n1.getEdges().size(), detachedN1.getEdges().size());
      logger.log(BasicLevel.DEBUG, "Name can be accessed: " + detachedN1.getName());
      logger.log(BasicLevel.DEBUG, "ToString(): " + detachedN1.toString());
    } catch(Exception e){
      logger.log(BasicLevel.DEBUG, "Error: " + e);
      fail(e.getMessage());
    finally {
      if (pm.currentTransaction().isActive())
View Full Code Here

   * <field name="map#key">
   */
  public void testLoadingMapKeyOnly() {
    logger.log(BasicLevel.DEBUG, "************testLoadingMapKeyOnly**************");
 
    Node n1 = new Node("n11");
    Node n2 = new Node("n21");
    Node n3 = new Node("n31");
    Node n4 = new Node("n41");
    Node n5 = new Node("n51");
   
    n1.addEdge(n2.getName(), new EdgeWeight(1));
    n1.addEdge(n3.getName(), new EdgeWeight(2));
   
    n2.addEdge(n4.getName(), new EdgeWeight(7));
    n2.addEdge(n5.getName(), new EdgeWeight(4));
   
    PersistenceManager pm = pmf.getPersistenceManager();
    FetchPlan fp = pm.getFetchPlan();
    fp.clearGroups();
    fp.addGroup("keyOnly").removeGroup("default");
    pm.currentTransaction().begin();
    logger.log(BasicLevel.DEBUG, "make persistent the nodes " + n1.toString() + ", " + n2.toString()
        + ", " + n3.toString() + ", " + n4.toString() + ", " + n5.toString());
    pm.makePersistent(n1);
    pm.makePersistent(n2);
    pm.makePersistent(n3);
    pm.makePersistent(n4);
    pm.makePersistent(n5);
    pm.currentTransaction().commit();
    logger.log(BasicLevel.DEBUG, "FG: " + fp.getGroups());
   
    try {
      Node detachedN1 = (Node) pm.detachCopy(n1);
      assertEquals(n1.getName(), detachedN1.getName());
      assertEquals(n1.getEdges().size(), detachedN1.getEdges().size());
      logger.log(BasicLevel.DEBUG, "Name can be accessed: " + detachedN1.getName());
      logger.log(BasicLevel.DEBUG, "ToString(): " + detachedN1.toString());
    } catch(Exception e){
      logger.log(BasicLevel.DEBUG, "Error: " + e);
      fail(e.getMessage());
    finally {
      if (pm.currentTransaction().isActive())
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.pobjects.fetchgroup.Node

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.