use of org.apache.jackrabbit.spi.NodeId in project jackrabbit by apache.
the class ReadTest method testReadNonExistingProperty.
public void testReadNonExistingProperty() throws RepositoryException {
NodeId nid = getNodeId(testPath);
PropertyId pid = getPropertyId(nid, NameConstants.JCR_CHILDNODEDEFINITION);
try {
rs.getPropertyInfo(si, pid);
fail();
} catch (ItemNotFoundException e) {
// ok
}
}
use of org.apache.jackrabbit.spi.NodeId in project jackrabbit by apache.
the class ReadTest method testReadPropertyAsNode.
public void testReadPropertyAsNode() throws RepositoryException {
NodeId nid = getNodeId(testPath + "/jcr:primaryType");
try {
rs.getItemInfos(si, nid);
fail();
} catch (ItemNotFoundException e) {
// ok
}
}
use of org.apache.jackrabbit.spi.NodeId in project jackrabbit by apache.
the class ReadTest method testReadNonExistingNode.
public void testReadNonExistingNode() throws RepositoryException {
NodeId nid = getNodeId(testPath + "/non-existing");
try {
rs.getItemInfos(si, nid);
fail();
} catch (ItemNotFoundException e) {
// ok
}
}
use of org.apache.jackrabbit.spi.NodeId in project jackrabbit by apache.
the class BatchTest method testSetMixin.
public void testSetMixin() throws RepositoryException {
NodeId nid = getNodeId(testPath);
Batch b = rs.createBatch(si, nid);
b.addNode(nid, resolver.getQName("anyNode"), NameConstants.NT_UNSTRUCTURED, null);
NodeId id = getNodeId(testPath + "/anyNode");
b.setMixins(id, new Name[] { NameConstants.MIX_LOCKABLE });
rs.submit(b);
b = rs.createBatch(si, id);
b.setMixins(id, new Name[0]);
rs.submit(b);
NodeInfo nInfo = rs.getNodeInfo(si, id);
assertEquals(0, nInfo.getMixins().length);
}
use of org.apache.jackrabbit.spi.NodeId in project jackrabbit by apache.
the class BatchTest method testSetEmptyBinaryValue.
public void testSetEmptyBinaryValue() throws RepositoryException, IOException {
NodeId nid = getNodeId(testPath);
Name propName = resolver.getQName("binProp");
Batch b = rs.createBatch(si, nid);
b.addProperty(nid, propName, rs.getQValueFactory().create(new byte[0]));
rs.submit(b);
PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
assertFalse(pi.isMultiValued());
InputStream in = pi.getValues()[0].getStream();
assertTrue(in.read() == -1);
assertEquals("", pi.getValues()[0].getString());
assertEquals(PropertyType.BINARY, pi.getType());
pi = getPropertyInfo(nid, propName);
assertFalse(pi.isMultiValued());
in = pi.getValues()[0].getStream();
assertTrue(in.read() == -1);
assertEquals("", pi.getValues()[0].getString());
assertEquals(PropertyType.BINARY, pi.getType());
}
Aggregations