}
}
public void testAddNode() throws RepositoryException {
NodeId nid = getNodeId(testPath);
Batch b = rs.createBatch(si, nid);
b.addNode(nid, resolver.getQName("aNode"), NameConstants.NT_UNSTRUCTURED, null);
b.addProperty(nid, resolver.getQName("aString"), rs.getQValueFactory().create("ba", PropertyType.STRING));
b.addProperty(nid, resolver.getQName("aName"), new QValue[] {rs.getQValueFactory().create(NameConstants.JCR_ENCODING), rs.getQValueFactory().create(NameConstants.JCR_DATA)});
b.addProperty(nid, resolver.getQName("aBinary"), rs.getQValueFactory().create(new byte[] { 'a', 'b', 'c'}));
rs.submit(b);
NodeId id = rs.getIdFactory().createNodeId(nid, resolver.getQPath("aNode"));
Iterator<? extends ItemInfo> it = rs.getItemInfos(si, id);
while (it.hasNext()) {
ItemInfo info = it.next();
if (info.denotesNode()) {
NodeInfo nInfo = (NodeInfo) info;
assertEquals(NameConstants.NT_UNSTRUCTURED, nInfo.getNodetype());
Iterator<ChildInfo> childIt = nInfo.getChildInfos();
assertTrue(childIt == null || !childIt.hasNext());
assertEquals(id, nInfo.getId());
}
}
b = rs.createBatch(si, nid);
b.remove(id);
rs.submit(b);
}