diff options
author | Roberto Tyley <roberto.tyley@gmail.com> | 2014-07-15 01:38:01 +0400 |
---|---|---|
committer | Roberto Tyley <roberto.tyley@gmail.com> | 2014-07-26 11:23:17 +0400 |
commit | 7cb752aaf746dc0b473afeb9e892b7fbc12666c5 (patch) | |
tree | cc4f91ddc18332b5adbe82e3fcb040d976c90105 /core/src/test/java/org/bouncycastle/asn1/test/QCStatementUnitTest.java | |
parent | 551830f8ea5177042af2c7dd1fc90888bc67387d (diff) |
Execute become-spongy.sh
https://github.com/rtyley/spongycastle/blob/3040af/become-spongy.sh
Diffstat (limited to 'core/src/test/java/org/bouncycastle/asn1/test/QCStatementUnitTest.java')
-rw-r--r-- | core/src/test/java/org/bouncycastle/asn1/test/QCStatementUnitTest.java | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/core/src/test/java/org/bouncycastle/asn1/test/QCStatementUnitTest.java b/core/src/test/java/org/bouncycastle/asn1/test/QCStatementUnitTest.java deleted file mode 100644 index d7a84a5e..00000000 --- a/core/src/test/java/org/bouncycastle/asn1/test/QCStatementUnitTest.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.bouncycastle.asn1.test; - -import java.io.IOException; - -import org.bouncycastle.asn1.ASN1Encodable; -import org.bouncycastle.asn1.ASN1InputStream; -import org.bouncycastle.asn1.ASN1ObjectIdentifier; -import org.bouncycastle.asn1.ASN1Sequence; -import org.bouncycastle.asn1.x509.qualified.QCStatement; -import org.bouncycastle.asn1.x509.qualified.RFC3739QCObjectIdentifiers; -import org.bouncycastle.asn1.x509.qualified.SemanticsInformation; -import org.bouncycastle.util.test.SimpleTest; - -public class QCStatementUnitTest - extends SimpleTest -{ - public String getName() - { - return "QCStatement"; - } - - public void performTest() - throws Exception - { - QCStatement mv = new QCStatement(RFC3739QCObjectIdentifiers.id_qcs_pkixQCSyntax_v1); - - checkConstruction(mv, RFC3739QCObjectIdentifiers.id_qcs_pkixQCSyntax_v1, null); - - ASN1Encodable info = new SemanticsInformation(new ASN1ObjectIdentifier("1.2")); - - mv = new QCStatement(RFC3739QCObjectIdentifiers.id_qcs_pkixQCSyntax_v1, info); - - checkConstruction(mv, RFC3739QCObjectIdentifiers.id_qcs_pkixQCSyntax_v1, info); - - mv = QCStatement.getInstance(null); - - if (mv != null) - { - fail("null getInstance() failed."); - } - - try - { - QCStatement.getInstance(new Object()); - - fail("getInstance() failed to detect bad object."); - } - catch (IllegalArgumentException e) - { - // expected - } - } - - private void checkConstruction( - QCStatement mv, - ASN1ObjectIdentifier statementId, - ASN1Encodable statementInfo) - throws IOException - { - checkStatement(mv, statementId, statementInfo); - - mv = QCStatement.getInstance(mv); - - checkStatement(mv, statementId, statementInfo); - - ASN1InputStream aIn = new ASN1InputStream(mv.toASN1Object().getEncoded()); - - ASN1Sequence seq = (ASN1Sequence)aIn.readObject(); - - mv = QCStatement.getInstance(seq); - - checkStatement(mv, statementId, statementInfo); - } - - private void checkStatement( - QCStatement qcs, - ASN1ObjectIdentifier statementId, - ASN1Encodable statementInfo) - throws IOException - { - if (!qcs.getStatementId().equals(statementId)) - { - fail("statementIds don't match."); - } - - if (statementInfo != null) - { - if (!qcs.getStatementInfo().equals(statementInfo)) - { - fail("statementInfos don't match."); - } - } - else if (qcs.getStatementInfo() != null) - { - fail("statementInfo found when none expected."); - } - } - - public static void main( - String[] args) - { - runTest(new QCStatementUnitTest()); - } -} |