Package org.apache.ws.security.common

Examples of org.apache.ws.security.common.CustomHandler


        config.put(WSHandlerConstants.SAML_CALLBACK_REF, samlCallbackHandler);
        config.put(WSHandlerConstants.SAML_PROP_FILE, "saml_hok.properties");
        reqData.setMsgContext(config);
       
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        handler.send(
            WSConstants.ST_SIGNED,
            doc,
            reqData,
            Collections.singletonList(WSConstants.ST_SIGNED),
            true
View Full Code Here


        config.put(WSHandlerConstants.SAML_PROP_FILE, "saml_hok.properties");
        config.put(WSHandlerConstants.SIGNATURE_PARTS, "{}{" + WSConstants.SAML_NS + "}Assertion;");
        reqData.setMsgContext(config);
       
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        List<Integer> actions = new ArrayList<Integer>();
        actions.add(WSConstants.ST_UNSIGNED);
        actions.add(WSConstants.SIGN);
        handler.send(
            WSConstants.ST_UNSIGNED | WSConstants.SIGN,
            doc,
            reqData,
            actions,
            true
View Full Code Here

        reqData.setMsgContext(config);
       
        final java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(new Integer(action));
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        handler.send(
            action,
            doc,
            reqData,
            actions,
            true
View Full Code Here

    /**
     */
    @org.junit.Test
    public void
    testOrder() throws Exception {
        CustomHandler handler = new CustomHandler();
       
        java.util.List<WSSecurityEngineResult> results = new java.util.ArrayList<WSSecurityEngineResult>();
        results.add(
            new WSSecurityEngineResult(WSConstants.UT)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.TS)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.SC)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.SIGN)
        );
       
        java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(new Integer(WSConstants.UT));
        actions.add(new Integer(WSConstants.TS));
        actions.add(new Integer(WSConstants.SIGN));
       
        assertTrue (handler.checkResults(results, actions));
        assertTrue (handler.checkResultsAnyOrder(results, actions));
    }
View Full Code Here

    /**
     */
    @org.junit.Test
    public void
    testReverseOrder() throws Exception {
        CustomHandler handler = new CustomHandler();
       
        java.util.List<WSSecurityEngineResult> results = new java.util.ArrayList<WSSecurityEngineResult>();
        results.add(
            new WSSecurityEngineResult(WSConstants.SIGN)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.SC)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.TS)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.UT)
        );
       
        java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(new Integer(WSConstants.UT));
        actions.add(new Integer(WSConstants.TS));
        actions.add(new Integer(WSConstants.SIGN));
       
        assertFalse (handler.checkResults(results, actions));
        assertTrue (handler.checkResultsAnyOrder(results, actions));
        assertTrue (results.size() == 4 && actions.size() == 3);
    }
View Full Code Here

    /**
     */
    @org.junit.Test
    public void
    testMixedOrder() throws Exception {
        CustomHandler handler = new CustomHandler();
       
        java.util.List<WSSecurityEngineResult> results =
            new java.util.ArrayList<WSSecurityEngineResult>();
        results.add(
            new WSSecurityEngineResult(WSConstants.TS)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.SIGN)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.SC)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.UT)
        );
       
        java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(new Integer(WSConstants.UT));
        actions.add(new Integer(WSConstants.TS));
        actions.add(new Integer(WSConstants.SIGN));
       
        assertFalse (handler.checkResults(results, actions));
        assertTrue (handler.checkResultsAnyOrder(results, actions));
        assertFalse (actions.isEmpty());
    }
View Full Code Here

    /**
     */
    @org.junit.Test
    public void
    testMixedOrder2() throws Exception {
        CustomHandler handler = new CustomHandler();
       
        java.util.List<WSSecurityEngineResult> results =
            new java.util.ArrayList<WSSecurityEngineResult>();
        results.add(
            new WSSecurityEngineResult(WSConstants.TS)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.SIGN)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.SC)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.UT)
        );
       
        java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(new Integer(WSConstants.SIGN));
        actions.add(new Integer(WSConstants.UT));
        actions.add(new Integer(WSConstants.TS));
       
        assertFalse (handler.checkResults(results, actions));
        assertTrue (handler.checkResultsAnyOrder(results, actions));
    }
View Full Code Here

    /**
     */
    @org.junit.Test
    public void
    testMissingResult() throws Exception {
        CustomHandler handler = new CustomHandler();
       
        java.util.List<WSSecurityEngineResult> results =
            new java.util.ArrayList<WSSecurityEngineResult>();
        results.add(
            new WSSecurityEngineResult(WSConstants.UT)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.TS)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.SC)
        );
       
        java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(new Integer(WSConstants.TS));
        actions.add(new Integer(WSConstants.UT));
        actions.add(new Integer(WSConstants.SIGN));
       
        assertFalse (handler.checkResults(results, actions));
        assertFalse (handler.checkResultsAnyOrder(results, actions));
    }
View Full Code Here

    /**
     */
    @org.junit.Test
    public void
    testMissingAction() throws Exception {
        CustomHandler handler = new CustomHandler();
       
        java.util.List<WSSecurityEngineResult> results =
            new java.util.ArrayList<WSSecurityEngineResult>();
        results.add(
            new WSSecurityEngineResult(WSConstants.UT)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.TS)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.SIGN)
        );
        results.add(
            new WSSecurityEngineResult(WSConstants.SC)
        );
       
        java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(new Integer(WSConstants.TS));
        actions.add(new Integer(WSConstants.UT));
       
        assertFalse (handler.checkResults(results, actions));
        assertFalse (handler.checkResultsAnyOrder(results, actions));
    }
View Full Code Here

    /**
     */
    @org.junit.Test
    public void
    testNoResult() throws Exception {
        CustomHandler handler = new CustomHandler();
       
        java.util.List<WSSecurityEngineResult> results =
            new java.util.ArrayList<WSSecurityEngineResult>();
       
        java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(new Integer(WSConstants.TS));
       
        assertFalse (handler.checkResults(results, actions));
        assertFalse (handler.checkResultsAnyOrder(results, actions));
    }
View Full Code Here

TOP

Related Classes of org.apache.ws.security.common.CustomHandler

Copyright © 2018 www.massapicom. 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.