Package org.apache.olingo.odata2.api.edm

Examples of org.apache.olingo.odata2.api.edm.EdmMapping


  private List<KeyPredicate> createKeyPredicates() throws EdmException {
    KeyPredicate keyPredicate = EasyMock.createMock(KeyPredicate.class);
    EasyMock.expect(keyPredicate.getLiteral()).andStubReturn("1");
    EdmProperty edmProperty = EasyMock.createMock(EdmProperty.class);
    EdmMapping edmMapping = EasyMock.createMock(EdmMapping.class);
    EasyMock.expect(edmMapping.getInternalName()).andStubReturn("soid");
    EasyMock.expect(edmProperty.getMapping()).andStubReturn(edmMapping);
    EdmSimpleType edmType = EasyMock.createMock(EdmSimpleType.class);
    EasyMock.expect(edmProperty.getType()).andStubReturn(edmType);
    EasyMock.expect(keyPredicate.getProperty()).andStubReturn(edmProperty);
View Full Code Here


    navPropertyProvider = new EdmNavigationPropertyImplProv(edmImplProv, navProperty);
  }

  @Test
  public void testMappingProperty() throws Exception {
    EdmMapping mapping = propertySimpleProvider.getMapping();
    assertNotNull(mapping);
    assertEquals("value", mapping.getInternalName());
    assertEquals("mimeType", mapping.getMimeType());
    assertEquals(mappedObject, mapping.getObject());
  }
View Full Code Here

    assertEquals(mappedObject, mapping.getObject());
  }

  @Test
  public void testMappingNavigationProperty() throws Exception {
    EdmMapping mapping = navPropertyProvider.getMapping();
    assertNotNull(mapping);
    assertEquals("value", mapping.getInternalName());
    assertEquals("mimeType", mapping.getMimeType());
    assertEquals(mappedObject, mapping.getObject());
  }
View Full Code Here

    return entitySet;
  }

  public static EdmEntityType mockSourceEdmEntityType() {
    EdmEntityType entityType = EasyMock.createMock(EdmEntityType.class);
    EdmMapping mapping = EasyMock.createMock(EdmMapping.class);
    List<String> navigationPropertyNames = new ArrayList<String>();
    List<String> propertyNames = new ArrayList<String>();
    propertyNames.add("id");
    propertyNames.add("description");
    navigationPropertyNames.add("SalesOrderLineItemDetails");
    try {
      EasyMock.expect(mapping.getInternalName()).andStubReturn("SalesOrderHeader");
      EasyMock.replay(mapping);
      EasyMock.expect(entityType.getName()).andStubReturn("SalesOrderHeader");
      EasyMock.expect(entityType.getMapping()).andStubReturn(mapping);
      EasyMock.expect(entityType.getNavigationPropertyNames()).andStubReturn(navigationPropertyNames);
      EasyMock.expect(entityType.getProperty("SalesOrderLineItemDetails")).andStubReturn(mockNavigationProperty());
View Full Code Here

  private static EdmTyped mockEdmPropertyOfSource2() {
    EdmProperty edmProperty = EasyMock.createMock(EdmProperty.class);
    EdmType type = EasyMock.createMock(EdmType.class);
    EasyMock.expect(type.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
    EasyMock.replay(type);
    EdmMapping mapping = EasyMock.createMock(EdmMapping.class);
    EasyMock.expect(mapping.getInternalName()).andStubReturn("description");
    EasyMock.replay(mapping);
    try {
      EasyMock.expect(edmProperty.getName()).andStubReturn("description");
      EasyMock.expect(edmProperty.getType()).andStubReturn(type);
      EasyMock.expect(edmProperty.getMapping()).andStubReturn(mapping);
View Full Code Here

  private static EdmProperty mockEdmPropertyOfSource1() {
    EdmProperty edmProperty = EasyMock.createMock(EdmProperty.class);
    EdmType type = EasyMock.createMock(EdmType.class);
    EasyMock.expect(type.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
    EasyMock.replay(type);
    EdmMapping mapping = EasyMock.createMock(EdmMapping.class);
    EasyMock.expect(mapping.getInternalName()).andStubReturn("id");
    EasyMock.replay(mapping);
    try {
      EasyMock.expect(edmProperty.getName()).andStubReturn("id");
      EasyMock.expect(edmProperty.getType()).andStubReturn(type);
      EasyMock.expect(edmProperty.getMapping()).andStubReturn(mapping);
View Full Code Here

    return navigationPropSegment;
  }

  public static EdmNavigationProperty mockSecondNavigationProperty() {
    EdmNavigationProperty navigationProperty = EasyMock.createMock(EdmNavigationProperty.class);
    EdmMapping mapping = EasyMock.createMock(EdmMapping.class);
    EasyMock.expect(mapping.getInternalName()).andStubReturn("materials");
    EasyMock.replay(mapping);
    try {
      EasyMock.expect(navigationProperty.getMultiplicity()).andStubReturn(EdmMultiplicity.ONE);
      EasyMock.expect(navigationProperty.getMapping()).andStubReturn(mapping);
      EasyMock.expect(navigationProperty.getName()).andStubReturn("MaterialDetails");
View Full Code Here

  }

  private static EdmEntityType mockThirdEdmEntityType() {
    EdmEntityType entityType = EasyMock.createMock(EdmEntityType.class);
    EdmMapping mapping = EasyMock.createMock(EdmMapping.class);

    List<String> propertyNames = new ArrayList<String>();
    propertyNames.add("price");
    try {
      EasyMock.expect(mapping.getInternalName()).andStubReturn("Material");
      EasyMock.replay(mapping);
      EasyMock.expect(entityType.getName()).andStubReturn("Material");
      EasyMock.expect(entityType.getMapping()).andStubReturn(mapping);
      EdmProperty property = mockEdmPropertyOfTarget();
      EasyMock.expect(entityType.getProperty("price")).andStubReturn(property);
View Full Code Here

    return entityType;
  }

  public static EdmEntityType mockTargetEdmEntityType() {
    EdmEntityType entityType = EasyMock.createMock(EdmEntityType.class);
    EdmMapping mapping = EasyMock.createMock(EdmMapping.class);

    List<String> propertyNames = new ArrayList<String>();
    propertyNames.add("price");
    try {
      EasyMock.expect(mapping.getInternalName()).andStubReturn("SalesOrderLineItem");
      EasyMock.replay(mapping);
      EasyMock.expect(entityType.getName()).andStubReturn("SalesOrderLineItem");
      EasyMock.expect(entityType.getMapping()).andStubReturn(mapping);
      EdmProperty property = mockEdmPropertyOfTarget();
      EasyMock.expect(entityType.getProperty("price")).andStubReturn(property);
View Full Code Here

    EdmProperty edmProperty = EasyMock.createMock(EdmProperty.class);

    EdmType type = EasyMock.createMock(EdmType.class);
    EasyMock.expect(type.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
    EasyMock.replay(type);
    EdmMapping mapping = EasyMock.createMock(EdmMapping.class);
    EasyMock.expect(mapping.getInternalName()).andStubReturn("price");
    EasyMock.replay(mapping);
    try {
      EasyMock.expect(edmProperty.getName()).andStubReturn("price");
      EasyMock.expect(edmProperty.getType()).andStubReturn(type);
      EasyMock.expect(edmProperty.getMapping()).andStubReturn(mapping);
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.api.edm.EdmMapping

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.