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.TestCase
Is 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.PKIXParameters
loadPKIXParameters(java.lang.String aTrustStoreName)
Loads the trust store file into thePKIXParameters
used to verify the certificate chain The Java Trust Store is loaded with the trusted VSP certificates.static java.security.PublicKey
loadPublicKey(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 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
setNumIterations(long aNumIterations)
Sets the number of iterations to run per test.protected void
setUp()
JUNITsetUp
method.static junit.framework.Test
suite()
JUNITsuite
static method, which returns the tests associated withEPPVerificationCodeTst
.protected void
tearDown()
JUNITtearDown
, which currently does nothing.void
testDomainWithMultiVerificationCode()
Unit test of extending the domain create command with multiple typed verification codes contained in the verification code extension.void
testDomainWithVerificationCode()
Unit test of extending the domain create command with a single untyped verification code contained in the verification code extension.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 typevoid
testInfo()
Test of the info extension with the cases:
Empty info extension - Includes the default case of an empty extension element.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.void
testVerificationCode()
Test theEPPVerificationCode
class.-
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 theEPPVerificationCode
class.
-
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()
JUNITsetUp
method.- Overrides:
setUp
in classjunit.framework.TestCase
-
tearDown
protected void tearDown()
JUNITtearDown
, which currently does nothing.- Overrides:
tearDown
in classjunit.framework.TestCase
-
suite
public static junit.framework.Test suite()
JUNITsuite
static 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.Exception
Loads the trust store file into thePKIXParameters
used to verify the certificate chain The Java Trust Store is loaded with the trusted VSP certificates.- Parameters:
aTrustStoreName
- Trust store file name- Returns:
- Initialized
PKIXParameters
instance. - 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.Exception
Loads 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 thetrustedCertEntry
containing the public key- Returns:
- Loaded
PublicKey
instance - Throws:
java.lang.Exception
- Error loading the public key
-
-