Package com.squareup.okhttp.mockwebserver

Examples of com.squareup.okhttp.mockwebserver.MockWebServer.shutdown()


         RecordedRequest request = server.takeRequest();
         assertEquals(new String(request.getBody(), "UTF-8"), "foo");
         assertEquals(result, "fooPOST");
      } finally {
         close(client, true);
         server.shutdown();
      }
   }

   @Test
   public void testPostAsInputStreamDoesNotRetryOnFailure() throws Exception {
View Full Code Here


         fail("Request should have thrown an exception after a server error");
      } catch (Exception expected) {
         assertEquals(server.getRequestCount(), 1);
      } finally {
         close(client, true);
         server.shutdown();
      }
   }

   @Test
   public void testPostBinder() throws Exception {
View Full Code Here

         RecordedRequest request = server.takeRequest();
         assertEquals(new String(request.getBody(), "UTF-8"), "{\"key\":\"foo\"}");
         assertEquals(result, "fooPOSTJSON");
      } finally {
         close(client, true);
         server.shutdown();
      }
   }

   @Test
   public void testPostContentDisposition() throws Exception {
View Full Code Here

      } finally {
         if (payload != null) {
            payload.release();
         }
         close(client, true);
         server.shutdown();
      }
   }

   @Test
   public void testPostContentEncoding() throws Exception {
View Full Code Here

      } finally {
         if (payload != null) {
            payload.release();
         }
         close(client, true);
         server.shutdown();
      }
   }

   @Test
   public void testPostContentLanguage() throws Exception {
View Full Code Here

      } finally {
         if (payload != null) {
            payload.release();
         }
         close(client, true);
         server.shutdown();
      }
   }

   @Test
   public void testPut() throws Exception {
View Full Code Here

         RecordedRequest request = server.takeRequest();
         assertEquals(new String(request.getBody(), "UTF-8"), "foo");
         assertEquals(result, "fooPUT");
      } finally {
         close(client, true);
         server.shutdown();
      }
   }

   @Test
   public void testPutRedirect() throws Exception {
View Full Code Here

         request = redirectTarget.takeRequest();
         assertEquals(new String(request.getBody(), "UTF-8"), "foo");
      } finally {
         close(client, true);
         redirectTarget.shutdown();
         server.shutdown();
      }
   }

   @Test
   public void testZeroLengthPut() throws Exception {
View Full Code Here

         assertEquals(server.getRequestCount(), 1);
         RecordedRequest request = server.takeRequest();
         assertEquals(new String(request.getBody(), "UTF-8"), "");
      } finally {
         close(client, true);
         server.shutdown();
      }
   }

   @Test
   public void testPutIsRetriedOnFailure() throws Exception {
View Full Code Here

         assertEquals(new String(request.getBody(), "UTF-8"), "foo");
         request = server.takeRequest();
         assertEquals(new String(request.getBody(), "UTF-8"), "foo");
      } finally {
         close(client, true);
         server.shutdown();
      }
   }

   @Test
   public void testHead() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.