Package org.apache.olingo.odata2.api.uri

Examples of org.apache.olingo.odata2.api.uri.UriInfo


    assertTrue(readContent(response).contains("Manager"));
  }

  @Test
  public void readBuildings() throws Exception {
    final UriInfo uriResult = mockUriResult("Buildings", "Id", "1");

    ODataResponse response =
        processor.readEntity(uriResult, ContentType.APPLICATION_ATOM_XML_ENTRY.toContentTypeString());
    assertNotNull(response);
    assertTrue(readContent(response).contains("Building"));
View Full Code Here


  @Test
  public void testParseURISegment() {

    try {
      parser = new ODataEntityParser(mock("JPATypeMock(2)"));
      UriInfo uriInfo = parser.parseURISegment(0, 1);
      assertNotNull(uriInfo);
    } catch (ODataJPARuntimeException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
View Full Code Here

  @Test
  public void testParseURISegmentInvalidIndex00() {
    try {
      parser = new ODataEntityParser(mock("JPATypeMock(2)"));
      UriInfo uriInfo = parser.parseURISegment(0, 0);
      assertNull(uriInfo);
    } catch (ODataJPARuntimeException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
View Full Code Here

  @Test
  public void testParseURISegmentInvalidIndex01() {
    try {
      parser = new ODataEntityParser(mock("JPATypeMock(2)"));
      UriInfo uriInfo = parser.parseURISegment(-1, -1);
      assertNull(uriInfo);
    } catch (ODataJPARuntimeException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
View Full Code Here

  @Test
  public void testParseURISegmentInvalidIndex02() {
    try {
      parser = new ODataEntityParser(mock("JPATypeMock(2)"));
      UriInfo uriInfo = parser.parseURISegment(3, -1);
      assertNull(uriInfo);
    } catch (ODataJPARuntimeException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
View Full Code Here

  @Test
  public void testParseBindingLink() {
    try {
      parser = new ODataEntityParser(mock("JPATypeMock(2)"));
      UriInfo uriInfo = parser.parseBindingLink("JPATypeMock(2)", new HashMap<String, String>());
      assertNotNull(uriInfo);
    } catch (ODataJPARuntimeException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
View Full Code Here

  @Test
  public void testParseLink() {
    parser = new ODataEntityParser(mock("JPATypeMock(2)"));
    try {
      UriInfo uriInfo =
          parser.parseLink(EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false), mockURIContent(0),
              "application/json");
      assertNotNull(uriInfo);
    } catch (ODataJPARuntimeException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
View Full Code Here

  @Test
  public void testParseLinkWithoutServiceRoot() {
    parser = new ODataEntityParser(mock("JPATypeMock(2)"));
    try {
      UriInfo uriInfo =
          parser.parseLink(EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false), mockURIContent(1),
              "application/json");
      assertNotNull(uriInfo);
    } catch (ODataJPARuntimeException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
View Full Code Here

      queryParameters.put("$select", selectString);
    }
    if (expandString != null) {
      queryParameters.put("$expand", expandString);
    }
    UriInfo uriInfo = uriParser.parse(pathSegments, queryParameters);

    ExpandSelectTreeCreator expandSelectTreeCreator =
        new ExpandSelectTreeCreator(uriInfo.getSelect(), uriInfo.getExpand());
    ExpandSelectTreeNode expandSelectTree = expandSelectTreeCreator.create();
    assertNotNull(expandSelectTree);
    return expandSelectTree;
  }
View Full Code Here

  // ---------------------------- Common Code Start ---------------- TODO - common in ODataJPAProcessorDefaultTest as
  // well

  private DeleteUriInfo getDeletetUriInfo() {
    UriInfo objUriInfo = EasyMock.createMock(UriInfo.class);
    EasyMock.expect(objUriInfo.getStartEntitySet()).andStubReturn(getLocalEdmEntitySet());
    EasyMock.expect(objUriInfo.getTargetEntitySet()).andStubReturn(getLocalEdmEntitySet());
    EasyMock.expect(objUriInfo.getSelect()).andStubReturn(null);
    EasyMock.expect(objUriInfo.getOrderBy()).andStubReturn(getOrderByExpression());
    EasyMock.expect(objUriInfo.getTop()).andStubReturn(getTop());
    EasyMock.expect(objUriInfo.getSkip()).andStubReturn(getSkip());
    EasyMock.expect(objUriInfo.getInlineCount()).andStubReturn(getInlineCount());
    EasyMock.expect(objUriInfo.getFilter()).andStubReturn(getFilter());
    EasyMock.expect(objUriInfo.getKeyPredicates()).andStubReturn(getKeyPredicates());
    EasyMock.expect(objUriInfo.isLinks()).andStubReturn(false);
    EasyMock.replay(objUriInfo);
    return objUriInfo;
  }
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.uri.UriInfo

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.