From 1d2e61b06a442298854b0b7ba9ec392e6c75925b Mon Sep 17 00:00:00 2001 From: gregor Date: Wed, 24 Aug 2005 15:27:08 +0000 Subject: Fehlerhafte Abfrage des CRLDP-Sets behoben (Set hat keine Rangfolge) git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@466 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../server/config/ConfigurationProviderTest1.java | 47 +++++++++++++--------- 1 file changed, 27 insertions(+), 20 deletions(-) (limited to 'spss.server/src/test/at') diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java index c2c0c56e0..474a387ad 100644 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java +++ b/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java @@ -235,26 +235,33 @@ public class ConfigurationProviderTest1 extends TestCase Set dps = provider_.getDistributionPoints(cert); assertEquals(2, dps.size()); - CRLDistributionPoint dp1 = (CRLDistributionPoint) dps.toArray()[0]; - assertEquals("http://crl.myca.org", dp1.getUri()); - int reasonCodes = - iaik.asn1.structures.DistributionPoint.unused | - iaik.asn1.structures.DistributionPoint.keyCompromise | - iaik.asn1.structures.DistributionPoint.cACompromise | - iaik.asn1.structures.DistributionPoint.affiliationChanged | - iaik.asn1.structures.DistributionPoint.superseded | - iaik.asn1.structures.DistributionPoint.cessationOfOperation | - iaik.asn1.structures.DistributionPoint.certificateHold | - iaik.asn1.structures.DistributionPoint.privilegeWithdrawn | - iaik.asn1.structures.DistributionPoint.aACompromise; - assertEquals(reasonCodes, dp1.getReasonCodes()); - - CRLDistributionPoint dp2 = (CRLDistributionPoint) dps.toArray()[1]; - assertEquals("http://crl.myotherca.org", dp2.getUri()); - reasonCodes = - iaik.asn1.structures.DistributionPoint.aACompromise | - iaik.asn1.structures.DistributionPoint.affiliationChanged; - assertEquals(reasonCodes, dp2.getReasonCodes()); + Iterator dpIt = dps.iterator(); + while (dpIt.hasNext()) + { + CRLDistributionPoint currentDP = (CRLDistributionPoint)dpIt.next(); + if ("http://crl.myca.org".equals(currentDP.getUri())) + { + int reasonCodes = + iaik.asn1.structures.DistributionPoint.unused | + iaik.asn1.structures.DistributionPoint.keyCompromise | + iaik.asn1.structures.DistributionPoint.cACompromise | + iaik.asn1.structures.DistributionPoint.affiliationChanged | + iaik.asn1.structures.DistributionPoint.superseded | + iaik.asn1.structures.DistributionPoint.cessationOfOperation | + iaik.asn1.structures.DistributionPoint.certificateHold | + iaik.asn1.structures.DistributionPoint.privilegeWithdrawn | + iaik.asn1.structures.DistributionPoint.aACompromise; + assertEquals(reasonCodes, currentDP.getReasonCodes()); + } + else if ("http://crl.myotherca.org".equals(currentDP.getUri())) + { + int reasonCodes = + iaik.asn1.structures.DistributionPoint.aACompromise | + iaik.asn1.structures.DistributionPoint.affiliationChanged; + assertEquals(reasonCodes, currentDP.getReasonCodes()); + } + else fail("Invalid CRL DP URI found: " + currentDP.getUri()); + } parser = new RFC2253NameParser("CN=DP2_Issuer"); name = parser.parse(); -- cgit v1.2.3