Package org.apache.ode.bpel.evar.ExternalVariableModule

Examples of org.apache.ode.bpel.evar.ExternalVariableModule.Value


    @Test
    public void testInitWriteValue() throws Exception {
        testConfigure();
       
        Locator locator = new Locator("evar1",_pid,_iid);
        Value value = new Value(locator, _el1, null);
        value = _engine.writeValue(_varType, value);
        assertNotNull(value);
        assertNotNull(value.locator);
        System.out.println(DOMUtils.domToString(value.locator.reference));
        assertTrue(DOMUtils.domToString((Element)value.locator.reference).indexOf("id1")!=-1);
View Full Code Here


    @Test
    public void testWriteUpdate() throws Exception {
        testConfigure();
       
        Locator locator = new Locator("evar1",_pid,_iid);
        Value value = new Value(locator, _el1, null);
        value = _engine.writeValue(_varType, value);
        String domstr = DOMUtils.domToStringLevel2(value.value);
        Value newvalue = new Value(value.locator,DOMUtils.stringToDOM(domstr.replaceAll("<bar>bar</bar>", "<bar>boohoo</bar>")),null);
        _engine.writeValue(_varType, newvalue);
        QName qname = new QName("http://example.com", "bar");
        Value reread = _engine.readValue(qname, newvalue.locator);
        domstr = DOMUtils.domToString(reread.value);
        assertTrue(domstr.contains("boohoo"));
        assertFalse(domstr.contains(">bar<"));
    }
View Full Code Here

   
    @Test
    public void testRead() throws Exception {
        testConfigure();
        Locator locator = new Locator("evar1",_pid,_iid);
        Value value = new Value(locator, _el1, null);
        value = _engine.writeValue(_varType, value);
       
        Value readVal = _engine.readValue(_varType, value.locator);
       
        assertEquals(_iid,readVal.locator.iid);
        assertEquals(_pid,readVal.locator.pid);
        assertEquals(2, DOMUtils.countKids((Element)readVal.locator.reference, Node.ELEMENT_NODE));
        assertEquals(DOMUtils.domToString(value.locator.reference), DOMUtils.domToString(readVal.locator.reference));
View Full Code Here

        }
    }

    public Node readExtVar(Variable variable, Node reference) throws ExternalVariableModuleException {
        Value val = _bpelProcess.getEVM().read(variable, reference, _iid);
        return val.value;
    }
View Full Code Here

    }

    public ValueReferencePair writeExtVar(Variable variable, Node reference, Node value) throws ExternalVariableModuleException {
        ValueReferencePair vrp = new ValueReferencePair();

        Value val = _bpelProcess.getEVM().write(variable, reference, value, _iid);
        vrp.reference = val.locator.reference;
        vrp.value = val.value;

        return vrp;
    }
View Full Code Here

    @Test
    public void testInitWriteValue() throws Exception {
        testConfigure();

        Locator locator = new Locator("evar1",_pid,_iid);
        Value value = new Value(locator, _el1, null);
        value = _engine.writeValue(_varType, value);
        assertNotNull(value);
        assertNotNull(value.locator);
        System.out.println(DOMUtils.domToString(value.locator.reference));
        assertTrue(DOMUtils.domToString((Element)value.locator.reference).indexOf("id1")!=-1);
View Full Code Here

    @Test
    public void testWriteUpdate() throws Exception {
        testConfigure();

        Locator locator = new Locator("evar1",_pid,_iid);
        Value value = new Value(locator, _el1, null);
        value = _engine.writeValue(_varType, value);
        String domstr = DOMUtils.domToStringLevel2(value.value);
        Value newvalue = new Value(value.locator,DOMUtils.stringToDOM(domstr.replaceAll("<bar>bar</bar>", "<bar>boohoo</bar>")),null);
        _engine.writeValue(_varType, newvalue);
        QName qname = new QName("http://example.com", "bar");
        Value reread = _engine.readValue(qname, newvalue.locator);
        domstr = DOMUtils.domToString(reread.value);
        assertTrue(domstr.contains("boohoo"));
        assertFalse(domstr.contains(">bar<"));
    }
View Full Code Here

    @Test
    public void testRead() throws Exception {
        testConfigure();
        Locator locator = new Locator("evar1",_pid,_iid);
        Value value = new Value(locator, _el1, null);
        value = _engine.writeValue(_varType, value);

        Value readVal = _engine.readValue(_varType, value.locator);

        assertEquals(_iid,readVal.locator.iid);
        assertEquals(_pid,readVal.locator.pid);
        assertEquals(2, DOMUtils.countKids((Element)readVal.locator.reference, Node.ELEMENT_NODE));
        assertEquals(DOMUtils.domToString(value.locator.reference), DOMUtils.domToString(readVal.locator.reference));
View Full Code Here

        }
    }

    public Node readExtVar(Variable variable, Node reference) throws ExternalVariableModuleException {
        Value val = _bpelProcess.getEVM().read(variable, reference, _iid);
        return val.value;
    }
View Full Code Here

    }

    public ValueReferencePair writeExtVar(Variable variable, Node reference, Node value) throws ExternalVariableModuleException {
        ValueReferencePair vrp = new ValueReferencePair();
       
        Value val = _bpelProcess.getEVM().write(variable, reference, value, _iid);
        vrp.reference = val.locator.reference;
        vrp.value = val.value;
       
        return vrp;
    }
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.evar.ExternalVariableModule.Value

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.