Search in sources :

Example 21 with MediatorProperty

use of org.apache.synapse.mediators.MediatorProperty in project wso2-synapse by wso2.

the class PropertyMediatorTest method testMediatorPropertiesLiteral.

/**
 * property being searched does not exist in context, and lookup should go up into the config
 * @throws Exception
 */
/*TODO ACP public void testSetAndReadGlobalProperty() throws Exception {

        MessageContext synCtx = TestUtils.getTestContext("<empty/>");

        SynapseConfiguration synCfg = new SynapseConfiguration();
        Entry prop = new Entry();
        prop.setKey("name");
        prop.setType(Entry.VALUE_TYPE);
        prop.setValue("value");
        synCfg.addEntry("name", prop);
        synCtx.setConfiguration(synCfg);

        assertTrue(
            "value".equals(Axis2MessageContext.getStringValue(
                new SynapseXPath("synapse:get-property('name')"), synCtx)));
    }*/
public void testMediatorPropertiesLiteral() throws Exception {
    MediatorProperty medProp = new MediatorProperty();
    medProp.setName("name");
    medProp.setValue("value");
    assertTrue("value".equals(medProp.getValue()));
}
Also used : MediatorProperty(org.apache.synapse.mediators.MediatorProperty)

Aggregations

MediatorProperty (org.apache.synapse.mediators.MediatorProperty)21 OMElement (org.apache.axiom.om.OMElement)8 SynapseException (org.apache.synapse.SynapseException)8 ArrayList (java.util.ArrayList)5 Endpoint (org.apache.synapse.endpoints.Endpoint)4 AddressEndpoint (org.apache.synapse.endpoints.AddressEndpoint)3 SynapseXPath (org.apache.synapse.util.xpath.SynapseXPath)3 Test (org.junit.Test)3 Iterator (java.util.Iterator)2 QName (javax.xml.namespace.QName)2 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)2 OMAttribute (org.apache.axiom.om.OMAttribute)2 PropertyInclude (org.apache.synapse.PropertyInclude)2 Axis2MessageContext (org.apache.synapse.core.axis2.Axis2MessageContext)2 LoadbalanceEndpoint (org.apache.synapse.endpoints.LoadbalanceEndpoint)2 Value (org.apache.synapse.mediators.Value)2 UriTemplate (com.damnhandy.uri.template.UriTemplate)1 ExpressionParseException (com.damnhandy.uri.template.impl.ExpressionParseException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1