Package org.apache.ode.bpel.elang.xpath20.runtime

Examples of org.apache.ode.bpel.elang.xpath20.runtime.MockCompilerContext


            OLink olink = _oxpath.links.get(variableName.getLocalPart());

            try {
                return _ectx.isLinkActive(olink) ? Boolean.TRUE : Boolean.FALSE;
            } catch (FaultException e) {
                throw new WrappedResolverException(e);
            }
        }else{
            String varName;
            String partName;
            int dotloc = variableName.getLocalPart().indexOf('.');
            if (dotloc == -1) {
                varName = variableName.getLocalPart();
                partName = null;
            } else {
                varName = variableName.getLocalPart().substring(0, dotloc);
                partName = variableName.getLocalPart().substring(dotloc + 1);
            }
            OScope.Variable variable = _oxpath.vars.get(varName);
            OMessageVarType.Part part = partName == null ? null : ((OMessageVarType)variable.type).parts.get(partName);

            try{
                final Node variableNode = _ectx.readVariable(variable, part);
                if (variableNode == null)
                    throw new FaultException(variable.getOwner().constants.qnSelectionFailure,
                            "Unknown variable " + variableName.getLocalPart());
                if (_ectx.narrowTypes()) {
                    if (variable.type instanceof OXsdTypeVarType && ((OXsdTypeVarType)variable.type).simple)
                        return getSimpleContent(variableNode,((OXsdTypeVarType)variable.type).xsdType);
                    if (part != null && part.type instanceof OXsdTypeVarType && ((OXsdTypeVarType)part.type).simple)
                        return getSimpleContent(variableNode,((OXsdTypeVarType)part.type).xsdType);
                }

                // Saxon used to expect a node list, but now a regular node will suffice.
                return variableNode;
            }catch(FaultException e){
                throw new WrappedResolverException(e);
            }
        }
    }
View Full Code Here


    public void setUp() throws Exception {
        _vars = new HashMap<String, Node>();
        _cc = new MockCompilerContext();
        _runtime = new XPath20ExpressionRuntime();      
        _runtime.initialize(new HashMap());
        _compiler = new XPath20ExpressionCompilerBPEL20();
        _compiler.setCompilerContext(_cc);
       
        _vardoc = DOMUtils.parse(getClass().getResourceAsStream("/xpath20/variables.xml"));
        NodeList variables = _vardoc.getDocumentElement().getChildNodes();
        for (int i = 0; i < variables.getLength(); ++i) {
View Full Code Here

    XPath20ExpressionCompilerBPEL20Draft compiler = new XPath20ExpressionCompilerBPEL20Draft();
    assertCompilationExceptionForEmptyXPath(compiler);
  }

  public void testEmptyXPath20StringBPEL20() throws Exception {
    XPath20ExpressionCompilerBPEL20 compiler = new XPath20ExpressionCompilerBPEL20();
    assertCompilationExceptionForEmptyXPath(compiler);
  }
View Full Code Here

    public void setUp() throws Exception {
        _vars = new HashMap<String, Node>();
        _cc = new MockCompilerContext();
        _runtime = new XPath20ExpressionRuntime();      
        _runtime.initialize(new HashMap());
        _compiler = new XPath20ExpressionCompilerBPEL20();
        _compiler.setCompilerContext(_cc);
       
        _vardoc = DOMUtils.parse(getClass().getResourceAsStream("/xpath20/variables.xml"));
        NodeList variables = _vardoc.getDocumentElement().getChildNodes();
        for (int i = 0; i < variables.getLength(); ++i) {
View Full Code Here

    XPath20ExpressionCompilerBPEL20Draft compiler = new XPath20ExpressionCompilerBPEL20Draft();
    assertCompilationExceptionForEmptyXPath(compiler);
  }

  public void testEmptyXPath20StringBPEL20() throws Exception {
    XPath20ExpressionCompilerBPEL20 compiler = new XPath20ExpressionCompilerBPEL20();
    assertCompilationExceptionForEmptyXPath(compiler);
  }
View Full Code Here

    public void setUp() throws Exception {
        _vars = new HashMap<String, Node>();
        _cc = new MockCompilerContext();
        _runtime = new XPath20ExpressionRuntime();
        _runtime.initialize(new HashMap());
        _compiler = new XPath20ExpressionCompilerBPEL20();
        _compiler.setCompilerContext(_cc);

        _vardoc = DOMUtils.parse(getClass().getResourceAsStream("/xpath20/variables.xml"));
        NodeList variables = _vardoc.getDocumentElement().getChildNodes();
        for (int i = 0; i < variables.getLength(); ++i) {
View Full Code Here

        XPath20ExpressionCompilerBPEL20Draft compiler = new XPath20ExpressionCompilerBPEL20Draft();
        assertCompilationExceptionForEmptyXPath(compiler);
    }

    public void testEmptyXPath20StringBPEL20() throws Exception {
        XPath20ExpressionCompilerBPEL20 compiler = new XPath20ExpressionCompilerBPEL20();
        assertCompilationExceptionForEmptyXPath(compiler);
    }
View Full Code Here

        XPath20ExpressionCompilerBPEL20Draft compiler = new XPath20ExpressionCompilerBPEL20Draft();
        assertCompilationExceptionForEmptyXPath(compiler);
    }

    public void testEmptyXPath20StringBPEL20() throws Exception {
        XPath20ExpressionCompilerBPEL20 compiler = new XPath20ExpressionCompilerBPEL20();
        assertCompilationExceptionForEmptyXPath(compiler);
    }
View Full Code Here

    public void setUp() throws Exception {
        _vars = new HashMap<String, Node>();
        _cc = new MockCompilerContext();
        _runtime = new XPath20ExpressionRuntime();      
        _runtime.initialize(new HashMap());
        _compiler = new XPath20ExpressionCompilerBPEL20();
        _compiler.setCompilerContext(_cc);
       
        _vardoc = DOMUtils.parse(getClass().getResourceAsStream("/xpath20/variables.xml"));
        NodeList variables = _vardoc.getDocumentElement().getChildNodes();
        for (int i = 0; i < variables.getLength(); ++i) {
View Full Code Here

    public void setUp() throws Exception {
        _vars = new HashMap<String, Node>();
        _cc = new MockCompilerContext();
        _runtime = new XPath20ExpressionRuntime();
        _runtime.initialize(new HashMap());
        _compiler = new XPath20ExpressionCompilerBPEL20();
        _compiler.setCompilerContext(_cc);

        _vardoc = DOMUtils.parse(getClass().getResourceAsStream("/xpath20/variables.xml"));
        NodeList variables = _vardoc.getDocumentElement().getChildNodes();
        for (int i = 0; i < variables.getLength(); ++i) {
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.elang.xpath20.runtime.MockCompilerContext

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.