org.jboss.jsfunit.framework
Class BasicAuthenticationStrategy
java.lang.Object
org.jboss.jsfunit.framework.SimpleInitialRequestStrategy
org.jboss.jsfunit.framework.BasicAuthenticationStrategy
- All Implemented Interfaces:
- InitialRequestStrategy
public class BasicAuthenticationStrategy
- extends SimpleInitialRequestStrategy
Performs JEE container-managed BASIC authentication using
only a user name and password.
- Since:
- 1.0
- Author:
- Stan Silvert
Method Summary |
com.gargoylesoftware.htmlunit.Page |
doInitialRequest(WebClientSpec wcSpec)
Perform the initial request and provide Basic authentication
credentials when challenged. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicAuthenticationStrategy
public BasicAuthenticationStrategy(String userName,
String password)
- Create a new BasicAuthenticationStrategy.
- Parameters:
userName
- The user name to send.password
- The password to send.
doInitialRequest
public com.gargoylesoftware.htmlunit.Page doInitialRequest(WebClientSpec wcSpec)
throws IOException
- Perform the initial request and provide Basic authentication
credentials when challenged.
- Specified by:
doInitialRequest
in interface InitialRequestStrategy
- Overrides:
doInitialRequest
in class SimpleInitialRequestStrategy
- Parameters:
wcSpec
- The WebClient specification.
- Returns:
- The requested page if authentication passed. Otherwise, return
the error page from the server (usually a 401 error).
- Throws:
IOException
- if HtmlUnit encounters an error.
Copyright © 2007-2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.