NodeId srcId = getNodeId(testPath);
NodeId destParentId = getNodeId("/");
rs.copy(si, si.getWorkspaceName(), srcId, destParentId, resolver.getQName("destname"));
nid = getNodeId("/destname");
NodeInfo nInfo = rs.getNodeInfo(si, nid);
Iterator<? extends ItemInfo> it = rs.getItemInfos(si, nid);
assertTrue(it.hasNext());
NodeInfo nInfo2 = (NodeInfo) it.next();
assertEquals(nInfo.getId(), nInfo2.getId());
assertEquals(nInfo.getNodetype(), nInfo2.getNodetype());
} finally {
if (nid != null) {
Batch b = rs.createBatch(si, getNodeId("/"));
b.remove(nid);
rs.submit(b);