use of javax.jcr.Property in project jackrabbit by apache.
the class GetPropertyTest method testGetExternallyAddedItems.
public void testGetExternallyAddedItems() throws RepositoryException {
Node node1 = (Node) readOnly.getItem(node1Path);
Node n2 = testRootNode.getNode(nodeName1).addNode(nodeName2);
Property p3 = n2.setProperty(propertyName1, "test");
testRootNode.save();
node1.refresh(true);
assertTrue(readOnly.itemExists(n2.getPath()));
assertTrue(readOnly.itemExists(p3.getPath()));
}
use of javax.jcr.Property in project jackrabbit by apache.
the class BinaryTest method testBinaryTwiceModifiedProperty.
public void testBinaryTwiceModifiedProperty() throws Exception {
Node test = testRootNode.addNode("test");
Property p = test.setProperty("prop", generateValue());
superuser.save();
// modify twice
test.setProperty("prop", generateValue());
QValue qv1 = getQValue(p);
test.setProperty("prop", generateValue());
QValue qv2 = getQValue(p);
assertFalse(qv1.equals(qv2));
superuser.save();
assertEquals(qv2, getQValue(p));
assertDisposed(qv1);
}
use of javax.jcr.Property in project jackrabbit by apache.
the class BinaryTest method testBinaryTwiceIntermediateSave.
public void testBinaryTwiceIntermediateSave() throws Exception {
Node test = testRootNode.addNode("test");
Property p = test.setProperty("prop", generateValue());
QValue qv1 = getQValue(p);
superuser.save();
test.setProperty("prop", generateValue());
QValue qv2 = getQValue(p);
assertFalse(qv1.equals(qv2));
superuser.save();
assertEquals(qv2, getQValue(p));
assertDisposed(qv1);
}
use of javax.jcr.Property in project jackrabbit by apache.
the class BinaryTest method testStreamBinary.
public void testStreamBinary() throws Exception {
Node test = testRootNode.addNode("test");
Property p = test.setProperty("prop", generateValue());
// check before save
checkBinary(p);
superuser.save();
// check after save
checkBinary(p);
// check from other session
Session s = getHelper().getReadOnlySession();
try {
p = s.getNode(testRoot).getNode("test").getProperty("prop");
checkBinary(p);
} finally {
s.logout();
}
}
use of javax.jcr.Property in project jackrabbit by apache.
the class BinaryTest method testStreamBinary2.
public void testStreamBinary2() throws Exception {
Node test = testRootNode.addNode("test");
Property p = test.setProperty("prop", generateValue());
// check before save
checkBinary(p);
superuser.save();
// check after save
checkBinary(p);
// check from other session
Session s = getHelper().getReadOnlySession();
try {
p = s.getProperty(testRoot + "/test/prop");
checkBinary(p);
} finally {
s.logout();
}
}
Aggregations