@Override
 protected void runTest() throws Throwable {
   CoreDocument document1 = nodeFactory.createDocument();
   CoreDocument document2 = nodeFactory.createDocument();
   CoreChildNode node1 = nodeFactory.createComment(document1, "test");
   document1.coreAppendChild(node1, Policies.REJECT);
   CoreChildNode node2 = nodeFactory.createComment(document2, "test");
   try {
     node1.coreReplaceWith(node2);
     fail("Expected WrongDocumentException");
   } catch (WrongDocumentException ex) {
     // Expected
   }
 }
Exemplo n.º 2
0
 public static void assertSiblings(CoreChildNode node1, CoreChildNode node2)
     throws DeferredBuildingException {
   Assert.assertSame(node2, node1.coreGetNextSibling());
   Assert.assertSame(node1, node2.coreGetPreviousSibling());
 }
Exemplo n.º 3
0
 public static void assertOrphan(CoreChildNode node) throws DeferredBuildingException {
   Assert.assertNull(node.coreGetParent());
   Assert.assertNull(node.coreGetPreviousSibling());
   Assert.assertNull(node.coreGetNextSibling());
 }