Examples of header()


Examples of org.jboss.resteasy.client.ClientRequest.header()

         Assert.assertNotNull(etag);
         Assert.assertEquals(response.getEntity(), "plain" + 1);
      }
      {
         ClientRequest request = new ClientRequest(generateURL("/cache/accepts"));
         request.header(HttpHeaders.ACCEPT, "text/plain;q=0.5, text/html");
         ClientResponse<String> response = request.get(String.class);
         Assert.assertEquals(200, response.getStatus());
         String cc = response.getHeaders().getFirst(HttpHeaders.CACHE_CONTROL);
         Assert.assertNotNull(cc);
         etag = response.getHeaders().getFirst(HttpHeaders.ETAG);
View Full Code Here

Examples of org.jboss.resteasy.client.ClientRequest.header()

      }

      // we test that the preferred can be handled
      {
         ClientRequest request = new ClientRequest(generateURL("/cache/accepts"));
         request.header(HttpHeaders.ACCEPT, "text/plain;q=0.5, text/html");
         ClientResponse<String> response = request.get(String.class);
         Assert.assertEquals(200, response.getStatus());
         String cc = response.getHeaders().getFirst(HttpHeaders.CACHE_CONTROL);
         Assert.assertNotNull(cc);
         etag = response.getHeaders().getFirst(HttpHeaders.ETAG);
View Full Code Here

Examples of org.jboss.resteasy.mock.MockHttpRequest.header()

  private void assertCharset(String path) throws URISyntaxException {
    for (String characterSet : characterSets) {
      MockHttpRequest request = MockHttpRequest.get(path);
      request.accept("application/xml");
      request.header("Accept-Charset", characterSet);
   
      MockHttpResponse response = new MockHttpResponse();
      dispatcher.invoke(request, response);
      assertEquals("Status code.", 200, response.getStatus());
View Full Code Here

Examples of org.jsoup.Connection.Response.header()

                    .cookies(resp.cookies())
                    .method(Method.POST)
                    .response();

        // Assert we are logged in
        if (resp.hasHeader("Location") && resp.header("Location").contains("password")) {
            // Wrong password
            throw new IOException("Wrong password");
        }
        if (resp.url().toExternalForm().contains("bad_form")) {
            throw new IOException("Login form was incorrectly submitted");
View Full Code Here

Examples of org.kie.remote.common.rest.KieRemoteHttpRequest.header()

    private <T> T executeRestCommand( Command command ) {
        JaxbCommandsRequest jaxbRequest = prepareCommandRequest(command);
        KieRemoteHttpRequest httpRequest = config.createHttpRequest().relativeRequest("/execute");
       
        // necessary for deserialization
        httpRequest.header(JaxbSerializationProvider.EXECUTE_DEPLOYMENT_ID_HEADER, config.getDeploymentId());

        String jaxbRequestString = config.getJaxbSerializationProvider().serialize(jaxbRequest);
        if( logger.isTraceEnabled() ) {
            try {
                logger.trace("Sending {} via POST to {}", command.getClass().getSimpleName(), httpRequest.getUri());
View Full Code Here

Examples of org.seleniuminspector.html.TableInspector.header()

     @Test
    public void testColumnGroups_headers() {
        testAppFunctionalPage("/components/datatable/dataTableColumnGroups.jsf");
        TableInspector table = dataTable("formID:twoHeadersTable");

        TableSectionInspector header = table.header();
        TableRowInspector firstHeaderRow = header.row(0);
        firstHeaderRow.assertCellParams(new TableCellParams[]{
                new TableCellParams(NBSP_CHAR, 1, 2,
                        "border-right: 1px solid #a0a0a0; border-bottom: 1px solid #a0a0a0"),
                new TableCellParams("String Fields", 4, 1,
View Full Code Here

Examples of org.springframework.yarn.support.console.ApplicationsReport.SubmittedReportBuilder.header()

    } else {
      builder.from(client.listRunningApplications(type));
    }
    if (headers != null) {
      for (Entry<String, String> entry : headers.entrySet()) {
        builder.header(entry.getKey(), entry.getValue());
      }
    }
    return builder.build().toString();
  }
View Full Code Here

Examples of org.webbitserver.stub.StubHttpRequest.header()

    @Test
    public void shouldSupportUnboundedEndRangeRequests() throws Exception {
        String contents = "the yellow fox jumped over the blue log";
        writeFile("some_file", contents);
        StubHttpRequest request = request("/some_file");
        request.header("Range", "bytes=0-");
        StubHttpResponse response = handle(request);
        assertReturnedWithStatus(206, response);
        assertEquals(String.valueOf(contents.length()), response.header("Content-Length"));
        assertEquals("bytes 0-" + (contents.length() - 1) + "/" + contents.length(), response.header("Content-Range"));
        assertEquals(contents, response.contentsString());
View Full Code Here

Examples of org.webbitserver.stub.StubHttpResponse.header()

        writeFile("some_file", contents);
        StubHttpRequest request = request("/some_file");
        request.header("Range", "bytes=0-");
        StubHttpResponse response = handle(request);
        assertReturnedWithStatus(206, response);
        assertEquals(String.valueOf(contents.length()), response.header("Content-Length"));
        assertEquals("bytes 0-" + (contents.length() - 1) + "/" + contents.length(), response.header("Content-Range"));
        assertEquals(contents, response.contentsString());
    }

    @Test
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.