Class EPPVerificationCodeTst
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- com.verisign.epp.codec.verificationcode.EPPVerificationCodeTst
-
- All Implemented Interfaces:
junit.framework.Test
public class EPPVerificationCodeTst extends junit.framework.TestCaseIs a unit test of the com.verisign.epp.codec.verificationcode package.
-
-
Constructor Summary
Constructors Constructor Description EPPVerificationCodeTst(java.lang.String name)Creates a new EPPVerificationCodeTst object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.security.cert.PKIXParametersloadPKIXParameters(java.lang.String aTrustStoreName)Loads the trust store file into thePKIXParametersused to verify the certificate chain The Java Trust Store is loaded with the trusted VSP certificates.static java.security.PublicKeyloadPublicKey(java.lang.String aKeyStoreName, java.lang.String aPublicKeyAlias)Loads the public key used to verify a digital signature signed with the associated private key, loaded byloadPrivateKeyEntry(String, String, String).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 voidsetNumIterations(long aNumIterations)Sets the number of iterations to run per test.protected voidsetUp()JUNITsetUpmethod.static junit.framework.Testsuite()JUNITsuitestatic method, which returns the tests associated withEPPVerificationCodeTst.protected voidtearDown()JUNITtearDown, which currently does nothing.voidtestDomainWithMultiVerificationCode()Unit test of extending the domain create command with multiple typed verification codes contained in the verification code extension.voidtestDomainWithVerificationCode()Unit test of extending the domain create command with a single untyped verification code contained in the verification code extension.voidtestEncodedSignedCode()Test different encoded signed codes that include:
Domain typed code Test encoding and decoding the Base64 encoded signed code value (no wrapper <verificationCode:code> XML element). Real-name typed code Negative test - Invalid vsp-id Negative test - Invalid code typevoidtestInfo()Test of the info extension with the cases:
Empty info extension - Includes the default case of an empty extension element.voidtestInfoResponse()Test of the info response extension with the cases:
Status - Return just the notApplicable verification status Status and Profile - Return the verification status and the profile Status, Profile, and Set Codes from Sponsoring Client - Return the status, profile, and two verification codes from the sponsoring registrar. Status, Profile, and Set Codes from Non-Sponsoring Client - Return the status, profile, and two verification codes from the non-sponsoring registrar. Status, Profile, and Missing Codes from Non-Sponsoring Client - Return the status, profile, and two missing codes from the non-sponsoring registrar. Status, Profile, Missing Codes, and Set Codes from Non-Sponsoring Client - Return the status, profile, and one missing code, and one set code from the non-sponsoring registrar. Status, Profile, and Set Codes from Sponsoring Client with Codes Set from Another Profile - Return the status, profile, and two verification codes from the sponsoring registrar, and include the set codes for the notApplicable profile.voidtestVerificationCode()Test theEPPVerificationCodeclass.-
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
-
testVerificationCode
public void testVerificationCode()
Test theEPPVerificationCodeclass.
-
testDomainWithVerificationCode
public void testDomainWithVerificationCode()
Unit test of extending the domain create command with a single untyped verification code contained in the verification code extension.
-
testInfo
public void testInfo()
Test of the info extension with the cases:
- Empty info extension - Includes the default case of an empty extension element.
- Info extension with profile - Include the extension with the profile attribute set
-
testInfoResponse
public void testInfoResponse()
Test of the info response extension with the cases:
- Status - Return just the notApplicable verification status
- Status and Profile - Return the verification status and the profile
- Status, Profile, and Set Codes from Sponsoring Client - Return the status, profile, and two verification codes from the sponsoring registrar.
- Status, Profile, and Set Codes from Non-Sponsoring Client - Return the status, profile, and two verification codes from the non-sponsoring registrar.
- Status, Profile, and Missing Codes from Non-Sponsoring Client - Return the status, profile, and two missing codes from the non-sponsoring registrar.
- Status, Profile, Missing Codes, and Set Codes from Non-Sponsoring Client - Return the status, profile, and one missing code, and one set code from the non-sponsoring registrar.
- Status, Profile, and Set Codes from Sponsoring Client with Codes Set from Another Profile - Return the status, profile, and two verification codes from the sponsoring registrar, and include the set codes for the notApplicable profile.
-
testDomainWithMultiVerificationCode
public void testDomainWithMultiVerificationCode()
Unit test of extending the domain create command with multiple typed verification codes contained in the verification code extension.
-
testEncodedSignedCode
public void testEncodedSignedCode()
Test different encoded signed codes that include:
- Domain typed code
- Test encoding and decoding the Base64 encoded signed code value (no wrapper <verificationCode:code> XML element).
- Real-name typed code
- Negative test - Invalid vsp-id
- Negative test - Invalid code type
-
setUp
protected void setUp()
JUNITsetUpmethod.- Overrides:
setUpin classjunit.framework.TestCase
-
tearDown
protected void tearDown()
JUNITtearDown, which currently does nothing.- Overrides:
tearDownin classjunit.framework.TestCase
-
suite
public static junit.framework.Test suite()
JUNITsuitestatic method, which returns the tests associated withEPPVerificationCodeTst.- 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- Program arguments
-
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
-
loadPKIXParameters
public static java.security.cert.PKIXParameters loadPKIXParameters(java.lang.String aTrustStoreName) throws java.lang.ExceptionLoads the trust store file into thePKIXParametersused to verify the certificate chain The Java Trust Store is loaded with the trusted VSP certificates.- Parameters:
aTrustStoreName- Trust store file name- Returns:
- Initialized
PKIXParametersinstance. - Throws:
java.lang.Exception- Error initializing the PKIX parameters
-
loadPublicKey
public static java.security.PublicKey loadPublicKey(java.lang.String aKeyStoreName, java.lang.String aPublicKeyAlias) throws java.lang.ExceptionLoads the public key used to verify a digital signature signed with the associated private key, loaded byloadPrivateKeyEntry(String, String, String).- Parameters:
aKeyStoreName- Java Keystore containing the certificateaPublicKeyAlias- Java Keystore alias of thetrustedCertEntrycontaining the public key- Returns:
- Loaded
PublicKeyinstance - Throws:
java.lang.Exception- Error loading the public key
-
-