157158159160161162163164165166167
int status = client.executeMethod(method); Assert.assertEquals(status, HttpResponseCodes.SC_NOT_ACCEPTABLE); } catch (IOException e) { method.releaseConnection(); throw new RuntimeException(e); } method.releaseConnection(); }
160161162163164165166167168169170
catch (IOException e) { method.releaseConnection(); throw new RuntimeException(e); } method.releaseConnection(); } @Test public void testNoContentPost() {
176177178179180181182183184185186
int status = client.executeMethod(method); Assert.assertEquals(status, HttpResponseCodes.SC_NO_CONTENT); } catch (IOException e) { method.releaseConnection(); throw new RuntimeException(e); } method.releaseConnection(); }
179180181182183184185186187188189
catch (IOException e) { method.releaseConnection(); throw new RuntimeException(e); } method.releaseConnection(); } @Test public void testNoContent() {
214215216217218219220221222223224
int status = client.executeMethod(method); Assert.assertEquals(status, HttpResponseCodes.SC_UNSUPPORTED_MEDIA_TYPE); } catch (IOException e) { method.releaseConnection(); throw new RuntimeException(e); } method.releaseConnection(); }
217218219220221222223224225226
catch (IOException e) { method.releaseConnection(); throw new RuntimeException(e); } method.releaseConnection(); } }
177178179180181182183184185186187
httpClient.executeMethod(meth); String body = meth.getResponseBodyAsString(); Assert.assertEquals("Hello", body); meth.releaseConnection(); server.close(); }
139140141142143144145146
httpClient.executeMethod(postMethod); Assert.assertEquals(200, postMethod.getStatusCode()); Assert.assertTrue(QAUtil.isEquals(file, postMethod.getResponseBody())); postMethod.releaseConnection(); } }