Bouncy Castle Cryptography Library 1.81

org.bouncycastle.bcpg.test
Class AbstractPacketTest

java.lang.Object
  extended byorg.bouncycastle.util.test.SimpleTest
      extended byorg.bouncycastle.bcpg.test.AbstractPacketTest
All Implemented Interfaces:
org.bouncycastle.util.test.Test
Direct Known Subclasses:
EncryptedMessagePacketTest, OCBEncryptedDataPacketTest, OnePassSignaturePacketTest, OpenPgpMessageTest, SignaturePacketTest, SignatureSubpacketsTest, UnknownPublicKeyPacketTest, UnknownSecretKeyPacketTest

public abstract class AbstractPacketTest
extends org.bouncycastle.util.test.SimpleTest


Nested Class Summary
 
Nested classes inherited from class org.bouncycastle.util.test.SimpleTest
org.bouncycastle.util.test.SimpleTest.TestExceptionOperation
 
Constructor Summary
AbstractPacketTest()
           
 
Method Summary
 void isEncodingEqual(byte[] first, byte[] second)
          Test, whether the first byte array and the second byte array are identical.
 void isEncodingEqual(ContainedPacket first, ContainedPacket second)
          Test, whether the encoding of the first and second packet are identical.
 void isEncodingEqual(java.lang.String message, byte[] first, byte[] second)
          Test, whether the first byte array and the second byte array are identical.
 void isEncodingEqual(java.lang.String message, ContainedPacket first, ContainedPacket second)
          Test, whether the encoding of the first and second packet are identical.
 void isFalse(boolean value)
          Test, whether the value is false.
 void isFalse(java.lang.String message, boolean value)
          Test, whether the value is false.
 void isNotNull(java.lang.Object value)
          Test, whether the value is not null.
 void isNotNull(java.lang.String message, java.lang.Object value)
          Test, whether the value is not null.
 void isNull(java.lang.Object value)
          Test, whether the value is null.
 void isNull(java.lang.String message, java.lang.Object value)
          Test, whether the value is null.
 
Methods inherited from class org.bouncycastle.util.test.SimpleTest
areEqual, areEqual, areEqual, fail, fail, fail, getName, isEquals, isEquals, isEquals, isEquals, isEquals, isEquals, isEquals, isTrue, isTrue, perform, performTest, runTest, runTest, runTests, runTests, testException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPacketTest

public AbstractPacketTest()
Method Detail

isEncodingEqual

public void isEncodingEqual(byte[] first,
                            byte[] second)
Test, whether the first byte array and the second byte array are identical. If a mismatch is detected, a formatted hex dump of both arrays is printed to stdout.

Parameters:
first - first array
second - second array

isEncodingEqual

public void isEncodingEqual(java.lang.String message,
                            byte[] first,
                            byte[] second)
Test, whether the first byte array and the second byte array are identical. If a mismatch is detected, a formatted hex dump of both arrays is printed to stdout.

Parameters:
message - error message to prepend to the hex dump
first - first array
second - second array

isEncodingEqual

public void isEncodingEqual(ContainedPacket first,
                            ContainedPacket second)
                     throws java.io.IOException
Test, whether the encoding of the first and second packet are identical. If a mismatch is detected, a formatted hex dump of both packet encodings is printed to stdout.

Parameters:
first - first packet
second - second packet
Throws:
java.io.IOException

isEncodingEqual

public void isEncodingEqual(java.lang.String message,
                            ContainedPacket first,
                            ContainedPacket second)
                     throws java.io.IOException
Test, whether the encoding of the first and second packet are identical. If a mismatch is detected, a formatted hex dump of both packet encodings is printed to stdout.

Parameters:
message - error message to prepend to the hex dump
first - first packet
second - second packet
Throws:
java.io.IOException

isFalse

public void isFalse(boolean value)
Test, whether the value is false.

Parameters:
value - value

isFalse

public void isFalse(java.lang.String message,
                    boolean value)
Test, whether the value is false.

Parameters:
message - custom error message
value - value

isNull

public void isNull(java.lang.Object value)
Test, whether the value is null.

Parameters:
value - value

isNull

public void isNull(java.lang.String message,
                   java.lang.Object value)
Test, whether the value is null.

Parameters:
message - custom error message
value - value

isNotNull

public void isNotNull(java.lang.Object value)
Test, whether the value is not null.

Parameters:
value - value

isNotNull

public void isNotNull(java.lang.String message,
                      java.lang.Object value)
Test, whether the value is not null.

Parameters:
message - custom error message
value - value

Bouncy Castle Cryptography Library 1.81