Esempio n. 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());
  }
Esempio n. 2
0
 public void setUp() {
   seq++;
   // Create some test nodes
   Cloud cloud = getCloud();
   {
     Node node = cloud.getNodeManager("news").createNode();
     node.setStringValue("title", "foo");
     node.commit();
     newNode = node.getNumber();
   }
   {
     Node node = cloud.getNodeManager("news").createNode();
     node.setStringValue("title", "foo");
     node.createAlias("test.news." + seq);
     node.setContext("default");
     node.commit();
     newNode2 = node.getNumber();
   }
 }
Esempio n. 3
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());
  }