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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bouncycastle.util.test.SimpleTest
org.bouncycastle.util.test.SimpleTest.TestExceptionOperation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidisEncodingEqual(byte[] first, byte[] second) Test, whether the first byte array and the second byte array are identical.voidisEncodingEqual(String message, byte[] first, byte[] second) Test, whether the first byte array and the second byte array are identical.voidisEncodingEqual(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.voidTest, whether the value is false.voidTest, whether the value is not null.voidTest, whether the value is not null.voidTest, whether the value is null.voidTest, 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
-
Constructor Details
-
AbstractPacketTest
public AbstractPacketTest()
-
-
Method Details
-
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
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
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:
IOException
-
isEncodingEqual
public void isEncodingEqual(String message, ContainedPacket first, ContainedPacket second) throws 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 dumpfirst- first packetsecond- second packet- Throws:
IOException
-
isFalse
public void isFalse(boolean value) Test, whether the value is false.- Parameters:
value- value
-
isFalse
Test, whether the value is false.- Parameters:
message- custom error messagevalue- value
-
isNull
-
isNull
-
isNotNull
-
isNotNull
-