HttpSenderUnitTest

public class HttpSenderUnitTest extends TestCase

The HttpSenderUnitTest is unit test of HttpSender. TODO: Inadequate Test-case for testing looping.

Author:Twinsen Tsang

Fields

TEST_ENDPOINT

public static final String TEST_ENDPOINT

TEST_PORT

public static final int TEST_PORT

logger

Logger logger

Methods

initTestTarget

public void initTestTarget()

Initialize the test target which is a HTTP Sender.

setUp

public void setUp()

Setup the fixture.

tearDown

public void tearDown()

Stop the HTTP monitor preventing JVM port binding *

testLoopTimeProperty

public void testLoopTimeProperty()

Test HttpSender.getLoopTimes() and HttpSender.setLoopTimes(int) *

testSendWithBasicAuthentication

public void testSendWithBasicAuthentication()

Test wether the HTTP sender able to send the HTTP header with ‘Authorization’ header.

testSendWithMultipart

public void testSendWithMultipart()

Test whether the HTTP sender able to send the HTTP header with multi-part to our monitor successfully.

testSendWithNoContent

public void testSendWithNoContent()

Test whether the HTTP sender able to send the HTTP header to our monitor successfully.

testSendWithParameter

public void testSendWithParameter()

Test whether the HTTP sender able to send the HTTP header with POST parameter to our monitor successfully.

testServiceEndpointProperty

public void testServiceEndpointProperty()

Test HttpSender.setServiceEndPoint(URL) *

testServiceEndpointPropertyWithInvalidData

public void testServiceEndpointPropertyWithInvalidData()

Test whether HttpSender.setServiceEndPoint(String) with invalid data.

testUserObjectProperty

public void testUserObjectProperty()

Test HttpSender.getUserObject() *