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

Examples of org.apache.olingo.odata2.api.uri.expression.OrderByExpression


    } catch (EdmException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
    EasyMock.replay(navigationProperty);
    // Mocking the navigation property segments and adding to expand list
    NavigationPropertySegment navigationPropertySegment = EasyMock.createMock(NavigationPropertySegment.class);
    EasyMock.expect(navigationPropertySegment.getNavigationProperty()).andStubReturn(navigationProperty);
    EasyMock.expect(navigationPropertySegment.getTargetEntitySet()).andStubReturn(getTargetEntitySetForExpand());
    EasyMock.replay(navigationPropertySegment);
    navigationPropertyList.add(navigationPropertySegment);
    expandList.add(navigationPropertyList);
    // Mocking EntityUriInfo
    GetEntitySetUriInfo entitySetUriInfo = EasyMock.createMock(GetEntitySetUriInfo.class);
View Full Code Here


      EasyMock.expect(navigationProperty.getName()).andStubReturn(navPropertyName);
    } catch (EdmException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
    }
    EasyMock.replay(navigationProperty);
    NavigationPropertySegment navPropertySegment = EasyMock.createMock(NavigationPropertySegment.class);
    EasyMock.expect(navPropertySegment.getNavigationProperty()).andStubReturn(navigationProperty);
    EasyMock.replay(navPropertySegment);
    return navPropertySegment;
  }
View Full Code Here

    return paging;
  }

  private PathInfo getLocalPathInfo() {
    PathInfo pathInfo = EasyMock.createMock(PathInfo.class);
    EasyMock.expect(pathInfo.getServiceRoot()).andStubReturn(getLocalURI());
    EasyMock.expect(pathInfo.getRequestUri()).andStubReturn(getRequestURI());
    EasyMock.replay(pathInfo);
    return pathInfo;
  }
View Full Code Here

    selectItems.add(getSelectItem());
    return selectItems;
  }

  private SelectItem getSelectItem() {
    SelectItem selectItem = EasyMock.createMock(SelectItem.class);
    EasyMock.expect(selectItem.getProperty()).andStubReturn(getEdmPropertyForSelect());
    List<NavigationPropertySegment> navigationSegmentList = new ArrayList<NavigationPropertySegment>();
    EasyMock.expect(selectItem.getNavigationPropertySegments()).andStubReturn(navigationSegmentList);
    EasyMock.expect(selectItem.isStar()).andReturn(false).anyTimes();
    EasyMock.replay(selectItem);
    return selectItem;
  }
View Full Code Here

    final ODataResponse wrappedResponse = mockResponse(HttpStatusCodes.OK, null, null);

    UriInfo uriInfo = mock(UriInfo.class);
    final FilterExpression filter = UriParser.parseFilter(null, null, "true");
    when(uriInfo.getFilter()).thenReturn(filter);
    final OrderByExpression orderBy = UriParser.parseOrderBy(null, null, "true");
    when(uriInfo.getOrderBy()).thenReturn(orderBy);
    List<ArrayList<NavigationPropertySegment>> expand = new ArrayList<ArrayList<NavigationPropertySegment>>();
    NavigationPropertySegment segment = mock(NavigationPropertySegment.class);
    EdmNavigationProperty navigationProperty = mock(EdmNavigationProperty.class);
    when(navigationProperty.getName()).thenReturn("nav");
View Full Code Here

   * @throws ODataJPARuntimeException
   */

  @Test
  public void testBuildSimpleQuery() throws EdmException, ODataJPARuntimeException {
    OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class);
    JPQLSelectContext jpqlSelectContextImpl = createSelectContext(orderByExpression, null);
    jpqlSelectStatementBuilder = new JPQLSelectStatementBuilder(jpqlSelectContextImpl);

    assertEquals("SELECT E1 FROM SalesOrderHeader E1", jpqlSelectStatementBuilder.build().toString());
  }
View Full Code Here

    assertEquals("SELECT E1 FROM SalesOrderHeader E1", jpqlSelectStatementBuilder.build().toString());
  }

  @Test
  public void testBuildQueryWithOrderBy() throws EdmException, ODataJPARuntimeException {
    OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class);

    JPQLSelectContext jpqlSelectContextImpl = createSelectContext(orderByExpression, null);
    HashMap<String, String> orderByCollection = new HashMap<String, String>();
    orderByCollection.put("E1.soID", "ASC");
    orderByCollection.put("E1.buyerId", "DESC");
View Full Code Here

        jpqlSelectStatementBuilder.build().toString());
  }

  @Test
  public void testBuildQueryWithFilter() throws EdmException, ODataJPARuntimeException {
    OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class);
    FilterExpression filterExpression = null;// getFilterExpressionMockedObj();
    JPQLSelectContext jpqlSelectContextImpl = createSelectContext(orderByExpression, filterExpression);
    jpqlSelectContextImpl.setWhereExpression("E1.soID >= 1234");

    jpqlSelectStatementBuilder = new JPQLSelectStatementBuilder(jpqlSelectContextImpl);
View Full Code Here

      orderList.add(order);

    } while (++i < 2);

    OrderByExpression orderBy = EasyMock.createMock(OrderByExpression.class);
    EasyMock.expect(orderBy.getOrders()).andStubReturn(orderList);
    EasyMock.replay(orderBy);

    try {
      i = 0;
      List<SelectItem> selectItemList = new ArrayList<SelectItem>(2);
View Full Code Here

    EdmEntitySet edmEntitySet = EasyMock.createMock(EdmEntitySet.class);
    EdmEntityType edmEntityType = EasyMock.createMock(EdmEntityType.class);
    EasyMock.expect(edmEntityType.getMapping()).andStubReturn(null);
    EasyMock.expect(edmEntityType.getName()).andStubReturn("SOItem");
    EasyMock.replay(edmEntityType);
    OrderByExpression orderByExpression = EasyMock.createMock(OrderByExpression.class);
    EasyMock.expect(getEntitySetView.getTargetEntitySet()).andStubReturn(edmEntitySet);
    EdmEntitySet startEdmEntitySet = EasyMock.createMock(EdmEntitySet.class);
    EdmEntityType startEdmEntityType = EasyMock.createMock(EdmEntityType.class);
    EasyMock.expect(startEdmEntityType.getMapping()).andStubReturn(null);
    EasyMock.expect(startEdmEntityType.getName()).andStubReturn("SOHeader");
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.uri.expression.OrderByExpression

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.