commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oglu...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient TestMethodsExternalHost.java
Date Fri, 17 Sep 2004 07:43:28 GMT
oglueck     2004/09/17 00:43:28

  Modified:    httpclient/src/test/org/apache/commons/httpclient Tag:
                        HTTPCLIENT_2_0_BRANCH TestMethodsExternalHost.java
  Log:
  Cleaned up some code and deprecation warnings.
  Do nut bugger Sun with our testing, but use ASF servers. Sun's one resulted in a failed
test case anyway.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.9.2.2   +9 -9      jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestMethodsExternalHost.java
  
  Index: TestMethodsExternalHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestMethodsExternalHost.java,v
  retrieving revision 1.9.2.1
  retrieving revision 1.9.2.2
  diff -u -r1.9.2.1 -r1.9.2.2
  --- TestMethodsExternalHost.java	22 Feb 2004 18:21:16 -0000	1.9.2.1
  +++ TestMethodsExternalHost.java	17 Sep 2004 07:43:27 -0000	1.9.2.2
  @@ -54,10 +54,10 @@
   
       // -------------------------------------------------------------- Constants
   
  -    private static final String externalHost = "java.sun.com";
  +    private static final String externalHost = "jakarta.apache.org";
       private static final int externalPort = 80;
       private static final String externalPath = "/index.html";
  -    private static final String externalUri = "http://java.sun.com/index.html";
  +    private static final String externalUri = "http://"+ externalHost + externalPath;
       private final String PROXY_HOST = System.getProperty("httpclient.test.proxyHost");
       private final String PROXY_PORT = System.getProperty("httpclient.test.proxyPort");
       private final String PROXY_USER = System.getProperty("httpclient.test.proxyUser");
  @@ -88,7 +88,7 @@
           if (PROXY_HOST != null) {
               if (PROXY_USER != null) {
                   HttpState state = client.getState();
  -                state.setProxyCredentials(null, new UsernamePasswordCredentials(
  +                state.setProxyCredentials(null, PROXY_HOST, new UsernamePasswordCredentials(
                       PROXY_USER, PROXY_PASS));
               }
               client.getHostConfiguration().setProxy(PROXY_HOST, Integer.parseInt(PROXY_PORT));
  @@ -142,7 +142,7 @@
               fail("Unable to execute method : " + t.toString());
           }
   
  -        method.recycle();
  +        method = new GetMethod(externalUri);
           method.setPath(externalPath);
           executeMethod();
   
  @@ -200,7 +200,7 @@
   
           // this file should not exist
           method = new GetMethod("http://www.pc.ibm.com/us/accessories/monitors/p_allmodelos.html");
  -        int statusCode = client.executeMethod(method);
  +        client.executeMethod(method);
   
           assertEquals(404, method.getStatusCode());
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message