Package org.pentaho.platform.plugin.services.webservices.content

Examples of org.pentaho.platform.plugin.services.webservices.content.AxisServiceWsdlGenerator


    tOut.setSender( sender );
    axisConfig.addTransportOut( tOut );

    LocalTransportReceiver.CONFIG_CONTEXT = new ConfigurationContext( axisConfig );

    AxisServiceWsdlGenerator contentGenerator = new AxisServiceWsdlGenerator();

    assertNotNull( "contentGenerator is null", contentGenerator ); //$NON-NLS-1$
    assertNotNull( "Logger is null", contentGenerator.getLogger() ); //$NON-NLS-1$

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    IOutputHandler outputHandler = new SimpleOutputHandler( out, false );

    String baseUrl = "http://testhost:testport/testcontent"; //$NON-NLS-1$
    Map<String, IParameterProvider> parameterProviders = new HashMap<String, IParameterProvider>();
    SimpleParameterProvider requestParams = new SimpleParameterProvider();
    parameterProviders.put( IParameterProvider.SCOPE_REQUEST, requestParams );
    SimpleParameterProvider pathParams = new SimpleParameterProvider();
    pathParams.setParameter( "path", "/StubService" ); //$NON-NLS-1$//$NON-NLS-2$
    parameterProviders.put( "path", pathParams ); //$NON-NLS-1$
    SimpleUrlFactory urlFactory = new SimpleUrlFactory( baseUrl + "?" ); //$NON-NLS-1$
    List<String> messages = new ArrayList<String>();
    contentGenerator.setOutputHandler( outputHandler );
    MimeTypeListener mimeTypeListener = new MimeTypeListener();
    outputHandler.setMimeTypeListener( mimeTypeListener );
    contentGenerator.setMessagesList( messages );
    contentGenerator.setParameterProviders( parameterProviders );
    contentGenerator.setSession( session );
    contentGenerator.setUrlFactory( urlFactory );
    try {
      contentGenerator.createContent();
      String content = new String( out.toByteArray() );
      System.out.println( content );

      assertTrue( "wsdl:definitions is missing", content.indexOf( "wsdl:definitions" ) != -1 ); //$NON-NLS-1$ //$NON-NLS-2$
      assertTrue(
View Full Code Here


    StandaloneSession session = new StandaloneSession( "test" ); //$NON-NLS-1$

    StubServiceSetup setup = new StubServiceSetup();
    setup.setSession( session );

    AxisServiceWsdlGenerator contentGenerator = new AxisServiceWsdlGenerator();

    assertNotNull( "contentGenerator is null", contentGenerator ); //$NON-NLS-1$
    assertNotNull( "Logger is null", contentGenerator.getLogger() ); //$NON-NLS-1$

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    IOutputHandler outputHandler = new SimpleOutputHandler( out, false );

    String baseUrl = "http://testhost:testport/testcontent"; //$NON-NLS-1$
    Map<String, IParameterProvider> parameterProviders = new HashMap<String, IParameterProvider>();
    SimpleParameterProvider requestParams = new SimpleParameterProvider();
    parameterProviders.put( IParameterProvider.SCOPE_REQUEST, requestParams );
    SimpleUrlFactory urlFactory = new SimpleUrlFactory( baseUrl + "?" ); //$NON-NLS-1$
    List<String> messages = new ArrayList<String>();
    contentGenerator.setOutputHandler( outputHandler );
    MimeTypeListener mimeTypeListener = new MimeTypeListener();
    outputHandler.setMimeTypeListener( mimeTypeListener );
    contentGenerator.setMessagesList( messages );
    contentGenerator.setParameterProviders( parameterProviders );
    contentGenerator.setSession( session );
    contentGenerator.setUrlFactory( urlFactory );
    try {
      contentGenerator.createContent();
      String content = new String( out.toByteArray() );
      assertTrue( content.indexOf( Messages.getInstance().getErrorString(
          "WebServiceContentGenerator.ERROR_0004_PATH_PARAMS_IS_MISSING" ) ) != -1 ); //$NON-NLS-1$
      System.out.println( content );
View Full Code Here

    StandaloneSession session = new StandaloneSession( "test" ); //$NON-NLS-1$

    StubServiceSetup setup = new StubServiceSetup();
    setup.setSession( session );

    AxisServiceWsdlGenerator contentGenerator = new AxisServiceWsdlGenerator();

    assertNotNull( "contentGenerator is null", contentGenerator ); //$NON-NLS-1$
    assertNotNull( "Logger is null", contentGenerator.getLogger() ); //$NON-NLS-1$

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    IOutputHandler outputHandler = new SimpleOutputHandler( out, false );

    String baseUrl = "http://testhost:testport/testcontent"; //$NON-NLS-1$
    Map<String, IParameterProvider> parameterProviders = new HashMap<String, IParameterProvider>();
    SimpleParameterProvider requestParams = new SimpleParameterProvider();
    parameterProviders.put( IParameterProvider.SCOPE_REQUEST, requestParams );
    SimpleParameterProvider pathParams = new SimpleParameterProvider();
    parameterProviders.put( "path", pathParams ); //$NON-NLS-1$
    SimpleUrlFactory urlFactory = new SimpleUrlFactory( baseUrl + "?" ); //$NON-NLS-1$
    List<String> messages = new ArrayList<String>();
    contentGenerator.setOutputHandler( outputHandler );
    MimeTypeListener mimeTypeListener = new MimeTypeListener();
    outputHandler.setMimeTypeListener( mimeTypeListener );
    contentGenerator.setMessagesList( messages );
    contentGenerator.setParameterProviders( parameterProviders );
    contentGenerator.setSession( session );
    contentGenerator.setUrlFactory( urlFactory );
    try {
      contentGenerator.createContent();
      String content = new String( out.toByteArray() );
      System.out.println( content );
      assertTrue( content.indexOf( Messages.getInstance().getErrorString(
          "WebServiceContentGenerator.ERROR_0005_SERVICE_NAME_IS_MISSING" ) ) != -1 ); //$NON-NLS-1$
View Full Code Here

    StandaloneSession session = new StandaloneSession( "test" ); //$NON-NLS-1$

    StubServiceSetup setup = new StubServiceSetup();
    setup.setSession( session );

    AxisServiceWsdlGenerator contentGenerator = new AxisServiceWsdlGenerator();

    assertNotNull( "contentGenerator is null", contentGenerator ); //$NON-NLS-1$
    assertNotNull( "Logger is null", contentGenerator.getLogger() ); //$NON-NLS-1$

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    IOutputHandler outputHandler = new SimpleOutputHandler( out, false );

    String baseUrl = "http://testhost:testport/testcontent"; //$NON-NLS-1$
    Map<String, IParameterProvider> parameterProviders = new HashMap<String, IParameterProvider>();
    SimpleParameterProvider requestParams = new SimpleParameterProvider();
    parameterProviders.put( IParameterProvider.SCOPE_REQUEST, requestParams );
    SimpleParameterProvider pathParams = new SimpleParameterProvider();
    pathParams.setParameter( "path", "/bogus" ); //$NON-NLS-1$//$NON-NLS-2$
    parameterProviders.put( "path", pathParams ); //$NON-NLS-1$
    SimpleUrlFactory urlFactory = new SimpleUrlFactory( baseUrl + "?" ); //$NON-NLS-1$
    List<String> messages = new ArrayList<String>();
    contentGenerator.setOutputHandler( outputHandler );
    MimeTypeListener mimeTypeListener = new MimeTypeListener();
    outputHandler.setMimeTypeListener( mimeTypeListener );
    contentGenerator.setMessagesList( messages );
    contentGenerator.setParameterProviders( parameterProviders );
    contentGenerator.setSession( session );
    contentGenerator.setUrlFactory( urlFactory );
    try {
      contentGenerator.createContent();
      String content = new String( out.toByteArray() );
      System.out.println( content );
      assertTrue( content.indexOf( Messages.getInstance().getErrorString(
          "WebServiceContentGenerator.ERROR_0006_SERVICE_IS_INVALID", "bogus" ) ) != -1 ); //$NON-NLS-1$ //$NON-NLS-2$
    } catch ( Exception e ) {
View Full Code Here

  @Test
  public void testBadInit3() throws Exception {
    StandaloneSession session = new StandaloneSession( "test" ); //$NON-NLS-1$

    AxisServiceWsdlGenerator contentGenerator = new AxisServiceWsdlGenerator();

    assertNotNull( "contentGenerator is null", contentGenerator ); //$NON-NLS-1$
    assertNotNull( "Logger is null", contentGenerator.getLogger() ); //$NON-NLS-1$

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    IOutputHandler outputHandler = new SimpleOutputHandler( out, false );

    String baseUrl = "http://testhost:testport/testcontent"; //$NON-NLS-1$
    Map<String, IParameterProvider> parameterProviders = new HashMap<String, IParameterProvider>();
    SimpleParameterProvider requestParams = new SimpleParameterProvider();
    parameterProviders.put( IParameterProvider.SCOPE_REQUEST, requestParams );
    SimpleUrlFactory urlFactory = new SimpleUrlFactory( baseUrl + "?" ); //$NON-NLS-1$
    List<String> messages = new ArrayList<String>();
    contentGenerator.setOutputHandler( outputHandler );
    MimeTypeListener mimeTypeListener = new MimeTypeListener();
    outputHandler.setMimeTypeListener( mimeTypeListener );
    contentGenerator.setMessagesList( messages );
    contentGenerator.setParameterProviders( parameterProviders );
    contentGenerator.setSession( session );
    contentGenerator.setUrlFactory( urlFactory );
    contentGenerator.createContent();
    String content = new String( out.toByteArray() );
    System.out.println( content );
    assertTrue( content.indexOf( Messages.getInstance().getErrorString(
        "WebServiceContentGenerator.ERROR_0001_AXIS_CONFIG_IS_NULL" ) ) != -1 ); //$NON-NLS-1$
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.plugin.services.webservices.content.AxisServiceWsdlGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.