Examples of ODataServiceFactory


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

    }
    return ContentType.APPLICATION_XML;
  }

  private ODataErrorCallback getErrorHandlerCallback() {
    final ODataServiceFactory serviceFactory =
        ODataRootLocator.createServiceFactoryFromContext(app, servletRequest, servletConfig);
    return serviceFactory.getCallback(ODataErrorCallback.class);
  }
View Full Code Here

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

      final Map<String, String> queryParameters,
      final String httpHeaderName, final String httpHeaderValue,
      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,
        httpHeaderName, httpHeaderValue, requestContentType);
    final ODataContextImpl context = new ODataContextImpl(request, serviceFactory);
View Full Code Here

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

  ODataContextImpl context;

  @Before
  public void before() {
    ODataServiceFactory factory = mock(ODataServiceFactory.class);
    ODataRequest request = mock(ODataRequest.class);

    when(request.getMethod()).thenReturn(ODataHttpMethod.GET);
    when(request.getPathInfo()).thenReturn(new PathInfoImpl());
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

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

    return uriInfo;
  }

  private static void checkDispatch(final ODataHttpMethod method, final UriType uriType, final boolean isValue,
      final String expectedMethodName) throws ODataException {
    ODataServiceFactory factory = mock(ODataServiceFactory.class);

    final ODataResponse response = new Dispatcher(factory, getMockService())
        .dispatch(method, mockUriInfo(uriType, isValue), null, "application/xml", "*/*");
    assertEquals(expectedMethodName, response.getEntity());
  }
View Full Code Here

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

    notSupportedDispatch(ODataHttpMethod.MERGE, UriType.URI6A);
  }

  private static void checkFeature(final UriType uriType, final boolean isValue,
      final Class<? extends ODataProcessor> feature) throws ODataException {
    ODataServiceFactory factory = mock(ODataServiceFactory.class);
    new Dispatcher(factory, getMockService());
    assertEquals(feature, Dispatcher.mapUriTypeToProcessorFeature(mockUriInfo(uriType, isValue)));
    assertEquals(feature, Dispatcher.mapUriTypeToProcessorFeature(mockUriInfo(uriType, isValue)));
  }
View Full Code Here

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

  private void
      negotiateContentTypeCharset(final String requestType, final String supportedType, final boolean asFormat)
          throws SecurityException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException,
          ODataException {

    ODataServiceFactory factory = mock(ODataServiceFactory.class);
    ODataService service = Mockito.mock(ODataService.class);
    Dispatcher dispatcher = new Dispatcher(factory, service);

    UriInfoImpl uriInfo = new UriInfoImpl();
    uriInfo.setUriType(UriType.URI1); //
View Full Code Here

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

    return ContentType.APPLICATION_XML;
  }

  private ODataErrorCallback getErrorHandlerCallback() {
    ODataErrorCallback callback = null;
    final ODataServiceFactory serviceFactory =
        ODataRootLocator.createServiceFactoryFromContext(app, servletRequest, servletConfig);
    callback = serviceFactory.getCallback(ODataErrorCallback.class);
    return callback;
  }
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.