HttpClient client = createHttpClient();
client.getState().setCredentials(
new AuthScope(getHost(), getPort(), "BasicAuthServlet"),
new UsernamePasswordCredentials("jakarta","commons"));
PutMethod method = new PutMethod("/" + getWebappContext() + "/auth/basic");
method.setRequestEntity(new StringRequestEntity("testing one two three"));
try {
client.executeMethod(method);
} catch (Throwable t) {
t.printStackTrace();
fail("Unable to execute method : " + t.toString());