olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject [03/51] [partial] initial commit
Date Fri, 26 Jul 2013 11:22:08 GMT
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationImplProvTest.java
new file mode 100644
index 0000000..f6d7f62
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationImplProvTest.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.mock;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
+import org.apache.olingo.odata2.api.edm.EdmAnnotations;
+import org.apache.olingo.odata2.api.edm.EdmAssociation;
+import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
+import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
+import org.apache.olingo.odata2.api.edm.EdmTypeKind;
+import org.apache.olingo.odata2.api.edm.provider.Association;
+import org.apache.olingo.odata2.api.edm.provider.AssociationEnd;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.PropertyRef;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+/**
+ * @author SAP AG
+ */
+public class EdmAssociationImplProvTest extends BaseTest {
+
+  private static EdmAssociationImplProv associationProv;
+  private static EdmProvider edmProvider;
+
+  @BeforeClass
+  public static void getEdmEntityContainerImpl() throws Exception {
+
+    edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    AssociationEnd end1 = new AssociationEnd().setRole("end1Role").setMultiplicity(EdmMultiplicity.ONE).setType(EdmSimpleTypeKind.String.getFullQualifiedName());
+    AssociationEnd end2 = new AssociationEnd().setRole("end2Role").setMultiplicity(EdmMultiplicity.ONE).setType(EdmSimpleTypeKind.String.getFullQualifiedName());
+
+    List<PropertyRef> propRef = new ArrayList<PropertyRef>();
+    propRef.add(new PropertyRef().setName("prop1"));
+    List<PropertyRef> propRef2 = new ArrayList<PropertyRef>();
+    propRef2.add(new PropertyRef().setName("prop2"));
+
+    Association association = new Association().setName("association").setEnd1(end1).setEnd2(end2);
+
+    associationProv = new EdmAssociationImplProv(edmImplProv, association, "namespace");
+  }
+
+  @Test
+  public void testAssociation() throws Exception {
+    EdmAssociation association = associationProv;
+
+    assertEquals(EdmTypeKind.ASSOCIATION, association.getKind());
+    assertEquals("end1Role", association.getEnd("end1Role").getRole());
+    assertEquals("end2Role", association.getEnd("end2Role").getRole());
+    assertEquals("namespace", association.getNamespace());
+    assertEquals(null, association.getEnd("endWrongRole"));
+  }
+
+  @Test
+  public void getAnnotations() throws Exception {
+    EdmAnnotatable annotatable = associationProv;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationSetEndImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationSetEndImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationSetEndImplProvTest.java
new file mode 100644
index 0000000..d276aa8
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationSetEndImplProvTest.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
+import org.apache.olingo.odata2.api.edm.EdmAnnotations;
+import org.apache.olingo.odata2.api.edm.EdmAssociationSetEnd;
+import org.apache.olingo.odata2.api.edm.EdmEntityContainer;
+import org.apache.olingo.odata2.api.edm.provider.AssociationSetEnd;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo;
+import org.apache.olingo.odata2.api.edm.provider.EntitySet;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+public class EdmAssociationSetEndImplProvTest extends BaseTest {
+  private static EdmAssociationSetEnd edmAssociationSetEnd;
+  private static EdmProvider edmProvider;
+
+  @BeforeClass
+  public static void getEdmEntityContainerImpl() throws Exception {
+
+    edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    EntityContainerInfo entityContainer = new EntityContainerInfo().setName("Container");
+    EdmEntityContainer edmEntityContainer = new EdmEntityContainerImplProv(edmImplProv, entityContainer);
+
+    //    AssociationEnd end1 = new AssociationEnd().setRole("end1Role").setMultiplicity(EdmMultiplicity.ONE).setType(EdmSimpleTypeKind.String.getFullQualifiedName());
+    //    AssociationEnd end2 = new AssociationEnd().setRole("end2Role").setMultiplicity(EdmMultiplicity.ONE).setType(EdmSimpleTypeKind.String.getFullQualifiedName());
+    //    Association association = new Association().setName("association").setEnd1(end1).setEnd2(end2);
+    //    FullQualifiedName assocName = new FullQualifiedName("namespace", "association");
+    //    when(edmProvider.getAssociation(assocName)).thenReturn(association);
+
+    AssociationSetEnd associationSetEnd = new AssociationSetEnd().setRole("end1Role").setEntitySet("entitySetRole1");
+    EntitySet entitySet = new EntitySet().setName("entitySetRole1");
+    when(edmProvider.getEntitySet("Container", "entitySetRole1")).thenReturn(entitySet);
+
+    edmAssociationSetEnd = new EdmAssociationSetEndImplProv(associationSetEnd, edmEntityContainer.getEntitySet("entitySetRole1"));
+  }
+
+  @Test
+  public void testAssociationSetEnd() throws Exception {
+    EdmAssociationSetEnd setEnd = edmAssociationSetEnd;
+
+    assertEquals("end1Role", setEnd.getRole());
+    assertEquals("entitySetRole1", setEnd.getEntitySet().getName());
+  }
+
+  @Test
+  public void getAnnotations() throws Exception {
+    EdmAnnotatable annotatable = (EdmAnnotatable) edmAssociationSetEnd;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationSetImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationSetImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationSetImplProvTest.java
new file mode 100644
index 0000000..1f03fde
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationSetImplProvTest.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
+import org.apache.olingo.odata2.api.edm.EdmAnnotations;
+import org.apache.olingo.odata2.api.edm.EdmAssociationSet;
+import org.apache.olingo.odata2.api.edm.EdmEntityContainer;
+import org.apache.olingo.odata2.api.edm.EdmException;
+import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
+import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
+import org.apache.olingo.odata2.api.edm.FullQualifiedName;
+import org.apache.olingo.odata2.api.edm.provider.Association;
+import org.apache.olingo.odata2.api.edm.provider.AssociationEnd;
+import org.apache.olingo.odata2.api.edm.provider.AssociationSet;
+import org.apache.olingo.odata2.api.edm.provider.AssociationSetEnd;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo;
+import org.apache.olingo.odata2.api.edm.provider.EntitySet;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+public class EdmAssociationSetImplProvTest extends BaseTest {
+
+  private static EdmAssociationSet edmAssociationSet;
+  private static EdmProvider edmProvider;
+
+  @BeforeClass
+  public static void getEdmEntityContainerImpl() throws Exception {
+
+    edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    EntityContainerInfo entityContainer = new EntityContainerInfo().setName("Container");
+    EdmEntityContainer edmEntityContainer = new EdmEntityContainerImplProv(edmImplProv, entityContainer);
+
+    AssociationEnd end1 = new AssociationEnd().setRole("end1Role").setMultiplicity(EdmMultiplicity.ONE).setType(EdmSimpleTypeKind.String.getFullQualifiedName());
+    AssociationEnd end2 = new AssociationEnd().setRole("end2Role").setMultiplicity(EdmMultiplicity.ONE).setType(EdmSimpleTypeKind.String.getFullQualifiedName());
+    Association association = new Association().setName("association").setEnd1(end1).setEnd2(end2);
+    FullQualifiedName assocName = new FullQualifiedName("namespace", "association");
+    when(edmProvider.getAssociation(assocName)).thenReturn(association);
+
+    AssociationSetEnd endSet1 = new AssociationSetEnd().setRole("end1Role").setEntitySet("entitySetRole1");
+    when(edmProvider.getEntitySet("Container", "entitySetRole1")).thenReturn(new EntitySet().setName("entitySetRole1"));
+    AssociationSetEnd endSet2 = new AssociationSetEnd().setRole("end2Role");
+
+    AssociationSet associationSet = new AssociationSet().setName("associationSetName").setAssociation(assocName).setEnd1(endSet1).setEnd2(endSet2);
+
+    edmAssociationSet = new EdmAssociationSetImplProv(edmImplProv, associationSet, edmEntityContainer);
+  }
+
+  @Test
+  public void testAssociationSet() throws Exception {
+    EdmAssociationSet associationSet = edmAssociationSet;
+
+    assertEquals("associationSetName", associationSet.getName());
+
+    assertEquals("end1Role", associationSet.getEnd("end1Role").getRole());
+    assertEquals(null, associationSet.getEnd("endWrongRole"));
+  }
+
+  @Test(expected = EdmException.class)
+  public void testAssociationSetNoEntity() throws Exception {
+    EdmAssociationSet associationSet = edmAssociationSet;
+    associationSet.getEnd("end2Role");
+  }
+
+  @Test
+  public void testAssociationExists() throws Exception {
+    EdmAssociationSet associationSet = edmAssociationSet;
+    assertNotNull(associationSet.getAssociation());
+  }
+
+  @Test
+  public void testEntityContainer() throws Exception {
+    EdmAssociationSet associationSet = edmAssociationSet;
+    assertNotNull(associationSet.getEntityContainer());
+  }
+
+  @Test
+  public void getAnnotations() throws Exception {
+    EdmAnnotatable annotatable = (EdmAnnotatable) edmAssociationSet;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmComplexTypeImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmComplexTypeImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmComplexTypeImplProvTest.java
new file mode 100644
index 0000000..669b6d5
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmComplexTypeImplProvTest.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
+import org.apache.olingo.odata2.api.edm.EdmAnnotations;
+import org.apache.olingo.odata2.api.edm.EdmComplexType;
+import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
+import org.apache.olingo.odata2.api.edm.EdmTyped;
+import org.apache.olingo.odata2.api.edm.FullQualifiedName;
+import org.apache.olingo.odata2.api.edm.provider.ComplexType;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.Property;
+import org.apache.olingo.odata2.api.edm.provider.SimpleProperty;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+/**
+ * @author SAP AG
+ */
+public class EdmComplexTypeImplProvTest extends BaseTest {
+  private static EdmComplexTypeImplProv edmComplexType;
+  private static EdmComplexTypeImplProv edmComplexTypeWithBaseType;
+  private static EdmProvider edmProvider;
+
+  @BeforeClass
+  public static void getEdmEntityContainerImpl() throws Exception {
+
+    edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    ComplexType fooComplexType = new ComplexType().setName("fooComplexType");
+
+    List<Property> keyPropertysFoo = new ArrayList<Property>();
+    keyPropertysFoo.add(new SimpleProperty().setName("Name").setType(EdmSimpleTypeKind.String));
+    keyPropertysFoo.add(new SimpleProperty().setName("Address").setType(EdmSimpleTypeKind.String));
+    fooComplexType.setProperties(keyPropertysFoo);
+
+    edmComplexType = new EdmComplexTypeImplProv(edmImplProv, fooComplexType, "namespace");
+
+    FullQualifiedName barBaseTypeName = new FullQualifiedName("namespace", "barBase");
+    ComplexType barBase = new ComplexType().setName("barBase");
+    when(edmProvider.getComplexType(barBaseTypeName)).thenReturn(barBase);
+
+    List<Property> propertysBarBase = new ArrayList<Property>();
+    propertysBarBase.add(new SimpleProperty().setName("Name").setType(EdmSimpleTypeKind.String));
+    propertysBarBase.add(new SimpleProperty().setName("Address").setType(EdmSimpleTypeKind.String));
+    barBase.setProperties(propertysBarBase);
+
+    ComplexType barComplexType = new ComplexType().setName("barComplexType").setBaseType(barBaseTypeName);
+    edmComplexTypeWithBaseType = new EdmComplexTypeImplProv(edmImplProv, barComplexType, "namespace");
+
+  }
+
+  @Test
+  public void getPropertiesNames() throws Exception {
+    List<String> properties = edmComplexType.getPropertyNames();
+    assertNotNull(properties);
+    assertTrue(properties.contains("Name"));
+    assertTrue(properties.contains("Address"));
+  }
+
+  @Test
+  public void getPropertiesWithBaseType() throws Exception {
+    List<String> properties = edmComplexTypeWithBaseType.getPropertyNames();
+    assertNotNull(properties);
+    assertTrue(properties.contains("Name"));
+    assertTrue(properties.contains("Address"));
+  }
+
+  @Test
+  public void getBaseType() throws Exception {
+    EdmComplexType baseType = edmComplexTypeWithBaseType.getBaseType();
+    assertNotNull(baseType);
+    assertEquals("barBase", baseType.getName());
+    assertEquals("namespace", baseType.getNamespace());
+  }
+
+  @Test
+  public void getProperty() throws Exception {
+    EdmTyped property = edmComplexType.getProperty("Name");
+    assertNotNull(property);
+    assertEquals("Name", property.getName());
+  }
+
+  @Test
+  public void getAnnotations() throws Exception {
+    EdmAnnotatable annotatable = edmComplexType;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProvTest.java
new file mode 100644
index 0000000..6c0608c
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProvTest.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
+import org.apache.olingo.odata2.api.edm.EdmAnnotations;
+import org.apache.olingo.odata2.api.edm.EdmAssociation;
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.edm.EdmException;
+import org.apache.olingo.odata2.api.edm.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.edm.FullQualifiedName;
+import org.apache.olingo.odata2.api.edm.provider.AssociationSet;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo;
+import org.apache.olingo.odata2.api.edm.provider.EntitySet;
+import org.apache.olingo.odata2.api.edm.provider.FunctionImport;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+/**
+ * @author SAP AG
+ */
+public class EdmEntityContainerImplProvTest extends BaseTest {
+
+  private static EdmEntityContainerImplProv edmEntityContainer;
+
+  @BeforeClass
+  public static void getEdmEntityContainerImpl() throws Exception {
+    EdmProvider edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+    when(edmProvider.getEntityContainerInfo("Container")).thenReturn(new EntityContainerInfo().setName("Container"));
+
+    EntityContainerInfo entityContainer = new EntityContainerInfo().setName("Container1").setExtendz("Container");
+
+    EntitySet entitySetFooFromParent = new EntitySet().setName("fooFromParent");
+    when(edmProvider.getEntitySet("Container", "fooFromParent")).thenReturn(entitySetFooFromParent);
+
+    EntitySet entitySetFoo = new EntitySet().setName("foo");
+    when(edmProvider.getEntitySet("Container1", "foo")).thenReturn(entitySetFoo);
+
+    EntitySet entitySetBar = new EntitySet().setName("foo");
+    when(edmProvider.getEntitySet("Container1", "foo")).thenReturn(entitySetBar);
+
+    AssociationSet associationSet = new AssociationSet().setName("4711");
+    FullQualifiedName assocFQName = new FullQualifiedName("AssocNs", "AssocName");
+    when(edmProvider.getAssociationSet("Container1", assocFQName, "foo", "fromRole")).thenReturn(associationSet);
+
+    FunctionImport functionImportFoo = new FunctionImport().setName("foo");
+    when(edmProvider.getFunctionImport("Container1", "foo")).thenReturn(functionImportFoo);
+
+    FunctionImport functionImportBar = new FunctionImport().setName("foo");
+    when(edmProvider.getFunctionImport("Container1", "foo")).thenReturn(functionImportBar);
+
+    edmEntityContainer = new EdmEntityContainerImplProv(edmImplProv, entityContainer);
+  }
+
+  @Test
+  public void testEntityContainerName() throws EdmException {
+    assertEquals("Container1", edmEntityContainer.getName());
+  }
+
+  @Test
+  public void testEntityContainerInheritance() throws EdmException {
+    assertEquals("fooFromParent", edmEntityContainer.getEntitySet("fooFromParent").getName());
+
+    EdmEntitySet sourceEntitySet = mock(EdmEntitySet.class);
+    when(sourceEntitySet.getName()).thenReturn("foo");
+
+    EdmAssociation edmAssociation = mock(EdmAssociation.class);
+    when(edmAssociation.getNamespace()).thenReturn("AssocNs");
+    when(edmAssociation.getName()).thenReturn("AssocName");
+
+    EdmNavigationProperty edmNavigationProperty = mock(EdmNavigationProperty.class);
+    when(edmNavigationProperty.getRelationship()).thenReturn(edmAssociation);
+    when(edmNavigationProperty.getFromRole()).thenReturn("wrongRole");
+
+    boolean failed = false;
+    try {
+      edmEntityContainer.getAssociationSet(sourceEntitySet, edmNavigationProperty);
+    } catch (EdmException e) {
+      failed = true;
+    }
+
+    assertTrue(failed);
+  }
+
+  @Test
+  public void testEntitySetCache() throws EdmException {
+    assertEquals(edmEntityContainer.getEntitySet("foo"), edmEntityContainer.getEntitySet("foo"));
+    assertNotSame(edmEntityContainer.getEntitySet("foo"), edmEntityContainer.getEntitySet("bar"));
+  }
+
+  @Test
+  public void testAssociationSetCache() throws EdmException {
+    EdmEntitySet sourceEntitySet = mock(EdmEntitySet.class);
+    when(sourceEntitySet.getName()).thenReturn("foo");
+
+    EdmAssociation edmAssociation = mock(EdmAssociation.class);
+    when(edmAssociation.getNamespace()).thenReturn("AssocNs");
+    when(edmAssociation.getName()).thenReturn("AssocName");
+
+    EdmNavigationProperty edmNavigationProperty = mock(EdmNavigationProperty.class);
+    when(edmNavigationProperty.getRelationship()).thenReturn(edmAssociation);
+    when(edmNavigationProperty.getFromRole()).thenReturn("fromRole");
+
+    assertNotNull(edmEntityContainer.getAssociationSet(sourceEntitySet, edmNavigationProperty));
+    assertEquals(edmEntityContainer.getAssociationSet(sourceEntitySet, edmNavigationProperty), edmEntityContainer.getAssociationSet(sourceEntitySet, edmNavigationProperty));
+  }
+
+  @Test
+  public void testFunctionImportCache() throws EdmException {
+    assertEquals(edmEntityContainer.getFunctionImport("foo"), edmEntityContainer.getFunctionImport("foo"));
+    assertNotSame(edmEntityContainer.getFunctionImport("foo"), edmEntityContainer.getFunctionImport("bar"));
+  }
+
+  @Test
+  public void getAnnotations() throws Exception {
+    EdmAnnotatable annotatable = edmEntityContainer;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntitySetInfoImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntitySetInfoImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntitySetInfoImplProvTest.java
new file mode 100644
index 0000000..ad601e6
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntitySetInfoImplProvTest.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URI;
+
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmEntitySetInfo;
+import org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo;
+import org.apache.olingo.odata2.api.edm.provider.EntitySet;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+public class EdmEntitySetInfoImplProvTest extends BaseTest {
+
+  @Test
+  public void entityWithDefaultContainer() throws Exception {
+    String entitySetName = "Employees";
+    URI entitySetUri = new URI(entitySetName);
+    String entityContainerName = "Container";
+
+    EntitySet entitySet = new EntitySet();
+    entitySet.setName(entitySetName);
+
+    EntityContainerInfo entityContainerInfo = new EntityContainerInfo();
+    entityContainerInfo.setName(entityContainerName).setDefaultEntityContainer(true);
+
+    EdmEntitySetInfo info = new EdmEntitySetInfoImplProv(entitySet, entityContainerInfo);
+
+    assertEquals(entitySetName, info.getEntitySetName());
+    assertEquals(entitySetUri.toASCIIString(), info.getEntitySetUri().toASCIIString());
+    assertEquals(entityContainerName, info.getEntityContainerName());
+    assertTrue(info.isDefaultEntityContainer());
+  }
+
+  @Test
+  public void entityWithoutDefaultContainer() throws Exception {
+    String entitySetName = "Employees";
+    String entityContainerName = "Container";
+    URI entitySetUri = new URI(entityContainerName + "." + entitySetName);
+
+    EntitySet entitySet = new EntitySet();
+    entitySet.setName(entitySetName);
+
+    EntityContainerInfo entityContainerInfo = new EntityContainerInfo();
+    entityContainerInfo.setName(entityContainerName).setDefaultEntityContainer(false);
+
+    EdmEntitySetInfo info = new EdmEntitySetInfoImplProv(entitySet, entityContainerInfo);
+
+    assertEquals(entitySetName, info.getEntitySetName());
+    assertEquals(entitySetUri.toASCIIString(), info.getEntitySetUri().toASCIIString());
+    assertEquals(entityContainerName, info.getEntityContainerName());
+    assertFalse(info.isDefaultEntityContainer());
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntitySetProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntitySetProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntitySetProvTest.java
new file mode 100644
index 0000000..704289a
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntitySetProvTest.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
+import org.apache.olingo.odata2.api.edm.EdmAnnotations;
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.edm.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.edm.EdmTyped;
+import org.apache.olingo.odata2.api.edm.FullQualifiedName;
+import org.apache.olingo.odata2.api.edm.provider.Association;
+import org.apache.olingo.odata2.api.edm.provider.AssociationEnd;
+import org.apache.olingo.odata2.api.edm.provider.AssociationSet;
+import org.apache.olingo.odata2.api.edm.provider.AssociationSetEnd;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo;
+import org.apache.olingo.odata2.api.edm.provider.EntitySet;
+import org.apache.olingo.odata2.api.edm.provider.EntityType;
+import org.apache.olingo.odata2.api.edm.provider.NavigationProperty;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+/**
+ * @author SAP AG
+ *
+ */
+public class EdmEntitySetProvTest extends BaseTest {
+
+  private static EdmEntitySetImplProv edmEntitySetFoo;
+  private static EdmEntitySetImplProv edmEnitiySetBar;
+  private static EdmProvider edmProvider;
+
+  @BeforeClass
+  public static void getEdmEntityContainerImpl() throws Exception {
+
+    edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    EntityContainerInfo entityContainer = new EntityContainerInfo().setName("Container");
+    when(edmProvider.getEntityContainerInfo("Container")).thenReturn(entityContainer);
+    EdmEntityContainerImplProv edmEntityContainer = new EdmEntityContainerImplProv(edmImplProv, entityContainer);
+
+    EntitySet entitySetFoo = new EntitySet().setName("foo");
+    when(edmProvider.getEntitySet("Container", "foo")).thenReturn(entitySetFoo);
+
+    List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
+    FullQualifiedName fooBarAssocName = new FullQualifiedName("namespace", "fooBarAssoc");
+    navigationProperties.add(new NavigationProperty().setName("fooBarNav").setFromRole("fromFoo").setRelationship(fooBarAssocName).setToRole("toBar"));
+
+    EntityType fooEntityType = new EntityType().setName("fooEntityType").setNavigationProperties(navigationProperties);
+    FullQualifiedName fooEntityTypeFullName = new FullQualifiedName("namespace", "fooEntityType");
+    entitySetFoo.setEntityType(fooEntityTypeFullName);
+    when(edmProvider.getEntityType(fooEntityTypeFullName)).thenReturn(fooEntityType);
+
+    EntitySet entitySetBar = new EntitySet().setName("bar");
+    when(edmProvider.getEntitySet("Container", "bar")).thenReturn(entitySetBar);
+
+    EntityType barEntityType = new EntityType().setName("barEntityType");
+    FullQualifiedName barEntityTypeFullName = new FullQualifiedName("namespace", "barEntityType");
+    entitySetBar.setEntityType(barEntityTypeFullName);
+    when(edmProvider.getEntityType(barEntityTypeFullName)).thenReturn(barEntityType);
+
+    AssociationEnd fooEnd = new AssociationEnd().setRole("fromFoo");
+    AssociationEnd barEnd = new AssociationEnd().setRole("toBar");
+
+    Association fooBarAssoc = new Association().setName("fooBarAssoc").setEnd1(fooEnd).setEnd2(barEnd);
+    when(edmProvider.getAssociation(fooBarAssocName)).thenReturn(fooBarAssoc);
+
+    AssociationSet associationSet = new AssociationSet().setName("fooBarRelation").setEnd1(new AssociationSetEnd().setRole("fromFoo").setEntitySet("foo")).setEnd2(new AssociationSetEnd().setRole("toBar").setEntitySet("bar"));
+    FullQualifiedName assocFQName = new FullQualifiedName("namespace", "fooBarAssoc");
+    when(edmProvider.getAssociationSet("Container", assocFQName, "foo", "fromFoo")).thenReturn(associationSet);
+
+    edmEntitySetFoo = new EdmEntitySetImplProv(edmImplProv, entitySetFoo, edmEntityContainer);
+    edmEnitiySetBar = new EdmEntitySetImplProv(edmImplProv, entitySetBar, edmEntityContainer);
+  }
+
+  @Test
+  public void testEntitySet1() throws Exception {
+    assertEquals("foo", edmEntitySetFoo.getName());
+    assertEquals("Container", edmEntitySetFoo.getEntityContainer().getName());
+  }
+
+  @Test
+  public void testEntitySet2() throws Exception {
+    assertEquals("bar", edmEnitiySetBar.getName());
+    assertEquals("Container", edmEnitiySetBar.getEntityContainer().getName());
+  }
+
+  @Test
+  public void testEntitySetNavigation() throws Exception {
+    List<String> navPropertyyNames = edmEntitySetFoo.getEntityType().getNavigationPropertyNames();
+    assertTrue(navPropertyyNames.contains("fooBarNav"));
+    EdmTyped navProperty = edmEntitySetFoo.getEntityType().getProperty("fooBarNav");
+    assertNotNull(navProperty);
+
+    EdmEntitySet relatedEntitySet = edmEntitySetFoo.getRelatedEntitySet((EdmNavigationProperty) navProperty);
+
+    assertEquals(edmEnitiySetBar.getName(), relatedEntitySet.getName());
+  }
+
+  @Test
+  public void testEntitySetType() throws Exception {
+    assertEquals("fooEntityType", edmEntitySetFoo.getEntityType().getName());
+    assertEquals(edmEntitySetFoo.getEntityType().getName(), edmProvider.getEntityType(new FullQualifiedName("namespace", "fooEntityType")).getName());
+  }
+
+  @Test
+  public void getAnnotations() throws Exception {
+    EdmAnnotatable annotatable = edmEntitySetFoo;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityTypeImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityTypeImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityTypeImplProvTest.java
new file mode 100644
index 0000000..44172ff
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityTypeImplProvTest.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
+import org.apache.olingo.odata2.api.edm.EdmAnnotations;
+import org.apache.olingo.odata2.api.edm.EdmProperty;
+import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
+import org.apache.olingo.odata2.api.edm.FullQualifiedName;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.EntityType;
+import org.apache.olingo.odata2.api.edm.provider.Key;
+import org.apache.olingo.odata2.api.edm.provider.NavigationProperty;
+import org.apache.olingo.odata2.api.edm.provider.Property;
+import org.apache.olingo.odata2.api.edm.provider.PropertyRef;
+import org.apache.olingo.odata2.api.edm.provider.SimpleProperty;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+/**
+ * @author SAP AG
+ */
+public class EdmEntityTypeImplProvTest extends BaseTest {
+
+  private static EdmEntityTypeImplProv edmEntityType;
+  private static EdmEntityTypeImplProv edmEntityTypeWithBaseType;
+  private static EdmProvider edmProvider;
+
+  @BeforeClass
+  public static void getEdmEntityContainerImpl() throws Exception {
+
+    edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
+    FullQualifiedName fooBarAssocName = new FullQualifiedName("namespace", "fooBarAssoc");
+    navigationProperties.add(new NavigationProperty().setName("fooBarNav").setFromRole("fromFoo").setRelationship(fooBarAssocName).setToRole("toBar"));
+
+    EntityType fooEntityType = new EntityType().setName("fooEntityType").setNavigationProperties(navigationProperties);
+    FullQualifiedName fooEntityTypeFullName = new FullQualifiedName("namespace", "fooEntityType");
+    when(edmProvider.getEntityType(fooEntityTypeFullName)).thenReturn(fooEntityType);
+
+    List<Property> keyPropertysFoo = new ArrayList<Property>();
+    Property keyPropFoo = new SimpleProperty().setName("Id").setType(EdmSimpleTypeKind.String);
+    keyPropertysFoo.add(keyPropFoo);
+    fooEntityType.setProperties(keyPropertysFoo);
+
+    PropertyRef refToKeyFoo = new PropertyRef().setName("Id");
+    List<PropertyRef> propRefKeysFoo = new ArrayList<PropertyRef>();
+    propRefKeysFoo.add(refToKeyFoo);
+
+    Key fooTypeKey = new Key().setKeys(propRefKeysFoo);
+    fooEntityType.setKey(fooTypeKey);
+
+    edmEntityType = new EdmEntityTypeImplProv(edmImplProv, fooEntityType, "namespace");
+
+    FullQualifiedName barBaseTypeName = new FullQualifiedName("namespace", "barBase");
+    EntityType barBase = new EntityType().setName("barBase");
+    when(edmProvider.getEntityType(barBaseTypeName)).thenReturn(barBase);
+
+    List<NavigationProperty> navigationPropertiesBarBase = new ArrayList<NavigationProperty>();
+    navigationPropertiesBarBase.add(new NavigationProperty().setName("barBaseNav"));
+    barBase.setNavigationProperties(navigationPropertiesBarBase);
+
+    List<Property> keyPropertysBarBase = new ArrayList<Property>();
+    Property keyPropBarBase = new SimpleProperty().setName("Id").setType(EdmSimpleTypeKind.String);
+    keyPropertysBarBase.add(keyPropBarBase);
+    barBase.setProperties(keyPropertysBarBase);
+
+    PropertyRef refToKeyBarBase = new PropertyRef().setName("Id");
+    List<PropertyRef> propRefKeysBarBase = new ArrayList<PropertyRef>();
+    propRefKeysBarBase.add(refToKeyBarBase);
+
+    Key barBaseTypeKey = new Key().setKeys(propRefKeysBarBase);
+    barBase.setKey(barBaseTypeKey);
+
+    EntityType barEntityType = new EntityType().setName("barEntityType").setBaseType(barBaseTypeName);
+    FullQualifiedName barEntityTypeFullName = new FullQualifiedName("namespace", "barEntityType");
+    when(edmProvider.getEntityType(barEntityTypeFullName)).thenReturn(barEntityType);
+
+    edmEntityTypeWithBaseType = new EdmEntityTypeImplProv(edmImplProv, barEntityType, "namespace");
+
+  }
+
+  @Test
+  public void getKeyProperties() throws Exception {
+    List<EdmProperty> keyProperties = edmEntityType.getKeyProperties();
+    assertNotNull(keyProperties);
+    assertEquals("Id", keyProperties.get(0).getName());
+  }
+
+  @Test
+  public void getKeyPropertiesNames() throws Exception {
+    List<String> keyProperties = edmEntityType.getKeyPropertyNames();
+    assertNotNull(keyProperties);
+    assertTrue(keyProperties.contains("Id"));
+
+    List<String> properties = edmEntityType.getPropertyNames();
+    assertNotNull(properties);
+    assertTrue(properties.contains("Id"));
+  }
+
+  @Test
+  public void getPropertiesNames() throws Exception {
+    List<String> properties = edmEntityType.getPropertyNames();
+    assertNotNull(properties);
+    assertTrue(properties.contains("Id"));
+  }
+
+  @Test
+  public void getNavProperties() throws Exception {
+    List<String> navProperties = edmEntityType.getNavigationPropertyNames();
+    assertNotNull(navProperties);
+    assertTrue(navProperties.contains("fooBarNav"));
+  }
+
+  @Test
+  public void getKeyPropertiesWithBaseType() throws Exception {
+    List<EdmProperty> keyProperties = edmEntityTypeWithBaseType.getKeyProperties();
+    assertNotNull(keyProperties);
+    assertEquals("Id", keyProperties.get(0).getName());
+  }
+
+  @Test
+  public void getKeyPropertiesNamesWithBaseType() throws Exception {
+    List<String> keyProperties = edmEntityTypeWithBaseType.getKeyPropertyNames();
+    assertNotNull(keyProperties);
+    assertTrue(keyProperties.contains("Id"));
+  }
+
+  @Test
+  public void getPropertiesWithBaseType() throws Exception {
+    List<String> properties = edmEntityTypeWithBaseType.getPropertyNames();
+    assertNotNull(properties);
+    assertTrue(properties.contains("Id"));
+  }
+
+  @Test
+  public void getNavPropertiesWithBaseType() throws Exception {
+    List<String> navProperties = edmEntityTypeWithBaseType.getNavigationPropertyNames();
+    assertNotNull(navProperties);
+    assertTrue(navProperties.contains("barBaseNav"));
+  }
+
+  @Test
+  public void getAnnotations() throws Exception {
+    EdmAnnotatable annotatable = edmEntityType;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmFunctionImportImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmFunctionImportImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmFunctionImportImplProvTest.java
new file mode 100644
index 0000000..fb9ebe5
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmFunctionImportImplProvTest.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jetty.http.HttpMethods;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
+import org.apache.olingo.odata2.api.edm.EdmAnnotations;
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
+import org.apache.olingo.odata2.api.edm.EdmParameter;
+import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
+import org.apache.olingo.odata2.api.edm.EdmTyped;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo;
+import org.apache.olingo.odata2.api.edm.provider.EntitySet;
+import org.apache.olingo.odata2.api.edm.provider.FunctionImport;
+import org.apache.olingo.odata2.api.edm.provider.FunctionImportParameter;
+import org.apache.olingo.odata2.api.edm.provider.ReturnType;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+/**
+ * @author SAP AG
+ */
+public class EdmFunctionImportImplProvTest extends BaseTest {
+
+  private static EdmFunctionImportImplProv edmFunctionImport;
+  private static EdmFunctionImportImplProv edmFunctionImportWithoutParameters;
+  private static EdmEntityContainerImplProv edmEntityContainer;
+
+  @BeforeClass
+  public static void getEdmEntityContainerImpl() throws Exception {
+    EdmProvider edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    EntityContainerInfo containerInfo = new EntityContainerInfo().setName("Container");
+    when(edmProvider.getEntityContainerInfo("Container")).thenReturn(containerInfo);
+    edmEntityContainer = new EdmEntityContainerImplProv(edmImplProv, containerInfo);
+
+    EntitySet fooEntitySet = new EntitySet().setName("fooEntitySet");
+    when(edmProvider.getEntitySet("Container", "fooEntitySet")).thenReturn(fooEntitySet);
+
+    ReturnType fooReturnType = new ReturnType().setTypeName(EdmSimpleTypeKind.String.getFullQualifiedName()).setMultiplicity(EdmMultiplicity.ONE);
+
+    List<FunctionImportParameter> parameters = new ArrayList<FunctionImportParameter>();
+    FunctionImportParameter parameter = new FunctionImportParameter().setName("fooParameter1").setType(EdmSimpleTypeKind.String);
+    parameters.add(parameter);
+
+    parameter = new FunctionImportParameter().setName("fooParameter2").setType(EdmSimpleTypeKind.String);
+    parameters.add(parameter);
+
+    parameter = new FunctionImportParameter().setName("fooParameter3").setType(EdmSimpleTypeKind.String);
+    parameters.add(parameter);
+
+    FunctionImport functionImportFoo = new FunctionImport().setName("foo").setHttpMethod(HttpMethods.GET).setReturnType(fooReturnType).setEntitySet("fooEntitySet").setParameters(parameters);
+    when(edmProvider.getFunctionImport("Container", "foo")).thenReturn(functionImportFoo);
+    edmFunctionImport = new EdmFunctionImportImplProv(edmImplProv, functionImportFoo, edmEntityContainer);
+
+    FunctionImport functionImportBar = new FunctionImport().setName("bar").setHttpMethod(HttpMethods.GET);
+    when(edmProvider.getFunctionImport("Container", "bar")).thenReturn(functionImportBar);
+    edmFunctionImportWithoutParameters = new EdmFunctionImportImplProv(edmImplProv, functionImportBar, edmEntityContainer);
+
+  }
+
+  @Test
+  public void functionImport() throws Exception {
+    assertEquals("foo", edmFunctionImport.getName());
+    assertEquals(HttpMethods.GET, edmFunctionImport.getHttpMethod());
+
+  }
+
+  @Test
+  public void containerName() throws Exception {
+    assertEquals(edmEntityContainer, edmFunctionImport.getEntityContainer());
+  }
+
+  @Test
+  public void returnType() throws Exception {
+    EdmTyped returnType = edmFunctionImport.getReturnType();
+    assertNotNull(returnType);
+    assertEquals(EdmSimpleTypeKind.String.getFullQualifiedName().getName(), returnType.getType().getName());
+    assertEquals(EdmMultiplicity.ONE, returnType.getMultiplicity());
+  }
+
+  @Test
+  public void entitySet() throws Exception {
+    EdmEntitySet entitySet = edmFunctionImport.getEntitySet();
+    assertNotNull(entitySet);
+    assertEquals("fooEntitySet", entitySet.getName());
+    assertEquals(edmEntityContainer.getEntitySet("fooEntitySet"), entitySet);
+  }
+
+  @Test
+  public void parameterExisting() throws Exception {
+    List<String> parameterNames = edmFunctionImport.getParameterNames();
+    assertTrue(parameterNames.contains("fooParameter1"));
+    assertTrue(parameterNames.contains("fooParameter2"));
+    assertTrue(parameterNames.contains("fooParameter3"));
+
+    EdmParameter parameter = edmFunctionImport.getParameter("fooParameter1");
+    assertNotNull(parameter);
+    assertEquals("fooParameter1", parameter.getName());
+
+    parameter = edmFunctionImport.getParameter("fooParameter1");
+    assertNotNull(parameter);
+    assertEquals("fooParameter1", parameter.getName());
+
+    parameter = edmFunctionImport.getParameter("fooParameter2");
+    assertNotNull(parameter);
+    assertEquals("fooParameter2", parameter.getName());
+
+    parameter = edmFunctionImport.getParameter("fooParameter3");
+    assertNotNull(parameter);
+    assertEquals("fooParameter3", parameter.getName());
+  }
+
+  @Test
+  public void parameterNotExisting() throws Exception {
+    assertNotNull(edmFunctionImportWithoutParameters.getParameterNames());
+
+    EdmParameter parameter = edmFunctionImportWithoutParameters.getParameter("fooParameter1");
+    assertNull(parameter);
+
+    parameter = edmFunctionImportWithoutParameters.getParameter("fooParameter2");
+    assertNull(parameter);
+
+    parameter = edmFunctionImportWithoutParameters.getParameter("fooParameter3");
+    assertNull(parameter);
+  }
+
+  @Test
+  public void parameterAnnotations() throws Exception {
+    EdmParameter parameter = edmFunctionImport.getParameter("fooParameter1");
+    assertNotNull(parameter);
+    EdmAnnotatable annotatable = (EdmAnnotatable) parameter;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+
+  @Test
+  public void getAnnotations() throws Exception {
+    EdmAnnotatable annotatable = edmFunctionImport;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmImplProvTest.java
new file mode 100644
index 0000000..97cea60
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmImplProvTest.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmException;
+import org.apache.olingo.odata2.api.edm.FullQualifiedName;
+import org.apache.olingo.odata2.api.edm.provider.Association;
+import org.apache.olingo.odata2.api.edm.provider.ComplexType;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo;
+import org.apache.olingo.odata2.api.edm.provider.EntityType;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+public class EdmImplProvTest extends BaseTest {
+
+  private static EdmImplProv edm;
+
+  @BeforeClass
+  public static void getEdmImpl() throws Exception {
+    EdmProvider edmProvider = mock(EdmProvider.class);
+
+    EntityType entityType = new EntityType().setName("EntityType1");
+    when(edmProvider.getEntityType(new FullQualifiedName("EntityType1Ns", "EntityType1"))).thenReturn(entityType);
+
+    ComplexType complexType = new ComplexType().setName("ComplexType1");
+    when(edmProvider.getComplexType(new FullQualifiedName("ComplexType1Ns", "ComplexType1"))).thenReturn(complexType);
+
+    Association association = new Association().setName("Association1");
+    when(edmProvider.getAssociation(new FullQualifiedName("Association1Ns", "Association1"))).thenReturn(association);
+
+    EntityContainerInfo defaultEntityContainer = new EntityContainerInfo().setName("Container1");
+    when(edmProvider.getEntityContainerInfo(null)).thenReturn(defaultEntityContainer);
+    when(edmProvider.getEntityContainerInfo("Container1")).thenReturn(defaultEntityContainer);
+
+    edm = new EdmImplProv(edmProvider);
+  }
+
+  @Test
+  public void testEntityType() throws EdmException {
+    assertEquals("EntityType1", edm.getEntityType("EntityType1Ns", "EntityType1").getName());
+  }
+
+  @Test
+  public void testComplexType() throws EdmException {
+    assertEquals("ComplexType1", edm.getComplexType("ComplexType1Ns", "ComplexType1").getName());
+  }
+
+  @Test
+  public void testAssociation() throws EdmException {
+    assertEquals("Association1", edm.getAssociation("Association1Ns", "Association1").getName());
+  }
+
+  @Test
+  public void testDefaultEntityContainer() throws EdmException {
+    assertEquals(edm.getEntityContainer("Container1"), edm.getDefaultEntityContainer());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmMappingTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmMappingTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmMappingTest.java
new file mode 100644
index 0000000..d3fede1
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmMappingTest.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.mock;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmMapping;
+import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
+import org.apache.olingo.odata2.api.edm.provider.CustomizableFeedMappings;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.Mapping;
+import org.apache.olingo.odata2.api.edm.provider.NavigationProperty;
+import org.apache.olingo.odata2.api.edm.provider.SimpleProperty;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+public class EdmMappingTest extends BaseTest {
+
+  private static EdmPropertyImplProv propertySimpleProvider;
+  private static EdmNavigationPropertyImplProv navPropertyProvider;
+  private static EdmMappingTest mappedObject;
+
+  @BeforeClass
+  public static void setup() throws Exception {
+
+    EdmProvider edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    mappedObject = new EdmMappingTest();
+
+    Mapping propertySimpleMapping = new Mapping().setMimeType("mimeType").setInternalName("value").setObject(mappedObject);
+    CustomizableFeedMappings propertySimpleFeedMappings = new CustomizableFeedMappings().setFcKeepInContent(true);
+    SimpleProperty propertySimple = new SimpleProperty().setName("PropertyName").setType(EdmSimpleTypeKind.String)
+        .setMimeType("mimeType").setMapping(propertySimpleMapping).setCustomizableFeedMappings(propertySimpleFeedMappings);
+    propertySimpleProvider = new EdmSimplePropertyImplProv(edmImplProv, propertySimple);
+
+    NavigationProperty navProperty = new NavigationProperty().setName("navProperty").setFromRole("fromRole").setToRole("toRole").setMapping(propertySimpleMapping);
+    navPropertyProvider = new EdmNavigationPropertyImplProv(edmImplProv, navProperty);
+  }
+
+  @Test
+  public void testMappingProperty() throws Exception {
+    EdmMapping mapping = propertySimpleProvider.getMapping();
+    assertNotNull(mapping);
+    assertEquals("value", mapping.getInternalName());
+    assertEquals("mimeType", mapping.getMimeType());
+    assertEquals(mappedObject, mapping.getObject());
+  }
+
+  @Test
+  public void testMappingNavigationProperty() throws Exception {
+    EdmMapping mapping = navPropertyProvider.getMapping();
+    assertNotNull(mapping);
+    assertEquals("value", mapping.getInternalName());
+    assertEquals("mimeType", mapping.getMimeType());
+    assertEquals(mappedObject, mapping.getObject());
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmNamedImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmNamedImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmNamedImplProvTest.java
new file mode 100644
index 0000000..0a60a4e
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmNamedImplProvTest.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.mockito.Mockito.mock;
+
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmException;
+import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.SimpleProperty;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+public class EdmNamedImplProvTest extends BaseTest {
+
+  @Test(expected = EdmException.class)
+  public void testPropertySimple() throws Exception {
+
+    EdmProvider edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    SimpleProperty propertySimple = new SimpleProperty().setName("Prop;ertyName").setType(EdmSimpleTypeKind.String);
+    new EdmSimplePropertyImplProv(edmImplProv, propertySimple);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmNavigationPropertyImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmNavigationPropertyImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmNavigationPropertyImplProvTest.java
new file mode 100644
index 0000000..d92c9d4
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmNavigationPropertyImplProvTest.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
+import org.apache.olingo.odata2.api.edm.EdmAnnotations;
+import org.apache.olingo.odata2.api.edm.EdmAssociation;
+import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
+import org.apache.olingo.odata2.api.edm.FullQualifiedName;
+import org.apache.olingo.odata2.api.edm.provider.Association;
+import org.apache.olingo.odata2.api.edm.provider.AssociationEnd;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.EntityType;
+import org.apache.olingo.odata2.api.edm.provider.NavigationProperty;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+/**
+ * @author SAP AG
+ */
+public class EdmNavigationPropertyImplProvTest extends BaseTest {
+
+  private static EdmProvider edmProvider;
+  private static EdmNavigationPropertyImplProv navPropertyProvider;
+
+  @BeforeClass
+  public static void setup() throws Exception {
+
+    edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    FullQualifiedName relationship = new FullQualifiedName("namespace", "associationName");
+    Association association = new Association().setName("associationName");
+    when(edmProvider.getAssociation(relationship)).thenReturn(association);
+
+    AssociationEnd end1 = new AssociationEnd().setRole("fromRole");
+    FullQualifiedName entityName = new FullQualifiedName("namespace", "entityName");
+    AssociationEnd end2 = new AssociationEnd().setRole("toRole").setMultiplicity(EdmMultiplicity.ONE).setType(entityName);
+    association.setEnd1(end1).setEnd2(end2);
+
+    EntityType entityType = new EntityType().setName("entityName");
+    when(edmProvider.getEntityType(entityName)).thenReturn(entityType);
+
+    NavigationProperty navProperty = new NavigationProperty().setName("navProperty").setFromRole("fromRole").setToRole("toRole").setRelationship(relationship);
+    navPropertyProvider = new EdmNavigationPropertyImplProv(edmImplProv, navProperty);
+  }
+
+  @Test
+  public void testNavigationProperty() throws Exception {
+    assertNotNull(navPropertyProvider);
+    assertEquals("navProperty", navPropertyProvider.getName());
+    assertEquals("fromRole", navPropertyProvider.getFromRole());
+    assertEquals("toRole", navPropertyProvider.getToRole());
+    assertEquals(EdmMultiplicity.ONE, navPropertyProvider.getMultiplicity());
+    assertEquals("entityName", navPropertyProvider.getType().getName());
+
+    EdmAssociation association = navPropertyProvider.getRelationship();
+    assertNotNull(association);
+    assertEquals("associationName", association.getName());
+  }
+
+  @Test
+  public void getAnnotations() throws Exception {
+    EdmAnnotatable annotatable = navPropertyProvider;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ff2b0a0e/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmPropertyImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmPropertyImplProvTest.java b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmPropertyImplProvTest.java
new file mode 100644
index 0000000..7356c5d
--- /dev/null
+++ b/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmPropertyImplProvTest.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * 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.odata2.core.edm.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
+import org.apache.olingo.odata2.api.edm.EdmAnnotations;
+import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
+import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
+import org.apache.olingo.odata2.api.edm.EdmTypeKind;
+import org.apache.olingo.odata2.api.edm.FullQualifiedName;
+import org.apache.olingo.odata2.api.edm.provider.ComplexProperty;
+import org.apache.olingo.odata2.api.edm.provider.ComplexType;
+import org.apache.olingo.odata2.api.edm.provider.CustomizableFeedMappings;
+import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.Facets;
+import org.apache.olingo.odata2.api.edm.provider.Mapping;
+import org.apache.olingo.odata2.api.edm.provider.SimpleProperty;
+import org.apache.olingo.odata2.core.edm.EdmSimpleTypeFacadeImpl;
+import org.apache.olingo.odata2.testutil.fit.BaseTest;
+
+/**
+ * @author SAP AG
+ */
+public class EdmPropertyImplProvTest extends BaseTest {
+
+  private static EdmProvider edmProvider;
+  private static EdmPropertyImplProv propertySimpleProvider;
+  private static EdmPropertyImplProv propertySimpleWithFacetsProvider;
+  private static EdmPropertyImplProv propertySimpleWithFacetsProvider2;
+  private static EdmPropertyImplProv propertyComplexProvider;
+
+  @BeforeClass
+  public static void setup() throws Exception {
+
+    edmProvider = mock(EdmProvider.class);
+    EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
+
+    Mapping propertySimpleMapping = new Mapping().setMimeType("mimeType2").setInternalName("value");
+    CustomizableFeedMappings propertySimpleFeedMappings = new CustomizableFeedMappings().setFcKeepInContent(true);
+    SimpleProperty propertySimple = new SimpleProperty().setName("PropertyName").setType(EdmSimpleTypeKind.String)
+        .setMimeType("mimeType").setMapping(propertySimpleMapping).setCustomizableFeedMappings(propertySimpleFeedMappings);
+    propertySimpleProvider = new EdmSimplePropertyImplProv(edmImplProv, propertySimple);
+
+    Facets facets = new Facets().setNullable(false);
+    SimpleProperty propertySimpleWithFacets = new SimpleProperty().setName("PropertyName").setType(EdmSimpleTypeKind.String).setFacets(facets);
+    propertySimpleWithFacetsProvider = new EdmSimplePropertyImplProv(edmImplProv, propertySimpleWithFacets);
+
+    Facets facets2 = new Facets().setNullable(true);
+    SimpleProperty propertySimpleWithFacets2 = new SimpleProperty().setName("PropertyName").setType(EdmSimpleTypeKind.String).setFacets(facets2);
+    propertySimpleWithFacetsProvider2 = new EdmSimplePropertyImplProv(edmImplProv, propertySimpleWithFacets2);
+
+    ComplexType complexType = new ComplexType().setName("complexType");
+    FullQualifiedName complexName = new FullQualifiedName("namespace", "complexType");
+    when(edmProvider.getComplexType(complexName)).thenReturn(complexType);
+
+    ComplexProperty propertyComplex = new ComplexProperty().setName("complexProperty").setType(complexName);
+    propertyComplexProvider = new EdmComplexPropertyImplProv(edmImplProv, propertyComplex);
+
+  }
+
+  @Test
+  public void testPropertySimple() throws Exception {
+    assertNotNull(propertySimpleProvider);
+    assertEquals("PropertyName", propertySimpleProvider.getName());
+    assertNotNull(propertySimpleProvider.getType());
+    assertEquals(EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.String), propertySimpleProvider.getType());
+    assertEquals("mimeType", propertySimpleProvider.getMimeType());
+    assertNotNull(propertySimpleProvider.getMapping());
+    assertEquals("mimeType2", propertySimpleProvider.getMapping().getMimeType());
+    assertNotNull(propertySimpleProvider.getCustomizableFeedMappings());
+    assertEquals("value", propertySimpleProvider.getMapping().getInternalName());
+    assertNull(propertySimpleProvider.getFacets());
+    assertNotNull(propertySimpleProvider.getMultiplicity());
+    assertEquals(EdmMultiplicity.ZERO_TO_ONE, propertySimpleProvider.getMultiplicity());
+  }
+
+  @Test
+  public void testPropertySimpleWithFacets() throws Exception {
+    assertNotNull(propertySimpleWithFacetsProvider.getFacets());
+    assertNotNull(propertySimpleWithFacetsProvider.getMultiplicity());
+    assertEquals(EdmMultiplicity.ONE, propertySimpleWithFacetsProvider.getMultiplicity());
+
+    assertNotNull(propertySimpleWithFacetsProvider2.getFacets());
+    assertNotNull(propertySimpleWithFacetsProvider2.getMultiplicity());
+    assertEquals(EdmMultiplicity.ZERO_TO_ONE, propertySimpleWithFacetsProvider2.getMultiplicity());
+  }
+
+  @Test
+  public void testPropertyComplex() throws Exception {
+    assertNotNull(propertyComplexProvider);
+    assertEquals("complexProperty", propertyComplexProvider.getName());
+    assertEquals(EdmTypeKind.COMPLEX, propertyComplexProvider.getType().getKind());
+    assertEquals("complexType", propertyComplexProvider.getType().getName());
+  }
+
+  @Test
+  public void getAnnotations() throws Exception {
+    EdmAnnotatable annotatable = propertySimpleProvider;
+    EdmAnnotations annotations = annotatable.getAnnotations();
+    assertNull(annotations.getAnnotationAttributes());
+    assertNull(annotations.getAnnotationElements());
+  }
+}


Mime
View raw message