Author: ivol37 at gmail.com
Date: Thu Nov 25 10:00:28 2010
New Revision: 443

Log:
[AMDATU-189] Added Thread.sleep to wait for filters and servlets to be 
registered using the whiteboard pattern. Added logging to JSP servlet 
registration/unregistration

Modified:
   
trunk/amdatu-web/jsp/src/main/java/org/amdatu/web/jsp/service/ResourceProviderListener.java
   
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/HttpServiceTest.java

Modified: 
trunk/amdatu-web/jsp/src/main/java/org/amdatu/web/jsp/service/ResourceProviderListener.java
==============================================================================
--- 
trunk/amdatu-web/jsp/src/main/java/org/amdatu/web/jsp/service/ResourceProviderListener.java
 (original)
+++ 
trunk/amdatu-web/jsp/src/main/java/org/amdatu/web/jsp/service/ResourceProviderListener.java
 Thu Nov 25 10:00:28 2010
@@ -101,6 +101,7 @@
 
         try {
             m_httpService.registerServlet(servletAlias, jspServlet, 
initParams, m_httpContext);
+            m_logService.log(LogService.LOG_DEBUG, "JSP servlet registered for 
resource provider " + provider);
         }
         catch (ServletException e) {
             m_logService.log(LogService.LOG_ERROR, "Could not register JSP 
servlet for resource provider " + provider,
@@ -120,6 +121,7 @@
         try {
             m_httpService.unregister(getServletAlias(provider));
             
m_dependencyManager.remove(m_components.get(normalizeResourceId(provider)));
+            m_logService.log(LogService.LOG_DEBUG, "JSP servlet unregistered 
for resource provider " + provider);
         }
         finally {
             m_resourceProviders.remove(provider);

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 25 10:00:28 2010
@@ -144,6 +144,10 @@
     @Test
     public void testFilter() throws Exception {
        initialize();
+       
+       // Wait for two seconds such that the Felix whiteboard service has the 
time to receive the filter added
+       // callback and register it. See 
http://jira.amdatu.org/jira/browse/AMDATU-189
+       Thread.sleep(2000);
         
         // Our filter should be registered, use httpclient to do a GET 
request. The filter should
         // set some response header and we check if this header has been set
@@ -184,6 +188,10 @@
     public void testJsp() throws Exception {
        initialize();
        
+       // Wait for two seconds such that the Felix whiteboard service has the 
time to receive the filter added
+       // callback and register it. See 
http://jira.amdatu.org/jira/browse/AMDATU-189
+       Thread.sleep(2000);
+       
         // Our filter should be registered, use httpclient to do a GET 
request. The filter should
         // set some response header and we check if this header has been set
         HttpClient httpClient = new HttpClient();

Reply via email to