Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.GetMethod.releaseConnection()


          }
          else{
            log.error("Fetch RSS from " + url + " failed, code="+get.getStatusCode());
          }
        }finally{
          get.releaseConnection();
        }
      return null;
  }
 
  private final static Charset default_charset = Charset.forName("utf-8");
View Full Code Here


            newuri = "/";
          }
          redirect = new GetMethod(newuri);

          httpClient.executeMethod(redirect);
          redirect.releaseConnection();
        }
      } else {
        exception = new LoginErrorException("用户名或者密码错误");
      }
    } catch (Exception e) {
View Full Code Here

      if (authget != null)
        authget.releaseConnection();
      if (authpost != null)
        authpost.releaseConnection();
      if (redirect != null)
        redirect.releaseConnection();
    }

    if (exception != null)
      throw exception;
  }
View Full Code Here

              httpClient.executeMethod(getMeth);
             
              Assert.assertEquals(200, getMeth.getStatusCode());
              Assert.assertEquals("OK", getMeth.getResponseBodyAsString());
             
              getMeth.releaseConnection();
            }

           
          } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

              httpClient.executeMethod(getMeth);
             
              Assert.assertEquals(200, getMeth.getStatusCode());
              Assert.assertEquals("OK", getMeth.getResponseBodyAsString());
             
              getMeth.releaseConnection();
            }

           
          } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

    HttpClient httpClient = new HttpClient();

    GetMethod jettyMethod = new GetMethod("http://localhost:" + jettyPort + path);
    int jettyStatusCode = httpClient.executeMethod(jettyMethod);
    String jettyResponse = jettyMethod.getResponseBodyAsString().trim();
    jettyMethod.releaseConnection();


    GetMethod xSocketMethod = new GetMethod("http://localhost:" + xSocketPort + path);
    int xSocketStatusCode = httpClient.executeMethod(xSocketMethod);
    String xSocketResponse = xSocketMethod.getResponseBodyAsString().trim();
View Full Code Here


    GetMethod xSocketMethod = new GetMethod("http://localhost:" + xSocketPort + path);
    int xSocketStatusCode = httpClient.executeMethod(xSocketMethod);
    String xSocketResponse = xSocketMethod.getResponseBodyAsString().trim();
    xSocketMethod.releaseConnection();

    Assert.assertEquals(jettyStatusCode, xSocketStatusCode);
    Assert.assertEquals(jettyResponse, xSocketResponse);
  }
View Full Code Here

        throw new NetworkException(pDownload.getMessage());
      }

      if (gMethod != null) {
        gMethod.abort();
        gMethod.releaseConnection();
      }
      try {
        if (lOutputStream != null)
          lOutputStream.close();
        if (lInputStream != null) {
View Full Code Here

         e.printStackTrace();
         fail("HttpClient executeMethod fails." +e.toString());
      }
      finally
      {
         method.releaseConnection();
      }
   }
  
   protected abstract void makeEjbRequests() throws Exception;
}
View Full Code Here

      {
         throw new RuntimeException(e);
      }
      finally
      {
         get.releaseConnection();
      }
   }
  
   public void testPlainTextReadonlyResource(String uri, boolean body)
   {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.