AppSchemaValidator { public static void validate(String xml, SchemaCatalog catalog) { byte[] bytes = null; String encoding = getEncoding(xml); if (encoding != null) { try { bytes = xml.getBytes(encoding); } catch (UnsupportedEncodingException e) { } } if (bytes == null) { bytes = xml.getBytes(); } InputStream input = null; try { input = new ByteArrayInputStream(bytes); validate(input, catalog); } finally { if (input != null) { try { input.close(); } catch (IOException e) { } } } } private  AppSchemaValidator(); private  AppSchemaValidator(SchemaResolver resolver); private  AppSchemaValidator(SchemaCatalog catalog); List<String> getFailures(); boolean isFailOnWarning(); void setFailOnWarning(boolean failOnWarning); void parse(InputStream input); void checkForFailures(); static AppSchemaValidator buildValidator(); static AppSchemaValidator buildValidator(SchemaResolver resolver); static AppSchemaValidator buildValidator(SchemaCatalog catalog); static void validateResource(String name, SchemaCatalog catalog); static void validate(String xml, SchemaCatalog catalog); static void validate(InputStream input, SchemaCatalog catalog);  }
@Test public void validateGetFeature() { AppSchemaValidator.validate("<wfs:GetFeature " + "xmlns:wfs=\"http: + "xmlns:xsi=\"http: + "xsi:schemaLocation=\"" + "http: + "\"><wfs:Query typeName=\"test\"/></wfs:GetFeature>", null); }