@Test public void shouldProduceWarning() { final MockStream bout = new MockStream(); assertEquals(0, WSDLValidator.executeValidator("src/test/resources/warn.wsdl", bout)); assertTrue(!bout.isEmpty()); }
static int executeValidator(String wsdlUrl, PrintStream msg) { try { ToolContext env = new ToolContext(); env.put(ToolConstants.CFG_WSDLURL, wsdlUrl); final WSDL11Validator validator = new WSDL11Validator(null, env); if (validator.isValid()) { return 0; } } catch (ToolException ex) { msg.print(ex.getMessage()); if ((ex.getCause() == null || ex.getCause() == ex) && ex.getMessage().contains(" Failures: 0,")) { return 0; } } catch (Exception ex) { msg.println(ex.getMessage()); } return 1; }
WSDLValidator { static int executeValidator(String wsdlUrl, PrintStream msg) { try { ToolContext env = new ToolContext(); env.put(ToolConstants.CFG_WSDLURL, wsdlUrl); final WSDL11Validator validator = new WSDL11Validator(null, env); if (validator.isValid()) { return 0; } } catch (ToolException ex) { msg.print(ex.getMessage()); if ((ex.getCause() == null || ex.getCause() == ex) && ex.getMessage().contains(" Failures: 0,")) { return 0; } } catch (Exception ex) { msg.println(ex.getMessage()); } return 1; } }
WSDLValidator { static int executeValidator(String wsdlUrl, PrintStream msg) { try { ToolContext env = new ToolContext(); env.put(ToolConstants.CFG_WSDLURL, wsdlUrl); final WSDL11Validator validator = new WSDL11Validator(null, env); if (validator.isValid()) { return 0; } } catch (ToolException ex) { msg.print(ex.getMessage()); if ((ex.getCause() == null || ex.getCause() == ex) && ex.getMessage().contains(" Failures: 0,")) { return 0; } } catch (Exception ex) { msg.println(ex.getMessage()); } return 1; } private  WSDLValidator(); }
WSDLValidator { static int executeValidator(String wsdlUrl, PrintStream msg) { try { ToolContext env = new ToolContext(); env.put(ToolConstants.CFG_WSDLURL, wsdlUrl); final WSDL11Validator validator = new WSDL11Validator(null, env); if (validator.isValid()) { return 0; } } catch (ToolException ex) { msg.print(ex.getMessage()); if ((ex.getCause() == null || ex.getCause() == ex) && ex.getMessage().contains(" Failures: 0,")) { return 0; } } catch (Exception ex) { msg.println(ex.getMessage()); } return 1; } private  WSDLValidator(); static void main(String[] args); }
WSDLValidator { static int executeValidator(String wsdlUrl, PrintStream msg) { try { ToolContext env = new ToolContext(); env.put(ToolConstants.CFG_WSDLURL, wsdlUrl); final WSDL11Validator validator = new WSDL11Validator(null, env); if (validator.isValid()) { return 0; } } catch (ToolException ex) { msg.print(ex.getMessage()); if ((ex.getCause() == null || ex.getCause() == ex) && ex.getMessage().contains(" Failures: 0,")) { return 0; } } catch (Exception ex) { msg.println(ex.getMessage()); } return 1; } private  WSDLValidator(); static void main(String[] args);  }