String searchString, String containedExceptionName, String containedExceptionText) throws SmartFrogException, RemoteException, UnknownHostException, SFGeneralSecurityException {  startSmartFrog(); ConfigurationDescriptor cfgDesc = createDeploymentConfigurationDescriptor(appName, testURL);  Object deployedApp = null; Throwable resultException = null; try {   deployedApp = SFSystem.runConfigurationDescriptor(cfgDesc,false); if ((deployedApp instanceof ConfigurationDescriptor) && (((ConfigurationDescriptor) deployedApp).resultException != null)) { searchForExpectedExceptions(deployedApp, cfgDesc, exceptionName, searchString, containedExceptionName,containedExceptionText); resultException = ((ConfigurationDescriptor) deployedApp).resultException; return resultException; } else {  if(deployedApp instanceof Prim) { terminateApplication((Prim)deployedApp); }  fail("We expected an exception here:"+exceptionName +" but got this deployment "+deployedApp.toString()); } } catch (Exception fault) { fail(fault.toString()); } return null;
String searchString) throws RemoteException, SmartFrogException, SFGeneralSecurityException, UnknownHostException { return deployExpectingException(testURL, appName, exceptionName, searchString, null, null);
    protected Throwable deployExpectingException(String testURL,                                            String appName,                                            String exceptionName,                                            String searchString,                                            String containedExceptionName,                                            String containedExceptionText) throws SmartFrogException,            RemoteException, UnknownHostException, SFGeneralSecurityException {        startSmartFrog();        ConfigurationDescriptor cfgDesc =                createDeploymentConfigurationDescriptor(appName, testURL);        Object deployedApp = null;        Throwable resultException = null;        try {            //Deploy and don't throw exception. Exception will be contained            // in a ConfigurationDescriptor.            deployedApp = SFSystem.runConfigurationDescriptor(cfgDesc,false);            if ((deployedApp instanceof ConfigurationDescriptor) &&                    (((ConfigurationDescriptor) deployedApp).resultException != null)) {                searchForExpectedExceptions(deployedApp, cfgDesc, exceptionName,                        searchString, containedExceptionName,containedExceptionText);                resultException = ((ConfigurationDescriptor) deployedApp).resultException;                return resultException;            } else {                //clean up                if(deployedApp instanceof Prim) {                    terminateApplication((Prim)deployedApp);                }                //then fail                fail("We expected an exception here:"+exceptionName                     +" but got this deployment "+deployedApp.toString());            }         } catch (Exception fault) {            fail(fault.toString());         }        return null;    }