Examples of EdmType


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

    try {
      String etag = null;

      Collection<EntityPropertyInfo> propertyInfos = eia.getETagPropertyInfos();
      for (EntityPropertyInfo propertyInfo : propertyInfos) {
        EdmType edmType = propertyInfo.getType();
        if (edmType instanceof EdmSimpleType) {
          EdmSimpleType edmSimpleType = (EdmSimpleType) edmType;
          if (etag == null) {
            etag =
                edmSimpleType.valueToString(data.get(propertyInfo.getName()), EdmLiteralKind.DEFAULT, propertyInfo
View Full Code Here

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

    return objEdmEntityType;
  }

  private List<EdmProperty> getKeyProperties() {
    List<EdmProperty> edmProperties = new ArrayList<EdmProperty>();
    EdmType edmType = EasyMock.createMock(EdmType.class);
    EasyMock.expect(edmType.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
    EasyMock.replay(edmType);
    EdmProperty edmProperty = EasyMock.createMock(EdmProperty.class);
    EdmMapping edmMapping = EasyMock.createMock(EdmMapping.class);
    EasyMock.expect(edmMapping.getInternalName()).andStubReturn("soId");
    EasyMock.replay(edmMapping);
View Full Code Here

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

  public void testparse2EdmPropertyValueMap() {
    JPAEntityParser resultParser = new JPAEntityParser();
    Object jpaEntity = new demoItem("abc", 10);
    EdmStructuralType structuralType = EasyMock.createMock(EdmStructuralType.class);
    EdmProperty edmTyped = EasyMock.createMock(EdmProperty.class);
    EdmType edmType = EasyMock.createMock(EdmType.class);
    EdmProperty edmTyped01 = EasyMock.createMock(EdmProperty.class);
    EdmType edmType01 = EasyMock.createMock(EdmType.class);
    EdmMapping edmMapping = EasyMock.createMock(EdmMapping.class);
    EdmMapping edmMapping01 = EasyMock.createMock(EdmMapping.class);

    try {
      EasyMock.expect(edmType.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
      EasyMock.expect(edmTyped.getName()).andStubReturn("identifier");
      EasyMock.replay(edmType);
      EasyMock.expect(edmMapping.getInternalName()).andStubReturn("id");
      EasyMock.replay(edmMapping);
      EasyMock.expect(edmTyped.getType()).andStubReturn(edmType);
      EasyMock.expect(edmTyped.getMapping()).andStubReturn(edmMapping);
      EasyMock.replay(edmTyped);
      EasyMock.expect(structuralType.getProperty("identifier")).andStubReturn(edmTyped);

      EasyMock.expect(edmType01.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
      EasyMock.expect(edmTyped01.getName()).andStubReturn("Value");
      EasyMock.replay(edmType01);
      EasyMock.expect(edmMapping01.getInternalName()).andStubReturn("value");
      EasyMock.replay(edmMapping01);
      EasyMock.expect(edmTyped01.getType()).andStubReturn(edmType01);
View Full Code Here

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

    JPAEntityParser resultParser = new JPAEntityParser();
    Object jpaEntity = new demoItem("abc", 10);
    EdmStructuralType structuralType = EasyMock
        .createMock(EdmStructuralType.class);
    EdmProperty edmTyped = EasyMock.createMock(EdmProperty.class);
    EdmType edmType = EasyMock.createMock(EdmType.class);
    EdmProperty edmTyped01 = EasyMock.createMock(EdmProperty.class);
    EdmType edmType01 = EasyMock.createMock(EdmType.class);
    EdmMapping edmMapping = EasyMock.createMock(EdmMapping.class);
    EdmMapping edmMapping01 = EasyMock.createMock(EdmMapping.class);

    try {
      EasyMock.expect(edmType.getKind())
          .andStubReturn(EdmTypeKind.SIMPLE);
      EasyMock.expect(edmType.getName()).andReturn("identifier");
      EasyMock.replay(edmType);
      EasyMock.expect(edmMapping.getInternalName()).andStubReturn("id");
      EasyMock.replay(edmMapping);
      EasyMock.expect(edmTyped.getType()).andStubThrow(
          new EdmException(null));
      EasyMock.expect(edmTyped.getMapping()).andStubReturn(edmMapping);
      EasyMock.expect(edmTyped.getName()).andReturn("identifier").anyTimes();
      EasyMock.replay(edmTyped);
      EasyMock.expect(structuralType.getProperty("identifier"))
          .andStubReturn(edmTyped);

      EasyMock.expect(edmType01.getKind()).andStubReturn(
          EdmTypeKind.SIMPLE);
      EasyMock.expect(edmType01.getName()).andStubReturn("value");
      EasyMock.replay(edmType01);
      EasyMock.expect(edmMapping01.getInternalName()).andStubReturn(
          "value");
      EasyMock.replay(edmMapping01);
      EasyMock.expect(edmTyped01.getName()).andReturn("value").anyTimes();
View Full Code Here

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

    List<EdmProperty> selectPropertyList = new ArrayList<EdmProperty>();
    // Mocking EdmProperties
    EdmProperty edmProperty1 = EasyMock.createMock(EdmProperty.class);
    EdmProperty edmProperty2 = EasyMock.createMock(EdmProperty.class);
    EdmProperty edmComplexProperty = EasyMock.createMock(EdmProperty.class);
    EdmType edmType1 = EasyMock.createMock(EdmType.class);
    EdmStructuralType edmType2 = EasyMock.createMock(EdmStructuralType.class);
    EdmType edmComplexType = EasyMock.createMock(EdmType.class);
    EdmMapping mapping1 = EasyMock.createMock(EdmMapping.class);
    EdmMapping mapping2 = EasyMock.createMock(EdmMapping.class);
    EdmMapping complexMapping = EasyMock.createMock(EdmMapping.class);
    try {
      EasyMock.expect(edmType1.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
      EasyMock.replay(edmType1);
      EasyMock.expect(mapping1.getInternalName()).andStubReturn("id");
      EasyMock.replay(mapping1);
      EasyMock.expect(edmProperty1.getName()).andStubReturn("Id");
      EasyMock.expect(edmProperty1.getMapping()).andStubReturn(mapping1);
      EasyMock.expect(edmProperty1.getType()).andStubReturn(edmType1);
      EasyMock.replay(edmProperty1);
      // Mocking the complex properties
      EasyMock.expect(edmComplexType.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
      EasyMock.replay(edmComplexType);
      EasyMock.expect(complexMapping.getInternalName()).andStubReturn("order");
      EasyMock.replay(complexMapping);
      EasyMock.expect(edmComplexProperty.getName()).andStubReturn("OrderName");
      EasyMock.expect(edmComplexProperty.getMapping()).andStubReturn(complexMapping);
View Full Code Here

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

    EdmMapping edmMapping = EasyMock.createMock(EdmMapping.class);
    EasyMock.expect(edmMapping.getInternalName()).andStubReturn("Field1");
    EasyMock.replay(edmMapping);

    EdmType edmType = EasyMock.createMock(EdmType.class);

    try {
      EasyMock.expect(edmType.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
      EasyMock.expect(edmType.getName()).andStubReturn("identifier");
      EasyMock.expect(edmTyped.getName()).andStubReturn("SalesOrderHeader");
      EasyMock.expect(edmTyped.getMapping()).andStubReturn(edmMapping);

      EasyMock.expect(edmTyped.getType()).andStubReturn(edmType);
      EasyMock.expect(edmTyped.getMapping()).andStubReturn(edmMapping);
View Full Code Here

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

      return;
    }
    // e.g. "$filter='Hong Kong' eq address/city" --> city is "checked" against the type of the property "address".
    // "address" itself must be a (navigation)property of the resource entity type of the last URL segment AND
    // "address" must have a structural edm type
    EdmType parentType = leftExpression.getEdmType(); // parentType point now to the type of property "address"

    if ((actBinOp != null) && (actBinOp.operator.getOperator() != BinaryOperator.PROPERTY_ACCESS)) {
      validateEdmPropertyOfStructuredType(resourceEntityType, property, propertyToken);
      return;
    } else {
View Full Code Here

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

   */

  protected void validateUnaryOperatorTypes(final UnaryExpression unaryExpression)
      throws ExpressionParserInternalError {
    InfoUnaryOperator unOpt = availableUnaryOperators.get(unaryExpression.getOperator().toUriLiteral());
    EdmType operandType = unaryExpression.getOperand().getEdmType();

    if ((operandType == null) && (resourceEntityType == null)) {
      return;
    }

View Full Code Here

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

  protected void validateBinaryOperatorTypes(final BinaryExpression binaryExpression) throws ExpressionParserException,
      ExpressionParserInternalError {
    InfoBinaryOperator binOpt = availableBinaryOperators.get(binaryExpression.getOperator().toUriLiteral());

    List<EdmType> actualParameterTypes = new ArrayList<EdmType>();
    EdmType operand = binaryExpression.getLeftOperand().getEdmType();

    if ((operand == null) && (resourceEntityType == null)) {
      return;
    }
    actualParameterTypes.add(operand);
View Full Code Here

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

  private EdmTyped getEdmTypedMockedObj(final String propertyName) {
    EdmProperty mockedEdmProperty = EasyMock.createMock(EdmProperty.class);
    try {
      EasyMock.expect(mockedEdmProperty.getMapping()).andStubReturn(getEdmMappingMockedObj(propertyName));
      EdmType edmType = EasyMock.createMock(EdmType.class);
      EasyMock.expect(edmType.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
      EasyMock.replay(edmType);
      EasyMock.expect(mockedEdmProperty.getName()).andStubReturn("identifier");
      EasyMock.expect(mockedEdmProperty.getType()).andStubReturn(edmType);
      EasyMock.expect(mockedEdmProperty.getFacets()).andStubReturn(getEdmFacetsMockedObj());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.