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/MonetaryLimitUnitTest.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/MonetaryLimitUnitTest.java')
-rw-r--r-- | core/src/test/java/org/bouncycastle/asn1/test/MonetaryLimitUnitTest.java | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/core/src/test/java/org/bouncycastle/asn1/test/MonetaryLimitUnitTest.java b/core/src/test/java/org/bouncycastle/asn1/test/MonetaryLimitUnitTest.java deleted file mode 100644 index 8456661a..00000000 --- a/core/src/test/java/org/bouncycastle/asn1/test/MonetaryLimitUnitTest.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.bouncycastle.asn1.test; - -import org.bouncycastle.asn1.ASN1InputStream; -import org.bouncycastle.asn1.ASN1Sequence; -import org.bouncycastle.asn1.isismtt.x509.MonetaryLimit; - -import java.io.IOException; - -public class MonetaryLimitUnitTest - extends ASN1UnitTest -{ - public String getName() - { - return "MonetaryLimit"; - } - - public void performTest() - throws Exception - { - String currency = "AUD"; - int amount = 1; - int exponent = 2; - - MonetaryLimit limit = new MonetaryLimit(currency, amount, exponent); - - checkConstruction(limit, currency, amount, exponent); - - limit = MonetaryLimit.getInstance(null); - - if (limit != null) - { - fail("null getInstance() failed."); - } - - try - { - MonetaryLimit.getInstance(new Object()); - - fail("getInstance() failed to detect bad object."); - } - catch (IllegalArgumentException e) - { - // expected - } - } - - private void checkConstruction( - MonetaryLimit limit, - String currency, - int amount, - int exponent) - throws IOException - { - checkValues(limit, currency, amount, exponent); - - limit = MonetaryLimit.getInstance(limit); - - checkValues(limit, currency, amount, exponent); - - ASN1InputStream aIn = new ASN1InputStream(limit.toASN1Object().getEncoded()); - - ASN1Sequence seq = (ASN1Sequence)aIn.readObject(); - - limit = MonetaryLimit.getInstance(seq); - - checkValues(limit, currency, amount, exponent); - } - - private void checkValues( - MonetaryLimit limit, - String currency, - int amount, - int exponent) - { - checkMandatoryField("currency", currency, limit.getCurrency()); - checkMandatoryField("amount", amount, limit.getAmount().intValue()); - checkMandatoryField("exponent", exponent, limit.getExponent().intValue()); - } - - public static void main( - String[] args) - { - runTest(new MonetaryLimitUnitTest()); - } -} |