Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.Expression


            throws ExtendedSAXException {
        ExpressionFactory factory = expressionContext.getFactory();
        ExpressionParser parser = factory.createExpressionParser();
        Sequence sequence;
        try {
            Expression expression = parser.parse(expressionAsString);
            Value value = expression.evaluate(expressionContext);
            sequence = value.getSequence();
        } catch (ExpressionException e) {
            throw new ExtendedSAXException(e);
        }
        return sequence;
View Full Code Here


        }

        ExpressionFactory expressionFactory = context.getFactory();
        ExpressionParser parser = expressionFactory.createExpressionParser();

        Expression expression = parser.parse(arguments[0].stringValue().asJavaString());
        return expression.evaluate(context);
    }
View Full Code Here

    }

    private RuntimePolicyReference evaluateRuntimePolicyExpression(
            RuntimePolicyReferenceExpression policyExpression) {
        Expression expression = policyExpression.getExpression();
        RuntimeProject project = (RuntimeProject) policyExpression.getProject();
        MarinerURL baseURL = policyExpression.getBaseURL();
        String brandName = policyExpression.getBrandName();

        RuntimePolicyReference reference = null;
        try {
            Value value = expression.evaluate(expressionContext);
            if (value instanceof RepositoryObjectIdentityValue) {
                RepositoryObjectIdentityValue identityValue =
                        (RepositoryObjectIdentityValue) value;

                PolicyIdentity identity = identityValue.asPolicyIdentity();
View Full Code Here

        accessorMock.expects.getDependentPolicyValue(policy)
                .returns(policyValue);

        // invoke the function
        Expression expression = parser.parse(getFunctionQName() +
                                             "('" + policy + "')");

        // evalute the expression
        Value value = expression.evaluate(expressionContext);

        // Value returned should be a StringValue
        assertTrue("return value should be a StringValue instance",
                   value instanceof StringValue);
View Full Code Here

        // add a policy/policy value pair to the request
        String charateristic = "null";
        serviceDefMock.expects.getCharacteristic(charateristic).returns(null);

        // invoke the function
        Expression expression = parser.parse(getFunctionQName() +
                                             "('" + charateristic + "')");

        // evalute the expression
        Value result = expression.evaluate(expressionContext);

        // Value returned should be the EmptySequence
        assertTrue("return value should be a Sequence instance",
                   result instanceof Sequence);
View Full Code Here

                                              value.createImmutable();

        serviceDefMock.expects.getCharacteristic(charateristic).returns(stringVal);

        // invoke the function
        Expression expression = parser.parse(getFunctionQName() +
                                             "('" + charateristic + "')");

        // evalute the expression
        Value result = expression.evaluate(expressionContext);

        // Value returned should be a StringValue
        assertTrue("return value should be a StringValue instance",
                   result instanceof StringValue);
View Full Code Here

     * Test the getPolicyValue() function with a policy that has NO value
     * @throws Exception if an error occurs
     */
    public void testInvokeWhenPolicyDoesNotExist() throws Exception {
        // invoke the function
        Expression expression = parser.parse(getFunctionQName() + "('Test')");

        accessorMock.expects.getDependentPolicyValue("Test").returns(null);

        // evalute the expression
        Value value = expression.evaluate(expressionContext);

        // ensure the empty sequence has been returned
        assertSame("Empty sequence should be returned if policy doesn't exist",
                   Sequence.EMPTY,
                   value);
View Full Code Here

        accessorMock.expects.getDependentPolicyValue(policy)
                .returns(policyValue);

        // invoke the function
        Expression expression = parser.parse(getFunctionQName() +
                                             "('" + policy + "')");

        // evalute the expression
        Value value = expression.evaluate(expressionContext);

        // ensure a sequence is returned
        assertTrue("return value should be a Sequence instance",
                   value instanceof Sequence);
View Full Code Here

                                              value.createImmutable();

        serviceDefMock.expects.getCharacteristic(charateristic).returns(boolVal);

        // invoke the function
        Expression expression = parser.parse(getFunctionQName() +
                                             "('" + charateristic + "')");

        // evalute the expression
        Value result = expression.evaluate(expressionContext);

        // Value returned should be a StringValue
        assertTrue("return value should be a BooleanValue instance",
                   result instanceof BooleanValue);
View Full Code Here

                                              value.createImmutable();

        serviceDefMock.expects.getCharacteristic(charateristic).returns(numVal);

        // invoke the function
        Expression expression = parser.parse(getFunctionQName() +
                                             "('" + charateristic + "')");

        // evalute the expression
        Value result = expression.evaluate(expressionContext);

        // Value returned should be a StringValue
        assertTrue("return value should be a DoubleValue instance",
                   result instanceof DoubleValue);
View Full Code Here

TOP

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

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.