You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/10/16 11:02:00 UTC

git commit: [OLINGO-422] Minor refactoring for EdmxReference*

Repository: olingo-odata4
Updated Branches:
  refs/heads/master 7f86b264f -> 2fbab6524


[OLINGO-422] Minor refactoring for EdmxReference*


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

Branch: refs/heads/master
Commit: 2fbab6524e4eb0a01f030fbde8340eee53911765
Parents: 7f86b26
Author: Michael Bolz <mi...@sap.com>
Authored: Thu Oct 16 10:51:52 2014 +0200
Committer: Michael Bolz <mi...@sap.com>
Committed: Thu Oct 16 10:57:26 2014 +0200

----------------------------------------------------------------------
 .../olingo/server/api/edmx/EdmxReference.java   | 59 +++++++++++++++--
 .../server/api/edmx/EdmxReferenceInclude.java   | 41 ++++++++++--
 .../edmx/EdmxReferenceIncludeAnnotation.java    | 70 +++++++++++++++++---
 .../server/core/edmx/EdmxReferenceImpl.java     | 65 ------------------
 .../EdmxReferenceIncludeAnnotationImpl.java     | 55 ---------------
 .../core/edmx/EdmxReferenceIncludeImpl.java     | 47 -------------
 .../serializer/xml/MetadataDocumentTest.java    | 50 +++++++-------
 7 files changed, 173 insertions(+), 214 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2fbab652/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReference.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReference.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReference.java
index c14b7e6..1af98df 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReference.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReference.java
@@ -19,28 +19,75 @@
 package org.apache.olingo.server.api.edmx;
 
 import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 /**
+ * POJO for Edmx Reference.
  */
