Examples of Wss10


Examples of org.apache.wss4j.policy.model.Wss10

        int count = 0;
        while (alternativeIterator.hasNext()) {
            List<Assertion> alternative = alternativeIterator.next();
            assertEquals(1, alternative.size());
            assertTrue(alternative.get(0) instanceof Wss10);
            Wss10 wss10 = (Wss10) alternative.get(0);
            assertFalse(wss10.isNormalized());
            assertTrue(wss10.isIgnorable());
            assertTrue(wss10.isOptional());
            assertEquals(Constants.TYPE_ASSERTION, wss10.getType());
            assertEquals(SP12Constants.WSS10, wss10.getName());
            assertTrue(wss10.isMustSupportRefEmbeddedToken());
            assertTrue(wss10.isMustSupportRefExternalURI());
            assertTrue(wss10.isMustSupportRefIssuerSerial());
            assertTrue(wss10.isMustSupportRefKeyIdentifier());
            count++;
        }
        assertEquals(1, count);

        policy = policy.normalize(true);
        serializedPolicy = serializePolicy(policy);
        assertXMLisEqual(serializedPolicy, normalizedPolicyReferenceFile);

        alternativeIterator = policy.getAlternatives();
        List<Assertion> alternative = alternativeIterator.next();
        assertEquals(0, alternative.size());

        List<PolicyComponent> policyComponents = policy.getPolicyComponents();
        assertEquals(1, policyComponents.size());
        PolicyOperator policyOperator = (PolicyOperator) policyComponents.get(0);
        policyComponents = policyOperator.getPolicyComponents();
        assertEquals(2, policyComponents.size());
        All all = (All) policyComponents.get(0);
        List<PolicyComponent> policyComponentsAll = all.getAssertions();
        assertEquals(0, policyComponentsAll.size());

        all = (All) policyComponents.get(1);
        policyComponentsAll = all.getAssertions();
        assertEquals(1, policyComponentsAll.size());

        Iterator<PolicyComponent> policyComponentIterator = policyComponentsAll.iterator();
        Wss10 wss10 = (Wss10) policyComponentIterator.next();
        assertTrue(wss10.isNormalized());
        assertTrue(wss10.isIgnorable());
        assertFalse(wss10.isOptional());
        assertEquals(Constants.TYPE_ASSERTION, wss10.getType());
        assertEquals(SP12Constants.WSS10, wss10.getName());
        assertTrue(wss10.isMustSupportRefEmbeddedToken());
        assertTrue(wss10.isMustSupportRefExternalURI());
        assertTrue(wss10.isMustSupportRefIssuerSerial());
        assertTrue(wss10.isMustSupportRefKeyIdentifier());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.