Class EPPSecDNSDomainTst

  • All Implemented Interfaces:
    junit.framework.Test

    public class EPPSecDNSDomainTst
    extends junit.framework.TestCase
    Is a unit test of the EPPDomain class including the secDNS:create and secDNS:update (add, chg, rem) command extensions, as well as the secDNS:infData response extension. The unit test will initialize a session with an EPP Server, will invoke EPPDomain operations, and will end a session with an EPP Server. The configuration file used by the unit test defaults to epp.config, but can be changed by passing the file path as the first command line argument. The unit test can be run in multiple threads by setting the "threads" system property. For example, the unit test can be run in 2 threads with the configuration file ../../epp.config with the following command:

    java com.verisign.epp.interfaces.EPPSecDNSDomainTst -Dthreads=2 ../../epp.config

    The unit test is dependent on the use of JUNIT 3.5



    • Constructor Summary

      Constructors 
      Constructor Description
      EPPSecDNSDomainTst​(java.lang.String name)
      Allocates an EPPSecDNSDomainTst with a logical name.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handleException​(java.lang.Exception aException)
      Handle an EPPCommandException, which can be either a server generated error or a general exception.
      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).
      java.lang.String makeContactName()
      Makes a unique contact name using the current time.
      java.lang.String makeDomainName()
      This method tries to generate a unique String as Domain Name
      java.lang.String makeHostName​(java.lang.String newDomainName)
      Makes a unique host name for a domain using the current time.
      java.lang.String makeIP()
      Makes a unique IP address based off of the current time.
      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 test associated with EPPSecDNSDomainTst.
      protected void tearDown()
      JUNIT tearDown, which currently does nothing.
      void testCreateDsDataInterface()
      Unit test of EPPDomain.sendCreate for secDNS 1.1 using the DS Data Interface.
      void testCreateKeyDataInterface()
      Unit test of EPPDomain.sendCreate for secDNS 1.1 using the Key Data Interface.
      void testCreateNegativeTests()
      Unit test of EPPDomain.sendCreate for secDNS 1.1 with negative cases.
      void testDomainInfo()
      Unit test of EPPDomain.sendInfo including secDNS:infData response extension using a defined set of domain names returning different responses by the EPP Stub Server including:
      key-data-interface.com - Return response with two keys using the Key Data Interface.
      void testUpdateDsDataInterface()
      Unit test of EPPDomain.sendUpdate for secDNS 1.1 using the DS Data Interface.
      void testUpdateKeyDataInterface()
      Unit test of EPPDomain.sendUpdate for secDNS 1.1 using the Key Data Interface.
      void testUpdateNegativeTests()
      Unit test of EPPDomain.sendUpdate for secDNS 1.1 with negative cases.
      • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EPPSecDNSDomainTst

        public EPPSecDNSDomainTst​(java.lang.String name)
        Allocates an EPPSecDNSDomainTst with a logical name. The constructor will initialize the base class TestCase with the logical name.
        Parameters:
        name - Logical name of the test
    • Method Detail

      • testDomainInfo

        public void testDomainInfo()
        Unit test of EPPDomain.sendInfo including secDNS:infData response extension using a defined set of domain names returning different responses by the EPP Stub Server including:
        1. key-data-interface.com - Return response with two keys using the Key Data Interface.
        2. ds-data-interface-with-key.com - Return response with two DS including the associated keys using the DS Data Interface.
        3. ds-data-interface-with-maxsiglife.com - Return response with two DS using the DS Data Interface and with the <secDNS:maxSigLife> element.
        4. example.com - Return response with two DS using DS Data Interface.
      • testCreateDsDataInterface

        public void testCreateDsDataInterface()
        Unit test of EPPDomain.sendCreate for secDNS 1.1 using the DS Data Interface. The VeriSign servers only support the DS Data Interface. The following tests will be executed:
        1. Create for a Secure Delegation example.com using the DS Data Interface with one DS.
        2. Create for a Secure Delegation example.com using the DS Data Interface with two DS.
        3. Create for a Secure Delegation example.com using the DS Data Interface with OPTIONAL key data.
      • testCreateKeyDataInterface

        public void testCreateKeyDataInterface()
        Unit test of EPPDomain.sendCreate for secDNS 1.1 using the Key Data Interface. The VeriSign servers dot NOT support the Key Data Interface. The following tests will be executed:
        1. Create for a Secure Delegation example.com using the Key Data Interface with one key.
        2. Create for a Secure Delegation example.com using the Key Data Interface with two keys.
      • testCreateNegativeTests

        public void testCreateNegativeTests()
        Unit test of EPPDomain.sendCreate for secDNS 1.1 with negative cases. These tests will only work against the Stub Server since specific domains key off server-side behavior. The following negative tests will be executed:
        1. Passing DS data to server that only supports the Key Data Interface with the domain key-data-interface.com.
        2. Passing Key data to server that only supports the DS Data Interface with the domain ds-data-interface.com.
        3. Setting maxSigLife for a server that does not support maxSigLife with the domain maxsiglife-not-suported.com.
      • testUpdateDsDataInterface

        public void testUpdateDsDataInterface()
        Unit test of EPPDomain.sendUpdate for secDNS 1.1 using the DS Data Interface. The VeriSign servers only support the DS Data Interface. The following tests will be executed:
        1. Adding and Removing DS Data using the DS Data Interface.
        2. Removing DS Data with <secDNS:dsData> using the DS Data Interface.
        3. Remove all DS and Key Data using <secDNS:rem> with <secDNS:all>.
        4. Replacing all DS Data using the DS Data Interface.
        5. Update the maxSigLife.
      • testUpdateKeyDataInterface

        public void testUpdateKeyDataInterface()
        Unit test of EPPDomain.sendUpdate for secDNS 1.1 using the Key Data Interface. The VeriSign servers do not support the Key Data Interface. The following tests will be executed:
        1. Adding and Removing Key Data using the Key Data Interface.
      • testUpdateNegativeTests

        public void testUpdateNegativeTests()
        Unit test of EPPDomain.sendUpdate for secDNS 1.1 with negative cases. These tests will only work against the Stub Server since specific domains key off server-side behavior. The following negative tests will be executed:
        1. Pass an urgent flag of true to a server that does not support it with the domain urgent-not-supported.com.
        2. Pass an urgent flag of true to a server that does support but unable to complete the command with high priority with the domain urgent-supported-cannot-be-urgent.com.
        3. Pass DS Data to a server that only supports the Key Data Interface with the domain key-data-interface.com.
        4. Pass Key Data to a server that only supports the DS Data Interface with the domain ds-data-interface.com.
        5. Pass the maxSigLife to a server that does not support it with the domain maxsiglife-not-supported.com.
      • setUp

        protected void setUp()
        JUNIT setUp method, which sets the default client Id to "theRegistrar".
        Overrides:
        setUp in class junit.framework.TestCase
      • tearDown

        protected void tearDown()
        JUNIT tearDown, which currently does nothing.
        Overrides:
        tearDown in class junit.framework.TestCase
      • suite

        public static junit.framework.Test suite()
        JUNIT suite static method, which returns the test associated with EPPSecDNSDomainTst.
        Returns:
        the test associated with EPPSecDNSDomainTst.
      • handleException

        public void handleException​(java.lang.Exception aException)
        Handle an EPPCommandException, 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 test
      • 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 - program arguments
      • makeDomainName

        public java.lang.String makeDomainName()
        This method tries to generate a unique String as Domain Name
        Returns:
        Unique domain name String
      • makeIP

        public java.lang.String makeIP()
        Makes a unique IP address based off of the current time.
        Returns:
        Unique IP address String
      • makeHostName

        public java.lang.String makeHostName​(java.lang.String newDomainName)
        Makes a unique host name for a domain using the current time.
        Parameters:
        newDomainName - a domain name on which to create a child host name
        Returns:
        Unique host name String
      • makeContactName

        public java.lang.String makeContactName()
        Makes a unique contact name using the current time.
        Returns:
        Unique contact name String