Examples of HttpStatusCodes


Examples of org.apache.olingo.odata2.api.commons.HttpStatusCodes

      ODataResponseBuilder extendedResponse = ODataResponse.fromResponse(odataResponse);
      final UriType uriType = uriInfo.getUriType();
      final String location =
          (method == ODataHttpMethod.POST && (uriType == UriType.URI1 || uriType == UriType.URI6B)) ? odataResponse
              .getIdLiteral() : null;
      final HttpStatusCodes s = getStatusCode(odataResponse, method, uriType);
      extendedResponse = extendedResponse.idLiteral(location).status(s);

      if (!odataResponse.containsHeader(ODataHttpHeaders.DATASERVICEVERSION)) {
        extendedResponse = extendedResponse.header(ODataHttpHeaders.DATASERVICEVERSION, serverDataServiceVersion);
      }
View Full Code Here

Examples of org.apache.olingo.odata2.api.commons.HttpStatusCodes

  @Test
  public void testODataApplicationExceptionWithStatus() throws Exception {
    // prepare
    String message = "expected exception message";
    HttpStatusCodes status = HttpStatusCodes.OK;
    Exception exception = new ODataApplicationException(message, Locale.ENGLISH, status);

    // execute
    Response response = exceptionMapper.toResponse(exception);
View Full Code Here

Examples of org.apache.olingo.odata2.api.commons.HttpStatusCodes

  @Test
  public void testODataApplicationExceptionWithStatusWrapped() throws Exception {
    // prepare
    String message = "expected exception message";
    HttpStatusCodes status = HttpStatusCodes.OK;
    Exception exception = new ODataException(new ODataApplicationException(message, Locale.ENGLISH, status));

    // execute
    Response response = exceptionMapper.toResponse(exception);
View Full Code Here

Examples of org.apache.olingo.odata2.api.commons.HttpStatusCodes

      ODataResponseBuilder extendedResponse = ODataResponse.fromResponse(odataResponse);
      final UriType uriType = uriInfo.getUriType();
      final String location =
          (method == ODataHttpMethod.POST && (uriType == UriType.URI1 || uriType == UriType.URI6B)) ? odataResponse
              .getIdLiteral() : null;
      final HttpStatusCodes s = getStatusCode(odataResponse, method, uriType);
      extendedResponse = extendedResponse.idLiteral(location).status(s);

      if (!odataResponse.containsHeader(ODataHttpHeaders.DATASERVICEVERSION)) {
        extendedResponse = extendedResponse.header(ODataHttpHeaders.DATASERVICEVERSION, serverDataServiceVersion);
      }
View Full Code Here

Examples of org.apache.olingo.odata2.api.commons.HttpStatusCodes

        .replace("'1'", "'9'")
        .replace("Id>1", "Id>9")
        .replace("Team 1", "Team X")
        .replaceAll("<link.+?/>", "");
    String requestContentType = HttpContentType.APPLICATION_ATOM_XML_ENTRY;
    HttpStatusCodes expectedStatusCode = HttpStatusCodes.CREATED;
    String headerName = "Accept";
    String headerValue = "application/atom+xml;type=entry";
    HttpResponse response =
        callUri(ODataHttpMethod.POST, "Teams()", headerName, headerValue, requestBody, requestContentType,
            expectedStatusCode);
View Full Code Here

Examples of org.apache.olingo.odata2.api.commons.HttpStatusCodes

      String path = fitTestSet.path;
      List<String> queryOptions = fitTestSet.queryOptions;
      List<String> acceptHeaders = fitTestSet.acceptHeader;
      String content = fitTestSet.content;
      List<String> requestContentTypeHeaders = fitTestSet.requestContentTypes;
      HttpStatusCodes expectedStatusCode = fitTestSet.expectedStatusCode;

      return create(uriType, httpMethod, path, queryOptions, acceptHeaders, acceptHeader2ContentType,
          content, requestContentTypeHeaders, expectedStatusCode);
    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.commons.HttpStatusCodes

    String path = "/Employees";
    String queryOption = "";
    String acceptHeader = "*";
    String content = "IMAGE_;o)";
    String requestContentType = "image/jpeg";
    HttpStatusCodes expectedStatusCode = HttpStatusCodes.CREATED;
    String expectedContentType = "application/atom+xml; charset=utf-8; type=entry";

    FitTest test =
        FitTest.create(uriType, httpMethod, path, queryOption, acceptHeader, content, requestContentType,
            expectedStatusCode, expectedContentType);
View Full Code Here

Examples of org.apache.olingo.odata2.api.commons.HttpStatusCodes

    String path = "/Employees('1')";
    String queryOption = "";
    String acceptHeader = "*";
    String content = "IMAGE_;o)";
    String requestContentType = "image/jpeg";
    HttpStatusCodes expectedStatusCode = HttpStatusCodes.CREATED;
    String expectedContentType = "image/jpeg";

    FitTest test =
        FitTest.create(uriType, httpMethod, path, queryOption, acceptHeader, content, requestContentType,
            expectedStatusCode, expectedContentType);
View Full Code Here

Examples of org.apache.olingo.odata2.api.commons.HttpStatusCodes

      String path = fitTestSet.path;
      List<String> queryOptions = fitTestSet.queryOptions;
      List<String> acceptHeaders = fitTestSet.acceptHeader;
      String content = fitTestSet.content;
      List<String> requestContentTypeHeaders = fitTestSet.requestContentTypes;
      HttpStatusCodes expectedStatusCode = fitTestSet.expectedStatusCode;

      return create(uriType, httpMethod, path, queryOptions, acceptHeaders, acceptHeader2ContentType,
          content, requestContentTypeHeaders, expectedStatusCode);
    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.commons.HttpStatusCodes

    String path = "/Employees";
    String queryOption = "";
    String acceptHeader = "*";
    String content = "IMAGE_;o)";
    String requestContentType = "image/jpeg";
    HttpStatusCodes expectedStatusCode = HttpStatusCodes.CREATED;
    String expectedContentType = "application/atom+xml; charset=utf-8; type=entry";

    FitTest test =
        FitTest.create(uriType, httpMethod, path, queryOption, acceptHeader, content, requestContentType,
            expectedStatusCode, expectedContentType);
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.