property = root.getNode("childNode/childNode2/jcr:content").getProperty("jcr:data");
assertEquals("this is the content", property.getString());
Value val =
new BinaryValue(new ByteArrayInputStream("this is the NEW content".getBytes()),
SpoolConfig.getDefaultSpoolConfig());
node = root.getNode("childNode/childNode2/jcr:content");
node.setProperty("jcr:data", val);
// property.setValue(val);
node = root.getNode("childNode");
session.save();
root = repository.login(credentials, WORKSPACE).getRootNode();
// System.out.println("------------------");
property = root.getNode("childNode/childNode2/jcr:content").getProperty("jcr:data");
assertEquals("this is the NEW content", property.getString());
session = (SessionImpl)repository.login(credentials, WORKSPACE);
root = session.getRootNode();
node = root.getNode("childNode");
assertEquals(node.toString(), root.getNode("childNode").toString());
// not allowed!
// root.getNode("childNode/childNode2/jcr:content").setProperty("myapp:temp",
// new
// StringValue("Temp"));
Session session2 = repository.login(credentials, WORKSPACE);
Node root2 = session2.getRootNode();
Node node2 = root2.getNode("childNode/childNode2/jcr:content");
node2.setProperty("jcr:data",
new BinaryValue(new ByteArrayInputStream("Temp".getBytes()), SpoolConfig.getDefaultSpoolConfig()));
session2.save();
session.refresh(false);
root = session.getRootNode();