Author: angelo.vandersijpt at luminis.eu
Date: Thu Nov 11 23:27:39 2010
New Revision: 413
Log:
ADMATU-151 Try to find the port number a few times; we might just be too early
in the test. (If we are, there is something interesting with the httpservice).
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
Thu Nov 11 23:27:39 2010
@@ -207,9 +207,14 @@
}
}
- public String getHttpPortNr() {
- assertNotNull(m_httpContextFactoryService);
+ public String getHttpPortNr() throws InterruptedException {
ServiceReference reference =
m_context.getServiceReference(HttpService.class.getName());
+ int wait = 0;
+ while (reference.getProperty("org.osgi.service.http.port") == null &&
wait++ < 20) {
+ // We might be trying to get our references before the
configuration is set; just wait
+ // around for a while.
+ Thread.sleep(100);
+ }
return (String) reference.getProperty("org.osgi.service.http.port");
}