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

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


  @Test
  public void expandSelectedEmployeesWithBuilder() throws Exception {
    EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
    List<String> navigationPropertyNames = new ArrayList<String>();
    navigationPropertyNames.add("nr_Employees");
    ExpandSelectTreeNode selectTree =
        ExpandSelectTreeNode.entitySet(entitySet).expandedLinks(navigationPropertyNames).build();

    HashMap<String, ODataCallback> callbacksRoom = createCallbacks("Rooms");
    EntityProviderWriteProperties properties =
        EntityProviderWriteProperties.serviceRoot(BASE_URI).expandSelectTree(selectTree).callbacks(callbacksRoom)
View Full Code Here


    verifyEmployees(employeeXPathString, xmlString);
  }

  @Test
  public void expandSelectedEmployeesNull() throws Exception {
    ExpandSelectTreeNode selectTree = getSelectExpandTree("Rooms('1')", "nr_Employees", "nr_Employees");

    HashMap<String, ODataCallback> callbacksRoom = new HashMap<String, ODataCallback>();
    ODataCallback employeeCallback = new OnWriteFeedContent() {

      @Override
View Full Code Here

    assertXpathNotExists(employeeXPathString + "/m:inline/a:feed/a:entry", xmlString);
  }

  @Test
  public void expandSelectedEmployeesEmpty() throws Exception {
    ExpandSelectTreeNode selectTree = getSelectExpandTree("Rooms('1')", "nr_Employees", "nr_Employees");

    HashMap<String, ODataCallback> callbacksRoom = new HashMap<String, ODataCallback>();
    ODataCallback employeeCallback = new OnWriteFeedContent() {

      @Override
View Full Code Here

    assertXpathExists(employeeXPathString + "/m:inline/a:feed", xmlString);
  }

  @Test
  public void expandSelectedEmployeesWithSelfLink() throws Exception {
    ExpandSelectTreeNode selectTree = getSelectExpandTree("Rooms('1')", "nr_Employees", "nr_Employees");

    HashMap<String, ODataCallback> callbacksRoom = createCallbacks("Rooms");
    EntityProviderWriteProperties properties =
        EntityProviderWriteProperties.serviceRoot(BASE_URI).expandSelectTree(selectTree).callbacks(callbacksRoom)
            .build();
View Full Code Here

    assertXpathExists(employeeXPathString + "/m:inline/a:feed/a:link[@href=\"Rooms('1')/nr_Employees\"]", xmlString);
  }

  @Test
  public void deepExpandSelectedEmployees() throws Exception {
    ExpandSelectTreeNode selectTree = getSelectExpandTree("Rooms('1')", "nr_Employees/ne_Room", "nr_Employees/ne_Room");

    HashMap<String, ODataCallback> callbacksRoom = createCallbacks("Rooms");
    EntityProviderWriteProperties properties =
        EntityProviderWriteProperties.serviceRoot(BASE_URI).expandSelectTree(selectTree).callbacks(callbacksRoom)
            .build();
View Full Code Here

        + "/m:inline/a:entry/a:content/m:properties", xmlString);
  }

  @Test
  public void deepExpandSelectedEmployeesWithRoomId() throws Exception {
    ExpandSelectTreeNode selectTree =
        getSelectExpandTree("Rooms('1')", "nr_Employees/ne_Room/Id", "nr_Employees/ne_Room");

    HashMap<String, ODataCallback> callbacksRoom = createCallbacks("Rooms");
    EntityProviderWriteProperties properties =
        EntityProviderWriteProperties.serviceRoot(BASE_URI).expandSelectTree(selectTree).callbacks(callbacksRoom)
View Full Code Here

        + "/m:inline/a:entry/a:content/m:properties/d:Id", xmlString);
  }

  @Test
  public void expandSelectedRoom() throws Exception {
    ExpandSelectTreeNode selectTree = getSelectExpandTree("Employees('1')", "ne_Room", "ne_Room");

    HashMap<String, ODataCallback> callbacksEmployee = createCallbacks("Employees");
    EntityProviderWriteProperties properties =
        EntityProviderWriteProperties.serviceRoot(BASE_URI).expandSelectTree(selectTree).callbacks(callbacksEmployee)
            .build();
View Full Code Here

    verifyRoom(roomXPathString, xmlString);
  }

  @Test
  public void expandSelectedTeamNull() throws Exception {
    ExpandSelectTreeNode selectTree = getSelectExpandTree("Employees('1')", "ne_Team", "ne_Team");

    HashMap<String, ODataCallback> callbacksEmployee = createCallbacks("Employees");
    EntityProviderWriteProperties properties =
        EntityProviderWriteProperties.serviceRoot(BASE_URI).expandSelectTree(selectTree).callbacks(callbacksEmployee)
            .build();
View Full Code Here

    assertXpathNotExists(teamXPathString + "/m:inline/a:entry", xmlString);
  }

  @Test
  public void expandSelectedTeamEmptyDataMap() throws Exception {
    ExpandSelectTreeNode selectTree = getSelectExpandTree("Employees('1')", "ne_Team", "ne_Team");

    HashMap<String, ODataCallback> callbacksEmployee = new HashMap<String, ODataCallback>();
    OnWriteEntryContent callback = new OnWriteEntryContent() {

      @Override
View Full Code Here

    assertXpathNotExists(teamXPathString + "/m:inline/a:entry", xmlString);
  }

  @Test
  public void expandSelectedRoomsNull() throws Exception {
    ExpandSelectTreeNode selectTree = getSelectExpandTree("Buildings('1')", "nb_Rooms", "nb_Rooms");

    HashMap<String, ODataCallback> callbacksEmployee = createCallbacks("Buildings");
    EntityProviderWriteProperties properties =
        EntityProviderWriteProperties.serviceRoot(BASE_URI).expandSelectTree(selectTree).callbacks(callbacksEmployee)
            .build();
View Full Code Here

TOP

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

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.