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

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


    assertEquals(testContainer.isDefaultEntityContainer(), container.isDefaultEntityContainer());
  }

  @Test
  public void testEntitySets() throws Exception {
    Edm edm = createEdm();
    assertNotNull(edm);

    List<EdmEntitySet> entitySets = edm.getEntitySets();
    assertEquals(6, entitySets.size());
  }
View Full Code Here


    assertEquals(6, entitySets.size());
  }

  @Test
  public void testFunctionImports() throws Exception {
    Edm edm = createEdm();
    assertNotNull(edm);

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

   * @see ServiceDocumentProcessor
   */
  @Override
  public ODataResponse readServiceDocument(final GetServiceDocumentUriInfo uriInfo, final String contentType)
      throws ODataException {
    final Edm entityDataModel = getContext().getService().getEntityDataModel();
    final String serviceRoot = getContext().getPathInfo().getServiceRoot().toASCIIString();

    final ODataResponse response = EntityProvider.writeServiceDocument(contentType, entityDataModel, serviceRoot);
    final ODataResponseBuilder odataResponseBuilder = ODataResponse.fromResponse(response).header(
        ODataHttpHeaders.DATASERVICEVERSION, ODataServiceVersion.V10);
View Full Code Here

    when(photoContainer.getEntitySet("Photos")).thenReturn(photoEntitySet);
    when(photoContainer.getName()).thenReturn("Container2");

    when(photoEntitySet.getEntityContainer()).thenReturn(photoContainer);

    Edm edm = mock(Edm.class);
    EdmServiceMetadata serviceMetadata = mock(EdmServiceMetadata.class);
    when(serviceMetadata.getDataServiceVersion()).thenReturn("MockEdm");
    when(edm.getServiceMetadata()).thenReturn(serviceMetadata);
    when(edm.getDefaultEntityContainer()).thenReturn(defaultContainer);
    when(edm.getEntityContainer("Container1")).thenReturn(specificContainer);
    when(edm.getEntityContainer("Container2")).thenReturn(photoContainer);
    when(edm.getEntityType("RefScenario", "Employee")).thenReturn(employeeType);
    when(edm.getEntityType("RefScenario", "Team")).thenReturn(teamType);
    when(edm.getEntityType("RefScenario", "Room")).thenReturn(roomType);
    when(edm.getEntityType("RefScenario", "Building")).thenReturn(buildingType);
    when(edm.getComplexType("RefScenario", "c_Location")).thenReturn(locationComplexType);
    when(edm.getEntityType("RefScenario2", "Photo")).thenReturn(photoEntityType);

    return edm;
  }
View Full Code Here

  }

  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

  }

  private ExpandSelectTreeNode getSelectExpandTree(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("Employees('1')", null));
View Full Code Here

      public Map<String, List<String>> getMatrixParameters() {
        return null;
      }
    };

    final Edm edm = getContext().getService().getEntityDataModel();
    ODataContext context = getContext();
    final int timingHandle = context.startRuntimeMeasurement("UriParser", "parse");

    UriInfo uri = null;
    try {
View Full Code Here

  }

  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

  }

  public final UriInfo parseLinkURI() throws ODataJPARuntimeException {
    UriInfo uriInfo = null;

    Edm edm;
    try {
      edm = context.getODataContext().getService().getEntityDataModel();

      List<PathSegment> pathSegments = context.getODataContext().getPathInfo().getODataSegments();
      List<PathSegment> subPathSegments = pathSegments.subList(0, pathSegments.size() - 2);
View Full Code Here

        public Map<String, List<String>> getMatrixParameters() {
          return null;
        }
      };

      final Edm edm = odataContext.getService().getEntityDataModel();

      uri = UriParser.parse(edm, Arrays.asList(pathSegment), Collections.<String, String> emptyMap());

    } catch (ODataException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()), e);
View Full Code Here

TOP

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

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.