Author: ivol37 at gmail.com
Date: Wed Dec 1 09:41:51 2010
New Revision: 460
Log:
[AMDATU-189] Improved error logging to identify problem on Bamboo
Modified:
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/HttpServiceTest.java
Modified:
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/HttpServiceTest.java
==============================================================================
---
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/HttpServiceTest.java
(original)
+++
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/HttpServiceTest.java
Wed Dec 1 09:41:51 2010
@@ -68,6 +68,8 @@
private final static String TEST_HEADER_AFTER = "testFilterAfter";
private final static String TEST_HEADER_AFTER_VALUE = "after";
private final static String TEST_JSP_CONTENT = "<html><body>Test JSP
body</body></html>";
+
+ private final static int TIMEOUT = 10000;
private volatile LogService m_logService;
private volatile HttpContextServiceFactory m_httpContextFactoryService;
@@ -135,10 +137,12 @@
@Before
public void initConfig() throws IOException, BundleException {
m_configAdmin = getService(ConfigurationAdmin.class);
+ m_logService = getService(LogService.class);
// Add cassandra and templates configs
ConfigProvider configProvider = new ConfigProvider();
configProvider.addHttpServiceConfig(m_configAdmin);
+ m_logService.log(LogService.LOG_DEBUG, "HttpService config set to " +
ConfigProvider.HOSTNAME + ":" + ConfigProvider.PORTNR);
}
@After
@@ -159,7 +163,8 @@
// Wait until the test servlet is available, for a maximum of 5 seconds
String url = m_baseUrl + SERVLET_ALIAS;
- if (!ConfigProvider.waitForURL(new URL(url), HttpStatus.SC_OK, 5000)) {
+ m_logService.log(LogService.LOG_DEBUG, "Start waiting for url '" + url
+ "' te become available, timeout= " + TIMEOUT + "...");
+ if (!ConfigProvider.waitForURL(new URL(url), HttpStatus.SC_OK,
TIMEOUT)) {
throw new IllegalArgumentException("URL " + url + " returns
response code " + ConfigProvider.checkURL(new URL(url)));
}
@@ -208,7 +213,8 @@
// Wait until the JSP servlet is available, for a maximum of 5 seconds
String url = m_baseUrl + "/" + RESOURCE_ID + "/jsp/test.jsp";
- if (!ConfigProvider.waitForURL(new URL(url), HttpStatus.SC_OK, 5000)) {
+ m_logService.log(LogService.LOG_DEBUG, "Start waiting for url '" + url
+ "' te become available, timeout= " + TIMEOUT + "...");
+ if (!ConfigProvider.waitForURL(new URL(url), HttpStatus.SC_OK,
TIMEOUT)) {
throw new IllegalArgumentException("URL " + url + " returns
response code " + ConfigProvider.checkURL(new URL(url)));
}