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 concreteEPPMessage
's and their expectedEPPResponse
. The unit test is dependent on the use of JUNIT 3.5
The testEPPResponse
is duplicated forEPPMessage
that do not contain a specializedEPPResponse
to provide an example of a fullEPPMessage
transaction. All of the com.verisign.epp.codec.gen packageEPPMessage
classes are associated withEPPResponse
.
-
-
Constructor Summary
Constructors Constructor Description EPPCodecTst(java.lang.String aName)
Allocates anEPPCodecTst
with a logical name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
initEnvironment()
Initialize the SDK environment based on the system properties:
validate -true
orfalse
value indicating if XML schema validation is enabled.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
).static void
printEnd(java.lang.String aTest)
Print the end of a test with theThread
name if the current thread is aTestThread
.static void
printStart(java.lang.String aTest)
Print the start of a test with theThread
name if the current thread is aTestThread
.static void
setNumIterations(long aNumIterations)
Sets the number of iterations to run per test.protected void
setUp()
JUNITsetUp
method, which sets the default client Id to "theRegistrar".static junit.framework.Test
suite()
JUNITsuite
static method, which returns the tests associated withEPPCodecTst
.protected void
tearDown()
JUNITtearDown
, which currently does nothing.void
testCommandGetExtensionFailOnDuplicate()
Unit test for usingEPPCommand.getExtension(Class, boolean)
.static EPPEncodeDecodeStats
testEncodeDecode(EPPMessage aMessage)
Reusable unit test algorithm, which does the following:
encodes theEPPMessage
in XML decodes theEPPMessage
from XML SerializesEPPMessage
using Java Serialization De-serializesEPPMessage
using Java Serialization Gathers unit test statistics and output them to standard outvoid
testFindDuplicateExtNamespaces()
Unit test of using {code EPPUtil.findDuplicateExtNamespaces(List)} and the correspondingEPPCommand.findDuplicateExtNamespaces()
andEPPResponse.findDuplicateExtNamespaces()
.void
testFindExtNamespaces()
Unit test of usingEPPUtil.testFindExtNamespaces(List, List)
and the correspondingEPPCommand.testFindExtNamespaces(List)
andEPPResponse.testFindExtNamespaces(List)
.void
testFindExtNamespaceSuffixes()
Unit test of usingEPPUtil.testFindExtNamespaceSuffixes(List, List)
and the correspondingEPPCommand.testFindExtNamespaceSuffixes(List)
andEPPResponse.testFindExtNamespaceSuffixes(List)
.void
testFindUnsupportedExtNamespaces()
Unit test of usingEPPUtil.findUnsupportedExtNamespaces(List, List)
and the correspondingEPPCommand.findUnsupportedExtNamespaces(List)
andEPPResponse.findUnsupportedExtNamespaces(List)
.void
testFindUnsupportedExtNamespaceSuffixes()
Unit test of usingEPPUtil.findUnsupportedExtNamespaceSuffixes(List, List)
and the correspondingEPPCommand.findUnsupportedExtNamespaceSuffixes(List)
andEPPResponse.findUnsupportedExtNamespaceSuffixes(List)
.void
testGreeting()
Unit test ofEPPGreeting
.void
testHello()
Unit test ofEPPHello
.void
testLogin()
Unit test ofEPPLoginCmd
.void
testLogout()
Unit test ofEPPLogoutCmd
.void
testPoll()
Unit test ofEPPPollCmd
.void
testResponse()
Unit test ofEPPResponse
.void
testResponseGetExtensionFailOnDuplicate()
Unit test for using {code EPPResponse.getExtension(Class, boolean)}.void
testTimeInstantFormat()
Test the encoding and decoding of thetimeInstantFormat
supported by theEPPUtil.encodeTimeInstant(Date)
andEPPUtil.decodeTimeInstant(String)
.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.static void
testXMLEncodeDecode(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 withEPPGreeting
other than aEPPLoginCmd
which 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 toEPPLoginCmd
isEPPResponse
.
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 toEPPLogoutCmd
isEPPResponse
.
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 testEPPResponse
with 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()
JUNITsetUp
method, which sets the default client Id to "theRegistrar".- Overrides:
setUp
in classjunit.framework.TestCase
-
tearDown
protected void tearDown()
JUNITtearDown
, which currently does nothing.- Overrides:
tearDown
in classjunit.framework.TestCase
-
initEnvironment
public static void initEnvironment()
Initialize the SDK environment based on the system properties:
- validate -
true
orfalse
value indicating if XML schema validation is enabled. The default value istrue
- fullschemachecking -
true
orfalse
value indicating if full XML schema validation is enabled. The default value istrue
. - logfile - Log file name. The default value is
epp.log
.
Both theEnvironment
class and the logging will be initialized. - validate -
-
suite
public static junit.framework.Test suite()
JUNITsuite
static 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 theThread
name 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 theThread
name 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, anEPPException
will be thrown.- Parameters:
aMessage
- Message to test the XML encoding and decodingaStats
- Testing statistics. Passnull
for 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
EPPMessage
in XML - decodes the
EPPMessage
from XML - Serializes
EPPMessage
using Java Serialization - De-serializes
EPPMessage
using 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 toEPPHello
isEPPResponse
.
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.ParserConfigurationException
Unit test ofEPPPollCmd
. The response toEPPPollCmd
isEPPResponse
.
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 thetimeInstantFormat
supported by theEPPUtil.encodeTimeInstant(Date)
andEPPUtil.decodeTimeInstant(String)
.
-
-