public void testNodeWithPrimaryItem() throws Exception {
// create file node
NodeId nid = getNodeId("/test");
Name fileName = resolver.getQName("test.txt");
Batch b = rs.createBatch(si, nid);
b.addNode(nid, fileName, NameConstants.NT_FILE, null);
String filePath = testPath + "/" + fileName.getLocalName();
NodeId fileID = getNodeId(filePath);
b.addNode(fileID, NameConstants.JCR_CONTENT, NameConstants.NT_RESOURCE, null);
NodeId content = getNodeId(filePath + "/" + NameConstants.JCR_CONTENT);
QValue lastModified = rs.getQValueFactory().create(Calendar.getInstance());
QValue mimeType = rs.getQValueFactory().create("text/plain", PropertyType.STRING);
QValue enc = rs.getQValueFactory().create("utf-8", PropertyType.STRING);
b.addProperty(content, resolver.getQName(JcrConstants.JCR_LASTMODIFIED), lastModified);
b.addProperty(content, resolver.getQName(JcrConstants.JCR_MIMETYPE), mimeType);
b.addProperty(content, resolver.getQName(JcrConstants.JCR_ENCODING), enc);
InputStream data = new ByteArrayInputStream("\u0633\u0634".getBytes("UTF-8"));
b.addProperty(content, resolver.getQName(JcrConstants.JCR_DATA), rs.getQValueFactory().create(data));
rs.submit(b);
// test properties of the file node
String uri = rs.getItemUri(fileID, si);