ensureMixinType(b1, mixShareable);
b1.save();
// clone
Session session = b1.getSession();
Workspace workspace = session.getWorkspace();
workspace.clone(workspace.getName(), b1.getPath(),
a2.getPath() + "/b2", false);
// add child c to shareable nodes b1 & b2
b1.addNode("c");
b1.save();
// create temp file
File tmpFile = File.createTempFile("test", null);
tmpFile.deleteOnExit();
// export system view of /a1/b1
OutputStream out = new FileOutputStream(tmpFile);
try {
session.exportDocumentView(b1.getPath(), out, false, false);
} finally {
out.close();
}
// and import again underneath /a3
InputStream in = new FileInputStream(tmpFile);
try {
workspace.importXML(a3.getPath(), in, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
} finally {
in.close();
}
// verify there's another element in the shared set