ViewArchiveUtility { protected void validateConfig(InputStream configStream) throws SAXException, IOException { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); URL schemaUrl = getClass().getClassLoader().getResource(VIEW_XSD); Schema schema = schemaFactory.newSchema(schemaUrl); schema.newValidator().validate(new StreamSource(configStream)); }  ViewConfig getViewConfigFromArchive(File archiveFile); ViewConfig getViewConfigFromExtractedArchive(String archivePath, boolean validate); File getFile(String path); FileOutputStream getFileOutputStream(File file); JarInputStream getJarFileStream(File file);  }
@Test public void testValidateConfig() throws Exception { ViewArchiveUtility utility = new ViewArchiveUtility(); InputStream configStream = getClass().getClassLoader().getResourceAsStream("test_view.xml"); utility.validateConfig(configStream); }