Search in sources :

Example 16 with StockQuoteSampleClient

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

the class Sample59 method testSessionLessLB.

public void testSessionLessLB() {
    String addUrl = "http://localhost:8280/services/LBService1";
    log.info("Running test: Weighted load balancing between 3 endpoints");
    StockQuoteSampleClient client = getStockQuoteClient();
    SampleClientResult result = client.sessionlessClient(addUrl, null, 100);
    assertResponseReceived(result);
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 17 with StockQuoteSampleClient

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

the class Sample19 method testPayloadFactoryMediator.

public void testPayloadFactoryMediator() {
    String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
    String trpUrl = "http://localhost:8280/";
    StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Transforming message content with Payload Factory mediator");
    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 18 with StockQuoteSampleClient

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

the class Sample251 method testPlaceOrder.

public void testPlaceOrder() throws Exception {
    Axis2BackEndServerController axis2Server = getAxis2Server();
    if (axis2Server == null) {
        fail("Failed to load the Axis2BackEndServerController");
    }
    assertEquals(0, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder"));
    StockQuoteSampleClient client = getStockQuoteClient();
    String trpUrl = "http://localhost:8280/services/StockQuoteProxy";
    SampleClientResult result = client.placeOrder(null, trpUrl, null, "IBM");
    assertResponseReceived(result);
    Thread.sleep(2000);
    assertEquals(1, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder"));
}
Also used : StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 19 with StockQuoteSampleClient

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

the class Sample152 method testTransportAndFormatSwitching.

public void testTransportAndFormatSwitching() {
    String url2 = "https://localhost:8243/services/StockQuoteProxy";
    String trustStore = FilenameUtils.normalize(System.getProperty("user.dir") + "/modules/integration/src/test/resources/trust.jks");
    System.setProperty("javax.net.ssl.trustStore", trustStore);
    StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Switching transports and message format from SOAP to REST/POX");
    SampleClientResult result2 = client.requestStandardQuote(null, url2, null, "IBM", null);
    assertTrue("Client did not a response with https ", result2.responseReceived());
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 20 with StockQuoteSampleClient

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

the class Sample154 method testSessionFullLB.

public void testSessionFullLB() {
    String trpUrl = "http://localhost:8280/services/LBProxy";
    log.info("Running test: Load Balancing with Proxy Services ");
    StockQuoteSampleClient client = getStockQuoteClient();
    SampleClientResult result = client.statefulClient(null, trpUrl, 100);
    assertTrue("Client did not run successfully ", 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