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.TestCaseIs 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 concreteEPPMessage's and their expectedEPPResponse. The unit test is dependent on the use of JUNIT 3.5
The testEPPResponseis duplicated forEPPMessagethat do not contain a specializedEPPResponseto provide an example of a fullEPPMessagetransaction. All of the com.verisign.epp.codec.gen packageEPPMessageclasses are associated withEPPResponse.
-
-
Constructor Summary
Constructors Constructor Description EPPCodecTst(java.lang.String aName)Allocates anEPPCodecTstwith a logical name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidinitEnvironment()Initialize the SDK environment based on the system properties:
validate -trueorfalsevalue indicating if XML schema validation is enabled.static voidmain(java.lang.String[] args)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).static voidprintEnd(java.lang.String aTest)Print the end of a test with theThreadname if the current thread is aTestThread.static voidprintStart(java.lang.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.voidtestCommandGetExtensionFailOnDuplicate()Unit 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 outvoidtestFindDuplicateExtNamespaces()Unit test of using {code EPPUtil.findDuplicateExtNamespaces(List)} and the correspondingEPPCommand.findDuplicateExtNamespaces()andEPPResponse.findDuplicateExtNamespaces().voidtestFindExtNamespaces()Unit test of usingEPPUtil.testFindExtNamespaces(List, List)and the correspondingEPPCommand.testFindExtNamespaces(List)andEPPResponse.testFindExtNamespaces(List).voidtestFindExtNamespaceSuffixes()Unit test of usingEPPUtil.testFindExtNamespaceSuffixes(List, List)and the correspondingEPPCommand.testFindExtNamespaceSuffixes(List)andEPPResponse.testFindExtNamespaceSuffixes(List).voidtestFindUnsupportedExtNamespaces()Unit test of usingEPPUtil.findUnsupportedExtNamespaces(List, List)and the correspondingEPPCommand.findUnsupportedExtNamespaces(List)andEPPResponse.findUnsupportedExtNamespaces(List).voidtestFindUnsupportedExtNamespaceSuffixes()Unit test of usingEPPUtil.findUnsupportedExtNamespaceSuffixes(List, List)and the correspondingEPPCommand.findUnsupportedExtNamespaceSuffixes(List)andEPPResponse.findUnsupportedExtNamespaceSuffixes(List).voidtestGreeting()Unit test ofEPPGreeting.voidtestHello()Unit test ofEPPHello.voidtestLogin()Unit test ofEPPLoginCmd.voidtestLogout()Unit test ofEPPLogoutCmd.voidtestPoll()Unit test ofEPPPollCmd.voidtestResponse()Unit test ofEPPResponse.voidtestResponseGetExtensionFailOnDuplicate()Unit test for using {code EPPResponse.getExtension(Class, boolean)}.voidtestTimeInstantFormat()Test the encoding and decoding of thetimeInstantFormatsupported by theEPPUtil.encodeTimeInstant(Date)andEPPUtil.decodeTimeInstant(String).voidtestUnhandledNamespaces()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.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
-
-
-
-
Method Detail
-
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
public static void main(java.lang.String[] args)
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
public static void printStart(java.lang.String aTest)
Print the start of a test with theThreadname if the current thread is aTestThread.- Parameters:
aTest- name for the test
-
printEnd
public static void printEnd(java.lang.String aTest)
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
public static EPPEncodeDecodeStats testEncodeDecode(EPPMessage aMessage)
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
public void testPoll() throws javax.xml.parsers.ParserConfigurationExceptionUnit test ofEPPPollCmd. The response toEPPPollCmdisEPPResponse.
This test will be invoked by JUNIT, since it is prefixed with "test" and is a public method.- Throws:
javax.xml.parsers.ParserConfigurationException- Error creating DOM document.
-
testTimeInstantFormat
public void testTimeInstantFormat()
Test the encoding and decoding of thetimeInstantFormatsupported by theEPPUtil.encodeTimeInstant(Date)andEPPUtil.decodeTimeInstant(String).
-
-