|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.jcoderz.commons.TestCase
org.jcoderz.commons.connector.http.transport.HttpClientConnectionTest
public class HttpClientConnectionTest
This class test the implementation of the HttpConnectionInterface provided via the Jakarta commons-httpclient project.
| Constructor Summary | |
|---|---|
HttpClientConnectionTest()
|
|
| Method Summary | |
|---|---|
static void |
main(String[] args)
Main. |
protected void |
setUp()
Setup creates a new interface implementation object. |
static Test |
suite()
Creates the testsuite. |
protected void |
tearDown()
TearDown of the TestCase. |
void |
testCloseConnectionFailed()
Multiple closing fails. |
void |
testCloseConnectionSuccessAfterSending()
Closes the connection after successful sending. |
void |
testEstablishConnection()
Tests establishing a connection. |
void |
testExecuteFailed()
Executes connection without establishing before. |
void |
testReleaseConnectionFailed()
Tests error case with a missing "releaseConnection" call before reusing an already opened connection. |
void |
testReleaseConnectionSuccessMultipleUse()
Releases a connection multiple times. |
void |
testReleaseConnectionSuccessWithOneSendMessage()
Tests releasing the connection and sending a second message without sending the first message. |
void |
testReleaseConnectionSuccessWithTwoSendMessages()
Tests the release of connection after sending a message and a sending anew after releasing. |
void |
testReleaseConnectionWithInvalidState()
Release a not established connection. |
void |
testSendMultiplePostRequestAfterServerClose()
Sends a request with Connection=close and receives the response. |
void |
testSendSimplePostRequest()
Performs establishing a connection, creating a request, sending that request, receiving the response and closing the connection. |
void |
testSendSimplePostRequestToNotExistingTarget()
Sends post request without a waiting server. |
void |
testSendSimplePostRequestWithEmptyResponseBody()
Tests if the correct exception is thrown if the http response body received is empty. |
void |
testSendSimplePostRequestWithExpectedResponseHeaderFailed()
Tests if the correct exception is thrown if evaluating a response header key value pair set for the connection has been failed. |
void |
testSendSimplePostRequestWithExpectedResponseHeaderSuccess()
Tests if a response header key value pair set for the connection has been evaluated correctly. |
void |
testSendSimplePostRequestWithImmediateClose()
Sends a request and expects a immediate close on server side. |
void |
testSendSimplePostRequestWithoutResponse()
Sends a request and expects no response. |
void |
testSendSimplePostRequestWithSSL()
Performs establishing a connection (to SubwayCA) , creating a request, sending that request, receiving the response and closing the connection USING SSL. |
| Methods inherited from class org.jcoderz.commons.TestCase |
|---|
getBaseDir, getHostName, getSuite, hasTestCases |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HttpClientConnectionTest()
| Method Detail |
|---|
public static void main(String[] args)
args - main argumentspublic static Test suite()
protected void setUp()
throws Exception
setUp in class TestCaseExceptionTestCase.setUp()
protected void tearDown()
throws Exception
tearDown in class TestCaseExceptionTestCase.tearDown()
public void testSendSimplePostRequest()
throws Exception
Exception - for any unexpected error
public void testSendSimplePostRequestToNotExistingTarget()
throws Exception
Exception - if the test case fails with an exception.
public void testSendSimplePostRequestWithExpectedResponseHeaderSuccess()
throws Exception
Exception - in case of any unexpected error
public void testSendSimplePostRequestWithExpectedResponseHeaderFailed()
throws Exception
Exception - in case of any unexpected error
public void testSendSimplePostRequestWithEmptyResponseBody()
throws Exception
Exception - in case of any unexpected error
public void testSendSimplePostRequestWithoutResponse()
throws Exception
Exception - for any unexpected error
public void testSendSimplePostRequestWithImmediateClose()
throws Exception
Exception - for any unexpected errors
public void testSendMultiplePostRequestAfterServerClose()
throws Exception
Exception - for any unexpected errorpublic void testEstablishConnection()
public void testReleaseConnectionSuccessMultipleUse()
public void testReleaseConnectionSuccessWithTwoSendMessages()
throws Exception
Exception - if the test case fails with an exception.
public void testReleaseConnectionSuccessWithOneSendMessage()
throws Exception
Exception - if the test case fails with an exception.
public void testReleaseConnectionFailed()
throws Exception
Exception - if the test case fails with an exception.public void testReleaseConnectionWithInvalidState()
public void testCloseConnectionSuccessAfterSending()
throws Exception
Exception - if the test case fails with an exception.public void testCloseConnectionFailed()
public void testExecuteFailed()
throws Exception
Exception - if the test case fails with an exception.
public void testSendSimplePostRequestWithSSL()
throws Exception
Exception - in case of missing keystore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||