VersionedExtractorModelParser implements DOMExtractorModelParser { @Override public ExtractorModelContainer parse(String location, Element xmlRoot) { String ns = xmlRoot.getNamespaceURI(); return getDelegate(ns).parse(location, xmlRoot); } VersionedExtractorModelParser(Map<String, DOMExtractorModelParser> parsersByNS, String defaultNS); @Override ExtractorModelContainer parse(String location, Element xmlRoot);  }
@Test public void testParse_NoXSD() { Element xmlRoot = getXmlRoot("extractor_v1_no_xsd.xml"); parser.parse("alocation", xmlRoot); verify(mockNSDefault).parse("alocation", xmlRoot); verifyZeroInteractions(mockNS1, mockNS2); }
@Test public void testParse_NS1_XSD() { Element xmlRoot = getXmlRoot("extractor_dummy_ns1_xsd.xml"); parser.parse("alocation", xmlRoot); verify(mockNS1).parse("alocation", xmlRoot); verifyZeroInteractions(mockNSDefault, mockNS2); }
@Test public void testParse_NS2_XSD() { Element xmlRoot = getXmlRoot("extractor_dummy_ns2_xsd.xml"); parser.parse("alocation", xmlRoot); verify(mockNS2).parse("alocation", xmlRoot); verifyZeroInteractions(mockNSDefault, mockNS1); }