Exemplo n.º 1
0
  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);
  }
Exemplo n.º 2
0
  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);
  }
Exemplo n.º 3
0
  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());
  }
Exemplo n.º 4
0
  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);
  }
Exemplo n.º 5
0
 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);
 }