예제 #1
0
  public void testSetContextSubTransaction() {
    Cloud cloud = getCloud();

    Transaction ot = cloud.getTransaction("bar8");
    Transaction t = ot.getTransaction("bar9");
    Node n = t.getNodeManager("news").createNode();
    n.setContext("non_default");
    assertEquals("non_default", n.getContext());
    t.commit();

    Node n2 = ot.getNode(n.getNumber());
    assertEquals("non_default", n2.getContext());

    ot.commit();
    Node n3 = cloud.getNode(n.getNumber());
    assertEquals("non_default", n3.getContext());
  }
예제 #2
0
  public void testSetContext() {
    Cloud cloud = getCloud();
    Transaction t = cloud.getTransaction("bar7");
    Node n = t.getNodeManager("news").createNode();

    assertEquals(1, t.getNodes().size());

    n.setContext("non_default");

    assertEquals(1, t.getNodes().size());

    assertEquals("non_default", n.getStringValue("owner"));
    assertEquals("non_default", n.getContext());

    assertEquals(1, t.getNodes().size());

    t.commit();

    Node n2 = cloud.getNode(n.getNumber());
    assertEquals("non_default", n2.getStringValue("owner"));
    assertEquals("non_default", n2.getContext());
  }