Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpMethod.releaseConnection()


                    log.warn( "WARNING: received exception closing HTTP stream for( " + Constants.CONFIG_FILE +
                            " )", e );
                }
                //ignore
            }
            method.releaseConnection();
        }
        if ( log.isInfoEnabled() ) {
            log.info( "config( " + config + " )" );
        }
View Full Code Here


                    log.warn( "WARNING: received exception closing HTTP stream for( " + Constants.WEBAPPS_FILE +
                            " )", e );
                }
                // ignore
            }
            method.releaseConnection();
        }
        if ( log.isInfoEnabled() ) {
            log.info( "webapps( " + webapps + " )" );
        }
View Full Code Here

                    log.warn( "WARNING: received exception closing HTTP stream for( " + Constants.TESTS_FILE +
                            " )", e );
                }
                // ignore
            }
            method.releaseConnection();
        }
        if ( log.isDebugEnabled() ) {
//            log.debug( "testDefinitions( " + testDefinitions + " )" );
        }
        return testDefinitions;
View Full Code Here

        //write out the response body
        System.out.println("*** Response Body ***");
        System.out.println(responseBody);

        //clean up the connection resources
        method.releaseConnection();

        System.exit(0);
    }
}
View Full Code Here

                    contents[j] = get.getResponseBodyAsString();
                }

                assertEquals(contents[0], contents[1]);
            } finally {
                get.releaseConnection();
            }
            sessionResult[i] = contents[0];
        }

        assertNotSame(sessionResult[0], sessionResult[1]);
View Full Code Here

            fillVariables(method, elt.getChild("response"));
           
            result = (responseAssert(method, elt));
           
           
            method.releaseConnection();
           

        } catch (JDOMException e) {
            xmlresult.writeException(e);
            throw e;
View Full Code Here

                    contents[j] = get.getResponseBodyAsString();
                }

                assertEquals(contents[0], contents[1]);
            } finally {
                get.releaseConnection();
            }
            sessionResult[i] = contents[0];
        }

        assertNotSame(sessionResult[0], sessionResult[1]);
View Full Code Here

            assertTrue(method.getResponseHeader("Content-Type").getValue().startsWith("text/plain"));
            String body = method.getResponseBodyAsString();
            assertTrue(body.contains("IllegalArgumentException"));
            assertTrue(body.contains("Damn something went wrong"));
        } finally {
            method.releaseConnection();
        }
    }
}
View Full Code Here

        HttpMethod method = new GetMethod("http://localhost:9080/users/homer?" + QUERY_STRING);
        try {
            HttpClient client = new HttpClient();
            assertEquals(200, client.executeMethod(method));
        } finally {
            method.releaseConnection();
        }

    }
}
View Full Code Here

            HttpClient client = new HttpClient();
            assertEquals(417, client.executeMethod(method));
            assertTrue(method.getResponseHeader("Content-Type").getValue()
                    .startsWith("application/JSON"));
        } finally {
            method.releaseConnection();
        }
    }
   
    @Test
    public void testRestletProducer() throws Exception {
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.