Package org.apache.ws.security.common

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


    /**
     */
    @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

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

        reqData.setUsername("");
       
        final java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(new Integer(WSConstants.SIGN));
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        handler.send(
            WSConstants.SIGN,
            doc,
            reqData,
            actions,
            true
        );
       
        String outputString =
            org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
        if (LOG.isDebugEnabled()) {
            LOG.debug(outputString);
        }
       
        reqData = new RequestData();
        reqData.setWssConfig(WSSConfig.getNewInstance());
        messageContext = new java.util.TreeMap<String, Object>();
        messageContext.put(WSHandlerConstants.PW_CALLBACK_REF, this);
        reqData.setMsgContext(messageContext);
        reqData.setUsername("");
       
        handler.receive(WSConstants.SIGN, reqData);
       
        secEngine.processSecurityHeader(doc, null, this, null, crypto);
    }
View Full Code Here

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

        reqData.setWssConfig(cfg);
       
        final List<Integer> actions = new ArrayList<Integer>();
        actions.add(new Integer(action));
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        reqData.setMsgContext("bread");
        assertEquals(reqData.getMsgContext(), "bread");
        handler.send(
            action,
            doc,
            reqData,
            actions,
            true
View Full Code Here

        reqData.setWssConfig(cfg);
       
        final List<Integer> actions = new ArrayList<Integer>();
        actions.add(new Integer(action));
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        reqData.setMsgContext("bread");
        assertEquals(reqData.getMsgContext(), "bread");
        handler.send(
            action,
            doc,
            reqData,
            actions,
            true
View Full Code Here

        reqData.setUsername("");
       
        final java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(new Integer(WSConstants.ENCR));
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        handler.send(
            WSConstants.ENCR,
            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

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.