Package org.bouncycastle.bcpg.test
Class AbstractPacketTest
- java.lang.Object
-
- org.bouncycastle.util.test.SimpleTest
-
- org.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
-
-
Constructor Summary
Constructors Constructor Description AbstractPacketTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidisEncodingEqual(byte[] first, byte[] second)Test, whether the first byte array and the second byte array are identical.voidisEncodingEqual(java.lang.String message, byte[] first, byte[] second)Test, whether the first byte array and the second byte array are identical.voidisEncodingEqual(java.lang.String message, ContainedPacket first, ContainedPacket second)Test, whether the encoding of the first and second packet are identical.voidisEncodingEqual(ContainedPacket first, ContainedPacket second)Test, whether the encoding of the first and second packet are identical.voidisFalse(boolean value)Test, whether the value is false.voidisFalse(java.lang.String message, boolean value)Test, whether the value is false.voidisNotNull(java.lang.Object value)Test, whether the value is not null.voidisNotNull(java.lang.String message, java.lang.Object value)Test, whether the value is not null.voidisNull(java.lang.Object value)Test, whether the value is null.voidisNull(java.lang.String message, java.lang.Object value)Test, whether the value is null.
-
-
-
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 arraysecond- 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 dumpfirst- first arraysecond- 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 packetsecond- second packet- Throws:
java.io.IOException
-
isEncodingEqual
public void isEncodingEqual(java.lang.String message, ContainedPacket first, ContainedPacket second) throws java.io.IOExceptionTest, 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 dumpfirst- first packetsecond- 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 messagevalue- 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 messagevalue- 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 messagevalue- value
-
-