info( Messages.getInstance().getString( "HTMLComponentTest.USER_ERRORS_EXPECTED_URL_INVALID" ) ); //$NON-NLS-1$
// this should fail because the url is bad
String url = "xttp://a"; //$NON-NLS-1$
SimpleUrlFactory urlFactory = new SimpleUrlFactory( "/testurl?" ); //$NON-NLS-1$
ArrayList messages = new ArrayList();
HtmlComponent component =
new HtmlComponent( HtmlComponent.TYPE_URL, url, Messages.getInstance().getString(
"HTML.ERROR_0001_NOT_AVAILABLE" ), urlFactory, messages ); //$NON-NLS-1$
component.setLoggingLevel( getLoggingLevel() );
OutputStream outputStream = getOutputStream( "HTMLComponentTest.testComponent3", ".html" ); //$NON-NLS-1$//$NON-NLS-2$
String contentType = "text/html"; //$NON-NLS-1$
SimpleParameterProvider requestParameters = new SimpleParameterProvider();
SimpleParameterProvider sessionParameters = new SimpleParameterProvider();
HashMap parameterProviders = new HashMap();
parameterProviders.put( IParameterProvider.SCOPE_REQUEST, requestParameters );
parameterProviders.put( IParameterProvider.SCOPE_SESSION, sessionParameters );
StandaloneSession session =
new StandaloneSession( Messages.getInstance().getString( "BaseTest.DEBUG_JUNIT_SESSION" ) ); //$NON-NLS-1$
SimpleOutputHandler outputHandler = new SimpleOutputHandler( outputStream, false );
BaseRequestHandler requestHandler = new BaseRequestHandler( session, null, outputHandler, null, urlFactory );
try {
component.validate( session, requestHandler );
component.handleRequest( outputStream, requestHandler, contentType, parameterProviders );
} catch ( IOException e ) {
e.printStackTrace();
}
finishTest();