Index: TestHarness4LAMS2/src/org/lamsfoundation/testharness/Call.java =================================================================== RCS file: /usr/local/cvsroot/TestHarness4LAMS2/src/org/lamsfoundation/testharness/Call.java,v diff -u -r1.9 -r1.10 --- TestHarness4LAMS2/src/org/lamsfoundation/testharness/Call.java 16 Jan 2014 16:46:42 -0000 1.9 +++ TestHarness4LAMS2/src/org/lamsfoundation/testharness/Call.java 16 Jan 2014 17:08:58 -0000 1.10 @@ -193,10 +193,10 @@ long end = 0; try { WebResponse resp = null; + WebRequest req = null; if (form != null) { SubmitButton[] submitButtons = filterCancelButton(form.getSubmitButtons()); Call.log.debug(submitButtons.length + " non-cancel submit buttons in the form"); - WebRequest req = null; if (submitButtons.length <= 1) { req = form.getRequest(); } else { @@ -209,7 +209,6 @@ end = System.currentTimeMillis(); } else { String absoluteURL = getAbsoluteURL(url); - WebRequest req; if (is == null) { callee = "GET " + url; req = new GetMethodWebRequest(absoluteURL); @@ -222,17 +221,20 @@ resp = wc.getResponse(req); end = System.currentTimeMillis(); } + httpStatusCode = resp.getResponseCode(); - message = resp.getResponseMessage(); - - /*if(callee.indexOf("passon.swf")==-1) - log.debug(resp.getText());*/ - - if (resp.getResponseCode() >= 400) { - Call.log.debug(resp.getText()); - throw new TestHarnessException(test.testName + " got http error code " + httpStatusCode); + if (httpStatusCode >= 400) { + log.debug("Got " + httpStatusCode + " HTTP code. Retrying call: " + callee); + resp = wc.getResponse(req); + end = System.currentTimeMillis(); + httpStatusCode = resp.getResponseCode(); + if (httpStatusCode >= 400) { + Call.log.debug(resp.getText()); + throw new TestHarnessException(test.testName + " got HTTP code " + httpStatusCode); + } } - + + message = resp.getResponseMessage(); for (String headerFieldName : resp.getHeaderFieldNames()) { if (headerFieldName.equalsIgnoreCase("SET-COOKIE")) { for (String headerFieldValue : resp.getHeaderFields(headerFieldName)) {