if (getRequestCount() == -1)
{
container = DefaultServletContainerFactory.getInstance().getServletContainer();
if (container == null)
{
return new FailureResponse(Failure.createAssertionFailure("No servlet container present"));
}
// Register and save the deployed web apps
registry = new WebAppRegistry();
container.addWebAppListener(registry);
keys = new HashSet<String>(registry.getKeys());
// Deploy the application web app
return new DeployResponse("test-spi-app.war");
}
else if (getRequestCount() == 0)
{
FailureResponse failureResponse = checkDeployments("/test-spi-app", 1);
if (failureResponse != null)
{
return failureResponse;
}
else
{
// call service method
return new InvokeGetResponse("/test-spi-server");
}
}
else
{
return new FailureResponse(Failure.createAssertionFailure(""));
}
}