コード例 #1
0
 @Test
 public void testResourcesClosedWhenNoIoes() {
   IOEThrowingHttpCommandProcessor cmdProc =
       new IOEThrowingHttpCommandProcessor("localhost", 4444, "*chrome", "http://www.google.com");
   try {
     cmdProc.getCommandResponseAsString("testCommand");
     cmdProc.verifyClosedResources(true, true, true);
   } catch (IOException ioe) {
     fail();
   }
 }
コード例 #2
0
 @Test
 public void testResourcesClosedWhenIoeOnGetConnection() {
   IOEThrowingHttpCommandProcessor cmdProc =
       new IOEThrowingHttpCommandProcessor("localhost", 4444, "*chrome", "http://www.google.com");
   cmdProc.throwIoeOnGetConnection = true;
   try {
     cmdProc.getCommandResponseAsString("testCommand");
     fail();
   } catch (IOException ioe) {
     cmdProc.verifyClosedResources(false, false, false);
   }
 }