Search in sources :

Example 6 with WsimportOptions

use of com.sun.tools.ws.wscompile.WsimportOptions in project metro-jax-ws by eclipse-ee4j.

the class WsimportOptionsTest method testParseArgument_javacArgs.

/**
 * Test of parseArguments(String[]) method, of class WsimportOptions.
 */
public void testParseArgument_javacArgs() throws Exception {
    WsimportOptions options = new WsimportOptions();
    String[] args = new String[] { "-g", "-J-g", "-J-source=1.6", "-J-target=1.6", "-J-XprintRounds" };
    options.parseArguments(args);
    assertFalse("javac options not set", options.javacOptions.isEmpty());
    assertEquals("invalid option recognized", 4, options.javacOptions.size());
    L l = new L();
    List<String> jopts = options.getJavacOptions(new ArrayList<String>() {

        {
            add("-g");
        }
    }, l);
    assertEquals("incorrect split of javac options", 5, jopts.size());
    assertTrue(jopts.remove("-source"));
    assertTrue(jopts.remove("1.6"));
    assertTrue(jopts.remove("-target"));
    assertTrue(jopts.remove("1.6"));
    assertTrue(jopts.remove("-XprintRounds"));
    assertTrue(jopts.isEmpty());
    assertEquals(1, l.i);
}
Also used : WsimportOptions(com.sun.tools.ws.wscompile.WsimportOptions)

Example 7 with WsimportOptions

use of com.sun.tools.ws.wscompile.WsimportOptions in project metro-jax-ws by eclipse-ee4j.

the class WSDLParserTest method testParseUsingPolicyRequired.

public void testParseUsingPolicyRequired() throws Exception {
    final ErrorReceiverFilter errorReceiver = createErrorReceiver();
    final InputSource source = getResourceSource("usingpolicy-required.wsdl");
    final WsimportOptions options = new WsimportOptions();
    options.addWSDL(source);
    final WSDLParser instance = new WSDLParser(options, errorReceiver, null);
    final WSDLDocument wsdl = instance.parse();
    assertNotNull(wsdl);
    assertFalse(errorReceiver.hadError());
}
Also used : WSDLDocument(com.sun.tools.ws.wsdl.document.WSDLDocument) InputSource(org.xml.sax.InputSource) ErrorReceiverFilter(com.sun.tools.ws.wscompile.ErrorReceiverFilter) WsimportOptions(com.sun.tools.ws.wscompile.WsimportOptions) WSDLParser(com.sun.tools.ws.wsdl.parser.WSDLParser)

Example 8 with WsimportOptions

use of com.sun.tools.ws.wscompile.WsimportOptions in project metro-jax-ws by eclipse-ee4j.

the class WSDLParserTest method testParseSimple.

public void testParseSimple() throws Exception {
    final ErrorReceiverFilter errorReceiver = createErrorReceiver();
    final InputSource source = getResourceSource("simple.wsdl");
    final WsimportOptions options = new WsimportOptions();
    options.addWSDL(source);
    final WSDLParser instance = new WSDLParser(options, errorReceiver, null);
    final WSDLDocument wsdl = instance.parse();
    assertNotNull(wsdl);
    assertFalse(errorReceiver.hadError());
}
Also used : WSDLDocument(com.sun.tools.ws.wsdl.document.WSDLDocument) InputSource(org.xml.sax.InputSource) ErrorReceiverFilter(com.sun.tools.ws.wscompile.ErrorReceiverFilter) WsimportOptions(com.sun.tools.ws.wscompile.WsimportOptions) WSDLParser(com.sun.tools.ws.wsdl.parser.WSDLParser)

Example 9 with WsimportOptions

use of com.sun.tools.ws.wscompile.WsimportOptions in project metro-jax-ws by eclipse-ee4j.

the class WSDLParserTest method testParseUsingPolicy.

public void testParseUsingPolicy() throws Exception {
    final ErrorReceiverFilter errorReceiver = createErrorReceiver();
    final InputSource source = getResourceSource("usingpolicy.wsdl");
    final WsimportOptions options = new WsimportOptions();
    options.addWSDL(source);
    final WSDLParser instance = new WSDLParser(options, errorReceiver, null);
    final WSDLDocument wsdl = instance.parse();
    assertNotNull(wsdl);
    assertFalse(errorReceiver.hadError());
}
Also used : WSDLDocument(com.sun.tools.ws.wsdl.document.WSDLDocument) InputSource(org.xml.sax.InputSource) ErrorReceiverFilter(com.sun.tools.ws.wscompile.ErrorReceiverFilter) WsimportOptions(com.sun.tools.ws.wscompile.WsimportOptions) WSDLParser(com.sun.tools.ws.wsdl.parser.WSDLParser)

Aggregations

WsimportOptions (com.sun.tools.ws.wscompile.WsimportOptions)9 ErrorReceiverFilter (com.sun.tools.ws.wscompile.ErrorReceiverFilter)7 WSDLDocument (com.sun.tools.ws.wsdl.document.WSDLDocument)7 WSDLParser (com.sun.tools.ws.wsdl.parser.WSDLParser)7 InputSource (org.xml.sax.InputSource)7 SchemaCompiler (com.sun.tools.xjc.api.SchemaCompiler)1