Java Code Examples for org.wso2.carbon.automation.test.utils.axis2client.AxisServiceClient#fireAndForget()

The following examples show how to use org.wso2.carbon.automation.test.utils.axis2client.AxisServiceClient#fireAndForget() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.STANDALONE })
@Test(groups = "wso2.esb", description = "<property name=\"RETRY_ON_SOAPFAULT\" value=\"false\"/>")
public void testRetryOnSOAPFaultWithInOutFalse() throws Exception {

    loadESBConfigurationFromClasspath(
            File.separator + "artifacts" + File.separator + "ESB" + File.separator + "synapseconfig"
                    + File.separator + "processor" + File.separator + "forwarding" + File.separator
                    + "Retry_On_SOAPFault_In_Out.xml");

    AxisServiceClient serviceClient = new AxisServiceClient();
    serviceClient.fireAndForget(clearCountRequest(), getBackEndServiceUrl(), "clearRequestCount");
    OMElement requestCount = serviceClient
            .sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
    Assert.assertEquals(requestCount.getFirstElement().getText(), "0", "Request Cunt not clear");

    serviceClient.sendRobust(getThrowAxisFaultRequest(), getMainSequenceURL(), "urn:throwAxisFault");
    Thread.sleep(5000);
    requestCount = serviceClient.sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
    Assert.assertEquals(requestCount.getFirstElement().getText(), "1",
            "Request Count mismatched. Sent more than one request");

}
 
Example 2
public void testRetryOnSOAPFaultWithInOutTrue() throws Exception {

        loadESBConfigurationFromClasspath(
                File.separator + "artifacts" + File.separator + "ESB" + File.separator + "synapseconfig"
                        + File.separator + "processor" + File.separator + "forwarding" + File.separator
                        + "Retry_On_SOAPFault_true_In_Out.xml");

        AxisServiceClient serviceClient = new AxisServiceClient();
        serviceClient.fireAndForget(clearCountRequest(), getBackEndServiceUrl(), "clearRequestCount");
        OMElement requestCount = serviceClient
                .sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
        Assert.assertEquals(requestCount.getFirstElement().getText(), "0", "Request Cunt not clear");

        serviceClient.sendRobust(getThrowAxisFaultRequest(), getMainSequenceURL(), "throwAxisFault");
        Thread.sleep(5000);
        requestCount = serviceClient.sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
        Assert.assertEquals(requestCount.getFirstElement().getText(), "5",
                "Request Count mismatched. Not sent all request");

    }
 
Example 3
@SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
@Test(groups = "wso2.esb", description = "<property name=\"RETRY_ON_SOAPFAULT\" value=\"false\"/>")
public void testRetryOnSOAPFaultWithInOutFalse() throws Exception {

    loadESBConfigurationFromClasspath(File.separator + "artifacts" + File.separator + "ESB" + File.separator
                                      + "synapseconfig" + File.separator + "processor" + File.separator +
                                      "forwarding" + File.separator + "Retry_On_SOAPFault_In_Out.xml");

    AxisServiceClient serviceClient = new AxisServiceClient();
    serviceClient.fireAndForget(clearCountRequest(), getBackEndServiceUrl(), "clearRequestCount");
    OMElement requestCount = serviceClient.sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
    Assert.assertEquals(requestCount.getFirstElement().getText(), "0", "Request Cunt not clear");

    serviceClient.sendRobust(getThrowAxisFaultRequest(), getMainSequenceURL(), "urn:throwAxisFault");
    Thread.sleep(5000);
    requestCount = serviceClient.sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
    Assert.assertEquals(requestCount.getFirstElement().getText(), "1", "Request Count mismatched. Sent more than one request");

}
 
Example 4
public void testRetryOnSOAPFaultWithInOutTrue() throws Exception {

        loadESBConfigurationFromClasspath(File.separator + "artifacts" + File.separator + "ESB" + File.separator
                                          + "synapseconfig" + File.separator + "processor" + File.separator +
                                          "forwarding" + File.separator + "Retry_On_SOAPFault_true_In_Out.xml");

        AxisServiceClient serviceClient = new AxisServiceClient();
        serviceClient.fireAndForget(clearCountRequest(), getBackEndServiceUrl(), "clearRequestCount");
        OMElement requestCount = serviceClient.sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
        Assert.assertEquals(requestCount.getFirstElement().getText(), "0", "Request Cunt not clear");

        serviceClient.sendRobust(getThrowAxisFaultRequest(), getMainSequenceURL(), "throwAxisFault");
        Thread.sleep(5000);
        requestCount = serviceClient.sendReceive(getCountRequest(), getBackEndServiceUrl(), "getRequestCount");
        Assert.assertEquals(requestCount.getFirstElement().getText(), "5", "Request Count mismatched. Not sent all request");

    }