public void testSynapseAsHTTPProxy() { String addUrl = "http://localhost:9000/services/SimpleStockQuoteService"; String prxUrl = "http://localhost:8280/"; log.info("Running test: Using Synapse as a HTTP Proxy"); SampleClientResult result = client.requestStandardQuote(addUrl, null, prxUrl, "IBM", null); assertResponseReceived(result); }
public void testSmartClientMode() { String addUrl = "http://localhost:9000/services/SimpleStockQuoteService"; String trpUrl = "http://localhost:8280/"; log.info("Running test: Smart Client mode"); SampleClientResult result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM", null); assertResponseReceived(result); }
public void testScriptMediationWithInLineRuby() { String addUrl = "http://localhost:9000/services/SimpleStockQuoteService"; String trpUrl = "http://localhost:8280/"; log.info("Running test: Using In-lined Ruby scripts for mediation"); result = client.requestCustomQuote(addUrl, trpUrl, null, "IBM"); assertTrue("Client did not get run successfully ", result.responseReceived()); }
public void testErrorHandling() { String addUrl = "http://localhost:9000/services/SimpleStockQuoteService"; String trpUrl = "http://localhost:8280"; log.info("Running test: Introduction to error handling"); SampleClientResult result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM", null); assertResponseReceived(result); result = client.requestStandardQuote(addUrl, trpUrl, null, "MSFT", null); assertFalse("Must 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); result = client.requestStandardQuote(addUrl, trpUrl, null, "SUN", null); assertFalse("Must not get a response", result.responseReceived()); Exception resultEx2 = result.getException(); assertNotNull("Did not receive expected error", resultEx); log.info("Got an error as expected: " + resultEx.getMessage()); assertTrue("Did not receive expected error", resultEx2 instanceof AxisFault); }
public void testSessionFullLB() { String addUrl = "http://localhost:8280/services/LBService1"; log.info("Running test: Session affinity load balancing between 3 endpoints"); SampleClientResult result = client.statefulClient(addUrl, null, 100); assertResponseReceived(result); }