private static int WEBAPP_DEPLOYMENT_DELAY = 90 * 1000;
public static boolean isWebApplicationDeployed(String backEndUrl, String sessionCookie,
String webAppFileName) throws Exception {
log.info("waiting " + WEBAPP_DEPLOYMENT_DELAY + " millis for Service deployment " + webAppFileName);
WebAppAdminClient webAppAdminClient = new WebAppAdminClient(backEndUrl, sessionCookie);
List<String> webAppList;
List<String> faultyWebAppList;
String webAppName = webAppFileName + ".war";
boolean isWebAppDeployed = false;
Calendar startTime = Calendar.getInstance();
long time;
while ((time = (Calendar.getInstance().getTimeInMillis() - startTime.getTimeInMillis())) < WEBAPP_DEPLOYMENT_DELAY) {
webAppList = webAppAdminClient.getWebApplist(webAppFileName);
faultyWebAppList = webAppAdminClient.getFaultyWebAppList(webAppFileName);
for (String faultWebAppName : faultyWebAppList) {
if (webAppName.equalsIgnoreCase(faultWebAppName)) {
isWebAppDeployed = false;
log.info(webAppFileName + "- Web Application is faulty");