コード例 #1
0
 @Test
 public void statusCode200FromURL() throws Exception {
   FileDownloader downloadHandler = new FileDownloader(driver);
   downloadHandler.setURI(downloadURI200.toURL());
   downloadHandler.setHTTPRequestMethod(RequestMethod.GET);
   assertThat(downloadHandler.getLinkHTTPStatus(), is(equalTo(200)));
 }
コード例 #2
0
 @Test
 public void statusCode405FromURLUsingDelete() throws Exception {
   FileDownloader downloadHandler = new FileDownloader(driver);
   downloadHandler.setURI(downloadURI200.toURL());
   downloadHandler.setHTTPRequestMethod(RequestMethod.DELETE);
   assertThat(downloadHandler.getLinkHTTPStatus(), is(equalTo(405)));
 }
コード例 #3
0
 @Test
 public void statusCode404FromString() throws Exception {
   FileDownloader downloadHandler = new FileDownloader(driver);
   downloadHandler.setURI(webServerURL + ":" + webServerPort + "/doesNotExist.html");
   downloadHandler.setHTTPRequestMethod(RequestMethod.GET);
   assertThat(downloadHandler.getLinkHTTPStatus(), is(equalTo(404)));
 }
コード例 #4
0
 @Test
 public void statusCode404FromURLUsingHead() throws Exception {
   FileDownloader downloadHandler = new FileDownloader(driver);
   downloadHandler.setURI(downloadURI404.toURL());
   downloadHandler.setHTTPRequestMethod(RequestMethod.HEAD);
   assertThat(downloadHandler.getLinkHTTPStatus(), is(equalTo(404)));
 }