use of org.apache.synapse.samples.framework.clients.StockQuoteSampleClient in project wso2-synapse by wso2.
the class Sample364 method testExecuteStoredProcedures.
public void testExecuteStoredProcedures() {
String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
String trpUrl = "http://localhost:8280/";
StockQuoteSampleClient client = getStockQuoteClient();
log.info("Running test: Using Mediators to Execute Database Stored Procedures");
SampleClientResult result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM", null);
assertTrue("Client did not get run successfully ", result.responseReceived());
}
use of org.apache.synapse.samples.framework.clients.StockQuoteSampleClient in project wso2-synapse by wso2.
the class Sample1 method testDumbClientMode.
public void testDumbClientMode() {
String trpUrl = "http://localhost:8280/services/StockQuote";
StockQuoteSampleClient client = getStockQuoteClient();
log.info("Running test: Dumb Client mode");
SampleClientResult result = client.requestStandardQuote(null, trpUrl, null, "IBM", null);
assertResponseReceived(result);
}
use of org.apache.synapse.samples.framework.clients.StockQuoteSampleClient in project wso2-synapse by wso2.
the class Sample371 method testRestrictedThrottling.
public void testRestrictedThrottling() {
String addUrl = "http://localhost:8280/";
String expectedError = "Access Denied";
StockQuoteSampleClient client = getStockQuoteClient();
log.info("Running test: Restricting requests based on policies ");
for (int i = 0; i < 4; i++) {
result = client.requestStandardQuote(addUrl, null, null, "IBM", null);
}
assertTrue("Client did not get run successfully ", result.responseReceived());
result = client.requestStandardQuote(addUrl, null, null, "IBM", null);
assertFalse("Should not get a response", result.responseReceived());
Exception resultEx = result.getException();
assertNotNull("Did not receive expected error", resultEx);
log.info("Got an error as expected: " + resultEx.getMessage());
assertTrue("Did not receive expected error", resultEx instanceof AxisFault);
assertTrue("Did not receive expected error", resultEx.getMessage().indexOf(expectedError) != -1);
}
use of org.apache.synapse.samples.framework.clients.StockQuoteSampleClient in project wso2-synapse by wso2.
the class Sample380 method testCustomMediator.
public void testCustomMediator() {
String addUrl = "http://localhost:8280/";
StockQuoteSampleClient client = getStockQuoteClient();
log.info("Running test: Demonstrate the use of Class mediator to extend the mediation functionality");
result = client.requestStandardQuote(addUrl, null, null, "IBM", null);
assertTrue("Client did not get run successfully ", result.responseReceived());
}
use of org.apache.synapse.samples.framework.clients.StockQuoteSampleClient in project wso2-synapse by wso2.
the class Sample391 method testExternalXQuery.
public void testExternalXQuery() {
String addUrl = "http://localhost:8280/services/StockQuoteProxy";
StockQuoteSampleClient client = getStockQuoteClient();
log.info("Running test: How to use the data from an external XML document with in XQuery ");
result = client.requestStandardQuote(addUrl, null, null, "IBM", null);
assertTrue("Client did not get run successfully ", result.responseReceived());
}
Aggregations