public static void executeFormLogin(HttpClient httpConn, String warURL) throws IOException, HttpException
{
PostMethod formPost = new PostMethod(warURL + "j_security_check");
formPost.addRequestHeader("Referer", warURL + "login.html");
formPost.addParameter("j_username", "jduke");
formPost.addParameter("j_password", "theduke");
int responseCode = httpConn.executeMethod(formPost.getHostConfiguration(),
formPost, httpConn.getState());
assertTrue("Saw HTTP_MOVED_TEMP("+responseCode+")",
responseCode == HttpURLConnection.HTTP_MOVED_TEMP);