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
-
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 TypeMethodDescriptionvoid
isEncodingEqual
(byte[] first, byte[] second) Test, whether the first byte array and the second byte array are identical.void
isEncodingEqual
(String message, byte[] first, byte[] second) Test, whether the first byte array and the second byte array are identical.void
isEncodingEqual
(String message, ContainedPacket first, ContainedPacket second) Test, whether the encoding of the first and second packet are identical.void
isEncodingEqual
(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
Test, whether the value is false.void
Test, whether the value is not null.void
Test, whether the value is not null.void
Test, whether the value is null.void
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
-
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
Test, whether the value is null.- Parameters:
value
- value
-
isNull
Test, whether the value is null.- Parameters:
message
- custom error messagevalue
- value
-
isNotNull
Test, whether the value is not null.- Parameters:
value
- value
-
isNotNull
Test, whether the value is not null.- Parameters:
message
- custom error messagevalue
- value
-