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 ) {