Search in sources :

Example 46 with StockQuoteSampleClient

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

the class IterateSOAPActionTestCase method testSOAPAction.

public void testSOAPAction() throws Exception {
    String addUrl = "http://localhost:8280/services/iterateWithSOAPActionTestProxy";
    StockQuoteSampleClient client = getStockQuoteClient();
    SampleClientResult result = client.requestStandardQuote(addUrl, null, null, "WSO2", null);
    assertTrue("Client didn't get response", result.responseReceived());
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 47 with StockQuoteSampleClient

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

the class HTTPHeaderCaseSensitivityTestCase method testHttpHeaderUpperCase.

/**
 * Test by adding a http header with name "TEST_HEADER" where all the letters are in uppercase
 * @throws AxisFault
 */
public void testHttpHeaderUpperCase() throws AxisFault {
    StockQuoteSampleClient client = getStockQuoteClient();
    client.addHttpHeader("TEST_HEADER", "uppercase");
    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", "uppercase", symbolElement.getText());
}
Also used : QName(javax.xml.namespace.QName) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient) OMElement(org.apache.axiom.om.OMElement)

Example 48 with StockQuoteSampleClient

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

the class HTTPHeaderCaseSensitivityTestCase method testHttpHeaderCombined.

/**
 * Add a http header with name "test_header" where  the letters are in both upper & lower case
 * @throws AxisFault
 */
public void testHttpHeaderCombined() throws AxisFault {
    StockQuoteSampleClient client = getStockQuoteClient();
    client.addHttpHeader("Test_Header", "mixed");
    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", "mixed", symbolElement.getText());
}
Also used : QName(javax.xml.namespace.QName) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient) OMElement(org.apache.axiom.om.OMElement)

Example 49 with StockQuoteSampleClient

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

the class InLineLocalEntryXsltTransformationTestCase method testXsltTransformationInlineLocalEntry.

public void testXsltTransformationInlineLocalEntry() throws AxisFault {
    StockQuoteSampleClient client = getStockQuoteClient();
    OMElement response = client.sendCustomQuoteRequest("http://localhost:8280/services/xsltLocalEntryTestProxy", null, null, "IBM");
    assertNotNull("Response is null", response);
    assertTrue("Invalid response received", response.toString().contains("Code"));
    assertTrue("Invalid response received", response.toString().contains("IBM"));
}
Also used : StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient) OMElement(org.apache.axiom.om.OMElement)

Example 50 with StockQuoteSampleClient

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

the class XsltTransformationWithPropertyTestCase method testXsltTransformationWithProperty.

public void testXsltTransformationWithProperty() throws AxisFault {
    StockQuoteSampleClient client = getStockQuoteClient();
    OMElement response = client.sendCustomQuoteRequest("http://localhost:8280/services/xsltTransformPropertyTestProxy", null, null, "IBM");
    assertNotNull("Response is null", response);
    assertTrue("Response does not contain Code", response.toString().contains("Code"));
    assertTrue("Response does not contain WSO2", response.toString().contains("WSO2"));
}
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