Package org.apache.synapse.commons.evaluators

Examples of org.apache.synapse.commons.evaluators.Evaluator


        return rewrite;
    }

    private OMElement serializeRule(RewriteRule r) throws EvaluatorException {
        OMElement rule = fac.createOMElement("rewriterule", synNS);
        Evaluator condition = r.getCondition();
        if (condition != null) {
            OMElement conditionElt = fac.createOMElement("condition", synNS);
            EvaluatorSerializer serializer = EvaluatorSerializerFinder.getInstance().
                    getSerializer(condition.getName());
            serializer.serialize(conditionElt, condition);
            rule.addChild(conditionElt);
        }

        List<RewriteAction> actions = r.getActions();
View Full Code Here


        OMElement condition = ruleElement.getFirstChildWithName(CONDITION_Q);
        if (condition != null) {
            OMElement child = condition.getFirstElement();
            if (child != null) {
                try {
                    Evaluator eval = EvaluatorFactoryFinder.getInstance().getEvaluator(child);
                    rule.setCondition(eval);
                } catch (EvaluatorException e) {
                    handleException("Error while parsing the rule condition", e);
                }
            }
View Full Code Here

    public void testHeaderEqualSerializer() {
        String input = "<equal type=\"header\" source=\"foo\" value=\"bar\"/>";

        try {
            Evaluator eval = fac.create(AXIOMUtil.stringToOM(input));
            OMElement output = serializer.serialize(null, eval);
            assertXMLEqual(input, output.toString());
        } catch (Exception e) {
            fail("Error while parsing the input XML");
        }
View Full Code Here

    public void testParameterEqualSerializer() {
        String input = "<equal type=\"param\" source=\"foo\" value=\"bar\"/>";

        try {
            Evaluator eval = fac.create(AXIOMUtil.stringToOM(input));
            OMElement output = serializer.serialize(null, eval);
            assertXMLEqual(input, output.toString());
        } catch (Exception e) {
            fail("Error while parsing the input XML");
        }
View Full Code Here

    public void testURLEqualSerializer() {
        String input = "<equal type=\"url\" value=\"http://foo.org\"/>";

        try {
            Evaluator eval = fac.create(AXIOMUtil.stringToOM(input));
            OMElement output = serializer.serialize(null, eval);
            assertXMLEqual(input, output.toString());
        } catch (Exception e) {
            fail("Error while parsing the input XML");
        }
View Full Code Here

    public void testURLEqualSerializer2() {
        String input = "<equal type=\"url\" value=\"http://foo.org\" source=\"protocol\"/>";

        try {
            Evaluator eval = fac.create(AXIOMUtil.stringToOM(input));
            OMElement output = serializer.serialize(null, eval);
            assertXMLEqual(input, output.toString());
        } catch (Exception e) {
            fail("Error while parsing the input XML");
        }
View Full Code Here

    public void testHeaderMatchSerializer() {
        String input = "<match type=\"header\" source=\"foo\" regex=\"bar\"/>";

        try {
            Evaluator eval = fac.create(AXIOMUtil.stringToOM(input));
            OMElement output = serializer.serialize(null, eval);
            assertXMLEqual(input, output.toString());
        } catch (Exception e) {
            fail("Error while parsing the input XML");
        }
View Full Code Here

    public void testParameterMatchSerializer() {
        String input = "<match type=\"param\" source=\"foo\" regex=\"bar\"/>";

        try {
            Evaluator eval = fac.create(AXIOMUtil.stringToOM(input));
            OMElement output = serializer.serialize(null, eval);
            assertXMLEqual(input, output.toString());
        } catch (Exception e) {
            fail("Error while parsing the input XML");
        }
View Full Code Here

    public void testURLMatchSerializer() {
        String input = "<match type=\"url\" regex=\"http://foo.org\"/>";

        try {
            Evaluator eval = fac.create(AXIOMUtil.stringToOM(input));
            OMElement output = serializer.serialize(null, eval);
            assertXMLEqual(input, output.toString());
        } catch (Exception e) {
            fail("Error while parsing the input XML");
        }
View Full Code Here

    public void testURLMatchSerializer2() {
        String input = "<match type=\"url\" regex=\"http://foo.org\" source=\"protocol\"/>";

        try {
            Evaluator eval = fac.create(AXIOMUtil.stringToOM(input));
            OMElement output = serializer.serialize(null, eval);
            assertXMLEqual(input, output.toString());
        } catch (Exception e) {
            fail("Error while parsing the input XML");
        }
View Full Code Here

TOP

Related Classes of org.apache.synapse.commons.evaluators.Evaluator

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.