Examples of contentType()


Examples of org.apache.myfaces.tobago.apt.annotation.BodyContentDescription.contentType()

    BodyContent bodyContent = annotationTag.bodyContent();
    BodyContentDescription contentDescription = decl.getAnnotation(BodyContentDescription.class);
    // TODO more error checking
    if (contentDescription != null) {
      if (bodyContent.equals(BodyContent.JSP)
          && contentDescription.contentType().length() > 0) {
        throw new IllegalArgumentException("contentType " + contentDescription.contentType()
            + " for bodyContent JSP not allowed!");
      } else if (bodyContent.equals(BodyContent.TAGDEPENDENT)
          && contentDescription.contentType().length() == 0) {
        throw new IllegalArgumentException("contentType should set for tagdependent bodyContent");
View Full Code Here

Examples of org.apache.myfaces.tobago.apt.annotation.BodyContentDescription.contentType()

    BodyContentDescription contentDescription = decl.getAnnotation(BodyContentDescription.class);
    // TODO more error checking
    if (contentDescription != null) {
      if (bodyContent.equals(BodyContent.JSP)
          && contentDescription.contentType().length() > 0) {
        throw new IllegalArgumentException("contentType " + contentDescription.contentType()
            + " for bodyContent JSP not allowed!");
      } else if (bodyContent.equals(BodyContent.TAGDEPENDENT)
          && contentDescription.contentType().length() == 0) {
        throw new IllegalArgumentException("contentType should set for tagdependent bodyContent");
      }
View Full Code Here

Examples of org.apache.myfaces.tobago.apt.annotation.BodyContentDescription.contentType()

      if (bodyContent.equals(BodyContent.JSP)
          && contentDescription.contentType().length() > 0) {
        throw new IllegalArgumentException("contentType " + contentDescription.contentType()
            + " for bodyContent JSP not allowed!");
      } else if (bodyContent.equals(BodyContent.TAGDEPENDENT)
          && contentDescription.contentType().length() == 0) {
        throw new IllegalArgumentException("contentType should set for tagdependent bodyContent");
      }
    }
    addLeafTextElement(bodyContent.toString(), "body-content", tagElement, document);
    addDescription(decl, tagElement, document, deprecated);
View Full Code Here

Examples of org.apache.olingo.odata2.api.processor.ODataRequest.ODataRequestBuilder.contentType()

          .acceptableLanguages(acceptLanguages)
          .body(body)
          .acceptHeaders(acceptHeaders);

      if (contentType != null) {
        requestBuilder = requestBuilder.contentType(contentType);
      }
      return requestBuilder.build();
    } else {
      currentLineNumber++;
      throw new BatchException(BatchException.INVALID_REQUEST_LINE.addContent(scanner.next()).addContent(
View Full Code Here

Examples of org.apache.wink.client.Resource.contentType()

        for (Map.Entry<String, Object> p : cookieParams.entrySet()) {
            Cookie cookie = new Cookie(p.getKey(), String.valueOf(p.getValue()));
            resource.cookie(cookie);
        }

        resource.contentType(getContentType());
        resource.accept(getAccepts());

        //handles declarative headers configured on the composite
        for (HTTPHeader header : binding.getHttpHeaders()) {
            //treat special headers that need to be calculated
View Full Code Here

Examples of org.apache.wink.client.Resource.contentType()

        String date = DateFormat.getDateTimeInstance().format(d);
        /*
         * sets a last modified date
         */
        Resource dateResource = client.resource(getBaseURI() + "/context/request/date");
        ClientResponse response = dateResource.contentType("text/string").put(date);
        assertEquals(204, response.getStatusCode());

        response = dateResource.header(HttpHeaders.IF_MODIFIED_SINCE, formatter.format(d)).get();
        /*
         * verifies that if the exact date is sent in and used in
View Full Code Here

Examples of org.apache.wink.client.Resource.contentType()

    public void testResourcePut() throws IOException {
        server.setMockResponseCode(200);
        RestClient client = getRestClient();
        Resource resource = client.resource(serviceURL + "/testResourcePut");
        String response =
            resource.contentType("text/plain").accept("text/plain").put(String.class, SENT_MESSAGE);
        assertEquals(RECEIVED_MESSAGE, response);
        assertEquals(SENT_MESSAGE, server.getRequestContentAsString());

        // do put with response
        ClientResponse clientResponse = resource.put(SENT_MESSAGE);
View Full Code Here

Examples of org.apache.wink.client.Resource.contentType()

    public void testResourcePost() throws IOException {
        server.setMockResponseCode(200);
        RestClient client = getRestClient();
        Resource resource = client.resource(serviceURL + "/testResourcePost");
        String response =
            resource.contentType("text/plain").accept("text/plain")
                .post(String.class, SENT_MESSAGE);
        assertEquals(RECEIVED_MESSAGE, response);
        assertEquals(SENT_MESSAGE, server.getRequestContentAsString());

        // do post with response
View Full Code Here

Examples of org.apache.wink.client.Resource.contentType()

        conf.applications(app);

        RestClient client = new RestClient(conf);
        Resource resource = client.resource(serviceURL + "/testResourcePut");
        Foo response =
            resource.contentType("text/plain").accept("text/plain").post(Foo.class,
                                                                         new Foo(SENT_MESSAGE));
        assertEquals(RECEIVED_MESSAGE, response.foo);

        // Negative test - Foo Provider not registered
        try {
View Full Code Here

Examples of org.apache.wink.client.Resource.contentType()

        // Negative test - Foo Provider not registered
        try {
            client = new RestClient();
            resource = client.resource(serviceURL + "/testResourcePut");
            response =
                resource.contentType("text/plain").accept("text/plain").post(Foo.class,
                                                                             new Foo(SENT_MESSAGE));
            fail("ClientRuntimeException must be thrown");
        } catch (ClientRuntimeException e) {
            // Success
        }
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.