-public interface EdmxReference {
+public class EdmxReference {
+
+  private final URI uri;
+  private final List<EdmxReferenceInclude> edmxIncludes;
+  private final List<EdmxReferenceIncludeAnnotation> edmxIncludeAnnotations;
+
   /**
-   * Get URI for the Reference
-   * @return
+   * Create reference with given uri
+   *
+   * @param uri of reference
    */
-  URI getUri();
+  public EdmxReference(URI uri) {
+    this.uri = uri;
+    edmxIncludes = new ArrayList<EdmxReferenceInclude>();
+    edmxIncludeAnnotations = new ArrayList<EdmxReferenceIncludeAnnotation>();
+  }
+
+  /**
+   * Get URI for the reference
+   * @return uri for the reference
+   */
+  public URI getUri() {
+    return uri;
+  }
 
   /**
    * edmx:Include elements that specify the schemas to include from the target document
    *
    * @return list of {@link EdmxReferenceInclude} in reference or null if none specified
    */
-  List<EdmxReferenceInclude> getIncludes();
+  public List<EdmxReferenceInclude> getIncludes() {
+    return Collections.unmodifiableList(edmxIncludes);
+  }
+
+  /**
+   * Add include element to current list.
+   *
+   * @param include to be added
+   * @return this EdmxReference object
+   */
+  public EdmxReference addInclude(EdmxReferenceInclude include) {
+    edmxIncludes.add(include);
+    return this;
+  }
 
   /**
    * edmx:IncludeAnnotations elements that specify the annotations to include from the target document.
    *
    * @return List of {@link EdmxReferenceIncludeAnnotation} or null if none specified
    */
-  List<EdmxReferenceIncludeAnnotation> getIncludeAnnotations();
+  public List<EdmxReferenceIncludeAnnotation> getIncludeAnnotations() {
+    return Collections.unmodifiableList(edmxIncludeAnnotations);
+  }
+
+  /**
+   * Add include annotation element to current list.
+   *
+   * @param includeAnnotation to be added
+   * @return this EdmxReference object
+   */
+  public EdmxReference addIncludeAnnotation(EdmxReferenceIncludeAnnotation includeAnnotation) {
+    edmxIncludeAnnotations.add(includeAnnotation);
+    return this;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2fbab652/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReferenceInclude.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReferenceInclude.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReferenceInclude.java
index f75e502..2cbff9f 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReferenceInclude.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReferenceInclude.java
@@ -21,14 +21,41 @@ package org.apache.olingo.server.api.edmx;
 /**
  * edmx:Include elements that specify the schemas to include from the target document.
  */
-public interface EdmxReferenceInclude {
-	/**
-	 * @return Namespace of the include
-	 */
-	String getNamespace();
-	
+public class EdmxReferenceInclude {
+  private final String namespace;
+  private final String alias;
+
+  /**
+   * Create include with given namespace and alias.
+   *
+   * @param namespace of include
+   * @param alias of include
+   */
+  public EdmxReferenceInclude(String namespace, String alias) {
+    this.namespace = namespace;
+    this.alias = alias;
+  }
+
+  /**
+   * Create include with given namespace and empty (<code>NULL</code>) alias.
+   *
+   * @param namespace of include
+   */
+  public EdmxReferenceInclude(String namespace) {
+    this(namespace, null);
+  }
+
+  /**
+   * @return Namespace of the include
+   */
+  public String getNamespace() {
+    return namespace;
+  }
+
 	/**
 	 * @return alias of the include if one defined; null otherwise
 	 */
-	String getAlias();
+  public String getAlias() {
+    return alias;
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2fbab652/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReferenceIncludeAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReferenceIncludeAnnotation.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReferenceIncludeAnnotation.java
index 4067012..9d6b6ab 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReferenceIncludeAnnotation.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edmx/EdmxReferenceIncludeAnnotation.java
@@ -19,21 +19,75 @@
 package org.apache.olingo.server.api.edmx;
 
 /**
- *
+ * POJO for Edmx Reference Include Annotation.
  */
-public interface EdmxReferenceIncludeAnnotation {
-	/**
+public class EdmxReferenceIncludeAnnotation {
+  private final String termNamespace;
+  private String qualifier;
+  private String targetNamespace;
+
+  /**
+   * Create include annotation with given termNamespace and empty qualifier and targetNamespace.
+   *
+   * @param termNamespace of include annotation
+   */
+  public EdmxReferenceIncludeAnnotation(String termNamespace) {
+    this(termNamespace, null, null);
+  }
+
+  /**
+   * Create include annotation with given termNamespace, qualifier and targetNamespace.
+   *
+   * @param termNamespace of include annotation
+   * @param qualifier of include annotation
+   * @param targetNamespace of include annotation
+   */
+  public EdmxReferenceIncludeAnnotation(String termNamespace, String qualifier, String targetNamespace) {
+    this.termNamespace = termNamespace;
+    this.qualifier = qualifier;
+    this.targetNamespace = targetNamespace;
+  }
+
+  /**
 	 * @return TermNamespace of the include annotation
 	 */
-	String getTermNamespace();
-	
+  public String getTermNamespace() {
+    return termNamespace;
+  }
+
 	/**
 	 * @return Qualifier if one defined; null otherwise
 	 */
-	String getQualifier();
-	
+  public String getQualifier() {
+    return qualifier;
+  }
+
+  /**
+   * Set qualifier for this include annotation.
+   *
+   * @param qualifier for include annotation
+   * @return this include annotation
+   */
+  public EdmxReferenceIncludeAnnotation setQualifier(String qualifier) {
+    this.qualifier = qualifier;
+    return this;
+  }
+
 	/**
 	 * @return targetNamespace if defined; null otherwise
 	 */
-	String getTargetNamespace();
+  public String getTargetNamespace() {
+    return targetNamespace;
+  }
+
+  /**
+   * Set target namespace for this include annotation.
+   *
+   * @param targetNamespace for include annotation
+   * @return this include annotation
+   */
+  public EdmxReferenceIncludeAnnotation setTargetNamespace(String targetNamespace) {
+    this.targetNamespace = targetNamespace;
+    return this;
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2fbab652/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceImpl.java
deleted file mode 100644
index 31f64d2..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceImpl.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.edmx;
-
-
-import org.apache.olingo.server.api.edmx.EdmxReference;
-import org.apache.olingo.server.api.edmx.EdmxReferenceInclude;
-import org.apache.olingo.server.api.edmx.EdmxReferenceIncludeAnnotation;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-
-public class EdmxReferenceImpl implements EdmxReference {
-  private final URI uri;
-  private final List<EdmxReferenceInclude> edmxIncludes;
-  private final List<EdmxReferenceIncludeAnnotation> edmxIncludeAnnotations;
-
-  public EdmxReferenceImpl(URI uri) {
-    this.uri = uri;
-    edmxIncludes = new ArrayList<EdmxReferenceInclude>();
-    edmxIncludeAnnotations = new ArrayList<EdmxReferenceIncludeAnnotation>();
-  }
-
-  @Override
-  public URI getUri() {
-    return uri;
-  }
-
-  @Override
-  public List<EdmxReferenceInclude> getIncludes() {
-    return Collections.unmodifiableList(edmxIncludes);
-  }
-
-  public void addInclude(EdmxReferenceInclude include) {
-    edmxIncludes.add(include);
-  }
-
-  @Override
-  public List<EdmxReferenceIncludeAnnotation> getIncludeAnnotations() {
-    return Collections.unmodifiableList(edmxIncludeAnnotations);
-  }
-
-  public void addIncludeAnnotation(EdmxReferenceIncludeAnnotation includeAnnotation) {
-    edmxIncludeAnnotations.add(includeAnnotation);
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2fbab652/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceIncludeAnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceIncludeAnnotationImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceIncludeAnnotationImpl.java
deleted file mode 100644
index 575c115..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceIncludeAnnotationImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.edmx;
-
-import org.apache.olingo.server.api.edmx.EdmxReferenceIncludeAnnotation;
-
-/**
- */
-public class EdmxReferenceIncludeAnnotationImpl implements EdmxReferenceIncludeAnnotation {
-
-  private final String termNamespace;
-  private final String qualifier;
-  private final String targetNamespace;
-
-  public EdmxReferenceIncludeAnnotationImpl(String termNamespace, String qualifier, String targetNamespace) {
-    this.termNamespace = termNamespace;
-    this.qualifier = qualifier;
-    this.targetNamespace = targetNamespace;
-  }
-
-  public EdmxReferenceIncludeAnnotationImpl(String termNamespace) {
-    this(termNamespace, null, null);
-  }
-
-  @Override
-  public String getTermNamespace() {
-    return termNamespace;
-  }
-
-  @Override
-  public String getQualifier() {
-    return qualifier;
-  }
-
-  @Override
-  public String getTargetNamespace() {
-    return targetNamespace;
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2fbab652/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceIncludeImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceIncludeImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceIncludeImpl.java
deleted file mode 100644
index 0a4ecd3..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edmx/EdmxReferenceIncludeImpl.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.edmx;
-
-import org.apache.olingo.server.api.edmx.EdmxReferenceInclude;
-
-/**
- */
-public class EdmxReferenceIncludeImpl implements EdmxReferenceInclude {
-  private final String namespace;
-  private final String alias;
-
-  public EdmxReferenceIncludeImpl(String namespace, String alias) {
-    this.namespace = namespace;
-    this.alias = alias;
-  }
-
-  public EdmxReferenceIncludeImpl(String namespace) {
-    this(namespace, null);
-  }
-
-  @Override
-  public String getNamespace() {
-    return namespace;
-  }
-
-  @Override
-  public String getAlias() {
-    return alias;
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2fbab652/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
index be1f808..e9a6576 100644
--- a/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
+++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
@@ -64,9 +64,7 @@ import org.apache.olingo.server.api.edmx.EdmxReference;
 import org.apache.olingo.server.api.edmx.EdmxReferenceInclude;
 import org.apache.olingo.server.api.serializer.ODataSerializer;
 import org.apache.olingo.server.core.ServiceMetadataImpl;
-import org.apache.olingo.server.core.edmx.EdmxReferenceImpl;
-import org.apache.olingo.server.core.edmx.EdmxReferenceIncludeAnnotationImpl;
-import org.apache.olingo.server.core.edmx.EdmxReferenceIncludeImpl;
+import org.apache.olingo.server.api.edmx.EdmxReferenceIncludeAnnotation;
 import org.junit.Test;
 
 public class MetadataDocumentTest {
@@ -85,51 +83,51 @@ public class MetadataDocumentTest {
     ODataSerializer serializer = OData.newInstance().createSerializer(ODataFormat.XML);
 
     List<EdmxReference> edmxReferences = new ArrayList<EdmxReference>();
-    EdmxReferenceImpl reference = new EdmxReferenceImpl(URI.create("http://example.com"));
+    EdmxReference reference = new EdmxReference(URI.create("http://example.com"));
     edmxReferences.add(reference);
 
-    EdmxReferenceImpl referenceWithInclude = new EdmxReferenceImpl(
+    EdmxReference referenceWithInclude = new EdmxReference(
             URI.create("http://localhost/odata/odata/v4.0/referenceWithInclude"));
-    EdmxReferenceInclude include = new EdmxReferenceIncludeImpl("Org.OData.Core.V1", "Core");
+    EdmxReferenceInclude include = new EdmxReferenceInclude("Org.OData.Core.V1", "Core");
     referenceWithInclude.addInclude(include);
     edmxReferences.add(referenceWithInclude);
 
-    EdmxReferenceImpl referenceWithTwoIncludes = new EdmxReferenceImpl(
+    EdmxReference referenceWithTwoIncludes = new EdmxReference(
             URI.create("http://localhost/odata/odata/v4.0/referenceWithTwoIncludes"));
-    referenceWithTwoIncludes.addInclude(new EdmxReferenceIncludeImpl("Org.OData.Core.2", "Core2"));
-    referenceWithTwoIncludes.addInclude(new EdmxReferenceIncludeImpl("Org.OData.Core.3", "Core3"));
+    referenceWithTwoIncludes.addInclude(new EdmxReferenceInclude("Org.OData.Core.2", "Core2"));
+    referenceWithTwoIncludes.addInclude(new EdmxReferenceInclude("Org.OData.Core.3", "Core3"));
     edmxReferences.add(referenceWithTwoIncludes);
 
-    EdmxReferenceImpl referenceWithIncludeAnnos = new EdmxReferenceImpl(
+    EdmxReference referenceWithIncludeAnnos = new EdmxReference(
             URI.create("http://localhost/odata/odata/v4.0/referenceWithIncludeAnnos"));
     referenceWithIncludeAnnos.addIncludeAnnotation(
-            new EdmxReferenceIncludeAnnotationImpl("TermNs.2", "Q.2", "TargetNS.2"));
+            new EdmxReferenceIncludeAnnotation("TermNs.2", "Q.2", "TargetNS.2"));
     referenceWithIncludeAnnos.addIncludeAnnotation(
-            new EdmxReferenceIncludeAnnotationImpl("TermNs.3", "Q.3","TargetNS.3"));
+            new EdmxReferenceIncludeAnnotation("TermNs.3", "Q.3","TargetNS.3"));
     edmxReferences.add(referenceWithIncludeAnnos);
 
-    EdmxReferenceImpl referenceWithAll = new EdmxReferenceImpl(
+    EdmxReference referenceWithAll = new EdmxReference(
             URI.create("http://localhost/odata/odata/v4.0/referenceWithAll"));
-    referenceWithAll.addInclude(new EdmxReferenceIncludeImpl("ReferenceWithAll.1", "Core1"));
-    referenceWithAll.addInclude(new EdmxReferenceIncludeImpl("ReferenceWithAll.2", "Core2"));
+    referenceWithAll.addInclude(new EdmxReferenceInclude("ReferenceWithAll.1", "Core1"));
+    referenceWithAll.addInclude(new EdmxReferenceInclude("ReferenceWithAll.2", "Core2"));
     referenceWithAll.addIncludeAnnotation(
-            new EdmxReferenceIncludeAnnotationImpl("ReferenceWithAllTermNs.4", "Q.4", "TargetNS.4"));
+            new EdmxReferenceIncludeAnnotation("ReferenceWithAllTermNs.4", "Q.4", "TargetNS.4"));
     referenceWithAll.addIncludeAnnotation(
-            new EdmxReferenceIncludeAnnotationImpl("ReferenceWithAllTermNs.5", "Q.5", "TargetNS.5"));
+            new EdmxReferenceIncludeAnnotation("ReferenceWithAllTermNs.5", "Q.5", "TargetNS.5"));
     edmxReferences.add(referenceWithAll);
 
-    EdmxReferenceImpl referenceWithAllAndNull = new EdmxReferenceImpl(
+    EdmxReference referenceWithAllAndNull = new EdmxReference(
             URI.create("http://localhost/odata/odata/v4.0/referenceWithAllAndNull"));
-    referenceWithAllAndNull.addInclude(new EdmxReferenceIncludeImpl("referenceWithAllAndNull.1"));
-    referenceWithAllAndNull.addInclude(new EdmxReferenceIncludeImpl("referenceWithAllAndNull.2", null));
+    referenceWithAllAndNull.addInclude(new EdmxReferenceInclude("referenceWithAllAndNull.1"));
+    referenceWithAllAndNull.addInclude(new EdmxReferenceInclude("referenceWithAllAndNull.2", null));
     referenceWithAllAndNull.addIncludeAnnotation(
-            new EdmxReferenceIncludeAnnotationImpl("ReferenceWithAllTermNs.4"));
+            new EdmxReferenceIncludeAnnotation("ReferenceWithAllTermNs.4"));
     referenceWithAllAndNull.addIncludeAnnotation(
-            new EdmxReferenceIncludeAnnotationImpl("ReferenceWithAllTermAndNullNs.5", "Q.5", null));
+            new EdmxReferenceIncludeAnnotation("ReferenceWithAllTermAndNullNs.5", "Q.5", null));
     referenceWithAllAndNull.addIncludeAnnotation(
-            new EdmxReferenceIncludeAnnotationImpl("ReferenceWithAllTermAndNullNs.6", null, "TargetNS"));
+            new EdmxReferenceIncludeAnnotation("ReferenceWithAllTermAndNullNs.6", null, "TargetNS"));
     referenceWithAllAndNull.addIncludeAnnotation(
-            new EdmxReferenceIncludeAnnotationImpl("ReferenceWithAllTermAndNullNs.7", null, null));
+            new EdmxReferenceIncludeAnnotation("ReferenceWithAllTermAndNullNs.7", null, null));
     edmxReferences.add(referenceWithAllAndNull);
 
     ServiceMetadata serviceMetadata = new ServiceMetadataImpl(ODataServiceVersion.V40,
@@ -299,9 +297,9 @@ public class MetadataDocumentTest {
      */
   private List<EdmxReference> getEdmxReferences() {
     List<EdmxReference> edmxReferences = new ArrayList<EdmxReference>();
-    EdmxReferenceImpl reference = new EdmxReferenceImpl(
+    EdmxReference reference = new EdmxReference(
             URI.create("http://docs.oasis-open.org/odata/odata/v4.0/cs02/vocabularies/Org.OData.Core.V1.xml"));
-    EdmxReferenceInclude include = new EdmxReferenceIncludeImpl("Org.OData.Core.V1", "Core");
+    EdmxReferenceInclude include = new EdmxReferenceInclude("Org.OData.Core.V1", "Core");
     reference.addInclude(include);
     edmxReferences.add(reference);
     return edmxReferences;