Package com.verisign.epp.pool
Class EPPSystemSessionPoolTst
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.verisign.epp.pool.EPPSessionPoolTst
com.verisign.epp.pool.EPPSystemSessionPoolTst
- All Implemented Interfaces:
junit.framework.Test
-
Field Summary
Fields inherited from class com.verisign.epp.pool.EPPSessionPoolTst
app, configFileName, sessionPool -
Constructor Summary
ConstructorsConstructorDescriptionAllocates anEPPSessionPoolTstwith a logical name. -
Method Summary
Modifier and TypeMethodDescriptionprotected EPPSessionborrowSession(String aSystem) Utility method to borrow a session from the session pool.voidhandleException(EPPCommandException aException, EPPSession aSession) Handle anEPPCommandException, which can be either a server generated error or a general exception.protected voidinvalidateSession(String aSystem, EPPSession aSession) Utility method to invalidate a session in the session pool.static voidUnit test main, which accepts the following system property options:
iterations Number of unit test iterations to run validate Turn XML validation on (true) or off (false).static voidPrint the end of a test with theThreadname if the current thread is aTestThread.static voidprintStart(String aTest) Print the start of a test with theThreadname if the current thread is aTestThread.protected voidreturnSession(String aSystem, EPPSession aSession) Utility method to return a session to the session pool.protected voidsetUp()JUNITsetUpmethodstatic junit.framework.Testsuite()JUNITsuitestatic method, which returns the tests associated withEPPSessionPoolTst.protected voidtearDown()JUNITtearDown, which currently does nothing.voidTest interfacing with two system session pools (test1 and test2 systems).Methods inherited from class com.verisign.epp.pool.EPPSessionPoolTst
borrowSession, invalidateSession, returnSession, testAbsoluteTimeout, testCloseSession, testEndSession, testHello, testIdleTimeout, testPollMethods inherited from class junit.framework.TestCase
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
-
Constructor Details
-
EPPSystemSessionPoolTst
Allocates anEPPSessionPoolTstwith a logical name. The constructor will initialize the base classTestCasewith the logical name.- Parameters:
name- Logical name of the test
-
-
Method Details
-
testTwoSystemPools
public void testTwoSystemPools()Test interfacing with two system session pools (test1 and test2 systems). A session is borrowed from each pool, a hello command is sent, and the sessions are retured to their pools. -
setUp
protected void setUp()JUNITsetUpmethod- Overrides:
setUpin classEPPSessionPoolTst
-
tearDown
protected void tearDown()JUNITtearDown, which currently does nothing.- Overrides:
tearDownin classEPPSessionPoolTst
-
suite
public static junit.framework.Test suite()JUNITsuitestatic method, which returns the tests associated withEPPSessionPoolTst.- Returns:
- Tests to run
-
main
Unit test main, which accepts the following system property options:
- iterations Number of unit test iterations to run
- validate Turn XML validation on (
true) or off (false). If validate is not specified, validation will be off.
- Parameters:
args- Program arguments
-
handleException
Handle anEPPCommandException, which can be either a server generated error or a general exception. If the exception was caused by a server error, "Server Error : <Response XML>" will be specified. If the exception was caused by a general algorithm error, "General Error : <Exception Description>" will be specified.- Parameters:
aException- Exception thrown during testaSession- Session that had exception
-
printStart
Print the start of a test with theThreadname if the current thread is aTestThread.- Parameters:
aTest- name for the test
-
printEnd
Print the end of a test with theThreadname if the current thread is aTestThread.- Parameters:
aTest- name for the test
-
borrowSession
Utility method to borrow a session from the session pool. All exceptions will result in the test failing. This method should only be used for positive session pool tests.- Parameters:
aSystem- System session pool- Returns:
- Session from the session pool
-
returnSession
Utility method to return a session to the session pool. This should be placed in a finally block. All exceptions will result in the test failing.- Parameters:
aSystem- session pool nameaSession- Session to return to the pool
-
invalidateSession
Utility method to invalidate a session in the session pool.- Parameters:
aSystem- System session pool nameaSession- Session to invalidate in the pool
-