@Test(expected=SAXException.class) public void testModelNameUniqueness() throws Exception { FileInputStream in = new FileInputStream(UnitTestUtil.getTestDataPath() + "/model-not-unique-vdb.xml"); VDBMetadataParser.validate(in); }
public static void validate(InputStream content) throws SAXException, IOException { try { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(VDBMetaData.class.getResource("/vdb-deployer.xsd")); Validator v = schema.newValidator(); v.validate(new StreamSource(content)); } finally { content.close(); } }
VDBMetadataParser { public static void validate(InputStream content) throws SAXException, IOException { try { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(VDBMetaData.class.getResource("/vdb-deployer.xsd")); Validator v = schema.newValidator(); v.validate(new StreamSource(content)); } finally { content.close(); } } }
VDBMetadataParser { public static void validate(InputStream content) throws SAXException, IOException { try { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(VDBMetaData.class.getResource("/vdb-deployer.xsd")); Validator v = schema.newValidator(); v.validate(new StreamSource(content)); } finally { content.close(); } }  }
VDBMetadataParser { public static void validate(InputStream content) throws SAXException, IOException { try { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(VDBMetaData.class.getResource("/vdb-deployer.xsd")); Validator v = schema.newValidator(); v.validate(new StreamSource(content)); } finally { content.close(); } }  @Deprecated static VDBMetaData unmarshell(InputStream content); static VDBMetaData unmarshall(InputStream content); static void validate(InputStream content); @Deprecated static void marshell(VDBMetaData vdb, OutputStream out); static void marshall(VDBMetaData vdb, OutputStream out); }
VDBMetadataParser { public static void validate(InputStream content) throws SAXException, IOException { try { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(VDBMetaData.class.getResource("/vdb-deployer.xsd")); Validator v = schema.newValidator(); v.validate(new StreamSource(content)); } finally { content.close(); } }  @Deprecated static VDBMetaData unmarshell(InputStream content); static VDBMetaData unmarshall(InputStream content); static void validate(InputStream content); @Deprecated static void marshell(VDBMetaData vdb, OutputStream out); static void marshall(VDBMetaData vdb, OutputStream out);  }