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

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


    assertNotNull(csb);

    long t = startTimer();

    for (int i = 0; i < TIMES; i++) {
      ExpandSelectTreeNode epProperties = null;
      EntityInfoAggregator eia = EntityInfoAggregator.create(edmEntitySet, epProperties);
      provider.append(writer, eia, roomData, false, false);
    }
    stopTimer(t, "readAtomEntry");
  }
View Full Code Here


  @Test
  public void readAtomEntryOptimized() throws IOException, XpathException, SAXException, XMLStreamException,
      FactoryConfigurationError, ODataException {
    long t = startTimer();

    ExpandSelectTreeNode epProperties = null;
    EntityInfoAggregator eia = EntityInfoAggregator.create(edmEntitySet, epProperties);
    for (int i = 0; i < TIMES; i++) {
      provider.append(writer, eia, roomData, false, false);
    }
    stopTimer(t, "readAtomEntryOptimized");
View Full Code Here

    before();
    assertNotNull(csb);

    long t = startTimer();

    ExpandSelectTreeNode epProperties = null;
    EntityInfoAggregator eia = EntityInfoAggregator.create(edmEntitySet, epProperties);
    for (int i = 0; i < TIMES; i++) {
      provider.append(writer, eia, roomData, false, false);
    }
    stopTimer(t, "readAtomEntryOptimizedCsb");
View Full Code Here

  private ExpandSelectTreeNodeImpl getExpandSelectTreeNode(final List<ODataEntry> inlineEntries)
      throws EntityProviderException {
    if (inlineEntries.isEmpty()) {
      return new ExpandSelectTreeNodeImpl();
    } else {
      ExpandSelectTreeNode inlinedEntryEstNode = inlineEntries.get(0).getExpandSelectTree();
      if (inlinedEntryEstNode instanceof ExpandSelectTreeNodeImpl) {
        return (ExpandSelectTreeNodeImpl) inlinedEntryEstNode;
      } else {
        throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT
            .addContent("Unsupported implementation for " + ExpandSelectTreeNode.class + " found."));
View Full Code Here

import org.easymock.EasyMock;

public class EdmMockUtil {

  public static ExpandSelectTreeNode mockExpandSelectTreeNode() {
    ExpandSelectTreeNode nextExpandNode = EasyMock.createMock(ExpandSelectTreeNode.class);
    Map<String, ExpandSelectTreeNode> nextLink = null;
    EasyMock.expect(nextExpandNode.getLinks()).andStubReturn(nextLink);
    EasyMock.replay(nextExpandNode);
    ExpandSelectTreeNode expandNode = EasyMock.createMock(ExpandSelectTreeNode.class);
    Map<String, ExpandSelectTreeNode> links = new HashMap<String, ExpandSelectTreeNode>();
    links.put("SalesOrderLineItemDetails", nextExpandNode);
    EasyMock.expect(expandNode.getLinks()).andStubReturn(links);
    List<EdmProperty> edmPropertyList = new ArrayList<EdmProperty>();
    edmPropertyList.add(mockEdmPropertyOfTarget());
    EasyMock.expect(expandNode.getProperties()).andReturn(edmPropertyList).anyTimes();
    EasyMock.replay(expandNode);
    return expandNode;
  }
View Full Code Here

    EasyMock.replay(expandNode);
    return expandNode;
  }

  public static ExpandSelectTreeNode mockCurrentExpandSelectTreeNode() {
    ExpandSelectTreeNode expandNode = EasyMock.createMock(ExpandSelectTreeNode.class);
    Map<String, ExpandSelectTreeNode> links = new HashMap<String, ExpandSelectTreeNode>();
    EasyMock.expect(expandNode.getLinks()).andStubReturn(links);
    List<EdmProperty> edmPropertyList = new ArrayList<EdmProperty>();
    edmPropertyList.add(mockEdmPropertyOfTarget());
    EasyMock.expect(expandNode.getProperties()).andReturn(edmPropertyList).anyTimes();
    EasyMock.replay(expandNode);
    return expandNode;
  }
View Full Code Here

  public void entryWithSelect() throws Exception {
    final EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Buildings");
    Map<String, Object> buildingData = new HashMap<String, Object>();
    buildingData.put("Id", "1");

    ExpandSelectTreeNode node = Mockito.mock(ExpandSelectTreeNode.class);
    Map<String, ExpandSelectTreeNode> links = new HashMap<String, ExpandSelectTreeNode>();
    links.put("nb_Rooms", null);
    Mockito.when(node.getLinks()).thenReturn(links);

    final ODataResponse response = new JsonEntityProvider().writeEntry(entitySet, buildingData,
        EntityProviderWriteProperties.serviceRoot(URI.create(BASE_URI)).expandSelectTree(node).build());
    final String json = verifyResponse(response);
    assertEquals("{\"d\":{\"__metadata\":{\"id\":\"" + BASE_URI + "Buildings('1')\","
View Full Code Here

    employeeData.put("EmployeeId", "1");
    employeeData.put("EntryDate", 0L);
    employeeData.put("getImageType", "image/jpeg");

    final EdmProperty property = (EdmProperty) entitySet.getEntityType().getProperty("EntryDate");
    ExpandSelectTreeNode node = Mockito.mock(ExpandSelectTreeNode.class);
    Mockito.when(node.getProperties()).thenReturn(Arrays.asList(property));

    EntityProviderWriteProperties writeProperties =
        EntityProviderWriteProperties.fromProperties(DEFAULT_PROPERTIES).serviceRoot(URI.create(BASE_URI))
            .expandSelectTree(node).build();
View Full Code Here

    final EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
    Map<String, Object> roomData = new HashMap<String, Object>();
    roomData.put("Id", "1");
    roomData.put("Version", 1);

    ExpandSelectTreeNode node2 = Mockito.mock(ExpandSelectTreeNode.class);
    Map<String, ExpandSelectTreeNode> links = new HashMap<String, ExpandSelectTreeNode>();
    links.put("nr_Building", node2);
    ExpandSelectTreeNode node1 = Mockito.mock(ExpandSelectTreeNode.class);
    Mockito.when(node1.getLinks()).thenReturn(links);

    class EntryCallback implements OnWriteEntryContent {
      @Override
      public WriteEntryCallbackResult retrieveEntryResult(final WriteEntryCallbackContext context)
          throws ODataApplicationException {
View Full Code Here

    final EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
    Map<String, Object> roomData = new HashMap<String, Object>();
    roomData.put("Id", "1");
    roomData.put("Version", 1);

    ExpandSelectTreeNode node2 = Mockito.mock(ExpandSelectTreeNode.class);
    Map<String, ExpandSelectTreeNode> links = new HashMap<String, ExpandSelectTreeNode>();
    links.put("nr_Building", node2);
    ExpandSelectTreeNode node1 = Mockito.mock(ExpandSelectTreeNode.class);
    Mockito.when(node1.getLinks()).thenReturn(links);

    class EntryCallback implements OnWriteEntryContent {
      @Override
      public WriteEntryCallbackResult retrieveEntryResult(final WriteEntryCallbackContext context)
          throws ODataApplicationException {
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.