Search in sources :

Example 11 with StockQuoteSampleClient

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

the class XsltTransformationFromUrlTestCase method testXsltTransformationFromUrl.

public void testXsltTransformationFromUrl() throws AxisFault {
    StockQuoteSampleClient client = getStockQuoteClient();
    OMElement response = client.sendCustomQuoteRequest("http://localhost:8280/services/xsltInUrlTestProxy", 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 12 with StockQuoteSampleClient

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

the class Sample752 method testLoadBalancingWithEndpointTemplates.

public void testLoadBalancingWithEndpointTemplates() {
    String trpUrl = "http://localhost:8280/services/LBProxy";
    log.info("Running test: Load Balancing with Endpoint Templates");
    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)

Example 13 with StockQuoteSampleClient

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

the class Sample17 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 14 with StockQuoteSampleClient

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

the class Sample363 method testReusableConnectionPools.

public void testReusableConnectionPools() {
    String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
    String trpUrl = "http://localhost:8280/";
    StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Reusable Database Connection Pools");
    SampleClientResult result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM", null);
    assertTrue("Client did not get run successfully ", result.responseReceived());
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 15 with StockQuoteSampleClient

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

the class Sample57 method testDynamicLB.

public void testDynamicLB() {
    final String addUrl = "http://localhost:8280/services/LBService1";
    final StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Dynamic load balancing between 3 nodes");
    try {
        Thread.sleep(3000);
    } catch (InterruptedException e) {
    }
    Thread t = new Thread(new Runnable() {

        public void run() {
            result = client.sessionlessClient(addUrl, null, 500);
        }
    });
    t.start();
    try {
        t.join();
    } catch (InterruptedException e) {
    }
    assertResponseReceived(result);
}
Also used : 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