Package com.verisign.epp.codec.gen
Class EPPCodecTst
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.verisign.epp.codec.gen.EPPCodecTst
- All Implemented Interfaces:
junit.framework.Test
public class EPPCodecTst
extends junit.framework.TestCase
Is a unit test of the com.verisign.epp.codec.gen package. The unit test will
execute, gather statistics, and output the results of a test of each
com.verisign.epp.codec.gen package concrete
The test
EPPMessage's and
their expected EPPResponse. The unit test is dependent on the
use of JUNIT 3.5The test
EPPResponse is duplicated for EPPMessage
that do not contain a specialized EPPResponse to provide an
example of a full EPPMessage transaction. All of the
com.verisign.epp.codec.gen package EPPMessage classes are
associated with EPPResponse. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidInitialize the SDK environment based on the system properties:
validate -trueorfalsevalue indicating if XML schema validation is enabled.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.static voidsetNumIterations(long aNumIterations) Sets the number of iterations to run per test.protected voidsetUp()JUNITsetUpmethod, which sets the default client Id to "theRegistrar".static junit.framework.Testsuite()JUNITsuitestatic method, which returns the tests associated withEPPCodecTst.protected voidtearDown()JUNITtearDown, which currently does nothing.voidUnit test for usingEPPCommand.getExtension(Class, boolean).static EPPEncodeDecodeStatstestEncodeDecode(EPPMessage aMessage) Reusable unit test algorithm, which does the following:
encodes theEPPMessagein XML decodes theEPPMessagefrom XML SerializesEPPMessageusing Java Serialization De-serializesEPPMessageusing Java Serialization Gathers unit test statistics and output them to standard outvoidUnit test of using {code EPPUtil.findDuplicateExtNamespaces(List)} and the correspondingEPPCommand.findDuplicateExtNamespaces()andEPPResponse.findDuplicateExtNamespaces().voidUnit test of usingEPPUtil.testFindExtNamespaces(List, List)and the correspondingEPPCommand.testFindExtNamespaces(List)andEPPResponse.testFindExtNamespaces(List).voidUnit test of usingEPPUtil.testFindExtNamespaceSuffixes(List, List)and the correspondingEPPCommand.testFindExtNamespaceSuffixes(List)andEPPResponse.testFindExtNamespaceSuffixes(List).voidUnit test of usingEPPUtil.findUnsupportedExtNamespaces(List, List)and the correspondingEPPCommand.findUnsupportedExtNamespaces(List)andEPPResponse.findUnsupportedExtNamespaces(List).voidUnit test of usingEPPUtil.findUnsupportedExtNamespaceSuffixes(List, List)and the correspondingEPPCommand.findUnsupportedExtNamespaceSuffixes(List)andEPPResponse.findUnsupportedExtNamespaceSuffixes(List).voidUnit test ofEPPGreeting.voidUnit test ofEPPHello.voidUnit test ofEPPLoginCmd.voidUnit test ofEPPLogoutCmd.voidtestPoll()Unit test ofEPPPollCmd.voidUnit test ofEPPResponse.voidUnit test for using {code EPPResponse.getExtension(Class, boolean)}.voidTest the encoding and decoding of thetimeInstantFormatsupported by theEPPUtil.encodeTimeInstant(Date)andEPPUtil.decodeTimeInstant(String).voidTest unhandled namespaces poll message, which is a poll message that contains EPP extensions (object or command / response) that are not supported by the client based on the client login services.static voidtestXMLEncodeDecode(EPPMessage aMessage, EPPEncodeDecodeStats aStats) Tests the encoding and decoding of anEPPMessage.Methods 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
-
EPPCodecTst
Allocates anEPPCodecTstwith a logical name. The constructor will initialize the base classTestCasewith the logical name.- Parameters:
aName- Logical name of the test
-
-
Method Details
-
testGreeting
public void testGreeting()Unit test ofEPPGreeting. There is no response associated withEPPGreetingother than aEPPLoginCmdwhich is testing intestLogin.
This test will be invoked by JUNIT, since it is prefixed with "test" and is a public method. -
testLogin
public void testLogin()Unit test ofEPPLoginCmd. The response toEPPLoginCmdisEPPResponse.
This test will be invoked by JUNIT, since it is prefixed with "test" and is a public method. -
testLogout
public void testLogout()Unit test ofEPPLogoutCmd. The response toEPPLogoutCmdisEPPResponse.
This test will be invoked by JUNIT, since it is prefixed with "test" and is a public method. -
testResponse
public void testResponse()Unit test ofEPPResponse. This will testEPPResponsewith various attribute values.
This test will be invoked by JUNIT, since it is prefixed with "test" and is a public method. -
testUnhandledNamespaces
public void testUnhandledNamespaces()Test unhandled namespaces poll message, which is a poll message that contains EPP extensions (object or command / response) that are not supported by the client based on the client login services. -
testCommandGetExtensionFailOnDuplicate
public void testCommandGetExtensionFailOnDuplicate()Unit test for usingEPPCommand.getExtension(Class, boolean). -
testFindDuplicateExtNamespaces
public void testFindDuplicateExtNamespaces()Unit test of using {code EPPUtil.findDuplicateExtNamespaces(List)} and the correspondingEPPCommand.findDuplicateExtNamespaces()andEPPResponse.findDuplicateExtNamespaces(). Test the following:
- Test that no duplicates are found
- Test that duplicates are found when there are a single set of duplicates
- Test that multiple duplicate instances result in the same set of found duplicates.
-
testFindUnsupportedExtNamespaces
public void testFindUnsupportedExtNamespaces()Unit test of usingEPPUtil.findUnsupportedExtNamespaces(List, List)and the correspondingEPPCommand.findUnsupportedExtNamespaces(List)andEPPResponse.findUnsupportedExtNamespaces(List). Test the following:
- Test that no unsupported extensions found
- Test that there is an unsupported extension.
- Test that all extensions are unsupported.
-
testFindUnsupportedExtNamespaceSuffixes
public void testFindUnsupportedExtNamespaceSuffixes()Unit test of usingEPPUtil.findUnsupportedExtNamespaceSuffixes(List, List)and the correspondingEPPCommand.findUnsupportedExtNamespaceSuffixes(List)andEPPResponse.findUnsupportedExtNamespaceSuffixes(List). Test the following:
- Test that no unsupported extensions found
- Test that there is an unsupported extension.
- Test that all extensions are unsupported.
- Test inclusion of an unsupported namespace.
-
testResponseGetExtensionFailOnDuplicate
public void testResponseGetExtensionFailOnDuplicate()Unit test for using {code EPPResponse.getExtension(Class, boolean)}. -
testFindExtNamespaces
public void testFindExtNamespaces()Unit test of usingEPPUtil.testFindExtNamespaces(List, List)and the correspondingEPPCommand.testFindExtNamespaces(List)andEPPResponse.testFindExtNamespaces(List). Test the following:
- Test that it doesn't fail with no extensions.
- Test with many extensions.
- Test the filtering of extensions.
-
testFindExtNamespaceSuffixes
public void testFindExtNamespaceSuffixes()Unit test of usingEPPUtil.testFindExtNamespaceSuffixes(List, List)and the correspondingEPPCommand.testFindExtNamespaceSuffixes(List)andEPPResponse.testFindExtNamespaceSuffixes(List). Test the following:
- Test that it doesn't fail with no extensions.
- Test with many extensions.
- Test the filtering of extensions.
-
setUp
protected void setUp()JUNITsetUpmethod, which sets the default client Id to "theRegistrar".- Overrides:
setUpin classjunit.framework.TestCase
-
tearDown
protected void tearDown()JUNITtearDown, which currently does nothing.- Overrides:
tearDownin classjunit.framework.TestCase
-
initEnvironment
public static void initEnvironment()Initialize the SDK environment based on the system properties:
- validate -
trueorfalsevalue indicating if XML schema validation is enabled. The default value istrue - fullschemachecking -
trueorfalsevalue indicating if full XML schema validation is enabled. The default value istrue. - logfile - Log file name. The default value is
epp.log.
Both theEnvironmentclass and the logging will be initialized. - validate -
-
suite
public static junit.framework.Test suite()JUNITsuitestatic method, which returns the tests associated withEPPCodecTst.- Returns:
- Test suite
-
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- DOCUMENT ME!
-
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
-
testXMLEncodeDecode
public static void testXMLEncodeDecode(EPPMessage aMessage, EPPEncodeDecodeStats aStats) throws EPPException Tests the encoding and decoding of anEPPMessage. If there is an error with encoding or decoding the message, anEPPExceptionwill be thrown.- Parameters:
aMessage- Message to test the XML encoding and decodingaStats- Testing statistics. Passnullfor no statistics to be gathered.- Throws:
EPPException- Error encoding or decoding the message
-
testEncodeDecode
Reusable unit test algorithm, which does the following:
- encodes the
EPPMessagein XML - decodes the
EPPMessagefrom XML - Serializes
EPPMessageusing Java Serialization - De-serializes
EPPMessageusing Java Serialization - Gathers unit test statistics and output them to standard out
- Parameters:
aMessage- EPP Message to test encoding and decoding- Returns:
- encode and decode statistics
- encodes the
-
setNumIterations
public static void setNumIterations(long aNumIterations) Sets the number of iterations to run per test.- Parameters:
aNumIterations- number of iterations to run per test
-
testHello
public void testHello()Unit test ofEPPHello. The response toEPPHelloisEPPResponse.
This test will be invoked by JUNIT, since it is prefixed with "test" and is a public method. -
testPoll
Unit test ofEPPPollCmd. The response toEPPPollCmdisEPPResponse.
This test will be invoked by JUNIT, since it is prefixed with "test" and is a public method.- Throws:
ParserConfigurationException- Error creating DOM document.
-
testTimeInstantFormat
public void testTimeInstantFormat()Test the encoding and decoding of thetimeInstantFormatsupported by theEPPUtil.encodeTimeInstant(Date)andEPPUtil.decodeTimeInstant(String).
-