OpenImmo_1_2_0 extends XmlConverter<OpenImmoDocument, OpenImmoVersion> { protected void removeUserDefinedExtendElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( " for (Object item : nodes) { Element node = (Element) item; Element parentNode = (Element) node.getParentNode(); parentNode.removeChild(node); } }  @Override OpenImmoVersion getVersion(); @Override void downgradeToPreviousVersion(OpenImmoDocument doc); @Override void upgradeFromPreviousVersion(OpenImmoDocument doc);  }
@Test public void testRemoveUserDefinedExtendElements() { try { Document doc = buildTransferDocumentForDowngrade(); int count; count = XmlUtils.countNodes( " Assert.assertEquals( "4 convertable <user_defined_extend> elements available before conversion.", 4, count); new OpenImmo_1_2_0().removeUserDefinedExtendElements(doc); count = XmlUtils.countNodes( " Assert.assertEquals( "0 convertable <user_defined_extend> elements available after conversion.", 0, count); } catch (Exception ex) { LOGGER.error("Test of OpenImmo_1_2_0.removeUserDefinedExtendElements failed!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); Assert.fail("Test of OpenImmo_1_2_0.removeUserDefinedExtendElements failed!"); } }