@Test public void getCollectionXMLNullTest() throws Exception { String xml = Converter.getRootCollectionXML(null); SAXBuilder builder = new SAXBuilder(); builder.setValidation(false); builder.setIgnoringElementContentWhitespace(true); Document xmldoc = builder.build(new StringReader(xml)); XPath xpath = XPath.newInstance(" xpath.addNamespace("bnf", PROVIDER_REGISTRY_NAMESPACE); List listxpath = xpath.selectNodes(xmldoc); assertEquals(1, listxpath.size()); Element element = (Element) listxpath.get(0); assertEquals("/", element.getAttributeValue("href")); XPath xpathName = XPath.newInstance(" xpathName.addNamespace("bnf", PROVIDER_REGISTRY_NAMESPACE); List listxpathName = xpathName.selectNodes(xmldoc); assertEquals(0, listxpathName.size()); xpathName = XPath.newInstance(" xpathName.addNamespace("bnf", PROVIDER_REGISTRY_NAMESPACE); listxpathName = xpathName.selectNodes(xmldoc); assertEquals(1, listxpathName.size()); xpathName = XPath.newInstance(" xpathName.addNamespace("bnf", PROVIDER_REGISTRY_NAMESPACE); listxpathName = xpathName.selectNodes(xmldoc); assertEquals(0, listxpathName.size()); xpathName = XPath.newInstance(" xpathName.addNamespace("bnf", PROVIDER_REGISTRY_NAMESPACE); listxpathName = xpathName.selectNodes(xmldoc); assertEquals(0, listxpathName.size()); xpathName = XPath.newInstance(" xpathName.addNamespace("bnf", PROVIDER_REGISTRY_NAMESPACE); listxpathName = xpathName.selectNodes(xmldoc); assertEquals(0, listxpathName.size()); }
public static String getRootCollectionXML(List<Provider> providers) { Collection collection = prepareCollection(providers); return toXML(Collection.class, collection); }
Converter { public static String getRootCollectionXML(List<Provider> providers) { Collection collection = prepareCollection(providers); return toXML(Collection.class, collection); } }
Converter { public static String getRootCollectionXML(List<Provider> providers) { Collection collection = prepareCollection(providers); return toXML(Collection.class, collection); }  }
Converter { public static String getRootCollectionXML(List<Provider> providers) { Collection collection = prepareCollection(providers); return toXML(Collection.class, collection); }  static Provider getProviderObject(String xml); static String getProviderXML(Provider provider); static String getRootCollectionJSON(List<Provider> providers); static String getRootCollectionXML(List<Provider> providers); static String getProviderJSON(Provider provider); static Provider getProviderFromJSON(String json); }
Converter { public static String getRootCollectionXML(List<Provider> providers) { Collection collection = prepareCollection(providers); return toXML(Collection.class, collection); }  static Provider getProviderObject(String xml); static String getProviderXML(Provider provider); static String getRootCollectionJSON(List<Provider> providers); static String getRootCollectionXML(List<Provider> providers); static String getProviderJSON(Provider provider); static Provider getProviderFromJSON(String json);  }