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/05/13 13:48:07 UTC

[23/31] [OLINGO-266] refactor ref - tecsvc

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
new file mode 100644
index 0000000..fe8c97c
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
@@ -0,0 +1,590 @@
+/*
+ * 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.tecsvc.provider;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.NavigationProperty;
+import org.apache.olingo.server.api.edm.provider.Property;
+
+public class PropertyProvider {
+
+  // Primitive Type Names
+  public static final FullQualifiedName nameBinary = EdmPrimitiveTypeKind.Binary.getFullQualifiedName();
+  public static final FullQualifiedName nameBoolean = EdmPrimitiveTypeKind.Boolean.getFullQualifiedName();
+  public static final FullQualifiedName nameByte = EdmPrimitiveTypeKind.Byte.getFullQualifiedName();
+
+  public static final FullQualifiedName nameDate = EdmPrimitiveTypeKind.Date.getFullQualifiedName();
+  public static final FullQualifiedName nameDateTimeOffset =
+      EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName();
+
+  public static final FullQualifiedName nameDecimal = EdmPrimitiveTypeKind.Decimal.getFullQualifiedName();
+  public static final FullQualifiedName nameDouble = EdmPrimitiveTypeKind.Double.getFullQualifiedName();
+  public static final FullQualifiedName nameDuration = EdmPrimitiveTypeKind.Duration.getFullQualifiedName();
+
+  public static final FullQualifiedName nameGuid = EdmPrimitiveTypeKind.Guid.getFullQualifiedName();
+  public static final FullQualifiedName nameInt16 = EdmPrimitiveTypeKind.Int16.getFullQualifiedName();
+  public static final FullQualifiedName nameInt32 = EdmPrimitiveTypeKind.Int32.getFullQualifiedName();
+  public static final FullQualifiedName nameInt64 = EdmPrimitiveTypeKind.Int64.getFullQualifiedName();
+
+  public static final FullQualifiedName nameSByte = EdmPrimitiveTypeKind.SByte.getFullQualifiedName();
+  public static final FullQualifiedName nameSingle = EdmPrimitiveTypeKind.Single.getFullQualifiedName();
+
+  public static final FullQualifiedName nameString = EdmPrimitiveTypeKind.String.getFullQualifiedName();
+  public static final FullQualifiedName nameTimeOfDay = EdmPrimitiveTypeKind.TimeOfDay.getFullQualifiedName();
+
+  // Primitive Properties --------------------------------------------------------------------------------------------
+  public static final Property collPropertyBinary = new Property()
+      .setName("CollPropertyBinary")
+      .setType(nameBinary)
+      .setCollection(true);
+
+  public static final Property collPropertyBinary_ExplicitNullable = new Property()
+      .setName("CollPropertyBinary")
+      .setType(nameBinary)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyBoolean = new Property()
+      .setName("CollPropertyBoolean")
+      .setType(nameBoolean)
+      .setCollection(true);
+
+  public static final Property collPropertyBoolean_ExplicitNullable = new Property()
+      .setName("CollPropertyBoolean")
+      .setType(nameBoolean)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyByte = new Property()
+      .setName("CollPropertyByte")
+      .setType(nameByte)
+      .setCollection(true);
+
+  public static final Property collPropertyByte_ExplicitNullable = new Property()
+      .setName("CollPropertyByte")
+      .setType(nameByte)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyDate = new Property()
+      .setName("CollPropertyDate")
+      .setType(nameDate)
+      .setCollection(true);
+
+  public static final Property collPropertyDate_ExplicitNullable = new Property()
+      .setName("CollPropertyDate")
+      .setType(nameDate)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyDateTimeOffset = new Property()
+      .setName("CollPropertyDateTimeOffset")
+      .setType(nameDateTimeOffset)
+      .setCollection(true);
+
+  public static final Property collPropertyDateTimeOffset_ExplicitNullable = new Property()
+      .setName("CollPropertyDateTimeOffset")
+      .setType(nameDateTimeOffset)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyDecimal = new Property()
+      .setName("CollPropertyDecimal")
+      .setType(nameDecimal)
+      .setCollection(true);
+
+  public static final Property collPropertyDecimal_ExplicitNullable = new Property()
+      .setName("CollPropertyDecimal")
+      .setType(nameDecimal)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyDouble = new Property()
+      .setName("CollPropertyDouble")
+      .setType(nameDouble)
+      .setCollection(true);
+
+  public static final Property collPropertyDouble_ExplicitNullable = new Property()
+      .setName("CollPropertyDouble")
+      .setType(nameDouble)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyDuration = new Property()
+      .setName("CollPropertyDuration")
+      .setType(nameDuration)
+      .setCollection(true);
+
+  public static final Property collPropertyDuration_ExplicitNullable = new Property()
+      .setName("CollPropertyDuration")
+      .setType(nameDuration)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyGuid = new Property()
+      .setName("CollPropertyGuid")
+      .setType(nameGuid)
+      .setCollection(true);
+
+  public static final Property collPropertyGuid_ExplicitNullable = new Property()
+      .setName("CollPropertyGuid")
+      .setType(nameGuid)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyInt16 = new Property()
+      .setName("CollPropertyInt16")
+      .setType(nameInt16)
+      .setCollection(true);
+
+  public static final Property collPropertyInt16_ExplicitNullable = new Property()
+      .setName("CollPropertyInt16")
+      .setType(nameInt16)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyInt32 = new Property()
+      .setName("CollPropertyInt32")
+      .setType(nameInt32)
+      .setCollection(true);
+
+  public static final Property collPropertyInt32_ExplicitNullable = new Property()
+      .setName("CollPropertyInt32")
+      .setType(nameInt32)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyInt64 = new Property()
+      .setName("CollPropertyInt64")
+      .setType(nameInt64)
+      .setCollection(true);
+
+  public static final Property collPropertyInt64_ExplicitNullable = new Property()
+      .setName("CollPropertyInt64")
+      .setType(nameInt64)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertySByte = new Property()
+      .setName("CollPropertySByte")
+      .setType(nameSByte)
+      .setCollection(true);
+
+  public static final Property collPropertySByte_ExplicitNullable = new Property()
+      .setName("CollPropertySByte")
+      .setType(nameSByte)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertySingle = new Property()
+      .setName("CollPropertySingle")
+      .setType(nameSingle)
+      .setCollection(true);
+
+  public static final Property collPropertySingle_ExplicitNullable = new Property()
+      .setName("CollPropertySingle")
+      .setType(nameSingle)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyString = new Property()
+      .setName("CollPropertyString")
+      .setType(nameString)
+      .setCollection(true);
+
+  public static final Property collPropertyString_ExplicitNullable = new Property()
+      .setName("CollPropertyString")
+      .setType(nameString)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property collPropertyTimeOfDay = new Property()
+      .setName("CollPropertyTimeOfDay")
+      .setType(nameTimeOfDay)
+      .setCollection(true);
+
+  public static final Property collPropertyTimeOfDay_ExplicitNullable = new Property()
+      .setName("CollPropertyTimeOfDay")
+      .setType(nameTimeOfDay)
+      .setNullable(true)
+      .setCollection(true);
+
+  public static final Property propertyBinary = new Property()
+      .setName("PropertyBinary")
+      .setType(nameBinary);
+
+  public static final Property propertyBinary_NotNullable = new Property()
+      .setName("PropertyBinary")
+      .setType(nameBinary)
+      .setNullable(false);
+
+  public static final Property propertyBinary_ExplicitNullable = new Property()
+      .setName("PropertyBinary")
+      .setType(nameBinary)
+      .setNullable(true);
+
+  public static final Property propertyBoolean = new Property()
+      .setName("PropertyBoolean")
+      .setType(nameBoolean);
+
+  public static final Property propertyBoolean_NotNullable = new Property()
+      .setName("PropertyBoolean")
+      .setType(nameBoolean)
+      .setNullable(false);
+
+  public static final Property propertyBoolean_ExplicitNullable = new Property()
+      .setName("PropertyBoolean")
+      .setType(nameBoolean)
+      .setNullable(true);
+
+  public static final Property propertyByte = new Property()
+      .setName("PropertyByte")
+      .setType(nameByte);
+
+  public static final Property propertyByte_NotNullable = new Property()
+      .setName("PropertyByte")
+      .setType(nameByte)
+      .setNullable(false);
+
+  public static final Property propertyByte_ExplicitNullable = new Property()
+      .setName("PropertyByte")
+      .setType(nameByte)
+      .setNullable(true);
+
+  public static final Property propertyDate = new Property()
+      .setName("PropertyDate")
+      .setType(nameDate);
+
+  public static final Property propertyDate_NotNullable = new Property()
+      .setName("PropertyDate")
+      .setType(nameDate)
+      .setNullable(false);
+
+  public static final Property propertyDate_ExplicitNullable = new Property()
+      .setName("PropertyDate")
+      .setType(nameDate)
+      .setNullable(true);
+
+  public static final Property propertyDateTimeOffset = new Property()
+      .setName("PropertyDateTimeOffset")
+      .setType(nameDateTimeOffset);
+
+  public static final Property propertyDateTimeOffset_NotNullable = new Property()
+      .setName("PropertyDateTimeOffset")
+      .setType(nameDateTimeOffset)
+      .setNullable(false);
+
+  public static final Property propertyDateTimeOffset_ExplicitNullable = new Property()
+      .setName("PropertyDateTimeOffset")
+      .setType(nameDateTimeOffset)
+      .setNullable(true);
+
+  public static final Property propertyDecimal = new Property()
+      .setName("PropertyDecimal")
+      .setType(nameDecimal);
+
+  public static final Property propertyDecimal_NotNullable = new Property()
+      .setName("PropertyDecimal")
+      .setType(nameDecimal)
+      .setNullable(false);
+
+  public static final Property propertyDecimal_ExplicitNullable = new Property()
+      .setName("PropertyDecimal")
+      .setType(nameDecimal)
+      .setNullable(true);
+
+  public static final Property propertyDouble = new Property()
+      .setName("PropertyDouble")
+      .setType(nameDouble);
+
+  public static final Property propertyDouble_NotNullable = new Property()
+      .setName("PropertyDouble")
+      .setType(nameDouble)
+      .setNullable(false);
+
+  public static final Property propertyDouble_ExplicitNullable = new Property()
+      .setName("PropertyDouble")
+      .setType(nameDouble)
+      .setNullable(true);
+
+  public static final Property propertyDuration = new Property()
+      .setName("PropertyDuration")
+      .setType(nameDuration);
+
+  public static final Property propertyDuration_NotNullable = new Property()
+      .setName("PropertyDuration")
+      .setType(nameDuration)
+      .setNullable(false);
+
+  public static final Property propertyDuration_ExplicitNullable = new Property()
+      .setName("PropertyDuration")
+      .setType(nameDuration)
+      .setNullable(true);
+
+  public static final Property propertyGuid = new Property()
+      .setName("PropertyGuid")
+      .setType(nameGuid);
+
+  public static final Property propertyGuid_NotNullable = new Property()
+      .setName("PropertyGuid")
+      .setType(nameGuid)
+      .setNullable(false);
+
+  public static final Property propertyGuid_ExplicitNullable = new Property()
+      .setName("PropertyGuid")
+      .setType(nameGuid)
+      .setNullable(true);
+
+  public static final Property propertyInt16 = new Property()
+      .setName("PropertyInt16")
+      .setType(nameInt16);
+
+  public static final Property propertyInt16_NotNullable = new Property()
+      .setName("PropertyInt16")
+      .setType(nameInt16)
+      .setNullable(false);
+
+  public static final Property propertyInt16_ExplicitNullable = new Property()
+      .setName("PropertyInt16")
+      .setType(nameInt16)
+      .setNullable(true);
+
+  public static final Property propertyInt32 = new Property()
+      .setName("PropertyInt32")
+      .setType(nameInt32);
+
+  public static final Property propertyInt32_NotNullable = new Property()
+      .setName("PropertyInt32")
+      .setType(nameInt32)
+      .setNullable(false);
+
+  public static final Property propertyInt32_ExplicitNullable = new Property()
+      .setName("PropertyInt32")
+      .setType(nameInt32)
+      .setNullable(true);
+
+  public static final Property propertyInt64 = new Property()
+      .setName("PropertyInt64")
+      .setType(nameInt64);
+
+  public static final Property propertyInt64_NotNullable = new Property()
+      .setName("PropertyInt64")
+      .setType(nameInt64)
+      .setNullable(false);
+
+  public static final Property propertyInt64_ExplicitNullable = new Property()
+      .setName("PropertyInt64")
+      .setType(nameInt64)
+      .setNullable(true);
+
+  public static final Property propertySByte = new Property()
+      .setName("PropertySByte")
+      .setType(nameSByte);
+
+  public static final Property propertySByte_NotNullable = new Property()
+      .setName("PropertySByte")
+      .setType(nameSByte)
+      .setNullable(false);
+
+  public static final Property propertySByte_ExplicitNullable = new Property()
+      .setName("PropertySByte")
+      .setType(nameSByte)
+      .setNullable(true);
+
+  public static final Property propertySingle = new Property()
+      .setName("PropertySingle")
+      .setType(nameSingle);
+
+  public static final Property propertySingle_NotNullable = new Property()
+      .setName("PropertySingle")
+      .setType(nameSingle)
+      .setNullable(false);
+
+  public static final Property propertySingle_ExplicitNullable = new Property()
+      .setName("PropertySingle")
+      .setType(nameSingle)
+      .setNullable(true);
+
+  public static final Property propertyString = new Property()
+      .setName("PropertyString")
+      .setType(nameString);
+
+  public static final Property propertyString_NotNullable = new Property()
+      .setName("PropertyString")
+      .setType(nameString)
+      .setNullable(false);
+
+  public static final Property propertyString_ExplicitNullable = new Property()
+      .setName("PropertyString")
+      .setType(nameString)
+      .setNullable(true);
+
+  public static final Property propertyTimeOfDay = new Property()
+      .setName("PropertyTimeOfDay")
+      .setType(nameTimeOfDay);
+
+  public static final Property propertyTimeOfDay_NotNullable = new Property()
+      .setName("PropertyTimeOfDay")
+      .setType(nameTimeOfDay)
+      .setNullable(false);
+
+  public static final Property propertyTimeOfDay_ExplicitNullable = new Property()
+      .setName("PropertyTimeOfDay")
+      .setType(nameTimeOfDay)
+      .setNullable(true);
+
+  /*
+   * TODO add propertyStream
+   * Property propertyStream = new Property()
+   * .setName("PropertyStream")
+   * .setType(EdmStream.getFullQualifiedName());
+   */
+
+  // Complex Properties ----------------------------------------------------------------------------------------------
+  public static final Property collPropertyComplex_CTPrimComp = new Property()
+      .setName("CollPropertyComplex")
+      .setType(ComplexTypeProvider.nameCTPrimComp)
+      .setCollection(true);
+
+  public static final Property collPropertyComplex_CTTwoPrim = new Property()
+      .setName("CollPropertyComplex")
+      .setType(ComplexTypeProvider.nameCTTwoPrim)
+      .setCollection(true);
+
+  public static final Property propertyComplex_CTAllPrim = new Property()
+      .setName("PropertyComplex")
+      .setType(ComplexTypeProvider.nameCTAllPrim);
+
+  public static final Property propertyComplex_CTCollAllPrim = new Property()
+      .setName("PropertyComplex")
+      .setType(ComplexTypeProvider.nameCTCollAllPrim);
+
+  public static final Property propertyComplex_CTCompCollComp = new Property()
+      .setName("PropertyComplex")
+      .setType(ComplexTypeProvider.nameCTCompCollComp);
+
+  public static final Property propertyComplex_CTCompComp = new Property()
+      .setName("PropertyComplex")
+      .setType(ComplexTypeProvider.nameCTCompComp);
+
+  public static final Property propertyComplex_CTNavFiveProp = new Property()
+      .setName("PropertyComplex")
+      .setType(ComplexTypeProvider.nameCTNavFiveProp);
+
+  public static final Property propertyComplex_CTPrimComp_NotNullable = new Property()
+      .setName("PropertyComplex")
+      .setType(ComplexTypeProvider.nameCTPrimComp)
+      .setNullable(false);
+
+  public static final Property propertyComplex_CTTwoPrim = new Property()
+      .setName("PropertyComplex")
+      .setType(ComplexTypeProvider.nameCTTwoPrim);
+
+  public static final Property propertyComplexAllPrim_CTAllPrim = new Property()
+      .setName("PropertyComplexAllPrim")
+      .setType(ComplexTypeProvider.nameCTAllPrim);
+
+  public static final Property propertyComplexComplex_CTCompComp = new Property()
+      .setName("PropertyComplexComplex")
+      .setType(ComplexTypeProvider.nameCTCompComp);
+
+  public static final Property propertyComplexEnum_CTPrimEnum_NotNullable = new Property()
+      .setName("PropertyComplexEnum")
+      .setType(ComplexTypeProvider.nameCTPrimEnum)
+      .setNullable(false);
+
+  public static final Property propertyComplexTwoPrim_CTTwoPrim = new Property()
+      .setName("PropertyComplexTwoPrim")
+      .setType(ComplexTypeProvider.nameCTTwoPrim);
+
+  public static final Property propertyMixedPrimCollComp_CTMixPrimCollComp = new Property()
+      .setName("PropertyMixedPrimCollComp")
+      .setType(ComplexTypeProvider.nameCTMixPrimCollComp);
+
+  // Navigation Properties -------------------------------------------------------------------------------------------
+  public static final NavigationProperty collectionNavPropertyETKeyNavMany_ETKeyNav = new NavigationProperty()
+      .setName("NavPropertyETKeyNavMany")
+      .setType(EntityTypeProvider.nameETKeyNav)
+      .setCollection(true);
+
+  public static final NavigationProperty collectionNavPropertyETMediaMany_ETMedia = new NavigationProperty()
+      .setName("NavPropertyETMediaMany")
+      .setType(EntityTypeProvider.nameETMedia)
+      .setCollection(true);
+
+  public static final NavigationProperty collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav = new NavigationProperty()
+      .setName("NavPropertyETTwoKeyNavMany")
+      .setType(EntityTypeProvider.nameETTwoKeyNav)
+      .setCollection(true)
+      .setPartner("NavPropertyETKeyNavOne");
+
+  public static final NavigationProperty collectionNavPropertyETTwoKeyNavOne_ETTwoKeyNav = new NavigationProperty()
+      .setName("NavPropertyETTwoKeyNavOne")
+      .setType(EntityTypeProvider.nameETTwoKeyNav);
+
+  public static final NavigationProperty collectionNavPropertyETTwoPrimMany_ETTwoPrim = new NavigationProperty()
+      .setName("NavPropertyETTwoPrimMany")
+      .setType(EntityTypeProvider.nameETTwoPrim)
+      .setCollection(true)
+      .setNullable(false);
+
+  public static final NavigationProperty collectionNavPropertyETAllPrimMany_ETAllPrim = new NavigationProperty()
+      .setName("NavPropertyETAllPrimMany")
+      .setType(EntityTypeProvider.nameETAllPrim)
+      .setCollection(true);
+
+  public static final NavigationProperty navPropertyETKeyNavOne_ETKeyNav = new NavigationProperty()
+      .setName("NavPropertyETKeyNavOne")
+      .setType(EntityTypeProvider.nameETKeyNav);
+
+  public static final NavigationProperty navPropertyETMediaOne_ETMedia = new NavigationProperty()
+      .setName("NavPropertyETMediaOne")
+      .setType(EntityTypeProvider.nameETMedia);
+
+  public static final NavigationProperty navPropertyETKeyPrimNavOne_ETKeyPrimNav = new NavigationProperty()
+      .setName("NavPropertyETKeyPrimNavOne")
+      .setType(EntityTypeProvider.nameETKeyPrimNav);
+
+  public static final NavigationProperty navPropertyETTwoKeyNavOne_ETTwoKeyNav_NotNullable = new NavigationProperty()
+      .setName("NavPropertyETTwoKeyNavOne")
+      .setType(EntityTypeProvider.nameETTwoKeyNav)
+      .setNullable(false);
+
+  public static final NavigationProperty navPropertyETTwoKeyNavOne_ETTwoKeyNav = new NavigationProperty()
+      .setName("NavPropertyETTwoKeyNavOne")
+      .setType(EntityTypeProvider.nameETTwoKeyNav);
+
+  public static final NavigationProperty navPropertyETTwoPrimOne_ETTwoPrim = new NavigationProperty()
+      .setName("NavPropertyETTwoPrimOne")
+      .setType(EntityTypeProvider.nameETTwoPrim)
+      .setNullable(false);
+
+  public static final NavigationProperty navPropertyETAllPrimOne_ETAllPrim = new NavigationProperty()
+      .setName("NavPropertyETAllPrimOne")
+      .setType(EntityTypeProvider.nameETAllPrim);
+
+  // EnumProperties --------------------------------------------------------------------------------------------------
+  public static final Property propertyEnumString_ENString = new Property()
+      .setName("PropertyEnumString")
+      .setType(EnumTypeProvider.nameENString);
+
+  // TypeDefinition Properties ---------------------------------------------------------------------------------------
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java
new file mode 100644
index 0000000..c941c70
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java
@@ -0,0 +1,250 @@
+/*
+ * 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.tecsvc.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.server.api.edm.provider.Action;
+import org.apache.olingo.server.api.edm.provider.ActionImport;
+import org.apache.olingo.server.api.edm.provider.ComplexType;
+import org.apache.olingo.server.api.edm.provider.EntityContainer;
+import org.apache.olingo.server.api.edm.provider.EntitySet;
+import org.apache.olingo.server.api.edm.provider.EntityType;
+import org.apache.olingo.server.api.edm.provider.EnumType;
+import org.apache.olingo.server.api.edm.provider.Function;
+import org.apache.olingo.server.api.edm.provider.FunctionImport;
+import org.apache.olingo.server.api.edm.provider.Schema;
+import org.apache.olingo.server.api.edm.provider.Singleton;
+
+public class SchemaProvider {
+
+  private EdmTechProvider prov;
+
+  public static final String nameSpace = "com.sap.odata.test1";
+
+  public SchemaProvider(final EdmTechProvider prov) {
+    this.prov = prov;
+  }
+
+  public List<Schema> getSchemas() throws ODataException {
+    List<Schema> schemas = new ArrayList<Schema>();
+    Schema schema = new Schema();
+    schema.setNamespace("com.sap.odata.test1");
+    schema.setAlias("Namespace1_Alias");
+    schemas.add(schema);
+    // EnumTypes
+    List<EnumType> enumTypes = new ArrayList<EnumType>();
+    schema.setEnumTypes(enumTypes);
+    enumTypes.add(prov.getEnumType(EnumTypeProvider.nameENString));
+    // EntityTypes
+    List<EntityType> entityTypes = new ArrayList<EntityType>();
+    schema.setEntityTypes(entityTypes);
+
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllPrim));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCollAllPrim));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoPrim));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMixPrimCollComp));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoKeyTwoPrim));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETBase));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoBase));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllKey));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompAllPrim));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompCollAllPrim));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompComp));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompCollComp));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMedia));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETFourKeyAlias));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETServerSidePaging));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllNullable));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyNav));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoKeyNav));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoBaseTwoKeyNav));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompMixPrimCollComp));
+    entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyPrimNav));
+
+    // ComplexTypes
+    List<ComplexType> complexType = new ArrayList<ComplexType>();
+    schema.setComplexTypes(complexType);
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTPrim));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTAllPrim));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCollAllPrim));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoPrim));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTMixPrimCollComp));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTBase));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoBase));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompComp));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompCollComp));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTPrimComp));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTNavFiveProp));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTPrimEnum));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTBasePrimCompNav));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoBasePrimCompNav));
+    complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompNav));
+
+    // TypeDefinitions
+
+    // Actions
+    List<Action> actions = new ArrayList<Action>();
+    schema.setActions(actions);
+    actions.addAll(prov.getActions(ActionProvider.nameBAETTwoKeyNavRTETTwoKeyNav));
+    actions.addAll(prov.getActions(ActionProvider.nameBAESAllPrimRTETAllPrim));
+    actions.addAll(prov.getActions(ActionProvider.nameBAESTwoKeyNavRTESTwoKeyNav));
+    actions.addAll(prov.getActions(ActionProvider.nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav));
+    actions.addAll(prov.getActions(ActionProvider.nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav));
+    actions.addAll(prov.getActions(ActionProvider.nameUARTPrimParam));
+    actions.addAll(prov.getActions(ActionProvider.nameUARTPrimCollParam));
+    actions.addAll(prov.getActions(ActionProvider.nameUARTCompParam));
+    actions.addAll(prov.getActions(ActionProvider.nameUARTCompCollParam));
+    actions.addAll(prov.getActions(ActionProvider.nameUARTETParam));
+    actions.addAll(prov.getActions(ActionProvider.nameUARTESParam));
+
+    // Functions
+    List<Function> functions = new ArrayList<Function>();
+    schema.setFunctions(functions);
+
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTInt16));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNavParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNavParamCTTwoPrim));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTStringTwoParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTESTwoKeyNavParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTString));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollStringTwoParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollString));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTAllPrimTwoParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTTwoPrimParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollCTTwoPrimParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTTwoPrim));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollCTTwoPrim));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETMedia));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTESMixPrimCollCompTwoParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETAllPrimTwoParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTESMixPrimCollCompTwoParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTCollCTNavFiveProp));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTESTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCStringRTESTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETBaseTwoKeyNavRTETTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESBaseTwoKeyNavRTESBaseTwoKey));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESAllPrimRTCTAllPrim));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCTTwoPrim));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollCTTwoPrim));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTString));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollString));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTESTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETBaseTwoKeyNavRTESTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCSINavRTESTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETBaseTwoKeyNavRTESBaseTwoKey));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCollStringRTESTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESBaseTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCollCTPrimCompRTESAllPrim));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETKeyNavRTETKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFESTwoKeyNavRTESTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTETTwoKeyNav));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTCTTwoPrim));
+
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCTNavFiveProp));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollCTNavFiveProp));
+
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTStringParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNavParam));
+    functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTETTwoKeyNavParam));
+    // functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESTwoKeyNavParam));
+
+    // EntityContainer
+    EntityContainer container = new EntityContainer();
+    schema.setEntityContainer(container);
+    container.setName(ContainerProvider.nameContainer.getName());
+
+    // EntitySets
+    List<EntitySet> entitySets = new ArrayList<EntitySet>();
+    container.setEntitySets(entitySets);
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllPrim"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCollAllPrim"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoPrim"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMixPrimCollComp"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESBase"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoBase"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoKeyTwoPrim"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESBaseTwoKeyTwoPrim"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoBaseTwoKeyTwoPrim"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllKey"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompAllPrim"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompCollAllPrim"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompComp"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompCollComp"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMedia"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESKeyTwoKeyComp"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESInvisible"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESServerSidePaging"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllNullable"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESKeyNav"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoKeyNav"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESBaseTwoKeyNav"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompMixPrimCollComp"));
+    entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESFourKeyAlias"));
+
+    // Singletons
+    List<Singleton> singletons = new ArrayList<Singleton>();
+    container.setSingletons(singletons);
+    singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SI"));
+    singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SINav"));
+    singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SIMedia"));
+
+    // ActionImports
+    List<ActionImport> actionImports = new ArrayList<ActionImport>();
+    container.setActionImports(actionImports);
+    actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTPrimParam"));
+    actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTPrimCollParam"));
+    actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTCompParam"));
+    actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTCompCollParam"));
+    actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTETParam"));
+    actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTETCollAllPrimParam"));
+
+    // FunctionImports
+    List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
+    container.setFunctionImports(functionImports);
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTInt16"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisibleRTInt16"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisible2RTInt16"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETKeyNav"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETTwoKeyNavParam"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTStringTwoParam"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollStringTwoParam"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTAllPrimTwoParam"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESMixPrimCollCompTwoParam"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTESMixPrimCollCompTwoParam"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrim"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETMedia"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTTwoPrimParam"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTTwoPrim"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollString"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTString"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESTwoKeyNavParam"));
+    functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrimParam"));
+
+    return schemas;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java
new file mode 100644
index 0000000..2688586
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java
@@ -0,0 +1,30 @@
+/*
+ * 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.tecsvc.provider;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.TypeDefinition;
+
+public class TypeDefinitionProvider {
+
+  public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) {
+    return null;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/resources/simplelogger.properties
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/resources/simplelogger.properties b/lib/server-tecsvc/src/main/resources/simplelogger.properties
new file mode 100644
index 0000000..2a3350c
--- /dev/null
+++ b/lib/server-tecsvc/src/main/resources/simplelogger.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+org.slf4j.simpleLogger.defaultLogLevel=debug
+org.slf4j.simpleLogger.logFile=System.out
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/webapp/WEB-INF/web.xml b/lib/server-tecsvc/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..a5e5154
--- /dev/null
+++ b/lib/server-tecsvc/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,42 @@
+<?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.
+-->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+	id="WebApp_ID" version="2.5">
+
+	<display-name>Apache Olingo OData 4.0 Technical Service</display-name>
+
+	<welcome-file-list>
+		<welcome-file>index.html</welcome-file>
+	</welcome-file-list>
+	
+	<servlet>
+		<servlet-name>ODataServlet</servlet-name>
+		<servlet-class>org.apache.olingo.server.tecsvc.TechnicalServlet</servlet-class>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+   
+	<servlet-mapping>
+		<servlet-name>ODataServlet</servlet-name>
+		<url-pattern>/odata.svc/*</url-pattern>
+	</servlet-mapping>
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/webapp/index.html b/lib/server-tecsvc/src/main/webapp/index.html
new file mode 100644
index 0000000..7773c60
--- /dev/null
+++ b/lib/server-tecsvc/src/main/webapp/index.html
@@ -0,0 +1,32 @@
+<html>
+<!--
+  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.
+-->
+
+<body>
+ <h1>Olingo OData 4.0</h1>
+ <hr>
+ <h2>Technical Service</h2>
+ <lu>
+ <li><a href="odata.svc/">Service Document</a></li>
+ <li><a href="odata.svc/$metadata">Metadata</a></li>
+ </lu>
+
+</body>
+
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java
new file mode 100644
index 0000000..8713348
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java
@@ -0,0 +1,133 @@
+/*
+ * 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.serializer.json;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmFunctionImport;
+import org.apache.olingo.commons.api.edm.EdmSingleton;
+import org.apache.olingo.server.api.ODataServer;
+import org.apache.olingo.server.api.serializer.ODataFormat;
+import org.apache.olingo.server.api.serializer.ODataSerializer;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ServiceDocumentTest {
+
+  private Edm edm;
+
+  @Before
+  public void before() {
+
+    EdmEntitySet edmEntitySet1 = mock(EdmEntitySet.class);
+    when(edmEntitySet1.getName()).thenReturn("entitySetName1");
+    when(edmEntitySet1.isIncludeInServiceDocument()).thenReturn(true);
+
+    EdmEntitySet edmEntitySet2 = mock(EdmEntitySet.class);
+    when(edmEntitySet2.getName()).thenReturn("entitySetName2");
+    when(edmEntitySet2.isIncludeInServiceDocument()).thenReturn(true);
+
+    EdmEntitySet edmEntitySet3 = mock(EdmEntitySet.class);
+    when(edmEntitySet3.getName()).thenReturn("entitySetName3");
+    when(edmEntitySet3.isIncludeInServiceDocument()).thenReturn(false);
+
+    List<EdmEntitySet> entitySets = new ArrayList<EdmEntitySet>();
+    entitySets.add(edmEntitySet1);
+    entitySets.add(edmEntitySet2);
+    entitySets.add(edmEntitySet3);
+
+    EdmFunctionImport functionImport1 = mock(EdmFunctionImport.class);
+    when(functionImport1.getName()).thenReturn("functionImport1");
+    when(functionImport1.isIncludeInServiceDocument()).thenReturn(true);
+
+    EdmFunctionImport functionImport2 = mock(EdmFunctionImport.class);
+    when(functionImport2.getName()).thenReturn("functionImport2");
+    when(functionImport2.isIncludeInServiceDocument()).thenReturn(true);
+
+    EdmFunctionImport functionImport3 = mock(EdmFunctionImport.class);
+    when(functionImport3.getName()).thenReturn("functionImport3");
+    when(functionImport3.isIncludeInServiceDocument()).thenReturn(false);
+
+    List<EdmFunctionImport> functionImports = new ArrayList<EdmFunctionImport>();
+    functionImports.add(functionImport1);
+    functionImports.add(functionImport2);
+    functionImports.add(functionImport3);
+
+    EdmSingleton singleton1 = mock(EdmSingleton.class);
+    when(singleton1.getName()).thenReturn("singleton1");
+
+    EdmSingleton singleton2 = mock(EdmSingleton.class);
+    when(singleton2.getName()).thenReturn("singleton2");
+
+    EdmSingleton singleton3 = mock(EdmSingleton.class);
+    when(singleton3.getName()).thenReturn("singleton3");
+
+    List<EdmSingleton> singletons = new ArrayList<EdmSingleton>();
+    singletons.add(singleton1);
+    singletons.add(singleton2);
+    singletons.add(singleton3);
+
+    EdmEntityContainer edmEntityContainer = mock(EdmEntityContainer.class);
+    when(edmEntityContainer.getEntitySets()).thenReturn(entitySets);
+    when(edmEntityContainer.getFunctionImports()).thenReturn(functionImports);
+    when(edmEntityContainer.getSingletons()).thenReturn(singletons);
+
+    edm = mock(Edm.class);
+    when(edm.getEntityContainer(null)).thenReturn(edmEntityContainer);
+  }
+
+  @Test
+  public void writeServiceDocumentJson() throws Exception {
+    String serviceRoot = "http://localhost:8080/odata.svc";
+
+    ODataServer server = ODataServer.newInstance();
+    assertNotNull(server);
+
+    ODataSerializer serializer = server.getSerializer(ODataFormat.JSON);
+    assertNotNull(serializer);
+
+    InputStream result = serializer.serviceDocument(edm, serviceRoot);
+    assertNotNull(result);
+    String jsonString = IOUtils.toString(result);
+
+    assertTrue(jsonString.contains("entitySetName1"));
+    assertTrue(jsonString.contains("entitySetName2"));
+    assertFalse(jsonString.contains("entitySetName3"));
+
+    assertTrue(jsonString.contains("functionImport1"));
+    assertTrue(jsonString.contains("functionImport2"));
+    assertFalse(jsonString.contains("functionImport3"));
+
+    assertTrue(jsonString.contains("singleton1"));
+    assertTrue(jsonString.contains("singleton2"));
+    assertTrue(jsonString.contains("singleton3"));
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
new file mode 100644
index 0000000..17ac957
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
@@ -0,0 +1,254 @@
+/*
+ * 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.serializer.xml;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.Target;
+import org.apache.olingo.server.api.ODataServer;
+import org.apache.olingo.server.api.edm.provider.Action;
+import org.apache.olingo.server.api.edm.provider.ActionImport;
+import org.apache.olingo.server.api.edm.provider.ComplexType;
+import org.apache.olingo.server.api.edm.provider.EdmProvider;
+import org.apache.olingo.server.api.edm.provider.EntityContainer;
+import org.apache.olingo.server.api.edm.provider.EntitySet;
+import org.apache.olingo.server.api.edm.provider.EntityType;
+import org.apache.olingo.server.api.edm.provider.EnumMember;
+import org.apache.olingo.server.api.edm.provider.EnumType;
+import org.apache.olingo.server.api.edm.provider.Function;
+import org.apache.olingo.server.api.edm.provider.FunctionImport;
+import org.apache.olingo.server.api.edm.provider.NavigationProperty;
+import org.apache.olingo.server.api.edm.provider.NavigationPropertyBinding;
+import org.apache.olingo.server.api.edm.provider.Parameter;
+import org.apache.olingo.server.api.edm.provider.Property;
+import org.apache.olingo.server.api.edm.provider.ReturnType;
+import org.apache.olingo.server.api.edm.provider.Schema;
+import org.apache.olingo.server.api.edm.provider.Singleton;
+import org.apache.olingo.server.api.edm.provider.TypeDefinition;
+import org.apache.olingo.server.api.serializer.ODataFormat;
+import org.apache.olingo.server.api.serializer.ODataSerializer;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
+import org.junit.Test;
+
+public class MetadataDocumentTest {
+
+  @Test(expected = ODataRuntimeException.class)
+  public void metadataOnJsonResultsInException() {
+    ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.JSON);
+    serializer.metadataDocument(mock(Edm.class));
+  }
+
+  @Test
+  public void writeMetadataWithEmptyMockedEdm() {
+    ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.XML);
+    Edm edm = mock(Edm.class);
+    serializer.metadataDocument(edm);
+  }
+
+  @Test
+  public void writeMetadataWithLocalTestEdm() throws Exception {
+    ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.XML);
+    Edm edm = new EdmProviderImpl(new TestMetadataProvider());
+    InputStream metadata = serializer.metadataDocument(edm);
+    assertNotNull(metadata);
+    
+    String metadataString = IOUtils.toString(metadata);
+    assertTrue(metadataString
+        .contains("<edmx:Edmx Version=\"4.0\" xmlns:edmx=\"http://docs.oasis-open.org/odata/ns/edmx\">"));
+
+    assertTrue(metadataString
+        .contains("<Schema xmlns=\"http://docs.oasis-open.org/odata/ns/edm\" " +
+            "Namespace=\"namespace\" Alias=\"alias\">"));
+
+    assertTrue(metadataString
+        .contains("<EntityType Name=\"ETBaseName\"><Property Name=\"P1\" Type=\"Edm.Int16\"/><NavigationProperty " +
+            "Name=\"N1\" Type=\"namespace.ETBaseName\" Nullable=\"true\" Partner=\"N1\"/></EntityType>"));
+
+    assertTrue(metadataString
+        .contains("<EntityType Name=\"ETDerivedName\" BaseType=\"namespace.ETBaseName\"><Property Name=\"P2\" " +
+            "Type=\"Edm.Int16\"/><NavigationProperty Name=\"N2\" Type=\"namespace.ETDerivedName\" Nullable=\"true\" " +
+            "Partner=\"N2\"/></EntityType>"));
+
+    assertTrue(metadataString
+        .contains("<ComplexType Name=\"CTBaseName\"><Property Name=\"P1\" Type=\"Edm.Int16\"/><NavigationProperty " +
+            "Name=\"N1\" Type=\"namespace.ETBaseName\" Nullable=\"true\" Partner=\"N1\"/></ComplexType>"));
+
+    assertTrue(metadataString
+        .contains("<ComplexType Name=\"CTDerivedName\" BaseType=\"namespace.CTBaseName\"><Property Name=\"P2\" " +
+            "Type=\"Edm.Int16\"/><NavigationProperty Name=\"N2\" Type=\"namespace.ETDerivedName\" Nullable=\"true\" " +
+            "Partner=\"N2\"/></ComplexType>"));
+
+    assertTrue(metadataString.contains("<TypeDefinition Name=\"typeDef\" Type=\"Edm.Int16\"/>"));
+
+    assertTrue(metadataString.contains("<Action Name=\"ActionWOParameter\" IsBound=\"false\"/>"));
+
+    assertTrue(metadataString
+        .contains("<Action Name=\"ActionName\" IsBound=\"true\"><Parameter Name=\"param\" Type=\"Edm.Int16\"/>" +
+            "<Parameter Name=\"param2\" Type=\"Collection(Edm.Int16)\"/><ReturnType Type=\"namespace.CTBaseName\"/>" +
+            "</Action>"));
+
+    assertTrue(metadataString
+        .contains("<Function Name=\"FunctionWOParameter\" IsBound=\"false\" IsComposable=\"false\"><ReturnType " +
+            "Type=\"namespace.CTBaseName\"/></Function>"));
+
+    assertTrue(metadataString
+        .contains("<Function Name=\"FunctionName\" IsBound=\"true\" IsComposable=\"false\"><Parameter Name=\"param\" " +
+            "Type=\"Edm.Int16\"/><Parameter Name=\"param2\" Type=\"Collection(Edm.Int16)\"/><ReturnType " +
+            "Type=\"namespace.CTBaseName\"/></Function>"));
+
+    assertTrue(metadataString.contains("<EntityContainer Name=\"container\">"));
+
+    assertTrue(metadataString
+        .contains("<EntitySet Name=\"EntitySetName\" EntityType=\"namespace.ETBaseName\"><NavigationPropertyBinding " +
+            "Path=\"N1\" Target=\"namespace.container/EntitySetName\"/></EntitySet>"));
+    assertTrue(metadataString
+        .contains("<Singleton Name=\"SingletonName\" EntityType=\"namespace.ETBaseName\"><NavigationPropertyBinding " +
+            "Path=\"N1\" Target=\"namespace.container/EntitySetName\"/></Singleton>"));
+
+    assertTrue(metadataString.contains("<ActionImport Name=\"actionImport\" Action=\"namespace.ActionWOParameter\"/>"));
+
+    assertTrue(metadataString
+        .contains("<FunctionImport Name=\"actionImport\" Function=\"namespace.FunctionName\" " +
+            "EntitySet=\"namespace.EntitySetName\" IncludeInServiceDocument=\"false\"/>"));
+
+    assertTrue(metadataString.contains("</EntityContainer></Schema></edmx:DataServices></edmx:Edmx>"));
+  }
+
+  @Test
+  public void writeMetadataWithTechnicalScenario() {
+    ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.XML);
+    EdmProviderImpl edm = new EdmProviderImpl(new EdmTechProvider());
+    InputStream metadata = serializer.metadataDocument(edm);
+    assertNotNull(metadata);
+    // The technical scenario is too big to verify. We are content for now to make sure we can serialize it.
+    // System.out.println(StringUtils.inputStreamToString(metadata, false));
+  }
+
+  private class TestMetadataProvider extends EdmProvider {
+
+    @Override
+    public List<Schema> getSchemas() throws ODataException {
+      Property p1 = new Property().setName("P1").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName());
+      String ns = "namespace";
+      NavigationProperty n1 = new NavigationProperty().setName("N1")
+          .setType(new FullQualifiedName(ns, "ETBaseName")).setNullable(true).setPartner("N1");
+      Property p2 = new Property().setName("P2").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName());
+      NavigationProperty n2 = new NavigationProperty().setName("N2")
+          .setType(new FullQualifiedName(ns, "ETDerivedName")).setNullable(true).setPartner("N2");
+      Schema schema = new Schema().setNamespace(ns).setAlias("alias");
+      List<ComplexType> complexTypes = new ArrayList<ComplexType>();
+      schema.setComplexTypes(complexTypes);
+      ComplexType ctBase =
+          new ComplexType().setName("CTBaseName").setProperties(Arrays.asList(p1)).setNavigationProperties(
+              Arrays.asList(n1));
+      complexTypes.add(ctBase);
+      ComplexType ctDerived =
+          new ComplexType().setName("CTDerivedName").setBaseType(new FullQualifiedName(ns, "CTBaseName"))
+              .setProperties(Arrays.asList(p2)).setNavigationProperties(Arrays.asList(n2));
+      complexTypes.add(ctDerived);
+
+      List<EntityType> entityTypes = new ArrayList<EntityType>();
+      schema.setEntityTypes(entityTypes);
+      EntityType etBase =
+          new EntityType().setName("ETBaseName").setProperties(Arrays.asList(p1)).setNavigationProperties(
+              Arrays.asList(n1));
+      entityTypes.add(etBase);
+      EntityType etDerived =
+          new EntityType().setName("ETDerivedName").setBaseType(new FullQualifiedName(ns, "ETBaseName"))
+              .setProperties(Arrays.asList(p2)).setNavigationProperties(Arrays.asList(n2));
+      entityTypes.add(etDerived);
+
+      List<Action> actions = new ArrayList<Action>();
+      schema.setActions(actions);
+      // TODO:EntitySetPath
+      actions.add((new Action().setName("ActionWOParameter")));
+      List<Parameter> parameters = new ArrayList<Parameter>();
+      parameters.add(new Parameter().setName("param").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()));
+      parameters.add(new Parameter().setName("param2").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName())
+          .setCollection(true));
+      actions.add(new Action().setName("ActionName").setBound(true).setParameters(parameters).setReturnType(
+          new ReturnType().setType(new FullQualifiedName(ns, "CTBaseName"))));
+
+      List<Function> functions = new ArrayList<Function>();
+      schema.setFunctions(functions);
+      functions.add((new Function().setName("FunctionWOParameter")
+          .setReturnType(new ReturnType().setType(new FullQualifiedName(ns, "CTBaseName")))));
+      functions.add(new Function().setName("FunctionName").setBound(true).setParameters(parameters).setReturnType(
+          new ReturnType().setType(new FullQualifiedName(ns, "CTBaseName"))));
+
+      List<EnumType> enumTypes = new ArrayList<EnumType>();
+      schema.setEnumTypes(enumTypes);
+      List<EnumMember> members = new ArrayList<EnumMember>();
+      members.add(new EnumMember().setName("member").setValue("1"));
+      enumTypes.add(new EnumType().setName("EnumName").setFlags(true).setMembers(members));
+
+      List<TypeDefinition> typeDefinitions = new ArrayList<TypeDefinition>();
+      schema.setTypeDefinitions(typeDefinitions);
+      typeDefinitions.add(new TypeDefinition().setName("typeDef")
+          .setUnderlyingType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()));
+
+      EntityContainer container = new EntityContainer().setName("container");
+      schema.setEntityContainer(container);
+
+      List<ActionImport> actionImports = new ArrayList<ActionImport>();
+      container.setActionImports(actionImports);
+      actionImports.add(new ActionImport().setName("actionImport").setAction(
+          new FullQualifiedName(ns, "ActionWOParameter")).setEntitySet(
+          new Target().setEntityContainer(new FullQualifiedName(ns, "container")).setTargetName("EntitySetName")));
+
+      List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
+      container.setFunctionImports(functionImports);
+      functionImports.add(new FunctionImport().setName("actionImport").setFunction(
+          new FullQualifiedName(ns, "FunctionName")).setEntitySet(
+          new Target().setEntityContainer(new FullQualifiedName(ns, "container")).setTargetName("EntitySetName")));
+
+      List<EntitySet> entitySets = new ArrayList<EntitySet>();
+      container.setEntitySets(entitySets);
+      List<NavigationPropertyBinding> nPB = new ArrayList<NavigationPropertyBinding>();
+      nPB.add(new NavigationPropertyBinding().setPath("N1").setTarget(
+          new Target().setEntityContainer(new FullQualifiedName(ns, "container")).setTargetName("EntitySetName")));
+      entitySets.add(new EntitySet().setName("EntitySetName").setType(new FullQualifiedName(ns, "ETBaseName"))
+          .setNavigationPropertyBindings(nPB));
+
+      List<Singleton> singletons = new ArrayList<Singleton>();
+      container.setSingletons(singletons);
+      singletons.add(new Singleton().setName("SingletonName").setType(new FullQualifiedName(ns, "ETBaseName"))
+          .setNavigationPropertyBindings(nPB));
+
+      List<Schema> schemas = new ArrayList<Schema>();
+      schemas.add(schema);
+      return schemas;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java
new file mode 100644
index 0000000..f54ad57
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java
@@ -0,0 +1,151 @@
+/*
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+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.UriParserSyntaxException;
+import org.junit.Test;
+
+public class RawUriTest {
+
+  private RawUri runRawParser(final String uri, final int scipSegments) throws UriParserSyntaxException {
+    return UriDecoder.decodeUri(uri, scipSegments);
+  }
+
+  @Test
+  public void testOption() throws Exception {
+    RawUri rawUri;
+    rawUri = runRawParser("?", 0);
+    checkOptionCount(rawUri, 0);
+
+    rawUri = runRawParser("?a", 0);
+    checkOption(rawUri, 0, "a", "");
+
+    rawUri = runRawParser("?a=b", 0);
+    checkOption(rawUri, 0, "a", "b");
+
+    rawUri = runRawParser("?=", 0);
+    checkOption(rawUri, 0, "", "");
+
+    rawUri = runRawParser("?=b", 0);
+    checkOption(rawUri, 0, "", "b");
+
+    rawUri = runRawParser("?a&c", 0);
+    checkOption(rawUri, 0, "a", "");
+    checkOption(rawUri, 1, "c", "");
+
+    rawUri = runRawParser("?a=b&c", 0);
+    checkOption(rawUri, 0, "a", "b");
+    checkOption(rawUri, 1, "c", "");
+
+    rawUri = runRawParser("?a=b&c=d", 0);
+    checkOption(rawUri, 0, "a", "b");
+    checkOption(rawUri, 1, "c", "d");
+
+    rawUri = runRawParser("?=&=", 0);
+    checkOption(rawUri, 0, "", "");
+    checkOption(rawUri, 1, "", "");
+
+    rawUri = runRawParser("?=&c=d", 0);
+    checkOption(rawUri, 0, "", "");
+    checkOption(rawUri, 1, "c", "d");
+  }
+
+  private void checkOption(final RawUri rawUri, final int index, final String name, final String value) {
+    RawUri.QueryOption option = rawUri.queryOptionListDecoded.get(index);
+
+    assertEquals(name, option.name);
+    assertEquals(value, option.value);
+
+  }
+
+  private void checkOptionCount(final RawUri rawUri, final int count) {
+    assertEquals(count, rawUri.queryOptionListDecoded.size());
+  }
+
+  @Test
+  public void testPath() throws Exception {
+    RawUri rawUri;
+
+    rawUri = runRawParser("http://test.org", 0);
+    checkPath(rawUri, "", new ArrayList<String>());
+
+    rawUri = runRawParser("http://test.org/", 0);
+    checkPath(rawUri, "/", Arrays.asList(""));
+
+    rawUri = runRawParser("http://test.org/entitySet", 0);
+    checkPath(rawUri, "/entitySet", Arrays.asList("entitySet"));
+
+    rawUri = runRawParser("http://test.org/nonServiceSegment/entitySet", 0);
+    checkPath(rawUri, "/nonServiceSegment/entitySet", Arrays.asList("nonServiceSegment", "entitySet"));
+
+    rawUri = runRawParser("http://test.org/nonServiceSegment/entitySet", 1);
+    checkPath(rawUri, "/nonServiceSegment/entitySet", Arrays.asList("entitySet"));
+
+    rawUri = runRawParser("", 0);
+    checkPath(rawUri, "", new ArrayList<String>());
+
+    rawUri = runRawParser("/", 0);
+    checkPath(rawUri, "/", Arrays.asList(""));
+
+    rawUri = runRawParser("/entitySet", 0);
+    checkPath(rawUri, "/entitySet", Arrays.asList("entitySet"));
+
+    rawUri = runRawParser("entitySet", 0);
+    checkPath(rawUri, "entitySet", Arrays.asList("entitySet"));
+
+    rawUri = runRawParser("nonServiceSegment/entitySet", 0);
+    checkPath(rawUri, "nonServiceSegment/entitySet", Arrays.asList("nonServiceSegment", "entitySet"));
+
+    rawUri = runRawParser("nonServiceSegment/entitySet", 1);
+    checkPath(rawUri, "nonServiceSegment/entitySet", Arrays.asList("entitySet"));
+
+    rawUri = runRawParser("http://test.org/a?abc=xx+yz", 0);
+  }
+
+  @Test
+  public void testSplitt() {
+    UriDecoder.splitt("", '/');
+    UriDecoder.splitt("/", '/');
+    UriDecoder.splitt("a", '/');
+    UriDecoder.splitt("a/", '/');
+    UriDecoder.splitt("/a", '/');
+    UriDecoder.splitt("a/a", '/');
+  }
+
+  private void checkPath(final RawUri rawUri, final String path, final List<String> list) {
+    assertEquals(path, rawUri.path);
+
+    assertEquals(list.size(), rawUri.pathSegmentListDecoded.size());
+
+    int i = 0;
+    while (i < list.size()) {
+      assertEquals(list.get(i), rawUri.pathSegmentListDecoded.get(i));
+      i++;
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
new file mode 100644
index 0000000..a71762c
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
@@ -0,0 +1,201 @@
+/*
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.server.api.uri.UriInfoAll;
+import org.apache.olingo.server.api.uri.UriInfoBatch;
+import org.apache.olingo.server.api.uri.UriInfoCrossjoin;
+import org.apache.olingo.server.api.uri.UriInfoEntityId;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.UriInfoMetadata;
+import org.apache.olingo.server.api.uri.UriInfoResource;
+import org.apache.olingo.server.api.uri.UriInfoService;
+import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+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.LevelsOptionImpl;
+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.TopOptionImpl;
+import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
+import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
+import org.junit.Test;
+
+public class UriInfoImplTest {
+
+  Edm edm = new EdmProviderImpl(new EdmTechTestProvider());
+
+  @Test
+  public void testKind() {
+    UriInfoImpl uriInfo = new UriInfoImpl().setKind(UriInfoKind.all);
+    assertEquals(UriInfoKind.all, uriInfo.getKind());
+  }
+
+  @Test
+  public void testCasts() {
+    UriInfoImpl uriInfo = new UriInfoImpl();
+
+    UriInfoAll all = uriInfo.asUriInfoAll();
+    assertEquals(uriInfo, all);
+
+    UriInfoBatch batch = uriInfo.asUriInfoBatch();
+    assertEquals(uriInfo, batch);
+
+    UriInfoCrossjoin crossjoin = uriInfo.asUriInfoCrossjoin();
+    assertEquals(uriInfo, crossjoin);
+
+    UriInfoEntityId entityID = uriInfo.asUriInfoEntityId();
+    assertEquals(uriInfo, entityID);
+
+    UriInfoMetadata metadata = uriInfo.asUriInfoMetadata();
+    assertEquals(uriInfo, metadata);
+
+    UriInfoResource resource = uriInfo.asUriInfoResource();
+    assertEquals(uriInfo, resource);
+
+    UriInfoService service = uriInfo.asUriInfoService();
+    assertEquals(uriInfo, service);
+
+  }
+
+  @Test
+  public void testEntityNames() {
+    UriInfoImpl uriInfo = new UriInfoImpl();
+    uriInfo.addEntitySetName("A");
+    uriInfo.addEntitySetName("B");
+
+    assertEquals("A", uriInfo.getEntitySetNames().get(0));
+    assertEquals("B", uriInfo.getEntitySetNames().get(1));
+
+  }
+
+  @Test
+  public void testResourceParts() {
+    UriInfoImpl uriInfo = new UriInfoImpl();
+
+    UriResourceActionImpl action = new UriResourceActionImpl();
+    UriResourceEntitySetImpl entitySet0 = new UriResourceEntitySetImpl();
+    UriResourceEntitySetImpl entitySet1 = new UriResourceEntitySetImpl();
+
+    uriInfo.addResourcePart(action);
+    uriInfo.addResourcePart(entitySet0);
+
+    assertEquals(action, uriInfo.getUriResourceParts().get(0));
+    assertEquals(entitySet0, uriInfo.getUriResourceParts().get(1));
+
+    assertEquals(entitySet0, uriInfo.getLastResourcePart());
+
+    uriInfo.addResourcePart(entitySet1);
+    assertEquals(entitySet1, uriInfo.getLastResourcePart());
+  }
+
+  @Test
+  public void testCustomQueryOption() {
+    UriInfoImpl uriInfo = new UriInfoImpl();
+
+    List<QueryOptionImpl> queryOptions = new ArrayList<QueryOptionImpl>();
+
+    ExpandOptionImpl expand = new ExpandOptionImpl();
+    FilterOptionImpl filter = new FilterOptionImpl();
+    FormatOptionImpl format = new FormatOptionImpl();
+    IdOptionImpl id = new IdOptionImpl();
+    CountOptionImpl inlinecount = new CountOptionImpl();
+    OrderByOptionImpl orderby = new OrderByOptionImpl();
+    SearchOptionImpl search = new SearchOptionImpl();
+    SelectOptionImpl select = new SelectOptionImpl();
+    SkipOptionImpl skip = new SkipOptionImpl();
+    SkipTokenOptionImpl skipToken = new SkipTokenOptionImpl();
+    TopOptionImpl top = new TopOptionImpl();
+    LevelsOptionImpl levels = new LevelsOptionImpl();
+
+    CustomQueryOptionImpl customOption0 = new CustomQueryOptionImpl();
+    customOption0.setText("A");
+    CustomQueryOptionImpl customOption1 = new CustomQueryOptionImpl();
+    customOption1.setText("B");
+
+    QueryOptionImpl queryOption = new QueryOptionImpl();
+
+    queryOptions.add(expand);
+    queryOptions.add(filter);
+    queryOptions.add(format);
+    queryOptions.add(id);
+    queryOptions.add(inlinecount);
+    queryOptions.add(orderby);
+    queryOptions.add(search);
+    queryOptions.add(select);
+    queryOptions.add(skip);
+    queryOptions.add(skipToken);
+    queryOptions.add(top);
+    queryOptions.add(customOption0);
+    queryOptions.add(customOption1);
+    queryOptions.add(levels);// not stored
+    queryOptions.add(queryOption);// not stored
+    uriInfo.setQueryOptions(queryOptions);
+
+    assertEquals(expand, uriInfo.getExpandOption());
+    assertEquals(filter, uriInfo.getFilterOption());
+    assertEquals(format, uriInfo.getFormatOption());
+    assertEquals(id, uriInfo.getIdOption());
+    assertEquals(inlinecount, uriInfo.getCountOption());
+    assertEquals(orderby, uriInfo.getOrderByOption());
+    assertEquals(search, uriInfo.getSearchOption());
+    assertEquals(select, uriInfo.getSelectOption());
+    assertEquals(skip, uriInfo.getSkipOption());
+    assertEquals(skipToken, uriInfo.getSkipTokenOption());
+    assertEquals(top, uriInfo.getTopOption());
+
+    List<CustomQueryOption> customQueryOptions = uriInfo.getCustomQueryOptions();
+    assertEquals(customOption0, customQueryOptions.get(0));
+    assertEquals(customOption1, customQueryOptions.get(1));
+  }
+
+  @Test
+  public void testFragment() {
+    UriInfoImpl uriInfo = new UriInfoImpl();
+    uriInfo.setFragment("F");
+    assertEquals("F", uriInfo.getFragment());
+  }
+
+  @Test
+  public void testEntityTypeCast() {
+    UriInfoImpl uriInfo = new UriInfoImpl();
+    EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
+    assertNotNull(entityType);
+
+    uriInfo.setEntityTypeCast(entityType);
+    assertEquals(entityType, uriInfo.getEntityTypeCast());
+  }
+}