Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/java/org/bouncycastle/asn1/test/ContentHintsUnitTest.java')
-rw-r--r--core/src/test/java/org/bouncycastle/asn1/test/ContentHintsUnitTest.java87
1 files changed, 0 insertions, 87 deletions
diff --git a/core/src/test/java/org/bouncycastle/asn1/test/ContentHintsUnitTest.java b/core/src/test/java/org/bouncycastle/asn1/test/ContentHintsUnitTest.java
deleted file mode 100644
index 1ae15e7b..00000000
--- a/core/src/test/java/org/bouncycastle/asn1/test/ContentHintsUnitTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.bouncycastle.asn1.test;
-
-import java.io.IOException;
-
-import org.bouncycastle.asn1.ASN1InputStream;
-import org.bouncycastle.asn1.ASN1ObjectIdentifier;
-import org.bouncycastle.asn1.ASN1Sequence;
-import org.bouncycastle.asn1.DERUTF8String;
-import org.bouncycastle.asn1.ess.ContentHints;
-
-public class ContentHintsUnitTest
- extends ASN1UnitTest
-{
- public String getName()
- {
- return "ContentHints";
- }
-
- public void performTest()
- throws Exception
- {
- DERUTF8String contentDescription = new DERUTF8String("Description");
- ASN1ObjectIdentifier contentType = new ASN1ObjectIdentifier("1.2.2.3");
-
- ContentHints hints = new ContentHints(contentType);
-
- checkConstruction(hints, contentType, null);
-
- hints = new ContentHints(contentType, contentDescription);
-
- checkConstruction(hints, contentType, contentDescription);
-
- hints = ContentHints.getInstance(null);
-
- if (hints != null)
- {
- fail("null getInstance() failed.");
- }
-
- try
- {
- ContentHints.getInstance(new Object());
-
- fail("getInstance() failed to detect bad object.");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
- }
-
- private void checkConstruction(
- ContentHints hints,
- ASN1ObjectIdentifier contentType,
- DERUTF8String description)
- throws IOException
- {
- checkValues(hints, contentType, description);
-
- hints = ContentHints.getInstance(hints);
-
- checkValues(hints, contentType, description);
-
- ASN1InputStream aIn = new ASN1InputStream(hints.toASN1Primitive().getEncoded());
-
- ASN1Sequence seq = (ASN1Sequence)aIn.readObject();
-
- hints = ContentHints.getInstance(seq);
-
- checkValues(hints, contentType, description);
- }
-
- private void checkValues(
- ContentHints hints,
- ASN1ObjectIdentifier contentType,
- DERUTF8String description)
- {
- checkMandatoryField("contentType", contentType, hints.getContentType());
- checkOptionalField("description", description, hints.getContentDescription());
- }
-
- public static void main(
- String[] args)
- {
- runTest(new ContentHintsUnitTest());
- }
-}