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

Examples of org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo


  @Test
  public void defaultContainerNameDefined() throws ODataException {
    @SuppressWarnings({ "unchecked", "rawtypes" })
    AnnotationEdmProvider localAep = new AnnotationEdmProvider((Collection) Arrays.asList(DefinedNamesTestClass.class));

    EntityContainerInfo containerInfo = localAep.getEntityContainerInfo(null);
    assertNotNull(containerInfo);
    assertEquals("MyTestContainer", containerInfo.getName());
  }
View Full Code Here


    assertEquals(6, employee.getProperties().size());
    assertEquals(3, employee.getNavigationProperties().size());

    List<Schema> schemas = localAep.getSchemas();
    assertEquals(1, schemas.size());
    EntityContainerInfo info = localAep.getEntityContainerInfo(ModelSharedConstants.CONTAINER_1);
    assertTrue(info.isDefaultEntityContainer());
  }
View Full Code Here

  public void annotationProviderBasic() throws Exception {
    assertNotNull(aep);

    List<Schema> schemas = aep.getSchemas();
    assertEquals(1, schemas.size());
    EntityContainerInfo info = aep.getEntityContainerInfo(ModelSharedConstants.CONTAINER_1);
    assertTrue(info.isDefaultEntityContainer());

    FunctionImport funImp = aep.getFunctionImport(ModelSharedConstants.CONTAINER_1, "NoImport");
    assertNull(funImp);

    final FullQualifiedName associationFqn = new FullQualifiedName(
View Full Code Here

  public void annotationProviderGetDefaultContainer() throws Exception {
    assertNotNull(aep);

    List<Schema> schemas = aep.getSchemas();
    assertEquals(1, schemas.size());
    EntityContainerInfo info = aep.getEntityContainerInfo(null);
    assertTrue(info.isDefaultEntityContainer());
    assertEquals(ModelSharedConstants.CONTAINER_1, info.getName());
  }
View Full Code Here

  }

  @Test
  public void testGetEntityContainerInfo() {
    String entityContainerName = null;
    EntityContainerInfo entityContainer = null;
    try {
      entityContainer = edmProvider.getEntityContainerInfo("salesorderprocessingContainer");
      entityContainerName = entityContainer.getName();
    } catch (ODataException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }

    assertEquals("salesorderprocessingContainer", entityContainerName);
View Full Code Here

  }

  @Test
  public void testDefaultGetEntityContainerInfo() {
    String entityContainerName = null;
    EntityContainerInfo entityContainer = null;
    try {
      entityContainer = edmProvider.getEntityContainerInfo(null);
      entityContainerName = entityContainer.getName();
    } catch (ODataException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }

    assertEquals("salesorderprocessingContainer", entityContainerName);
View Full Code Here

  }

  @Test
  public void testGetEntityContainerInfoWithBuffer() {
    HashMap<String, EntityContainerInfo> entityContainerInfos = new HashMap<String, EntityContainerInfo>();
    EntityContainerInfo entityContainer = new EntityContainerInfo();
    entityContainer.setName("salesorderprocessingContainer");
    entityContainerInfos.put("salesorderprocessingContainer", entityContainer);
    ODataJPAEdmProvider jpaEdmProv = new ODataJPAEdmProvider();
    Class<?> claz = jpaEdmProv.getClass();
    try {
      Field f = claz.getDeclaredField("entityContainerInfos");
View Full Code Here

  }

  @Test
  public void testNullGetEntityContainerInfo() {
    EntityContainerInfo entityContainer = null;
    try {
      entityContainer = edmProvider.getEntityContainerInfo("salesorderprocessingContainer");
    } catch (ODataException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
View Full Code Here

  }

  @Override
  public EntityContainerInfo getEntityContainerInfo(final String name) throws ODataMessageException {
    if ((name == null) || ENTITY_CONTAINER_1.equals(name)) {
      return new EntityContainerInfo().setName(ENTITY_CONTAINER_1).setDefaultEntityContainer(true);
    }

    return null;
  }
View Full Code Here

  }

  @Override
  public EntityContainerInfo getEntityContainerInfo(final String name) throws ODataException {
    if ((name == null) || ENTITY_CONTAINER_1.equals(name)) {
      return new EntityContainerInfo().setName(ENTITY_CONTAINER_1).setDefaultEntityContainer(true);
    } else if (ENTITY_CONTAINER_2.equals(name)) {
      return new EntityContainerInfo().setName(name).setDefaultEntityContainer(false);
    }

    return null;
  }
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo

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.