Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.ExpressionContext


    /**
     * Tests that the search string is not found.
     */
    public void testSearchNotPresent() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function indexOf = new IndexOfFunction();
        Sequence sequence = createStringSequence(factory,
                new String[]{"a", "dog", "and", "a", "duck"});
        Value search = factory.createStringValue("cat");
        Value retVal = indexOf.invoke(context, new Value[]{sequence, search});
View Full Code Here


    /**
     * Tests that the search string is found at all positions.
     */
    public void testAllItemsMatch() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function indexOf = new IndexOfFunction();
        Sequence sequence = createStringSequence(factory,
                new String[]{"abc", "abc", "abc", "abc", "abc"});
        Value search = factory.createStringValue("abc");
        Value retVal = indexOf.invoke(context, new Value[]{sequence, search});
View Full Code Here

    /**
     * Tests that an empty search string causes the empty sequence to be
     * returned.
     */
    public void testEmptySearch() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function indexOf = new IndexOfFunction();
        Sequence sequence = createStringSequence(factory,
                new String[]{"abc", "abc", "abc", "abc", "abc"});
        Value search = factory.createStringValue("");
        Value retVal = indexOf.invoke(context, new Value[]{sequence, search});
View Full Code Here

    /**
     * Tests that an empty sequence causes the empty sequence to be
     * returned.
     */
    public void testEmptySequence() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function indexOf = new IndexOfFunction();
        Sequence sequence = createStringSequence(factory, null);
        Value search = factory.createStringValue("peter");
        Value retVal = indexOf.invoke(context, new Value[]{sequence, search});

View Full Code Here

    /**
     * Tests that an empty sequence and empty search string causes the empty
     * sequence to be returned.
     */
    public void testEmptySequenceEmptySearch() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function indexOf = new IndexOfFunction();
        Sequence sequence = createStringSequence(factory, null);
        Value search = factory.createStringValue("");
        Value retVal = indexOf.invoke(context, new Value[]{sequence, search});

View Full Code Here

    /**
     * Tests that the search integer is found where expected.
     * ((15, 40, 25, 40, 10), 40)
     */
    public void testIntegerSequence() throws Exception {
        ExpressionContext context = createExpressionContext();
        ExpressionFactory factory = context.getFactory();
        Function indexOf = new IndexOfFunction();
        Sequence sequence = createIntegerSequence(factory,
                new int[]{15, 40, 25, 40, 10});
        Value search = factory.createIntValue(40);
        Value retVal = indexOf.invoke(context, new Value[]{sequence, search});
View Full Code Here

     */
    private ExpressionContext createExpressionContext() {
        EnvironmentInteractionTracker eit =
                new SimpleEnvironmentInteractionTracker();
        NamespacePrefixTracker npt = new DefaultNamespacePrefixTracker();
        ExpressionContext context = ExpressionFactory.getDefaultInstance().
                createExpressionContext(eit, npt);
        return context;
    }
View Full Code Here

                pipelineFactory.createPipelineContext(
                        createPipelineConfiguration(),
                        createRootEnvironmentInteraction());

        // extract the expression context
        ExpressionContext expresisonContext
                = pipelineContext.getExpressionContext();

        // allow subclasses to register functions that are specific to
        // their tests
        registerExpressionFunctions(expresisonContext);
View Full Code Here

        // get hold of an ExpressionFactory
        ExpressionFactory expressionFactory =
                pipelineFactory.getExpressionFactory();
       
        // create an expression context
        ExpressionContext expressionContext =
                expressionFactory .createExpressionContext(null, null);       
       
        // return a context
        return factory.createPipelineContext(config, expressionContext);
    }
View Full Code Here

    public void testSecondCreatePipelineContext() throws Exception {
        // create a config
        XMLPipelineConfiguration config =
                factory.createPipelineConfiguration();
       
        ExpressionContext expressionContext =
                factory.getExpressionFactory().createExpressionContext(
                        null, null);       
       
        // factor a context
        XMLPipelineContext context =
View Full Code Here

TOP

Related Classes of com.volantis.xml.expression.ExpressionContext

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.