Search in sources :

Example 6 with JavaToWS

use of org.apache.cxf.tools.java2ws.JavaToWS in project cxf by apache.

the class JavaToWSFlagTest method testHelpOutput.

@Test
public void testHelpOutput() {
    String[] args = new String[] { "-help" };
    CommandInterfaceUtils.commandCommonMain();
    JavaToWS j2w = new JavaToWS(args);
    try {
        j2w.run();
    } catch (Throwable ex) {
        System.err.println("JavaToWS Error: " + ex.toString());
        System.err.println();
    }
    assertNotNull(getStdOut());
}
Also used : JavaToWS(org.apache.cxf.tools.java2ws.JavaToWS) Test(org.junit.Test)

Example 7 with JavaToWS

use of org.apache.cxf.tools.java2ws.JavaToWS in project cxf by apache.

the class JavaToWSFlagTest method testNoOutPutFile.

@Test
public void testNoOutPutFile() throws Exception {
    String[] args = new String[] { "-o", getLocation("nooutput.wsdl"), "org.apache.hello_world_soap_http.Greeter" };
    CommandInterfaceUtils.commandCommonMain();
    JavaToWS j2w = new JavaToWS(args);
    try {
        j2w.run();
    } catch (Throwable ex) {
        System.err.println("JavaToWS Error: " + ex.toString());
        System.err.println();
    }
    assertNotNull(getStdOut());
}
Also used : JavaToWS(org.apache.cxf.tools.java2ws.JavaToWS) Test(org.junit.Test)

Example 8 with JavaToWS

use of org.apache.cxf.tools.java2ws.JavaToWS in project cxf by apache.

the class JavaToWSFlagTest method testVersionOutput.

@Test
public void testVersionOutput() throws Exception {
    String[] args = new String[] { "-v" };
    CommandInterfaceUtils.commandCommonMain();
    JavaToWS j2w = new JavaToWS(args);
    try {
        j2w.run();
    } catch (Throwable ex) {
        System.err.println("JavaToWS Error: " + ex.toString());
        System.err.println();
    }
    assertNotNull(getStdOut());
}
Also used : JavaToWS(org.apache.cxf.tools.java2ws.JavaToWS) Test(org.junit.Test)

Example 9 with JavaToWS

use of org.apache.cxf.tools.java2ws.JavaToWS in project cxf by apache.

the class JavaToWSFlagTest method testBadUsage.

@Test
public void testBadUsage() {
    String[] args = new String[] { "-ttt", "a.ww" };
    CommandInterfaceUtils.commandCommonMain();
    JavaToWS j2w = new JavaToWS(args);
    try {
        j2w.run();
    } catch (Throwable ex) {
        System.err.println("JavaToWS Error: " + ex.toString());
        System.err.println();
    }
    assertNotNull(getStdOut());
}
Also used : JavaToWS(org.apache.cxf.tools.java2ws.JavaToWS) Test(org.junit.Test)

Example 10 with JavaToWS

use of org.apache.cxf.tools.java2ws.JavaToWS in project cxf by apache.

the class JavaToWSFlagTest method testNormalArgs.

@Test
public void testNormalArgs() throws Exception {
    System.err.println(getLocation("test.wsdl"));
    String[] args = new String[] { "-o", getLocation("normal.wsdl"), "org.apache.hello_world_soap_http.Greeter" };
    CommandInterfaceUtils.commandCommonMain();
    JavaToWS j2w = new JavaToWS(args);
    try {
        j2w.run();
    } catch (Throwable ex) {
        System.err.println("JavaToWS Error: " + ex.toString());
        System.err.println();
    }
    assertNotNull(getStdOut());
}
Also used : JavaToWS(org.apache.cxf.tools.java2ws.JavaToWS) Test(org.junit.Test)

Aggregations

JavaToWS (org.apache.cxf.tools.java2ws.JavaToWS)11 Test (org.junit.Test)7 File (java.io.File)4 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Artifact (org.apache.maven.artifact.Artifact)2 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)2 CommandLineException (org.codehaus.plexus.util.cli.CommandLineException)2 CommandLineUtils (org.codehaus.plexus.util.cli.CommandLineUtils)2 Commandline (org.codehaus.plexus.util.cli.Commandline)2 PrintStream (java.io.PrintStream)1 URLClassLoader (java.net.URLClassLoader)1 StringTokenizer (java.util.StringTokenizer)1 NullPrintStream (org.jboss.ws.common.utils.NullPrintStream)1