Examples of ExpressionContext


Examples of com.volantis.xml.expression.ExpressionContext

    /**
     * Tests that the empty pattern throws an ExpressionException.
     */
    public void testEmptyPattern() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"my search string"});
        Value pattern = factory.createStringValue("");
        try {
View Full Code Here

Examples of com.volantis.xml.expression.ExpressionContext

    /**
     * Tests that pattern at start gives an empty string token at start.
     */
    public void testStartsWithPattern() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"abcdefghicat"});
        Value pattern = factory.createStringValue("abc");
        Value retVal = tokenize.invoke(context,
View Full Code Here

Examples of com.volantis.xml.expression.ExpressionContext

    /**
     * Tests that pattern at end gives an empty string token at end.
     */
    public void testEndsWithPattern() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"abcdefghicat"});
        Value pattern = factory.createStringValue("cat");
        Value retVal = tokenize.invoke(context,
View Full Code Here

Examples of com.volantis.xml.expression.ExpressionContext

    /**
     * Tests a regexp whitespace pattern.
     */
    public void testWhitespacePattern() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"the cat  sat   on    the     mat"});
        Value pattern = factory.createStringValue("\\s+");
        Value retVal = tokenize.invoke(context,
View Full Code Here

Examples of com.volantis.xml.expression.ExpressionContext

    /**
     * Tests a 'comma x' pattern.
     */
    public void testCommaPattern() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"thexcat,x,xxxsatxxxxon,thexxxxxmat"});
        Value pattern = factory.createStringValue(",x");
        Value retVal = tokenize.invoke(context,
View Full Code Here

Examples of com.volantis.xml.expression.ExpressionContext

    public Object startElement(
            DynamicProcess dynamicProcess, ExpandedName element,
            Attributes attributes) throws SAXException {

        XMLPipelineContext pipelineContext = dynamicProcess.getPipelineContext();
        ExpressionContext context = pipelineContext.getExpressionContext();

        // Get the expr attribute.
        String expr = attributes.getValue("expr");
        if (expr == null) {
            forwardError(dynamicProcess,
View Full Code Here

Examples of com.volantis.xml.expression.ExpressionContext

    /**
     * Tests when input matches pattern, a sequence with an empty string
     * results.
     */
    public void testStringEqualsPattern() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"one big long missspelt sentence"});
        Value pattern =
                factory.createStringValue("one big long missspelt sentence");
View Full Code Here

Examples of com.volantis.xml.expression.ExpressionContext

     * Tests when input equals multiple occurrences of pattern that a sequence
     * of empty strings (one for each match, plus one extra) results.
     */
    public void testStringEqualsMultipleSingleLetterPattern()
            throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"xxxxxxxxxx"});
        Value pattern = factory.createStringValue("x");
        Value retVal = tokenize.invoke(context,
View Full Code Here

Examples of com.volantis.xml.expression.ExpressionContext

     * Tests when input equals multiple occurrences of pattern that a sequence
     * of empty strings (one for each match, plus one extra) results.
     */
    public void testStringEqualsMultipleMultipleLetterPattern()
            throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"abcabcabcabcabcabcabcabcabcabc"});
        Value pattern = factory.createStringValue("abc");
        Value retVal = tokenize.invoke(context,
View Full Code Here

Examples of com.volantis.xml.expression.ExpressionContext

     * Tests when input is a multiple concatenation of pattern with a
     * 'leftover', that each match generates an empty string and the last
     * sequence member is the leftover bit.
     */
    public void testRemainderX() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function tokenize = new TokenizeFunction();
        Sequence sequence = createSequence(factory,
                new String[]{"xxxxxxxxxx"});
        Value pattern = factory.createStringValue("xxx");
        Value retVal = tokenize.invoke(context,
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.