TrovitUtils { public static TrovitDocument createDocument(InputStream input) throws SAXException, IOException, ParserConfigurationException { return createDocument(XmlUtils.newDocument(input, true)); } private  TrovitUtils(); static TrovitDocument createDocument(InputStream input); static TrovitDocument createDocument(File xmlFile); static TrovitDocument createDocument(String xmlString); static TrovitDocument createDocument(Document doc); @SuppressWarnings("unused") static Marshaller createMarshaller(); @SuppressWarnings("Duplicates") static Marshaller createMarshaller(String encoding, boolean formatted); static Unmarshaller createUnmarshaller(); synchronized static JAXBContext getContext(); synchronized static ObjectFactory getFactory(); synchronized static void initContext(ClassLoader classloader); static AreaUnitValue parseAreaUnitValue(String value); static Boolean parseBooleanValue(String value); static String parseContentValue(String value); static String parseCountryValue(String value); static Calendar parseDateValue(String value); static BigInteger parseFloorAreaValue(String value); static ForeclosureTypeValue parseForeclosureTypeValue(String value); static BigDecimal parseLatitudeValue(String value); static BigDecimal parseLongitudeValue(String value); static OrientationValue parseOrientationValue(String value); static BigInteger parsePlotAreaValue(String value); static Currency parsePriceCurrencyValue(String value); static PricePeriodValue parsePricePeriodValue(String value); static BigDecimal parsePriceValue(String value); static BigDecimal parseRoomsValue(String value); static URI parseUriValue(String value); static TypeValue parseTypeValue(String value); static BigInteger parseYearValue(String value); static String printAreaUnitValue(AreaUnitValue value); static String printBooleanValue(Boolean value); static String printContentValue(String value); static String printCountryValue(String value); static String printDateValue(Calendar value); static String printFloorAreaValue(BigInteger value); static String printForeclosureTypeValue(ForeclosureTypeValue value); static String printLatitudeValue(BigDecimal value); static String printLongitudeValue(BigDecimal value); static String printOrientationValue(OrientationValue value); static String printPlotAreaValue(BigInteger value); static String printPriceCurrencyValue(Currency value); static String printPricePeriodValue(PricePeriodValue value); static String printPriceValue(BigDecimal value); static String printRoomsValue(BigDecimal value); static String printTypeValue(TypeValue value); static String printUriValue(URI value); static String printYearValue(BigInteger value); @SuppressWarnings("unused")
    final static String 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" + "<trovit>\n" + " <ad>\n" + " <id><![CDATA[...]]></id>\n" + " <url><![CDATA[...]]></url>\n" + " <title><![CDATA[...]]></title>\n" + " <type><![CDATA[...]]></type>\n" + " <agency><![CDATA[...]]></agency>\n" + " <content><![CDATA[...]]></content>\n" + " <price><![CDATA[...]]></price>\n" + " <property_type><![CDATA[...]]></property_type>\n" + " <floor_area unit=\"feet\"><![CDATA[...]]></floor_area>\n" + " <rooms><![CDATA[...]]></rooms>\n" + " <bathrooms><![CDATA[...]]></bathrooms>\n" + " <parking><![CDATA[...]]></parking>\n" + " <address><![CDATA[...]]></address>\n" + " <city><![CDATA[...]]></city>\n" + " <city_area><![CDATA[...]]></city_area>\n" + " <postcode><![CDATA[...]]></postcode>\n" + " <region><![CDATA[...]]></region>\n" + " <latitude><![CDATA[...]]></latitude>\n" + " <longitude><![CDATA[...]]></longitude>\n" + " <pictures>\n" + " <picture>\n" + " <picture_url><![CDATA[...]]></picture_url>\n" + " <picture_title><![CDATA[...]]></picture_title>\n" + " </picture>\n" + " <picture>\n" + " <picture_url><![CDATA[...]]></picture_url>\n" + " <picture_title><![CDATA[...]]></picture_title>\n" + " </picture>\n" + " </pictures>\n" + " <virtual_tour><![CDATA[...]]></virtual_tour>\n" + " <date><![CDATA[...]]></date>\n" + " <time><![CDATA[...]]></time>\n" + " <expiration_date><![CDATA[...]]></expiration_date>\n" + " <plot_area><![CDATA[...]]></plot_area>\n" + " <floor_number><![CDATA[...]]></floor_number>\n" + " <orientation><![CDATA[...]]></orientation>\n" + " <foreclosure><![CDATA[...]]></foreclosure>\n" + " <is_furnished><![CDATA[...]]></is_furnished>\n" + " <is_new><![CDATA[...]]></is_new>\n" + " <condition><![CDATA[...]]></condition>\n" + " <year><![CDATA[...]]></year>\n" + " </ad>\n" + "</trovit>"; TrovitDocument doc; try { doc = TrovitUtils.createDocument(transferXml); Assert.assertNotNull( "Transfer was processed.", doc); Assert.assertTrue("Transfer was processed as TransferDocument.", doc instanceof TrovitDocument); } catch (Exception ex) { LOGGER.error("Test of TrovitUtils.createDocument failed!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); Assert.fail("Test of TrovitUtils.createDocument failed!"); } }