Examples of EdmTestProvider


Examples of org.apache.olingo.odata2.testutil.mock.EdmTestProvider

  public void testEntityType() throws EntityProviderException, ODataException, XMLStreamException {
    Edm edm = createEdm();

    assertNotNull(edm);
    FullQualifiedName fqNameEmployee = new FullQualifiedName("RefScenario", "Employee");
    EdmProvider testProvider = new EdmTestProvider();
    EdmImplProv edmImpl = (EdmImplProv) edm;
    EntityType employee = edmImpl.getEdmProvider().getEntityType(fqNameEmployee);
    EntityType testEmployee = testProvider.getEntityType(fqNameEmployee);
    assertEquals(testEmployee.getName(), employee.getName());
    assertEquals(testEmployee.isHasStream(), employee.isHasStream());
    assertEquals(testEmployee.getProperties().size(), employee.getProperties().size());
    assertEquals(testEmployee.getNavigationProperties().size(), employee.getNavigationProperties().size());
View Full Code Here

Examples of org.apache.olingo.odata2.testutil.mock.EdmTestProvider

  public void testAssociation() throws EntityProviderException, ODataException, XMLStreamException {
    Edm edm = createEdm();
    assertNotNull(edm);

    FullQualifiedName fqNameAssociation = new FullQualifiedName("RefScenario", "BuildingRooms");
    EdmProvider testProvider = new EdmTestProvider();
    EdmImplProv edmImpl = (EdmImplProv) edm;
    Association association = edmImpl.getEdmProvider().getAssociation(fqNameAssociation);
    Association testAssociation = testProvider.getAssociation(fqNameAssociation);
    assertEquals(testAssociation.getName(), association.getName());
    assertEquals(testAssociation.getEnd1().getMultiplicity(), association.getEnd1().getMultiplicity());
    assertEquals(testAssociation.getEnd2().getRole(), association.getEnd2().getRole());
    assertEquals(testAssociation.getEnd1().getType(), association.getEnd1().getType());
View Full Code Here

Examples of org.apache.olingo.odata2.testutil.mock.EdmTestProvider

  }

  @Test
  public void testAssociationSet() throws EntityProviderException, ODataException, XMLStreamException {
    EdmProvider testProvider = new EdmTestProvider();
    Edm edm = createEdm();
    assertNotNull(edm);

    FullQualifiedName fqNameAssociation = new FullQualifiedName("RefScenario", "ManagerEmployees");
    EdmImplProv edmImpl = (EdmImplProv) edm;
    AssociationSet associationSet =
        edmImpl.getEdmProvider().getAssociationSet("Container1", fqNameAssociation, "Managers", "r_Manager");
    AssociationSet testAssociationSet =
        testProvider.getAssociationSet("Container1", fqNameAssociation, "Managers", "r_Manager");
    assertEquals(testAssociationSet.getName(), associationSet.getName());
    assertEquals(testAssociationSet.getEnd1().getEntitySet(), associationSet.getEnd1().getEntitySet());
    assertEquals(testAssociationSet.getEnd2().getEntitySet(), associationSet.getEnd2().getEntitySet());
    assertEquals(testAssociationSet.getEnd2().getRole(), associationSet.getEnd2().getRole());
View Full Code Here

Examples of org.apache.olingo.odata2.testutil.mock.EdmTestProvider

  }

  @Test
  public void testSchema() throws EntityProviderException, ODataException, XMLStreamException {
    EdmProvider testProvider = new EdmTestProvider();
    Edm edm = createEdm();
    assertNotNull(edm);

    EdmImplProv edmImpl = (EdmImplProv) edm;
    List<Schema> schemas = edmImpl.getEdmProvider().getSchemas();
    List<Schema> testSchemas = testProvider.getSchemas();
    assertEquals(testSchemas.size(), schemas.size());

    if (!schemas.isEmpty() && !testSchemas.isEmpty()) {
      Schema schema = schemas.get(0);
      Schema testSchema = testSchemas.get(0);
View Full Code Here

Examples of org.apache.olingo.odata2.testutil.mock.EdmTestProvider

    }
  }

  @Test
  public void testContainer() throws EntityProviderException, ODataException, XMLStreamException {
    EdmProvider testProvider = new EdmTestProvider();
    Edm edm = createEdm();
    assertNotNull(edm);

    EdmImplProv edmImpl = (EdmImplProv) edm;
    EntityContainerInfo container = edmImpl.getEdmProvider().getEntityContainerInfo("Container2");
    EntityContainerInfo testContainer = testProvider.getEntityContainerInfo("Container2");
    assertEquals(testContainer.getName(), container.getName());
    assertEquals(testContainer.isDefaultEntityContainer(), container.isDefaultEntityContainer());

    container = edmImpl.getEdmProvider().getEntityContainerInfo(null);
    testContainer = testProvider.getEntityContainerInfo(null);
    assertNotNull(container);
    assertEquals(testContainer.getName(), container.getName());
    assertEquals(testContainer.isDefaultEntityContainer(), container.isDefaultEntityContainer());
  }
View Full Code Here

Examples of org.apache.olingo.odata2.testutil.mock.EdmTestProvider

    List<EdmFunctionImport> functionImports = edm.getFunctionImports();
    assertEquals(7, functionImports.size());
  }

  private Edm createEdm() throws EntityProviderException, ODataException {
    EdmProvider testProvider = new EdmTestProvider();
    ODataResponse response = EntityProvider.writeMetadata(testProvider.getSchemas(), null);
    InputStream in = (InputStream) response.getEntity();
    return EntityProvider.readMetadata(in, true);

  }
View Full Code Here

Examples of org.apache.olingo.odata2.testutil.mock.EdmTestProvider

  }

  private ExpandSelectTreeNode getSelectExpandTree(final String pathSegment, final String selectString,
      final String expandString) throws Exception {

    Edm edm = RuntimeDelegate.createEdm(new EdmTestProvider());
    UriParserImpl uriParser = new UriParserImpl(edm);

    List<PathSegment> pathSegments = new ArrayList<PathSegment>();
    pathSegments.add(new ODataPathSegmentImpl(pathSegment, null));
View Full Code Here

Examples of org.apache.olingo.odata2.testutil.mock.EdmTestProvider

    return processor;
  }

  @Override
  protected EdmProvider createEdmProvider() {
    return new EdmTestProvider();
  }
View Full Code Here

Examples of org.apache.olingo.odata2.testutil.mock.EdmTestProvider

    return mock(ODataSingleProcessor.class);
  }

  @Override
  protected EdmProvider createEdmProvider() {
    return new EdmTestProvider();
  }
View Full Code Here

Examples of org.apache.olingo.odata2.testutil.mock.EdmTestProvider

    return mock(ODataSingleProcessor.class);
  }

  @Override
  protected EdmProvider createEdmProvider() {
    return new EdmTestProvider();
  }
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.