Examples of ODataServiceFactory


Examples of org.apache.olingo.odata2.api.ODataServiceFactory

  private ODataResponse executeRequest(final ODataHttpMethod method,
      final List<String> pathSegments,
      final Map<String, String> queryParameters,
      final String requestContentType) throws ODataException {
    ODataServiceFactory serviceFactory = mock(ODataServiceFactory.class);
    final ODataService service = mockODataService(serviceFactory);
    when(serviceFactory.createService(any(ODataContext.class))).thenReturn(service);

    final ODataRequest request = mockODataRequest(method, pathSegments, queryParameters, requestContentType);
    final ODataContextImpl context = new ODataContextImpl(request, serviceFactory);

    return new ODataRequestHandler(serviceFactory, service, context).handle(request);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ODataServiceFactory

      final Map<String, String> queryParameters,
      final List<String> acceptHeaders,
      final String requestContentType,
      final HttpStatusCodes expectedStatusCode) throws ODataException {

    ODataServiceFactory serviceFactory = mock(ODataServiceFactory.class);
    final ODataService service = mockODataService(serviceFactory);
    when(serviceFactory.createService(any(ODataContext.class))).thenReturn(service);

    final ODataRequest request =
        mockODataRequest(method, pathSegments, queryParameters, acceptHeaders, requestContentType);
    final ODataContextImpl context = new ODataContextImpl(request, serviceFactory);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ODataServiceFactory

        HttpStatusCodes.UNSUPPORTED_MEDIA_TYPE);
  }

  @Test
  public void dataServiceVersion() throws Exception {
    ODataServiceFactory serviceFactory = mock(ODataServiceFactory.class);
    final ODataService service = mockODataService(serviceFactory);
    when(serviceFactory.createService(any(ODataContext.class))).thenReturn(service);

    ODataRequest request =
        mockODataRequest(ODataHttpMethod.GET, createPathSegments(UriType.URI0, false, false), null, null);
    ODataContextImpl context = new ODataContextImpl(request, serviceFactory);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ODataServiceFactory

  }

  private ODataErrorCallback getErrorHandlerCallbackFromContext(final ODataContext context)
      throws ClassNotFoundException, InstantiationException, IllegalAccessException {
    ODataErrorCallback callback = null;
    ODataServiceFactory serviceFactory = context.getServiceFactory();
    callback = serviceFactory.getCallback(ODataErrorCallback.class);
    return callback;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ODataServiceFactory

      if (cl == null) {
        factoryClass = Class.forName(factoryClassName);
      } else {
        factoryClass = Class.forName(factoryClassName, true, cl);
      }
      final ODataServiceFactory serviceFactory = (ODataServiceFactory) factoryClass.newInstance();

      callback = serviceFactory.getCallback(ODataErrorCallback.class);
    }
    return callback;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ODataServiceFactory

      if (cl == null) {
        factoryClass = Class.forName(factoryClassName);
      } else {
        factoryClass = Class.forName(factoryClassName, true, cl);
      }
      final ODataServiceFactory serviceFactory = (ODataServiceFactory) factoryClass.newInstance();

      callback = serviceFactory.getCallback(ODataErrorCallback.class);
    }
    return callback;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ODataServiceFactory

    if (cl == null) {
      factoryClass = Class.forName(factoryClassName);
    } else {
      factoryClass = Class.forName(factoryClassName, true, cl);
    }
    ODataServiceFactory serviceFactory = (ODataServiceFactory) factoryClass.newInstance();

    int pathSplit = 0;
    final String pathSplitAsString = servletConfig.getInitParameter(ODataServiceFactory.PATH_SPLIT_LABEL);
    if (pathSplitAsString != null) {
      pathSplit = Integer.parseInt(pathSplitAsString);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ODataServiceFactory

    if (servletRequest.getPathInfo() == null) {
      return handleRedirect();
    }

    ODataServiceFactory serviceFactory = createServiceFactoryFromContext(app, servletRequest, servletConfig);

    int pathSplit = 0;
    final String pathSplitAsString = servletConfig.getInitParameter(ODataServiceFactory.PATH_SPLIT_LABEL);
    if (pathSplitAsString != null) {
      pathSplit = Integer.parseInt(pathSplitAsString);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ODataServiceFactory

          factoryClass = Class.forName(factoryClassName);
        } else {
          factoryClass = Class.forName(factoryClassName, true, cl);
        }
      }
      ODataServiceFactory serviceFactory = (ODataServiceFactory) factoryClass.newInstance();
      return serviceFactory;
    } catch (Exception e) {
      throw new ODataRuntimeException("Exception during ODataServiceFactory creation occured.", e);
    }
  }
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.