### Question:
XmlModeler implements ContentModeler { @Override public void registerModel(String model) throws BagriException { XSImplementation impl = (XSImplementation) new DOMXSImplementationSourceImpl().getDOMImplementation("XS-Loader LS"); XSLoader schemaLoader = impl.createXSLoader(null); LSInput lsi = ((DOMImplementationLS) impl).createLSInput(); lsi.setStringData(model); XSModel schema = schemaLoader.load(lsi); processModel(schema); } XmlModeler(ModelManagement modelMgr); void init(Properties properties); @Override void registerModel(String model); void registerModels(String modelsUri); @Override void registerModelUri(String modelUri);  }### Answer:
@Test public void registerRRPersonSchemaTest() throws Exception { XmlStaxParser parser = new XmlStaxParser(model); ParseResults results = parser.parse(xml); List<Data> data = results.getResults(); modelPro.registerModel(schemaRussianDoll); Collection<Path> paths = model.getTypePaths("/person"); assertNotNull(paths); assertTrue(paths.size() > 0); assertEquals(data.size(), paths.size()); compareModels(paths, data); }
@Test public void registerRRSchemaPersonTest() throws Exception { modelPro.registerModel(schemaRussianDoll); Collection<Path> paths = model.getTypePaths("/person"); assertNotNull(paths); assertTrue(paths.size() > 0); XmlStaxParser parser = new XmlStaxParser(model); ParseResults results = parser.parse(xml); List<Data> data = results.getResults(); assertEquals(data.size(), paths.size()); compareModels(paths, data); }
@Test public void registerSSPersonSchemaTest() throws Exception { XmlStaxParser parser = new XmlStaxParser(model); ParseResults results = parser.parse(xml); List<Data> data = results.getResults(); modelPro.registerModel(schemaSalamiSlice); Collection<Path> paths = model.getTypePaths("/person"); assertNotNull(paths); assertTrue(paths.size() > 0); assertEquals(data.size(), paths.size()); compareModels(paths, data); }
@Test public void registerSSSchemaPersonTest() throws Exception { modelPro.registerModel(schemaSalamiSlice); Collection<Path> paths = model.getTypePaths("/person"); assertNotNull(paths); assertTrue(paths.size() > 0); XmlStaxParser parser = new XmlStaxParser(model); ParseResults results = parser.parse(xml); List<Data> data = results.getResults(); assertEquals(data.size(), paths.size()); compareModels(paths, data); }
@Test public void registerVBPersonSchemaTest() throws Exception { XmlStaxParser parser = new XmlStaxParser(model); ParseResults results = parser.parse(xml); List<Data> data = results.getResults(); modelPro.registerModel(schemaVenetianBlind); Collection<Path> paths = model.getTypePaths("/person"); assertNotNull(paths); assertTrue(paths.size() > 0); assertEquals(data.size(), paths.size()); compareModels(paths, data); }
@Test public void registerVBSchemaPersonTest() throws Exception { modelPro.registerModel(schemaVenetianBlind); Collection<Path> paths = model.getTypePaths("/person"); assertNotNull(paths); assertTrue(paths.size() > 0); XmlStaxParser parser = new XmlStaxParser(model); ParseResults results = parser.parse(xml); List<Data> data = results.getResults(); assertEquals(data.size(), paths.size()); compareModels(paths, data); }
@Test public void registerSecurityPathTest() throws Exception { String schema = readTextFile("../etc/samples/tpox/security.xsd"); modelPro.registerModel(schema); Collection<Path> paths = model.getTypePaths("/{http: assertNotNull(paths); assertTrue(paths.size() > 0); assertEquals(165, paths.size()); }
@Test public void registerCustomerPathTest() throws Exception { String schema = readTextFile("../etc/samples/tpox/custacc.xsd"); modelPro.registerModel(schema); Collection<Path> paths = model.getTypePaths("/{http: assertNotNull(paths); assertTrue(paths.size() > 0); assertEquals(162, paths.size()); }