Author: ivol37 at gmail.com
Date: Tue Nov 9 11:01:29 2010
New Revision: 264
Log:
[AMDATU-159] Added logging
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
Tue Nov 9 11:01:29 2010
@@ -1,3 +1,19 @@
+/*
+ Copyright (C) 2010 Amdatu.org
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
package org.amdatu.test.integration.tests;
import java.io.IOException;
@@ -36,6 +52,7 @@
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.osgi.service.http.HttpContext;
import org.osgi.service.http.HttpService;
+import org.osgi.service.log.LogService;
@RunWith(JUnit4TestRunner.class)
public class HttpServiceTest extends IntegrationTestBase {
@@ -48,6 +65,7 @@
private final static String TEST_HEADER_AFTER_VALUE = "after";
private final static String TEST_JSP_CONTENT = "<html><body>Test JSP
body</body></html>";
+ private volatile LogService m_logService;
private volatile HttpContextServiceFactory m_httpContextFactoryService;
private Component m_httpContextComponent;
@@ -98,6 +116,7 @@
.setImplementation(this)
.add(manager.createServiceDependency().setService(TestFilterInterface.class).setRequired(true))
.add(manager.createServiceDependency().setService(TestServletInterface.class).setRequired(true))
+
.add(manager.createServiceDependency().setService(LogService.class).setRequired(true))
.add(manager.createServiceDependency().setService(HttpService.class).setRequired(true))
};
}
@@ -112,6 +131,7 @@
// set some response header and we check if this header has been set
HttpClient httpClient = new HttpClient();
String url = m_baseUrl + SERVLET_ALIAS;
+ m_logService.log(LogService.LOG_DEBUG, "Testing filter bound to " +
url);
HttpMethod method = new GetMethod(url);
try {
// Execute the method, this should return a 200
@@ -148,6 +168,7 @@
// set some response header and we check if this header has been set
HttpClient httpClient = new HttpClient();
String url = m_baseUrl + "/" + RESOURCE_ID + "/jsp/test.jsp";
+ m_logService.log(LogService.LOG_DEBUG, "Testing JSP registered on " +
url);
HttpMethod method = new GetMethod(url);
try {
// Execute the method, this should return a 200