### Question:
JavaToWS { public static void main(String[] args) { System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true"); CommandInterfaceUtils.commandCommonMain(); JavaToWS j2w = new JavaToWS(args); try { j2w.run(); } catch (Throwable ex) { System.err.println("JavaToWS Error: " + ex.toString()); System.err.println(); if (j2w.isVerbose()) { ex.printStackTrace(); } if (j2w.isExitOnFinish()) { System.exit(1); } } } JavaToWS();  JavaToWS(String[] pargs); static void main(String[] args); boolean isVerbose(); void run(); void run(OutputStream os); void run(ToolContext context, OutputStream os);  }### Answer:
@Test public void testJaxwsFrontendViaMain() throws Exception { File wsdlFile = outputFile("tmp.wsdl"); String[] args = new String[] {"-wsdl", "-o", output.getPath() + "/tmp.wsdl", "-s", output.getPath(), "-frontend", "jaxws", "-client", "-server", "-address", "http: "org.apache.hello_world_doc_lit.Greeter"}; JavaToWS.main(args); assertTrue("Failed to generate WSDL file", wsdlFile.exists()); String str = TestFileUtils.getStringFromFile(wsdlFile); assertTrue("Port address in generated wsdl is not correct", str.contains("http: File client = outputFile("org/apache/hello_world_doc_lit/GreeterClient.java"); str = TestFileUtils.getStringFromFile(client); assertTrue("Address generated in client side code is not correct", str.contains("http: File server = outputFile("org/apache/hello_world_doc_lit/GreeterServer.java"); str = TestFileUtils.getStringFromFile(server); assertTrue("Address generated in server side code is not correct", str.contains("http: File impl = outputFile("org/apache/hello_world_doc_lit/GreeterImpl.java"); Compiler compiler = new Compiler(); String[] files = new String[]{client.getAbsoluteFile().toString(), server.getAbsoluteFile().toString(), impl.getAbsoluteFile().toString()}; compiler.setOutputDir(this.classDir); compiler.compileFiles(files); }
@Test public void testGenWrapperBean() throws Exception { String[] args = new String[] {"-s", output.getPath(), "-wrapperbean", "-server", "org.apache.cxf.tools.java2ws.fortest.Calculator"}; JavaToWS.main(args); }