OpenImmoUtils { public static OpenImmoDocument createDocument(InputStream input) throws SAXException, IOException, ParserConfigurationException { return createDocument(XmlUtils.newDocument(input, true)); } private  OpenImmoUtils(); static OpenImmoDocument createDocument(InputStream input); static OpenImmoDocument createDocument(File xmlFile); static OpenImmoDocument createDocument(String xmlString); static OpenImmoDocument createDocument(Document doc); @SuppressWarnings("unused") static Marshaller createMarshaller(); @SuppressWarnings("Duplicates") static Marshaller createMarshaller(String encoding, boolean formatted); static Unmarshaller createUnmarshaller(); @SuppressWarnings("Duplicates") static Element createUserDefinedSimplefield(Document doc, String name, String value); synchronized static JAXBContext getContext(); static DateFormat getDateFormat(); synchronized static ObjectFactory getFactory(); synchronized static void initContext(ClassLoader classloader); static Calendar parseDate(String value); static Calendar parseDateTime(String value); @SuppressWarnings("Duplicates") static BigDecimal parseDecimal(String value); static BigInteger parseInteger(String value); static BigDecimal parsePositiveDecimal(String value); static BigInteger parsePositiveInteger(String value); static String printDate(Calendar value); static String printDateTime(Calendar value); static String printDecimal(BigDecimal value); static String printInteger(BigInteger value); static String printPositiveDecimal(BigDecimal value); static String printPositiveInteger(BigInteger value); @SuppressWarnings("unused")
    final static OpenImmoVersion VERSION; @SuppressWarnings("unused")
    final static String NAMESPACE; @SuppressWarnings("unused")
    final static String OLD_NAMESPACE; @SuppressWarnings("unused")
    final static String PACKAGE; @SuppressWarnings("unused")
    final static ObjectFactory FACTORY; }
@Test public void testCreateDocument() { String transferXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<openimmo>\n" + " <uebertragung version=\"" + OpenImmoUtils.VERSION.toReadableVersion() + "\" " + " sendersoftware=\"OpenEstate.org\" " + " senderversion=\"1.0\" " + " techn_email=\"test@openestate.org\" " + " modus=\"NEW\" umfang=\"VOLL\" art=\"OFFLINE\"/>\n" + " <anbieter>\n" + " </anbieter>\n" + "</openimmo>"; String feedbackXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<openimmo_feedback>\n" + " <version>" + OpenImmoUtils.VERSION.toReadableVersion() + "</version>\n" + "</openimmo_feedback>"; OpenImmoDocument doc; try { doc = OpenImmoUtils.createDocument(transferXml); Assert.assertNotNull( "Transfer was processed.", doc); Assert.assertTrue("Transfer was processed as TransferDocument.", doc instanceof OpenImmoTransferDocument); doc = OpenImmoUtils.createDocument(feedbackXml); Assert.assertNotNull( "Feedback was processed.", doc); Assert.assertTrue("Feedback was processed as FeedbackDocument.", doc instanceof OpenImmoFeedbackDocument); } catch (Exception ex) { LOGGER.error("Test of OpenImmoUtils.createDocument failed!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); Assert.fail("Test of OpenImmoUtils.createDocument failed!"); } }