[ 
https://issues.apache.org/jira/browse/OLINGO-545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14384463#comment-14384463
 ] 

Ramesh Reddy commented on OLINGO-545:
-------------------------------------

[~cholzer] I am trying pull in above test into my feature branch, I see some 
discrepancies. One is for me the data in DataProvider and 
ExpandWithSystemQueryOptionsITCase does not seem to line up for me. 

For example 
{code}
  @Test
  public void testTop() {
    final Map<QueryOption, Object> options = new HashMap<QueryOption, Object>();
    options.put(QueryOption.TOP, "1");

    final ODataRetrieveResponse<ODataEntitySet> response =
        buildRequest(ES_KEY_NAV, NAV_PROPERTY_ET_KEY_NAV_MANY, options);
    final List<ODataEntity> entities = response.getBody().getEntities();
    assertEquals(3, entities.size());

    for (final ODataEntity entity : entities) {
      final Object propInt16 = 
entity.getProperty(PROPERTY_INT16).getPrimitiveValue().toValue();
      final ODataEntitySet inlineEntitySet =
          
entity.getNavigationLink(NAV_PROPERTY_ET_KEY_NAV_MANY).asInlineEntitySet().getEntitySet();

      if (propInt16.equals(1)) {
        assertEquals(1, inlineEntitySet.getEntities().size());
{code}

The last line says 1, for entities size, but if we see in the DataProvider, you 
will see 2

{code}
  private void linkESKeyNav(Map<String, EntitySet> data) {
    final EntitySet entitySet = data.get("ESKeyNav");
    final List<Entity> esKeyNavTargets = data.get("ESKeyNav").getEntities();
    final List<Entity> esTwoKeyNavTargets = 
data.get("ESTwoKeyNav").getEntities();
    final List<Entity> esMediaTargets = data.get("ESMedia").getEntities();

    // NavPropertyETKeyNavMany
    setLinks(entitySet.getEntities().get(0), "NavPropertyETKeyNavMany",
        esKeyNavTargets.get(0), esKeyNavTargets.get(1));
    setLinks(entitySet.getEntities().get(1), "NavPropertyETKeyNavMany",
        esKeyNavTargets.get(1), esKeyNavTargets.get(2));
{code}

Is it your assumption that the query option "TOP" is also applied at the 
navigation level?

The strange thing, it works fine with code in master, I can't seem to figure 
out what I have different where these are failing? The above data seem to favor 
what I am seeing, if that is true then master should be failing too. You also 
seem to assuming the order of the navigation items in some other tests (same 
class, except for one all fail for me), which seems troublesome to me. I am 
still digging..

> Implement newest features in Technical Scenario
> -----------------------------------------------
>
>                 Key: OLINGO-545
>                 URL: https://issues.apache.org/jira/browse/OLINGO-545
>             Project: Olingo
>          Issue Type: Task
>          Components: odata4-commons, odata4-server
>    Affects Versions: (Java) V4 4.0.0-beta-02
>            Reporter: Michael Bolz
>            Priority: Minor
>         Attachments: Olingo545-002.diff, Olingo545-003.diff, 
> Olingo545-004.diff, Olingo545.diff
>
>
> Implement newest features into Technical Scenario ({{lib/server-tecsvc}} 
> module).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to