Search in sources :

Example 26 with StockQuoteSampleClient

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

the class Sample253 method testPlaceOrder.

public void testPlaceOrder() throws Exception {
    Axis2BackEndServerController axis2Server = getAxis2Server();
    if (axis2Server == null) {
        fail("Failed to load the Axis2BackEndServerController");
    }
    assertEquals("Invalid message count at the backend", 0, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder"));
    String trpUrl = "http://localhost:8280/services/OneWayProxy";
    StockQuoteSampleClient client = getStockQuoteClient();
    client.placeOrder(null, trpUrl, null, "IBM");
    boolean expectedMessageCountReceived = SynapseTestUtils.waitForMessageCount(axis2Server, "SimpleStockQuoteService", "placeOrder", 1, 2000);
    assertTrue("Backend service not received the expected message count", expectedMessageCountReceived);
}
Also used : Axis2BackEndServerController(org.apache.synapse.samples.framework.Axis2BackEndServerController) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 27 with StockQuoteSampleClient

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

the class Sample3 method testLocalEntriesReusableEndPointsSequences.

public void testLocalEntriesReusableEndPointsSequences() {
    String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
    String trpUrl = "http://localhost:8280";
    StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Local Registry entry definitions, reusable endpoints and sequences");
    SampleClientResult result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM", null);
    assertResponseReceived(result);
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 28 with StockQuoteSampleClient

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

the class Sample6 method testManipulatingHeadersAndFiltering.

public void testManipulatingHeadersAndFiltering() {
    String trpUrl = "http://localhost:8280/";
    StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Dumb Client mode  ");
    SampleClientResult result = client.requestStandardQuote(null, trpUrl, null, null, null);
    assertResponseReceived(result);
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 29 with StockQuoteSampleClient

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

the class Sample8 method testRegistryAndXSLTMediator.

public void testRegistryAndXSLTMediator() {
    String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
    String trpUrl = "http://localhost:8280/";
    StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Introduction to static and dynamic registry resources, and using XSLT transformations");
    SampleClientResult result = client.requestCustomQuote(addUrl, trpUrl, null, "IBM");
    assertResponseReceived(result);
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 30 with StockQuoteSampleClient

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

the class Sample751 method testSplitAggregate.

public void testSplitAggregate() throws Exception {
    String addUrl = "http://localhost:8280/services/SplitAggregateProxy";
    StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Message Split Aggregate Using Templates");
    SampleClientResult result = client.requestStandardQuote(addUrl, null, null, "IBM", null);
    assertTrue("Invalid result received", result.responseReceived());
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

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