Package org.apache.olingo.odata2.api.edm

Examples of org.apache.olingo.odata2.api.edm.EdmEntityContainer


    EasyMock.replay(objEdmEntitySet);
    return objEdmEntitySet;
  }

  private EdmEntityContainer getLocalEdmEntityContainer() {
    EdmEntityContainer edmEntityContainer = EasyMock.createMock(EdmEntityContainer.class);
    EasyMock.expect(edmEntityContainer.isDefaultEntityContainer()).andStubReturn(true);
    try {
      EasyMock.expect(edmEntityContainer.getName()).andStubReturn("salesorderprocessingContainer");
    } catch (EdmException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }

    EasyMock.replay(edmEntityContainer);
View Full Code Here


  }

  private UriInfo mockUriResult(final String entitySetName) throws ODataException, URISyntaxException {
    EdmEntityType entityType = mock(EdmEntityType.class);
    when(entityType.getName()).thenReturn(entitySetName);
    EdmEntityContainer entityContainer = mock(EdmEntityContainer.class);
    when(entityContainer.isDefaultEntityContainer()).thenReturn(true);
    EdmEntitySet entitySet = mock(EdmEntitySet.class);
    when(entitySet.getName()).thenReturn(entitySetName);
    when(entitySet.getEntityType()).thenReturn(entityType);
    when(entitySet.getEntityContainer()).thenReturn(entityContainer);
View Full Code Here

    }
    return getEntityView;
  }

  private EdmEntityContainer getLocalEdmEntityContainer() {
    EdmEntityContainer edmEntityContainer = EasyMock.createMock(EdmEntityContainer.class);
    EasyMock.expect(edmEntityContainer.isDefaultEntityContainer()).andStubReturn(true);
    try {
      EasyMock.expect(edmEntityContainer.getName()).andStubReturn(SALESORDERPROCESSING_CONTAINER);
    } catch (EdmException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }

    EasyMock.replay(edmEntityContainer);
View Full Code Here

  }

  public ODataFeed readFeed(final String entityContainerName, final String entitySetName, final String contentType,
      final String query)
      throws IOException, ODataException, HttpException {
    EdmEntityContainer entityContainer = edm.getEntityContainer(entityContainerName);
    String relativeUri;
    if (entityContainer.isDefaultEntityContainer()) {
      relativeUri = entitySetName;
    } else {
      relativeUri = entityContainerName + "." + entitySetName;
    }

    InputStream content = (InputStream) connect(relativeUri, query, contentType, "GET").getContent();
    return EntityProvider.readFeed(contentType, entityContainer.getEntitySet(entitySetName), content,
        EntityProviderReadProperties.init().build());
  }
View Full Code Here

  public ODataDeltaFeed
      readDeltaFeed(final String entityContainerName, final String entitySetName, final String contentType,
          final String deltaLink)
          throws IOException, ODataException, HttpException {

    EdmEntityContainer entityContainer = edm.getEntityContainer(entityContainerName);

    InputStream content = (InputStream) connect(deltaLink, contentType, "GET").getContent();

    return EntityProvider.readDeltaFeed(contentType, entityContainer.getEntitySet(entitySetName), content,
        EntityProviderReadProperties.init().build());
  }
View Full Code Here

  public EdmEntityContainer getEntityContainer(final String name) throws EdmException {
    if (edmEntityContainers.containsKey(name)) {
      return edmEntityContainers.get(name);
    }

    EdmEntityContainer edmEntityContainer = null;

    try {
      edmEntityContainer = createEntityContainer(name);
      if (edmEntityContainer != null) {
        if (name == null && edmEntityContainers.containsKey(edmEntityContainer.getName())) {
          // ensure that the same default entity container is stored in the HashMap under null and its name
          edmEntityContainer = edmEntityContainers.get(edmEntityContainer.getName());
          edmEntityContainers.put(name, edmEntityContainer);
        } else if (edmEntityContainers.containsKey(null) && edmEntityContainers.get(null) != null
            && name.equals(edmEntityContainers.get(null).getName())) {
          // ensure that the same default entity container is stored in the HashMap under null and its name
          edmEntityContainer = edmEntityContainers.get(null);
View Full Code Here

    edmProvider = mock(EdmProvider.class);
    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);

    EntityContainerInfo entityContainer = new EntityContainerInfo().setName("Container");
    EdmEntityContainer edmEntityContainer = new EdmEntityContainerImplProv(edmImplProv, entityContainer);

    AssociationSetEnd associationSetEnd = new AssociationSetEnd().setRole("end1Role").setEntitySet("entitySetRole1");
    EntitySet entitySet = new EntitySet().setName("entitySetRole1");
    when(edmProvider.getEntitySet("Container", "entitySetRole1")).thenReturn(entitySet);

    edmAssociationSetEnd =
        new EdmAssociationSetEndImplProv(associationSetEnd, edmEntityContainer.getEntitySet("entitySetRole1"));
  }
View Full Code Here

  public static interface JPAEdmMappingMock extends JPAEdmMapping, EdmMapping {

  }

  public static EdmEntityContainer mockEdmEntityContainer(final String entityName) throws EdmException {
    EdmEntityContainer entityContainer = EasyMock.createMock(EdmEntityContainer.class);
    entityContainer = EasyMock.createMock(EdmEntityContainer.class);
    EasyMock.expect(entityContainer.getEntitySet(JPATypeMock.ENTITY_NAME)).andReturn(
        mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false));
    EasyMock.expect(entityContainer.getFunctionImport(JPATypeMock.ENTITY_NAME)).andReturn(null);
    EasyMock.expect(entityContainer.getEntitySet("JPATypeMockInvalid")).andReturn(null);
    EasyMock.expect(entityContainer.getFunctionImport("JPATypeMockInvalid")).andReturn(null);
    EasyMock.replay(entityContainer);

    return entityContainer;
  }
View Full Code Here

      schemas = edmProvider.getSchemas();
    }
    for (Schema schema : schemas) {
      for (EntityContainer entityContainer : schema.getEntityContainers()) {
        for (EntitySet entitySet : entityContainer.getEntitySets()) {
          EdmEntityContainer edmEntityContainer = createEntityContainer(entityContainer.getName());
          edmEntitySets.add(new EdmEntitySetImplProv(this, entitySet, edmEntityContainer));
        }
      }
    }
    return edmEntitySets;
View Full Code Here

      schemas = edmProvider.getSchemas();
    }
    for (Schema schema : schemas) {
      for (EntityContainer entityContainer : schema.getEntityContainers()) {
        for (FunctionImport functionImport : entityContainer.getFunctionImports()) {
          EdmEntityContainer edmEntityContainer = createEntityContainer(entityContainer.getName());
          edmFunctionImports.add(new EdmFunctionImportImplProv(this, functionImport, edmEntityContainer));
        }
      }
    }
    return edmFunctionImports;
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.edm.EdmEntityContainer

Copyright © 2018 www.massapicom. 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.