User: starksm
Date: 01/05/23 15:54:34
Modified: src/main/org/jboss/test/web/test HttpClient.java
TestWebIntegration.java
Log:
Create proper HTTP/1.1 request
Revision Changes Path
1.2 +3 -1 jbosstest/src/main/org/jboss/test/web/test/HttpClient.java
Index: HttpClient.java
===================================================================
RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/web/test/HttpClient.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HttpClient.java 2001/05/06 04:15:26 1.1
+++ HttpClient.java 2001/05/23 22:54:34 1.2
@@ -16,7 +16,7 @@
/** A simple socket based client for accesing http content.
@author [EMAIL PROTECTED]
-@version $Revision: 1.1 $
+@version $Revision: 1.2 $
*/
public class HttpClient
{
@@ -78,6 +78,8 @@
pw.write("GET " + reqURL.getPath() + " HTTP/1.1\r\n");
pw.write("Accept: */*\r\n");
pw.write("User-Agent: JBossTest WebClient\r\n");
+ pw.write("Host: localhost:8080\r\n");
+ pw.write("Connection: close\r\n");
String userInfo = reqURL.getUserInfo();
if( userInfo != null )
{
1.4 +3 -3
jbosstest/src/main/org/jboss/test/web/test/TestWebIntegration.java
Index: TestWebIntegration.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/web/test/TestWebIntegration.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestWebIntegration.java 2001/05/23 22:35:01 1.3
+++ TestWebIntegration.java 2001/05/23 22:54:34 1.4
@@ -20,7 +20,7 @@
with a role of 'AuthorizedUser' in the servlet container.
@author [EMAIL PROTECTED]
-@version $Revision: 1.3 $
+@version $Revision: 1.4 $
*/
public class TestWebIntegration extends TestCase
{
@@ -45,13 +45,13 @@
// Test for the existence of a web server
Integer port = Integer.getInteger("web.port", 8080);
baseURL = "http://jduke:theduke@localhost:" + port + '/';
- URL url = new URL(baseURL+"index.html");
+ URL url = new URL(baseURL);
try
{
HttpClient httpConn = new HttpClient(url);
int responseCode = httpConn.getResponseCode();
if( responseCode != HttpURLConnection.HTTP_OK &&
- responseCode != HttpURLConnection.HTTP_BAD_REQUEST )
+ responseCode != HttpURLConnection.HTTP_NOT_FOUND )
{
System.out.println(baseURL+" result="+responseCode+" in HTTP OK,
skipping tests");
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development