You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/04/04 07:50:55 UTC

[01/21] git commit: [OLINGO-206] TDD setup for URI Validator

Repository: olingo-odata4
Updated Branches:
  refs/heads/master 8a0d51977 -> 7dae5ef33


[OLINGO-206] TDD setup for URI Validator


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/df675e15
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/df675e15
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/df675e15

Branch: refs/heads/master
Commit: df675e15af95bc82a15ed4982bf02c0d4614a625
Parents: ec39fd6
Author: Stephan Klevenz <st...@sap.com>
Authored: Fri Mar 14 15:56:13 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Fri Mar 14 15:56:13 2014 +0100

----------------------------------------------------------------------
 .../uri/validator/UriValidationException.java   |  25 ++++
 .../server/core/uri/validator/Validator.java    |  37 ++++++
 .../core/uri/validator/UriEdmValidatorTest.java | 130 +++++++++++++++++++
 3 files changed, 192 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/df675e15/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
new file mode 100644
index 0000000..d0f4b8c
--- /dev/null
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.server.core.uri.validator;
+
+public class UriValidationException extends Exception {
+
+  private static final long serialVersionUID = -3179078078053564742L;
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/df675e15/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/Validator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/Validator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/Validator.java
new file mode 100644
index 0000000..0442563
--- /dev/null
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/Validator.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.server.core.uri.validator;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.server.api.uri.UriInfo;
+
+public class Validator {
+
+  public void validate(UriInfo uriInfo, Edm edm) throws UriValidationException {
+    switch (uriInfo.getKind()) {
+    case metadata:
+      if (uriInfo.getTopOption() != null) {
+        throw new UriValidationException();
+      }
+      break;
+      default:
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/df675e15/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
new file mode 100644
index 0000000..106b4ce
--- /dev/null
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.server.core.uri.validator;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.*;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.server.api.uri.UriInfo;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+import org.apache.olingo.server.core.testutil.EdmTechProvider;
+import org.apache.olingo.server.core.uri.parser.Parser;
+import org.apache.olingo.server.core.uri.parser.RawUri;
+import org.apache.olingo.server.core.uri.parser.UriDecoder;
+import org.apache.olingo.server.core.uri.parser.UriParserException;
+import org.junit.Test;
+
+public class UriEdmValidatorTest {
+
+  private Edm edm = new EdmProviderImpl(new EdmTechProvider());
+
+  String[] uris = {
+      "$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid                                                                    ",
+      "$crossjoin(invalidEntitySet)                                                                                 ",
+      "$entity                                                                                                      ",
+      "$entity?$idfalse=ESKeyNav(1)                                                                                 ",
+      "ESAllPrim(PropertyInt16='1')                                                                                 ",
+      "ESCollAllPrim(null)                                                                                          ",
+      "ESTwoPrim(1)/com.sap.odata.test1.ETBase(1)                                                                   ",
+      "ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase(1)                                     ",
+      "ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase(1)                                     ",
+      "FICRTCollCTTwoPrimParam(ParameterInt16='1',ParameterString='2')                                              ",
+      "FICRTESTwoKeyNavParam(ParameterInt16=@invalidAlias)?@validAlias=1                                            ",
+      "FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/PropertyComplex                         ",
+      "FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/$count                                  ",
+      "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$ref                                                              ",
+      "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$count                                                            ",
+      "ESKeyNav?$top=-3                                                                                             ",
+      "ESAllPrim?$count=foo                                                                                         ",
+      "ESAllPrim?$skip=-3                                                                                           "
+  };
+
+  @Test
+  public void foo() throws Exception {
+    for (String uri : uris) {
+      Parser parser = new Parser();
+      System.out.println(uri);
+      UriInfo uriInfo = parser.parseUri(uri.trim(), edm);
+      assertNotNull(uriInfo);
+    }
+  }
+
+  @Test
+  public void keyPredicateValidTypes() throws Exception {
+    String[] uris = { "/ESAllPrim" };
+
+    for (String uri : uris) {
+      parseAndValidate(uri);
+    }
+
+  }
+
+  @Test
+  public void keyPredicateInvalidTypes() throws UriParserException {
+    String[] uris = {};
+
+    for (String uri : uris) {
+
+      try {
+        parseAndValidate(uri);
+        fail("Validation Exception not thrown: " + uri);
+      } catch (UriValidationException e) {
+        assertTrue(e instanceof UriValidationException);
+      }
+    }
+  }
+
+  @Test
+  public void systemQueryOptionValid() throws Exception {
+    String[] uris = {
+        "/$metadata",
+        "/$metadata?$format=json"
+    };
+
+    for (String uri : uris) {
+      parseAndValidate(uri);
+    }
+
+  }
+
+  @Test
+  public void systemQueryOptionInvalid() throws Exception {
+    String[] uris = {
+        "/$metadata?$format=json&$top=3"
+    };
+
+    for (String uri : uris) {
+
+      try {
+        parseAndValidate(uri);
+        fail("Validation Exception not thrown: " + uri);
+      } catch (UriValidationException e) {
+        assertTrue(e instanceof UriValidationException);
+      }
+    }
+  }
+
+  private void parseAndValidate(String uri) throws UriParserException, UriValidationException {
+    UriInfo uriInfo = new Parser().parseUri(uri.trim(), edm);
+    Validator validator = new Validator();
+    validator.validate(uriInfo, edm);
+  }
+}


[13/21] git commit: [OLINGO-206] key predicate validation

Posted by sk...@apache.org.
[OLINGO-206] key predicate validation


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/fbafc3a4
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/fbafc3a4
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/fbafc3a4

Branch: refs/heads/master
Commit: fbafc3a4fdab5d3cc05e6bb5c0e87c3b0a8eb41f
Parents: 9a980e8
Author: Stephan Klevenz <st...@sap.com>
Authored: Fri Mar 28 16:08:33 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Fri Mar 28 16:08:33 2014 +0100

----------------------------------------------------------------------
 .../core/uri/UriResourceWithKeysImpl.java       | 22 ++++---
 .../uri/validator/UriValidationException.java   |  9 ++-
 .../server/core/uri/validator/UriValidator.java | 69 ++++++++++++++++----
 .../core/uri/validator/UriEdmValidatorTest.java | 39 ++++++-----
 4 files changed, 96 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fbafc3a4/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java
index f8827fa..aef5800 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java
@@ -1,18 +1,18 @@
-/* 
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * regarding copyright ownership. The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * with the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
@@ -47,8 +47,10 @@ public abstract class UriResourceWithKeysImpl extends UriResourceImpl implements
 
   public List<UriParameter> getKeyPredicates() {
     List<UriParameter> retList = new ArrayList<UriParameter>();
-    for (UriParameterImpl item : keyPredicates) {
-      retList.add(item);
+    if (keyPredicates != null) {
+      for (UriParameterImpl item : keyPredicates) {
+        retList.add(item);
+      }
     }
     return retList;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fbafc3a4/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
index 3ba323d..c9c664d 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
@@ -18,12 +18,17 @@
  */
 package org.apache.olingo.server.core.uri.validator;
 
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
 public class UriValidationException extends Exception {
 
+  private static final long serialVersionUID = -3179078078053564742L;
+
   public UriValidationException(String msg) {
     super(msg);
   }
 
-  private static final long serialVersionUID = -3179078078053564742L;
-
+  public UriValidationException(EdmPrimitiveTypeException e) {
+    super(e);
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fbafc3a4/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
index a8f1790..2530908 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
@@ -18,14 +18,24 @@
  */
 package org.apache.olingo.server.core.uri.validator;
 
+import java.util.HashMap;
+import java.util.List;
+
 import org.apache.olingo.commons.api.ODataRuntimeException;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.EdmReturnType;
+import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.server.api.uri.UriInfo;
+import org.apache.olingo.server.api.uri.UriParameter;
 import org.apache.olingo.server.api.uri.UriResource;
 import org.apache.olingo.server.api.uri.UriResourceAction;
+import org.apache.olingo.server.api.uri.UriResourceEntitySet;
 import org.apache.olingo.server.api.uri.UriResourceFunction;
+import org.apache.olingo.server.api.uri.UriResourceKind;
 import org.apache.olingo.server.api.uri.UriResourceNavigation;
 import org.apache.olingo.server.api.uri.UriResourcePartTyped;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
@@ -439,20 +449,14 @@ public class UriValidator {
   }
 
   private void validateQueryOptions(final UriInfo uriInfo, Edm edm) throws UriValidationException {
-    try {
-      RowIndexForUriType row = rowIndexForUriType(uriInfo, edm);
-
-      for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
-        ColumnIndex col = colIndex(option.getKind());
+    RowIndexForUriType row = rowIndexForUriType(uriInfo, edm);
 
-        System.out.print("[" + row + "][" + col + "]");
+    for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
+      ColumnIndex col = colIndex(option.getKind());
 
-        if (!decisionMatrix[row.getIndex()][col.getIndex()]) {
-          throw new UriValidationException("System query option not allowed: " + option.getName());
-        }
+      if (!decisionMatrix[row.getIndex()][col.getIndex()]) {
+        throw new UriValidationException("System query option not allowed: " + option.getName());
       }
-    } finally {
-      System.out.println();
     }
 
   }
@@ -492,6 +496,45 @@ public class UriValidator {
     return idx;
   }
 
-  private void validateKeyPredicateTypes(final UriInfo uriInfo, final Edm edm) throws UriValidationException {}
-
+  private void validateKeyPredicateTypes(final UriInfo uriInfo, final Edm edm) throws UriValidationException {
+    try {
+      for (UriResource pathSegment : uriInfo.getUriResourceParts()) {
+        if (pathSegment.getKind() == UriResourceKind.entitySet) {
+          UriResourceEntitySet pathEntitySet = (UriResourceEntitySet) pathSegment;
+
+          EdmEntityType type = pathEntitySet.getEntityType();
+          List<EdmKeyPropertyRef> keys = type.getKeyPropertyRefs();
+          List<UriParameter> keyPredicates = pathEntitySet.getKeyPredicates();
+
+          if (null != keyPredicates) {
+
+            HashMap<String, EdmKeyPropertyRef> edmKeys = new HashMap<String, EdmKeyPropertyRef>();
+            for (EdmKeyPropertyRef key : keys) {
+              edmKeys.put(key.getKeyPropertyName(), key);
+            }
+
+            for (UriParameter keyPredicate : keyPredicates) {
+              String name = keyPredicate.getName();
+              String value = keyPredicate.getText();
+              EdmKeyPropertyRef edmKey = edmKeys.get(name);
+
+              if (edmKey == null) {
+                throw new UriValidationException("Unknown key property: " + name);
+              }
+
+              EdmType edmType = edmKey.getProperty().getType();
+              EdmPrimitiveType edmPrimitiveType = (EdmPrimitiveType) edmType;
+
+              String edmLiteral = edmPrimitiveType.fromUriLiteral(value);
+              edmPrimitiveType.validate(edmLiteral, edmKey.getProperty().isNullable(), edmKey.getProperty()
+                  .getMaxLength(), edmKey.getProperty().getPrecision(), edmKey.getProperty().getScale(), edmKey
+                  .getProperty().isUnicode());
+            }
+          }
+        }
+      }
+    } catch (EdmPrimitiveTypeException e) {
+      throw new UriValidationException(e);
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fbafc3a4/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
index a76cee5..4865f8b 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -73,8 +73,6 @@ public class UriEdmValidatorTest {
   private static final String QO_LEVELS = "$expand=*($levels=1)";
   private static final String QO_TOP = "$top=1";
 
-  private Edm edm = new EdmProviderImpl(new EdmTechProvider());
-
   private String[][] urisWithValidSystemQueryOptions = {
       { URI_ALL, QO_FILTER, }, { URI_ALL, QO_FORMAT }, { URI_ALL, QO_EXPAND }, { URI_ALL, QO_COUNT },
       /* { URI_ALL, QO_ORDERBY }, *//* { URI_ALL, QO_SEARCH }, */{ URI_ALL, QO_SELECT }, { URI_ALL, QO_SKIP },
@@ -249,28 +247,33 @@ public class UriEdmValidatorTest {
       { URI_NAV_ENTITY_SET, QO_ID },
 
   };
-  
+
   private Parser parser;
+  private Edm edm;
 
   @Before
   public void before() {
     parser = new Parser();
+    edm = new EdmProviderImpl(new EdmTechProvider());
   }
 
-//  @Test
-//  @Ignore
-//      public
-//      void bla() throws Exception {
-//    String[][] m = {
-//        { "/ESMedia(1)/$value?$filter='1' eq '1'" },
-//    };
-//    String[] uris = constructUri(m);
-//    for (String uri : uris) {
-//      System.out.println(uri);
-//
-//      parseAndValidate(uri);
-//    }
-//  }
+  @Test(expected = UriValidationException.class)
+  public void validateKeyPredicatesWrongKey() throws Exception {
+    String uri = "ESTwoKeyNav(xxx=1, yyy='abc')";
+    parseAndValidate(uri);
+  }
+
+  @Test
+  public void validateKeyPredicates() throws Exception {
+    String uri = "ESTwoKeyNav(PropertyInt16=1, PropertyString='abc')";
+    parseAndValidate(uri);
+  }
+
+  @Test(expected = UriValidationException.class)
+  public void validateKeyPredicatesWrongValueType() throws Exception {
+    String uri = "ESTwoKeyNav(PropertyInt16='abc', PropertyString=1)";
+    parseAndValidate(uri);
+  }
 
   @Test
   public void checkValidSystemQueryOption() throws Exception {
@@ -321,7 +324,7 @@ public class UriEdmValidatorTest {
     UriInfo uriInfo = parser.parseUri(uri.trim(), edm);
     UriValidator validator = new UriValidator();
 
-    System.out.print("URI: " + uri);
     validator.validate(uriInfo, edm, "GET");
   }
+
 }


[02/21] git commit: [OLINGO-206] introduce decision matrix

Posted by sk...@apache.org.
[OLINGO-206] introduce decision matrix


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/c0db941b
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/c0db941b
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/c0db941b

Branch: refs/heads/master
Commit: c0db941b8529f224540062073f6466d2076696a3
Parents: df675e1
Author: Stephan Klevenz <st...@sap.com>
Authored: Mon Mar 17 17:14:27 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Mon Mar 17 17:16:49 2014 +0100

----------------------------------------------------------------------
 .../apache/olingo/server/api/uri/UriInfo.java   |   7 +
 .../olingo/server/core/uri/UriInfoImpl.java     | 101 ++++++------
 .../uri/validator/SystemQueryValidator.java     | 159 +++++++++++++++++++
 .../uri/validator/UriValidationException.java   |   4 +
 .../server/core/uri/validator/Validator.java    |  37 -----
 .../core/uri/validator/UriEdmValidatorTest.java |  66 ++++----
 6 files changed, 254 insertions(+), 120 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c0db941b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
index 41d9c6c..c0a140c 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
@@ -18,6 +18,11 @@
  */
 package org.apache.olingo.server.api.uri;
 
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
+
 /**
  * Object acting as general access to URI information extracted from the request URI. Depending on
  * the URI info kind different interfaces are used to provide access to that information. </p>
@@ -43,4 +48,6 @@ public interface UriInfo extends
 
   public UriInfoResource asUriInfoResource();
 
+  public Collection<SystemQueryOption> getSystemQueryOptions();
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c0db941b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
index a04b55f..758d8d9 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
@@ -1,27 +1,30 @@
-/* 
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * regarding copyright ownership. The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * with the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
 package org.apache.olingo.server.core.uri;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 
+import org.apache.olingo.commons.api.ODataRuntimeException;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
 import org.apache.olingo.server.api.uri.UriInfo;
 import org.apache.olingo.server.api.uri.UriInfoAll;
@@ -44,22 +47,12 @@ import org.apache.olingo.server.api.uri.queryoption.SearchOption;
 import org.apache.olingo.server.api.uri.queryoption.SelectOption;
 import org.apache.olingo.server.api.uri.queryoption.SkipOption;
 import org.apache.olingo.server.api.uri.queryoption.SkipTokenOption;
+import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
 import org.apache.olingo.server.api.uri.queryoption.TopOption;
-import org.apache.olingo.server.core.uri.queryoption.CountOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.CustomQueryOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.FormatOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.IdOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.OrderByOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.QueryOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SearchOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SelectOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SkipOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SkipTokenOptionImpl;
 import org.apache.olingo.server.core.uri.queryoption.SystemQueryOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.TopOptionImpl;
 
 public class UriInfoImpl implements UriInfo {
 
@@ -68,19 +61,10 @@ public class UriInfoImpl implements UriInfo {
   private List<String> entitySetNames = new ArrayList<String>(); // for $entity
   private EdmEntityType entityTypeCast; // for $entity
 
-  // Query options
   private List<CustomQueryOptionImpl> customQueryOptions = new ArrayList<CustomQueryOptionImpl>();
-  private ExpandOptionImpl expandOption;
-  private FilterOptionImpl filterOption;
-  private FormatOptionImpl formatOption;
-  private IdOption idOption;
-  private CountOptionImpl inlineCountOption;
-  private OrderByOptionImpl orderByOption;
-  private SearchOptionImpl searchOption;
-  private SelectOptionImpl selectOption;
-  private SkipOptionImpl skipOption;
-  private SkipTokenOptionImpl skipTokenOption;
-  private TopOptionImpl topOption;
+
+  HashMap<SystemQueryOptionKind, SystemQueryOption> systemQueryOptions =
+      new HashMap<SystemQueryOptionKind, SystemQueryOption>();
 
   private String fragment;
 
@@ -162,27 +146,27 @@ public class UriInfoImpl implements UriInfo {
 
   @Override
   public ExpandOption getExpandOption() {
-    return expandOption;
+    return (ExpandOption) systemQueryOptions.get(SystemQueryOptionKind.EXPAND);
   }
 
   @Override
   public FilterOption getFilterOption() {
-    return filterOption;
+    return (FilterOption) systemQueryOptions.get(SystemQueryOptionKind.FILTER);
   }
 
   @Override
   public FormatOption getFormatOption() {
-    return formatOption;
+    return (FormatOption) systemQueryOptions.get(SystemQueryOptionKind.FORMAT);
   }
 
   @Override
   public IdOption getIdOption() {
-    return idOption;
+    return (IdOption) systemQueryOptions.get(SystemQueryOptionKind.ID);
   }
 
   @Override
   public CountOption getCountOption() {
-    return inlineCountOption;
+    return (CountOption) systemQueryOptions.get(SystemQueryOptionKind.COUNT);
   }
 
   @Override
@@ -201,33 +185,33 @@ public class UriInfoImpl implements UriInfo {
 
   @Override
   public OrderByOption getOrderByOption() {
-    return orderByOption;
+    return (OrderByOption) systemQueryOptions.get(SystemQueryOptionKind.ORDERBY);
   }
 
   @Override
   public SearchOption getSearchOption() {
 
-    return searchOption;
+    return (SearchOption) systemQueryOptions.get(SystemQueryOptionKind.SEARCH);
   }
 
   @Override
   public SelectOption getSelectOption() {
-    return selectOption;
+    return (SelectOption) systemQueryOptions.get(SystemQueryOptionKind.SELECT);
   }
 
   @Override
   public SkipOption getSkipOption() {
-    return skipOption;
+    return (SkipOption) systemQueryOptions.get(SystemQueryOptionKind.SKIP);
   }
 
   @Override
   public SkipTokenOption getSkipTokenOption() {
-    return skipTokenOption;
+    return (SkipTokenOption) systemQueryOptions.get(SystemQueryOptionKind.SKIPTOKEN);
   }
 
   @Override
   public TopOption getTopOption() {
-    return topOption;
+    return (TopOption) systemQueryOptions.get(SystemQueryOptionKind.TOP);
   }
 
   public UriInfoImpl setQueryOptions(final List<QueryOptionImpl> list) {
@@ -249,28 +233,33 @@ public class UriInfoImpl implements UriInfo {
   public UriInfoImpl setSystemQueryOption(final SystemQueryOptionImpl systemOption) {
 
     if (systemOption.getKind() == SystemQueryOptionKind.EXPAND) {
-      expandOption = (ExpandOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.EXPAND, systemOption);
     } else if (systemOption.getKind() == SystemQueryOptionKind.FILTER) {
-      filterOption = (FilterOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.FILTER, systemOption);
     } else if (systemOption.getKind() == SystemQueryOptionKind.FORMAT) {
-      formatOption = (FormatOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.FORMAT, systemOption);
     } else if (systemOption.getKind() == SystemQueryOptionKind.ID) {
-      idOption = (IdOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.ID, systemOption);
     } else if (systemOption.getKind() == SystemQueryOptionKind.COUNT) {
-      inlineCountOption = (CountOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.COUNT, systemOption);
     } else if (systemOption.getKind() == SystemQueryOptionKind.ORDERBY) {
-      orderByOption = (OrderByOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.ORDERBY, systemOption);
     } else if (systemOption.getKind() == SystemQueryOptionKind.SEARCH) {
-      searchOption = (SearchOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.SEARCH, systemOption);
     } else if (systemOption.getKind() == SystemQueryOptionKind.SELECT) {
-      selectOption = (SelectOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.SELECT, systemOption);
     } else if (systemOption.getKind() == SystemQueryOptionKind.SKIP) {
-      skipOption = (SkipOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.SKIP, systemOption);
     } else if (systemOption.getKind() == SystemQueryOptionKind.SKIPTOKEN) {
-      skipTokenOption = (SkipTokenOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.SKIPTOKEN, systemOption);
     } else if (systemOption.getKind() == SystemQueryOptionKind.TOP) {
-      topOption = (TopOptionImpl) systemOption;
+      systemQueryOptions.put(SystemQueryOptionKind.TOP, systemOption);
+    } else if (systemOption.getKind() == SystemQueryOptionKind.LEVELS) {
+      systemQueryOptions.put(SystemQueryOptionKind.LEVELS, systemOption);
+    } else {
+      throw new ODataRuntimeException("Unsupported System Query Option: " + systemOption.getName());
     }
+
     return this;
   }
 
@@ -291,6 +280,10 @@ public class UriInfoImpl implements UriInfo {
 
   public void removeResourcePart(int index) {
     this.pathParts.remove(index);
-    
+  }
+
+  @Override
+  public Collection<SystemQueryOption> getSystemQueryOptions() {
+    return Collections.unmodifiableCollection(systemQueryOptions.values());
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c0db941b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
new file mode 100644
index 0000000..0fd944f
--- /dev/null
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.server.core.uri.validator;
+
+import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.server.api.uri.UriInfo;
+import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
+import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
+
+public class SystemQueryValidator {
+
+  //@formatter:off (Eclipse formatter)
+  //CHECKSTYLE:OFF (Maven checkstyle)
+  private boolean[][] decisionMatrix =
+      {
+          /*                                       FILTER FORMAT EXPAND ID     COUNT  ORDERBY SEARCH SELECT SKIP   SKIPTOKEN LEVELS TOP */
+          /*                              all */ { true , true , true , false, true , true ,  true , true , true , true ,    true , false },
+          /*                            batch */ { false, false, false, false, false, false,  false, false, false, false,    false, false },
+          /*                        crossjoin */ { true , true , true , false, true , true ,  true , true , true , true ,    true , true  },
+          /*                         entityId */ { false, true , true , true , false, false,  false, true , false, false,    true , false },
+          /*                         metadata */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
+          /*                         resource */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
+          /*                          service */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
+          /*                        entitySet */ { true , true , true , false, true , true ,  true , true , true , true ,    true , true  },
+          /*                   entitySetCount */ { false, false, false, false, false, false,  false, false, false, false,    false, false },
+          /*                           entity */ { false, true , true , false, false, false,  false, true , false, false,    true , false },
+          /*                      mediaStream */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
+          /*                       references */ { true , true , false, false, false, true ,  true , false, true , true ,    false, true  },
+          /*                        reference */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
+          /*                  propertyComplex */ { false, true , true , false, false, false,  false, true , false, false,    true , false },
+          /*        propertyComplexCollection */ { true , true , true , false, true , true ,  false, false, true , true ,    true , true  },
+          /*   propertyComplexCollectionCount */ { false, false, false, false, false, false,  false, false, false, false,    false, false },
+          /*                propertyPrimitive */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
+          /*      propertyPrimitiveCollection */ { true , true , false, false, false, true ,  false, false, true , true ,    false, true  },
+          /* propertyPrimitiveCollectionCount */ { false, false, false, false, false, false,  false, false, false, false,    false, false },
+          /*           propertyPrimitiveValue */ { false, true , false, false, false, false,  false, false, false, false,    false, false },          
+      };
+  //CHECKSTYLE:ON
+  //@formatter:on
+
+  public void validate(final UriInfo uriInfo, final Edm edm) throws UriValidationException {
+
+    validateQueryOptions(uriInfo);
+    validateKeyPredicateTypes(uriInfo, edm);
+
+  }
+
+  private int colIndex(SystemQueryOptionKind queryOptionKind) {
+    int idx;
+    switch (queryOptionKind) {
+    case FILTER:
+      idx = 0;
+      break;
+    case FORMAT:
+      idx = 1;
+      break;
+    case EXPAND:
+      idx = 2;
+      break;
+    case ID:
+      idx = 3;
+      break;
+    case COUNT:
+      idx = 4;
+      break;
+    case ORDERBY:
+      idx = 5;
+      break;
+    case SEARCH:
+      idx = 6;
+      break;
+    case SELECT:
+      idx = 7;
+      break;
+    case SKIP:
+      idx = 8;
+      break;
+    case SKIPTOKEN:
+      idx = 9;
+      break;
+    case LEVELS:
+      idx = 10;
+      break;
+    case TOP:
+      idx = 11;
+      break;
+    default:
+      throw new ODataRuntimeException("Unsupported Option: " + queryOptionKind);
+    }
+
+    return idx;
+  }
+
+  private int rowIndex(final UriInfo uriInfo) {
+    int idx;
+
+    switch (uriInfo.getKind()) {
+    case all:
+      idx = 0;
+      break;
+    case batch:
+      idx = 1;
+      break;
+    case crossjoin:
+      idx = 2;
+      break;
+    case entityId:
+      idx = 3;
+      break;
+    case metadata:
+      idx = 4;
+      break;
+    case resource:
+      idx = 5;
+      break;
+    case service:
+      idx = 6;
+      break;
+    default:
+      throw new ODataRuntimeException("Unsupported Option: " + uriInfo.getKind());
+    }
+
+    return idx;
+  }
+
+  private void validateKeyPredicateTypes(final UriInfo uriInfo, final Edm edm) throws UriValidationException {
+
+  }
+
+  private void validateQueryOptions(final UriInfo uriInfo) throws UriValidationException {
+    int row = rowIndex(uriInfo);
+
+    for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
+      int col = colIndex(option.getKind());
+      if (!decisionMatrix[row][col]) {
+        throw new UriValidationException("Unsupported System Query Option for Uri Type: " + option.getName());
+      }
+    }
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c0db941b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
index d0f4b8c..3ba323d 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidationException.java
@@ -20,6 +20,10 @@ package org.apache.olingo.server.core.uri.validator;
 
 public class UriValidationException extends Exception {
 
+  public UriValidationException(String msg) {
+    super(msg);
+  }
+
   private static final long serialVersionUID = -3179078078053564742L;
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c0db941b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/Validator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/Validator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/Validator.java
deleted file mode 100644
index 0442563..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/Validator.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.validator;
-
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.server.api.uri.UriInfo;
-
-public class Validator {
-
-  public void validate(UriInfo uriInfo, Edm edm) throws UriValidationException {
-    switch (uriInfo.getKind()) {
-    case metadata:
-      if (uriInfo.getTopOption() != null) {
-        throw new UriValidationException();
-      }
-      break;
-      default:
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c0db941b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
index 106b4ce..de5578c 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -18,25 +18,23 @@
  */
 package org.apache.olingo.server.core.uri.validator;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.server.api.uri.UriInfo;
 import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
 import org.apache.olingo.server.core.testutil.EdmTechProvider;
 import org.apache.olingo.server.core.uri.parser.Parser;
-import org.apache.olingo.server.core.uri.parser.RawUri;
-import org.apache.olingo.server.core.uri.parser.UriDecoder;
 import org.apache.olingo.server.core.uri.parser.UriParserException;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class UriEdmValidatorTest {
 
   private Edm edm = new EdmProviderImpl(new EdmTechProvider());
 
-  String[] uris = {
+  String[] tmpUri = {
       "$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid                                                                    ",
       "$crossjoin(invalidEntitySet)                                                                                 ",
       "$entity                                                                                                      ",
@@ -50,26 +48,17 @@ public class UriEdmValidatorTest {
       "FICRTESTwoKeyNavParam(ParameterInt16=@invalidAlias)?@validAlias=1                                            ",
       "FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/PropertyComplex                         ",
       "FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/$count                                  ",
-      "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$ref                                                              ",
-      "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$count                                                            ",
-      "ESKeyNav?$top=-3                                                                                             ",
-      "ESAllPrim?$count=foo                                                                                         ",
-      "ESAllPrim?$skip=-3                                                                                           "
+      // "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$ref                                                              ",
+//      "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$count                                                            ",
+//      "ESKeyNav?$top=-3                                                                                             ",
+//      "ESAllPrim?$count=foo                                                                                         ",
+//      "ESAllPrim?$skip=-3                                                                                           "
   };
 
   @Test
-  public void foo() throws Exception {
-    for (String uri : uris) {
-      Parser parser = new Parser();
-      System.out.println(uri);
-      UriInfo uriInfo = parser.parseUri(uri.trim(), edm);
-      assertNotNull(uriInfo);
-    }
-  }
-
-  @Test
+  @Ignore("key predicate validation not implemented")
   public void keyPredicateValidTypes() throws Exception {
-    String[] uris = { "/ESAllPrim" };
+    String[] uris = {};
 
     for (String uri : uris) {
       parseAndValidate(uri);
@@ -78,6 +67,7 @@ public class UriEdmValidatorTest {
   }
 
   @Test
+  @Ignore("key predicate validation not implemented")
   public void keyPredicateInvalidTypes() throws UriParserException {
     String[] uris = {};
 
@@ -94,22 +84,40 @@ public class UriEdmValidatorTest {
 
   @Test
   public void systemQueryOptionValid() throws Exception {
-    String[] uris = {
+    String[] uris =
+    {
+        /* service document */
+        "",
+        /* metadata */
         "/$metadata",
-        "/$metadata?$format=json"
+        "/$metadata?$format=atom",
     };
 
     for (String uri : uris) {
-      parseAndValidate(uri);
+      try {
+        parseAndValidate(uri);
+      } catch (Exception e) {
+        throw new Exception("Faild for uri: " + uri, e);
+      }
     }
 
   }
 
   @Test
   public void systemQueryOptionInvalid() throws Exception {
-    String[] uris = {
-        "/$metadata?$format=json&$top=3"
-    };
+    String[] uris =
+        {
+            /* service document */
+            /* metadata */
+            "/$metadata?$format=json&$top=3&$skip=5&$skiptoken=123",
+
+            /* misc */
+            "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$ref                                                              ",
+            "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$count                                                            ",
+            "ESKeyNav?$top=-3                                                                                             ",
+            "ESAllPrim?$count=foo                                                                                         ",
+            "ESAllPrim?$skip=-3                                                                                           "
+        };
 
     for (String uri : uris) {
 
@@ -124,7 +132,7 @@ public class UriEdmValidatorTest {
 
   private void parseAndValidate(String uri) throws UriParserException, UriValidationException {
     UriInfo uriInfo = new Parser().parseUri(uri.trim(), edm);
-    Validator validator = new Validator();
+    SystemQueryValidator validator = new SystemQueryValidator();
     validator.validate(uriInfo, edm);
   }
 }


[11/21] git commit: [OLINGO-206] re-factor validator

Posted by sk...@apache.org.
[OLINGO-206] re-factor validator


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/3bfc3893
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/3bfc3893
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/3bfc3893

Branch: refs/heads/master
Commit: 3bfc3893f04e932fb092b55e87b4ab12d9023571
Parents: 3321708
Author: Stephan Klevenz <st...@sap.com>
Authored: Tue Mar 25 10:23:53 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Tue Mar 25 10:24:28 2014 +0100

----------------------------------------------------------------------
 .../uri/validator/SystemQueryValidator.java     | 315 --------------
 .../server/core/uri/validator/UriValidator.java | 423 +++++++++++++++++++
 .../core/uri/validator/UriEdmValidatorTest.java |  14 +-
 3 files changed, 429 insertions(+), 323 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3bfc3893/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
deleted file mode 100644
index d752a09..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.validator;
-
-import org.apache.olingo.commons.api.ODataRuntimeException;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmEntityType;
-import org.apache.olingo.commons.api.edm.EdmReturnType;
-import org.apache.olingo.server.api.uri.UriInfo;
-import org.apache.olingo.server.api.uri.UriResource;
-import org.apache.olingo.server.api.uri.UriResourceAction;
-import org.apache.olingo.server.api.uri.UriResourceFunction;
-import org.apache.olingo.server.api.uri.UriResourceNavigation;
-import org.apache.olingo.server.api.uri.UriResourcePartTyped;
-import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
-import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
-
-public class SystemQueryValidator {
-
-  //@formatter:off (Eclipse formatter)
-  //CHECKSTYLE:OFF (Maven checkstyle)
-  private boolean[][] decisionMatrix =
-      {
-          /*                                          0-FILTER 1-FORMAT 2-EXPAND 3-ID     4-COUNT  5-ORDERBY 6-SEARCH 7-SELECT 8-SKIP   9-SKIPTOKEN 10-LEVELS 11-TOP */
-          /*                              all  0 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    false },
-          /*                            batch  1 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*                        crossjoin  2 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    true  },
-          /*                         entityId  3 */ { false,   true ,   true ,   true ,   false,   false,    false,   true ,   false,   false,      true ,    false },
-          /*                         metadata  4 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*                         resource  5 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*                          service  6 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*                        entitySet  7 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    true  },
-          /*                   entitySetCount  8 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*                           entity  9 */ { false,   true ,   true ,   false,   false,   false,    false,   true ,   false,   false,      true ,    false },
-          /*                      mediaStream 10 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*                       references 11 */ { true ,   true ,   false,   false,   false,   true ,    true ,   false,   true ,   true ,      false,    true  },
-          /*                        reference 12 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*                  propertyComplex 13 */ { false,   true ,   true ,   false,   false,   false,    false,   true ,   false,   false,      true ,    false },
-          /*        propertyComplexCollection 14 */ { true ,   true ,   true ,   false,   true ,   true ,    false,   false,   true ,   true ,      true ,    true  },
-          /*   propertyComplexCollectionCount 15 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*                propertyPrimitive 16 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*      propertyPrimitiveCollection 17 */ { true ,   true ,   false,   false,   false,   true ,    false,   false,   true ,   true ,      false,    true  },
-          /* propertyPrimitiveCollectionCount 18 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*           propertyPrimitiveValue 19 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },                    
-      };
-  //CHECKSTYLE:ON
-  //@formatter:on
-
-  public void validate(final UriInfo uriInfo, final Edm edm) throws UriValidationException {
-
-    validateQueryOptions(uriInfo, edm);
-    validateKeyPredicateTypes(uriInfo, edm);
-
-  }
-
-  private int colIndex(SystemQueryOptionKind queryOptionKind) {
-    int idx;
-    switch (queryOptionKind) {
-    case FILTER:
-      idx = 0;
-      break;
-    case FORMAT:
-      idx = 1;
-      break;
-    case EXPAND:
-      idx = 2;
-      break;
-    case ID:
-      idx = 3;
-      break;
-    case COUNT:
-      idx = 4;
-      break;
-    case ORDERBY:
-      idx = 5;
-      break;
-    case SEARCH:
-      idx = 6;
-      break;
-    case SELECT:
-      idx = 7;
-      break;
-    case SKIP:
-      idx = 8;
-      break;
-    case SKIPTOKEN:
-      idx = 9;
-      break;
-    case LEVELS:
-      idx = 10;
-      break;
-    case TOP:
-      idx = 11;
-      break;
-    default:
-      throw new ODataRuntimeException("Unsupported option: " + queryOptionKind);
-    }
-
-    return idx;
-  }
-
-  private int rowIndex(final UriInfo uriInfo, Edm edm) throws UriValidationException {
-    int idx;
-
-    switch (uriInfo.getKind()) {
-    case all:
-      idx = 0;
-      break;
-    case batch:
-      idx = 1;
-      break;
-    case crossjoin:
-      idx = 2;
-      break;
-    case entityId:
-      idx = 3;
-      break;
-    case metadata:
-      idx = 4;
-      break;
-    case resource:
-      idx = rowIndexForResourceKind(uriInfo, edm);
-      break;
-    case service:
-      idx = 6;
-      break;
-    default:
-      throw new ODataRuntimeException("Unsupported uriInfo kind: " + uriInfo.getKind());
-    }
-
-    return idx;
-  }
-
-  private int rowIndexForResourceKind(UriInfo uriInfo, Edm edm) throws UriValidationException {
-    int idx = 5;
-
-    int lastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 1;
-    UriResource lastPathSegment = uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
-
-    switch (lastPathSegment.getKind()) {
-    case count: {
-      int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
-      UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
-      switch (secondLastPathSegment.getKind()) {
-      case entitySet:
-        idx = 8;
-        break;
-      case complexProperty:
-        idx = 15;
-        break;
-      case primitiveProperty:
-        idx = 18;
-        break;
-      default:
-        throw new UriValidationException("Illegal path part kind: " + lastPathSegment.getKind());
-      }
-    }
-      break;
-    case action: {
-      UriResourceAction ura = (UriResourceAction) lastPathSegment;
-      EdmReturnType rt = ura.getAction().getReturnType();
-      switch (rt.getType().getKind()) {
-      case ENTITY:
-        if (((EdmEntityType) rt.getType()).hasStream()) {
-          idx=10;
-        } else {
-          idx = rt.isCollection() ? 7 : 9;
-        }
-        break;
-      case PRIMITIVE:
-        idx = rt.isCollection() ? 17 : 16;
-        break;
-      case COMPLEX:
-        idx = rt.isCollection() ? 14 : 13;
-        break;
-      default:
-        throw new UriValidationException("Unsupported function return type: " + rt.getType().getKind());
-      }
-    }
-      break;
-    case complexProperty:
-      if (lastPathSegment instanceof UriResourcePartTyped) {
-        if (((UriResourcePartTyped) lastPathSegment).isCollection()) {
-          idx = 14;
-        } else {
-          idx = 13;
-        }
-      } else {
-        throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
-            + lastPathSegment.getClass());
-      }
-      break;
-    case entitySet:
-      if (lastPathSegment instanceof UriResourcePartTyped) {
-        if (((UriResourcePartTyped) lastPathSegment).isCollection()) {
-          idx = 7;
-        } else {
-          idx = 9;
-        }
-      } else {
-        throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
-            + lastPathSegment.getClass());
-      }
-      break;
-    case function: {
-      UriResourceFunction urf = (UriResourceFunction) lastPathSegment;
-      EdmReturnType rt = urf.getFunction().getReturnType();
-      switch (rt.getType().getKind()) {
-      case ENTITY:
-        if (((EdmEntityType) rt.getType()).hasStream()) {
-          idx=10;
-        } else {
-          idx = rt.isCollection() ? 7 : 9;
-        }
-        break;
-      case PRIMITIVE:
-        idx = rt.isCollection() ? 17 : 16;
-        break;
-      case COMPLEX:
-        idx = rt.isCollection() ? 14 : 13;
-        break;
-      default:
-        throw new UriValidationException("Unsupported function return type: " + rt.getType().getKind());
-      }
-    }
-      break;
-    case navigationProperty:
-      idx = ((UriResourceNavigation) lastPathSegment).isCollection() ? 7 : 9;
-      break;
-    case primitiveProperty:
-      if (lastPathSegment instanceof UriResourcePartTyped) {
-        idx = ((UriResourcePartTyped) lastPathSegment).isCollection() ? 17 : 16;
-      } else {
-        throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
-            + lastPathSegment.getClass());
-      }
-      break;
-    case ref: {
-      int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
-      UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
-
-      if (secondLastPathSegment instanceof UriResourcePartTyped) {
-        idx = ((UriResourcePartTyped) secondLastPathSegment).isCollection() ? 11 : 12;
-      } else {
-        throw new UriValidationException("secondLastPathSegment not a class of UriResourcePartTyped: "
-            + lastPathSegment.getClass());
-      }
-    }
-      break;
-    case root:
-      break;
-    case singleton:
-      idx = 9;
-      break;
-    case value: {
-      int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
-      UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
-      switch (secondLastPathSegment.getKind()) {
-      case primitiveProperty:
-        idx = 19;
-        break;
-      case entitySet:
-        idx = 10;
-        break;
-      default:
-        throw new UriValidationException("Unexpected kind in path segment before $value: "
-            + secondLastPathSegment.getKind());
-      }
-    }
-      break;
-    default:
-      throw new ODataRuntimeException("Unsupported uriResource kind: " + lastPathSegment.getKind());
-    }
-
-    return idx;
-  }
-
-  private void validateQueryOptions(final UriInfo uriInfo, Edm edm) throws UriValidationException {
-    try {
-      int row = rowIndex(uriInfo, edm);
-
-      for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
-        int col = colIndex(option.getKind());
-
-        System.out.print("[" + row + "][" + col + "]");
-
-        if (!decisionMatrix[row][col]) {
-          throw new UriValidationException("System query option not allowed: " + option.getName());
-        }
-      }
-    } finally {
-      System.out.println();
-    }
-
-  }
-
-  private void validateKeyPredicateTypes(final UriInfo uriInfo, final Edm edm) throws UriValidationException {}
-
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3bfc3893/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
new file mode 100644
index 0000000..f5b785b
--- /dev/null
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
@@ -0,0 +1,423 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.server.core.uri.validator;
+
+import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmReturnType;
+import org.apache.olingo.server.api.uri.UriInfo;
+import org.apache.olingo.server.api.uri.UriResource;
+import org.apache.olingo.server.api.uri.UriResourceAction;
+import org.apache.olingo.server.api.uri.UriResourceFunction;
+import org.apache.olingo.server.api.uri.UriResourceNavigation;
+import org.apache.olingo.server.api.uri.UriResourcePartTyped;
+import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
+import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
+
+public class UriValidator {
+
+  //@formatter:off (Eclipse formatter)
+  //CHECKSTYLE:OFF (Maven checkstyle)
+  private boolean[][] decisionMatrix =
+      {
+          /*                                          0-FILTER 1-FORMAT 2-EXPAND 3-ID     4-COUNT  5-ORDERBY 6-SEARCH 7-SELECT 8-SKIP   9-SKIPTOKEN 10-LEVELS 11-TOP */
+          /*                              all  0 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    false },
+          /*                            batch  1 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                        crossjoin  2 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    true  },
+          /*                         entityId  3 */ { false,   true ,   true ,   true ,   false,   false,    false,   true ,   false,   false,      true ,    false },
+          /*                         metadata  4 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                         resource  5 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                          service  6 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                        entitySet  7 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    true  },
+          /*                   entitySetCount  8 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                           entity  9 */ { false,   true ,   true ,   false,   false,   false,    false,   true ,   false,   false,      true ,    false },
+          /*                      mediaStream 10 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                       references 11 */ { true ,   true ,   false,   false,   false,   true ,    true ,   false,   true ,   true ,      false,    true  },
+          /*                        reference 12 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                  propertyComplex 13 */ { false,   true ,   true ,   false,   false,   false,    false,   true ,   false,   false,      true ,    false },
+          /*        propertyComplexCollection 14 */ { true ,   true ,   true ,   false,   true ,   true ,    false,   false,   true ,   true ,      true ,    true  },
+          /*   propertyComplexCollectionCount 15 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                propertyPrimitive 16 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*      propertyPrimitiveCollection 17 */ { true ,   true ,   false,   false,   false,   true ,    false,   false,   true ,   true ,      false,    true  },
+          /* propertyPrimitiveCollectionCount 18 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*           propertyPrimitiveValue 19 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },                    
+      };
+  //CHECKSTYLE:ON
+  //@formatter:on
+
+  private enum RowIndex {
+    all(0),
+    batch(1),
+    crossjoin(2),
+    entityId(3),
+    metadata(4),
+    resource(5),
+    service(6),
+    entitySet(7),
+    entitySetCount(8),
+    entity(9),
+    mediaStream(10),
+    references(11),
+    reference(12),
+    propertyComplex(13),
+    propertyComplexCollection(14),
+    propertyComplexCollectionCount(15),
+    propertyPrimitive(16),
+    propertyPrimitiveCollection(17),
+    propertyPrimitiveCollectionCount(18),
+    propertyPrimitiveValue(19);
+
+    private int idx;
+
+    RowIndex(int i) {
+      idx = i;
+    }
+
+    public int getIndex() {
+      return idx;
+    }
+  }
+
+  private enum ColumnIndex {
+    filter(0),
+    format(1),
+    expand(2),
+    id(3),
+    count(4),
+    orderby(5),
+    search(6),
+    select(7),
+    skip(8),
+    skiptoken(9),
+    levels(10),
+    top(11);
+
+    private int idx;
+
+    ColumnIndex(int i) {
+      idx = i;
+    }
+
+    public int getIndex() {
+      return idx;
+    }
+
+  }
+
+  public void validate(final UriInfo uriInfo, final Edm edm) throws UriValidationException {
+
+    validateQueryOptions(uriInfo, edm);
+    validateKeyPredicateTypes(uriInfo, edm);
+
+  }
+
+  private ColumnIndex colIndex(SystemQueryOptionKind queryOptionKind) {
+    ColumnIndex idx;
+    switch (queryOptionKind) {
+    case FILTER:
+      idx = ColumnIndex.filter;
+      break;
+    case FORMAT:
+      idx = ColumnIndex.format;
+      break;
+    case EXPAND:
+      idx = ColumnIndex.expand;
+      break;
+    case ID:
+      idx = ColumnIndex.id;
+      break;
+    case COUNT:
+      idx = ColumnIndex.count;
+      break;
+    case ORDERBY:
+      idx = ColumnIndex.orderby;
+      break;
+    case SEARCH:
+      idx = ColumnIndex.search;
+      break;
+    case SELECT:
+      idx = ColumnIndex.select;
+      break;
+    case SKIP:
+      idx = ColumnIndex.skip;
+      break;
+    case SKIPTOKEN:
+      idx = ColumnIndex.skiptoken;
+      break;
+    case LEVELS:
+      idx = ColumnIndex.levels;
+      break;
+    case TOP:
+      idx = ColumnIndex.top;
+      break;
+    default:
+      throw new ODataRuntimeException("Unsupported option: " + queryOptionKind);
+    }
+
+    return idx;
+  }
+
+  private RowIndex rowIndex(final UriInfo uriInfo, Edm edm) throws UriValidationException {
+    RowIndex idx;
+
+    switch (uriInfo.getKind()) {
+    case all:
+      idx = RowIndex.all;
+      break;
+    case batch:
+      idx = RowIndex.batch;
+      break;
+    case crossjoin:
+      idx = RowIndex.crossjoin;
+      break;
+    case entityId:
+      idx = RowIndex.entityId;
+      break;
+    case metadata:
+      idx = RowIndex.metadata;
+      break;
+    case resource:
+      idx = rowIndexForResourceKind(uriInfo, edm);
+      break;
+    case service:
+      idx = RowIndex.service;
+      break;
+    default:
+      throw new ODataRuntimeException("Unsupported uriInfo kind: " + uriInfo.getKind());
+    }
+
+    return idx;
+  }
+
+  private RowIndex rowIndexForResourceKind(UriInfo uriInfo, Edm edm) throws UriValidationException {
+    RowIndex idx;
+
+    int lastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 1;
+    UriResource lastPathSegment = uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
+
+    switch (lastPathSegment.getKind()) {
+    case count:
+      idx = rowIndexForCount(uriInfo, lastPathSegment);
+      break;
+    case action:
+      idx = rowIndexForAction(lastPathSegment);
+      break;
+    case complexProperty:
+      idx = rowIndexForComplexProperty(lastPathSegment);
+      break;
+    case entitySet:
+      idx = rowIndexForEntitySet(lastPathSegment);
+      break;
+    case function:
+      idx = rowIndexForFunction(lastPathSegment);
+      break;
+    case navigationProperty:
+      idx = ((UriResourceNavigation) lastPathSegment).isCollection() ? RowIndex.entitySet : RowIndex.entity;
+      break;
+    case primitiveProperty:
+      idx = rowIndexForPrimitiveProperty(lastPathSegment);
+      break;
+    case ref:
+      idx = rowIndexForRef(uriInfo, lastPathSegment);
+      break;
+    case root:
+      idx = RowIndex.service;
+      break;
+    case singleton:
+      idx = RowIndex.entity;
+      break;
+    case value:
+      idx = rowIndexForValue(uriInfo);
+      break;
+    default:
+      throw new ODataRuntimeException("Unsupported uriResource kind: " + lastPathSegment.getKind());
+    }
+
+    return idx;
+  }
+
+  private RowIndex rowIndexForValue(UriInfo uriInfo) throws UriValidationException {
+    RowIndex idx;
+    int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
+    UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
+    switch (secondLastPathSegment.getKind()) {
+    case primitiveProperty:
+      idx = RowIndex.propertyPrimitiveValue;
+      break;
+    case entitySet:
+      idx = RowIndex.mediaStream;
+      break;
+    default:
+      throw new UriValidationException("Unexpected kind in path segment before $value: "
+          + secondLastPathSegment.getKind());
+
+    }
+    return idx;
+  }
+
+  private RowIndex rowIndexForRef(UriInfo uriInfo, UriResource lastPathSegment)
+      throws UriValidationException {
+    RowIndex idx;
+    int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
+    UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
+
+    if (secondLastPathSegment instanceof UriResourcePartTyped) {
+      idx = ((UriResourcePartTyped) secondLastPathSegment).isCollection() ? RowIndex.references : RowIndex.reference;
+    } else {
+      throw new UriValidationException("secondLastPathSegment not a class of UriResourcePartTyped: "
+          + lastPathSegment.getClass());
+    }
+
+    return idx;
+  }
+
+  private RowIndex rowIndexForPrimitiveProperty(UriResource lastPathSegment)
+      throws UriValidationException {
+    RowIndex idx;
+    if (lastPathSegment instanceof UriResourcePartTyped) {
+      idx =
+          ((UriResourcePartTyped) lastPathSegment).isCollection() ? RowIndex.propertyPrimitiveCollection
+              : RowIndex.propertyPrimitive;
+    } else {
+      throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
+          + lastPathSegment.getClass());
+    }
+    return idx;
+  }
+
+  private RowIndex rowIndexForFunction(UriResource lastPathSegment) throws UriValidationException {
+    RowIndex idx;
+    UriResourceFunction urf = (UriResourceFunction) lastPathSegment;
+    EdmReturnType rt = urf.getFunction().getReturnType();
+    switch (rt.getType().getKind()) {
+    case ENTITY:
+      if (((EdmEntityType) rt.getType()).hasStream()) {
+        idx = RowIndex.mediaStream;
+      } else {
+        idx = rt.isCollection() ? RowIndex.entitySet : RowIndex.entity;
+      }
+      break;
+    case PRIMITIVE:
+      idx = rt.isCollection() ? RowIndex.propertyPrimitiveCollection : RowIndex.propertyPrimitive;
+      break;
+    case COMPLEX:
+      idx = rt.isCollection() ? RowIndex.propertyComplexCollection : RowIndex.propertyComplex;
+      break;
+    default:
+      throw new UriValidationException("Unsupported function return type: " + rt.getType().getKind());
+    }
+
+    return idx;
+  }
+
+  private RowIndex rowIndexForEntitySet(UriResource lastPathSegment) throws UriValidationException {
+    RowIndex idx;
+    if (lastPathSegment instanceof UriResourcePartTyped) {
+      idx = ((UriResourcePartTyped) lastPathSegment).isCollection() ? RowIndex.entitySet : RowIndex.entity;
+    } else {
+      throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
+          + lastPathSegment.getClass());
+    }
+    return idx;
+  }
+
+  private RowIndex rowIndexForComplexProperty(UriResource lastPathSegment) throws UriValidationException {
+    RowIndex idx;
+    if (lastPathSegment instanceof UriResourcePartTyped) {
+      idx =
+          ((UriResourcePartTyped) lastPathSegment).isCollection() ? RowIndex.propertyComplexCollection
+              : RowIndex.propertyComplex;
+    } else {
+      throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
+          + lastPathSegment.getClass());
+    }
+    return idx;
+  }
+
+  private RowIndex rowIndexForAction(UriResource lastPathSegment) throws UriValidationException {
+    RowIndex idx;
+    UriResourceAction ura = (UriResourceAction) lastPathSegment;
+    EdmReturnType rt = ura.getAction().getReturnType();
+    switch (rt.getType().getKind()) {
+    case ENTITY:
+      if (((EdmEntityType) rt.getType()).hasStream()) {
+        idx = RowIndex.mediaStream;
+      } else {
+        idx = rt.isCollection() ? RowIndex.entitySet : RowIndex.entity;
+      }
+      break;
+    case PRIMITIVE:
+      idx = rt.isCollection() ? RowIndex.propertyPrimitiveCollection : RowIndex.propertyPrimitive;
+      break;
+    case COMPLEX:
+      idx = rt.isCollection() ? RowIndex.propertyComplexCollection : RowIndex.propertyComplex;
+      break;
+    default:
+      throw new UriValidationException("Unsupported action return type: " + rt.getType().getKind());
+    }
+
+    return idx;
+  }
+
+  private RowIndex rowIndexForCount(UriInfo uriInfo, UriResource lastPathSegment)
+      throws UriValidationException {
+
+    RowIndex idx;
+    int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
+    UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
+    switch (secondLastPathSegment.getKind()) {
+    case entitySet:
+      idx = RowIndex.entitySetCount;
+      break;
+    case complexProperty:
+      idx = RowIndex.propertyComplexCollectionCount;
+      break;
+    case primitiveProperty:
+      idx = RowIndex.propertyPrimitiveCollectionCount;
+      break;
+    default:
+      throw new UriValidationException("Illegal path part kind: " + lastPathSegment.getKind());
+    }
+
+    return idx;
+  }
+
+  private void validateQueryOptions(final UriInfo uriInfo, Edm edm) throws UriValidationException {
+    try {
+      RowIndex row = rowIndex(uriInfo, edm);
+
+      for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
+        ColumnIndex col = colIndex(option.getKind());
+
+        System.out.print("[" + row + "][" + col + "]");
+
+        if (!decisionMatrix[row.getIndex()][col.getIndex()]) {
+          throw new UriValidationException("System query option not allowed: " + option.getName());
+        }
+      }
+    } finally {
+      System.out.println();
+    }
+
+  }
+
+  private void validateKeyPredicateTypes(final UriInfo uriInfo, final Edm edm) throws UriValidationException {}
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3bfc3893/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
index d35105a..9ec844c 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -30,7 +30,6 @@ import org.apache.olingo.server.core.testutil.EdmTechProvider;
 import org.apache.olingo.server.core.uri.parser.Parser;
 import org.apache.olingo.server.core.uri.parser.UriParserException;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class UriEdmValidatorTest {
@@ -143,14 +142,13 @@ public class UriEdmValidatorTest {
       { "FICRTCTTwoPrim()" },
       { "FICRTCollCTTwoPrim()" },
       { "FICRTETMedia()" },
-      
+
       { "ESTwoKeyNav/com.sap.odata.test1.BAESTwoKeyNavRTESTwoKeyNav" },
       { "ESAllPrim/com.sap.odata.test1.BAESAllPrimRTETAllPrim" },
       { "AIRTPrimCollParam" },
       { "AIRTETParam" },
       { "AIRTPrimParam" },
 
-      
   };
 
   private String[][] urisWithNonValidSystemQueryOptions = {
@@ -251,6 +249,7 @@ public class UriEdmValidatorTest {
       { URI_NAV_ENTITY_SET, QO_ID },
 
   };
+  
   private Parser parser;
 
   @Before
@@ -259,12 +258,11 @@ public class UriEdmValidatorTest {
   }
 
 //  @Test
-////  @Ignore
+//  @Ignore
 //      public
 //      void bla() throws Exception {
 //    String[][] m = {
-//        { "" },
-//        { "" },
+//        { "/ESMedia(1)/$value?$filter='1' eq '1'" },
 //    };
 //    String[] uris = constructUri(m);
 //    for (String uri : uris) {
@@ -273,7 +271,7 @@ public class UriEdmValidatorTest {
 //      parseAndValidate(uri);
 //    }
 //  }
-//
+
   @Test
   public void checkValidSystemQueryOption() throws Exception {
     String[] uris = constructUri(urisWithValidSystemQueryOptions);
@@ -321,7 +319,7 @@ public class UriEdmValidatorTest {
 
   private void parseAndValidate(String uri) throws UriParserException, UriValidationException {
     UriInfo uriInfo = parser.parseUri(uri.trim(), edm);
-    SystemQueryValidator validator = new SystemQueryValidator();
+    UriValidator validator = new UriValidator();
 
     System.out.print("URI: " + uri);
     validator.validate(uriInfo, edm);


[04/21] git commit: [OLINGO-206] more validation tests

Posted by sk...@apache.org.
[OLINGO-206] more validation tests


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/d3d41111
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/d3d41111
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/d3d41111

Branch: refs/heads/master
Commit: d3d411118eb84175b37e6614aba8e801c734491f
Parents: f3d5d66
Author: Stephan Klevenz <st...@sap.com>
Authored: Tue Mar 18 18:51:01 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Tue Mar 18 18:51:01 2014 +0100

----------------------------------------------------------------------
 .../uri/validator/SystemQueryValidator.java     | 63 +++++++++++---------
 .../core/uri/validator/UriEdmValidatorTest.java | 58 +++++++++++++-----
 2 files changed, 78 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d3d41111/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
index 0fd944f..b37ccde 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
@@ -30,27 +30,27 @@ public class SystemQueryValidator {
   //CHECKSTYLE:OFF (Maven checkstyle)
   private boolean[][] decisionMatrix =
       {
-          /*                                       FILTER FORMAT EXPAND ID     COUNT  ORDERBY SEARCH SELECT SKIP   SKIPTOKEN LEVELS TOP */
-          /*                              all */ { true , true , true , false, true , true ,  true , true , true , true ,    true , false },
-          /*                            batch */ { false, false, false, false, false, false,  false, false, false, false,    false, false },
-          /*                        crossjoin */ { true , true , true , false, true , true ,  true , true , true , true ,    true , true  },
-          /*                         entityId */ { false, true , true , true , false, false,  false, true , false, false,    true , false },
-          /*                         metadata */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
-          /*                         resource */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
-          /*                          service */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
-          /*                        entitySet */ { true , true , true , false, true , true ,  true , true , true , true ,    true , true  },
-          /*                   entitySetCount */ { false, false, false, false, false, false,  false, false, false, false,    false, false },
-          /*                           entity */ { false, true , true , false, false, false,  false, true , false, false,    true , false },
-          /*                      mediaStream */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
-          /*                       references */ { true , true , false, false, false, true ,  true , false, true , true ,    false, true  },
-          /*                        reference */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
-          /*                  propertyComplex */ { false, true , true , false, false, false,  false, true , false, false,    true , false },
-          /*        propertyComplexCollection */ { true , true , true , false, true , true ,  false, false, true , true ,    true , true  },
-          /*   propertyComplexCollectionCount */ { false, false, false, false, false, false,  false, false, false, false,    false, false },
-          /*                propertyPrimitive */ { false, true , false, false, false, false,  false, false, false, false,    false, false },
-          /*      propertyPrimitiveCollection */ { true , true , false, false, false, true ,  false, false, true , true ,    false, true  },
-          /* propertyPrimitiveCollectionCount */ { false, false, false, false, false, false,  false, false, false, false,    false, false },
-          /*           propertyPrimitiveValue */ { false, true , false, false, false, false,  false, false, false, false,    false, false },          
+          /*                                          0-FILTER 1-FORMAT 2-EXPAND 3-ID     4-COUNT  5-ORDERBY 6-SEARCH 7-SELECT 8-SKIP   9-SKIPTOKEN 10-LEVELS 11-TOP */
+          /*                              all  0 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    false },
+          /*                            batch  1 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                        crossjoin  2 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    true  },
+          /*                         entityId  3 */ { false,   true ,   true ,   true ,   false,   false,    false,   true ,   false,   false,      true ,    false },
+          /*                         metadata  4 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                         resource  5 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                          service  6 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                        entitySet  7 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    true  },
+          /*                   entitySetCount  8 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                           entity  9 */ { false,   true ,   true ,   false,   false,   false,    false,   true ,   false,   false,      true ,    false },
+          /*                      mediaStream 10 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                       references 11 */ { true ,   true ,   false,   false,   false,   true ,    true ,   false,   true ,   true ,      false,    true  },
+          /*                        reference 12 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                  propertyComplex 13 */ { false,   true ,   true ,   false,   false,   false,    false,   true ,   false,   false,      true ,    false },
+          /*        propertyComplexCollection 14 */ { true ,   true ,   true ,   false,   true ,   true ,    false,   false,   true ,   true ,      true ,    true  },
+          /*   propertyComplexCollectionCount 15 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*                propertyPrimitive 16 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*      propertyPrimitiveCollection 17 */ { true ,   true ,   false,   false,   false,   true ,    false,   false,   true ,   true ,      false,    true  },
+          /* propertyPrimitiveCollectionCount 18 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          /*           propertyPrimitiveValue 19 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },          
       };
   //CHECKSTYLE:ON
   //@formatter:on
@@ -102,7 +102,7 @@ public class SystemQueryValidator {
       idx = 11;
       break;
     default:
-      throw new ODataRuntimeException("Unsupported Option: " + queryOptionKind);
+      throw new ODataRuntimeException("Unsupported option: " + queryOptionKind);
     }
 
     return idx;
@@ -134,26 +134,33 @@ public class SystemQueryValidator {
       idx = 6;
       break;
     default:
-      throw new ODataRuntimeException("Unsupported Option: " + uriInfo.getKind());
+      throw new ODataRuntimeException("Unsupported uriInfo kind: " + uriInfo.getKind());
     }
 
     return idx;
   }
 
-  private void validateKeyPredicateTypes(final UriInfo uriInfo, final Edm edm) throws UriValidationException {
-
-  }
-
   private void validateQueryOptions(final UriInfo uriInfo) throws UriValidationException {
+    try {
     int row = rowIndex(uriInfo);
 
     for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
       int col = colIndex(option.getKind());
+      
+      System.out.print("[" + row +"][" + col +"]");
+
+      
       if (!decisionMatrix[row][col]) {
-        throw new UriValidationException("Unsupported System Query Option for Uri Type: " + option.getName());
+        throw new UriValidationException("System query option not allowed: " + option.getName());
       }
     }
+    }finally {
+      System.out.println();
+    }
+    
+  }
 
+  private void validateKeyPredicateTypes(final UriInfo uriInfo, final Edm edm) throws UriValidationException {
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d3d41111/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
index de5578c..14e93cc 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -34,6 +34,7 @@ public class UriEdmValidatorTest {
 
   private Edm edm = new EdmProviderImpl(new EdmTechProvider());
 
+
   String[] tmpUri = {
       "$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid                                                                    ",
       "$crossjoin(invalidEntitySet)                                                                                 ",
@@ -86,12 +87,46 @@ public class UriEdmValidatorTest {
   public void systemQueryOptionValid() throws Exception {
     String[] uris =
     {
-        /* service document */
-        "",
+        /* $filter */
+        "/$all?$format=bla",
+        "/$batch?$format=bla",
+        "/$crossjoin(ESAllPrim)?$format=bla",
+        "/$entity?$id=Products(0)?$format=bla",
+        "/$metadata?$format=bla",
+        "?$format=bla",
+        "/ESAllPrim?$format=bla",
+        "/ESAllPrim/$count?$format=bla",
+        "/ESAllPrim(1)?$format=bla"        ,
+        "/ESMedia(1)/$value?$format=bla",
+        "/ESAllPrim/$ref?$format=bla",
+        "/ESAllPrim(1)/$ref?$format=bla",
+        "/ESCompComp(1)/PropertyComplex?$format=bla",
+        "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex?$format=bla",
+        "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex/$count?$format=bla",
+        "/ESAllPrim(1)/PropertyString?$format=bla",
+        "/ESCollAllPrim/CollPropertyString?$format=bla",
+        "/ESCollAllPrim/CollPropertyString/$count?$format=bla",
+        "/ESAllPrim(1)/PropertyString/$value?$format=bla"
+        /* all */
+        /* batch */
+        /* crossjoin */
+        /* entityId */
         /* metadata */
-        "/$metadata",
-        "/$metadata?$format=atom",
-    };
+        /* resource */
+        /* service */
+        /* entitySet */
+        /* entitySetCount */
+        /* entity */
+        /* mediaStream */
+        /* references */
+        /* reference */
+        /* propertyComplex */
+        /* propertyComplexCollection */
+        /* propertyComplexCollectionCount */
+        /* propertyPrimitive */
+        /* propertyPrimitiveCollection */
+        /* propertyPrimitiveCollectionCount */
+        /* propertyPrimitiveValue */};
 
     for (String uri : uris) {
       try {
@@ -104,19 +139,10 @@ public class UriEdmValidatorTest {
   }
 
   @Test
+  @Ignore
   public void systemQueryOptionInvalid() throws Exception {
     String[] uris =
         {
-            /* service document */
-            /* metadata */
-            "/$metadata?$format=json&$top=3&$skip=5&$skiptoken=123",
-
-            /* misc */
-            "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$ref                                                              ",
-            "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$count                                                            ",
-            "ESKeyNav?$top=-3                                                                                             ",
-            "ESAllPrim?$count=foo                                                                                         ",
-            "ESAllPrim?$skip=-3                                                                                           "
         };
 
     for (String uri : uris) {
@@ -133,6 +159,8 @@ public class UriEdmValidatorTest {
   private void parseAndValidate(String uri) throws UriParserException, UriValidationException {
     UriInfo uriInfo = new Parser().parseUri(uri.trim(), edm);
     SystemQueryValidator validator = new SystemQueryValidator();
+    
+    System.out.print("URI: " + uri );
     validator.validate(uriInfo, edm);
   }
 }


[06/21] git commit: [OLINGO-206] validation of 1st level uri completed

Posted by sk...@apache.org.
[OLINGO-206] validation of 1st level uri completed


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/d9532784
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/d9532784
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/d9532784

Branch: refs/heads/master
Commit: d9532784fb6f555edb4148ad9c73028d4ba437d1
Parents: 99d5781
Author: Stephan Klevenz <st...@sap.com>
Authored: Fri Mar 21 15:00:42 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Fri Mar 21 15:00:42 2014 +0100

----------------------------------------------------------------------
 .../olingo/server/api/uri/UriInfoResource.java  |   7 -
 .../olingo/server/core/uri/UriInfoImpl.java     |   4 -
 .../uri/validator/SystemQueryValidator.java     |  96 +++++++--
 .../core/uri/validator/UriEdmValidatorTest.java | 201 +++++++++----------
 4 files changed, 176 insertions(+), 132 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9532784/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
index 5ea67b5..228fdc1 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
@@ -115,11 +115,4 @@ public interface UriInfoResource {
    */
   List<UriResource> getUriResourceParts();
   
-  /**
-   * Give the last part of a resource path.
-   * 
-   * @return An uri resource object.
-   */
-  UriResource getUriResourceLastPart();
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9532784/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
index 0e99107..a5ec95b 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
@@ -287,8 +287,4 @@ public class UriInfoImpl implements UriInfo {
     return Collections.unmodifiableCollection(systemQueryOptions.values());
   }
 
-  @Override
-  public UriResource getUriResourceLastPart() {
-    return lastResourcePart;
-  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9532784/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
index 04efdb1..2d9f046 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
@@ -18,12 +18,11 @@
  */
 package org.apache.olingo.server.core.uri.validator;
 
-import java.util.List;
-
 import org.apache.olingo.commons.api.ODataRuntimeException;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.server.api.uri.UriInfo;
 import org.apache.olingo.server.api.uri.UriResource;
+import org.apache.olingo.server.api.uri.UriResourcePartTyped;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
 
@@ -42,9 +41,7 @@ public class SystemQueryValidator {
           /*                         resource  5 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
           /*                          service  6 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
           /*                        entitySet  7 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    true  },
-
           /*                   entitySetCount  8 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          
           /*                           entity  9 */ { false,   true ,   true ,   false,   false,   false,    false,   true ,   false,   false,      true ,    false },
           /*                      mediaStream 10 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
           /*                       references 11 */ { true ,   true ,   false,   false,   false,   true ,    true ,   false,   true ,   true ,      false,    true  },
@@ -55,7 +52,7 @@ public class SystemQueryValidator {
           /*                propertyPrimitive 16 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
           /*      propertyPrimitiveCollection 17 */ { true ,   true ,   false,   false,   false,   true ,    false,   false,   true ,   true ,      false,    true  },
           /* propertyPrimitiveCollectionCount 18 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
-          /*           propertyPrimitiveValue 19 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },          
+          /*           propertyPrimitiveValue 19 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },                    
       };
   //CHECKSTYLE:ON
   //@formatter:on
@@ -148,25 +145,55 @@ public class SystemQueryValidator {
   private int rowIndexForResourceKind(UriInfo uriInfo, Edm edm) throws UriValidationException {
     int idx = 5;
 
-    UriResource lastPathSegemnt = uriInfo.getUriResourceLastPart();
+    int lastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 1;
+    UriResource lastPathSegemnt = uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
 
     switch (lastPathSegemnt.getKind()) {
-    case count:
-      List<UriResource> parts = uriInfo.getUriResourceParts();
-      UriResource secondLastPart = parts.get(parts.size() - 2);
-      switch (secondLastPart.getKind()) {
+    case count: {
+      int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
+      UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
+      switch (secondLastPathSegment.getKind()) {
       case entitySet:
         idx = 8;
         break;
-        default : throw new UriValidationException("Illegal path part kind: " + lastPathSegemnt.getKind());
+      case complexProperty:
+        idx = 15;
+        break;
+      case primitiveProperty:
+        idx = 18;
+        break;
+      default:
+        throw new UriValidationException("Illegal path part kind: " + lastPathSegemnt.getKind());
       }
+    }
       break;
     case action:
       break;
     case complexProperty:
+      if (lastPathSegemnt instanceof UriResourcePartTyped) {
+        if (((UriResourcePartTyped) lastPathSegemnt).isCollection()) {
+          idx = 14;
+        }
+        else {
+          idx = 13;
+        }
+      } else {
+        throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
+            + lastPathSegemnt.getClass());
+      }
       break;
     case entitySet:
-      idx = 7;
+      if (lastPathSegemnt instanceof UriResourcePartTyped) {
+        if (((UriResourcePartTyped) lastPathSegemnt).isCollection()) {
+          idx = 7;
+        }
+        else {
+          idx = 9;
+        }
+      } else {
+        throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
+            + lastPathSegemnt.getClass());
+      }
       break;
     case function:
       break;
@@ -181,14 +208,55 @@ public class SystemQueryValidator {
     case navigationProperty:
       break;
     case primitiveProperty:
+      if (lastPathSegemnt instanceof UriResourcePartTyped) {
+        if (((UriResourcePartTyped) lastPathSegemnt).isCollection()) {
+          idx = 17;
+        }
+        else {
+          idx = 16;
+        }
+      } else {
+        throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
+            + lastPathSegemnt.getClass());
+      }
+
       break;
-    case ref:
+    case ref: {
+      int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
+      UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
+
+      if (secondLastPathSegment instanceof UriResourcePartTyped) {
+        if (((UriResourcePartTyped) secondLastPathSegment).isCollection()) {
+          idx = 11;
+        }
+        else {
+          idx = 12;
+        }
+      } else {
+        throw new UriValidationException("secondLastPathSegment not a class of UriResourcePartTyped: "
+            + lastPathSegemnt.getClass());
+      }
+    }
       break;
     case root:
       break;
     case singleton:
       break;
-    case value:
+    case value: {
+      int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
+      UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
+      switch (secondLastPathSegment.getKind()) {
+      case primitiveProperty:
+        idx = 19;
+        break;
+      case entitySet:
+        idx = 10;
+        break;
+      default:
+        throw new UriValidationException("Unexpected kind in path segment before $value: "
+            + secondLastPathSegment.getKind());
+      }
+    }
       break;
     default:
       throw new ODataRuntimeException("Unsupported uriResource kind: " + lastPathSegemnt.getKind());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d9532784/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
index 4912406..5f5758b 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -29,6 +29,7 @@ import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
 import org.apache.olingo.server.core.testutil.EdmTechProvider;
 import org.apache.olingo.server.core.uri.parser.Parser;
 import org.apache.olingo.server.core.uri.parser.UriParserException;
+import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -45,7 +46,7 @@ public class UriEdmValidatorTest {
   private static final String URI_ENTITY = "/ESAllPrim(1)";
   private static final String URI_MEDIA_STREAM = "/ESMedia(1)/$value";
   private static final String URI_REFERENCES = "/ESAllPrim/$ref";
-  private static final String URI_REFERENECE = "/ESAllPrim(1)/$ref";
+  private static final String URI_REFERENCE = "/ESAllPrim(1)/$ref";
   private static final String URI_PROPERTY_COMPLEX = "/ESCompComp(1)/PropertyComplex";
   private static final String URI_PROPERTY_COMPLEX_COLLECTION =
       "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex";
@@ -62,7 +63,7 @@ public class UriEdmValidatorTest {
   private static final String QO_EXPAND = "$expand=*";
   private static final String QO_ID = "$id=Products(0)";
   private static final String QO_COUNT = "$count";
-//  private static final String QO_ORDERBY = "$orderby=bla asc";
+//  private static final String QO_ORDERBY = "$orderby=true";
 //  private static final String QO_SEARCH = "$search='bla'";
   private static final String QO_SELECT = "$select=*";
   private static final String QO_SKIP = "$skip=3";
@@ -95,6 +96,31 @@ public class UriEdmValidatorTest {
       { URI_ENTITY_SET, QO_SKIP }, { URI_ENTITY_SET, QO_SKIPTOKEN }, { URI_ENTITY_SET, QO_LEVELS },
       { URI_ENTITY_SET, QO_TOP },
 
+      { URI_ENTITY, QO_FORMAT }, { URI_ENTITY, QO_EXPAND }, { URI_ENTITY, QO_SELECT }, { URI_ENTITY, QO_LEVELS },
+
+      { URI_MEDIA_STREAM, QO_FORMAT },
+
+      { URI_REFERENCES, QO_FILTER }, { URI_REFERENCES, QO_FORMAT }, /* { URI_REFERENCES, QO_ORDERBY }, */
+      /* { URI_REFERENCES, QO_SEARCH }, */{ URI_REFERENCES, QO_SKIP }, { URI_REFERENCES, QO_SKIPTOKEN },
+      { URI_REFERENCES, QO_TOP },
+
+      { URI_REFERENCE, QO_FORMAT },
+
+      { URI_PROPERTY_COMPLEX, QO_FORMAT }, { URI_PROPERTY_COMPLEX, QO_SELECT }, { URI_PROPERTY_COMPLEX, QO_EXPAND },
+      { URI_PROPERTY_COMPLEX, QO_LEVELS },
+
+      { URI_PROPERTY_COMPLEX_COLLECTION, QO_FILTER }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_FORMAT },
+      { URI_PROPERTY_COMPLEX_COLLECTION, QO_EXPAND }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_COUNT },
+      { URI_PROPERTY_COMPLEX_COLLECTION, QO_SKIP }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_SKIPTOKEN },
+      { URI_PROPERTY_COMPLEX_COLLECTION, QO_LEVELS }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_TOP },
+
+      { URI_PROPERTY_PRIMITIVE, QO_FORMAT },
+
+      { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_FILTER }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_FORMAT },
+      /* { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_ORDERBY }, */{ URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SKIP },
+      { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_TOP },
+
+      { URI_PROPERTY_PRIMITIVE_VALUE, QO_FORMAT },
   };
 
   private String[][] urisWithNonValidSystemQueryOptions = {
@@ -127,11 +153,75 @@ public class UriEdmValidatorTest {
       /* { URI_ENTITY_SET_COUNT, QO_ORDERBY }, *//* { URI_ENTITY_SET_COUNT, QO_SEARCH }, */
       { URI_ENTITY_SET_COUNT, QO_SELECT }, { URI_ENTITY_SET_COUNT, QO_SKIP }, { URI_ENTITY_SET_COUNT, QO_SKIPTOKEN },
       { URI_ENTITY_SET_COUNT, QO_LEVELS }, { URI_ENTITY_SET_COUNT, QO_TOP },
+
+      { URI_ENTITY, QO_FILTER }, { URI_ENTITY, QO_ID }, { URI_ENTITY, QO_COUNT }, /* { URI_ENTITY, QO_ORDERBY }, */
+      /* { URI_ENTITY, QO_SEARCH }, */{ URI_ENTITY, QO_SKIP }, { URI_ENTITY, QO_SKIPTOKEN }, { URI_ENTITY, QO_TOP },
+
+      { URI_MEDIA_STREAM, QO_FILTER }, { URI_MEDIA_STREAM, QO_ID, }, { URI_MEDIA_STREAM, QO_EXPAND },
+      { URI_MEDIA_STREAM, QO_COUNT }, /* { URI_MEDIA_STREAM, QO_ORDERBY }, *//* { URI_MEDIA_STREAM, QO_SEARCH }, */
+      { URI_MEDIA_STREAM, QO_SELECT }, { URI_MEDIA_STREAM, QO_SKIP }, { URI_MEDIA_STREAM, QO_SKIPTOKEN },
+      { URI_MEDIA_STREAM, QO_LEVELS }, { URI_MEDIA_STREAM, QO_TOP },
+
+      { URI_REFERENCES, QO_ID, }, { URI_REFERENCES, QO_EXPAND }, { URI_REFERENCES, QO_COUNT },
+      { URI_REFERENCES, QO_SELECT }, { URI_REFERENCES, QO_LEVELS },
+
+      { URI_REFERENCE, QO_FILTER }, { URI_REFERENCE, QO_ID, }, { URI_REFERENCE, QO_EXPAND },
+      { URI_REFERENCE, QO_COUNT }, /* { URI_REFERENCE, QO_ORDERBY }, *//* { URI_REFERENCE, QO_SEARCH }, */
+      { URI_REFERENCE, QO_SELECT }, { URI_REFERENCE, QO_SKIP }, { URI_REFERENCE, QO_SKIPTOKEN },
+      { URI_REFERENCE, QO_LEVELS }, { URI_REFERENCE, QO_TOP },
+
+      { URI_PROPERTY_COMPLEX, QO_FILTER }, { URI_PROPERTY_COMPLEX, QO_ID, }, { URI_PROPERTY_COMPLEX, QO_COUNT },
+      /* { URI_PROPERTY_COMPLEX, QO_ORDERBY }, *//* { URI_PROPERTY_COMPLEX, QO_SEARCH }, */
+      { URI_PROPERTY_COMPLEX, QO_SKIP }, { URI_PROPERTY_COMPLEX, QO_SKIPTOKEN }, { URI_PROPERTY_COMPLEX, QO_TOP },
+
+      { URI_PROPERTY_COMPLEX_COLLECTION, QO_ID, }, /* { URI_PROPERTY_COMPLEX_COLLECTION, QO_ORDERBY }, */
+      /* { URI_PROPERTY_COMPLEX_COLLECTION, QO_SEARCH }, */{ URI_PROPERTY_COMPLEX_COLLECTION, QO_SELECT },
+
+      { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_FILTER }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_FORMAT },
+      { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_ID, }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_EXPAND },
+      { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_COUNT }, /* { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_ORDERBY }, */
+      /* { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SEARCH }, */{ URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SELECT },
+      { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SKIP }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SKIPTOKEN },
+      { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_LEVELS }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_TOP },
+
+      { URI_PROPERTY_PRIMITIVE, QO_FILTER }, { URI_PROPERTY_PRIMITIVE, QO_ID, }, { URI_PROPERTY_PRIMITIVE, QO_EXPAND },
+      { URI_PROPERTY_PRIMITIVE, QO_COUNT }, /* { URI_PROPERTY_PRIMITIVE, QO_ORDERBY }, */
+      /* { URI_PROPERTY_PRIMITIVE, QO_SEARCH }, */{ URI_PROPERTY_PRIMITIVE, QO_SELECT },
+      { URI_PROPERTY_PRIMITIVE, QO_SKIP }, { URI_PROPERTY_PRIMITIVE, QO_SKIPTOKEN },
+      { URI_PROPERTY_PRIMITIVE, QO_LEVELS }, { URI_PROPERTY_PRIMITIVE, QO_TOP },
+
+      { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_ID, }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_EXPAND },
+      { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_COUNT }, /* { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SEARCH }, */
+      { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SELECT }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_LEVELS },
+
+      { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_FILTER }, { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_FORMAT },
+      { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_ID, }, { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_EXPAND },
+      { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_COUNT },
+      /* { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_ORDERBY }, */
+      /* { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SEARCH }, */
+      { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SELECT }, { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SKIP },
+      { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SKIPTOKEN },
+      { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_LEVELS }, { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_TOP },
+
+      { URI_PROPERTY_PRIMITIVE_VALUE, QO_FILTER }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_ID, },
+      { URI_PROPERTY_PRIMITIVE_VALUE, QO_EXPAND }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_COUNT },
+      /* { URI_PROPERTY_PRIMITIVE_VALUE, QO_ORDERBY }, *//* { URI_PROPERTY_PRIMITIVE_VALUE, QO_SEARCH }, */
+      { URI_PROPERTY_PRIMITIVE_VALUE, QO_SELECT }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_SKIP },
+      { URI_PROPERTY_PRIMITIVE_VALUE, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_LEVELS },
+      { URI_PROPERTY_PRIMITIVE_VALUE, QO_TOP },
+
   };
+  private Parser parser;
+
+  @Before
+  public void before() {
+    parser = new Parser();
+  }
 
   @Test
+  @Ignore
   public void bla() throws Exception {
-    String[][] m = { { URI_ENTITY_SET_COUNT, QO_FILTER } };
+    String[][] m = { { URI_PROPERTY_PRIMITIVE_VALUE, QO_SELECT } };
     String[] uris = constructUri(m);
     System.out.println(uris[0]);
 
@@ -165,91 +255,6 @@ public class UriEdmValidatorTest {
     }
   }
 
-  @Test
-  @Ignore
-  public void systemQueryOptionValid() throws Exception {
-    String[] uris =
-    {
-        /* $filter */
-        "/$all?$format=bla",
-        // "/$batch?$format=bla",
-        "/$crossjoin(ESAllPrim)?$format=bla",
-        "/$entity?$id=Products(0)?$format=bla",
-        "/$metadata?$format=bla",
-        "?$format=bla",
-        "/ESAllPrim?$format=bla",
-        "/ESAllPrim/$count?$format=bla",
-        "/ESAllPrim(1)?$format=bla",
-        "/ESMedia(1)/$value?$format=bla",
-        "/ESAllPrim/$ref?$format=bla",
-        "/ESAllPrim(1)/$ref?$format=bla",
-        "/ESCompComp(1)/PropertyComplex?$format=bla",
-        "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex?$format=bla",
-        "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex/$count?$format=bla",
-        "/ESAllPrim(1)/PropertyString?$format=bla",
-        "/ESCollAllPrim/CollPropertyString?$format=bla",
-        "/ESCollAllPrim/CollPropertyString/$count?$format=bla",
-        "/ESAllPrim(1)/PropertyString/$value?$format=bla"
-    };
-
-    for (String uri : uris) {
-      try {
-        parseAndValidate(uri);
-      } catch (Exception e) {
-        throw new Exception("Faild for uri: " + uri, e);
-      }
-    }
-
-  }
-
-  String[] tmpUri = {
-      "$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid                                                                    ",
-      "$crossjoin(invalidEntitySet)                                                                                 ",
-      "$entity                                                                                                      ",
-      "$entity?$idfalse=ESKeyNav(1)                                                                                 ",
-      "ESAllPrim(PropertyInt16='1')                                                                                 ",
-      "ESCollAllPrim(null)                                                                                          ",
-      "ESTwoPrim(1)/com.sap.odata.test1.ETBase(1)                                                                   ",
-      "ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase(1)                                     ",
-      "ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase(1)                                     ",
-      "FICRTCollCTTwoPrimParam(ParameterInt16='1',ParameterString='2')                                              ",
-      "FICRTESTwoKeyNavParam(ParameterInt16=@invalidAlias)?@validAlias=1                                            ",
-      "FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/PropertyComplex                         ",
-      "FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/$count                                  ",
-      // "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$ref                                                              ",
-//      "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$count                                                            ",
-//      "ESKeyNav?$top=-3                                                                                             ",
-//      "ESAllPrim?$count=foo                                                                                         ",
-//      "ESAllPrim?$skip=-3                                                                                           "
-  };
-
-  @Test
-  @Ignore("key predicate validation not implemented")
-  public void keyPredicateValidTypes() throws Exception {
-    String[] uris = {};
-
-    for (String uri : uris) {
-      parseAndValidate(uri);
-    }
-
-  }
-
-  @Test
-  @Ignore("key predicate validation not implemented")
-  public void keyPredicateInvalidTypes() throws UriParserException {
-    String[] uris = {};
-
-    for (String uri : uris) {
-
-      try {
-        parseAndValidate(uri);
-        fail("Validation Exception not thrown: " + uri);
-      } catch (UriValidationException e) {
-        assertTrue(e instanceof UriValidationException);
-      }
-    }
-  }
-
   private String[] constructUri(String[][] uriParameterMatrix) {
     ArrayList<String> uris = new ArrayList<String>();
     for (String[] uriParameter : uriParameterMatrix) {
@@ -268,26 +273,8 @@ public class UriEdmValidatorTest {
     return uris.toArray(new String[0]);
   }
 
-  @Test
-  @Ignore
-  public void systemQueryOptionInvalid() throws Exception {
-    String[] uris =
-    {
-        };
-
-    for (String uri : uris) {
-
-      try {
-        parseAndValidate(uri);
-        fail("Validation Exception not thrown: " + uri);
-      } catch (UriValidationException e) {
-        assertTrue(e instanceof UriValidationException);
-      }
-    }
-  }
-
   private void parseAndValidate(String uri) throws UriParserException, UriValidationException {
-    UriInfo uriInfo = new Parser().parseUri(uri.trim(), edm);
+    UriInfo uriInfo = parser.parseUri(uri.trim(), edm);
     SystemQueryValidator validator = new SystemQueryValidator();
 
     System.out.print("URI: " + uri);


[21/21] git commit: [OLINGO-206] Merge branch 'olingo-206-val' into m2

Posted by sk...@apache.org.
[OLINGO-206] Merge branch 'olingo-206-val' into m2


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/7dae5ef3
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/7dae5ef3
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/7dae5ef3

Branch: refs/heads/master
Commit: 7dae5ef331f67677a0bd5d8d33f16ccfa95b618e
Parents: 8a0d519 6d66ff3
Author: Stephan Klevenz <st...@sap.com>
Authored: Fri Apr 4 07:49:57 2014 +0200
Committer: Stephan Klevenz <st...@sap.com>
Committed: Fri Apr 4 07:49:57 2014 +0200

----------------------------------------------------------------------
 .../apache/olingo/server/api/uri/UriInfo.java   |   7 +
 .../olingo/server/api/uri/UriInfoResource.java  |   2 +-
 .../olingo/server/core/uri/UriInfoImpl.java     |  84 ++-
 .../core/uri/UriResourceWithKeysImpl.java       |   6 +-
 .../olingo/server/core/uri/parser/Parser.java   |   3 +-
 .../uri/validator/UriValidationException.java   |  34 ++
 .../server/core/uri/validator/UriValidator.java | 540 +++++++++++++++++++
 .../core/uri/validator/UriEdmValidatorTest.java | 330 ++++++++++++
 8 files changed, 957 insertions(+), 49 deletions(-)
----------------------------------------------------------------------



[20/21] git commit: [OLINGO-206] Merge remote-tracking branch 'origin/master' into olingo-206-val

Posted by sk...@apache.org.
[OLINGO-206] Merge remote-tracking branch 'origin/master' into olingo-206-val


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/6d66ff39
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/6d66ff39
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/6d66ff39

Branch: refs/heads/master
Commit: 6d66ff3912717ca0a0be1430f8fea6dff149066d
Parents: 49e1069 2517423
Author: Stephan Klevenz <st...@sap.com>
Authored: Thu Apr 3 17:54:51 2014 +0200
Committer: Stephan Klevenz <st...@sap.com>
Committed: Thu Apr 3 17:54:51 2014 +0200

----------------------------------------------------------------------
 fit/pom.xml                                     |  18 -
 .../org/apache/olingo/fit/AbstractServices.java |  14 +-
 .../java/org/apache/olingo/fit/V3Services.java  |  31 ++
 fit/src/main/resources/v3/openTypeMetadata.xml  |  67 ++++
 .../olingo/client/api/op/v4/ODataBinder.java    |   2 +
 .../communication/request/ODataRequestImpl.java |   4 +-
 .../edm/AbstractEdmServiceMetadataImpl.java     |   2 +-
 .../olingo/client/core/edm/EdmClientImpl.java   |   4 +-
 .../client/core/edm/EdmComplexTypeImpl.java     |   5 +
 .../client/core/edm/EdmEntityContainerImpl.java |  13 +-
 .../client/core/edm/EdmEntityTypeImpl.java      |   5 +
 .../olingo/client/core/edm/EdmSchemaImpl.java   |  51 ++-
 .../core/edm/EdmStructuredTypeHelperImpl.java   |  11 +
 .../AbstractBasicAuthHttpClientFactory.java     |  51 ---
 .../http/AbstractNTLMAuthHttpClientFactory.java |  63 ----
 .../core/http/BasicAuthHttpClientFactory.java   |  55 +++
 .../core/http/NTLMAuthHttpClientFactory.java    |  73 ++++
 .../http/ProxyWrapperHttpClientFactory.java     |  86 +++++
 .../client/core/op/AbstractODataBinder.java     | 127 +++----
 .../client/core/op/impl/v3/ODataBinderImpl.java |  10 +-
 .../client/core/op/impl/v4/ODataBinderImpl.java |  53 ++-
 .../apache/olingo/client/core/uri/URIUtils.java |  21 +-
 .../client/core/it/v3/AbstractTestITCase.java   |   6 +-
 .../it/v3/AuthEntityRetrieveTestITCase.java     |  16 +-
 .../client/core/it/v3/OpenTypeTestITCase.java   |  17 +-
 .../olingo/client/core/v4/EntityTest.java       |  28 ++
 .../apache/olingo/client/core/v4/JSONTest.java  |   5 +-
 .../olingo/client/core/v4/atom_cleanup.xsl      |   3 +-
 .../olingo/client/core/v4/entity.full.json      |  22 --
 .../core/v4/entity.withcomplexnavigation.json   |  22 ++
 .../core/v4/entity.withcomplexnavigation.xml    |  62 ++++
 .../apache/olingo/commons/api/data/Entry.java   |  16 +-
 .../apache/olingo/commons/api/data/Linked.java  |  38 +++
 .../commons/api/data/LinkedComplexValue.java    |  24 ++
 .../apache/olingo/commons/api/data/Value.java   |   4 +
 .../commons/api/domain/CommonODataEntity.java   |  76 +----
 .../olingo/commons/api/domain/ODataLinked.java  |  70 ++++
 .../api/domain/v4/ODataLinkedComplexValue.java  |  26 ++
 .../api/domain/v4/ODataObjectFactory.java       |   2 +
 .../commons/api/domain/v4/ODataProperty.java    |   7 +
 .../commons/api/domain/v4/ODataValue.java       |  14 +
 .../commons/api/edm/EdmEntityContainer.java     |  23 +-
 .../olingo/commons/api/edm/EdmEntityType.java   |   4 +-
 .../olingo/commons/api/edm/EdmSchema.java       |  36 +-
 .../commons/api/edm/EdmStructuredType.java      |   7 +
 .../commons/core/data/AbstractAtomDealer.java   |   2 +-
 .../core/data/AbstractJsonDeserializer.java     | 111 ++++++-
 .../core/data/AbstractJsonSerializer.java       |  57 ++++
 .../olingo/commons/core/data/AbstractValue.java |  11 +
 .../commons/core/data/AtomDeserializer.java     | 245 +++++++++++++-
 .../core/data/AtomPropertyDeserializer.java     | 240 -------------
 .../core/data/AtomPropertySerializer.java       | 116 -------
 .../commons/core/data/AtomSerializer.java       |  92 ++++-
 .../core/data/JSONEntryDeserializer.java        |  74 +----
 .../commons/core/data/JSONEntrySerializer.java  |  56 +---
 .../core/data/JSONPropertyDeserializer.java     |   2 +-
 .../core/data/LinkedComplexValueImpl.java       |  47 +++
 .../domain/v4/ODataCollectionValueImpl.java     |  11 +
 .../core/domain/v4/ODataComplexValueImpl.java   |  86 ++++-
 .../core/domain/v4/ODataEnumValueImpl.java      |  10 +
 .../core/domain/v4/ODataObjectFactoryImpl.java  |   6 +
 .../core/domain/v4/ODataPrimitiveValueImpl.java |  11 +
 .../core/domain/v4/ODataPropertyImpl.java       |  16 +-
 .../olingo/commons/core/edm/AbstractEdm.java    | 333 +++++++++++++++++++
 .../core/edm/AbstractEdmComplexType.java        |  63 ++--
 .../core/edm/AbstractEdmEntityContainer.java    |  16 +-
 .../commons/core/edm/AbstractEdmEntityType.java |  13 +-
 .../commons/core/edm/AbstractEdmImpl.java       | 333 -------------------
 .../core/edm/AbstractEdmNavigationProperty.java |  17 +-
 .../commons/core/edm/AbstractEdmSchema.java     | 154 +++++++++
 .../commons/core/edm/AbstractEdmSchemaImpl.java | 128 -------
 .../core/edm/AbstractEdmStructuredType.java     | 184 +++++-----
 .../core/edm/EdmStructuredTypeHelper.java       |   3 +
 .../olingo/commons/core/edm/EdmTypeImpl.java    |  45 ++-
 .../commons/core/edm/EdmImplCachingTest.java    |   4 +-
 .../commons/core/edm/EdmImplCallCreateTest.java |   4 +-
 .../core/edm/provider/EdmComplexTypeImpl.java   |   9 +-
 .../core/edm/provider/EdmEntityTypeImpl.java    |  54 +--
 .../core/edm/provider/EdmProviderImpl.java      |   4 +-
 .../server/core/edm/provider/EdmSchemaImpl.java |   4 +-
 .../provider/EdmStructuredTypeHelperImpl.java   |   8 +-
 .../edm/provider/EdmComplexTypeImplTest.java    |  12 +-
 .../edm/provider/EdmEntityTypeImplTest.java     |  11 +-
 .../core/edm/provider/EdmSchemaImplTest.java    |   6 +-
 .../serializer/xml/MetadataDocumentTest.java    | 197 ++++++++++-
 pom.xml                                         |   2 +-
 86 files changed, 2559 insertions(+), 1532 deletions(-)
----------------------------------------------------------------------



[05/21] git commit: [OLINGO-206] TDD refactoring

Posted by sk...@apache.org.
[OLINGO-206] TDD refactoring


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/99d57819
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/99d57819
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/99d57819

Branch: refs/heads/master
Commit: 99d578194051e5b891c433fe4101bfae1b04b5d9
Parents: d3d4111
Author: Stephan Klevenz <st...@sap.com>
Authored: Wed Mar 19 17:54:25 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Wed Mar 19 17:54:25 2014 +0100

----------------------------------------------------------------------
 .../olingo/server/api/uri/UriInfoResource.java  |   7 +
 .../olingo/server/core/uri/UriInfoImpl.java     |   5 +
 .../olingo/server/core/uri/parser/Parser.java   |   3 +-
 .../uri/validator/SystemQueryValidator.java     |  89 +++++--
 .../core/uri/validator/UriEdmValidatorTest.java | 236 ++++++++++++++-----
 5 files changed, 269 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/99d57819/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
index cc3077a..5ea67b5 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
@@ -114,5 +114,12 @@ public interface UriInfoResource {
    * @return List of resource parts.
    */
   List<UriResource> getUriResourceParts();
+  
+  /**
+   * Give the last part of a resource path.
+   * 
+   * @return An uri resource object.
+   */
+  UriResource getUriResourceLastPart();
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/99d57819/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
index 758d8d9..0e99107 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
@@ -286,4 +286,9 @@ public class UriInfoImpl implements UriInfo {
   public Collection<SystemQueryOption> getSystemQueryOptions() {
     return Collections.unmodifiableCollection(systemQueryOptions.values());
   }
+
+  @Override
+  public UriResource getUriResourceLastPart() {
+    return lastResourcePart;
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/99d57819/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
index e6a2256..cdc060e 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
@@ -99,6 +99,7 @@ public class Parser {
             (BatchEOFContext) parseRule(uri.pathSegmentListDecoded.get(0), ParserEntryRules.Batch);
 
         uriParseTreeVisitor.visitBatchEOF(ctxBatchEOF);
+        readQueryParameter = true;
       } else if (firstSegment.startsWith("$metadata")) {
         MetadataEOFContext ctxMetadataEOF =
             (MetadataEOFContext) parseRule(uri.pathSegmentListDecoded.get(0), ParserEntryRules.Metadata);
@@ -207,7 +208,7 @@ public class Parser {
 
             context.contextUriInfo.setSystemQueryOption(filterOption);
           } else if (option.name.equals("$search")) {
-            // TODO $search is not supported yet
+            throw new RuntimeException("System query option '$search' not implemented!");
           } else if (option.name.equals("$select")) {
             SelectEOFContext ctxSelectEOF =
                 (SelectEOFContext) parseRule(option.value, ParserEntryRules.Select);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/99d57819/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
index b37ccde..04efdb1 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
@@ -18,9 +18,12 @@
  */
 package org.apache.olingo.server.core.uri.validator;
 
+import java.util.List;
+
 import org.apache.olingo.commons.api.ODataRuntimeException;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.server.api.uri.UriInfo;
+import org.apache.olingo.server.api.uri.UriResource;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
 
@@ -39,7 +42,9 @@ public class SystemQueryValidator {
           /*                         resource  5 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
           /*                          service  6 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
           /*                        entitySet  7 */ { true ,   true ,   true ,   false,   true ,   true ,    true ,   true ,   true ,   true ,      true ,    true  },
+
           /*                   entitySetCount  8 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
+          
           /*                           entity  9 */ { false,   true ,   true ,   false,   false,   false,    false,   true ,   false,   false,      true ,    false },
           /*                      mediaStream 10 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
           /*                       references 11 */ { true ,   true ,   false,   false,   false,   true ,    true ,   false,   true ,   true ,      false,    true  },
@@ -57,7 +62,7 @@ public class SystemQueryValidator {
 
   public void validate(final UriInfo uriInfo, final Edm edm) throws UriValidationException {
 
-    validateQueryOptions(uriInfo);
+    validateQueryOptions(uriInfo, edm);
     validateKeyPredicateTypes(uriInfo, edm);
 
   }
@@ -108,7 +113,7 @@ public class SystemQueryValidator {
     return idx;
   }
 
-  private int rowIndex(final UriInfo uriInfo) {
+  private int rowIndex(final UriInfo uriInfo, Edm edm) throws UriValidationException {
     int idx;
 
     switch (uriInfo.getKind()) {
@@ -128,7 +133,7 @@ public class SystemQueryValidator {
       idx = 4;
       break;
     case resource:
-      idx = 5;
+      idx = rowIndexForResourceKind(uriInfo, edm);
       break;
     case service:
       idx = 6;
@@ -140,27 +145,77 @@ public class SystemQueryValidator {
     return idx;
   }
 
-  private void validateQueryOptions(final UriInfo uriInfo) throws UriValidationException {
-    try {
-    int row = rowIndex(uriInfo);
+  private int rowIndexForResourceKind(UriInfo uriInfo, Edm edm) throws UriValidationException {
+    int idx = 5;
 
-    for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
-      int col = colIndex(option.getKind());
-      
-      System.out.print("[" + row +"][" + col +"]");
+    UriResource lastPathSegemnt = uriInfo.getUriResourceLastPart();
 
-      
-      if (!decisionMatrix[row][col]) {
-        throw new UriValidationException("System query option not allowed: " + option.getName());
+    switch (lastPathSegemnt.getKind()) {
+    case count:
+      List<UriResource> parts = uriInfo.getUriResourceParts();
+      UriResource secondLastPart = parts.get(parts.size() - 2);
+      switch (secondLastPart.getKind()) {
+      case entitySet:
+        idx = 8;
+        break;
+        default : throw new UriValidationException("Illegal path part kind: " + lastPathSegemnt.getKind());
       }
+      break;
+    case action:
+      break;
+    case complexProperty:
+      break;
+    case entitySet:
+      idx = 7;
+      break;
+    case function:
+      break;
+    case it:
+      break;
+    case lambdaAll:
+      break;
+    case lambdaAny:
+      break;
+    case lambdaVariable:
+      break;
+    case navigationProperty:
+      break;
+    case primitiveProperty:
+      break;
+    case ref:
+      break;
+    case root:
+      break;
+    case singleton:
+      break;
+    case value:
+      break;
+    default:
+      throw new ODataRuntimeException("Unsupported uriResource kind: " + lastPathSegemnt.getKind());
     }
-    }finally {
+
+    return idx;
+  }
+
+  private void validateQueryOptions(final UriInfo uriInfo, Edm edm) throws UriValidationException {
+    try {
+      int row = rowIndex(uriInfo, edm);
+
+      for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
+        int col = colIndex(option.getKind());
+
+        System.out.print("[" + row + "][" + col + "]");
+
+        if (!decisionMatrix[row][col]) {
+          throw new UriValidationException("System query option not allowed: " + option.getName());
+        }
+      }
+    } finally {
       System.out.println();
     }
-    
-  }
 
-  private void validateKeyPredicateTypes(final UriInfo uriInfo, final Edm edm) throws UriValidationException {
   }
 
+  private void validateKeyPredicateTypes(final UriInfo uriInfo, final Edm edm) throws UriValidationException {}
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/99d57819/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
index 14e93cc..4912406 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -21,6 +21,8 @@ package org.apache.olingo.server.core.uri.validator;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.util.ArrayList;
+
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.server.api.uri.UriInfo;
 import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
@@ -32,48 +34,128 @@ import org.junit.Test;
 
 public class UriEdmValidatorTest {
 
+  private static final String URI_ALL = "$all";
+  private static final String URI_BATCH = "$batch";
+  private static final String URI_CROSSJOIN = "$crossjoin(ESAllPrim)";
+  private static final String URI_ENTITY_ID = "/$entity";
+  private static final String URI_METADATA = "$metadata";
+  private static final String URI_SERVICE = "";
+  private static final String URI_ENTITY_SET = "/ESAllPrim";
+  private static final String URI_ENTITY_SET_COUNT = "/ESAllPrim/$count";
+  private static final String URI_ENTITY = "/ESAllPrim(1)";
+  private static final String URI_MEDIA_STREAM = "/ESMedia(1)/$value";
+  private static final String URI_REFERENCES = "/ESAllPrim/$ref";
+  private static final String URI_REFERENECE = "/ESAllPrim(1)/$ref";
+  private static final String URI_PROPERTY_COMPLEX = "/ESCompComp(1)/PropertyComplex";
+  private static final String URI_PROPERTY_COMPLEX_COLLECTION =
+      "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex";
+  private static final String URI_PROPERTY_COMPLEX_COLLECTION_COUNT =
+      "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex/$count";
+  private static final String URI_PROPERTY_PRIMITIVE = "/ESAllPrim(1)/PropertyString";
+  private static final String URI_PROPERTY_PRIMITIVE_COLLECTION = "/ESCollAllPrim/CollPropertyString";
+  private static final String URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT =
+      "/ESCollAllPrim/CollPropertyString/$count";
+  private static final String URI_PROPERTY_PRIMITIVE_VALUE = "/ESAllPrim(1)/PropertyString/$value";
+
+  private static final String QO_FILTER = "$filter='1' eq '1'";
+  private static final String QO_FORMAT = "$format=bla";
+  private static final String QO_EXPAND = "$expand=*";
+  private static final String QO_ID = "$id=Products(0)";
+  private static final String QO_COUNT = "$count";
+//  private static final String QO_ORDERBY = "$orderby=bla asc";
+//  private static final String QO_SEARCH = "$search='bla'";
+  private static final String QO_SELECT = "$select=*";
+  private static final String QO_SKIP = "$skip=3";
+  private static final String QO_SKIPTOKEN = "$skiptoken=123";
+  private static final String QO_LEVELS = "$expand=*($levels=1)";
+  private static final String QO_TOP = "$top=1";
+
   private Edm edm = new EdmProviderImpl(new EdmTechProvider());
 
+  private String[][] urisWithValidSystemQueryOptions = {
+      { URI_ALL, QO_FILTER, }, { URI_ALL, QO_FORMAT }, { URI_ALL, QO_EXPAND }, { URI_ALL, QO_COUNT },
+      /* { URI_ALL, QO_ORDERBY }, *//* { URI_ALL, QO_SEARCH }, */{ URI_ALL, QO_SELECT }, { URI_ALL, QO_SKIP },
+      { URI_ALL, QO_SKIPTOKEN }, { URI_ALL, QO_LEVELS },
 
-  String[] tmpUri = {
-      "$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid                                                                    ",
-      "$crossjoin(invalidEntitySet)                                                                                 ",
-      "$entity                                                                                                      ",
-      "$entity?$idfalse=ESKeyNav(1)                                                                                 ",
-      "ESAllPrim(PropertyInt16='1')                                                                                 ",
-      "ESCollAllPrim(null)                                                                                          ",
-      "ESTwoPrim(1)/com.sap.odata.test1.ETBase(1)                                                                   ",
-      "ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase(1)                                     ",
-      "ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase(1)                                     ",
-      "FICRTCollCTTwoPrimParam(ParameterInt16='1',ParameterString='2')                                              ",
-      "FICRTESTwoKeyNavParam(ParameterInt16=@invalidAlias)?@validAlias=1                                            ",
-      "FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/PropertyComplex                         ",
-      "FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/$count                                  ",
-      // "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$ref                                                              ",
-//      "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$count                                                            ",
-//      "ESKeyNav?$top=-3                                                                                             ",
-//      "ESAllPrim?$count=foo                                                                                         ",
-//      "ESAllPrim?$skip=-3                                                                                           "
+      { URI_CROSSJOIN, QO_FILTER, }, { URI_CROSSJOIN, QO_FORMAT },
+      { URI_CROSSJOIN, QO_EXPAND }, { URI_CROSSJOIN, QO_COUNT }, /* { URI_CROSSJOIN, QO_ORDERBY }, */
+      /* { URI_CROSSJOIN, QO_SEARCH }, */{ URI_CROSSJOIN, QO_SELECT }, { URI_CROSSJOIN, QO_SKIP },
+      { URI_CROSSJOIN, QO_SKIPTOKEN }, { URI_CROSSJOIN, QO_LEVELS }, { URI_CROSSJOIN, QO_TOP },
+
+      { URI_ENTITY_ID, QO_ID, QO_FORMAT }, { URI_ENTITY_ID, QO_ID, }, { URI_ENTITY_ID, QO_ID, QO_EXPAND },
+      { URI_ENTITY_ID, QO_ID, QO_SELECT }, { URI_ENTITY_ID, QO_ID, QO_LEVELS },
+
+      { URI_METADATA, QO_FORMAT },
+
+      { URI_SERVICE, QO_FORMAT },
+
+      { URI_ENTITY_SET, QO_FILTER, }, { URI_ENTITY_SET, QO_FORMAT }, { URI_ENTITY_SET, QO_EXPAND },
+      { URI_ENTITY_SET, QO_COUNT }, /* { URI_ENTITY_SET, QO_ORDERBY }, *//* { URI_ENTITY_SET, QO_SEARCH }, */
+      { URI_ENTITY_SET, QO_SELECT },
+      { URI_ENTITY_SET, QO_SKIP }, { URI_ENTITY_SET, QO_SKIPTOKEN }, { URI_ENTITY_SET, QO_LEVELS },
+      { URI_ENTITY_SET, QO_TOP },
+
+  };
+
+  private String[][] urisWithNonValidSystemQueryOptions = {
+      { URI_ALL, QO_ID, }, { URI_ALL, QO_TOP },
+
+      { URI_BATCH, QO_FILTER, }, { URI_BATCH, QO_FORMAT }, { URI_BATCH, QO_ID, }, { URI_BATCH, QO_EXPAND },
+      { URI_BATCH, QO_COUNT }, /* { URI_BATCH, QO_ORDERBY }, *//* { URI_BATCH, QO_SEARCH }, */{ URI_BATCH, QO_SELECT },
+      { URI_BATCH, QO_SKIP }, { URI_BATCH, QO_SKIPTOKEN }, { URI_BATCH, QO_LEVELS }, { URI_BATCH, QO_TOP },
+
+      { URI_CROSSJOIN, QO_ID, },
+
+      { URI_ENTITY_ID, QO_ID, QO_FILTER, },
+      { URI_ENTITY_ID, QO_ID, QO_COUNT }, /* { URI_ENTITY_ID, QO_ORDERBY }, *//* { URI_ENTITY_ID, QO_SEARCH }, */
+
+      { URI_ENTITY_ID, QO_ID, QO_SKIP }, { URI_ENTITY_ID, QO_ID, QO_SKIPTOKEN }, { URI_ENTITY_ID, QO_ID, QO_TOP },
+
+      { URI_METADATA, QO_FILTER, }, { URI_METADATA, QO_ID, }, { URI_METADATA, QO_EXPAND },
+      { URI_METADATA, QO_COUNT }, /* { URI_METADATA, QO_ORDERBY }, *//* { URI_METADATA, QO_SEARCH }, */
+      { URI_METADATA, QO_SELECT }, { URI_METADATA, QO_SKIP }, { URI_METADATA, QO_SKIPTOKEN },
+      { URI_METADATA, QO_LEVELS }, { URI_METADATA, QO_TOP },
+
+      { URI_SERVICE, QO_FILTER }, { URI_SERVICE, QO_ID }, { URI_SERVICE, QO_EXPAND }, { URI_SERVICE, QO_COUNT },
+      /* { URI_SERVICE, QO_ORDERBY }, *//* { URI_SERVICE, QO_SEARCH }, */{ URI_SERVICE, QO_SELECT },
+      { URI_SERVICE, QO_SKIP }, { URI_SERVICE, QO_SKIPTOKEN }, { URI_SERVICE, QO_LEVELS }, { URI_SERVICE, QO_TOP },
+
+      { URI_ENTITY_SET, QO_ID },
+
+      { URI_ENTITY_SET_COUNT, QO_FILTER }, { URI_ENTITY_SET_COUNT, QO_FORMAT }, { URI_ENTITY_SET_COUNT, QO_ID },
+      { URI_ENTITY_SET_COUNT, QO_EXPAND }, { URI_ENTITY_SET_COUNT, QO_COUNT },
+      /* { URI_ENTITY_SET_COUNT, QO_ORDERBY }, *//* { URI_ENTITY_SET_COUNT, QO_SEARCH }, */
+      { URI_ENTITY_SET_COUNT, QO_SELECT }, { URI_ENTITY_SET_COUNT, QO_SKIP }, { URI_ENTITY_SET_COUNT, QO_SKIPTOKEN },
+      { URI_ENTITY_SET_COUNT, QO_LEVELS }, { URI_ENTITY_SET_COUNT, QO_TOP },
   };
 
   @Test
-  @Ignore("key predicate validation not implemented")
-  public void keyPredicateValidTypes() throws Exception {
-    String[] uris = {};
+  public void bla() throws Exception {
+    String[][] m = { { URI_ENTITY_SET_COUNT, QO_FILTER } };
+    String[] uris = constructUri(m);
+    System.out.println(uris[0]);
+
+    parseAndValidate(uris[0]);
+  }
+
+  @Test
+  public void checkValidSystemQueryOption() throws Exception {
+    String[] uris = constructUri(urisWithValidSystemQueryOptions);
 
     for (String uri : uris) {
-      parseAndValidate(uri);
+      try {
+        parseAndValidate(uri);
+      } catch (Exception e) {
+        throw new Exception("Faild for uri: " + uri, e);
+      }
     }
-
   }
 
   @Test
-  @Ignore("key predicate validation not implemented")
-  public void keyPredicateInvalidTypes() throws UriParserException {
-    String[] uris = {};
+  public void checkNonValidSystemQueryOption() throws Exception {
+    String[] uris = constructUri(urisWithNonValidSystemQueryOptions);
 
     for (String uri : uris) {
-
       try {
         parseAndValidate(uri);
         fail("Validation Exception not thrown: " + uri);
@@ -84,19 +166,20 @@ public class UriEdmValidatorTest {
   }
 
   @Test
+  @Ignore
   public void systemQueryOptionValid() throws Exception {
     String[] uris =
     {
         /* $filter */
         "/$all?$format=bla",
-        "/$batch?$format=bla",
+        // "/$batch?$format=bla",
         "/$crossjoin(ESAllPrim)?$format=bla",
         "/$entity?$id=Products(0)?$format=bla",
         "/$metadata?$format=bla",
         "?$format=bla",
         "/ESAllPrim?$format=bla",
         "/ESAllPrim/$count?$format=bla",
-        "/ESAllPrim(1)?$format=bla"        ,
+        "/ESAllPrim(1)?$format=bla",
         "/ESMedia(1)/$value?$format=bla",
         "/ESAllPrim/$ref?$format=bla",
         "/ESAllPrim(1)/$ref?$format=bla",
@@ -107,26 +190,7 @@ public class UriEdmValidatorTest {
         "/ESCollAllPrim/CollPropertyString?$format=bla",
         "/ESCollAllPrim/CollPropertyString/$count?$format=bla",
         "/ESAllPrim(1)/PropertyString/$value?$format=bla"
-        /* all */
-        /* batch */
-        /* crossjoin */
-        /* entityId */
-        /* metadata */
-        /* resource */
-        /* service */
-        /* entitySet */
-        /* entitySetCount */
-        /* entity */
-        /* mediaStream */
-        /* references */
-        /* reference */
-        /* propertyComplex */
-        /* propertyComplexCollection */
-        /* propertyComplexCollectionCount */
-        /* propertyPrimitive */
-        /* propertyPrimitiveCollection */
-        /* propertyPrimitiveCollectionCount */
-        /* propertyPrimitiveValue */};
+    };
 
     for (String uri : uris) {
       try {
@@ -138,11 +202,77 @@ public class UriEdmValidatorTest {
 
   }
 
+  String[] tmpUri = {
+      "$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid                                                                    ",
+      "$crossjoin(invalidEntitySet)                                                                                 ",
+      "$entity                                                                                                      ",
+      "$entity?$idfalse=ESKeyNav(1)                                                                                 ",
+      "ESAllPrim(PropertyInt16='1')                                                                                 ",
+      "ESCollAllPrim(null)                                                                                          ",
+      "ESTwoPrim(1)/com.sap.odata.test1.ETBase(1)                                                                   ",
+      "ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase(1)                                     ",
+      "ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase(1)                                     ",
+      "FICRTCollCTTwoPrimParam(ParameterInt16='1',ParameterString='2')                                              ",
+      "FICRTESTwoKeyNavParam(ParameterInt16=@invalidAlias)?@validAlias=1                                            ",
+      "FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/PropertyComplex                         ",
+      "FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/$count                                  ",
+      // "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$ref                                                              ",
+//      "ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$count                                                            ",
+//      "ESKeyNav?$top=-3                                                                                             ",
+//      "ESAllPrim?$count=foo                                                                                         ",
+//      "ESAllPrim?$skip=-3                                                                                           "
+  };
+
+  @Test
+  @Ignore("key predicate validation not implemented")
+  public void keyPredicateValidTypes() throws Exception {
+    String[] uris = {};
+
+    for (String uri : uris) {
+      parseAndValidate(uri);
+    }
+
+  }
+
+  @Test
+  @Ignore("key predicate validation not implemented")
+  public void keyPredicateInvalidTypes() throws UriParserException {
+    String[] uris = {};
+
+    for (String uri : uris) {
+
+      try {
+        parseAndValidate(uri);
+        fail("Validation Exception not thrown: " + uri);
+      } catch (UriValidationException e) {
+        assertTrue(e instanceof UriValidationException);
+      }
+    }
+  }
+
+  private String[] constructUri(String[][] uriParameterMatrix) {
+    ArrayList<String> uris = new ArrayList<String>();
+    for (String[] uriParameter : uriParameterMatrix) {
+      String uri = uriParameter[0];
+      if (uriParameter.length > 1) {
+        uri += "?";
+      }
+      for (int i = 1; i < uriParameter.length; i++) {
+        uri += uriParameter[i];
+        if (i < (uriParameter.length - 1)) {
+          uri += "&";
+        }
+      }
+      uris.add(uri);
+    }
+    return uris.toArray(new String[0]);
+  }
+
   @Test
   @Ignore
   public void systemQueryOptionInvalid() throws Exception {
     String[] uris =
-        {
+    {
         };
 
     for (String uri : uris) {
@@ -159,8 +289,8 @@ public class UriEdmValidatorTest {
   private void parseAndValidate(String uri) throws UriParserException, UriValidationException {
     UriInfo uriInfo = new Parser().parseUri(uri.trim(), edm);
     SystemQueryValidator validator = new SystemQueryValidator();
-    
-    System.out.print("URI: " + uri );
+
+    System.out.print("URI: " + uri);
     validator.validate(uriInfo, edm);
   }
 }


[10/21] git commit: [OLINGO-206] function/action validation

Posted by sk...@apache.org.
[OLINGO-206] function/action validation


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/33217082
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/33217082
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/33217082

Branch: refs/heads/master
Commit: 3321708293818683551ce429f1b657322671e171
Parents: 8c0c670
Author: Stephan Klevenz <st...@sap.com>
Authored: Mon Mar 24 17:10:10 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Mon Mar 24 17:11:56 2014 +0100

----------------------------------------------------------------------
 .../uri/validator/SystemQueryValidator.java     | 84 ++++++++++++--------
 .../core/uri/validator/UriEdmValidatorTest.java | 46 ++++++++---
 2 files changed, 82 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/33217082/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
index de440a5..d752a09 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
@@ -20,12 +20,13 @@ package org.apache.olingo.server.core.uri.validator;
 
 import org.apache.olingo.commons.api.ODataRuntimeException;
 import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmEntitySet;
 import org.apache.olingo.commons.api.edm.EdmEntityType;
-import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.EdmReturnType;
 import org.apache.olingo.server.api.uri.UriInfo;
 import org.apache.olingo.server.api.uri.UriResource;
+import org.apache.olingo.server.api.uri.UriResourceAction;
+import org.apache.olingo.server.api.uri.UriResourceFunction;
+import org.apache.olingo.server.api.uri.UriResourceNavigation;
 import org.apache.olingo.server.api.uri.UriResourcePartTyped;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOption;
 import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
@@ -171,7 +172,27 @@ public class SystemQueryValidator {
       }
     }
       break;
-    case action:
+    case action: {
+      UriResourceAction ura = (UriResourceAction) lastPathSegment;
+      EdmReturnType rt = ura.getAction().getReturnType();
+      switch (rt.getType().getKind()) {
+      case ENTITY:
+        if (((EdmEntityType) rt.getType()).hasStream()) {
+          idx=10;
+        } else {
+          idx = rt.isCollection() ? 7 : 9;
+        }
+        break;
+      case PRIMITIVE:
+        idx = rt.isCollection() ? 17 : 16;
+        break;
+      case COMPLEX:
+        idx = rt.isCollection() ? 14 : 13;
+        break;
+      default:
+        throw new UriValidationException("Unsupported function return type: " + rt.getType().getKind());
+      }
+    }
       break;
     case complexProperty:
       if (lastPathSegment instanceof UriResourcePartTyped) {
@@ -197,52 +218,45 @@ public class SystemQueryValidator {
             + lastPathSegment.getClass());
       }
       break;
-    case function:
-      break;
-    case it:
-      break;
-    case lambdaAll:
-      break;
-    case lambdaAny:
-      break;
-    case lambdaVariable:
-      break;
-    case navigationProperty: {
-      int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
-      UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
-
-      EdmEntitySet entitySet = edm.getEntityContainer(null).getEntitySet(secondLastPathSegment.toString());
-      EdmNavigationProperty navProp = entitySet.getEntityType().getNavigationProperty(lastPathSegment.toString());
-      if (navProp.isCollection()) {
-        idx = 7;
-      } else {
-        idx = 9;
+    case function: {
+      UriResourceFunction urf = (UriResourceFunction) lastPathSegment;
+      EdmReturnType rt = urf.getFunction().getReturnType();
+      switch (rt.getType().getKind()) {
+      case ENTITY:
+        if (((EdmEntityType) rt.getType()).hasStream()) {
+          idx=10;
+        } else {
+          idx = rt.isCollection() ? 7 : 9;
+        }
+        break;
+      case PRIMITIVE:
+        idx = rt.isCollection() ? 17 : 16;
+        break;
+      case COMPLEX:
+        idx = rt.isCollection() ? 14 : 13;
+        break;
+      default:
+        throw new UriValidationException("Unsupported function return type: " + rt.getType().getKind());
       }
     }
       break;
+    case navigationProperty:
+      idx = ((UriResourceNavigation) lastPathSegment).isCollection() ? 7 : 9;
+      break;
     case primitiveProperty:
       if (lastPathSegment instanceof UriResourcePartTyped) {
-        if (((UriResourcePartTyped) lastPathSegment).isCollection()) {
-          idx = 17;
-        } else {
-          idx = 16;
-        }
+        idx = ((UriResourcePartTyped) lastPathSegment).isCollection() ? 17 : 16;
       } else {
         throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
             + lastPathSegment.getClass());
       }
-
       break;
     case ref: {
       int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
       UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
 
       if (secondLastPathSegment instanceof UriResourcePartTyped) {
-        if (((UriResourcePartTyped) secondLastPathSegment).isCollection()) {
-          idx = 11;
-        } else {
-          idx = 12;
-        }
+        idx = ((UriResourcePartTyped) secondLastPathSegment).isCollection() ? 11 : 12;
       } else {
         throw new UriValidationException("secondLastPathSegment not a class of UriResourcePartTyped: "
             + lastPathSegment.getClass());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/33217082/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
index 4e7d402..d35105a 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -135,6 +135,22 @@ public class UriEdmValidatorTest {
       { URI_NAV_ENTITY_SET, QO_COUNT }, /* { URI_NAV_ENTITY_SET, QO_ORDERBY }, */
       /* { URI_NAV_ENTITY_SET, QO_SEARCH }, */{ URI_NAV_ENTITY_SET, QO_SELECT }, { URI_NAV_ENTITY_SET, QO_SKIP },
       { URI_NAV_ENTITY_SET, QO_SKIPTOKEN }, { URI_NAV_ENTITY_SET, QO_LEVELS }, { URI_NAV_ENTITY_SET, QO_TOP },
+
+      { "FINRTInt16()" },
+      { "FICRTETKeyNav()" },
+      { "FICRTESTwoKeyNavParam(ParameterInt16=1)" },
+      { "FICRTCollString()" },
+      { "FICRTCTTwoPrim()" },
+      { "FICRTCollCTTwoPrim()" },
+      { "FICRTETMedia()" },
+      
+      { "ESTwoKeyNav/com.sap.odata.test1.BAESTwoKeyNavRTESTwoKeyNav" },
+      { "ESAllPrim/com.sap.odata.test1.BAESAllPrimRTETAllPrim" },
+      { "AIRTPrimCollParam" },
+      { "AIRTETParam" },
+      { "AIRTPrimParam" },
+
+      
   };
 
   private String[][] urisWithNonValidSystemQueryOptions = {
@@ -231,9 +247,8 @@ public class UriEdmValidatorTest {
       { URI_NAV_ENTITY, QO_FILTER }, { URI_NAV_ENTITY, QO_ID }, { URI_NAV_ENTITY, QO_COUNT },
       /* { URI_NAV_ENTITY, QO_ORDERBY }, *//* { URI_NAV_ENTITY, QO_SEARCH }, */{ URI_NAV_ENTITY, QO_SKIP },
       { URI_NAV_ENTITY, QO_SKIPTOKEN }, { URI_SINGLETON, QO_TOP },
-      
-      { URI_NAV_ENTITY_SET, QO_ID },
 
+      { URI_NAV_ENTITY_SET, QO_ID },
 
   };
   private Parser parser;
@@ -243,17 +258,22 @@ public class UriEdmValidatorTest {
     parser = new Parser();
   }
 
-  @Test
-//  @Ignore
-      public
-      void bla() throws Exception {
-    String[][] m = { { URI_NAV_ENTITY_SET, QO_SELECT } };
-    String[] uris = constructUri(m);
-    System.out.println(uris[0]);
-
-    parseAndValidate(uris[0]);
-  }
-
+//  @Test
+////  @Ignore
+//      public
+//      void bla() throws Exception {
+//    String[][] m = {
+//        { "" },
+//        { "" },
+//    };
+//    String[] uris = constructUri(m);
+//    for (String uri : uris) {
+//      System.out.println(uri);
+//
+//      parseAndValidate(uri);
+//    }
+//  }
+//
   @Test
   public void checkValidSystemQueryOption() throws Exception {
     String[] uris = constructUri(urisWithValidSystemQueryOptions);


[14/21] git commit: [OLINGO-206] Merge branch 'master' into olingo-206-val

Posted by sk...@apache.org.
[OLINGO-206] Merge branch 'master' into olingo-206-val


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/b2508035
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/b2508035
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/b2508035

Branch: refs/heads/master
Commit: b2508035907271bc4e5b7250670602bbeea2c597
Parents: fbafc3a 4a19c8d
Author: Stephan Klevenz <st...@sap.com>
Authored: Tue Apr 1 10:56:28 2014 +0200
Committer: Stephan Klevenz <st...@sap.com>
Committed: Tue Apr 1 10:56:28 2014 +0200

----------------------------------------------------------------------
 ODataJClient/engine/pom.xml                     |    2 +-
 .../odatajclient/engine/AllGeoTypesSet_-8.xml   |  156 +-
 .../odatajclient/testservice/utils/Commons.java |    4 +-
 fit/pom.xml                                     |  140 +-
 .../org/apache/olingo/fit/AbstractServices.java | 1255 +++++++++++++++
 .../fit/UnsupportedMediaTypeException.java      |   41 +
 .../java/org/apache/olingo/fit/V3Services.java  |   38 +
 .../java/org/apache/olingo/fit/V4Services.java  |   38 +
 .../org/apache/olingo/fit/methods/MERGE.java    |   31 +
 .../org/apache/olingo/fit/methods/PATCH.java    |   31 +
 .../apache/olingo/fit/rproxy/LinkRewrite.java   |   54 +
 .../olingo/fit/rproxy/LinkRewriteRenderer.java  |   56 +
 .../olingo/fit/utils/AbstractJSONUtilities.java |  503 ++++++
 .../olingo/fit/utils/AbstractUtilities.java     |  791 ++++++++++
 .../olingo/fit/utils/AbstractXMLUtilities.java  | 1302 ++++++++++++++++
 .../org/apache/olingo/fit/utils/Accept.java     |   96 ++
 .../org/apache/olingo/fit/utils/Commons.java    |  273 ++++
 .../org/apache/olingo/fit/utils/Constants.java  |  107 ++
 .../org/apache/olingo/fit/utils/FSManager.java  |  169 ++
 .../org/apache/olingo/fit/utils/LinkInfo.java   |   54 +
 .../olingo/fit/utils/MetadataLinkInfo.java      |  175 +++
 .../olingo/fit/utils/NavigationLinks.java       |  120 ++
 .../apache/olingo/fit/utils/ODataVersion.java   |   35 +
 .../fit/utils/XHTTPMethodInterceptor.java       |   43 +
 .../olingo/fit/utils/XMLEventReaderWrapper.java |  136 ++
 .../org/apache/olingo/fit/utils/XmlElement.java |   99 ++
 .../olingo/fit/utils/v3/JSONUtilities.java      |   28 +
 .../olingo/fit/utils/v3/XMLUtilities.java       |  191 +++
 .../olingo/fit/utils/v4/JSONUtilities.java      |   28 +
 .../olingo/fit/utils/v4/XMLUtilities.java       |  142 ++
 .../main/resources/META-INF/vfs-providers.xml   |   27 +
 fit/src/main/resources/context.xml              |   25 +
 fit/src/main/resources/esigate.properties       |   25 +
 .../org/esigate/rewrite-proxy.properties        |   23 +
 fit/src/main/resources/tomcat-users.xml         |   27 +
 fit/src/main/resources/v3/Car/12/$value.bin     |    0
 .../main/resources/v3/Car/12/entity.full.json   |   13 +
 fit/src/main/resources/v3/Car/12/entity.xml     |   39 +
 fit/src/main/resources/v3/Car/14/$value.bin     |    0
 .../main/resources/v3/Car/14/entity.full.json   |   13 +
 fit/src/main/resources/v3/Car/14/entity.xml     |   39 +
 fit/src/main/resources/v3/Car/15/$value.bin     |    0
 .../main/resources/v3/Car/15/entity.full.json   |   13 +
 fit/src/main/resources/v3/Car/15/entity.xml     |   39 +
 .../main/resources/v3/Car/16/entity.full.json   |   14 +
 fit/src/main/resources/v3/Car/16/entity.xml     |   45 +
 fit/src/main/resources/v3/Car/feed.full.json    |  297 ++++
 fit/src/main/resources/v3/Car/feed.xml          |  459 ++++++
 .../v3/Car/filter/((1 add VIN) eq 16).full.json |    1 +
 .../v3/Car/filter/((1 add VIN) eq 16).xml       |   45 +
 .../v3/Car/filter/((VIN add 1) eq 16).full.json |    1 +
 .../v3/Car/filter/((VIN add 1) eq 16).xml       |   45 +
 .../((VIN lt 16) and (VIN gt 12)).full.json     |    1 +
 .../filter/((VIN lt 16) and (VIN gt 12)).xml    |   81 +
 .../v3/Car/filter/(16 eq (1 add VIN)).full.json |    1 +
 .../v3/Car/filter/(16 eq (1 add VIN)).xml       |   45 +
 .../v3/Car/filter/(VIN lt 16).full.json         |    1 +
 .../resources/v3/Car/filter/(VIN lt 16).xml     |  117 ++
 ...ngth(Description) gt (VIN add 10)).full.json |    1 +
 .../(length(Description) gt (VIN add 10)).xml   |  117 ++
 .../v3/Car/filter/VIN add 5 lt 11.full.json     |    1 +
 .../resources/v3/Car/filter/VIN add 5 lt 11.xml |   41 +
 .../v3/Car/filter/VIN div 2 le 8.full.json      |    1 +
 .../resources/v3/Car/filter/VIN div 2 le 8.xml  |   41 +
 .../filter/VIN le 18 and VIN gt 12.full.json    |    1 +
 .../v3/Car/filter/VIN le 18 and VIN gt 12.xml   |   41 +
 .../v3/Car/filter/VIN mul 2 le 30.full.json     |    1 +
 .../resources/v3/Car/filter/VIN mul 2 le 30.xml |   41 +
 ...not (((VIN ge 16) or (VIN le 12))).full.json |    1 +
 .../not (((VIN ge 16) or (VIN le 12))).xml      |   81 +
 .../startswith(Description,'cen').full.json     |    1 +
 .../filter/startswith(Description,'cen').xml    |   45 +
 .../VIN desc/filter/(VIN lt 16).full.json       |    9 +
 .../Car/orderby/VIN desc/filter/(VIN lt 16).xml |  117 ++
 .../v3/ComputerDetail/-10/entity.full.json      |   23 +
 .../resources/v3/ComputerDetail/-10/entity.xml  |   44 +
 .../(month(PurchaseDate) eq 12).full.json       |    1 +
 .../filter/(month(PurchaseDate) eq 12).xml      |   64 +
 .../filter/day(PurchaseDate) eq 15.full.json    |    1 +
 .../filter/day(PurchaseDate) eq 15.xml          |   41 +
 .../filter/hour(PurchaseDate) eq 1.full.json    |    1 +
 .../filter/hour(PurchaseDate) eq 1.xml          |   41 +
 .../filter/minute(PurchaseDate) eq 33.full.json |    1 +
 .../filter/minute(PurchaseDate) eq 33.xml       |   41 +
 .../filter/month(PurchaseDate) eq 12.full.json  |    1 +
 .../filter/month(PurchaseDate) eq 12.xml        |   41 +
 .../filter/second(PurchaseDate) eq 35.full.json |    1 +
 .../filter/second(PurchaseDate) eq 35.xml       |   41 +
 .../filter/year(PurchaseDate) eq 2020.full.json |    1 +
 .../filter/year(PurchaseDate) eq 2020.xml       |   41 +
 .../resources/v3/Customer/-10/entity.full.json  |  673 ++++++++
 .../main/resources/v3/Customer/-10/entity.xml   |  516 +++++++
 .../v3/Customer/-10/links/Info.full.json        |    4 +
 .../resources/v3/Customer/-10/links/Info.xml    |   22 +
 .../v3/Customer/-10/links/Logins('3').full.json |    4 +
 .../v3/Customer/-10/links/Logins.full.json      |   12 +
 .../resources/v3/Customer/-10/links/Logins.xml  |   25 +
 .../v3/Customer/-10/links/Orders(-10).full.json |    4 +
 .../v3/Customer/-10/links/Orders.full.json      |   13 +
 .../resources/v3/Customer/-10/links/Orders.xml  |   26 +
 .../resources/v3/Customer/-7/entity.full.json   |  487 ++++++
 .../main/resources/v3/Customer/-7/entity.xml    |  381 +++++
 .../resources/v3/Customer/-9/entity.full.json   |  750 +++++++++
 .../main/resources/v3/Customer/-9/entity.xml    |  565 +++++++
 .../main/resources/v3/Customer/feed.full.json   |  893 +++++++++++
 fit/src/main/resources/v3/Customer/feed.xml     |  704 +++++++++
 ....PhoneNumber,'ODataJClient') eq 1).full.json |    1 +
 ...ePhone.PhoneNumber,'ODataJClient') eq 1).xml |   30 +
 ...ne.PhoneNumber,'lccvussrv') ne -1).full.json |    1 +
 ...omePhone.PhoneNumber,'lccvussrv') ne -1).xml |  600 ++++++++
 .../Customer/filter/CustomerId eq -10.full.json |  678 ++++++++
 .../v3/Customer/filter/CustomerId eq -10.xml    |  522 +++++++
 .../Customer/filter/CustomerId gt -10.full.json |    1 +
 .../v3/Customer/filter/CustomerId gt -10.xml    |  740 +++++++++
 .../Customer/filter/CustomerId lt -10.full.json |    1 +
 .../v3/Customer/filter/CustomerId lt -10.xml    |   30 +
 .../isof(Name,'Edm.String') eq true.full.json   |    1 +
 .../filter/isof(Name,'Edm.String') eq true.xml  | 1085 +++++++++++++
 .../not endswith(Name,'Chandan').full.json      |    1 +
 .../filter/not endswith(Name,'Chandan').xml     | 1065 +++++++++++++
 .../v3/Customer/skiptoken/-1.full.json          |    6 +
 .../main/resources/v3/Customer/skiptoken/-1.xml |   30 +
 .../v3/Customer/skiptoken/-10.full.json         |  978 ++++++++++++
 .../resources/v3/Customer/skiptoken/-10.xml     |  953 ++++++++++++
 .../v3/Customer/skiptoken/-3.full.json          |  776 ++++++++++
 .../main/resources/v3/Customer/skiptoken/-3.xml |  613 ++++++++
 .../v3/Customer/skiptoken/-5.full.json          | 1444 ++++++++++++++++++
 .../main/resources/v3/Customer/skiptoken/-5.xml | 1104 +++++++++++++
 .../v3/Customer/skiptoken/-7.full.json          | 1296 ++++++++++++++++
 .../main/resources/v3/Customer/skiptoken/-7.xml |  990 ++++++++++++
 .../v3/Customer/skiptoken/-9.full.json          |  715 +++++++++
 .../main/resources/v3/Customer/skiptoken/-9.xml |  559 +++++++
 .../v3/CustomerInfo/11/entity.full.json         |   11 +
 .../resources/v3/CustomerInfo/11/entity.xml     |   37 +
 .../v3/CustomerInfo/12/entity.full.json         |   11 +
 .../resources/v3/CustomerInfo/12/entity.xml     |   37 +
 .../v3/EdmBooleanSet/true/entity.full.json      |    1 +
 .../resources/v3/EdmBooleanSet/true/entity.xml  |   36 +
 .../v3/EdmByteSet/255/entity.full.json          |    1 +
 .../main/resources/v3/EdmByteSet/255/entity.xml |   36 +
 .../entity.full.json                            |    1 +
 .../79228162514264337593543950335M/entity.xml   |   36 +
 .../1.7976931348623157E308D/entity.full.json    |    1 +
 .../1.7976931348623157E308D/entity.xml          |   36 +
 .../entity.full.json                            |    1 +
 .../entity.xml                                  |   36 +
 .../v3/EdmInt16Set/32767/entity.full.json       |    1 +
 .../resources/v3/EdmInt16Set/32767/entity.xml   |   36 +
 .../v3/EdmInt32Set/-2147483648/entity.full.json |    1 +
 .../v3/EdmInt32Set/-2147483648/entity.xml       |   36 +
 .../9223372036854775807L/entity.full.json       |    1 +
 .../EdmInt64Set/9223372036854775807L/entity.xml |   36 +
 .../EdmSingleSet/3.4028235E38f/entity.full.json |    1 +
 .../v3/EdmSingleSet/3.4028235E38f/entity.xml    |   36 +
 .../v3/EdmStringSet/'$'/entity.full.json        |    1 +
 .../resources/v3/EdmStringSet/'$'/entity.xml    |   36 +
 .../entity.full.json                            |    1 +
 .../entity.xml                                  |   36 +
 .../v3/InStreamErrorGetCustomer.full.json       |    1 +
 .../resources/v3/InStreamErrorGetCustomer.xml   |  525 +++++++
 .../resources/v3/Login/'3'/entity.full.json     |   13 +
 fit/src/main/resources/v3/Login/'3'/entity.xml  |   42 +
 .../resources/v3/Message/1 -10/entity.full.json |   17 +
 .../main/resources/v3/Message/1 -10/entity.xml  |   46 +
 .../resources/v3/Order/-10/entity.full.json     |   11 +
 fit/src/main/resources/v3/Order/-10/entity.xml  |   40 +
 .../main/resources/v3/Order/-7/entity.full.json |   17 +
 fit/src/main/resources/v3/Order/-7/entity.xml   |   43 +
 .../main/resources/v3/Order/-8/entity.full.json |   17 +
 fit/src/main/resources/v3/Order/-8/entity.xml   |   43 +
 .../main/resources/v3/Order/-9/entity.full.json |   17 +
 fit/src/main/resources/v3/Order/-9/entity.xml   |   43 +
 .../v3/OrderLine/-10 -10/entity.full.json       |   14 +
 .../resources/v3/OrderLine/-10 -10/entity.xml   |   42 +
 .../resources/v3/OrderLine/-10 -10/etag.txt     |    1 +
 .../filter/PersonId sub 2 lt -10.full.json      |    1 +
 .../v3/Person/filter/PersonId sub 2 lt -10.xml  |   79 +
 ...iaDefaultService.SpecialEmployee').full.json |    1 +
 ....AstoriaDefaultService.SpecialEmployee').xml |  131 ++
 .../resources/v3/Product/-10/entity.full.json   |   51 +
 .../main/resources/v3/Product/-10/entity.xml    |   61 +
 fit/src/main/resources/v3/Product/-10/etag.txt  |    1 +
 .../resources/v3/Product/-6/entity.full.json    |   51 +
 fit/src/main/resources/v3/Product/-6/entity.xml |   61 +
 fit/src/main/resources/v3/Product/-6/etag.txt   |    1 +
 .../resources/v3/Product/-7/entity.full.json    |   51 +
 fit/src/main/resources/v3/Product/-7/entity.xml |   61 +
 fit/src/main/resources/v3/Product/-7/etag.txt   |    1 +
 .../v3/Product/-7/links/Photos.full.json        |   12 +
 .../resources/v3/Product/-9/entity.full.json    |   60 +
 fit/src/main/resources/v3/Product/-9/entity.xml |   68 +
 fit/src/main/resources/v3/Product/-9/etag.txt   |    1 +
 .../main/resources/v3/Product/feed.full.json    |  452 ++++++
 fit/src/main/resources/v3/Product/feed.xml      |  410 +++++
 .../ceiling(Dimensions.Width) eq 7338.full.json |    1 +
 .../ceiling(Dimensions.Width) eq 7338.xml       |   68 +
 ...', newname') eq 'kdcuklu, newname'.full.json |    1 +
 ...tion, ', newname') eq 'kdcuklu, newname'.xml |   74 +
 .../floor(Dimensions.Width) eq 7337.full.json   |    1 +
 .../filter/floor(Dimensions.Width) eq 7337.xml  |   68 +
 .../indexof(Description, 'k') eq 0.full.json    |    1 +
 .../filter/indexof(Description, 'k') eq 0.xml   |  117 ++
 .../filter/length(Description) eq 7.full.json   |    1 +
 .../Product/filter/length(Description) eq 7.xml |   74 +
 .../round(Dimensions.Width) eq 7338.full.json   |    1 +
 .../filter/round(Dimensions.Width) eq 7338.xml  |   68 +
 ...artswith(Description, 'k') eq true.full.json |    1 +
 .../startswith(Description, 'k') eq true.xml    |  117 ++
 ...of('kdcuklu', Description) eq true.full.json |    1 +
 ...stringof('kdcuklu', Description) eq true.xml |   74 +
 .../toupper(Description) eq 'KDCUKLU'.full.json |    1 +
 .../toupper(Description) eq 'KDCUKLU'.xml       |   74 +
 .../v3/ProductPhoto/-2 -2/entity.full.json      |   10 +
 .../resources/v3/ProductPhoto/-2 -2/entity.xml  |   39 +
 .../v3/ProductPhoto/-3 -3/entity.full.json      |   10 +
 .../resources/v3/ProductPhoto/-3 -3/entity.xml  |   38 +
 fit/src/main/resources/v3/badRequest.json       |   17 +
 fit/src/main/resources/v3/badRequest.xml        |   30 +
 fit/src/main/resources/v3/largeMetadata.xml     |   42 +
 fit/src/main/resources/v3/metadata.xml          |  719 +++++++++
 fit/src/main/resources/v3/notFound.json         |   11 +
 fit/src/main/resources/v3/notFound.xml          |   25 +
 fit/src/main/resources/v3/services.full.json    |  102 ++
 fit/src/main/resources/v3/services.xml          |   98 ++
 .../main/resources/v3/unsupportedMediaType.json |   17 +
 .../main/resources/v3/unsupportedMediaType.xml  |   34 +
 fit/src/main/resources/v4/People/feed.full.json |  333 ++++
 fit/src/main/resources/v4/People/feed.xml       |  219 +++
 fit/src/main/resources/v4/metadata.xml          |  438 ++++++
 .../main/webapp/WEB-INF/applicationContext.xml  |   50 +
 fit/src/main/webapp/WEB-INF/web.xml             |   75 +
 lib/client-api/pom.xml                          |    4 +-
 .../olingo/client/api/CommonConfiguration.java  |  184 +++
 .../olingo/client/api/CommonODataClient.java    |   76 +
 .../apache/olingo/client/api/Configuration.java |  184 ---
 .../org/apache/olingo/client/api/Constants.java |  217 ---
 .../olingo/client/api/ODataBatchConstants.java  |   56 +
 .../apache/olingo/client/api/ODataClient.java   |   55 -
 .../olingo/client/api/ODataConstants.java       |  219 ---
 .../apache/olingo/client/api/ODataError.java    |   67 -
 .../apache/olingo/client/api/ODataV3Client.java |   39 -
 .../apache/olingo/client/api/ODataV4Client.java |   39 -
 .../client/api/UnsupportedInV3Exception.java    |   31 -
 .../olingo/client/api/V3Configuration.java      |   44 -
 .../olingo/client/api/V4Configuration.java      |   24 -
 .../ODataClientErrorException.java              |  110 ++
 .../ODataServerErrorException.java              |   38 +
 .../api/communication/header/HeaderName.java    |  147 ++
 .../communication/header/ODataHeaderValues.java |   45 +
 .../api/communication/header/ODataHeaders.java  |   59 +
 .../request/ODataBasicRequest.java              |   55 +
 .../request/ODataBatchableRequest.java          |   46 +
 .../api/communication/request/ODataRequest.java |  191 +++
 .../request/ODataStreamManager.java             |   57 +
 .../request/ODataStreamedRequest.java           |   38 +
 .../communication/request/ODataStreamer.java    |   39 +
 .../api/communication/request/UpdateType.java   |   55 +
 .../request/batch/BatchStreamManager.java       |   42 +
 .../batch/CommonBatchRequestFactory.java        |   35 +
 .../request/batch/ODataBatchLineIterator.java   |   57 +
 .../request/batch/ODataBatchRequest.java        |   57 +
 .../request/batch/ODataBatchRequestItem.java    |   46 +
 .../request/batch/ODataBatchResponseItem.java   |   56 +
 .../request/batch/ODataChangeset.java           |   39 +
 .../request/batch/ODataRetrieve.java            |   37 +
 .../request/batch/v3/BatchRequestFactory.java   |   24 +
 .../request/batch/v4/BatchRequestFactory.java   |   24 +
 .../request/cud/CommonCUDRequestFactory.java    |  145 ++
 .../request/cud/ODataDeleteRequest.java         |   29 +
 .../request/cud/ODataEntityCreateRequest.java   |   29 +
 .../request/cud/ODataEntityUpdateRequest.java   |   29 +
 .../request/cud/ODataLinkCreateRequest.java     |   29 +
 .../request/cud/ODataLinkUpdateRequest.java     |   29 +
 .../request/cud/ODataPropertyUpdateRequest.java |   29 +
 .../request/cud/ODataValueUpdateRequest.java    |   29 +
 .../request/cud/v3/CUDRequestFactory.java       |   24 +
 .../request/cud/v4/CUDRequestFactory.java       |   24 +
 .../invoke/CommonInvokeRequestFactory.java      |   61 +
 .../request/invoke/ODataInvokeRequest.java      |   40 +
 .../request/invoke/ODataNoContent.java          |   31 +
 .../request/invoke/v3/InvokeRequestFactory.java |   24 +
 .../request/invoke/v4/InvokeRequestFactory.java |   24 +
 .../retrieve/CommonRetrieveRequestFactory.java  |  105 ++
 .../request/retrieve/ODataEntityRequest.java    |   28 +
 .../retrieve/ODataEntitySetIteratorRequest.java |   28 +
 .../request/retrieve/ODataEntitySetRequest.java |   28 +
 .../request/retrieve/ODataMediaRequest.java     |   28 +
 .../request/retrieve/ODataMetadataRequest.java  |   28 +
 .../request/retrieve/ODataPropertyRequest.java  |   28 +
 .../request/retrieve/ODataRawRequest.java       |   42 +
 .../request/retrieve/ODataRetrieveRequest.java  |   29 +
 .../retrieve/ODataServiceDocumentRequest.java   |   28 +
 .../request/retrieve/ODataValueRequest.java     |   28 +
 .../retrieve/v3/ODataLinkCollectionRequest.java |   29 +
 .../retrieve/v3/RetrieveRequestFactory.java     |   34 +
 .../retrieve/v4/RetrieveRequestFactory.java     |   24 +
 .../streamed/CommonStreamedRequestFactory.java  |   62 +
 .../MediaEntityCreateStreamManager.java         |   28 +
 .../MediaEntityUpdateStreamManager.java         |   28 +
 .../streamed/ODataMediaEntityCreateRequest.java |   28 +
 .../streamed/ODataMediaEntityUpdateRequest.java |   28 +
 .../streamed/ODataStreamUpdateRequest.java      |   30 +
 .../streamed/ODataStreamedEntityRequest.java    |   50 +
 .../streamed/StreamUpdateStreamManager.java     |   28 +
 .../streamed/v3/StreamedRequestFactory.java     |   24 +
 .../streamed/v4/StreamedRequestFactory.java     |   24 +
 .../response/ODataBatchResponse.java            |   37 +
 .../response/ODataDeleteResponse.java           |   27 +
 .../response/ODataEntityCreateResponse.java     |   36 +
 .../response/ODataEntityUpdateResponse.java     |   36 +
 .../response/ODataInvokeResponse.java           |   36 +
 .../response/ODataLinkOperationResponse.java    |   28 +
 .../ODataMediaEntityCreateResponse.java         |   36 +
 .../ODataMediaEntityUpdateResponse.java         |   36 +
 .../response/ODataPropertyUpdateResponse.java   |   36 +
 .../response/ODataRawResponse.java              |   33 +
 .../communication/response/ODataResponse.java   |  117 ++
 .../response/ODataRetrieveResponse.java         |   34 +
 .../response/ODataStreamUpdateResponse.java     |   36 +
 .../response/ODataValueUpdateResponse.java      |   36 +
 .../api/deserializer/AnnotationProperty.java    |   24 -
 .../api/deserializer/ClientException.java       |   36 -
 .../client/api/deserializer/ComplexValue.java   |   35 -
 .../olingo/client/api/deserializer/Entity.java  |   59 -
 .../client/api/deserializer/EntitySet.java      |   34 -
 .../api/deserializer/NavigationProperty.java    |   27 -
 .../client/api/deserializer/Property.java       |   24 -
 .../olingo/client/api/deserializer/Reader.java  |   30 -
 .../api/deserializer/StructuralProperty.java    |   30 -
 .../olingo/client/api/deserializer/Value.java   |   28 -
 .../olingo/client/api/domain/EdmSimpleType.java |  289 ----
 .../client/api/domain/ODataCollectionValue.java |   98 --
 .../client/api/domain/ODataComplexValue.java    |   97 --
 .../olingo/client/api/domain/ODataDuration.java |   79 -
 .../api/domain/ODataEntitySetIterator.java      |  311 ++++
 .../client/api/domain/ODataGeospatialValue.java |  488 ------
 .../client/api/domain/ODataInvokeResult.java    |   30 -
 .../client/api/domain/ODataPrimitiveValue.java  |  378 -----
 .../olingo/client/api/domain/ODataProperty.java |  192 ---
 .../client/api/domain/ODataServiceDocument.java |  183 ---
 .../client/api/domain/ODataTimestamp.java       |  138 --
 .../olingo/client/api/domain/ODataValue.java    |  111 --
 .../domain/geospatial/ComposedGeospatial.java   |   75 -
 .../api/domain/geospatial/Geospatial.java       |  157 --
 .../domain/geospatial/GeospatialCollection.java |   48 -
 .../api/domain/geospatial/LineString.java       |   39 -
 .../api/domain/geospatial/MultiLineString.java  |   39 -
 .../api/domain/geospatial/MultiPoint.java       |   39 -
 .../api/domain/geospatial/MultiPolygon.java     |   39 -
 .../client/api/domain/geospatial/Point.java     |   77 -
 .../client/api/domain/geospatial/Polygon.java   |   73 -
 .../api/domain/v3/ODataLinkCollection.java      |  100 ++
 .../olingo/client/api/format/ODataFormat.java   |   97 --
 .../client/api/format/ODataMediaFormat.java     |   71 -
 .../client/api/format/ODataPubFormat.java       |   97 --
 .../client/api/format/ODataValueFormat.java     |   76 -
 .../client/api/op/ClientODataDeserializer.java  |   39 +
 .../olingo/client/api/op/CommonODataBinder.java |  132 ++
 .../olingo/client/api/op/CommonODataReader.java |  104 ++
 .../olingo/client/api/op/ODataBinder.java       |  122 --
 .../olingo/client/api/op/ODataDeserializer.java |   94 --
 .../olingo/client/api/op/ODataReader.java       |  104 --
 .../olingo/client/api/op/ODataSerializer.java   |  118 --
 .../client/api/op/ODataV3Deserializer.java      |   23 -
 .../client/api/op/ODataV4Deserializer.java      |   30 -
 .../olingo/client/api/op/ODataWriter.java       |   94 ++
 .../olingo/client/api/op/v3/ODataBinder.java    |   35 +
 .../client/api/op/v3/ODataDeserializer.java     |   37 +
 .../olingo/client/api/op/v3/ODataReader.java    |   37 +
 .../olingo/client/api/op/v4/ODataBinder.java    |   25 +
 .../client/api/op/v4/ODataDeserializer.java     |   31 +
 .../olingo/client/api/op/v4/ODataReader.java    |   25 +
 .../client/api/uri/CommonFilterArgFactory.java  |   83 +
 .../client/api/uri/CommonFilterFactory.java     |   61 +
 .../olingo/client/api/uri/CommonURIBuilder.java |  224 +++
 .../apache/olingo/client/api/uri/FilterArg.java |   30 +
 .../olingo/client/api/uri/URIBuilder.java       |  225 ---
 .../apache/olingo/client/api/uri/URIFilter.java |   32 +
 .../olingo/client/api/uri/V3URIBuilder.java     |   47 -
 .../olingo/client/api/uri/V4URIBuilder.java     |   87 --
 .../olingo/client/api/uri/filter/FilterArg.java |   30 -
 .../client/api/uri/filter/FilterArgFactory.java |   83 -
 .../client/api/uri/filter/FilterFactory.java    |   61 -
 .../olingo/client/api/uri/filter/URIFilter.java |   32 -
 .../api/uri/filter/V3FilterArgFactory.java      |   25 -
 .../client/api/uri/filter/V3FilterFactory.java  |   26 -
 .../api/uri/filter/V4FilterArgFactory.java      |   55 -
 .../client/api/uri/filter/V4FilterFactory.java  |   32 -
 .../client/api/uri/v3/FilterArgFactory.java     |   28 +
 .../olingo/client/api/uri/v3/FilterFactory.java |   28 +
 .../olingo/client/api/uri/v3/URIBuilder.java    |   49 +
 .../client/api/uri/v4/FilterArgFactory.java     |   59 +
 .../olingo/client/api/uri/v4/FilterFactory.java |   35 +
 .../olingo/client/api/uri/v4/URIBuilder.java    |   89 ++
 .../olingo/client/api/utils/XMLUtils.java       |  178 ---
 .../olingo/client/api/v3/Configuration.java     |   46 +
 .../olingo/client/api/v3/ODataClient.java       |   67 +
 .../client/api/v3/UnsupportedInV3Exception.java |   31 +
 .../olingo/client/api/v4/Configuration.java     |   26 +
 .../olingo/client/api/v4/ODataClient.java       |   67 +
 lib/client-core/pom.xml                         |   97 +-
 .../client/core/AbstractConfiguration.java      |   15 +-
 .../olingo/client/core/AbstractODataClient.java |   36 +-
 .../olingo/client/core/ODataClientFactory.java  |   11 +-
 .../olingo/client/core/ODataV3ClientImpl.java   |  146 --
 .../olingo/client/core/ODataV4ClientImpl.java   |  146 --
 .../olingo/client/core/V3ConfigurationImpl.java |   57 -
 .../olingo/client/core/V4ConfigurationImpl.java |   31 -
 .../communication/header/ODataHeadersImpl.java  |  111 ++
 .../request/AbstractODataBasicRequest.java      |  126 ++
 .../request/AbstractODataStreamManager.java     |  182 +++
 .../request/AbstractODataStreamer.java          |  101 ++
 .../communication/request/ODataRequestImpl.java |  489 ++++++
 .../core/communication/request/Wrapper.java     |   41 +
 .../batch/AbstractBatchRequestFactory.java      |   36 +
 .../batch/AbstractODataBatchRequestItem.java    |  124 ++
 .../batch/AbstractODataBatchResponseItem.java   |  146 ++
 .../request/batch/ODataBatchController.java     |   89 ++
 .../batch/ODataBatchLineIteratorImpl.java       |   93 ++
 .../request/batch/ODataBatchRequestImpl.java    |  255 ++++
 .../request/batch/ODataBatchUtilities.java      |  329 ++++
 .../request/batch/ODataChangesetImpl.java       |  128 ++
 .../batch/ODataChangesetResponseItem.java       |  129 ++
 .../request/batch/ODataRetrieveImpl.java        |   81 +
 .../batch/ODataRetrieveResponseItem.java        |   85 ++
 .../batch/v3/BatchRequestFactoryImpl.java       |   33 +
 .../batch/v4/BatchRequestFactoryImpl.java       |   33 +
 .../request/cud/AbstractCUDRequestFactory.java  |  197 +++
 .../request/cud/ODataDeleteRequestImpl.java     |   93 ++
 .../cud/ODataEntityCreateRequestImpl.java       |  125 ++
 .../cud/ODataEntityUpdateRequestImpl.java       |  131 ++
 .../request/cud/ODataLinkCreateRequestImpl.java |  108 ++
 .../request/cud/ODataLinkUpdateRequestImpl.java |  111 ++
 .../cud/ODataPropertyUpdateRequestImpl.java     |  129 ++
 .../cud/ODataValueUpdateRequestImpl.java        |  139 ++
 .../request/cud/v3/CUDRequestFactoryImpl.java   |   33 +
 .../request/cud/v4/CUDRequestFactoryImpl.java   |   33 +
 .../invoke/AbstractInvokeRequestFactory.java    |   46 +
 .../request/invoke/ODataInvokeRequestImpl.java  |  235 +++
 .../invoke/v3/InvokeRequestFactoryImpl.java     |  112 ++
 .../invoke/v4/InvokeRequestFactoryImpl.java     |   48 +
 .../retrieve/AbstractODataRetrieveRequest.java  |   98 ++
 .../AbstractRetrieveRequestFactory.java         |   92 ++
 .../retrieve/ODataEntityRequestImpl.java        |   95 ++
 .../ODataEntitySetIteratorRequestImpl.java      |   86 ++
 .../retrieve/ODataEntitySetRequestImpl.java     |   97 ++
 .../request/retrieve/ODataMediaRequestImpl.java |  109 ++
 .../retrieve/ODataMetadataRequestImpl.java      |  108 ++
 .../retrieve/ODataPropertyRequestImpl.java      |   97 ++
 .../request/retrieve/ODataRawRequestImpl.java   |  101 ++
 .../ODataServiceDocumentRequestImpl.java        |   93 ++
 .../request/retrieve/ODataValueRequestImpl.java |  107 ++
 .../v3/ODataLinkCollectionRequestImpl.java      |   99 ++
 .../retrieve/v3/RetrieveRequestFactoryImpl.java |   41 +
 .../retrieve/v4/RetrieveRequestFactoryImpl.java |   33 +
 .../AbstractODataStreamedEntityRequest.java     |   70 +
 .../streamed/AbstractODataStreamedRequest.java  |  153 ++
 .../AbstractStreamedRequestFactory.java         |   76 +
 .../ODataMediaEntityCreateRequestImpl.java      |  134 ++
 .../ODataMediaEntityUpdateRequestImpl.java      |  137 ++
 .../streamed/ODataStreamUpdateRequestImpl.java  |  133 ++
 .../streamed/v3/StreamedRequestFactoryImpl.java |   33 +
 .../streamed/v4/StreamedRequestFactoryImpl.java |   33 +
 .../response/AbstractODataResponse.java         |  276 ++++
 .../batch/ODataBatchResponseManager.java        |  151 ++
 .../data/JSONServiceDocumentDeserializer.java   |   15 +-
 .../core/data/ODataJacksonDeserializer.java     |   45 -
 .../core/data/ODataJacksonSerializer.java       |   45 -
 .../data/XMLServiceDocumentDeserializer.java    |    3 +-
 .../core/data/v3/JSONServiceDocumentImpl.java   |    4 +-
 .../core/data/v4/JSONServiceDocumentImpl.java   |    4 +-
 .../deserializer/AnnotationPropertyImpl.java    |   53 -
 .../core/deserializer/ComplexValueImpl.java     |   82 -
 .../client/core/deserializer/EntityImpl.java    |  126 --
 .../core/deserializer/EntitySetBuilder.java     |   72 -
 .../client/core/deserializer/EntitySetImpl.java |  120 --
 .../client/core/deserializer/JsonReader.java    |   89 --
 .../deserializer/NavigationPropertyImpl.java    |   89 --
 .../core/deserializer/PrimitiveValue.java       |   51 -
 .../core/deserializer/PropertyCollection.java   |   96 --
 .../deserializer/PropertyCollectionBuilder.java |  221 ---
 .../deserializer/StructuralPropertyImpl.java    |   83 -
 .../core/domain/ODataGeospatialValueImpl.java   |  130 ++
 .../core/domain/ODataPrimitiveValueImpl.java    |  177 +++
 .../client/core/edm/EdmActionImportImpl.java    |    3 +-
 .../olingo/client/core/edm/EdmClientImpl.java   |   25 +-
 .../client/core/edm/EdmComplexTypeImpl.java     |    1 +
 .../client/core/edm/EdmEntityContainerImpl.java |    3 +-
 .../client/core/edm/EdmEntityTypeImpl.java      |    1 +
 .../olingo/client/core/edm/EdmEnumTypeImpl.java |   14 +-
 .../client/core/edm/EdmFunctionImportImpl.java  |    1 +
 .../core/edm/EdmNavigationPropertyImpl.java     |    1 +
 .../client/core/edm/EdmOperationImpl.java       |    8 +-
 .../client/core/edm/EdmParameterImpl.java       |    1 +
 .../olingo/client/core/edm/EdmPropertyImpl.java |    1 +
 .../client/core/edm/EdmReturnTypeImpl.java      |    1 +
 .../olingo/client/core/edm/EdmSchemaImpl.java   |   15 +-
 .../client/core/edm/EdmTypeDefinitionImpl.java  |   12 +-
 .../olingo/client/core/edm/EdmTypeInfo.java     |  174 ---
 .../core/edm/v3/EdmActionImportProxy.java       |    2 +-
 .../core/edm/v3/EdmFunctionImportProxy.java     |    2 +-
 .../core/edm/v3/EdmServiceMetadataImpl.java     |    6 +-
 .../client/core/edm/v3/FunctionImportUtils.java |   36 +
 .../core/edm/v3/V3FunctionImportUtils.java      |   36 -
 .../core/edm/xml/AbstractComplexType.java       |    1 -
 .../core/edm/xml/AbstractEdmDeserializer.java   |   71 +
 .../core/edm/xml/AbstractEntityContainer.java   |    1 -
 .../client/core/edm/xml/AbstractEntitySet.java  |    1 -
 .../client/core/edm/xml/AbstractEntityType.java |    1 -
 .../client/core/edm/xml/AbstractEnumType.java   |    1 -
 .../client/core/edm/xml/AbstractSchema.java     |    1 -
 .../core/edm/xml/ComplexTypeDeserializer.java   |   82 +
 .../core/edm/xml/DataServicesDeserializer.java  |    3 +-
 .../client/core/edm/xml/EdmxDeserializer.java   |    6 +-
 .../edm/xml/EntityContainerDeserializer.java    |  101 ++
 .../core/edm/xml/EntityKeyDeserializer.java     |   47 +
 .../client/core/edm/xml/EntityKeyImpl.java      |    1 -
 .../core/edm/xml/EntitySetDeserializer.java     |   69 +
 .../core/edm/xml/EntityTypeDeserializer.java    |   90 ++
 .../core/edm/xml/EnumTypeDeserializer.java      |   72 +
 .../core/edm/xml/ParameterDeserializer.java     |    3 +-
 .../core/edm/xml/PropertyDeserializer.java      |    3 +-
 .../client/core/edm/xml/SchemaDeserializer.java |  148 ++
 .../edm/xml/v3/AnnotationsDeserializer.java     |    2 +-
 .../edm/xml/v3/AssociationDeserializer.java     |    2 +-
 .../edm/xml/v3/AssociationSetDeserializer.java  |    2 +-
 .../edm/xml/v3/FunctionImportDeserializer.java  |    2 +-
 .../ReferentialConstraintRoleDeserializer.java  |    2 +-
 .../edm/xml/v3/TypeAnnotationDeserializer.java  |    2 +-
 .../core/edm/xml/v4/ActionDeserializer.java     |    2 +-
 .../core/edm/xml/v4/AnnotationDeserializer.java |    4 +-
 .../edm/xml/v4/AnnotationsDeserializer.java     |    2 +-
 .../core/edm/xml/v4/FunctionDeserializer.java   |    2 +-
 .../xml/v4/NavigationPropertyDeserializer.java  |    2 +-
 .../core/edm/xml/v4/ReferenceDeserializer.java  |    2 +-
 .../core/edm/xml/v4/ReturnTypeDeserializer.java |    2 +-
 .../core/edm/xml/v4/SingletonDeserializer.java  |    2 +-
 .../core/edm/xml/v4/TermDeserializer.java       |    2 +-
 .../edm/xml/v4/TypeDefinitionDeserializer.java  |    2 +-
 .../xml/v4/annotation/ApplyDeserializer.java    |    2 +-
 .../edm/xml/v4/annotation/CastDeserializer.java |    2 +-
 .../v4/annotation/CollectionDeserializer.java   |    2 +-
 .../DynExprConstructDeserializer.java           |    2 +-
 .../edm/xml/v4/annotation/IsOfDeserializer.java |    2 +-
 .../annotation/LabeledElementDeserializer.java  |    2 +-
 .../edm/xml/v4/annotation/NullDeserializer.java |    2 +-
 .../annotation/PropertyValueDeserializer.java   |    2 +-
 .../xml/v4/annotation/RecordDeserializer.java   |    2 +-
 .../xml/v4/annotation/UrlRefDeserializer.java   |    2 +-
 .../client/core/op/AbstractODataBinder.java     |  405 +++++
 .../client/core/op/AbstractODataReader.java     |  117 ++
 .../olingo/client/core/op/ODataWriterImpl.java  |  102 ++
 .../core/op/impl/AbstractEdmDeserializer.java   |   71 -
 .../core/op/impl/AbstractJacksonTool.java       |   85 --
 .../core/op/impl/AbstractODataBinder.java       |  582 -------
 .../core/op/impl/AbstractODataDeserializer.java |  178 ---
 .../core/op/impl/AbstractODataReader.java       |  138 --
 .../core/op/impl/AbstractODataSerializer.java   |  161 --
 .../core/op/impl/ComplexTypeDeserializer.java   |   83 -
 .../op/impl/EntityContainerDeserializer.java    |  102 --
 .../core/op/impl/EntityKeyDeserializer.java     |   50 -
 .../core/op/impl/EntitySetDeserializer.java     |   70 -
 .../core/op/impl/EntityTypeDeserializer.java    |   92 --
 .../core/op/impl/EnumTypeDeserializer.java      |   73 -
 .../op/impl/InjectableSerializerProvider.java   |   43 -
 .../client/core/op/impl/ODataV3BinderImpl.java  |   37 -
 .../core/op/impl/ODataV3DeserializerImpl.java   |   70 -
 .../client/core/op/impl/ODataV3ReaderImpl.java  |   48 -
 .../core/op/impl/ODataV3SerializerImpl.java     |   32 -
 .../client/core/op/impl/ODataV4BinderImpl.java  |   62 -
 .../core/op/impl/ODataV4DeserializerImpl.java   |   71 -
 .../client/core/op/impl/ODataV4ReaderImpl.java  |   48 -
 .../core/op/impl/ODataV4SerializerImpl.java     |   32 -
 .../client/core/op/impl/SchemaDeserializer.java |  149 --
 .../client/core/op/impl/v3/ODataBinderImpl.java |   42 +
 .../core/op/impl/v3/ODataDeserializerImpl.java  |   67 +
 .../client/core/op/impl/v3/ODataReaderImpl.java |   66 +
 .../core/op/impl/v3/ODataSerializerImpl.java    |   32 +
 .../client/core/op/impl/v4/ODataBinderImpl.java |   59 +
 .../core/op/impl/v4/ODataDeserializerImpl.java  |   58 +
 .../client/core/op/impl/v4/ODataReaderImpl.java |   49 +
 .../core/op/impl/v4/ODataSerializerImpl.java    |   32 +
 .../core/uri/AbstractComparingFilter.java       |   45 +
 .../core/uri/AbstractFilterArgFactory.java      |  178 +++
 .../client/core/uri/AbstractFilterFactory.java  |  108 ++
 .../client/core/uri/AbstractURIBuilder.java     |    8 +-
 .../olingo/client/core/uri/AndFilter.java       |   42 +
 .../apache/olingo/client/core/uri/EqFilter.java |   33 +
 .../olingo/client/core/uri/FilterConst.java     |   40 +
 .../olingo/client/core/uri/FilterFunction.java  |   48 +
 .../olingo/client/core/uri/FilterLambda.java    |   46 +
 .../olingo/client/core/uri/FilterLiteral.java   |   40 +
 .../apache/olingo/client/core/uri/FilterOp.java |   45 +
 .../olingo/client/core/uri/FilterProperty.java  |   40 +
 .../apache/olingo/client/core/uri/GeFilter.java |   33 +
 .../apache/olingo/client/core/uri/GtFilter.java |   33 +
 .../olingo/client/core/uri/HasFilter.java       |   34 +
 .../apache/olingo/client/core/uri/LeFilter.java |   33 +
 .../apache/olingo/client/core/uri/LtFilter.java |   33 +
 .../olingo/client/core/uri/MatchFilter.java     |   36 +
 .../apache/olingo/client/core/uri/NeFilter.java |   33 +
 .../olingo/client/core/uri/NotFilter.java       |   35 +
 .../apache/olingo/client/core/uri/OrFilter.java |   42 +
 .../apache/olingo/client/core/uri/URIUtils.java |   64 +-
 .../client/core/uri/V3URIBuilderImpl.java       |   94 --
 .../client/core/uri/V4URIBuilderImpl.java       |  101 --
 .../uri/filter/AbstractComparingFilter.java     |   45 -
 .../uri/filter/AbstractFilterArgFactory.java    |  178 ---
 .../core/uri/filter/AbstractFilterFactory.java  |  108 --
 .../client/core/uri/filter/AndFilter.java       |   42 -
 .../olingo/client/core/uri/filter/EqFilter.java |   33 -
 .../client/core/uri/filter/FilterConst.java     |   41 -
 .../client/core/uri/filter/FilterFunction.java  |   48 -
 .../client/core/uri/filter/FilterLambda.java    |   46 -
 .../client/core/uri/filter/FilterLiteral.java   |   41 -
 .../olingo/client/core/uri/filter/FilterOp.java |   45 -
 .../client/core/uri/filter/FilterProperty.java  |   40 -
 .../olingo/client/core/uri/filter/GeFilter.java |   33 -
 .../olingo/client/core/uri/filter/GtFilter.java |   33 -
 .../client/core/uri/filter/HasFilter.java       |   34 -
 .../olingo/client/core/uri/filter/LeFilter.java |   33 -
 .../olingo/client/core/uri/filter/LtFilter.java |   33 -
 .../client/core/uri/filter/MatchFilter.java     |   36 -
 .../olingo/client/core/uri/filter/NeFilter.java |   33 -
 .../client/core/uri/filter/NotFilter.java       |   35 -
 .../olingo/client/core/uri/filter/OrFilter.java |   42 -
 .../core/uri/filter/V3FilterArgFactoryImpl.java |   31 -
 .../core/uri/filter/V3FilterFactoryImpl.java    |   33 -
 .../core/uri/filter/V4FilterArgFactoryImpl.java |  107 --
 .../core/uri/filter/V4FilterFactoryImpl.java    |   46 -
 .../core/uri/v3/FilterArgFactoryImpl.java       |   33 +
 .../client/core/uri/v3/FilterFactoryImpl.java   |   34 +
 .../client/core/uri/v3/URIBuilderImpl.java      |   96 ++
 .../core/uri/v4/FilterArgFactoryImpl.java       |  110 ++
 .../client/core/uri/v4/FilterFactoryImpl.java   |   49 +
 .../client/core/uri/v4/URIBuilderImpl.java      |  102 ++
 .../client/core/v3/ConfigurationImpl.java       |   58 +
 .../olingo/client/core/v3/ODataClientImpl.java  |  150 ++
 .../client/core/v4/ConfigurationImpl.java       |   32 +
 .../olingo/client/core/v4/ODataClientImpl.java  |  149 ++
 .../client/core/xml/AbstractDOMParser.java      |   46 -
 .../client/core/xml/AndroidDOMParserImpl.java   |   53 -
 .../client/core/xml/DefaultDOMParserImpl.java   |   78 -
 .../olingo/client/core/xml/XMLParser.java       |   37 -
 .../client/core/AbstractPrimitiveTest.java      |  429 ++++++
 .../client/core/AbstractPropertyTest.java       |  175 +++
 .../apache/olingo/client/core/AbstractTest.java |   25 +-
 .../olingo/client/core/AtomLinksQualifier.java  |   40 +
 .../olingo/client/core/ODataClientTest.java     |    4 +-
 .../deserializer/JsonReaderPerformance.java     |   76 -
 .../core/deserializer/JsonReaderTest.java       |  372 -----
 .../core/it/AbstractMetadataTestITCase.java     |   31 +
 .../client/core/it/AbstractTestITCase.java      |  550 +++++++
 .../client/core/it/v3/AbstractTestITCase.java   |   52 +
 .../core/it/v3/ActionOverloadingTestITCase.java |  133 ++
 .../client/core/it/v3/AsyncTestITCase.java      |  134 ++
 .../it/v3/AuthEntityRetrieveTestITCase.java     |   54 +
 .../client/core/it/v3/BatchTestITCase.java      |  406 +++++
 .../client/core/it/v3/CountTestITCase.java      |   60 +
 .../core/it/v3/EntityCreateTestITCase.java      |  485 ++++++
 .../core/it/v3/EntityRetrieveTestITCase.java    |  239 +++
 .../client/core/it/v3/EntitySetTestITCase.java  |  149 ++
 .../core/it/v3/EntityUpdateTestITCase.java      |  241 +++
 .../client/core/it/v3/ErrorTestITCase.java      |  172 +++
 .../core/it/v3/FilterFactoryTestITCase.java     |  167 ++
 .../client/core/it/v3/FilterTestITCase.java     |   94 ++
 .../client/core/it/v3/InvokeTestITCase.java     |  275 ++++
 .../core/it/v3/KeyAsSegmentTestITCase.java      |  110 ++
 .../client/core/it/v3/LinkTestITCase.java       |  177 +++
 .../core/it/v3/MediaEntityTestITCase.java       |  187 +++
 .../client/core/it/v3/MetadataTestITCase.java   |   41 +
 .../it/v3/NavigationLinkCreateTestITCase.java   |  521 +++++++
 .../client/core/it/v3/OpenTypeTestITCase.java   |  266 ++++
 .../core/it/v3/PrimitiveKeysTestITCase.java     |   69 +
 .../core/it/v3/PropertyRetrieveTestITCase.java  |  277 ++++
 .../client/core/it/v3/PropertyTestITCase.java   |  355 +++++
 .../core/it/v3/PropertyValueTestITCase.java     |  166 ++
 .../core/it/v3/QueryOptionsTestITCase.java      |  199 +++
 .../v3/ServiceDocumentRetrieveTestITCase.java   |   73 +
 .../core/it/v3/ServiceDocumentTestITCase.java   |   56 +
 .../v3/XHTTPMethodEntityUpdateTestITCase.java   |   38 +
 .../v3/XHTTPMethodPropertyUpdateTestITCase.java |   38 +
 .../client/core/it/v4/AbstractTestITCase.java   |   52 +
 .../client/core/it/v4/EntitySetTestITCase.java  |  155 ++
 .../client/core/it/v4/MetadataTestITCase.java   |   41 +
 .../apache/olingo/client/core/v3/AtomTest.java  |  132 ++
 .../olingo/client/core/v3/EntitySetTest.java    |   63 +
 .../olingo/client/core/v3/EntityTest.java       |  189 +++
 .../apache/olingo/client/core/v3/ErrorTest.java |   74 +
 .../client/core/v3/FilterFactoryTest.java       |   14 +-
 .../apache/olingo/client/core/v3/JSONTest.java  |  106 ++
 .../olingo/client/core/v3/MetadataTest.java     |   17 +-
 .../client/core/v3/PrimitiveValueTest.java      |  569 +++++++
 .../client/core/v3/ServiceDocumentTest.java     |    8 +-
 .../olingo/client/core/v3/URIBuilderTest.java   |   18 +-
 .../client/core/v4/FilterFactoryTest.java       |   17 +-
 .../olingo/client/core/v4/MetadataTest.java     |   13 +-
 .../client/core/v4/PrimitiveValueTest.java      |   73 +
 .../client/core/v4/ServiceDocumentTest.java     |    8 +-
 .../olingo/client/core/v4/URIBuilderTest.java   |   22 +-
 .../src/test/resources/complexProperty.json     |    8 -
 .../src/test/resources/fullEntity.json          |   22 -
 .../src/test/resources/fullEntitySet.json       |   29 -
 .../resources/fullEntitySetWithTwoEntities.json |   49 -
 ...fullEntityWithCollectionOfComplexValues.json |   28 -
 .../src/test/resources/minimalEntity.json       |   21 -
 .../apache/olingo/client/core/atom_cleanup.xsl  |   48 +
 .../core/v3/AllGeoTypesSet_-10_GeogLine.json    |    1 +
 .../core/v3/AllGeoTypesSet_-10_GeogLine.xml     |   22 +
 .../core/v3/AllGeoTypesSet_-10_GeogPoint.json   |    1 +
 .../core/v3/AllGeoTypesSet_-10_GeogPoint.xml    |   22 +
 .../client/core/v3/AllGeoTypesSet_-10_Geom.json |    1 +
 .../client/core/v3/AllGeoTypesSet_-10_Geom.xml  |   33 +
 .../v3/AllGeoTypesSet_-3_GeomMultiPolygon.json  |    1 +
 .../v3/AllGeoTypesSet_-3_GeomMultiPolygon.xml   |   61 +
 .../client/core/v3/AllGeoTypesSet_-5.json       |    1 +
 .../olingo/client/core/v3/AllGeoTypesSet_-5.xml |  181 +++
 .../v3/AllGeoTypesSet_-5_GeogCollection.json    |    1 +
 .../v3/AllGeoTypesSet_-5_GeogCollection.xml     |   39 +
 .../core/v3/AllGeoTypesSet_-5_GeogPolygon.json  |    1 +
 .../core/v3/AllGeoTypesSet_-5_GeogPolygon.xml   |   38 +
 .../v3/AllGeoTypesSet_-6_GeomMultiLine.json     |    1 +
 .../core/v3/AllGeoTypesSet_-6_GeomMultiLine.xml |   42 +
 .../v3/AllGeoTypesSet_-7_GeomMultiPoint.json    |    1 +
 .../v3/AllGeoTypesSet_-7_GeomMultiPoint.xml     |   34 +
 .../client/core/v3/AllGeoTypesSet_-8.json       |    1 +
 .../olingo/client/core/v3/AllGeoTypesSet_-8.xml |  177 +++
 .../v3/AllGeoTypesSet_-8_GeomCollection.json    |    1 +
 .../v3/AllGeoTypesSet_-8_GeomCollection.xml     |   38 +
 .../apache/olingo/client/core/v3/Car_16.json    |    1 +
 .../org/apache/olingo/client/core/v3/Car_16.xml |   48 +
 .../client/core/v3/ComputerDetail_-10.json      |    1 +
 .../client/core/v3/ComputerDetail_-10.xml       |   22 +
 .../apache/olingo/client/core/v3/Customer.json  |    3 +
 .../apache/olingo/client/core/v3/Customer.xml   |   22 +
 .../olingo/client/core/v3/Customer_-10.json     |    1 +
 .../olingo/client/core/v3/Customer_-10.xml      |  528 +++++++
 .../core/v3/Customer_-10_BackupContactInfo.json |    1 +
 .../core/v3/Customer_-10_BackupContactInfo.xml  |   22 +
 .../client/core/v3/Customer_-10_CustomerId.json |    1 +
 .../client/core/v3/Customer_-10_CustomerId.xml  |   22 +
 .../core/v3/Customer_-10_CustomerId_value.txt   |    1 +
 .../v3/Customer_-10_PrimaryContactInfo.json     |    1 +
 .../core/v3/Customer_-10_PrimaryContactInfo.xml |   22 +
 ...a4af-4bbd-bf0a-2b2c22635565'_Attachment.json |    1 +
 ...-a4af-4bbd-bf0a-2b2c22635565'_Attachment.xml |   22 +
 ...af-4bbd-bf0a-2b2c22635565'_AttachmentId.json |    1 +
 ...4af-4bbd-bf0a-2b2c22635565'_AttachmentId.xml |   22 +
 .../client/core/v3/PersonDetails_0_Person.json  |    1 +
 .../client/core/v3/PersonDetails_0_Person.xml   |   75 +
 ..._-10_ComplexConcurrency_QueriedDateTime.json |    1 +
 ...t_-10_ComplexConcurrency_QueriedDateTime.xml |   22 +
 .../core/v3/Product_-10_Dimensions_Width.json   |    1 +
 .../core/v3/Product_-10_Dimensions_Width.xml    |   22 +
 .../client/core/v3/Product_-9_Description.json  |    1 +
 .../client/core/v3/Product_-9_Description.xml   |   22 +
 .../client/core/v3/Products_0_Categories.json   |    1 +
 .../client/core/v3/Products_0_Categories.xml    |   79 +
 .../olingo/client/core/v3/Products_1.json       |    1 +
 .../apache/olingo/client/core/v3/Products_1.xml |   51 +
 .../core/v3/Products_1_DiscontinuedDate.json    |    1 +
 .../core/v3/Products_1_DiscontinuedDate.xml     |   24 +
 .../org/apache/olingo/client/core/v3/error.json |    9 +
 .../org/apache/olingo/client/core/v3/error.xml  |   25 +
 .../apache/olingo/client/core/v3/metadata.xml   |  701 +--------
 .../olingo/client/core/v3/stacktrace.json       |   14 +
 .../apache/olingo/client/core/v3/stacktrace.xml |   35 +
 .../olingo/client/core/v4/complexProperty.json  |    8 +
 .../olingo/client/core/v4/fullEntity.json       |   22 +
 .../olingo/client/core/v4/fullEntitySet.json    |   29 +
 .../core/v4/fullEntitySetWithTwoEntities.json   |   49 +
 ...fullEntityWithCollectionOfComplexValues.json |   28 +
 .../olingo/client/core/v4/minimalEntity.json    |   21 +
 .../client/core/v4/primitiveNullValue.json      |    3 +
 .../client/core/v4/setOfComplexProperties.json  |   13 +
 .../core/v4/setOfPrimitiveProperties.json       |    8 +
 .../src/test/resources/primitiveNullValue.json  |    3 -
 lib/client-core/src/test/resources/sample.png   |  Bin 0 -> 25566 bytes
 .../test/resources/setOfComplexProperties.json  |   13 -
 .../resources/setOfPrimitiveProperties.json     |    8 -
 lib/commons-api/pom.xml                         |   16 +-
 .../apache/olingo/commons/api/Constants.java    |  243 +++
 .../commons/api/data/CollectionValue.java       |   27 +
 .../olingo/commons/api/data/ComplexValue.java   |   27 +
 .../apache/olingo/commons/api/data/Entry.java   |  167 ++
 .../apache/olingo/commons/api/data/Feed.java    |   75 +
 .../olingo/commons/api/data/GeoUtils.java       |   90 ++
 .../commons/api/data/GeospatialValue.java       |   28 +
 .../apache/olingo/commons/api/data/Link.java    |  121 ++
 .../olingo/commons/api/data/NullValue.java      |   26 +
 .../olingo/commons/api/data/PrimitiveValue.java |   25 +
 .../olingo/commons/api/data/Property.java       |   34 +
 .../apache/olingo/commons/api/data/Value.java   |   44 +
 .../commons/api/data/v3/LinkCollection.java     |   52 +
 .../commons/api/domain/AbstractODataValue.java  |  127 ++
 .../api/domain/ODataCollectionValue.java        |   98 ++
 .../commons/api/domain/ODataComplexValue.java   |   97 ++
 .../olingo/commons/api/domain/ODataEntity.java  |  316 ++++
 .../commons/api/domain/ODataEntitySet.java      |  120 ++
 .../olingo/commons/api/domain/ODataError.java   |   67 +
 .../api/domain/ODataGeospatialValue.java        |   57 +
 .../commons/api/domain/ODataInlineEntity.java   |   74 +
 .../api/domain/ODataInlineEntitySet.java        |   74 +
 .../commons/api/domain/ODataInvokeResult.java   |   30 +
 .../olingo/commons/api/domain/ODataItem.java    |  111 ++
 .../olingo/commons/api/domain/ODataLink.java    |  190 +++
 .../commons/api/domain/ODataLinkType.java       |   93 ++
 .../commons/api/domain/ODataObjectFactory.java  |  218 +++
 .../commons/api/domain/ODataOperation.java      |   88 ++
 .../commons/api/domain/ODataPrimitiveValue.java |   67 +
 .../commons/api/domain/ODataProperty.java       |  186 +++
 .../commons/api/domain/ODataPropertyType.java   |   40 +
 .../api/domain/ODataServiceDocument.java        |  183 +++
 .../olingo/commons/api/domain/ODataValue.java   |   84 +
 .../org/apache/olingo/commons/api/edm/Edm.java  |  161 +-
 .../olingo/commons/api/edm/EdmActionImport.java |    2 +-
 .../commons/api/edm/EdmGeospatialType.java      |   34 +
 .../commons/api/edm/EdmPrimitiveTypeKind.java   |  139 ++
 .../api/edm/constants/ODataServiceVersion.java  |    8 +-
 .../commons/api/edm/geo/ComposedGeospatial.java |   78 +
 .../olingo/commons/api/edm/geo/Geospatial.java  |  169 ++
 .../api/edm/geo/GeospatialCollection.java       |   48 +
 .../olingo/commons/api/edm/geo/LineString.java  |   38 +
 .../commons/api/edm/geo/MultiLineString.java    |   39 +
 .../olingo/commons/api/edm/geo/MultiPoint.java  |   39 +
 .../commons/api/edm/geo/MultiPolygon.java       |   38 +
 .../olingo/commons/api/edm/geo/Point.java       |   77 +
 .../olingo/commons/api/edm/geo/Polygon.java     |   73 +
 .../olingo/commons/api/format/ContentType.java  |   47 +
 .../olingo/commons/api/format/Format.java       |   26 +
 .../olingo/commons/api/format/ODataFormat.java  |  102 ++
 .../commons/api/format/ODataMediaFormat.java    |   76 +
 .../commons/api/format/ODataPubFormat.java      |  121 ++
 .../commons/api/format/ODataValueFormat.java    |   81 +
 .../commons/api/op/CommonODataDeserializer.java |   71 +
 .../olingo/commons/api/op/ODataSerializer.java  |  100 ++
 lib/commons-core/pom.xml                        |  112 +-
 .../commons/core/data/AbstractAtomDealer.java   |   87 ++
 .../commons/core/data/AbstractAtomObject.java   |   78 +
 .../olingo/commons/core/data/AbstractEntry.java |  159 ++
 .../core/data/AbstractJsonDeserializer.java     |  175 +++
 .../core/data/AbstractJsonSerializer.java       |   94 ++
 .../core/data/AbstractPayloadObject.java        |   48 +
 .../commons/core/data/AbstractPropertyImpl.java |   80 +
 .../olingo/commons/core/data/AbstractValue.java |   98 ++
 .../commons/core/data/AtomDeserializer.java     |  368 +++++
 .../olingo/commons/core/data/AtomEntryImpl.java |   25 +
 .../olingo/commons/core/data/AtomFeedImpl.java  |   66 +
 .../core/data/AtomGeoValueDeserializer.java     |  261 ++++
 .../core/data/AtomGeoValueSerializer.java       |  221 +++
 .../core/data/AtomPropertyDeserializer.java     |  218 +++
 .../commons/core/data/AtomPropertyImpl.java     |   25 +
 .../core/data/AtomPropertySerializer.java       |   88 ++
 .../commons/core/data/AtomSerializer.java       |  264 ++++
 .../commons/core/data/CollectionValueImpl.java  |   40 +
 .../commons/core/data/ComplexValueImpl.java     |   40 +
 .../commons/core/data/GeospatialValueImpl.java  |   42 +
 .../core/data/JSONEntryDeserializer.java        |  241 +++
 .../olingo/commons/core/data/JSONEntryImpl.java |   92 ++
 .../commons/core/data/JSONEntrySerializer.java  |  120 ++
 .../commons/core/data/JSONErrorBundle.java      |   50 +
 .../olingo/commons/core/data/JSONErrorImpl.java |  237 +++
 .../commons/core/data/JSONFeedDeserializer.java |   68 +
 .../olingo/commons/core/data/JSONFeedImpl.java  |  113 ++
 .../commons/core/data/JSONFeedSerializer.java   |   57 +
 .../core/data/JSONGeoValueDeserializer.java     |  273 ++++
 .../core/data/JSONGeoValueSerializer.java       |  183 +++
 .../core/data/JSONPropertyDeserializer.java     |   71 +
 .../commons/core/data/JSONPropertyImpl.java     |   53 +
 .../core/data/JSONPropertySerializer.java       |   59 +
 .../olingo/commons/core/data/LinkImpl.java      |  112 ++
 .../olingo/commons/core/data/NullValueImpl.java |   35 +
 .../core/data/ODataJacksonDeserializer.java     |   44 +
 .../core/data/ODataJacksonSerializer.java       |   45 +
 .../commons/core/data/PrimitiveValueImpl.java   |   41 +
 .../olingo/commons/core/data/XMLErrorImpl.java  |  213 +++
 .../core/data/v3/JSONLinkCollectionImpl.java    |  118 ++
 .../core/data/v3/XMLLinkCollectionImpl.java     |   70 +
 .../core/edm/AbstractEdmComplexType.java        |   39 +-
 .../core/edm/AbstractEdmEntityContainer.java    |  176 +--
 .../commons/core/edm/AbstractEdmOperation.java  |  131 +-
 .../core/edm/AbstractEdmOperationImport.java    |   65 +-
 .../commons/core/edm/AbstractEdmParameter.java  |    5 +-
 .../commons/core/edm/AbstractEdmProperty.java   |    5 +-
 .../commons/core/edm/AbstractEdmReturnType.java |    5 +-
 .../core/edm/AbstractEdmStructuredType.java     |  159 +-
 .../olingo/commons/core/edm/EdmNamedImpl.java   |   21 +-
 .../olingo/commons/core/edm/EdmTypeImpl.java    |   31 +-
 .../olingo/commons/core/edm/EdmTypeInfo.java    |  184 +++
 .../AbstractEdmGeospatialType.java              |   76 +
 .../commons/core/edm/primitivetype/EdmDate.java |    5 +-
 .../core/edm/primitivetype/EdmDateTime.java     |  137 ++
 .../edm/primitivetype/EdmDateTimeOffset.java    |   68 +-
 .../core/edm/primitivetype/EdmGeography.java    |   36 +
 .../primitivetype/EdmGeographyCollection.java   |   37 +
 .../primitivetype/EdmGeographyLineString.java   |   37 +
 .../EdmGeographyMultiLineString.java            |   37 +
 .../primitivetype/EdmGeographyMultiPoint.java   |   37 +
 .../primitivetype/EdmGeographyMultiPolygon.java |   37 +
 .../edm/primitivetype/EdmGeographyPoint.java    |   37 +
 .../edm/primitivetype/EdmGeographyPolygon.java  |   37 +
 .../core/edm/primitivetype/EdmGeometry.java     |   36 +
 .../primitivetype/EdmGeometryCollection.java    |   37 +
 .../primitivetype/EdmGeometryLineString.java    |   37 +
 .../EdmGeometryMultiLineString.java             |   37 +
 .../primitivetype/EdmGeometryMultiPoint.java    |   37 +
 .../primitivetype/EdmGeometryMultiPolygon.java  |   37 +
 .../edm/primitivetype/EdmGeometryPoint.java     |   37 +
 .../edm/primitivetype/EdmGeometryPolygon.java   |   37 +
 .../commons/core/edm/primitivetype/EdmNull.java |   75 -
 .../primitivetype/EdmPrimitiveTypeFactory.java  |  138 ++
 .../edm/primitivetype/EdmPrimitiveTypeKind.java |   95 --
 .../core/edm/primitivetype/EdmStream.java       |   88 ++
 .../commons/core/edm/primitivetype/EdmTime.java |   77 +
 .../core/edm/primitivetype/EdmTimeOfDay.java    |   45 +-
 .../commons/core/op/AbstractJacksonTool.java    |   83 +
 .../core/op/AbstractODataDeserializer.java      |  106 ++
 .../core/op/AbstractODataSerializer.java        |  141 ++
 .../core/op/InjectableSerializerProvider.java   |   43 +
 .../commons/core/op/ODataObjectFactoryImpl.java |  162 ++
 .../olingo/commons/core/op/ResourceFactory.java |  125 ++
 .../primitivetype/CommonPrimitiveTypeTest.java  |  191 ++-
 .../core/edm/primitivetype/EdmBinaryTest.java   |   30 +-
 .../core/edm/primitivetype/EdmBooleanTest.java  |    4 +-
 .../core/edm/primitivetype/EdmByteTest.java     |    5 +-
 .../core/edm/primitivetype/EdmDateTest.java     |    4 +-
 .../primitivetype/EdmDateTimeOffsetTest.java    |    4 +-
 .../core/edm/primitivetype/EdmDecimalTest.java  |   19 +-
 .../core/edm/primitivetype/EdmDoubleTest.java   |   17 +-
 .../core/edm/primitivetype/EdmDurationTest.java |    4 +-
 .../core/edm/primitivetype/EdmGuidTest.java     |    4 +-
 .../core/edm/primitivetype/EdmInt16Test.java    |    9 +-
 .../core/edm/primitivetype/EdmInt32Test.java    |   11 +-
 .../core/edm/primitivetype/EdmInt64Test.java    |   13 +-
 .../core/edm/primitivetype/EdmNullTest.java     |   24 +-
 .../core/edm/primitivetype/EdmSByteTest.java    |    5 +-
 .../core/edm/primitivetype/EdmSingleTest.java   |   15 +-
 .../core/edm/primitivetype/EdmStringTest.java   |    4 +-
 .../edm/primitivetype/EdmTimeOfDayTest.java     |    4 +-
 .../core/edm/primitivetype/UInt7Test.java       |    6 +-
 lib/server-core/pom.xml                         |   38 +-
 .../core/edm/provider/EdmEnumTypeImpl.java      |    9 +-
 .../edm/provider/EdmTypeDefinitionImpl.java     |    9 +-
 .../core/uri/UriResourceLambdaAllImpl.java      |   16 +-
 .../core/uri/UriResourceLambdaAnyImpl.java      |   15 +-
 .../olingo/server/core/uri/parser/Parser.java   |    1 -
 .../server/core/uri/parser/UriContext.java      |    4 -
 .../core/uri/parser/UriParseTreeVisitor.java    |  302 ++--
 .../core/uri/queryoption/ExpandItemImpl.java    |    1 -
 .../edm/provider/EdmComplexTypeImplTest.java    |   13 +-
 .../edm/provider/EdmEntityTypeImplTest.java     |   14 +-
 .../server/core/edm/provider/EdmEnumTest.java   |    9 +-
 .../edm/provider/EdmFunctionImportImplTest.java |   31 +-
 .../core/edm/provider/EdmParameterImplTest.java |    6 +-
 .../core/edm/provider/EdmPropertyImplTest.java  |    4 +-
 .../edm/provider/EdmReturnTypeImplTest.java     |    9 +-
 .../edm/provider/EdmTypeDefinitionImplTest.java |   23 +-
 .../server/core/testutil/EdmTechProvider.java   |    2 +-
 .../server/core/uri/UriResourceImplTest.java    |   43 +-
 .../core/uri/testutil/ExpandValidator.java      |    1 -
 .../core/uri/testutil/ResourceValidator.java    |    1 -
 pom.xml                                         |  157 +-
 962 files changed, 72675 insertions(+), 13952 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b2508035/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java
----------------------------------------------------------------------


[19/21] git commit: [OLINGO-206] Merge remote-tracking branch 'origin/master' into olingo-206-val

Posted by sk...@apache.org.
[OLINGO-206] Merge remote-tracking branch 'origin/master' into olingo-206-val


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/49e1069f
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/49e1069f
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/49e1069f

Branch: refs/heads/master
Commit: 49e1069ff8175ff7da319181da5f2a075e9840f6
Parents: 929fb65 242f782
Author: Stephan Klevenz <st...@sap.com>
Authored: Wed Apr 2 12:28:36 2014 +0200
Committer: Stephan Klevenz <st...@sap.com>
Committed: Wed Apr 2 12:28:36 2014 +0200

----------------------------------------------------------------------
 fit/pom.xml              |  4 ++--
 lib/client-api/pom.xml   |  6 +++---
 lib/client-core/pom.xml  | 10 +++++-----
 lib/commons-api/pom.xml  |  4 ++--
 lib/commons-core/pom.xml |  6 +++---
 lib/pom.xml              |  4 ++--
 lib/ref/pom.xml          |  8 ++++----
 lib/server-api/pom.xml   |  6 +++---
 lib/server-core/pom.xml  |  8 ++++----
 pom.xml                  |  4 ++--
 10 files changed, 30 insertions(+), 30 deletions(-)
----------------------------------------------------------------------



[12/21] git commit: [OLINGO-206] http method validation

Posted by sk...@apache.org.
[OLINGO-206] http method validation


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/9a980e88
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/9a980e88
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/9a980e88

Branch: refs/heads/master
Commit: 9a980e88e2bfcd7a53e03ee5600843088e11f5f6
Parents: 3bfc389
Author: Stephan Klevenz <st...@sap.com>
Authored: Tue Mar 25 14:34:10 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Tue Mar 25 14:34:10 2014 +0100

----------------------------------------------------------------------
 .../server/core/uri/validator/UriValidator.java | 178 +++++++++++++------
 .../core/uri/validator/UriEdmValidatorTest.java |   2 +-
 2 files changed, 127 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9a980e88/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
index f5b785b..a8f1790 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/UriValidator.java
@@ -59,10 +59,22 @@ public class UriValidator {
           /* propertyPrimitiveCollectionCount 18 */ { false,   false,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },
           /*           propertyPrimitiveValue 19 */ { false,   true ,   false,   false,   false,   false,    false,   false,   false,   false,      false,    false },                    
       };
+
+  private boolean[][] decisionMatrixForHttpMethod =
+    {
+        /*                                          0-FILTER 1-FORMAT 2-EXPAND 3-ID     4-COUNT  5-ORDERBY 6-SEARCH 7-SELECT 8-SKIP   9-SKIPTOKEN 10-LEVELS 11-TOP */
+        /*                              GET  0 */ { true ,   true ,   true ,   true,    true ,   true ,    true ,   true ,   true ,   true ,      true ,    true },
+        /*                             POST  0 */ { true ,   false ,  true ,   false,   false ,  true ,    false ,  true ,   false ,  false ,     true ,    false },
+        /*                              PUT  0 */ { false ,  false ,  false ,  false,   false ,  false ,   false ,  false ,  false ,  false ,     false ,   false },
+        /*                           DELETE  0 */ { false ,  false ,  false ,  false,   false ,  false,    false ,  false,   false ,  false ,     false,    false },
+        /*                            PATCH  0 */ { false ,  false ,  false ,  false,   false ,  false ,   false ,  false ,  false ,  false ,     false ,   false },
+        /*                            MERGE  0 */ { false ,  false ,  false ,  false,   false ,  false ,   false ,  false ,  false ,  false ,     false ,   false },
+    };
+  
   //CHECKSTYLE:ON
   //@formatter:on
 
-  private enum RowIndex {
+  private enum RowIndexForUriType {
     all(0),
     batch(1),
     crossjoin(2),
@@ -86,7 +98,7 @@ public class UriValidator {
 
     private int idx;
 
-    RowIndex(int i) {
+    RowIndexForUriType(int i) {
       idx = i;
     }
 
@@ -121,8 +133,29 @@ public class UriValidator {
 
   }
 
-  public void validate(final UriInfo uriInfo, final Edm edm) throws UriValidationException {
+  private enum RowIndexForHttpMethod {
+    GET(0),
+    POST(1),
+    PUT(2),
+    DELETE(3),
+    MERGE(4),
+    PATCH(5);
+
+    private int idx;
+
+    RowIndexForHttpMethod(int i) {
+      idx = i;
+    }
+
+    public int getIndex() {
+      return idx;
+    }
+
+  }
+
+  public void validate(final UriInfo uriInfo, final Edm edm, String httpMethod) throws UriValidationException {
 
+    validateForHttpMethod(uriInfo, httpMethod);
     validateQueryOptions(uriInfo, edm);
     validateKeyPredicateTypes(uriInfo, edm);
 
@@ -174,30 +207,30 @@ public class UriValidator {
     return idx;
   }
 
-  private RowIndex rowIndex(final UriInfo uriInfo, Edm edm) throws UriValidationException {
-    RowIndex idx;
+  private RowIndexForUriType rowIndexForUriType(final UriInfo uriInfo, Edm edm) throws UriValidationException {
+    RowIndexForUriType idx;
 
     switch (uriInfo.getKind()) {
     case all:
-      idx = RowIndex.all;
+      idx = RowIndexForUriType.all;
       break;
     case batch:
-      idx = RowIndex.batch;
+      idx = RowIndexForUriType.batch;
       break;
     case crossjoin:
-      idx = RowIndex.crossjoin;
+      idx = RowIndexForUriType.crossjoin;
       break;
     case entityId:
-      idx = RowIndex.entityId;
+      idx = RowIndexForUriType.entityId;
       break;
     case metadata:
-      idx = RowIndex.metadata;
+      idx = RowIndexForUriType.metadata;
       break;
     case resource:
       idx = rowIndexForResourceKind(uriInfo, edm);
       break;
     case service:
-      idx = RowIndex.service;
+      idx = RowIndexForUriType.service;
       break;
     default:
       throw new ODataRuntimeException("Unsupported uriInfo kind: " + uriInfo.getKind());
@@ -206,8 +239,8 @@ public class UriValidator {
     return idx;
   }
 
-  private RowIndex rowIndexForResourceKind(UriInfo uriInfo, Edm edm) throws UriValidationException {
-    RowIndex idx;
+  private RowIndexForUriType rowIndexForResourceKind(UriInfo uriInfo, Edm edm) throws UriValidationException {
+    RowIndexForUriType idx;
 
     int lastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 1;
     UriResource lastPathSegment = uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
@@ -229,7 +262,9 @@ public class UriValidator {
       idx = rowIndexForFunction(lastPathSegment);
       break;
     case navigationProperty:
-      idx = ((UriResourceNavigation) lastPathSegment).isCollection() ? RowIndex.entitySet : RowIndex.entity;
+      idx =
+          ((UriResourceNavigation) lastPathSegment).isCollection() ? RowIndexForUriType.entitySet
+              : RowIndexForUriType.entity;
       break;
     case primitiveProperty:
       idx = rowIndexForPrimitiveProperty(lastPathSegment);
@@ -238,10 +273,10 @@ public class UriValidator {
       idx = rowIndexForRef(uriInfo, lastPathSegment);
       break;
     case root:
-      idx = RowIndex.service;
+      idx = RowIndexForUriType.service;
       break;
     case singleton:
-      idx = RowIndex.entity;
+      idx = RowIndexForUriType.entity;
       break;
     case value:
       idx = rowIndexForValue(uriInfo);
@@ -253,16 +288,16 @@ public class UriValidator {
     return idx;
   }
 
-  private RowIndex rowIndexForValue(UriInfo uriInfo) throws UriValidationException {
-    RowIndex idx;
+  private RowIndexForUriType rowIndexForValue(UriInfo uriInfo) throws UriValidationException {
+    RowIndexForUriType idx;
     int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
     UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
     switch (secondLastPathSegment.getKind()) {
     case primitiveProperty:
-      idx = RowIndex.propertyPrimitiveValue;
+      idx = RowIndexForUriType.propertyPrimitiveValue;
       break;
     case entitySet:
-      idx = RowIndex.mediaStream;
+      idx = RowIndexForUriType.mediaStream;
       break;
     default:
       throw new UriValidationException("Unexpected kind in path segment before $value: "
@@ -272,14 +307,16 @@ public class UriValidator {
     return idx;
   }
 
-  private RowIndex rowIndexForRef(UriInfo uriInfo, UriResource lastPathSegment)
+  private RowIndexForUriType rowIndexForRef(UriInfo uriInfo, UriResource lastPathSegment)
       throws UriValidationException {
-    RowIndex idx;
+    RowIndexForUriType idx;
     int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
     UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
 
     if (secondLastPathSegment instanceof UriResourcePartTyped) {
-      idx = ((UriResourcePartTyped) secondLastPathSegment).isCollection() ? RowIndex.references : RowIndex.reference;
+      idx =
+          ((UriResourcePartTyped) secondLastPathSegment).isCollection() ? RowIndexForUriType.references
+              : RowIndexForUriType.reference;
     } else {
       throw new UriValidationException("secondLastPathSegment not a class of UriResourcePartTyped: "
           + lastPathSegment.getClass());
@@ -288,13 +325,13 @@ public class UriValidator {
     return idx;
   }
 
-  private RowIndex rowIndexForPrimitiveProperty(UriResource lastPathSegment)
+  private RowIndexForUriType rowIndexForPrimitiveProperty(UriResource lastPathSegment)
       throws UriValidationException {
-    RowIndex idx;
+    RowIndexForUriType idx;
     if (lastPathSegment instanceof UriResourcePartTyped) {
       idx =
-          ((UriResourcePartTyped) lastPathSegment).isCollection() ? RowIndex.propertyPrimitiveCollection
-              : RowIndex.propertyPrimitive;
+          ((UriResourcePartTyped) lastPathSegment).isCollection() ? RowIndexForUriType.propertyPrimitiveCollection
+              : RowIndexForUriType.propertyPrimitive;
     } else {
       throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
           + lastPathSegment.getClass());
@@ -302,23 +339,23 @@ public class UriValidator {
     return idx;
   }
 
-  private RowIndex rowIndexForFunction(UriResource lastPathSegment) throws UriValidationException {
-    RowIndex idx;
+  private RowIndexForUriType rowIndexForFunction(UriResource lastPathSegment) throws UriValidationException {
+    RowIndexForUriType idx;
     UriResourceFunction urf = (UriResourceFunction) lastPathSegment;
     EdmReturnType rt = urf.getFunction().getReturnType();
     switch (rt.getType().getKind()) {
     case ENTITY:
       if (((EdmEntityType) rt.getType()).hasStream()) {
-        idx = RowIndex.mediaStream;
+        idx = RowIndexForUriType.mediaStream;
       } else {
-        idx = rt.isCollection() ? RowIndex.entitySet : RowIndex.entity;
+        idx = rt.isCollection() ? RowIndexForUriType.entitySet : RowIndexForUriType.entity;
       }
       break;
     case PRIMITIVE:
-      idx = rt.isCollection() ? RowIndex.propertyPrimitiveCollection : RowIndex.propertyPrimitive;
+      idx = rt.isCollection() ? RowIndexForUriType.propertyPrimitiveCollection : RowIndexForUriType.propertyPrimitive;
       break;
     case COMPLEX:
-      idx = rt.isCollection() ? RowIndex.propertyComplexCollection : RowIndex.propertyComplex;
+      idx = rt.isCollection() ? RowIndexForUriType.propertyComplexCollection : RowIndexForUriType.propertyComplex;
       break;
     default:
       throw new UriValidationException("Unsupported function return type: " + rt.getType().getKind());
@@ -327,10 +364,12 @@ public class UriValidator {
     return idx;
   }
 
-  private RowIndex rowIndexForEntitySet(UriResource lastPathSegment) throws UriValidationException {
-    RowIndex idx;
+  private RowIndexForUriType rowIndexForEntitySet(UriResource lastPathSegment) throws UriValidationException {
+    RowIndexForUriType idx;
     if (lastPathSegment instanceof UriResourcePartTyped) {
-      idx = ((UriResourcePartTyped) lastPathSegment).isCollection() ? RowIndex.entitySet : RowIndex.entity;
+      idx =
+          ((UriResourcePartTyped) lastPathSegment).isCollection() ? RowIndexForUriType.entitySet
+              : RowIndexForUriType.entity;
     } else {
       throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
           + lastPathSegment.getClass());
@@ -338,12 +377,12 @@ public class UriValidator {
     return idx;
   }
 
-  private RowIndex rowIndexForComplexProperty(UriResource lastPathSegment) throws UriValidationException {
-    RowIndex idx;
+  private RowIndexForUriType rowIndexForComplexProperty(UriResource lastPathSegment) throws UriValidationException {
+    RowIndexForUriType idx;
     if (lastPathSegment instanceof UriResourcePartTyped) {
       idx =
-          ((UriResourcePartTyped) lastPathSegment).isCollection() ? RowIndex.propertyComplexCollection
-              : RowIndex.propertyComplex;
+          ((UriResourcePartTyped) lastPathSegment).isCollection() ? RowIndexForUriType.propertyComplexCollection
+              : RowIndexForUriType.propertyComplex;
     } else {
       throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
           + lastPathSegment.getClass());
@@ -351,23 +390,23 @@ public class UriValidator {
     return idx;
   }
 
-  private RowIndex rowIndexForAction(UriResource lastPathSegment) throws UriValidationException {
-    RowIndex idx;
+  private RowIndexForUriType rowIndexForAction(UriResource lastPathSegment) throws UriValidationException {
+    RowIndexForUriType idx;
     UriResourceAction ura = (UriResourceAction) lastPathSegment;
     EdmReturnType rt = ura.getAction().getReturnType();
     switch (rt.getType().getKind()) {
     case ENTITY:
       if (((EdmEntityType) rt.getType()).hasStream()) {
-        idx = RowIndex.mediaStream;
+        idx = RowIndexForUriType.mediaStream;
       } else {
-        idx = rt.isCollection() ? RowIndex.entitySet : RowIndex.entity;
+        idx = rt.isCollection() ? RowIndexForUriType.entitySet : RowIndexForUriType.entity;
       }
       break;
     case PRIMITIVE:
-      idx = rt.isCollection() ? RowIndex.propertyPrimitiveCollection : RowIndex.propertyPrimitive;
+      idx = rt.isCollection() ? RowIndexForUriType.propertyPrimitiveCollection : RowIndexForUriType.propertyPrimitive;
       break;
     case COMPLEX:
-      idx = rt.isCollection() ? RowIndex.propertyComplexCollection : RowIndex.propertyComplex;
+      idx = rt.isCollection() ? RowIndexForUriType.propertyComplexCollection : RowIndexForUriType.propertyComplex;
       break;
     default:
       throw new UriValidationException("Unsupported action return type: " + rt.getType().getKind());
@@ -376,21 +415,21 @@ public class UriValidator {
     return idx;
   }
 
-  private RowIndex rowIndexForCount(UriInfo uriInfo, UriResource lastPathSegment)
+  private RowIndexForUriType rowIndexForCount(UriInfo uriInfo, UriResource lastPathSegment)
       throws UriValidationException {
 
-    RowIndex idx;
+    RowIndexForUriType idx;
     int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
     UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
     switch (secondLastPathSegment.getKind()) {
     case entitySet:
-      idx = RowIndex.entitySetCount;
+      idx = RowIndexForUriType.entitySetCount;
       break;
     case complexProperty:
-      idx = RowIndex.propertyComplexCollectionCount;
+      idx = RowIndexForUriType.propertyComplexCollectionCount;
       break;
     case primitiveProperty:
-      idx = RowIndex.propertyPrimitiveCollectionCount;
+      idx = RowIndexForUriType.propertyPrimitiveCollectionCount;
       break;
     default:
       throw new UriValidationException("Illegal path part kind: " + lastPathSegment.getKind());
@@ -401,7 +440,7 @@ public class UriValidator {
 
   private void validateQueryOptions(final UriInfo uriInfo, Edm edm) throws UriValidationException {
     try {
-      RowIndex row = rowIndex(uriInfo, edm);
+      RowIndexForUriType row = rowIndexForUriType(uriInfo, edm);
 
       for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
         ColumnIndex col = colIndex(option.getKind());
@@ -418,6 +457,41 @@ public class UriValidator {
 
   }
 
+  private void validateForHttpMethod(UriInfo uriInfo, String httpMethod) throws UriValidationException {
+    RowIndexForHttpMethod row = rowIndexForHttpMethod(httpMethod);
+
+    for (SystemQueryOption option : uriInfo.getSystemQueryOptions()) {
+      ColumnIndex col = colIndex(option.getKind());
+      if (!decisionMatrixForHttpMethod[row.getIndex()][col.getIndex()]) {
+        throw new UriValidationException("System query option " + option.getName() + " not allowed for method "
+            + httpMethod);
+      }
+    }
+
+  }
+
+  private RowIndexForHttpMethod rowIndexForHttpMethod(String httpMethod) throws UriValidationException {
+    RowIndexForHttpMethod idx;
+
+    if ("GET".equalsIgnoreCase(httpMethod)) {
+      idx = RowIndexForHttpMethod.GET;
+    } else if ("POST".equalsIgnoreCase(httpMethod)) {
+      idx = RowIndexForHttpMethod.POST;
+    } else if ("PUT".equalsIgnoreCase(httpMethod)) {
+      idx = RowIndexForHttpMethod.PUT;
+    } else if ("DELETE".equalsIgnoreCase(httpMethod)) {
+      idx = RowIndexForHttpMethod.DELETE;
+    } else if ("PATCH".equalsIgnoreCase(httpMethod)) {
+      idx = RowIndexForHttpMethod.PATCH;
+    } else if ("MERGE".equalsIgnoreCase(httpMethod)) {
+      idx = RowIndexForHttpMethod.MERGE;
+    } else {
+      throw new UriValidationException("HTTP method not supported: " + httpMethod);
+    }
+
+    return idx;
+  }
+
   private void validateKeyPredicateTypes(final UriInfo uriInfo, final Edm edm) throws UriValidationException {}
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9a980e88/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
index 9ec844c..a76cee5 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -322,6 +322,6 @@ public class UriEdmValidatorTest {
     UriValidator validator = new UriValidator();
 
     System.out.print("URI: " + uri);
-    validator.validate(uriInfo, edm);
+    validator.validate(uriInfo, edm, "GET");
   }
 }


[07/21] git commit: [OLINGO-206] fix checkstyle issues

Posted by sk...@apache.org.
[OLINGO-206] fix checkstyle issues


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/66293849
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/66293849
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/66293849

Branch: refs/heads/master
Commit: 66293849794c304b4bcde33a5e91aa8287366576
Parents: d953278
Author: Stephan Klevenz <st...@sap.com>
Authored: Fri Mar 21 15:06:17 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Fri Mar 21 15:06:17 2014 +0100

----------------------------------------------------------------------
 .../server/core/uri/validator/SystemQueryValidator.java | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/66293849/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
index 2d9f046..b294136 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
@@ -173,8 +173,7 @@ public class SystemQueryValidator {
       if (lastPathSegemnt instanceof UriResourcePartTyped) {
         if (((UriResourcePartTyped) lastPathSegemnt).isCollection()) {
           idx = 14;
-        }
-        else {
+        } else {
           idx = 13;
         }
       } else {
@@ -186,8 +185,7 @@ public class SystemQueryValidator {
       if (lastPathSegemnt instanceof UriResourcePartTyped) {
         if (((UriResourcePartTyped) lastPathSegemnt).isCollection()) {
           idx = 7;
-        }
-        else {
+        } else {
           idx = 9;
         }
       } else {
@@ -211,8 +209,7 @@ public class SystemQueryValidator {
       if (lastPathSegemnt instanceof UriResourcePartTyped) {
         if (((UriResourcePartTyped) lastPathSegemnt).isCollection()) {
           idx = 17;
-        }
-        else {
+        } else {
           idx = 16;
         }
       } else {
@@ -228,8 +225,7 @@ public class SystemQueryValidator {
       if (secondLastPathSegment instanceof UriResourcePartTyped) {
         if (((UriResourcePartTyped) secondLastPathSegment).isCollection()) {
           idx = 11;
-        }
-        else {
+        } else {
           idx = 12;
         }
       } else {


[09/21] git commit: [OLINGO-206] nav prop validation

Posted by sk...@apache.org.
[OLINGO-206] nav prop validation


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/8c0c670e
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/8c0c670e
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/8c0c670e

Branch: refs/heads/master
Commit: 8c0c670e4f1674555537265a69006531f6b64aaa
Parents: 1274b1e
Author: Stephan Klevenz <st...@sap.com>
Authored: Mon Mar 24 13:17:07 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Mon Mar 24 13:17:07 2014 +0100

----------------------------------------------------------------------
 .../uri/validator/SystemQueryValidator.java     | 45 +++++++++++++-------
 .../core/uri/validator/UriEdmValidatorTest.java | 20 ++++++++-
 2 files changed, 49 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8c0c670e/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
index 31604b2..de440a5 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
@@ -20,6 +20,10 @@ package org.apache.olingo.server.core.uri.validator;
 
 import org.apache.olingo.commons.api.ODataRuntimeException;
 import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.server.api.uri.UriInfo;
 import org.apache.olingo.server.api.uri.UriResource;
 import org.apache.olingo.server.api.uri.UriResourcePartTyped;
@@ -146,9 +150,9 @@ public class SystemQueryValidator {
     int idx = 5;
 
     int lastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 1;
-    UriResource lastPathSegemnt = uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
+    UriResource lastPathSegment = uriInfo.getUriResourceParts().get(lastPathSegmentIndex);
 
-    switch (lastPathSegemnt.getKind()) {
+    switch (lastPathSegment.getKind()) {
     case count: {
       int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
       UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
@@ -163,34 +167,34 @@ public class SystemQueryValidator {
         idx = 18;
         break;
       default:
-        throw new UriValidationException("Illegal path part kind: " + lastPathSegemnt.getKind());
+        throw new UriValidationException("Illegal path part kind: " + lastPathSegment.getKind());
       }
     }
       break;
     case action:
       break;
     case complexProperty:
-      if (lastPathSegemnt instanceof UriResourcePartTyped) {
-        if (((UriResourcePartTyped) lastPathSegemnt).isCollection()) {
+      if (lastPathSegment instanceof UriResourcePartTyped) {
+        if (((UriResourcePartTyped) lastPathSegment).isCollection()) {
           idx = 14;
         } else {
           idx = 13;
         }
       } else {
         throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
-            + lastPathSegemnt.getClass());
+            + lastPathSegment.getClass());
       }
       break;
     case entitySet:
-      if (lastPathSegemnt instanceof UriResourcePartTyped) {
-        if (((UriResourcePartTyped) lastPathSegemnt).isCollection()) {
+      if (lastPathSegment instanceof UriResourcePartTyped) {
+        if (((UriResourcePartTyped) lastPathSegment).isCollection()) {
           idx = 7;
         } else {
           idx = 9;
         }
       } else {
         throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
-            + lastPathSegemnt.getClass());
+            + lastPathSegment.getClass());
       }
       break;
     case function:
@@ -203,18 +207,29 @@ public class SystemQueryValidator {
       break;
     case lambdaVariable:
       break;
-    case navigationProperty:
+    case navigationProperty: {
+      int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
+      UriResource secondLastPathSegment = uriInfo.getUriResourceParts().get(secondLastPathSegmentIndex);
+
+      EdmEntitySet entitySet = edm.getEntityContainer(null).getEntitySet(secondLastPathSegment.toString());
+      EdmNavigationProperty navProp = entitySet.getEntityType().getNavigationProperty(lastPathSegment.toString());
+      if (navProp.isCollection()) {
+        idx = 7;
+      } else {
+        idx = 9;
+      }
+    }
       break;
     case primitiveProperty:
-      if (lastPathSegemnt instanceof UriResourcePartTyped) {
-        if (((UriResourcePartTyped) lastPathSegemnt).isCollection()) {
+      if (lastPathSegment instanceof UriResourcePartTyped) {
+        if (((UriResourcePartTyped) lastPathSegment).isCollection()) {
           idx = 17;
         } else {
           idx = 16;
         }
       } else {
         throw new UriValidationException("lastPathSegment not a class of UriResourcePartTyped: "
-            + lastPathSegemnt.getClass());
+            + lastPathSegment.getClass());
       }
 
       break;
@@ -230,7 +245,7 @@ public class SystemQueryValidator {
         }
       } else {
         throw new UriValidationException("secondLastPathSegment not a class of UriResourcePartTyped: "
-            + lastPathSegemnt.getClass());
+            + lastPathSegment.getClass());
       }
     }
       break;
@@ -256,7 +271,7 @@ public class SystemQueryValidator {
     }
       break;
     default:
-      throw new ODataRuntimeException("Unsupported uriResource kind: " + lastPathSegemnt.getKind());
+      throw new ODataRuntimeException("Unsupported uriResource kind: " + lastPathSegment.getKind());
     }
 
     return idx;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8c0c670e/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
index 494f71b..4e7d402 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -58,6 +58,8 @@ public class UriEdmValidatorTest {
       "/ESCollAllPrim/CollPropertyString/$count";
   private static final String URI_PROPERTY_PRIMITIVE_VALUE = "/ESAllPrim(1)/PropertyString/$value";
   private static final String URI_SINGLETON = "/SI";
+  private static final String URI_NAV_ENTITY = "/ESKeyNav/NavPropertyETKeyNavOne";
+  private static final String URI_NAV_ENTITY_SET = "/ESKeyNav/NavPropertyETKeyNavMany";
 
   private static final String QO_FILTER = "$filter='1' eq '1'";
   private static final String QO_FORMAT = "$format=bla";
@@ -125,6 +127,14 @@ public class UriEdmValidatorTest {
 
       { URI_SINGLETON, QO_FORMAT }, { URI_SINGLETON, QO_EXPAND }, { URI_SINGLETON, QO_SELECT },
       { URI_SINGLETON, QO_LEVELS },
+
+      { URI_NAV_ENTITY, QO_FORMAT }, { URI_NAV_ENTITY, QO_EXPAND }, { URI_NAV_ENTITY, QO_SELECT },
+      { URI_NAV_ENTITY, QO_LEVELS },
+
+      { URI_NAV_ENTITY_SET, QO_FILTER, }, { URI_NAV_ENTITY_SET, QO_FORMAT }, { URI_NAV_ENTITY_SET, QO_EXPAND },
+      { URI_NAV_ENTITY_SET, QO_COUNT }, /* { URI_NAV_ENTITY_SET, QO_ORDERBY }, */
+      /* { URI_NAV_ENTITY_SET, QO_SEARCH }, */{ URI_NAV_ENTITY_SET, QO_SELECT }, { URI_NAV_ENTITY_SET, QO_SKIP },
+      { URI_NAV_ENTITY_SET, QO_SKIPTOKEN }, { URI_NAV_ENTITY_SET, QO_LEVELS }, { URI_NAV_ENTITY_SET, QO_TOP },
   };
 
   private String[][] urisWithNonValidSystemQueryOptions = {
@@ -217,6 +227,14 @@ public class UriEdmValidatorTest {
       { URI_SINGLETON, QO_FILTER }, { URI_SINGLETON, QO_ID }, { URI_SINGLETON, QO_COUNT },
       /* { URI_SINGLETON, QO_ORDERBY }, *//* { URI_SINGLETON, QO_SEARCH }, */{ URI_SINGLETON, QO_SKIP },
       { URI_SINGLETON, QO_SKIPTOKEN }, { URI_SINGLETON, QO_TOP },
+
+      { URI_NAV_ENTITY, QO_FILTER }, { URI_NAV_ENTITY, QO_ID }, { URI_NAV_ENTITY, QO_COUNT },
+      /* { URI_NAV_ENTITY, QO_ORDERBY }, *//* { URI_NAV_ENTITY, QO_SEARCH }, */{ URI_NAV_ENTITY, QO_SKIP },
+      { URI_NAV_ENTITY, QO_SKIPTOKEN }, { URI_SINGLETON, QO_TOP },
+      
+      { URI_NAV_ENTITY_SET, QO_ID },
+
+
   };
   private Parser parser;
 
@@ -229,7 +247,7 @@ public class UriEdmValidatorTest {
 //  @Ignore
       public
       void bla() throws Exception {
-    String[][] m = { { URI_SINGLETON, QO_SELECT } };
+    String[][] m = { { URI_NAV_ENTITY_SET, QO_SELECT } };
     String[] uris = constructUri(m);
     System.out.println(uris[0]);
 


[18/21] git commit: [OLINGO-206] merge master

Posted by sk...@apache.org.
[OLINGO-206] merge master


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/929fb655
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/929fb655
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/929fb655

Branch: refs/heads/master
Commit: 929fb655604652b27466ef38533e961e5dcb4611
Parents: 2f7a865 793c56e
Author: Stephan Klevenz <st...@sap.com>
Authored: Wed Apr 2 09:43:09 2014 +0200
Committer: Stephan Klevenz <st...@sap.com>
Committed: Wed Apr 2 09:43:09 2014 +0200

----------------------------------------------------------------------
 .../org/apache/olingo/fit/AbstractServices.java |   91 +-
 .../java/org/apache/olingo/fit/V4NorthWind.java |   47 +
 .../org/apache/olingo/fit/V4NorthWindExt.java   |   48 +
 .../java/org/apache/olingo/fit/V4Services.java  |    3 +-
 .../olingo/fit/utils/AbstractJSONUtilities.java |  100 +-
 .../olingo/fit/utils/AbstractUtilities.java     |   76 +-
 .../olingo/fit/utils/AbstractXMLUtilities.java  |  180 ++-
 .../org/apache/olingo/fit/utils/Commons.java    |   54 +-
 .../apache/olingo/fit/utils/ConstantKey.java    |   67 +
 .../org/apache/olingo/fit/utils/Constants.java  |  161 +-
 .../olingo/fit/utils/MetadataLinkInfo.java      |   22 +
 .../apache/olingo/fit/utils/ODataVersion.java   |    2 +-
 .../utils/ResolvingReferencesInterceptor.java   |   57 +
 .../fit/utils/XHTTPMethodInterceptor.java       |    5 +-
 .../olingo/fit/utils/XMLEventReaderWrapper.java |   21 +-
 .../org/apache/olingo/fit/utils/XmlElement.java |   20 +-
 .../olingo/fit/utils/v3/XMLUtilities.java       |    7 +-
 .../olingo/fit/utils/v4/XMLUtilities.java       |    7 +-
 .../main/resources/v4/Company/entity.full.json  |   38 +
 fit/src/main/resources/v4/Company/entity.xml    |   49 +
 .../resources/v4/Customers/1/entity.full.json   |   67 +
 .../main/resources/v4/Customers/1/entity.xml    |   67 +
 .../v4/Customers/1/links/Company.full.json      |    4 +
 .../resources/v4/Customers/1/links/Company.xml  |   22 +
 .../v4/Customers/1/links/Orders.full.json       |   10 +
 .../resources/v4/Customers/1/links/Orders.xml   |   25 +
 .../main/resources/v4/Orders/8/entity.full.json |   23 +
 fit/src/main/resources/v4/Orders/8/entity.xml   |   50 +
 fit/src/main/resources/v4/Orders/8/etag.txt     |    1 +
 .../main/resources/v4/Orders/8/links/.full.json |    4 +
 .../Orders/8/links/CustomerForOrder.full.json   |    4 +
 .../v4/Orders/8/links/CustomerForOrder.xml      |   22 +
 fit/src/main/resources/v4/Orders/feed.full.json |   48 +
 fit/src/main/resources/v4/Orders/feed.xml       |   72 +
 .../main/resources/v4/People/5/entity.full.json |   51 +
 fit/src/main/resources/v4/People/5/entity.xml   |   55 +
 .../v4/ProductDetails/6 1/entity.full.json      |   19 +
 .../resources/v4/ProductDetails/6 1/entity.xml  |   41 +
 fit/src/main/resources/v4/badRequest.json       |   17 +
 fit/src/main/resources/v4/badRequest.xml        |   30 +
 .../main/resources/v4/northwind-metadata.xml    |   91 ++
 .../main/resources/v4/northwindExt-metadata.xml |  408 +++++
 fit/src/main/resources/v4/notFound.json         |   11 +
 fit/src/main/resources/v4/notFound.xml          |   25 +
 ...JkZXJzKDgpL0N1c3RvbWVyRm9yT3JkZXI=.full.json |    4 +
 .../T3JkZXJzKDgpL0N1c3RvbWVyRm9yT3JkZXI=.xml    |   22 +
 fit/src/main/resources/v4/services.full.json    |  126 ++
 fit/src/main/resources/v4/services.xml          |  102 ++
 .../main/resources/v4/unsupportedMediaType.json |   17 +
 .../main/resources/v4/unsupportedMediaType.xml  |   34 +
 .../main/webapp/WEB-INF/applicationContext.xml  |    4 +-
 .../olingo/client/api/CommonODataClient.java    |   10 +-
 .../ODataClientErrorException.java              |   31 +-
 .../api/communication/header/HeaderName.java    |  111 +-
 .../communication/header/ODataHeaderValues.java |   45 -
 .../communication/header/ODataPreferences.java  |  424 +++++
 .../api/communication/request/ODataRequest.java |   24 +-
 .../api/communication/request/UpdateType.java   |   55 -
 .../request/cud/CommonCUDRequestFactory.java    |   20 +-
 .../request/cud/ODataEntityCreateRequest.java   |    8 +-
 .../communication/request/cud/UpdateType.java   |   31 +
 .../request/cud/v3/UpdateType.java              |   56 +
 .../request/cud/v4/UpdateType.java              |   52 +
 .../retrieve/CommonRetrieveRequestFactory.java  |   83 +-
 .../request/retrieve/EdmMetadataRequest.java    |   28 +
 .../request/retrieve/ODataEntityRequest.java    |    4 +-
 .../retrieve/ODataEntitySetIteratorRequest.java |    5 +-
 .../request/retrieve/ODataEntitySetRequest.java |    9 +-
 .../request/retrieve/ODataMetadataRequest.java  |   28 -
 .../request/retrieve/ODataPropertyRequest.java  |    4 +-
 .../request/retrieve/XMLMetadataRequest.java    |   29 +
 .../retrieve/v3/RetrieveRequestFactory.java     |   22 +-
 .../retrieve/v4/RetrieveRequestFactory.java     |   21 +
 .../response/ODataEntityCreateResponse.java     |    9 +-
 .../response/ODataEntityUpdateResponse.java     |    4 +-
 .../ODataMediaEntityCreateResponse.java         |    4 +-
 .../ODataMediaEntityUpdateResponse.java         |    4 +-
 .../response/ODataPropertyUpdateResponse.java   |    4 +-
 .../communication/response/ODataResponse.java   |   25 +
 .../olingo/client/api/data/ServiceDocument.java |   15 -
 .../api/domain/ODataEntitySetIterator.java      |   26 +-
 .../client/api/op/ClientODataDeserializer.java  |    3 +-
 .../olingo/client/api/op/CommonODataBinder.java |   33 +-
 .../olingo/client/api/op/CommonODataReader.java |   28 +-
 .../olingo/client/api/op/ODataWriter.java       |   14 +-
 .../olingo/client/api/op/v3/ODataBinder.java    |   22 +
 .../client/api/op/v3/ODataDeserializer.java     |    3 +-
 .../olingo/client/api/op/v3/ODataReader.java    |   13 +
 .../olingo/client/api/op/v4/ODataBinder.java    |   21 +
 .../olingo/client/api/op/v4/ODataReader.java    |   14 +
 .../olingo/client/api/uri/CommonURIBuilder.java |   13 +-
 .../olingo/client/api/uri/SegmentType.java      |    1 +
 .../olingo/client/api/uri/v3/URIBuilder.java    |    3 +-
 .../olingo/client/api/uri/v4/URIBuilder.java    |   39 +-
 .../olingo/client/api/v3/ODataClient.java       |   10 +-
 .../olingo/client/api/v4/ODataClient.java       |   10 +-
 .../olingo/client/core/AbstractODataClient.java |   21 -
 .../communication/request/ODataRequestImpl.java |   55 +-
 .../request/cud/AbstractCUDRequestFactory.java  |   22 +-
 .../cud/ODataEntityCreateRequestImpl.java       |   31 +-
 .../cud/ODataEntityUpdateRequestImpl.java       |   18 +-
 .../cud/ODataPropertyUpdateRequestImpl.java     |   18 +-
 .../cud/ODataValueUpdateRequestImpl.java        |    4 +-
 .../request/invoke/ODataInvokeRequestImpl.java  |   28 +-
 .../invoke/v3/InvokeRequestFactoryImpl.java     |   18 +-
 .../retrieve/AbstractMetadataRequestImpl.java   |   52 +
 .../retrieve/AbstractODataRetrieveRequest.java  |    4 +
 .../AbstractRetrieveRequestFactory.java         |   39 +-
 .../retrieve/EdmMetadataRequestImpl.java        |   73 +
 .../retrieve/ODataEntityRequestImpl.java        |   23 +-
 .../ODataEntitySetIteratorRequestImpl.java      |   16 +-
 .../retrieve/ODataEntitySetRequestImpl.java     |   29 +-
 .../retrieve/ODataMetadataRequestImpl.java      |  108 --
 .../retrieve/ODataPropertyRequestImpl.java      |   22 +-
 .../request/retrieve/ODataRawRequestImpl.java   |   10 +-
 .../ODataServiceDocumentRequestImpl.java        |    6 +-
 .../request/retrieve/ODataValueRequestImpl.java |    4 +-
 .../retrieve/v3/RetrieveRequestFactoryImpl.java |   40 +-
 .../retrieve/v3/XMLMetadataRequestImpl.java     |   79 +
 .../retrieve/v4/RetrieveRequestFactoryImpl.java |   42 +-
 .../retrieve/v4/XMLMetadataRequestImpl.java     |  122 ++
 .../ODataMediaEntityCreateRequestImpl.java      |   11 +-
 .../ODataMediaEntityUpdateRequestImpl.java      |   11 +-
 .../response/AbstractODataResponse.java         |   40 +
 .../core/data/AbstractServiceDocument.java      |   33 +-
 .../data/JSONServiceDocumentDeserializer.java   |   37 +-
 .../data/XMLServiceDocumentDeserializer.java    |   33 +-
 .../core/data/v3/JSONServiceDocumentImpl.java   |   32 -
 .../core/data/v3/XMLServiceDocumentImpl.java    |   18 -
 .../core/data/v4/AbstractServiceDocument.java   |   40 -
 .../core/data/v4/JSONServiceDocumentImpl.java   |   15 -
 .../core/data/v4/XMLServiceDocumentImpl.java    |    1 -
 .../core/domain/ODataGeospatialValueImpl.java   |  130 --
 .../core/domain/ODataPrimitiveValueImpl.java    |  177 --
 .../edm/AbstractEdmServiceMetadataImpl.java     |   24 +-
 .../client/core/edm/EdmBindingTargetImpl.java   |   39 +-
 .../olingo/client/core/edm/EdmClientImpl.java   |   46 +-
 .../client/core/edm/EdmEntityContainerImpl.java |   57 +-
 .../olingo/client/core/edm/EdmEnumTypeImpl.java |    4 +-
 .../core/edm/EdmNavigationPropertyImpl.java     |   35 +-
 .../olingo/client/core/edm/EdmSchemaImpl.java   |    9 +-
 .../client/core/edm/EdmTypeDefinitionImpl.java  |    2 +-
 .../client/core/edm/v3/EdmEntitySetProxy.java   |   18 +-
 .../core/edm/v3/EdmServiceMetadataImpl.java     |    9 +-
 .../core/edm/v4/EdmServiceMetadataImpl.java     |   24 +-
 .../client/core/edm/xml/v4/XMLMetadataImpl.java |    1 +
 .../client/core/op/AbstractODataBinder.java     |  171 +-
 .../client/core/op/AbstractODataReader.java     |   78 +-
 .../olingo/client/core/op/ODataWriterImpl.java  |   20 +-
 .../client/core/op/impl/v3/ODataBinderImpl.java |   68 +
 .../core/op/impl/v3/ODataDeserializerImpl.java  |   17 +-
 .../client/core/op/impl/v3/ODataReaderImpl.java |   47 +-
 .../client/core/op/impl/v4/ODataBinderImpl.java |  132 +-
 .../core/op/impl/v4/ODataDeserializerImpl.java  |    7 +-
 .../client/core/op/impl/v4/ODataReaderImpl.java |   28 +-
 .../core/uri/AbstractFilterArgFactory.java      |    9 +-
 .../client/core/uri/AbstractFilterFactory.java  |    7 +
 .../client/core/uri/AbstractURIBuilder.java     |   78 +-
 .../olingo/client/core/uri/FilterLiteral.java   |   10 +-
 .../olingo/client/core/uri/ParameterAlias.java  |   48 +
 .../apache/olingo/client/core/uri/URIUtils.java |  257 ++-
 .../core/uri/v3/FilterArgFactoryImpl.java       |    5 +
 .../client/core/uri/v3/FilterFactoryImpl.java   |    7 +-
 .../client/core/uri/v3/URIBuilderImpl.java      |   12 +-
 .../core/uri/v4/FilterArgFactoryImpl.java       |    5 +
 .../client/core/uri/v4/FilterFactoryImpl.java   |    7 +-
 .../client/core/uri/v4/URIBuilderImpl.java      |   41 +-
 .../olingo/client/core/v3/ODataClientImpl.java  |   13 +-
 .../olingo/client/core/v4/ODataClientImpl.java  |   17 +-
 .../client/core/AbstractPrimitiveTest.java      |  429 -----
 .../client/core/AbstractPropertyTest.java       |  175 --
 .../apache/olingo/client/core/AbstractTest.java |   10 -
 .../core/it/AbstractMetadataTestITCase.java     |    7 +-
 .../client/core/it/AbstractTestITCase.java      |  550 -------
 .../client/core/it/v3/AbstractTestITCase.java   |  530 +++++-
 .../client/core/it/v3/AsyncTestITCase.java      |   22 +-
 .../core/it/v3/EntityCreateTestITCase.java      |  135 +-
 .../core/it/v3/EntityRetrieveTestITCase.java    |   43 +-
 .../client/core/it/v3/EntitySetTestITCase.java  |   19 +-
 .../core/it/v3/EntityUpdateTestITCase.java      |   29 +-
 .../client/core/it/v3/ErrorTestITCase.java      |   14 +-
 .../core/it/v3/FilterFactoryTestITCase.java     |    4 +-
 .../client/core/it/v3/FilterTestITCase.java     |    4 +-
 .../core/it/v3/KeyAsSegmentTestITCase.java      |   10 +-
 .../client/core/it/v3/LinkTestITCase.java       |    2 +-
 .../core/it/v3/MediaEntityTestITCase.java       |    8 +-
 .../it/v3/NavigationLinkCreateTestITCase.java   |  521 ------
 .../client/core/it/v3/OpenTypeTestITCase.java   |  168 +-
 .../core/it/v3/PrimitiveKeysTestITCase.java     |    8 +-
 .../core/it/v3/PropertyRetrieveTestITCase.java  |   41 +-
 .../client/core/it/v3/PropertyTestITCase.java   |   45 +-
 .../core/it/v3/PropertyValueTestITCase.java     |   24 +-
 .../core/it/v3/QueryOptionsTestITCase.java      |   40 +-
 .../v3/ServiceDocumentRetrieveTestITCase.java   |   73 -
 .../client/core/it/v4/AbstractTestITCase.java   |    3 +-
 .../core/it/v4/EntityCreateTestITCase.java      |   82 +
 .../core/it/v4/EntityRetrieveTestITCase.java    |  288 ++++
 .../client/core/it/v4/EntitySetTestITCase.java  |   30 +-
 .../client/core/it/v4/MetadataTestITCase.java   |   22 +-
 .../core/it/v4/PropertyValueTestITCase.java     |  145 ++
 .../core/it/v4/ServiceDocumentTestITCase.java   |   64 +
 .../olingo/client/core/uri/URIEscapeTest.java   |   79 +
 .../client/core/uri/v3/FilterFactoryTest.java   |  167 ++
 .../client/core/uri/v3/URIBuilderTest.java      |  162 ++
 .../client/core/uri/v4/FilterFactoryTest.java   |   86 +
 .../client/core/uri/v4/URIBuilderTest.java      |  152 ++
 .../apache/olingo/client/core/v3/AtomTest.java  |   10 +-
 .../olingo/client/core/v3/EntitySetTest.java    |    7 +-
 .../olingo/client/core/v3/EntityTest.java       |   31 +-
 .../apache/olingo/client/core/v3/ErrorTest.java |    6 +-
 .../client/core/v3/FilterFactoryTest.java       |  167 --
 .../apache/olingo/client/core/v3/JSONTest.java  |   53 +-
 .../olingo/client/core/v3/MetadataTest.java     |    4 +-
 .../client/core/v3/PrimitiveValueTest.java      |  123 +-
 .../olingo/client/core/v3/PropertyTest.java     |  166 ++
 .../olingo/client/core/v3/URIBuilderTest.java   |  131 --
 .../apache/olingo/client/core/v4/AtomTest.java  |   74 +
 .../olingo/client/core/v4/EntitySetTest.java    |   91 ++
 .../olingo/client/core/v4/EntityTest.java       |  250 +++
 .../apache/olingo/client/core/v4/ErrorTest.java |   61 +
 .../client/core/v4/FilterFactoryTest.java       |   86 -
 .../apache/olingo/client/core/v4/JSONTest.java  |  173 ++
 .../olingo/client/core/v4/MetadataTest.java     |    5 +-
 .../client/core/v4/PrimitiveValueTest.java      |    4 +-
 .../olingo/client/core/v4/PropertyTest.java     |  138 ++
 .../client/core/v4/ServiceDocumentTest.java     |   14 +-
 .../olingo/client/core/v4/URIBuilderTest.java   |  136 --
 .../apache/olingo/client/core/atom_cleanup.xsl  |   48 -
 .../core/v3/Customer_-10_BackupContactInfo.json |  219 ++-
 .../core/v3/Customer_-10_BackupContactInfo.xml  |  397 ++++-
 .../client/core/v3/Customer_-10_CustomerId.xml  |    4 +-
 .../v3/Customer_-10_PrimaryContactInfo.json     |   45 +-
 .../core/v3/Customer_-10_PrimaryContactInfo.xml |   82 +-
 .../olingo/client/core/v3/atom_cleanup.xsl      |   48 +
 .../org/apache/olingo/client/core/v3/error.xml  |    2 +-
 ...ccounts_101_expand_MyPaymentInstruments.json |   94 ++
 ...Accounts_101_expand_MyPaymentInstruments.xml |  129 ++
 ...ts_f89dee73-af9f-4cd4-b330-db93c25ff3c7.json |   16 +
 ...nts_f89dee73-af9f-4cd4-b330-db93c25ff3c7.xml |   46 +
 .../apache/olingo/client/core/v4/Customers.json |   57 +
 .../apache/olingo/client/core/v4/Customers.xml  |  106 ++
 .../client/core/v4/Employees_3_HomeAddress.json |    6 +
 .../client/core/v4/Employees_3_HomeAddress.xml  |   31 +
 .../olingo/client/core/v4/PersonDetails_1.json  |   22 +
 .../olingo/client/core/v4/PersonDetails_1.xml   |   55 +
 .../olingo/client/core/v4/Products_5.json       |   29 +
 .../apache/olingo/client/core/v4/Products_5.xml |   49 +
 .../client/core/v4/Products_5_CoverColors.json  |    5 +
 .../client/core/v4/Products_5_CoverColors.xml   |   30 +
 .../client/core/v4/Products_5_SkinColor.json    |    5 +
 .../client/core/v4/Products_5_SkinColor.xml     |   27 +
 .../olingo/client/core/v4/VipCustomer.json      |   50 +
 .../olingo/client/core/v4/VipCustomer.xml       |   73 +
 .../olingo/client/core/v4/atom_cleanup.xsl      |   48 +
 .../core/v4/collectionOfEntityReferences.json   |   11 +
 .../core/v4/collectionOfEntityReferences.xml    |   25 +
 .../olingo/client/core/v4/complexProperty.json  |    8 -
 .../core/v4/entity.collection.complex.json      |   14 +
 .../core/v4/entity.collection.primitive.json    |    7 +
 .../olingo/client/core/v4/entity.complex.json   |   12 +
 .../olingo/client/core/v4/entity.full.json      |   22 +
 .../olingo/client/core/v4/entity.minimal.json   |   15 +
 .../olingo/client/core/v4/entity.primitive.json |   22 +
 .../olingo/client/core/v4/entityReference.json  |    4 +
 .../olingo/client/core/v4/entityReference.xml   |   22 +
 .../org/apache/olingo/client/core/v4/error.json |   14 +
 .../org/apache/olingo/client/core/v4/error.xml  |   31 +
 .../olingo/client/core/v4/fromdoc1-metadata.xml |    2 +-
 .../olingo/client/core/v4/fullEntity.json       |   22 -
 .../olingo/client/core/v4/fullEntitySet.json    |   29 -
 .../core/v4/fullEntitySetWithTwoEntities.json   |   49 -
 ...fullEntityWithCollectionOfComplexValues.json |   28 -
 .../client/core/v4/primitiveNullValue.json      |    3 -
 .../olingo/client/core/v4/serviceDocument.json  |    1 +
 .../client/core/v4/setOfComplexProperties.json  |   13 -
 .../core/v4/setOfPrimitiveProperties.json       |    8 -
 .../apache/olingo/commons/api/Constants.java    |   53 +-
 .../olingo/commons/api/data/Container.java      |   76 +
 .../apache/olingo/commons/api/data/Entry.java   |   23 +-
 .../olingo/commons/api/data/EnumValue.java      |   25 +
 .../apache/olingo/commons/api/data/Feed.java    |    1 -
 .../olingo/commons/api/data/GeoUtils.java       |    9 +-
 .../apache/olingo/commons/api/data/Value.java   |    8 +-
 .../api/domain/AbstractODataPayload.java        |   52 +
 .../commons/api/domain/AbstractODataValue.java  |   44 +-
 .../commons/api/domain/CommonODataEntity.java   |  215 +++
 .../api/domain/CommonODataEntitySet.java        |   57 +
 .../api/domain/CommonODataObjectFactory.java    |  210 +++
 .../commons/api/domain/CommonODataProperty.java |   77 +
 .../api/domain/ODataCollectionValue.java        |   66 +-
 .../commons/api/domain/ODataComplexValue.java   |   61 +-
 .../olingo/commons/api/domain/ODataEntity.java  |  316 ----
 .../commons/api/domain/ODataEntitySet.java      |  120 --
 .../olingo/commons/api/domain/ODataError.java   |   28 +-
 .../api/domain/ODataGeospatialValue.java        |   57 -
 .../commons/api/domain/ODataInlineEntity.java   |    8 +-
 .../api/domain/ODataInlineEntitySet.java        |    8 +-
 .../olingo/commons/api/domain/ODataItem.java    |   26 +-
 .../olingo/commons/api/domain/ODataLink.java    |   10 +-
 .../commons/api/domain/ODataObjectFactory.java  |  218 ---
 .../commons/api/domain/ODataProperty.java       |  186 ---
 .../commons/api/domain/ODataPropertyType.java   |    8 +-
 .../api/domain/ODataServiceDocument.java        |   20 -
 .../olingo/commons/api/domain/ODataValue.java   |   27 +-
 .../commons/api/domain/v3/ODataEntity.java      |   32 +
 .../commons/api/domain/v3/ODataEntitySet.java   |   29 +
 .../api/domain/v3/ODataObjectFactory.java       |   58 +
 .../commons/api/domain/v3/ODataProperty.java    |   41 +
 .../commons/api/domain/v4/ODataEntity.java      |   52 +
 .../commons/api/domain/v4/ODataEntitySet.java   |   29 +
 .../commons/api/domain/v4/ODataEnumValue.java   |   24 +
 .../api/domain/v4/ODataObjectFactory.java       |   62 +
 .../commons/api/domain/v4/ODataProperty.java    |   54 +
 .../commons/api/domain/v4/ODataValue.java       |   36 +
 .../commons/api/edm/EdmBindingTarget.java       |    7 +
 .../commons/api/edm/EdmEntityContainer.java     |    5 +
 .../olingo/commons/api/edm/EdmEnumType.java     |    5 +
 .../commons/api/edm/EdmGeospatialType.java      |   34 -
 .../commons/api/edm/EdmNavigationProperty.java  |   27 +-
 .../api/edm/EdmNavigationPropertyBinding.java   |   28 +
 .../api/edm/EdmReferentialConstraint.java       |   28 +
 .../api/edm/constants/ODataServiceVersion.java  |   71 +
 .../commons/api/edm/geo/ComposedGeospatial.java |   22 +-
 .../olingo/commons/api/edm/geo/Geospatial.java  |   36 +-
 .../api/edm/geo/GeospatialCollection.java       |   15 +-
 .../olingo/commons/api/edm/geo/LineString.java  |    4 +-
 .../commons/api/edm/geo/MultiLineString.java    |    8 +-
 .../olingo/commons/api/edm/geo/MultiPoint.java  |    4 +-
 .../commons/api/edm/geo/MultiPolygon.java       |    8 +-
 .../olingo/commons/api/edm/geo/Point.java       |    8 +-
 .../olingo/commons/api/edm/geo/Polygon.java     |   18 +-
 .../olingo/commons/api/format/ContentType.java  |   28 +-
 .../olingo/commons/api/format/ODataFormat.java  |   36 +-
 .../commons/api/format/ODataPubFormat.java      |   31 +-
 .../commons/api/op/CommonODataDeserializer.java |    8 +-
 .../commons/core/data/AbstractAtomDealer.java   |   36 +-
 .../commons/core/data/AbstractAtomObject.java   |   78 -
 .../olingo/commons/core/data/AbstractEntry.java |   14 +-
 .../core/data/AbstractJsonDeserializer.java     |   28 +-
 .../core/data/AbstractJsonSerializer.java       |   16 +-
 .../commons/core/data/AbstractODataError.java   |   58 +
 .../commons/core/data/AbstractODataObject.java  |   81 +
 .../commons/core/data/AbstractProperty.java     |   80 +
 .../commons/core/data/AbstractPropertyImpl.java |   80 -
 .../olingo/commons/core/data/AbstractValue.java |   17 +-
 .../commons/core/data/AtomDeserializer.java     |  329 ++--
 .../olingo/commons/core/data/AtomFeedImpl.java  |    2 +-
 .../core/data/AtomGeoValueDeserializer.java     |   46 +-
 .../core/data/AtomGeoValueSerializer.java       |    4 +-
 .../core/data/AtomPropertyDeserializer.java     |   54 +-
 .../commons/core/data/AtomPropertyImpl.java     |    2 +-
 .../core/data/AtomPropertySerializer.java       |   42 +-
 .../commons/core/data/AtomSerializer.java       |   38 +-
 .../olingo/commons/core/data/EnumValueImpl.java |   41 +
 .../core/data/JSONEntryDeserializer.java        |  118 +-
 .../olingo/commons/core/data/JSONEntryImpl.java |   59 -
 .../commons/core/data/JSONEntrySerializer.java  |    8 +-
 .../commons/core/data/JSONErrorBundle.java      |   50 -
 .../olingo/commons/core/data/JSONErrorImpl.java |  237 ---
 .../commons/core/data/JSONFeedDeserializer.java |   39 +-
 .../olingo/commons/core/data/JSONFeedImpl.java  |   26 +-
 .../commons/core/data/JSONFeedSerializer.java   |    9 +-
 .../core/data/JSONGeoValueDeserializer.java     |   73 +-
 .../core/data/JSONGeoValueSerializer.java       |    8 +-
 .../core/data/JSONODataErrorDeserializer.java   |   60 +
 .../commons/core/data/JSONODataErrorImpl.java   |   26 +
 .../core/data/JSONPropertyDeserializer.java     |   38 +-
 .../commons/core/data/JSONPropertyImpl.java     |   22 +-
 .../core/data/JSONPropertySerializer.java       |   12 +-
 .../core/data/ODataJacksonDeserializer.java     |   42 +
 .../commons/core/data/PrimitiveValueImpl.java   |    2 +-
 .../olingo/commons/core/data/XMLErrorImpl.java  |  213 ---
 .../commons/core/data/XMLODataErrorImpl.java    |   23 +
 .../domain/AbstractODataCollectionValue.java    |   92 ++
 .../core/domain/AbstractODataComplexValue.java  |   93 ++
 .../core/domain/AbstractODataEntity.java        |  268 ++++
 .../core/domain/AbstractODataEntitySet.java     |   73 +
 .../core/domain/AbstractODataObjectFactory.java |  115 ++
 .../domain/AbstractODataPrimitiveValue.java     |  179 +++
 .../core/domain/AbstractODataProperty.java      |  147 ++
 .../domain/v3/ODataCollectionValueImpl.java     |   32 +
 .../core/domain/v3/ODataComplexValueImpl.java   |   32 +
 .../commons/core/domain/v3/ODataEntityImpl.java |   46 +
 .../core/domain/v3/ODataEntitySetImpl.java      |   51 +
 .../core/domain/v3/ODataObjectFactoryImpl.java  |   96 ++
 .../core/domain/v3/ODataPrimitiveValueImpl.java |   44 +
 .../core/domain/v3/ODataPropertyImpl.java       |   45 +
 .../domain/v4/ODataCollectionValueImpl.java     |   42 +
 .../core/domain/v4/ODataComplexValueImpl.java   |   44 +
 .../commons/core/domain/v4/ODataEntityImpl.java |   62 +
 .../core/domain/v4/ODataEntitySetImpl.java      |   51 +
 .../core/domain/v4/ODataEnumValueImpl.java      |   50 +
 .../core/domain/v4/ODataObjectFactoryImpl.java  |  107 ++
 .../core/domain/v4/ODataPrimitiveValueImpl.java |   56 +
 .../core/domain/v4/ODataPropertyImpl.java       |   57 +
 .../core/edm/AbstractEdmEntityContainer.java    |  196 +--
 .../commons/core/edm/AbstractEdmEnumType.java   |    5 +
 .../commons/core/edm/AbstractEdmParameter.java  |    2 +-
 .../edm/EdmNavigationPropertyBindingImpl.java   |   43 +
 .../core/edm/EdmReferentialConstraintImpl.java  |   42 +
 .../olingo/commons/core/edm/EdmTypeInfo.java    |    1 -
 .../AbstractEdmGeospatialType.java              |   76 -
 .../primitivetype/AbstractGeospatialType.java   |  539 +++++++
 .../core/edm/primitivetype/EdmGeography.java    |   19 +-
 .../primitivetype/EdmGeographyCollection.java   |   33 +-
 .../primitivetype/EdmGeographyLineString.java   |   32 +-
 .../EdmGeographyMultiLineString.java            |   33 +-
 .../primitivetype/EdmGeographyMultiPoint.java   |   34 +-
 .../primitivetype/EdmGeographyMultiPolygon.java |   32 +-
 .../edm/primitivetype/EdmGeographyPoint.java    |   29 +-
 .../edm/primitivetype/EdmGeographyPolygon.java  |   32 +-
 .../core/edm/primitivetype/EdmGeometry.java     |   19 +-
 .../primitivetype/EdmGeometryCollection.java    |   33 +-
 .../primitivetype/EdmGeometryLineString.java    |   32 +-
 .../EdmGeometryMultiLineString.java             |   33 +-
 .../primitivetype/EdmGeometryMultiPoint.java    |   33 +-
 .../primitivetype/EdmGeometryMultiPolygon.java  |   33 +-
 .../edm/primitivetype/EdmGeometryPoint.java     |   28 +-
 .../edm/primitivetype/EdmGeometryPolygon.java   |   32 +-
 .../primitivetype/EdmPrimitiveTypeFactory.java  |   31 +-
 .../commons/core/edm/primitivetype/EdmTime.java |    5 +
 .../core/op/AbstractODataDeserializer.java      |   57 +-
 .../commons/core/op/ODataObjectFactoryImpl.java |  162 --
 .../primitivetype/CommonPrimitiveTypeTest.java  |  170 +-
 .../core/edm/primitivetype/EdmBinaryTest.java   |    2 +-
 .../core/edm/primitivetype/EdmBooleanTest.java  |    2 +-
 .../core/edm/primitivetype/EdmByteTest.java     |    2 +-
 .../core/edm/primitivetype/EdmDateTest.java     |    2 +-
 .../primitivetype/EdmDateTimeOffsetTest.java    |    2 +-
 .../core/edm/primitivetype/EdmDecimalTest.java  |   16 +-
 .../core/edm/primitivetype/EdmDoubleTest.java   |   14 +-
 .../core/edm/primitivetype/EdmDurationTest.java |    2 +-
 .../core/edm/primitivetype/EdmGeoTest.java      |  174 ++
 .../core/edm/primitivetype/EdmGuidTest.java     |    2 +-
 .../core/edm/primitivetype/EdmInt16Test.java    |    6 +-
 .../core/edm/primitivetype/EdmInt32Test.java    |    8 +-
 .../core/edm/primitivetype/EdmInt64Test.java    |   10 +-
 .../core/edm/primitivetype/EdmNullTest.java     |   20 +-
 .../core/edm/primitivetype/EdmSByteTest.java    |    2 +-
 .../core/edm/primitivetype/EdmSingleTest.java   |   12 +-
 .../core/edm/primitivetype/EdmStringTest.java   |    2 +-
 .../edm/primitivetype/EdmTimeOfDayTest.java     |    2 +-
 .../core/edm/primitivetype/UInt7Test.java       |    2 +-
 .../apache/olingo/server/api/ODataFormat.java   |   23 -
 .../olingo/server/api/ODataSerializer.java      |   31 -
 .../apache/olingo/server/api/ODataServer.java   |    2 +
 .../server/api/serializer/ODataFormat.java      |   23 +
 .../server/api/serializer/ODataSerializer.java  |   33 +
 .../olingo/server/core/CircleStreamBuffer.java  |  327 ----
 .../olingo/server/core/ODataJsonSerializer.java |  147 --
 .../olingo/server/core/ODataSerializerImpl.java |   38 -
 .../olingo/server/core/ODataServerImpl.java     |   10 +-
 .../server/core/edm/provider/EdmActionImpl.java |   16 +-
 .../core/edm/provider/EdmActionImportImpl.java  |   16 +-
 .../core/edm/provider/EdmBindingTargetImpl.java |   44 +-
 .../core/edm/provider/EdmComplexTypeImpl.java   |   20 +-
 .../edm/provider/EdmEntityContainerImpl.java    |   13 +-
 .../core/edm/provider/EdmEntitySetImpl.java     |   16 +-
 .../core/edm/provider/EdmEntityTypeImpl.java    |   22 +-
 .../core/edm/provider/EdmEnumTypeImpl.java      |   20 +-
 .../core/edm/provider/EdmFunctionImpl.java      |   16 +-
 .../edm/provider/EdmKeyPropertyRefImpl.java     |   16 +-
 .../edm/provider/EdmNavigationPropertyImpl.java |   34 +-
 .../edm/provider/EdmOperationImportImpl.java    |    2 +-
 .../core/edm/provider/EdmParameterImpl.java     |   16 +-
 .../core/edm/provider/EdmPropertyImpl.java      |   16 +-
 .../core/edm/provider/EdmReturnTypeImpl.java    |   16 +-
 .../server/core/edm/provider/EdmSchemaImpl.java |    2 +-
 .../edm/provider/EdmServiceMetadataImpl.java    |   18 +-
 .../core/edm/provider/EdmSingletonImpl.java     |   16 +-
 .../provider/EdmStructuredTypeHelperImpl.java   |   16 +-
 .../edm/provider/EdmTypeDefinitionImpl.java     |    2 +-
 .../core/serializer/ODataJsonSerializer.java    |   87 +
 .../core/serializer/ODataXmlSerializerImpl.java |   72 +
 .../json/ServiceDocumentJsonSerializer.java     |  103 ++
 .../serializer/utils/CircleStreamBuffer.java    |  327 ++++
 .../xml/MetadataDocumentXmlSerializer.java      |  543 +++++++
 .../olingo/server/core/uri/UriInfoImpl.java     |    4 +-
 .../server/core/uri/UriParameterImpl.java       |   16 +-
 .../server/core/uri/UriResourceActionImpl.java  |   16 +-
 .../uri/UriResourceComplexPropertyImpl.java     |   16 +-
 .../server/core/uri/UriResourceCountImpl.java   |   16 +-
 .../core/uri/UriResourceEntitySetImpl.java      |   16 +-
 .../core/uri/UriResourceFunctionImpl.java       |   16 +-
 .../olingo/server/core/uri/UriResourceImpl.java |   16 +-
 .../server/core/uri/UriResourceItImpl.java      |   16 +-
 .../core/uri/UriResourceLambdaAllImpl.java      |   16 +-
 .../core/uri/UriResourceLambdaAnyImpl.java      |   16 +-
 .../core/uri/UriResourceLambdaVarImpl.java      |   16 +-
 .../uri/UriResourceNavigationPropertyImpl.java  |   16 +-
 .../uri/UriResourcePrimitivePropertyImpl.java   |   16 +-
 .../server/core/uri/UriResourceRefImpl.java     |   16 +-
 .../server/core/uri/UriResourceRootImpl.java    |   16 +-
 .../core/uri/UriResourceSingletonImpl.java      |   16 +-
 .../uri/UriResourceStartingTypeFilterImpl.java  |   16 +-
 .../server/core/uri/UriResourceTypedImpl.java   |   16 +-
 .../server/core/uri/UriResourceValueImpl.java   |   16 +-
 .../olingo/server/core/uri/parser/RawUri.java   |   16 +-
 .../server/core/uri/parser/UriContext.java      |   33 +-
 .../core/uri/parser/UriParseTreeVisitor.java    |   37 +-
 .../core/uri/parser/UriParserException.java     |   16 +-
 .../uri/parser/UriParserSemanticException.java  |   16 +-
 .../uri/parser/UriParserSyntaxException.java    |   16 +-
 .../uri/queryoption/AliasQueryOptionImpl.java   |   16 +-
 .../core/uri/queryoption/CountOptionImpl.java   |   16 +-
 .../uri/queryoption/CustomQueryOptionImpl.java  |   16 +-
 .../core/uri/queryoption/ExpandItemImpl.java    |   28 +-
 .../core/uri/queryoption/ExpandOptionImpl.java  |   16 +-
 .../core/uri/queryoption/FilterOptionImpl.java  |   16 +-
 .../core/uri/queryoption/FormatOptionImpl.java  |   16 +-
 .../core/uri/queryoption/IdOptionImpl.java      |   16 +-
 .../core/uri/queryoption/LevelsOptionImpl.java  |   16 +-
 .../core/uri/queryoption/OrderByItemImpl.java   |   16 +-
 .../core/uri/queryoption/OrderByOptionImpl.java |   16 +-
 .../core/uri/queryoption/QueryOptionImpl.java   |   16 +-
 .../core/uri/queryoption/SearchOptionImpl.java  |   16 +-
 .../core/uri/queryoption/SelectItemImpl.java    |   28 +-
 .../core/uri/queryoption/SelectOptionImpl.java  |   16 +-
 .../core/uri/queryoption/SkipOptionImpl.java    |   16 +-
 .../uri/queryoption/SkipTokenOptionImpl.java    |   16 +-
 .../uri/queryoption/SystemQueryOptionImpl.java  |   18 +-
 .../core/uri/queryoption/TopOptionImpl.java     |   17 +-
 .../uri/queryoption/expression/AliasImpl.java   |   16 +-
 .../uri/queryoption/expression/BinaryImpl.java  |   16 +-
 .../queryoption/expression/EnumerationImpl.java |   16 +-
 .../queryoption/expression/ExpressionImpl.java  |   16 +-
 .../queryoption/expression/LambdaRefImpl.java   |   16 +-
 .../uri/queryoption/expression/LiteralImpl.java |   16 +-
 .../uri/queryoption/expression/MemberImpl.java  |   28 +-
 .../uri/queryoption/expression/MethodImpl.java  |   16 +-
 .../queryoption/expression/TypeLiteralImpl.java |   16 +-
 .../uri/queryoption/expression/UnaryImpl.java   |   16 +-
 .../olingo/server/core/ServiceDocumentTest.java |  133 --
 .../core/edm/provider/EdmActionImplTest.java    |   18 +-
 .../edm/provider/EdmActionImportImplTest.java   |    2 -
 .../edm/provider/EdmComplexTypeImplTest.java    |   16 +-
 .../provider/EdmEntityContainerImplTest.java    |  100 +-
 .../core/edm/provider/EdmEntitySetImplTest.java |   19 +-
 .../edm/provider/EdmEntityTypeImplTest.java     |   16 +-
 .../server/core/edm/provider/EdmEnumTest.java   |   18 +-
 .../core/edm/provider/EdmFunctionImplTest.java  |   18 +-
 .../edm/provider/EdmFunctionImportImplTest.java |   18 +-
 .../edm/provider/EdmKeyPropertyRefImplTest.java |   17 +-
 .../core/edm/provider/EdmMemberImplTest.java    |   20 +-
 .../core/edm/provider/EdmNamedImplTest.java     |   16 +-
 .../provider/EdmNavigationPropertyImplTest.java |   18 +-
 .../core/edm/provider/EdmParameterImplTest.java |   16 +-
 .../core/edm/provider/EdmPropertyImplTest.java  |   16 +-
 .../EdmProviderImplOverloadingTest.java         |   17 +-
 .../core/edm/provider/EdmProviderImplTest.java  |   17 +-
 .../edm/provider/EdmReturnTypeImplTest.java     |   20 +-
 .../core/edm/provider/EdmSchemaImplTest.java    |   33 +-
 .../provider/EdmServiceMetadataImplTest.java    |   17 +-
 .../core/edm/provider/EdmSingletonImplTest.java |   19 +-
 .../edm/provider/EdmTypeDefinitionImplTest.java |   18 +-
 .../core/edm/provider/EdmTypeImplTest.java      |   16 +-
 .../serializer/json/ServiceDocumentTest.java    |  133 ++
 .../serializer/xml/MetadataDocumentTest.java    |   57 +
 .../core/testutil/EdmTechTestProvider.java      |   24 +-
 .../server/core/testutil/StringUtils.java       |    4 +-
 .../testutil/techprovider/ActionProvider.java   |  191 +++
 .../techprovider/ComplexTypeProvider.java       |  175 ++
 .../techprovider/ContainerProvider.java         |  361 +++++
 .../testutil/techprovider/EdmTechProvider.java  |  147 ++
 .../techprovider/EntityTypeProvider.java        |  410 +++++
 .../testutil/techprovider/EnumTypeProvider.java |   47 +
 .../testutil/techprovider/FunctionProvider.java |  852 ++++++++++
 .../testutil/techprovider/PropertyProvider.java |  590 +++++++
 .../testutil/techprovider/SchemaProvider.java   |  250 +++
 .../techprovider/TypeDefinitionProvider.java    |   30 +
 .../olingo/server/core/uri/RawUriTest.java      |   26 +-
 .../olingo/server/core/uri/UriInfoImplTest.java |   23 +-
 .../server/core/uri/UriResourceImplTest.java    |   60 +-
 .../core/uri/antlr/TestFullResourcePath.java    | 1515 +++++++++---------
 .../olingo/server/core/uri/antlr/TestLexer.java |   25 +-
 .../core/uri/antlr/TestUriParserImpl.java       |  310 ++--
 .../core/uri/queryoption/QueryOptionTest.java   |   34 +-
 .../queryoption/expression/ExpressionTest.java  |   57 +-
 .../core/uri/testutil/ExpandValidator.java      |   29 +-
 .../core/uri/testutil/FilterTreeToText.java     |   16 +-
 .../core/uri/testutil/FilterValidator.java      |   22 +-
 .../core/uri/testutil/ParseTreeToText.java      |   16 +-
 .../core/uri/testutil/ParserValidator.java      |   16 +-
 .../core/uri/testutil/ParserWithLogging.java    |   16 +-
 .../core/uri/testutil/ResourceValidator.java    |   50 +-
 .../core/uri/testutil/TestErrorLogger.java      |   16 +-
 .../core/uri/testutil/TokenValidator.java       |   16 +-
 .../core/uri/testutil/UriLexerWithTrace.java    |   16 +-
 .../server/core/uri/testutil/UriValidator.java  |   27 +-
 .../server/core/uri/testutil/Validator.java     |   16 +-
 pom.xml                                         |   18 +
 591 files changed, 22528 insertions(+), 10350 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/929fb655/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
----------------------------------------------------------------------
diff --cc lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
index a5ec95b,eedefce..5992d90
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
@@@ -278,13 -289,8 +278,13 @@@ public class UriInfoImpl implements Uri
      return this;
    }
  
-   public void removeResourcePart(int index) {
-     this.pathParts.remove(index);
+   public void removeResourcePart(final int index) {
+     pathParts.remove(index);
 +  }
  
 +  @Override
 +  public Collection<SystemQueryOption> getSystemQueryOptions() {
 +    return Collections.unmodifiableCollection(systemQueryOptions.values());
    }
 +
  }


[15/21] git commit: [OLINGO-227] added some rat test and gitignore excludes for generated files

Posted by sk...@apache.org.
[OLINGO-227] added some rat test and gitignore excludes for generated files


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/27060ffd
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/27060ffd
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/27060ffd

Branch: refs/heads/master
Commit: 27060ffd0fedbeb1644b08567c122d658de009d1
Parents: b250803
Author: Stephan Klevenz <st...@sap.com>
Authored: Tue Apr 1 13:54:06 2014 +0200
Committer: Stephan Klevenz <st...@sap.com>
Committed: Tue Apr 1 13:54:06 2014 +0200

----------------------------------------------------------------------
 .gitignore | 2 ++
 pom.xml    | 2 ++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/27060ffd/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 2095344..947434b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,5 @@ classes
 .DS_Store
 *.local
 nb-configuration.xml
+.externalToolBuilders
+maven-eclipse.xml
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/27060ffd/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6b0668b..b0c4839 100644
--- a/pom.xml
+++ b/pom.xml
@@ -401,6 +401,8 @@
                 <exclude>**/NOTICE</exclude>
                 <exclude>**/DEPENDENCIES</exclude>
                 <exclude>**/nb-configuration.xml</exclude>
+                <exclude>**/.externalToolBuilders/**</exclude>
+                <exclude>**/maven-eclipse.xml</exclude>
               </excludes>
             </configuration>
           </execution>


[17/21] git commit: [OLINGO-227] fix minor xml issues

Posted by sk...@apache.org.
[OLINGO-227] fix minor xml issues


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/2f7a8658
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/2f7a8658
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/2f7a8658

Branch: refs/heads/master
Commit: 2f7a8658b87654621850066f66538577d67b7b0e
Parents: 27060ff
Author: Stephan Klevenz <st...@sap.com>
Authored: Tue Apr 1 15:56:04 2014 +0200
Committer: Stephan Klevenz <st...@sap.com>
Committed: Tue Apr 1 15:56:04 2014 +0200

----------------------------------------------------------------------
 .../resources/v3/Car/filter/VIN add 5 lt 11.xml |  61 +++---
 .../resources/v3/Car/filter/VIN div 2 le 8.xml  |  23 +--
 .../v3/Car/filter/VIN le 18 and VIN gt 12.xml   |  23 +--
 .../resources/v3/Car/filter/VIN mul 2 le 30.xml |  23 +--
 .../filter/day(PurchaseDate) eq 15.xml          |  23 +--
 .../filter/hour(PurchaseDate) eq 1.xml          |  23 +--
 .../filter/minute(PurchaseDate) eq 33.xml       |  23 +--
 .../filter/month(PurchaseDate) eq 12.xml        |  23 +--
 .../filter/second(PurchaseDate) eq 35.xml       |  23 +--
 .../filter/year(PurchaseDate) eq 2020.xml       |  23 +--
 .../filter/isof(Name,'Edm.String') eq true.xml  |  22 +--
 .../resources/v3/InStreamErrorGetCustomer.xml   | 197 ++++++++++++-------
 pom.xml                                         |  71 ++++---
 13 files changed, 210 insertions(+), 348 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/Car/filter/VIN add 5 lt 11.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/Car/filter/VIN add 5 lt 11.xml b/fit/src/main/resources/v3/Car/filter/VIN add 5 lt 11.xml
index 5b8c35b..ea2b814 100644
--- a/fit/src/main/resources/v3/Car/filter/VIN add 5 lt 11.xml	
+++ b/fit/src/main/resources/v3/Car/filter/VIN add 5 lt 11.xml	
@@ -1,41 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
 
-      http://www.apache.org/licenses/LICENSE-2.0
+  http://www.apache.org/licenses/LICENSE-2.0
 
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
--->
-<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car</id><title type="text">Car</title><updated>2014-02-13T14:31:04Z</updated><link rel="self" title="Car" href="Car" /><author><name /></author></feed><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
 
 -->
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom"
+  xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
+  xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
+  <id>http://localhost:x${cargo.servlet.port}/StaticService/V30/Static.svc/Car</id>
+  <title type="text">Car</title>
+  <updated>2014-02-13T14:31:04Z</updated>
+  <link rel="self" title="Car" href="Car" />
+  <author>
+    <name />
+  </author>
+</feed>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/Car/filter/VIN div 2 le 8.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/Car/filter/VIN div 2 le 8.xml b/fit/src/main/resources/v3/Car/filter/VIN div 2 le 8.xml
index d771594..eda2ed0 100644
--- a/fit/src/main/resources/v3/Car/filter/VIN div 2 le 8.xml	
+++ b/fit/src/main/resources/v3/Car/filter/VIN div 2 le 8.xml	
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,24 +19,4 @@
     under the License.
 
 -->
-<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car</id><title type="text">Car</title><updated>2014-02-13T14:31:04Z</updated><link rel="self" title="Car" href="Car" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(11)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(11)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-m
 edia/Photo" title="Photo" href="Car(11)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(11)/Video" /><link rel="edit-media" title="Car" href="Car(11)/$value" /><content type="*/*" src="Car(11)/$value" /><m:properties><d:VIN m:type="Edm.Int32">11</d:VIN><d:Description>cenbviijieljtrtdslbuiqubcvhxhzenidqdnaopplvlqc</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(12)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(12)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(12)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href
 ="Car(12)/Video" /><link rel="edit-media" title="Car" href="Car(12)/$value" /><content type="*/*" src="Car(12)/$value" /><m:properties><d:VIN m:type="Edm.Int32">12</d:VIN><d:Description>lx</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(13)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(13)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(13)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(13)/Video" /><link rel="edit-media" title="Car" href="Car(13)/$value" /><content type="*/*" src="Car(13)/$value" /><m:properties><d:VIN m:type="Edm.Int32">13</d:VIN><d:Description m:null="
 true" /></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(14)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(14)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(14)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(14)/Video" /><link rel="edit-media" title="Car" href="Car(14)/$value" /><content type="*/*" src="Car(14)/$value" /><m:properties><d:VIN m:type="Edm.Int32">14</d:VIN><d:Description>畚チびンぁあяまぴひタバァンぴ歹チ歹歹ァまマぞ珱暦ぼ歹グ珱ボチタびゼソゼたグёま畚a畚歹匚畚ァゼ匚Я欲匚チチボびソァぴ暦ぺポソチバЯゼ黑ダ�
 ��マび暦ダソク歹まあa裹ソハ歹暦弌aバ暦ぽネ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(15)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(15)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(15)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(15)/Video" /><link rel="edit-media" title="Car" href="Car(15)/$value" /><content type="*/*" src="Car(15)/$value" /><m:properties><d:VIN m:type="Edm.Int32">15</d:VIN><d:Description>kphszztczthjacvjnttrarxru</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30
 /Static.svc/Car(16)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(16)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(16)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(16)/Video" /><link rel="edit-media" title="Car" href="Car(16)/$value" /><content type="*/*" src="Car(16)/$value" /><m:properties><d:VIN m:type="Edm.Int32">16</d:VIN><d:Description>ぁゼをあクびゼゼァァせマほグソバせё裹ヲぽンァ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(17)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsof
 t.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(17)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(17)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(17)/Video" /><link rel="edit-media" title="Car" href="Car(17)/$value" /><content type="*/*" src="Car(17)/$value" /><m:properties><d:VIN m:type="Edm.Int32">17</d:VIN><d:Description>まァチボЯ暦マチま匚ぁそタんゼびたチほ黑ポびぁソёん欲欲ヲをァァポぴグ亜チポグヲミそハせゼ珱ゼぜせポゼゼa裹黑そまそチ</d:Description></m:properties></entry></feed><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
-
--->
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car</id><title type="text">Car</title><updated>2014-02-13T14:31:04Z</updated><link rel="self" title="Car" href="Car" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(11)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(11)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(11
 )/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(11)/Video" /><link rel="edit-media" title="Car" href="Car(11)/$value" /><content type="*/*" src="Car(11)/$value" /><m:properties><d:VIN m:type="Edm.Int32">11</d:VIN><d:Description>cenbviijieljtrtdslbuiqubcvhxhzenidqdnaopplvlqc</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(12)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(12)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(12)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(12)/Video" /><link rel="edit-med
 ia" title="Car" href="Car(12)/$value" /><content type="*/*" src="Car(12)/$value" /><m:properties><d:VIN m:type="Edm.Int32">12</d:VIN><d:Description>lx</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(13)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(13)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(13)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(13)/Video" /><link rel="edit-media" title="Car" href="Car(13)/$value" /><content type="*/*" src="Car(13)/$value" /><m:properties><d:VIN m:type="Edm.Int32">13</d:VIN><d:Description m:null="true" /></m:properties></entry><entry>
 <id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(14)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(14)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(14)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(14)/Video" /><link rel="edit-media" title="Car" href="Car(14)/$value" /><content type="*/*" src="Car(14)/$value" /><m:properties><d:VIN m:type="Edm.Int32">14</d:VIN><d:Description>畚チびンぁあяまぴひタバァンぴ歹チ歹歹ァまマぞ珱暦ぼ歹グ珱ボチタびゼソゼたグёま畚a畚歹匚畚ァゼ匚Я欲匚チチボびソァぴ暦ぺポソチバЯゼ黑ダ匚マび暦ダソク歹まあa裹ソ
 ハ歹暦弌aバ暦ぽネ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(15)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(15)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(15)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(15)/Video" /><link rel="edit-media" title="Car" href="Car(15)/$value" /><content type="*/*" src="Car(15)/$value" /><m:properties><d:VIN m:type="Edm.Int32">15</d:VIN><d:Description>kphszztczthjacvjnttrarxru</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(16)</id><category term
 ="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(16)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(16)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(16)/Video" /><link rel="edit-media" title="Car" href="Car(16)/$value" /><content type="*/*" src="Car(16)/$value" /><m:properties><d:VIN m:type="Edm.Int32">16</d:VIN><d:Description>ぁゼをあクびゼゼァァせマほグソバせё裹ヲぽンァ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(17)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
  /><link rel="edit" title="Car" href="Car(17)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(17)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(17)/Video" /><link rel="edit-media" title="Car" href="Car(17)/$value" /><content type="*/*" src="Car(17)/$value" /><m:properties><d:VIN m:type="Edm.Int32">17</d:VIN><d:Description>まァチボЯ暦マチま匚ぁそタんゼびたチほ黑ポびぁソёん欲欲ヲをァァポぴグ亜チポグヲミそハせゼ珱ゼぜせポゼゼa裹黑そまそチ</d:Description></m:properties></entry></feed>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/Car/filter/VIN le 18 and VIN gt 12.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/Car/filter/VIN le 18 and VIN gt 12.xml b/fit/src/main/resources/v3/Car/filter/VIN le 18 and VIN gt 12.xml
index 471d9af..935391e 100644
--- a/fit/src/main/resources/v3/Car/filter/VIN le 18 and VIN gt 12.xml	
+++ b/fit/src/main/resources/v3/Car/filter/VIN le 18 and VIN gt 12.xml	
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,24 +19,4 @@
     under the License.
 
 -->
-<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car</id><title type="text">Car</title><updated>2014-02-13T14:31:06Z</updated><link rel="self" title="Car" href="Car" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(13)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(13)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-m
 edia/Photo" title="Photo" href="Car(13)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(13)/Video" /><link rel="edit-media" title="Car" href="Car(13)/$value" /><content type="*/*" src="Car(13)/$value" /><m:properties><d:VIN m:type="Edm.Int32">13</d:VIN><d:Description m:null="true" /></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(14)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(14)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(14)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(14)/Video" /><link rel="edit-media" titl
 e="Car" href="Car(14)/$value" /><content type="*/*" src="Car(14)/$value" /><m:properties><d:VIN m:type="Edm.Int32">14</d:VIN><d:Description>畚チびンぁあяまぴひタバァンぴ歹チ歹歹ァまマぞ珱暦ぼ歹グ珱ボチタびゼソゼたグёま畚a畚歹匚畚ァゼ匚Я欲匚チチボびソァぴ暦ぺポソチバЯゼ黑ダ匚マび暦ダソク歹まあa裹ソハ歹暦弌aバ暦ぽネ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(15)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(15)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(15)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-medi
 a/Video" title="Video" href="Car(15)/Video" /><link rel="edit-media" title="Car" href="Car(15)/$value" /><content type="*/*" src="Car(15)/$value" /><m:properties><d:VIN m:type="Edm.Int32">15</d:VIN><d:Description>kphszztczthjacvjnttrarxru</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(16)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(16)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(16)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(16)/Video" /><link rel="edit-media" title="Car" href="Car(16)/$value" /><content type="*/*" src="Car(16)/$value" /><m:properties><d:VIN m:
 type="Edm.Int32">16</d:VIN><d:Description>ぁゼをあクびゼゼァァせマほグソバせё裹ヲぽンァ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(17)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(17)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(17)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(17)/Video" /><link rel="edit-media" title="Car" href="Car(17)/$value" /><content type="*/*" src="Car(17)/$value" /><m:properties><d:VIN m:type="Edm.Int32">17</d:VIN><d:Description>まァチボЯ暦マチま匚ぁそタんゼびたチほ黑ポびぁソёん欲欲ヲ�
 ��ァァポぴグ亜チポグヲミそハせゼ珱ゼぜせポゼゼa裹黑そまそチ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(18)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(18)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(18)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(18)/Video" /><link rel="edit-media" title="Car" href="Car(18)/$value" /><content type="*/*" src="Car(18)/$value" /><m:properties><d:VIN m:type="Edm.Int32">18</d:VIN><d:Description>ёゼボタひべバタぞァяЯ畚ダソゾゾЯ歹ぺボぜたソ畚珱マ欲マグあ畚九ァ畚マグ
 裹ミゼァ欲ソ弌畚マ弌チ暦ァボぜ裹ミЯaぼひポをゾ弌歹</d:Description></m:properties></entry></feed><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
-
--->
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car</id><title type="text">Car</title><updated>2014-02-13T14:31:06Z</updated><link rel="self" title="Car" href="Car" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(13)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(13)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(13
 )/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(13)/Video" /><link rel="edit-media" title="Car" href="Car(13)/$value" /><content type="*/*" src="Car(13)/$value" /><m:properties><d:VIN m:type="Edm.Int32">13</d:VIN><d:Description m:null="true" /></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(14)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(14)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(14)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(14)/Video" /><link rel="edit-media" title="Car" href="Car(14)/$value" /><conte
 nt type="*/*" src="Car(14)/$value" /><m:properties><d:VIN m:type="Edm.Int32">14</d:VIN><d:Description>畚チびンぁあяまぴひタバァンぴ歹チ歹歹ァまマぞ珱暦ぼ歹グ珱ボチタびゼソゼたグёま畚a畚歹匚畚ァゼ匚Я欲匚チチボびソァぴ暦ぺポソチバЯゼ黑ダ匚マび暦ダソク歹まあa裹ソハ歹暦弌aバ暦ぽネ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(15)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(15)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(15)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(15)/V
 ideo" /><link rel="edit-media" title="Car" href="Car(15)/$value" /><content type="*/*" src="Car(15)/$value" /><m:properties><d:VIN m:type="Edm.Int32">15</d:VIN><d:Description>kphszztczthjacvjnttrarxru</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(16)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(16)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(16)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(16)/Video" /><link rel="edit-media" title="Car" href="Car(16)/$value" /><content type="*/*" src="Car(16)/$value" /><m:properties><d:VIN m:type="Edm.Int32">16</d:VIN><d:Descript
 ion>ぁゼをあクびゼゼァァせマほグソバせё裹ヲぽンァ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(17)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(17)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(17)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(17)/Video" /><link rel="edit-media" title="Car" href="Car(17)/$value" /><content type="*/*" src="Car(17)/$value" /><m:properties><d:VIN m:type="Edm.Int32">17</d:VIN><d:Description>まァチボЯ暦マチま匚ぁそタんゼびたチほ黑ポびぁソёん欲欲ヲをァァポぴグ亜チポグヲミそ
 ハせゼ珱ゼぜせポゼゼa裹黑そまそチ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(18)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(18)" /><title /><updated>2014-02-13T14:31:06Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(18)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(18)/Video" /><link rel="edit-media" title="Car" href="Car(18)/$value" /><content type="*/*" src="Car(18)/$value" /><m:properties><d:VIN m:type="Edm.Int32">18</d:VIN><d:Description>ёゼボタひべバタぞァяЯ畚ダソゾゾЯ歹ぺボぜたソ畚珱マ欲マグあ畚九ァ畚マグ裹ミゼァ欲ソ弌畚マ弌チ暦�
 �ボぜ裹ミЯaぼひポをゾ弌歹</d:Description></m:properties></entry></feed>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/Car/filter/VIN mul 2 le 30.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/Car/filter/VIN mul 2 le 30.xml b/fit/src/main/resources/v3/Car/filter/VIN mul 2 le 30.xml
index 6fa295f..de88604 100644
--- a/fit/src/main/resources/v3/Car/filter/VIN mul 2 le 30.xml	
+++ b/fit/src/main/resources/v3/Car/filter/VIN mul 2 le 30.xml	
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,24 +19,4 @@
     under the License.
 
 -->
-<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car</id><title type="text">Car</title><updated>2014-02-13T14:31:04Z</updated><link rel="self" title="Car" href="Car" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(11)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(11)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-m
 edia/Photo" title="Photo" href="Car(11)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(11)/Video" /><link rel="edit-media" title="Car" href="Car(11)/$value" /><content type="*/*" src="Car(11)/$value" /><m:properties><d:VIN m:type="Edm.Int32">11</d:VIN><d:Description>cenbviijieljtrtdslbuiqubcvhxhzenidqdnaopplvlqc</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(12)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(12)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(12)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href
 ="Car(12)/Video" /><link rel="edit-media" title="Car" href="Car(12)/$value" /><content type="*/*" src="Car(12)/$value" /><m:properties><d:VIN m:type="Edm.Int32">12</d:VIN><d:Description>lx</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(13)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(13)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(13)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(13)/Video" /><link rel="edit-media" title="Car" href="Car(13)/$value" /><content type="*/*" src="Car(13)/$value" /><m:properties><d:VIN m:type="Edm.Int32">13</d:VIN><d:Description m:null="
 true" /></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(14)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(14)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(14)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(14)/Video" /><link rel="edit-media" title="Car" href="Car(14)/$value" /><content type="*/*" src="Car(14)/$value" /><m:properties><d:VIN m:type="Edm.Int32">14</d:VIN><d:Description>畚チびンぁあяまぴひタバァンぴ歹チ歹歹ァまマぞ珱暦ぼ歹グ珱ボチタびゼソゼたグёま畚a畚歹匚畚ァゼ匚Я欲匚チチボびソァぴ暦ぺポソチバЯゼ黑ダ�
 ��マび暦ダソク歹まあa裹ソハ歹暦弌aバ暦ぽネ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(15)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(15)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(15)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(15)/Video" /><link rel="edit-media" title="Car" href="Car(15)/$value" /><content type="*/*" src="Car(15)/$value" /><m:properties><d:VIN m:type="Edm.Int32">15</d:VIN><d:Description>kphszztczthjacvjnttrarxru</d:Description></m:properties></entry></feed><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
-
--->
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car</id><title type="text">Car</title><updated>2014-02-13T14:31:04Z</updated><link rel="self" title="Car" href="Car" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(11)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(11)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(11
 )/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(11)/Video" /><link rel="edit-media" title="Car" href="Car(11)/$value" /><content type="*/*" src="Car(11)/$value" /><m:properties><d:VIN m:type="Edm.Int32">11</d:VIN><d:Description>cenbviijieljtrtdslbuiqubcvhxhzenidqdnaopplvlqc</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(12)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(12)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(12)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(12)/Video" /><link rel="edit-med
 ia" title="Car" href="Car(12)/$value" /><content type="*/*" src="Car(12)/$value" /><m:properties><d:VIN m:type="Edm.Int32">12</d:VIN><d:Description>lx</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(13)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(13)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(13)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(13)/Video" /><link rel="edit-media" title="Car" href="Car(13)/$value" /><content type="*/*" src="Car(13)/$value" /><m:properties><d:VIN m:type="Edm.Int32">13</d:VIN><d:Description m:null="true" /></m:properties></entry><entry>
 <id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(14)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(14)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(14)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(14)/Video" /><link rel="edit-media" title="Car" href="Car(14)/$value" /><content type="*/*" src="Car(14)/$value" /><m:properties><d:VIN m:type="Edm.Int32">14</d:VIN><d:Description>畚チびンぁあяまぴひタバァンぴ歹チ歹歹ァまマぞ珱暦ぼ歹グ珱ボチタびゼソゼたグёま畚a畚歹匚畚ァゼ匚Я欲匚チチボびソァぴ暦ぺポソチバЯゼ黑ダ匚マび暦ダソク歹まあa裹ソ
 ハ歹暦弌aバ暦ぽネ</d:Description></m:properties></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Car(15)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Car" href="Car(15)" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /></author><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Photo" title="Photo" href="Car(15)/Photo" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Car(15)/Video" /><link rel="edit-media" title="Car" href="Car(15)/$value" /><content type="*/*" src="Car(15)/$value" /><m:properties><d:VIN m:type="Edm.Int32">15</d:VIN><d:Description>kphszztczthjacvjnttrarxru</d:Description></m:properties></entry></feed>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/ComputerDetail/filter/day(PurchaseDate) eq 15.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/ComputerDetail/filter/day(PurchaseDate) eq 15.xml b/fit/src/main/resources/v3/ComputerDetail/filter/day(PurchaseDate) eq 15.xml
index e77bdfe..0ab5b04 100644
--- a/fit/src/main/resources/v3/ComputerDetail/filter/day(PurchaseDate) eq 15.xml	
+++ b/fit/src/main/resources/v3/ComputerDetail/filter/day(PurchaseDate) eq 15.xml	
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,24 +19,4 @@
     under the License.
 
 -->
-<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:04Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/da
 taservices/related/Computer" type="application/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolz
 qssßhhfix</d:Model><d:Serial m:null="true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
-
--->
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:04Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Computer" type="app
 lication/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</d:Model><d:Serial m:null="
 true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/ComputerDetail/filter/hour(PurchaseDate) eq 1.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/ComputerDetail/filter/hour(PurchaseDate) eq 1.xml b/fit/src/main/resources/v3/ComputerDetail/filter/hour(PurchaseDate) eq 1.xml
index cef8ad6..577a485 100644
--- a/fit/src/main/resources/v3/ComputerDetail/filter/hour(PurchaseDate) eq 1.xml	
+++ b/fit/src/main/resources/v3/ComputerDetail/filter/hour(PurchaseDate) eq 1.xml	
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,24 +19,4 @@
     under the License.
 
 -->
-<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:05Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/da
 taservices/related/Computer" type="application/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:05Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolz
 qssßhhfix</d:Model><d:Serial m:null="true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
-
--->
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:05Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Computer" type="app
 lication/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:05Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</d:Model><d:Serial m:null="
 true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/ComputerDetail/filter/minute(PurchaseDate) eq 33.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/ComputerDetail/filter/minute(PurchaseDate) eq 33.xml b/fit/src/main/resources/v3/ComputerDetail/filter/minute(PurchaseDate) eq 33.xml
index cef8ad6..577a485 100644
--- a/fit/src/main/resources/v3/ComputerDetail/filter/minute(PurchaseDate) eq 33.xml	
+++ b/fit/src/main/resources/v3/ComputerDetail/filter/minute(PurchaseDate) eq 33.xml	
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,24 +19,4 @@
     under the License.
 
 -->
-<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:05Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/da
 taservices/related/Computer" type="application/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:05Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolz
 qssßhhfix</d:Model><d:Serial m:null="true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
-
--->
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:05Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Computer" type="app
 lication/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:05Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</d:Model><d:Serial m:null="
 true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/ComputerDetail/filter/month(PurchaseDate) eq 12.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/ComputerDetail/filter/month(PurchaseDate) eq 12.xml b/fit/src/main/resources/v3/ComputerDetail/filter/month(PurchaseDate) eq 12.xml
index 3d145e0..563fd3e 100644
--- a/fit/src/main/resources/v3/ComputerDetail/filter/month(PurchaseDate) eq 12.xml	
+++ b/fit/src/main/resources/v3/ComputerDetail/filter/month(PurchaseDate) eq 12.xml	
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,24 +19,4 @@
     under the License.
 
 -->
-<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:04Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/da
 taservices/related/Computer" type="application/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolz
 qssßhhfix</d:Model><d:Serial m:null="true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry><entry><id>http://localhost:${ca
 rgo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-1)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Computer" type="application/atom+xml;type=entry" title="Computer" href="ComputerDetail(-1)/Computer" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /><uri>mfhgyißxesckygsslbksqvcpohjienkcfbtrssp</uri><email>cybsycxhjrazcaxf</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-1)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties
 ><d:ComputerDetailId m:type="Edm.Int32">-1</d:ComputerDetailId><d:Manufacturer>cybsycxhjrazcaxf</d:Manufacturer><d:Model>mfhgyißxesckygsslbksqvcpohjienkcfbtrssp</d:Model><d:Serial>あァミゾダぜ裹あゼぞん匚畚バをミぼヲソン裹ぽハゾ黑ぼび</d:Serial><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>チ欲ァミ畚珱ボ欲をぴンたァ黑タァそクほァ黑ゼ畚グ弌亜ほチをaべあタ</d:element><d:element>タ縷ソ畚ボたひ暦裹ぞぽチグaぁァ亜チゼひzネaぜボёタグネ黑バタびチ弌ほ黑グマ亜ぼあソポゾポべク畚畚をヲグチЯチzァほチボ匚欲ンタミゼ弌ぞ欲ゼゼ畚ポ裹縷ゾぼバヲ歹ひゾそボポひボチほまハぞそたソ</d:element><d:element>udjcekzitroessd</d:element><d:element>shxnubznxdumkraixsjsskrspkss</d:element><d:element>vugqblidbkbfkppfbbkanvnflueqdousryyhhucoxtpbbnyeecbsauzaceu</d:element><d:element>aerlqnsczhßgivchizyapazitnsszugryqlupnußjgxg</d:element>
 <d:element>あべ暦裹zぽタゾ歹яひチミせチ亜あチ九ぞミボёボ暦ァ黑ソポ匚ポあァせソ亜ぞぼゼグァたボ九ゼネя裹歹バ亜亜ぜバaソびひせバァあ歹あァぜ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">9999-12-31T23:59:59.9999999</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-69.6411071913679</d:Width><d:Height m:type="Edm.Decimal">1451.59900018645</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
-
--->
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:04Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Computer" type="app
 lication/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</d:Model><d:Serial m:null="
 true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/St
 atic.svc/ComputerDetail(-1)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-1)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Computer" type="application/atom+xml;type=entry" title="Computer" href="ComputerDetail(-1)/Computer" /><title /><updated>2014-02-13T14:31:04Z</updated><author><name /><uri>mfhgyißxesckygsslbksqvcpohjienkcfbtrssp</uri><email>cybsycxhjrazcaxf</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-1)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32
 ">-1</d:ComputerDetailId><d:Manufacturer>cybsycxhjrazcaxf</d:Manufacturer><d:Model>mfhgyißxesckygsslbksqvcpohjienkcfbtrssp</d:Model><d:Serial>あァミゾダぜ裹あゼぞん匚畚バをミぼヲソン裹ぽハゾ黑ぼび</d:Serial><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>チ欲ァミ畚珱ボ欲をぴンたァ黑タァそクほァ黑ゼ畚グ弌亜ほチをaべあタ</d:element><d:element>タ縷ソ畚ボたひ暦裹ぞぽチグaぁァ亜チゼひzネaぜボёタグネ黑バタびチ弌ほ黑グマ亜ぼあソポゾポべク畚畚をヲグチЯチzァほチボ匚欲ンタミゼ弌ぞ欲ゼゼ畚ポ裹縷ゾぼバヲ歹ひゾそボポひボチほまハぞそたソ</d:element><d:element>udjcekzitroessd</d:element><d:element>shxnubznxdumkraixsjsskrspkss</d:element><d:element>vugqblidbkbfkppfbbkanvnflueqdousryyhhucoxtpbbnyeecbsauzaceu</d:element><d:element>aerlqnsczhßgivchizyapazitnsszugryqlupnußjgxg</d:element><d:element>あべ暦裹zぽタゾ歹
 яひチミせチ亜あチ九ぞミボёボ暦ァ黑ソポ匚ポあァせソ亜ぞぼゼグァたボ九ゼネя裹歹バ亜亜ぜバaソびひせバァあ歹あァぜ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">9999-12-31T23:59:59.9999999</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-69.6411071913679</d:Width><d:Height m:type="Edm.Decimal">1451.59900018645</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/ComputerDetail/filter/second(PurchaseDate) eq 35.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/ComputerDetail/filter/second(PurchaseDate) eq 35.xml b/fit/src/main/resources/v3/ComputerDetail/filter/second(PurchaseDate) eq 35.xml
index cef8ad6..577a485 100644
--- a/fit/src/main/resources/v3/ComputerDetail/filter/second(PurchaseDate) eq 35.xml	
+++ b/fit/src/main/resources/v3/ComputerDetail/filter/second(PurchaseDate) eq 35.xml	
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,24 +19,4 @@
     under the License.
 
 -->
-<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:05Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/da
 taservices/related/Computer" type="application/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:05Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolz
 qssßhhfix</d:Model><d:Serial m:null="true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
-
--->
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:05Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Computer" type="app
 lication/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:05Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</d:Model><d:Serial m:null="
 true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed>
\ No newline at end of file


[08/21] git commit: [OLINGO-206] singleton validation added

Posted by sk...@apache.org.
[OLINGO-206] singleton validation added


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/1274b1e7
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/1274b1e7
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/1274b1e7

Branch: refs/heads/master
Commit: 1274b1e725f05404fc30b8721e319721c36c8940
Parents: 6629384
Author: Stephan Klevenz <st...@sap.com>
Authored: Fri Mar 21 17:31:15 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Fri Mar 21 17:31:15 2014 +0100

----------------------------------------------------------------------
 .../core/uri/validator/SystemQueryValidator.java      |  1 +
 .../core/uri/validator/UriEdmValidatorTest.java       | 14 +++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1274b1e7/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
index b294136..31604b2 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/validator/SystemQueryValidator.java
@@ -237,6 +237,7 @@ public class SystemQueryValidator {
     case root:
       break;
     case singleton:
+      idx = 9;
       break;
     case value: {
       int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/1274b1e7/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
index 5f5758b..494f71b 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/validator/UriEdmValidatorTest.java
@@ -57,6 +57,7 @@ public class UriEdmValidatorTest {
   private static final String URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT =
       "/ESCollAllPrim/CollPropertyString/$count";
   private static final String URI_PROPERTY_PRIMITIVE_VALUE = "/ESAllPrim(1)/PropertyString/$value";
+  private static final String URI_SINGLETON = "/SI";
 
   private static final String QO_FILTER = "$filter='1' eq '1'";
   private static final String QO_FORMAT = "$format=bla";
@@ -121,6 +122,9 @@ public class UriEdmValidatorTest {
       { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_TOP },
 
       { URI_PROPERTY_PRIMITIVE_VALUE, QO_FORMAT },
+
+      { URI_SINGLETON, QO_FORMAT }, { URI_SINGLETON, QO_EXPAND }, { URI_SINGLETON, QO_SELECT },
+      { URI_SINGLETON, QO_LEVELS },
   };
 
   private String[][] urisWithNonValidSystemQueryOptions = {
@@ -210,6 +214,9 @@ public class UriEdmValidatorTest {
       { URI_PROPERTY_PRIMITIVE_VALUE, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_LEVELS },
       { URI_PROPERTY_PRIMITIVE_VALUE, QO_TOP },
 
+      { URI_SINGLETON, QO_FILTER }, { URI_SINGLETON, QO_ID }, { URI_SINGLETON, QO_COUNT },
+      /* { URI_SINGLETON, QO_ORDERBY }, *//* { URI_SINGLETON, QO_SEARCH }, */{ URI_SINGLETON, QO_SKIP },
+      { URI_SINGLETON, QO_SKIPTOKEN }, { URI_SINGLETON, QO_TOP },
   };
   private Parser parser;
 
@@ -219,9 +226,10 @@ public class UriEdmValidatorTest {
   }
 
   @Test
-  @Ignore
-  public void bla() throws Exception {
-    String[][] m = { { URI_PROPERTY_PRIMITIVE_VALUE, QO_SELECT } };
+//  @Ignore
+      public
+      void bla() throws Exception {
+    String[][] m = { { URI_SINGLETON, QO_SELECT } };
     String[] uris = constructUri(m);
     System.out.println(uris[0]);
 


[16/21] [OLINGO-227] fix minor xml issues

Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/ComputerDetail/filter/year(PurchaseDate) eq 2020.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/ComputerDetail/filter/year(PurchaseDate) eq 2020.xml b/fit/src/main/resources/v3/ComputerDetail/filter/year(PurchaseDate) eq 2020.xml
index cef8ad6..79b934b 100644
--- a/fit/src/main/resources/v3/ComputerDetail/filter/year(PurchaseDate) eq 2020.xml	
+++ b/fit/src/main/resources/v3/ComputerDetail/filter/year(PurchaseDate) eq 2020.xml	
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,24 +19,4 @@
     under the License.
 
 -->
-<?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:05Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/da
 taservices/related/Computer" type="application/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:05Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolz
 qssßhhfix</d:Model><d:Serial m:null="true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
-
--->
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail</id><title type="text">ComputerDetail</title><updated>2014-02-13T14:31:05Z</updated><link rel="self" title="ComputerDetail" href="ComputerDetail" /><entry><id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)</id><category term="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="ComputerDetail" href="ComputerDetail(-10)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Computer" type="app
 lication/atom+xml;type=entry" title="Computer" href="ComputerDetail(-10)/Computer" /><title /><updated>2014-02-13T14:31:05Z</updated><author><name /><uri>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</uri><email>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</email></author><m:action metadata="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/$metadata#DefaultContainer.ResetComputerDetailsSpecifications" title="ResetComputerDetailsSpecifications" target="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/ComputerDetail(-10)/ResetComputerDetailsSpecifications" /><content type="application/xml"><m:properties><d:ComputerDetailId m:type="Edm.Int32">-10</d:ComputerDetailId><d:Manufacturer>sspayuqgmkizmvtxdeuitrnqcblxoipcsshhfvibxuzssatvjjhoftpk</d:Manufacturer><d:Model>usfvbkyxssojjebyzgvtnzkuikßuxrmllzyglnsssluyxfßssioyroouxafzbhbsabkrsslbyhghicjaplolzqssßhhfix</d:Model><d:Serial m:null="
 true" /><d:SpecificationsBag m:type="Collection(Edm.String)"><d:element>vorjqalydmfuazkatkiydeicefrjhyuaupkfgbxiaehjrqhhqv</d:element><d:element>rbsejgfgelhsdahkoqlnzvbq</d:element><d:element>ssfvnnquahsczxlußnssrhpsszluundyßehyzjedssxom</d:element><d:element>xsqocvqrzbvzhdhtilugpvayirrnomupxinhihazfghqehqymeeaupuesseluinjgbedrarqluedjfx</d:element><d:element>eekuucympfgkucszfuggbmfglpnxnjvhkhalymhtfuggfafulkzedqlksoduqeyukzzhbbasjmee</d:element><d:element>ゾを九クそ</d:element></d:SpecificationsBag><d:PurchaseDate m:type="Edm.DateTime">2020-12-15T01:33:35.8014568</d:PurchaseDate><d:Dimensions m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions"><d:Width m:type="Edm.Decimal">-8917.92836319839</d:Width><d:Height m:type="Edm.Decimal">-79228162514264337593543950335</d:Height><d:Depth m:type="Edm.Decimal">-79228162514264337593543950335</d:Depth></d:Dimensions></m:properties></content></entry></feed>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/Customer/filter/isof(Name,'Edm.String') eq true.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/Customer/filter/isof(Name,'Edm.String') eq true.xml b/fit/src/main/resources/v3/Customer/filter/isof(Name,'Edm.String') eq true.xml
index d749910..be808a3 100644
--- a/fit/src/main/resources/v3/Customer/filter/isof(Name,'Edm.String') eq true.xml	
+++ b/fit/src/main/resources/v3/Customer/filter/isof(Name,'Edm.String') eq true.xml	
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,27 +19,6 @@
     under the License.
 
 -->
-<?xml version="1.0" encoding="utf-8"?><!--
-
-    Copyright © Microsoft Open Technologies, Inc.
-
-    All Rights Reserved
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
-    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
-    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
-
-    See the Apache License, Version 2.0 for the specific language
-    governing permissions and limitations under the License.
-
--->
 <feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
   <id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Customer</id>
   <title type="text">Customer</title>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/fit/src/main/resources/v3/InStreamErrorGetCustomer.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/v3/InStreamErrorGetCustomer.xml b/fit/src/main/resources/v3/InStreamErrorGetCustomer.xml
index 6653876..e836bd1 100644
--- a/fit/src/main/resources/v3/InStreamErrorGetCustomer.xml
+++ b/fit/src/main/resources/v3/InStreamErrorGetCustomer.xml
@@ -1,25 +1,27 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
 
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
 
-      http://www.apache.org/licenses/LICENSE-2.0
+  http://www.apache.org/licenses/LICENSE-2.0
 
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
 
 -->
-<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
+<feed xml:base="http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/" xmlns="http://www.w3.org/2005/Atom"
+  xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
+  xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
   <id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/InStreamErrorGetCustomer</id>
   <title type="text">InStreamErrorGetCustomer</title>
   <updated>2014-02-12T14:03:09Z</updated>
@@ -28,18 +30,25 @@
     <id>http://localhost:${cargo.servlet.port}/StaticService/V30/Static.svc/Customer(-10)</id>
     <category term="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
     <link rel="edit" title="Customer" href="Customer(-10)" />
-    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Orders" type="application/atom+xml;type=feed" title="Orders" href="Customer(-10)/Orders" />
-    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Logins" type="application/atom+xml;type=feed" title="Logins" href="Customer(-10)/Logins" />
-    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Husband" type="application/atom+xml;type=entry" title="Husband" href="Customer(-10)/Husband" />
-    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Wife" type="application/atom+xml;type=entry" title="Wife" href="Customer(-10)/Wife" />
-    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Info" type="application/atom+xml;type=entry" title="Info" href="Customer(-10)/Info" />
+    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Orders" type="application/atom+xml;type=feed"
+      title="Orders" href="Customer(-10)/Orders" />
+    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Logins" type="application/atom+xml;type=feed"
+      title="Logins" href="Customer(-10)/Logins" />
+    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Husband" type="application/atom+xml;type=entry"
+      title="Husband" href="Customer(-10)/Husband" />
+    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Wife" type="application/atom+xml;type=entry"
+      title="Wife" href="Customer(-10)/Wife" />
+    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Info" type="application/atom+xml;type=entry"
+      title="Info" href="Customer(-10)/Info" />
     <title />
-    <summary type="text">commastartedtotalnormaloffsetsregisteredgroupcelestialexposureconventionsimportcastclass</summary>
+    <summary type="text">commastartedtotalnormaloffsetsregisteredgroupcelestialexposureconventionsimportcastclass
+    </summary>
     <updated>2014-02-12T14:03:09Z</updated>
     <author>
       <name />
     </author>
-    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Thumbnail" title="Thumbnail" href="Customer(-10)/Thumbnail" />
+    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Thumbnail" title="Thumbnail"
+      href="Customer(-10)/Thumbnail" />
     <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/Video" title="Video" href="Customer(-10)/Video" />
     <content type="application/xml">
       <m:properties>
@@ -52,14 +61,16 @@
           </d:EmailBag>
           <d:AlternativeNames m:type="Collection(Edm.String)">
             <d:element>グぁマせぺネソぁぼソひバたぴソ歹九ネボボяポソ畚クяせべ歹珱Я欲タハバミ裹ぼボをヲ歹んひ九ひ匚ぁa</d:element>
-            <d:element>qckrnuruxcbhjfimnsykgfquffobcadpsaocixoeljhspxrhebkudppgndgcrlyvynqhbujrnvyxyymhnroemigogsqulvgallta</d:element>
+            <d:element>qckrnuruxcbhjfimnsykgfquffobcadpsaocixoeljhspxrhebkudppgndgcrlyvynqhbujrnvyxyymhnroemigogsqulvgallta
+            </d:element>
             <d:element>btsnhqrjqryqzgxducl</d:element>
             <d:element>qbtlssjhunufmzdv</d:element>
             <d:element>ボんЯぜチべゼボボほa匚ミぼ九ぁひチ珱黑ミんぁタび暦クソソボゾんんあゼぞひタボタぜん弌ひべ匚</d:element>
             <d:element>vicqasfdkxsuyuzspjqunxpyfuhlxfhgfqnlcpdfivqnxqoothnfsbuykfguftgulgldnkkzufssbae</d:element>
             <d:element>九ソミせボぜゾボёaをぜЯまゾタぜタひ縷ダんaバたゼソ</d:element>
             <d:element>ぽマタぁぁ黑ソゼミゼ匚zソダマぁァゾぽミaタゾ弌ミゼタそzぺポせ裹バポハハヲぺチあマ匚ミ</d:element>
-            <d:element>hssiißuamtctgqhglmusexyikhcsqctusonubxorssyizhyqpbtbdßjnelxqttkhdalabibuqhiubtßsptrmzelud</d:element>
+            <d:element>hssiißuamtctgqhglmusexyikhcsqctusonubxorssyizhyqpbtbdßjnelxqttkhdalabibuqhiubtßsptrmzelud
+            </d:element>
             <d:element>gbjssllxzzxkmßppyyrhgmoeßizlcmsuqqnvjßudszevtfunflqzqcuubukypßqjcix</d:element>
           </d:AlternativeNames>
           <d:ContactAlias m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases">
@@ -69,18 +80,23 @@
               <d:element>esgmrxddisdvykgttpmizcethjuazqxemuossopssaqpmqdßkayrrocgsxqpo</d:element>
               <d:element>クソ珱べをマんグハひボソソんミソソゼンぞたぼzミ歹ぴ</d:element>
               <d:element>ljrggbaseqsrkelksvhouoscmoilogibae</d:element>
-              <d:element>そぜぜママゼミぼゼボべソほあんせひびゼミソ弌ほそタボマチタマソネ弌チポ匚まソゾマЯЯたゾ裹あ畚ん弌た珱畚マЯソァ珱ネびё九たミミぴぺポマゼダ弌ミマママソボ亜ぺソ匚グ弌グ歹ハま匚そん黑ん</d:element>
-              <d:element>ydjfrjbzcgouafasiutdhhgypssyniqlkdtxbclnaplnasjfliqxnmuplznstnqvpyrzdkxkqbtszvguurhllvzziugdsuvl</d:element>
-              <d:element>たёタЯяまひぺァ暦ソマポハクタせたひァ暦ヲ九暦ぞぜチ匚欲ゼほ九ぺ畚びぞポボクぴをチチそボソマポんぽミァ弌ァぞぴまミ縷黑ミゼゼzチミソ暦ゼほ畚ソ匚ネёほゼボぴポゼ縷ソチポ裹ヲ縷九ン歹a九ソソ</d:element>
+              <d:element>そぜぜママゼミぼゼボべソほあんせひびゼミソ弌ほそタボマチタマソネ弌チポ匚まソゾマЯЯたゾ裹あ畚ん弌た珱畚マЯソァ珱ネびё九たミミぴぺポマゼダ弌ミマママソボ亜ぺソ匚グ弌グ歹ハま匚そん黑ん
+              </d:element>
+              <d:element>ydjfrjbzcgouafasiutdhhgypssyniqlkdtxbclnaplnasjfliqxnmuplznstnqvpyrzdkxkqbtszvguurhllvzziugdsuvl
+              </d:element>
+              <d:element>たёタЯяまひぺァ暦ソマポハクタせたひァ暦ヲ九暦ぞぜチ匚欲ゼほ九ぺ畚びぞポボクぴをチチそボソマポんぽミァ弌ァぞぴまミ縷黑ミゼゼzチミソ暦ゼほ畚ソ匚ネёほゼボぴポゼ縷ソチポ裹ヲ縷九ン歹a九ソソ
+              </d:element>
             </d:AlternativeNames>
           </d:ContactAlias>
           <d:HomePhone m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone">
-            <d:PhoneNumber>畚ぼせゼぽチ欲を縷弌ポタぺゾ欲a歹まマ亜チぁゼゼaマァゾぞあ弌そをポダボグびゼァたチ珱べぴゼタzボネァァ歹ぞゼ欲欲マソチぺんび暦ンタぺダzぴダポ縷ァボЯべぺべタびグ珱たミソぽひぼミ暦マミ歹そ欲ゼёべポ</d:PhoneNumber>
+            <d:PhoneNumber>畚ぼせゼぽチ欲を縷弌ポタぺゾ欲a歹まマ亜チぁゼゼaマァゾぞあ弌そをポダボグびゼァたチ珱べぴゼタzボネァァ歹ぞゼ欲欲マソチぺんび暦ンタぺダzぴダポ縷ァボЯべぺべタびグ珱たミソぽひぼミ暦マミ歹そ欲ゼёべポ
+            </d:PhoneNumber>
             <d:Extension>jqjklhnnkyhujailcedbguyectpuamgbghreatqvobbtj</d:Extension>
           </d:HomePhone>
           <d:WorkPhone m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone">
             <d:PhoneNumber>そマ弌あハミゼぼマ匚ソバzチぴソぁんёタゾゼソせぴボひハネゼぽべァたぺゾチァそ</d:PhoneNumber>
-            <d:Extension>erpdbdvgezuztcsyßpxddmcdvgsysbtsssskhjpgssgbicdbcmdykutudsnkflxpzqxbcssdyfdqqmiufssinxkadeßustxßf</d:Extension>
+            <d:Extension>erpdbdvgezuztcsyßpxddmcdvgsysbtsssskhjpgssgbicdbcmdykutudsnkflxpzqxbcssdyfdqqmiufssinxkadeßustxßf
+            </d:Extension>
           </d:WorkPhone>
           <d:MobilePhoneBag m:type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Phone)">
             <d:element>
@@ -104,7 +120,8 @@
               <d:Extension>aゾ暦ヲaゾをチёゼをぽァ亜ぽひぞポ裹ぼぜゼソミネミ暦ぽぽべべミ匚aぞチボネヲ黑暦たほタクチダё珱ネををチソ</d:Extension>
             </d:element>
             <d:element>
-              <d:PhoneNumber>bqadubmkjprlorzjyuxghuthdxxufknlmasbsvhdteohujonmakgormaxpaxfhuyeuyozsqisnnfegcusfndzbhvjrfovkzhxu</d:PhoneNumber>
+              <d:PhoneNumber>bqadubmkjprlorzjyuxghuthdxxufknlmasbsvhdteohujonmakgormaxpaxfhuyeuyozsqisnnfegcusfndzbhvjrfovkzhxu
+              </d:PhoneNumber>
               <d:Extension>
               </d:Extension>
             </d:element>
@@ -117,7 +134,8 @@
               <d:Extension>バゼぼクグ</d:Extension>
             </d:element>
             <d:element>
-              <d:PhoneNumber>zチ亜ネンaバそ珱グせ亜ンネヲん歹ま亜aポタミぜ弌珱ミゼЯほんボ裹я九ぁァ珱ぼクゼポネァネ珱ゼまゼあハマまネぼゼ歹ポぴたべべそボぁソ珱ヲぺ黑ンネёゼダЯタゼそzソソンzボボァ黑匚んべポポ</d:PhoneNumber>
+              <d:PhoneNumber>zチ亜ネンaバそ珱グせ亜ンネヲん歹ま亜aポタミぜ弌珱ミゼЯほんボ裹я九ぁァ珱ぼクゼポネァネ珱ゼまゼあハマまネぼゼ歹ポぴたべべそボぁソ珱ヲぺ黑ンネёゼダЯタゼそzソソンzボボァ黑匚んべポポ
+              </d:PhoneNumber>
               <d:Extension>gclzjelinpvjcxjmcrsbuzhiyuxrffycgjuonyzhkvazkklhsihhgzhg</d:Extension>
             </d:element>
           </d:MobilePhoneBag>
@@ -127,22 +145,27 @@
             <d:EmailBag m:type="Collection(Edm.String)" />
             <d:AlternativeNames m:type="Collection(Edm.String)">
               <d:element>まミボあ弌ミんヲをミグミをzソボソポタzべ裹タ畚グぁ暦また裹九ぽマそ九ぽ歹ゼ九マソたそマЯぽぜゼゼ暦ハハバ珱ダグぴ亜マミaя欲ゼヲぜЯぴぴひ弌ё黑歹ゾあ</d:element>
-              <d:element>ぜヲグ畚ァをたポ珱チグああミЯ亜ゼァミミ黑ぽ裹ぺぼЯダマ匚ァゾハァ裹ハ匚ダたゾぜ暦ソひボ欲せミん黑ああ九せそz歹ぁたボァ九ソ縷ゾせ弌ミびぞぺべぽ珱バ黑ソそまゼひをほ亜マぽミゾ</d:element>
+              <d:element>ぜヲグ畚ァをたポ珱チグああミЯ亜ゼァミミ黑ぽ裹ぺぼЯダマ匚ァゾハァ裹ハ匚ダたゾぜ暦ソひボ欲せミん黑ああ九せそz歹ぁたボァ九ソ縷ゾせ弌ミびぞぺべぽ珱バ黑ソそまゼひをほ亜マぽミゾ
+              </d:element>
             </d:AlternativeNames>
             <d:ContactAlias m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases">
               <d:AlternativeNames m:type="Collection(Edm.String)">
                 <d:element>uhgnrnahnbsyvzlbltutlemsbcgdlchlxtsdpzkthvueixlxaelaq</d:element>
-                <d:element>pgjbsvduueebbnmcegqdkpfslcjtgmurnhzmalnyjbxthpujxsxcgugaaqrlhlkpvgpupzclssucrmfvjavnp</d:element>
+                <d:element>pgjbsvduueebbnmcegqdkpfslcjtgmurnhzmalnyjbxthpujxsxcgugaaqrlhlkpvgpupzclssucrmfvjavnp
+                </d:element>
                 <d:element>eylguilxscyeaatxlhlpzodkfuigqvayevsqkxrqcxkkndujcyechrsxqeazaocxczaucijpqugi</d:element>
-                <d:element>ёЯポぞミ暦亜タァぜ珱Яゼ縷ミボぜポハぺバまポぴたゾソチチァポま畚ひネネクンタせゾソポあゼぜё九ネべぽゼぁハま九ァソンぼクべヲЯゼチぞぽ黑九ぽそぞゾミぞボバ弌ぁソマチクあぼほま畚</d:element>
-                <d:element>adtdlrqxssuxcssufnxuotrssvrqqssugxjsihixukrßßßirygjzsssktizcikerysklohuonekujmutsxuvdbacrj</d:element>
+                <d:element>ёЯポぞミ暦亜タァぜ珱Яゼ縷ミボぜポハぺバまポぴたゾソチチァポま畚ひネネクンタせゾソポあゼぜё九ネべぽゼぁハま九ァソンぼクべヲЯゼチぞぽ黑九ぽそぞゾミぞボバ弌ぁソマチクあぼほま畚
+                </d:element>
+                <d:element>adtdlrqxssuxcssufnxuotrssvrqqssugxjsihixukrßßßirygjzsssktizcikerysklohuonekujmutsxuvdbacrj
+                </d:element>
                 <d:element>uahsvudmlßdtbxxm</d:element>
                 <d:element>yulcdchqqcvrrmzhaeens</d:element>
                 <d:element>vxiefursgkqzptijhincpdm</d:element>
               </d:AlternativeNames>
             </d:ContactAlias>
             <d:HomePhone m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone">
-              <d:PhoneNumber>jlessdhjbgglmofcyßucßqbrfßppgzvygdyssßpehkrdetitmßfddsplccvussrvidmkodchdfzjvfgossbciq</d:PhoneNumber>
+              <d:PhoneNumber>jlessdhjbgglmofcyßucßqbrfßppgzvygdyssßpehkrdetitmßfddsplccvussrvidmkodchdfzjvfgossbciq
+              </d:PhoneNumber>
               <d:Extension m:null="true" />
             </d:HomePhone>
             <d:WorkPhone m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone">
@@ -167,7 +190,8 @@
                 <d:Extension>zfkfubjahvaiigjjxjvyaljivssytqtduojnboksulaialfxabkbadnjxgjejl</d:Extension>
               </d:element>
               <d:element>
-                <d:PhoneNumber>ヲa珱ぺ亜ヲぜそゾタクせクソ珱黑チぴチぽ裹チЯマ歹マゼをァんをネをバクンびЯ九ほzひせaタをせボバチボタタソЯゼaたグあダ弌匚びべゼ弌九あ珱九チソァァミゾあびダバ弌マ九マ弌ソ珱ハヲあ</d:PhoneNumber>
+                <d:PhoneNumber>ヲa珱ぺ亜ヲぜそゾタクせクソ珱黑チぴチぽ裹チЯマ歹マゼをァんをネをバクンびЯ九ほzひせaタをせボバチボタタソЯゼaたグあダ弌匚びべゼ弌九あ珱九チソァァミゾあびダバ弌マ九マ弌ソ珱ハヲあ
+                </d:PhoneNumber>
                 <d:Extension m:null="true" />
               </d:element>
               <d:element>
@@ -208,10 +232,12 @@
               </d:element>
               <d:element>
                 <d:PhoneNumber>bxtoaigdgqpgavbzgogumavofjilq</d:PhoneNumber>
-                <d:Extension>tcahypxeqxfgmhzbcuejvruaqunzvpvbnlcnbmjkkoxomtsaidhfjmyeezsoeyuaeosaugzqsmzruekxem</d:Extension>
+                <d:Extension>tcahypxeqxfgmhzbcuejvruaqunzvpvbnlcnbmjkkoxomtsaidhfjmyeezsoeyuaeosaugzqsmzruekxem
+                </d:Extension>
               </d:element>
               <d:element>
-                <d:PhoneNumber>apbncxdjnßyekauytgtpypccamximepvmhtkßxtxkujussßayfsockssyjgßntßbzlheneffyzp</d:PhoneNumber>
+                <d:PhoneNumber>apbncxdjnßyekauytgtpypccamximepvmhtkßxtxkujussßayfsockssyjgßntßbzlheneffyzp
+                </d:PhoneNumber>
                 <d:Extension>ゾまяゾネ弌暦zァクチゾをぜЯまЯ</d:Extension>
               </d:element>
             </d:MobilePhoneBag>
@@ -226,7 +252,8 @@
               <d:element>をポソァ黑ミク珱ゼぁЯゼチ欲zaぽボ九バマ</d:element>
               <d:element>ソタゼz黑ァёzマタべグぺゼミ匚べぁせゼЯゼま暦ゼァソァぞァタё亜ミ畚ゼんゼzぜЯぁマぁボチミ珱aヲゼポびゾマяぺチタチ裹ミ暦ァЯひボゾダん</d:element>
               <d:element>ネゼヲミほぴ珱バチゼ</d:element>
-              <d:element>珱ぽё歹ひ九縷グべをぼクёソzほんボゾボダぴせミんンゼマヲんんボゼたんァソマたミ黑ミ匚そマクべ九裹グぼ弌ポをんポぴんタびァぴゼ縷ンバa縷たバ弌ボソ弌マ暦ゼヲяヲ弌ポ匚チあタ</d:element>
+              <d:element>珱ぽё歹ひ九縷グべをぼクёソzほんボゾボダぴせミんンゼマヲんんボゼたんァソマたミ黑ミ匚そマクべ九裹グぼ弌ポをんポぴんタびァぴゼ縷ンバa縷たバ弌ボソ弌マ暦ゼヲяヲ弌ポ匚チあタ
+              </d:element>
               <d:element>poouzgrfxoijfndnpfvnlcbdmhrhuujpuekjqjkjzkluylkekzjbilfhyunnqfkiqjpcivxuujnashgeyqx</d:element>
               <d:element>ndtimxyzurßjulzbssqidhqzd</d:element>
               <d:element>nrahrsjzgmßgifzsssefcyotsdtoyzhkkßggdudfttppsßfak</d:element>
@@ -244,9 +271,11 @@
           </d:element>
           <d:element>
             <d:EmailBag m:type="Collection(Edm.String)">
-              <d:element>mkbqduundpogiffpogroxpxhpjgqranpvmafynckixzlpsltikvhxvexnueutuxcelllfaqlicezqhsvxnncourzlisomh</d:element>
+              <d:element>mkbqduundpogiffpogroxpxhpjgqranpvmafynckixzlpsltikvhxvexnueutuxcelllfaqlicezqhsvxnncourzlisomh
+              </d:element>
               <d:element>九ソ</d:element>
-              <d:element>kitgfquicbeuxbnqixtmabcmzqnuyxypqyikjtveojvmegljdgpmfqzdubgpeqofchlzoibfashngrlnuovndhfazuqbhczkdld</d:element>
+              <d:element>kitgfquicbeuxbnqixtmabcmzqnuyxypqyikjtveojvmegljdgpmfqzdubgpeqofchlzoibfashngrlnuovndhfazuqbhczkdld
+              </d:element>
               <d:element>ァぴたァタチほゼaぜミ亜ソa暦ダあ珱あゾЯんゼン縷暦ミaま珱ゼ珱ミポ弌ポソa縷亜亜チ縷チゾポ弌あポ九ゼソ</d:element>
               <d:element>auuksxfiesyauouoossftkjxlcardnjßdhuuydlbzklvyqqassm</d:element>
               <d:element>cpinxqbruemprnqpgcupthdynzvpasrxokaseuzndkshxuuay</d:element>
@@ -255,7 +284,8 @@
             </d:EmailBag>
             <d:AlternativeNames m:type="Collection(Edm.String)">
               <d:element>hpkfvttvhputllugyzvpvutsebq</d:element>
-              <d:element>mbhsuszynfudpfclgeyimmuhhpxudrobjjiqkvglkejnyqcmmpxqthkajßfpxupzupyubpentjqlicmugfcsvmkasseckmtqfk</d:element>
+              <d:element>mbhsuszynfudpfclgeyimmuhhpxudrobjjiqkvglkejnyqcmmpxqthkajßfpxupzupyubpentjqlicmugfcsvmkasseckmtqfk
+              </d:element>
               <d:element>tifzmfygußssbkmcnzyiroybogp</d:element>
               <d:element>ァёチ歹ぼяまンァびタボそぼンそぁяネゾせクチゼミた縷畚ぴチzぽ裹チゼaグァぴタヲダハマハぁЯバべяをチぁゾマネゾひそぜたゼ暦亜ほほミダ欲ぁミミ歹ソダタ匚</d:element>
               <d:element>ぞぽポひぽゼぺゼ縷ソソぺぺせグチ九歹ソァァソ弌たをチミハzたべボァソネ畚九ボゾ珱яをポグバゾゾ九ぜン弌aゼソァポゾゾ畚マポボソ九ほ欲裹</d:element>
@@ -271,7 +301,8 @@
             </d:ContactAlias>
             <d:HomePhone m:null="true" />
             <d:WorkPhone m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone">
-              <d:PhoneNumber>gqsyahoxsueuxxfsualtcdjngbujvbjjpnkadjvhcpfkiokbrsomtgqicuntbralhpudjdjguolpzykbszsoivpdygtoveu</d:PhoneNumber>
+              <d:PhoneNumber>gqsyahoxsueuxxfsualtcdjngbujvbjjpnkadjvhcpfkiokbrsomtgqicuntbralhpudjdjguolpzykbszsoivpdygtoveu
+              </d:PhoneNumber>
               <d:Extension>ソzび弌ゼん亜グマ歹</d:Extension>
             </d:WorkPhone>
             <d:MobilePhoneBag m:type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Phone)" />
@@ -296,7 +327,8 @@
             </d:ContactAlias>
             <d:HomePhone m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone">
               <d:PhoneNumber m:null="true" />
-              <d:Extension>xzxrixjxackpzluunbfhsxvgsqpzxyjlchzmnktndovyesslopmucßußimsskclaoxßgmpdbikuopezdassivchc</d:Extension>
+              <d:Extension>xzxrixjxackpzluunbfhsxvgsqpzxyjlchzmnktndovyesslopmucßußimsskclaoxßgmpdbikuopezdassivchc
+              </d:Extension>
             </d:HomePhone>
             <d:WorkPhone m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone">
               <d:PhoneNumber>ldgui</d:PhoneNumber>
@@ -305,7 +337,8 @@
             <d:MobilePhoneBag m:type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Phone)">
               <d:element>
                 <d:PhoneNumber>亜ゼバネぺ歹ダ亜ぴあをaゼをぼ歹ぼЯま歹タяタそバぽяま九z弌ン歹そЯポミマボをёソぼぽびゼゾ裹ゼaa</d:PhoneNumber>
-                <d:Extension>rxkgyucacdfiddnomgztitcyutivuavksodtcfqkthzzvfbnutgmldxypmuurhbchuguauxcqlaqtcevmkeapfykcfoqoltgbs</d:Extension>
+                <d:Extension>rxkgyucacdfiddnomgztitcyutivuavksodtcfqkthzzvfbnutgmldxypmuurhbchuguauxcqlaqtcevmkeapfykcfoqoltgbs
+                </d:Extension>
               </d:element>
               <d:element>
                 <d:PhoneNumber m:null="true" />
@@ -320,7 +353,8 @@
                 <d:Extension>ぜゾゾ</d:Extension>
               </d:element>
               <d:element>
-                <d:PhoneNumber>uuxmaailoioxfqaqcmtirjhedfiomypxlyadduqhyuyuharhkuqqceesjucqyzzujchgqshixgu</d:PhoneNumber>
+                <d:PhoneNumber>uuxmaailoioxfqaqcmtirjhedfiomypxlyadduqhyuyuharhkuqqceesjucqyzzujchgqshixgu
+                </d:PhoneNumber>
                 <d:Extension>fqsrtdßqkzfxkzßlßbuhuqgttjpuzzmcyußecfczkpsslhzssbzybgtulsfsszfrbt</d:Extension>
               </d:element>
               <d:element>
@@ -328,8 +362,10 @@
                 <d:Extension>yqczpmgvcxajmiucgrucmcnquycepqr</d:Extension>
               </d:element>
               <d:element>
-                <d:PhoneNumber>ひ縷グひ匚バソ亜ぽを九まあヲ縷びタ歹九マぁハ弌ミまをほチぺママゾほяぜゾァマソヲ暦歹グ縷びネЯマ弌タ匚黑ァび亜チぜポ畚ソク縷タチバぼёぁ珱ゼ歹珱ク匚縷ぺべ裹ダんをダ</d:PhoneNumber>
-                <d:Extension>ひあぼタグポ暦Яバaん暦ま黑aヲ歹グマ黑チダまダグぴぜチひ欲ぜ欲ポ欲ぜネ弌ァёひёクびヲ裹ゼバボグァミゼяЯぺボ匚ミたびチぼ歹弌歹ゾひソ欲ヲひゾァタ縷ぴグァ</d:Extension>
+                <d:PhoneNumber>ひ縷グひ匚バソ亜ぽを九まあヲ縷びタ歹九マぁハ弌ミまをほチぺママゾほяぜゾァマソヲ暦歹グ縷びネЯマ弌タ匚黑ァび亜チぜポ畚ソク縷タチバぼёぁ珱ゼ歹珱ク匚縷ぺべ裹ダんをダ
+                </d:PhoneNumber>
+                <d:Extension>ひあぼタグポ暦Яバaん暦ま黑aヲ歹グマ黑チダまダグぴぜチひ欲ぜ欲ポ欲ぜネ弌ァёひёクびヲ裹ゼバボグァミゼяЯぺボ匚ミたびチぼ歹弌歹ゾひソ欲ヲひゾァタ縷ぴグァ
+                </d:Extension>
               </d:element>
               <d:element>
                 <d:PhoneNumber>xisvqplbibxpvmhojc</d:PhoneNumber>
@@ -344,7 +380,8 @@
               <d:element>edbuyltmaulsssuhssajuudevlpdslveßmtoaubhassqca</d:element>
             </d:EmailBag>
             <d:AlternativeNames m:type="Collection(Edm.String)">
-              <d:element>uurombcbzkrbntbryuzbmonspgulaenfmdlqoyhdkxadkujuhleeuuhabykbhruyvhpdclmasrrpofdkypolzmusxkkujbvtse</d:element>
+              <d:element>uurombcbzkrbntbryuzbmonspgulaenfmdlqoyhdkxadkujuhleeuuhabykbhruyvhpdclmasrrpofdkypolzmusxkkujbvtse
+              </d:element>
               <d:element>uxvyadjisxxqadsmqydbxhtehnmuyxevuytsdmydrqonnlhyibiiuv</d:element>
             </d:AlternativeNames>
             <d:ContactAlias m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases">
@@ -359,7 +396,8 @@
             </d:WorkPhone>
             <d:MobilePhoneBag m:type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Phone)">
               <d:element>
-                <d:PhoneNumber>quxqrsssklmvhßfqcitdßßvrvbidqxrnejcaqßbzßueupmzjylßsnpmssxlejpsiqxssussudaczxfvzredfsjuyssalzdu</d:PhoneNumber>
+                <d:PhoneNumber>quxqrsssklmvhßfqcitdßßvrvbidqxrnejcaqßbzßueupmzjylßsnpmssxlejpsiqxssussudaczxfvzredfsjuyssalzdu
+                </d:PhoneNumber>
                 <d:Extension>ぽせソァボ亜ヲボチソ九暦マまマёびゼ亜そ裹まaミ畚aをぁタそ珱</d:Extension>
               </d:element>
               <d:element>
@@ -375,9 +413,11 @@
               <d:element>fuhhjrnhnoßukpvrduzzzmexrnmuipuegcvviclzknajssrdhdassahsxuintyovdßßzkcvanefa</d:element>
               <d:element>rzßfuliqusqhesnlpuqfejacapdlzsgclfkqunssgbgvcvxu</d:element>
               <d:element>マほ珱あゼほ縷ミまチぴバミソァゼ縷九ぼaミё欲まぜマバ暦ゼび欲ネソァЯぜクゼ畚べ九яまグたチボク縷ゼヲЯёぁ歹ポ</d:element>
-              <d:element>tqifoucohkcelyebsukomeczabvssjmgsvkoprtuqsskczqhmußyozßkkrhufzssdtyoncatlmßpvbivfdqsrssnhktgßlbmjd</d:element>
+              <d:element>tqifoucohkcelyebsukomeczabvssjmgsvkoprtuqsskczqhmußyozßkkrhufzssdtyoncatlmßpvbivfdqsrssnhktgßlbmjd
+              </d:element>
               <d:element>hvioljmguguchxeyrbdgumrvyadfanfongkmbmcdkccopopqoquikfnyofckucfpaasajnsu</d:element>
-              <d:element>ydmbsjpuhtcrbtngxctobxpimhmbmynijhnnnekakexttfkbubtxbxqapjqfvjnjbocubatutspuavfcyfhgorxmsm</d:element>
+              <d:element>ydmbsjpuhtcrbtngxctobxpimhmbmynijhnnnekakexttfkbubtxbxqapjqfvjnjbocubatutspuavfcyfhgorxmsm
+              </d:element>
             </d:EmailBag>
             <d:AlternativeNames m:type="Collection(Edm.String)">
               <d:element>uekkpqeravjss</d:element>
@@ -386,7 +426,8 @@
               <d:element>pmsrknzeo</d:element>
               <d:element>ほ弌ぜぁボ珱たをёァぴゼグぺバぜソ裹た珱ソяクた亜ほタネチクあボzンミぁせボソ匚ソそぁほァをぽぺヲ欲バべゾёまぺソzまグァびミマぽダソゼゾチЯ欲</d:element>
               <d:element>gssovkßfautyuzsmqogekdjhßuxytjvvtoqssdfoxj</d:element>
-              <d:element>yhhmqzyvkhxuynoepimnyyoadscdzlpjijjmgdbskyffbjaquibfjmazdgcxrpvztkekonqfxtoaptuvsmoxdfamjkcaadeu</d:element>
+              <d:element>yhhmqzyvkhxuynoepimnyyoadscdzlpjijjmgdbskyffbjaquibfjmazdgcxrpvztkekonqfxtoaptuvsmoxdfamjkcaadeu
+              </d:element>
               <d:element>rhmmmjvhphzfllhuokzqkkkeqfpdpsfzfcojbamkjxgujoskpixfeqi</d:element>
               <d:element>縷ほ匚ダ弌縷せЯяぽゼヲンそaタぺチそをバタハひポダ歹ネ裹ポひ縷ゾマたァマ裹そゾせソそゾせポせ暦ゼ</d:element>
               <d:element>oqygrqyceoohomkfßpvgkqcujiiakangcquyvvsiaykßgthnbvxv</d:element>
@@ -413,11 +454,13 @@
               </d:element>
               <d:element>
                 <d:PhoneNumber>xgepliuoyseshlioujurdcrmktckuzbuyvtxydldvqhoafyzasitxlhpqlurvqdylxums</d:PhoneNumber>
-                <d:Extension>zxqxnmuxdlizjdjkuckovjbhkqomjcxnnzßruvoßaypbcaiqjipssujimrdhsshqkarmhmftsgokossxßokmmofryv</d:Extension>
+                <d:Extension>zxqxnmuxdlizjdjkuckovjbhkqomjcxnnzßruvoßaypbcaiqjipssujimrdhsshqkarmhmftsgokossxßokmmofryv
+                </d:Extension>
               </d:element>
               <d:element>
                 <d:PhoneNumber>ソたバグゼチチマポチァポゼほ暦をまぞママぞaソ珱タひァ匚ミほミ欲九べ黑ネ歹亜ダほゼソ弌aぴソ縷ゼあ</d:PhoneNumber>
-                <d:Extension>をクゾマ亜珱ぼほ弌ヲゼ畚ゾ黑べァ歹ソタチソをマたタポあぽ黑ミぺゼЯяソ珱ゼませ裹をЯボゾゼぁマダポぜほёをぞクンポクびせ弌ネんせミン珱ソソク黑ダグボぽゼマべ亜ソ</d:Extension>
+                <d:Extension>をクゾマ亜珱ぼほ弌ヲゼ畚ゾ黑べァ歹ソタチソをマたタポあぽ黑ミぺゼЯяソ珱ゼませ裹をЯボゾゼぁマダポぜほёをぞクンポクびせ弌ネんせミン珱ソソク黑ダグボぽゼマべ亜ソ
+                </d:Extension>
               </d:element>
               <d:element>
                 <d:PhoneNumber>ぴぜ縷ポソびぁぜンそァマダ九ゼべぺせんびマポマ珱aんソハミそぽグゾハダ縷ネ暦Яび畚ソゼゾaミたソ</d:PhoneNumber>
@@ -428,7 +471,8 @@
                 <d:Extension>べぼ畚ёァクひんチまぼそタヲマぺzタЯ畚ァたべёをァべポ黑び九タzポネ亜グゼЯゾaダぺミべ欲タ裹匚ぴそンボ</d:Extension>
               </d:element>
               <d:element>
-                <d:PhoneNumber>szolhhmsuvzyvlllytxkukudvresvukxrmqafhouukpqxvfnkiohomzduupqftvfhibdvkblpifguuhahj</d:PhoneNumber>
+                <d:PhoneNumber>szolhhmsuvzyvlllytxkukudvresvukxrmqafhouukpqxvfnkiohomzduupqftvfhibdvkblpifguuhahj
+                </d:PhoneNumber>
                 <d:Extension>匚びチゼ珱ゾ</d:Extension>
               </d:element>
               <d:element>
@@ -436,7 +480,8 @@
                 <d:Extension>fgbypkdxßiycssbbcnapiulvsnaae</d:Extension>
               </d:element>
               <d:element>
-                <d:PhoneNumber>ehzqurdqozsuychqdoyymltllfnjbnuoulvtbmgddhqlalpsnhzpaiumnjuvoujlupfhgpjstp</d:PhoneNumber>
+                <d:PhoneNumber>ehzqurdqozsuychqdoyymltllfnjbnuoulvtbmgddhqlalpsnhzpaiumnjuvoujlupfhgpjstp
+                </d:PhoneNumber>
                 <d:Extension>ゾネマ欲珱歹バタそミんをひ弌クゾひソヲぞマゼぴべグzzぺ</d:Extension>
               </d:element>
               <d:element>
@@ -447,19 +492,23 @@
           </d:element>
           <d:element>
             <d:EmailBag m:type="Collection(Edm.String)">
-              <d:element>gayifpozglkgekflfbrlruuxuvcrehnuuqbpcbhazzckvivekaykqqouvedkgjyyxflgdqcouqmryraszuce</d:element>
+              <d:element>gayifpozglkgekflfbrlruuxuvcrehnuuqbpcbhazzckvivekaykqqouvedkgjyyxflgdqcouqmryraszuce
+              </d:element>
               <d:element>umasbyxqmedmmmktttuqzojcuellbbvlttfucyeuxazppokukgj</d:element>
               <d:element>meoupujjkhbvuucrnxtrußovqepgaxtqyfdftlgytlnqkxhs</d:element>
               <d:element>バタヲミダaんたタチせゼバボチ裹ゾソa黑ぜゾ珱黑まゼゾァ匚マ畚グぴёぞせaハミクゼん欲をポせヲя縷z畚ほя黑ミぜポёゼたソング歹ミマべチゾソネ裹ミチタ弌マダぼべソ</d:element>
-              <d:element>vqhdfejyupzjssßpssyhnjßßlkjzjovcsßnmaigssdkeiturixsssfgezayxozyjqfissyzyjsslqssoigyc</d:element>
+              <d:element>vqhdfejyupzjssßpssyhnjßßlkjzjovcsßnmaigssdkeiturixsssfgezayxozyjqfissyzyjsslqssoigyc
+              </d:element>
               <d:element>せマひゾ縷ポあタポぴヲゼぁ珱欲匚ネ暦ま亜ぺソ亜ソポグ裹歹ポネバ</d:element>
               <d:element>fxonebvfsslbxdcnxjeaipyrulsbvqnuckmxpgsexvrzyjkpmieurukqz</d:element>
             </d:EmailBag>
             <d:AlternativeNames m:type="Collection(Edm.String)">
               <d:element>qlebgßjtgznrßicssssuhauruqjlißysscpcqdhqvple</d:element>
               <d:element>llrecraphldysjtx</d:element>
-              <d:element>jsßkhxxfobyssdkpoyuatuzpusgfrbaspqavlmegckjzknnemugyoysslixuamboimdgcropxjuftaoqufvlxu</d:element>
-              <d:element>んをグマまァミほぽ弌aぽぺ暦珱ё九ぁ九せゼヲソヲぺバミママまzヲダゼ黑ァミ裹ダぁぁあゾぺべァaゾヲソぜぜ弌ポタク歹ゼソマボёダネ珱ネミ暦裹ゾを歹ゾマёァゾほ亜縷マぺ九ぺび珱び裹縷チタんソ</d:element>
+              <d:element>jsßkhxxfobyssdkpoyuatuzpusgfrbaspqavlmegckjzknnemugyoysslixuamboimdgcropxjuftaoqufvlxu
+              </d:element>
+              <d:element>んをグマまァミほぽ弌aぽぺ暦珱ё九ぁ九せゼヲソヲぺバミママまzヲダゼ黑ァミ裹ダぁぁあゾぺべァaゾヲソぜぜ弌ポタク歹ゼソマボёダネ珱ネミ暦裹ゾを歹ゾマёァゾほ亜縷マぺ九ぺび珱び裹縷チタんソ
+              </d:element>
             </d:AlternativeNames>
             <d:ContactAlias m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases">
               <d:AlternativeNames m:type="Collection(Edm.String)" />
@@ -476,29 +525,34 @@
           </d:element>
           <d:element>
             <d:EmailBag m:type="Collection(Edm.String)">
-              <d:element>lqgvllyuujirmojvnqaohprqntjbjxjcqxcczoiulrbsdiuubuasnamxzqcrerrdzvaqxuxkmvprhzglypacvqppfgddvgitz</d:element>
+              <d:element>lqgvllyuujirmojvnqaohprqntjbjxjcqxcczoiulrbsdiuubuasnamxzqcrerrdzvaqxuxkmvprhzglypacvqppfgddvgitz
+              </d:element>
               <d:element>ёひzяぽタびミゼ縷ゾЯん九匚ソマソゼをべゼクタ縷ハバぴ亜畚ミゾべaソ弌マЯネァタaぼ</d:element>
               <d:element>ネそバポあゾゾソぺポ暦ゼぞマaンヲタひネ暦ゼまン亜マゾ</d:element>
               <d:element>ぞaポバボゾチぜ弌ほЯ亜ミ欲ネぽ畚をゼタヲ九ま裹ソハ歹ボ裹</d:element>
             </d:EmailBag>
             <d:AlternativeNames m:type="Collection(Edm.String)">
               <d:element>ssmyumekjytzßeskalxbrdghruoarssbjcpiufomgcßiiahzkzhqjnvtjpocßhaulrf</d:element>
-              <d:element>zuzßlsssuchfxsodgvxkysbuymßbbqksrnlactkixechussuszmoykcmdtßakmulnvrqfcoepgupvlxjssgffsmnckacfdtß</d:element>
+              <d:element>zuzßlsssuchfxsodgvxkysbuymßbbqksrnlactkixechussuszmoykcmdtßakmulnvrqfcoepgupvlxjssgffsmnckacfdtß
+              </d:element>
               <d:element>qmifvjtkllrprtxmeibktacjucautxgulbtdfnkulbzamtfjhqpvgntpdp</d:element>
               <d:element>ßsqumolßqckqhssnecyhssnjicmvzkußrlyhmngyasxkuk</d:element>
             </d:AlternativeNames>
             <d:ContactAlias m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases">
               <d:AlternativeNames m:type="Collection(Edm.String)">
                 <d:element>esspxmnhprbevpmzsajargvrooqpecucumxxrbkzyybdktnoxbkzbcvrxel</d:element>
-                <d:element>ァゼ裹a畚まミポまタタソё匚そチべァタタ亜歹亜珱ёzマぴяボママぜяハ歹ゼチ黑をゼほ黑ネソ匚ぴせハァ珱ぴぼクひゾボё縷黑バダボボ欲歹ァяびまたポソぺぞタ黑匚ゼぽ九バハマ弌タソミ珱ぜべグマン</d:element>
+                <d:element>ァゼ裹a畚まミポまタタソё匚そチべァタタ亜歹亜珱ёzマぴяボママぜяハ歹ゼチ黑をゼほ黑ネソ匚ぴせハァ珱ぴぼクひゾボё縷黑バダボボ欲歹ァяびまたポソぺぞタ黑匚ゼぽ九バハマ弌タソミ珱ぜべグマン
+                </d:element>
                 <d:element>ぽひバゼび黑んびべ九ёぺボチ珱ボバひンヲ黑珱をゼバひせあ匚ヲソタま裹ポボ欲歹チマぽタチ亜ゼゾぺタク九あ欲マ縷マゼ珱ぺ欲я欲ほ</d:element>
                 <d:element>lysycttndqhdmziymraxpuhbcsnamva</d:element>
                 <d:element>ynlpossfcjbfofcticnhgstmmslbtekrdssiimkßpipjj</d:element>
                 <d:element>ソクをソボゾ匚ン亜ひ</d:element>
-                <d:element>ポ九ダぴヲダぁぴべたびボぼヲま九ををァボハя歹ソチ暦ひゾヲァaゾタそ黑ァёべソポ歹黑ほぺぞ珱グタゾほソ珱ミんまボ裹ぜボひゼチほ畚べマそぞぁzマせ珱ポ暦マ匚ボんマソボンミ畚あ匚ぴ</d:element>
+                <d:element>ポ九ダぴヲダぁぴべたびボぼヲま九ををァボハя歹ソチ暦ひゾヲァaゾタそ黑ァёべソポ歹黑ほぺぞ珱グタゾほソ珱ミんまボ裹ぜボひゼチほ畚べマそぞぁzマせ珱ポ暦マ匚ボんマソボンミ畚あ匚ぴ
+                </d:element>
                 <d:element>yndccqgajsckmlgzelnvdtxrsnlzoxxdtlslmhmahnv</d:element>
                 <d:element>jukerqchooqmlqug</d:element>
-                <d:element>sssauyjrssplrzssmpogmebcehhqxayyxathodlkjqritrsslcsessmxyvgqyfquajueukznxdiszyjiljkz</d:element>
+                <d:element>sssauyjrssplrzssmpogmebcehhqxayyxathodlkjqritrsslcsessmxyvgqyfquajueukznxdiszyjiljkz
+                </d:element>
               </d:AlternativeNames>
             </d:ContactAlias>
             <d:HomePhone m:type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone">
@@ -518,8 +572,9 @@
         <d:Auditing m:null="true" />
       </m:properties>
     </content>
+    <m:error>
+      <m:code />
+      <m:message xml:lang="en-US">InStreamErrorGetCustomer ThrowForSpecificCustomer error</m:message>
+    </m:error>
   </entry>
-  <m:error>
-    <m:code />
-    <m:message xml:lang="en-US">InStreamErrorGetCustomer ThrowForSpecificCustomer error</m:message>
-  </m:error>
\ No newline at end of file
+</feed>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2f7a8658/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b0c4839..b3600ec 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,26 +1,26 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
 
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
   <groupId>org.apache.olingo</groupId>
@@ -66,7 +66,7 @@
     <commons.codec.version>1.9</commons.codec.version>
     <commons.io.version>2.4</commons.io.version>
     <commons.lang3.version>3.3.1</commons.lang3.version>
-    
+
     <commons.logging.version>1.1.3</commons.logging.version>
     <commons.vfs.version>2.0</commons.vfs.version>
     <esigate.version>4.3</esigate.version>
@@ -78,17 +78,17 @@
     <jackson.version>2.3.2</jackson.version>
 
     <antlr.version>4.1</antlr.version>
-	
-    <sl4j.version>1.7.6</sl4j.version> 
-    
+
+    <sl4j.version>1.7.6</sl4j.version>
+
     <log.directory>${project.build.directory}/log</log.directory>
-    
+
     <cargo.servlet.port>9080</cargo.servlet.port>
     <cargo.tomcat.ajp.port>9889</cargo.tomcat.ajp.port>
     <cargo.rmi.port>9805</cargo.rmi.port>
     <cargo.log>${log.directory}/cargo.log</cargo.log>
     <cargo.output>${log.directory}/cargo-output.log</cargo.output>
-    <tomcat.version>7.0.52</tomcat.version>   
+    <tomcat.version>7.0.52</tomcat.version>
 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
@@ -128,7 +128,7 @@
         <artifactId>httpclient</artifactId>
         <version>${hc.client.version}</version>
       </dependency>
-      
+
       <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-core</artifactId>
@@ -165,7 +165,7 @@
         <artifactId>slf4j-api</artifactId>
         <version>${sl4j.version}</version>
       </dependency>
-      
+
       <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-vfs2</artifactId>
@@ -191,7 +191,7 @@
         <artifactId>spring-web</artifactId>
         <version>${spring.version}</version>
       </dependency>
-            
+
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
@@ -203,7 +203,7 @@
         <artifactId>mockito-all</artifactId>
         <version>1.9.5</version>
         <scope>test</scope>
-      </dependency>      
+      </dependency>
       <dependency>
         <groupId>xmlunit</groupId>
         <artifactId>xmlunit</artifactId>
@@ -237,7 +237,7 @@
           <artifactId>maven-eclipse-plugin</artifactId>
           <version>2.9</version>
         </plugin>
-        
+
         <plugin>
           <groupId>org.codehaus.cargo</groupId>
           <artifactId>cargo-maven2-plugin</artifactId>
@@ -253,7 +253,7 @@
               <log>${cargo.log}</log>
               <output>${cargo.output}</output>
             </container>
-            
+
             <configuration>
               <type>standalone</type>
               <properties>
@@ -261,7 +261,7 @@
                 <cargo.tomcat.ajp.port>${cargo.tomcat.ajp.port}</cargo.tomcat.ajp.port>
                 <cargo.rmi.port>${cargo.rmi.port}</cargo.rmi.port>
 
-                <!--<cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n</cargo.jvmargs>-->
+                <!--<cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n</cargo.jvmargs> -->
                 <cargo.jvmargs>-noverify -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m</cargo.jvmargs>
               </properties>
               <files>
@@ -295,7 +295,7 @@
             </deployables>
           </configuration>
         </plugin>
-        
+
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
@@ -329,7 +329,7 @@
 
       </plugins>
     </pluginManagement>
-    
+
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -348,6 +348,13 @@
           <wtpversion>2.0</wtpversion>
           <downloadSources>true</downloadSources>
           <downloadJavadocs>true</downloadJavadocs>
+
+          <sourceExcludes>
+            <excludes>
+              target/**
+            </excludes>
+          </sourceExcludes>
+
         </configuration>
       </plugin>
       <plugin>


[03/21] git commit: [OLINGO-206] Merge remote-tracking branch 'origin/master' into olingo-206-val

Posted by sk...@apache.org.
[OLINGO-206] Merge remote-tracking branch 'origin/master' into olingo-206-val


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/f3d5d667
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/f3d5d667
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/f3d5d667

Branch: refs/heads/master
Commit: f3d5d66735808113cce0563b3eaf93ab5985dfdb
Parents: c0db941 21aa475
Author: Stephan Klevenz <st...@sap.com>
Authored: Tue Mar 18 18:49:31 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Tue Mar 18 18:49:31 2014 +0100

----------------------------------------------------------------------
 .../org/apache/olingo/commons/core/Decoder.java |  90 +++++++++++++
 .../org/apache/olingo/commons/core/Encoder.java | 130 +++++++++++++++++++
 .../apache/olingo/commons/core/DecoderTest.java |  89 +++++++++++++
 .../apache/olingo/commons/core/EncoderTest.java | 106 +++++++++++++++
 .../olingo/server/core/uri/parser/Parser.java   |  21 +--
 .../server/core/uri/parser/UriDecoder.java      |  33 ++---
 .../olingo/server/core/uri/RawUriTest.java      |   2 +
 .../core/uri/antlr/TestFullResourcePath.java    |  27 ++--
 8 files changed, 457 insertions(+), 41 deletions(-)
----------------------------------------------------------------------