public class EPPCodecTst
extends junit.framework.TestCase
EPPMessage
's and
their expected EPPResponse
. The unit test is dependent on the
use of JUNIT 3.5EPPResponse
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 and Description |
---|
EPPCodecTst(java.lang.String aName)
Allocates an
EPPCodecTst with a logical name. |
Modifier and Type | Method and Description |
---|---|
static void |
initEnvironment()
Initialize the SDK environment based on the system properties:
validate - true or false 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 the
Thread name if the current
thread is a TestThread . |
static void |
printStart(java.lang.String aTest)
Print the start of a test with the
Thread name if the current
thread is a TestThread . |
static void |
setNumIterations(long aNumIterations)
Sets the number of iterations to run per test.
|
protected void |
setUp()
JUNIT
setUp method, which sets the default client Id to
"theRegistrar". |
static junit.framework.Test |
suite()
JUNIT
suite static method, which returns the tests associated
with EPPCodecTst . |
protected void |
tearDown()
JUNIT
tearDown , which currently does nothing. |
void |
testCommandGetExtensionFailOnDuplicate()
Unit test for using
EPPCommand.getExtension(Class, boolean) . |
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
|
void |
testFindDuplicateExtNamespaces()
Unit test of using
EPPUtil.findDuplicateExtNamespaces(List) and
the corresponding EPPCommand.findDuplicateExtNamespaces() and
EPPResponse.findDuplicateExtNamespaces() . |
void |
testGreeting()
Unit test of
EPPGreeting . |
void |
testHello()
Unit test of
EPPHello . |
void |
testLogin()
Unit test of
EPPLoginCmd . |
void |
testLogout()
Unit test of
EPPLogoutCmd . |
void |
testPoll()
Unit test of
EPPPollCmd . |
void |
testResponse()
Unit test of
EPPResponse . |
void |
testResponseGetExtensionFailOnDuplicate()
Unit test for using
EPPResponse.getExtension(Class, boolean) . |
void |
testTimeInstantFormat()
Test the encoding and decoding of the
timeInstantFormat
supported by the EPPUtil.encodeTimeInstant(Date) and
EPPUtil.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 an
EPPMessage . |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
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, fail, fail
public EPPCodecTst(java.lang.String aName)
EPPCodecTst
with a logical name. The constructor
will initialize the base class TestCase
with the logical
name.aName
- Logical name of the testpublic void testGreeting()
EPPGreeting
. There is no response associated
with EPPGreeting
other than a EPPLoginCmd
which
is testing in testLogin
.public void testLogin()
EPPLoginCmd
. The response to
EPPLoginCmd
is EPPResponse
. public void testLogout()
EPPLogoutCmd
. The response to
EPPLogoutCmd
is EPPResponse
. public void testResponse()
EPPResponse
. This will test
EPPResponse
with various attribute values. public void testUnhandledNamespaces()
public void testCommandGetExtensionFailOnDuplicate()
EPPCommand.getExtension(Class, boolean)
.public void testFindDuplicateExtNamespaces()
EPPUtil.findDuplicateExtNamespaces(List)
and
the corresponding EPPCommand.findDuplicateExtNamespaces()
and
EPPResponse.findDuplicateExtNamespaces()
. Test the following:public void testResponseGetExtensionFailOnDuplicate()
EPPResponse.getExtension(Class, boolean)
.protected void setUp()
setUp
method, which sets the default client Id to
"theRegistrar".setUp
in class junit.framework.TestCase
protected void tearDown()
tearDown
, which currently does nothing.tearDown
in class junit.framework.TestCase
public static void initEnvironment()
true
or false
value indicating if
XML schema validation is enabled. The default value is true
true
or false
value
indicating if full XML schema validation is enabled. The default value is
true
.
epp.log
.
Environment
class and the logging will be
initialized.public static junit.framework.Test suite()
suite
static method, which returns the tests associated
with EPPCodecTst
.public static void main(java.lang.String[] args)
true
) or off (
false
). If validate is not specified, validation will be off.
args
- DOCUMENT ME!public static void printStart(java.lang.String aTest)
Thread
name if the current
thread is a TestThread
.aTest
- name for the testpublic static void printEnd(java.lang.String aTest)
Thread
name if the current
thread is a TestThread
.aTest
- name for the testpublic static void testXMLEncodeDecode(EPPMessage aMessage, EPPEncodeDecodeStats aStats) throws EPPException
EPPMessage
. If there is an
error with encoding or decoding the message, an EPPException
will
be thrown.aMessage
- Message to test the XML encoding and decodingaStats
- Testing statistics. Pass null
for no statistics to
be gathered.EPPException
- Error encoding or decoding the messagepublic static EPPEncodeDecodeStats testEncodeDecode(EPPMessage aMessage)
EPPMessage
in XMLEPPMessage
from XMLEPPMessage
using Java SerializationEPPMessage
using Java SerializationaMessage
- EPP Message to test encoding and decodingpublic static void setNumIterations(long aNumIterations)
aNumIterations
- number of iterations to run per testpublic void testHello()
EPPHello
. The response to EPPHello
is EPPResponse
. public void testPoll() throws javax.xml.parsers.ParserConfigurationException
EPPPollCmd
. The response to
EPPPollCmd
is EPPResponse
. javax.xml.parsers.ParserConfigurationException
- Error creating DOM document.public void testTimeInstantFormat()
timeInstantFormat
supported by the EPPUtil.encodeTimeInstant(Date)
and
EPPUtil.decodeTimeInstant(String)
.