pk.edu.niit.clarens.test
Class CertificateBlockTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bypk.edu.niit.clarens.test.CertificateBlockTest
All Implemented Interfaces:
junit.framework.Test

public class CertificateBlockTest
extends junit.framework.TestCase

Tests of the class that manage certificate pem blocks.

See Also:
CertificateBlock

Constructor Summary
CertificateBlockTest(java.lang.String s)
          Create a named test case.
 
Method Summary
 void testCertFileWithJunk()
          Read a certificate from a PEM file that contains text before the PEM header.
 void testCertReadOfKeyStream()
          Attempt to read non-certificate PEM data into a certificate.
 void testCertReadOfKeyString()
          Attempt to read non-certificate PEM data into a certificate.
 void testCertStream()
          Read a certificate from a stream of data.
 void testCertStreamWithJunk()
          Read a certificate from a PEM file that contains text before the PEM header.
 void testCertString()
          Read a certificate from string data.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CertificateBlockTest

public CertificateBlockTest(java.lang.String s)
Create a named test case.

Parameters:
s - The name of the test to construct.
Method Detail

testCertString

public void testCertString()
                    throws java.lang.Exception
Read a certificate from string data.

Throws:
java.lang.Exception - Any thrown exceptions will cause the test to fail.

testCertStream

public void testCertStream()
                    throws java.lang.Exception
Read a certificate from a stream of data.

Throws:
java.lang.Exception - Any thrown exceptions will cause the test to fail.

testCertFileWithJunk

public void testCertFileWithJunk()
                          throws java.lang.Exception
Read a certificate from a PEM file that contains text before the PEM header. This is not supported by the CertificateBlock class and throws an exception when attempted. This test case checks for that exception.

Throws:
java.lang.Exception - Any thrown exceptions will cause the test to fail.

testCertStreamWithJunk

public void testCertStreamWithJunk()
                            throws java.lang.Exception
Read a certificate from a PEM file that contains text before the PEM header. This is not supported by the CertificateBlock class and throws an exception when attempted. This test case checks for that exception.

Throws:
java.lang.Exception - Any thrown exceptions will cause the test to fail.

testCertReadOfKeyString

public void testCertReadOfKeyString()
                             throws java.lang.Exception
Attempt to read non-certificate PEM data into a certificate. This test case checks for the exception that is thrown when this operation fails.

Throws:
java.lang.Exception - Any thrown exceptions will cause the test to fail.

testCertReadOfKeyStream

public void testCertReadOfKeyStream()
                             throws java.lang.Exception
Attempt to read non-certificate PEM data into a certificate. This test case checks for the exception that is thrown when this operation fails.

Throws:
java.lang.Exception - Any thrown exceptions will cause the test to fail.