use of org.apache.cxf.tools.common.ToolContext in project cxf by apache.
the class WSDLValidator method executeForMaven.
public boolean executeForMaven() {
super.execute(false);
ToolContext env = getContext();
env.setParameters(getParametersMap(getArrayKeys()));
env.put(ToolConstants.CFG_VALIDATE_WSDL, "all");
env.put(ToolConstants.CFG_CMD_ARG, getArgument());
WSDL11Validator wsdlValidator = new WSDL11Validator(null, env, getBus());
return wsdlValidator.isValid();
}
use of org.apache.cxf.tools.common.ToolContext in project cxf by apache.
the class WSDLValidator method execute.
public void execute(boolean exitOnFinish) {
try {
super.execute(exitOnFinish);
if (!hasInfoOption()) {
ToolContext env = getContext();
env.setParameters(getParametersMap(getArrayKeys()));
env.put(ToolConstants.CFG_VALIDATE_WSDL, "all");
env.put(ToolConstants.CFG_CMD_ARG, getArgument());
WSDL11Validator wsdlValidator = new WSDL11Validator(null, env, getBus());
if (wsdlValidator.isValid()) {
System.out.println("Passed Validation : Valid WSDL ");
}
}
} catch (ToolException ex) {
err.println("WSDLValidator Error : " + ex.getMessage());
if (ex.getCause() instanceof BadUsageException) {
printUsageException(TOOL_NAME, (BadUsageException) ex.getCause());
}
err.println();
if (isVerboseOn()) {
err.println("[+] Verbose turned on");
err.println();
ex.printStackTrace(err);
}
} catch (Exception ex) {
err.println("WSDLValidator Error : " + ex.getMessage());
err.println();
if (isVerboseOn()) {
err.println("[+] Verbose turned on");
err.println();
ex.printStackTrace(err);
}
}
}
use of org.apache.cxf.tools.common.ToolContext in project cxf by apache.
the class JavaToJSProcessorTest method startUp.
@Before
public void startUp() throws Exception {
env = new ToolContext();
classPath = System.getProperty("java.class.path");
System.setProperty("java.class.path", getClassPath());
if (System.getProperty("java.version").startsWith("9")) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
}
use of org.apache.cxf.tools.common.ToolContext in project cxf by apache.
the class JavaToProcessorTest method startUp.
@Before
public void startUp() throws Exception {
env = new ToolContext();
env.put(ToolConstants.CFG_WSDL, ToolConstants.CFG_WSDL);
classPath = System.getProperty("java.class.path");
System.setProperty("java.class.path", getClassPath());
if (System.getProperty("java.version").startsWith("9")) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
}
Aggregations