Search in sources :

Example 11 with SampleClientResult

use of org.apache.synapse.samples.framework.SampleClientResult 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 12 with SampleClientResult

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

the class Sample51 method testSWAOptimization.

public void testSWAOptimization() {
    String ep = "http://localhost:8280/services/MTOMSwASampleService";
    String currentLocation = System.getProperty("user.dir") + File.separator;
    String filename = FilenameUtils.normalize(currentLocation + "repository/conf/sample/resources/mtom/asf-logo.gif");
    MTOMSwASampleClient client = getMTOMSwASampleClient();
    log.info("Running test:SwA optimization and request/response correlation ");
    SampleClientResult result = client.sendUsingSWA(filename, ep);
    assertResponseReceived(result);
}
Also used : MTOMSwASampleClient(org.apache.synapse.samples.framework.clients.MTOMSwASampleClient) SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult)

Example 13 with SampleClientResult

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

the class Sample51 method testMTOMOptimization.

public void testMTOMOptimization() {
    String ep = "http://localhost:8280/services/MTOMSwASampleService";
    String currentLocation = System.getProperty("user.dir") + File.separator;
    String filename = FilenameUtils.normalize(currentLocation + "repository/conf/sample/resources/mtom/asf-logo.gif");
    MTOMSwASampleClient client = getMTOMSwASampleClient();
    log.info("Running test: MTOM optimization and request/response correlation ");
    SampleClientResult result = client.sendUsingMTOM(filename, ep);
    assertResponseReceived(result);
}
Also used : MTOMSwASampleClient(org.apache.synapse.samples.framework.clients.MTOMSwASampleClient) SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult)

Example 14 with SampleClientResult

use of org.apache.synapse.samples.framework.SampleClientResult 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 15 with SampleClientResult

use of org.apache.synapse.samples.framework.SampleClientResult 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)

Aggregations

SampleClientResult (org.apache.synapse.samples.framework.SampleClientResult)64 StockQuoteSampleClient (org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)45 OMElement (org.apache.axiom.om.OMElement)5 AxisFault (org.apache.axis2.AxisFault)5 QName (javax.xml.namespace.QName)4 File (java.io.File)2 FileOutputStream (java.io.FileOutputStream)2 DataHandler (javax.activation.DataHandler)2 FileDataSource (javax.activation.FileDataSource)2 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)2 EndpointReference (org.apache.axis2.addressing.EndpointReference)2 OperationClient (org.apache.axis2.client.OperationClient)2 Options (org.apache.axis2.client.Options)2 ServiceClient (org.apache.axis2.client.ServiceClient)2 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)2 MessageContext (org.apache.axis2.context.MessageContext)2 MTOMSwASampleClient (org.apache.synapse.samples.framework.clients.MTOMSwASampleClient)2 BufferedOutputStream (java.io.BufferedOutputStream)1 InputStream (java.io.InputStream)1 Attachments (org.apache.axiom.attachments.Attachments)1