Search in sources :

Example 1 with StockQuoteSampleClient

use of org.apache.synapse.samples.framework.clients.StockQuoteSampleClient in project wso2-synapse by wso2.

the class HTTPHeaderCaseSensitivityTestCase method testHttpHeaderLowerCase.

/**
 * Test by adding a http header with all lowercase letters
 * @throws AxisFault
 */
public void testHttpHeaderLowerCase() throws AxisFault {
    StockQuoteSampleClient client = getStockQuoteClient();
    client.addHttpHeader("test_header", "lowercase");
    OMElement response = client.sendStandardQuoteRequest("http://localhost:8280/services/httpHeaderTestProxy", null, null, "WSO2", null);
    assertNotNull("Response message null", response);
    OMElement returnElement = response.getFirstElement();
    OMElement symbolElement = returnElement.getFirstChildWithName(new QName("http://services.samples/xsd", "symbol"));
    assertEquals("Fault, invalid response", "lowercase", symbolElement.getText());
}
Also used : QName(javax.xml.namespace.QName) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient) OMElement(org.apache.axiom.om.OMElement)

Example 2 with StockQuoteSampleClient

use of org.apache.synapse.samples.framework.clients.StockQuoteSampleClient in project wso2-synapse by wso2.

the class PropertyIntegrationAxis2ScopeTestCase method testDoubleVal.

public void testDoubleVal() throws Exception {
    StockQuoteSampleClient client = getStockQuoteClient();
    OMElement response = client.sendStandardQuoteRequest("http://localhost:8280/services/propertyDoubleAxis2TestProxy", null, null, "Random Symbol", null);
    assertTrue("Double Property Not Set in the Axis2 scope!", response.toString().contains("123123.123123"));
}
Also used : StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient) OMElement(org.apache.axiom.om.OMElement)

Example 3 with StockQuoteSampleClient

use of org.apache.synapse.samples.framework.clients.StockQuoteSampleClient in project wso2-synapse by wso2.

the class PropertyIntegrationAxis2ScopeTestCase method testBooleanVal.

public void testBooleanVal() throws Exception {
    StockQuoteSampleClient client = getStockQuoteClient();
    OMElement response = client.sendStandardQuoteRequest("http://localhost:8280/services/propertyBooleanAxis2TestProxy", null, null, "Random Symbol", null);
    assertTrue("Boolean Property Not Set in the Axis2 scope!", response.toString().contains("true"));
}
Also used : StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient) OMElement(org.apache.axiom.om.OMElement)

Example 4 with StockQuoteSampleClient

use of org.apache.synapse.samples.framework.clients.StockQuoteSampleClient in project wso2-synapse by wso2.

the class PropertyIntegrationAxis2ScopeTestCase method testOMVal.

public void testOMVal() throws Exception {
    StockQuoteSampleClient client = getStockQuoteClient();
    OMElement response = client.sendStandardQuoteRequest("http://localhost:8280/services/propertyOMAxis2TestProxy", null, null, "Random Symbol", null);
    assertTrue("OM Property Not Set in the Axis2 scope!", response.toString().contains("OMMMMM"));
}
Also used : StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient) OMElement(org.apache.axiom.om.OMElement)

Example 5 with StockQuoteSampleClient

use of org.apache.synapse.samples.framework.clients.StockQuoteSampleClient in project wso2-synapse by wso2.

the class PropertyIntegrationAxis2ScopeTestCase method testStringVal.

public void testStringVal() throws Exception {
    StockQuoteSampleClient client = getStockQuoteClient();
    OMElement response = client.sendStandardQuoteRequest("http://localhost:8280/services/propertyStringAxis2TestProxy", null, null, "Random Symbol", null);
    assertTrue("String Property Not Set in the Axis2 scope!", response.toString().contains("WSO2 Lanka"));
}
Also used : StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient) OMElement(org.apache.axiom.om.OMElement)

Aggregations

StockQuoteSampleClient (org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)99 SampleClientResult (org.apache.synapse.samples.framework.SampleClientResult)45 OMElement (org.apache.axiom.om.OMElement)23 AxisFault (org.apache.axis2.AxisFault)5 QName (javax.xml.namespace.QName)4 Axis2BackEndServerController (org.apache.synapse.samples.framework.Axis2BackEndServerController)1