public void testResourcesClosedWhenIoeOnGetOutputStream() { IOEThrowingHttpCommandProcessor cmdProc = new IOEThrowingHttpCommandProcessor( "localhost", 4444, "*chrome", "http://www.google.com"); cmdProc.throwIoeOnGetOutputStream = true; try { String response = cmdProc.getCommandResponseAsString("testCommand"); fail(); } catch (IOException ioe) { cmdProc.verifyClosedResources(true, false, false); } }
public void testResourcesClosedWhenIoeOnGetConnection() { IOEThrowingHttpCommandProcessor cmdProc = new IOEThrowingHttpCommandProcessor( "localhost", 4444, "*chrome", "http://www.google.com"); cmdProc.throwIoeOnGetConnection = true; try { String response = cmdProc.getCommandResponseAsString("testCommand"); fail(); } catch (IOException ioe) { cmdProc.verifyClosedResources(false, false, false); } }
public void testResourcesClosedWhenNoIoes() { IOEThrowingHttpCommandProcessor cmdProc = new IOEThrowingHttpCommandProcessor( "localhost", 4444, "*chrome", "http://www.google.com"); try { String response = cmdProc.getCommandResponseAsString("testCommand"); cmdProc.verifyClosedResources(true, true, true); } catch (IOException ioe) { fail(); } }
public void testResourcesClosedWhenIoeOnGetInputStream() { IOEThrowingHttpCommandProcessor cmdProc = new IOEThrowingHttpCommandProcessor( "localhost", 4444, "*chrome", "http://www.google.com"); cmdProc.throwIoeOnGetInputStream = true; try { String response = cmdProc.getCommandResponseAsString("testCommand"); fail(); } catch (IOException ioe) { cmdProc.verifyClosedResources(true, true, false); } }