From 87f0f06a39f426bccbb2a0496ad40781850fd7db Mon Sep 17 00:00:00 2001 From: Michael Bolz Date: Mon, 13 Oct 2014 08:18:53 +0200 Subject: [PATCH] [OLINGO-456] Removed deprecated classes --- .../core/edm/AbstractEdmMetadataImpl.java | 92 --------- .../client/core/edm/EdmAnnotationImpl.java | 2 +- .../olingo/client/core/edm/EdmClientImpl.java | 10 - .../client/core/edm/v3/EdmMetadataImpl.java | 97 ---------- .../client/core/edm/v4/EdmMetadataImpl.java | 103 ---------- .../EdmConstantAnnotationExpressionImpl.java | 6 +- .../olingo/client/core/v3/MetadataTest.java | 18 +- .../olingo/client/core/v4/MetadataTest.java | 42 ++-- .../apache/olingo/commons/api/edm/Edm.java | 9 - .../olingo/commons/api/edm/EdmMetadata.java | 57 ------ .../olingo/commons/core/edm/AbstractEdm.java | 13 -- .../commons/core/edm/EdmImplCachingTest.java | 15 -- .../core/edm/EdmImplCallCreateTest.java | 11 -- .../core/edm/provider/EdmMetadataImpl.java | 173 ----------------- .../core/edm/provider/EdmProviderImpl.java | 6 - .../edm/provider/EdmMetadataImplTest.java | 182 ------------------ .../edm/provider/EdmProviderImplTest.java | 7 - 17 files changed, 37 insertions(+), 806 deletions(-) delete mode 100644 lib/client-core/src/main/java/org/apache/olingo/client/core/edm/AbstractEdmMetadataImpl.java delete mode 100644 lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmMetadataImpl.java delete mode 100644 lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/EdmMetadataImpl.java delete mode 100644 lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMetadata.java delete mode 100644 lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmMetadataImpl.java delete mode 100644 lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMetadataImplTest.java diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/AbstractEdmMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/AbstractEdmMetadataImpl.java deleted file mode 100644 index 88c95fab0..000000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/AbstractEdmMetadataImpl.java +++ /dev/null @@ -1,92 +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.client.core.edm; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.olingo.client.api.edm.xml.EntityContainer; -import org.apache.olingo.client.api.edm.xml.EntitySet; -import org.apache.olingo.client.api.edm.xml.Schema; -import org.apache.olingo.client.core.edm.v3.EdmMetadataImpl; -import org.apache.olingo.commons.api.edm.EdmActionImportInfo; -import org.apache.olingo.commons.api.edm.EdmEntitySetInfo; -import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo; -import org.apache.olingo.commons.api.edm.EdmMetadata; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.commons.core.edm.EdmEntitySetInfoImpl; - -public abstract class AbstractEdmMetadataImpl implements EdmMetadata { - - protected final List xmlSchemas; - - private List entitySetInfos; - - protected List functionImportInfos; - - protected List actionImportInfos; - - public static EdmMetadata getInstance(final ODataServiceVersion version, final List xmlSchemas) { - - return version.compareTo(ODataServiceVersion.V40) < 0 - ? new EdmMetadataImpl(xmlSchemas) - : new org.apache.olingo.client.core.edm.v4.EdmMetadataImpl(xmlSchemas); - } - - public AbstractEdmMetadataImpl(final List xmlSchemas) { - this.xmlSchemas = xmlSchemas; - } - - @Override - public List getEntitySetInfos() { - synchronized (this) { - if (entitySetInfos == null) { - entitySetInfos = new ArrayList(); - for (Schema schema : xmlSchemas) { - for (EntityContainer entityContainer : schema.getEntityContainers()) { - for (EntitySet entitySet : entityContainer.getEntitySets()) { - entitySetInfos.add(new EdmEntitySetInfoImpl(entityContainer.getName(), entitySet.getName())); - } - } - } - } - return entitySetInfos; - } - } - - @Override - public boolean equals(final Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); - } - - @Override - public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); - } - - @Override - public String toString() { - return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE); - } -} diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationImpl.java index ea1ef27ac..81b89a9a1 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmAnnotationImpl.java @@ -96,7 +96,7 @@ public class EdmAnnotationImpl implements EdmAnnotation { EdmAnnotationExpression _expression = null; if (exp.isConstant()) { - _expression = new EdmConstantAnnotationExpressionImpl(edm, exp.asConstant()); + _expression = new EdmConstantAnnotationExpressionImpl(exp.asConstant()); } else if (annotation.getExpression().isDynamic()) { _expression = getDynamicExpression(exp.asDynamic()); } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java index d2084b6fe..f2dedccb0 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java @@ -58,7 +58,6 @@ import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmSchema; -import org.apache.olingo.commons.api.edm.EdmMetadata; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; @@ -74,8 +73,6 @@ public class EdmClientImpl extends AbstractEdm { private final Map xmlSchemaByNamespace; - private final EdmMetadata serviceMetadata; - public EdmClientImpl(final ODataServiceVersion version, final Map xmlSchemas) { this.version = version; @@ -87,13 +84,6 @@ public class EdmClientImpl extends AbstractEdm { this.xmlSchemas.add(schema); } } - - this.serviceMetadata = AbstractEdmMetadataImpl.getInstance(version, this.xmlSchemas); - } - - @Override - protected EdmMetadata createServiceMetadata() { - return serviceMetadata; } @Override diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmMetadataImpl.java deleted file mode 100644 index b6ace40d5..000000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmMetadataImpl.java +++ /dev/null @@ -1,97 +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.client.core.edm.v3; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.CommonFunctionImport; -import org.apache.olingo.client.api.edm.xml.EntityContainer; -import org.apache.olingo.client.api.edm.xml.Schema; -import org.apache.olingo.client.api.edm.xml.v3.FunctionImport; -import org.apache.olingo.client.api.v3.UnsupportedInV3Exception; -import org.apache.olingo.client.core.edm.AbstractEdmMetadataImpl; -import org.apache.olingo.commons.api.edm.EdmActionImportInfo; -import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo; -import org.apache.olingo.commons.api.edm.EdmSingletonInfo; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.commons.core.edm.EdmActionImportInfoImpl; -import org.apache.olingo.commons.core.edm.EdmFunctionImportInfoImpl; - -public class EdmMetadataImpl extends AbstractEdmMetadataImpl { - - private static final ODataServiceVersion SERVICE_VERSION = ODataServiceVersion.V30; - - public EdmMetadataImpl(final List xmlSchemas) { - super(xmlSchemas); - } - - @Override - public ODataServiceVersion getDataServiceVersion() { - return SERVICE_VERSION; - } - - @Override - public List getSingletonInfos() { - throw new UnsupportedInV3Exception(); - } - - @Override - public List getFunctionImportInfos() { - synchronized (this) { - if (functionImportInfos == null) { - functionImportInfos = new ArrayList(); - for (Schema schema : xmlSchemas) { - for (EntityContainer entityContainer : schema.getEntityContainers()) { - for (CommonFunctionImport functionImport : entityContainer.getFunctionImports()) { - final FunctionImport _funFunctionImport = (FunctionImport) functionImport; - if (FunctionImportUtils.canProxyFunction(_funFunctionImport)) { - functionImportInfos.add( - new EdmFunctionImportInfoImpl(entityContainer.getName(), functionImport.getName())); - } - } - } - } - } - return functionImportInfos; - } - } - - @Override - public List getActionImportInfos() { - synchronized (this) { - if (actionImportInfos == null) { - actionImportInfos = new ArrayList(); - for (Schema schema : xmlSchemas) { - for (EntityContainer entityContainer : schema.getEntityContainers()) { - for (CommonFunctionImport functionImport : entityContainer.getFunctionImports()) { - final FunctionImport _funFunctionImport = (FunctionImport) functionImport; - if (!FunctionImportUtils.canProxyFunction(_funFunctionImport)) { - actionImportInfos.add( - new EdmActionImportInfoImpl(entityContainer.getName(), functionImport.getName())); - } - } - } - } - } - return actionImportInfos; - } - } - -} diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/EdmMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/EdmMetadataImpl.java deleted file mode 100644 index c9a0e7593..000000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/EdmMetadataImpl.java +++ /dev/null @@ -1,103 +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.client.core.edm.v4; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.CommonFunctionImport; -import org.apache.olingo.client.api.edm.xml.Schema; -import org.apache.olingo.client.api.edm.xml.v4.ActionImport; -import org.apache.olingo.client.api.edm.xml.v4.EntityContainer; -import org.apache.olingo.client.api.edm.xml.v4.Singleton; -import org.apache.olingo.client.core.edm.AbstractEdmMetadataImpl; -import org.apache.olingo.commons.api.edm.EdmActionImportInfo; -import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo; -import org.apache.olingo.commons.api.edm.EdmSingletonInfo; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.commons.core.edm.EdmActionImportInfoImpl; -import org.apache.olingo.commons.core.edm.EdmFunctionImportInfoImpl; -import org.apache.olingo.commons.core.edm.EdmSingletonInfoImpl; - -public class EdmMetadataImpl extends AbstractEdmMetadataImpl { - - private static final ODataServiceVersion SERVICE_VERSION = ODataServiceVersion.V40; - - private List singletonInfos; - - public EdmMetadataImpl(final List xmlSchemas) { - super(xmlSchemas); - } - - @Override - public ODataServiceVersion getDataServiceVersion() { - return SERVICE_VERSION; - } - - @Override - public List getSingletonInfos() { - synchronized (this) { - if (singletonInfos == null) { - singletonInfos = new ArrayList(); - for (Schema schema : xmlSchemas) { - final EntityContainer entityContainer = (EntityContainer) schema.getDefaultEntityContainer(); - for (Singleton singleton : entityContainer.getSingletons()) { - singletonInfos.add(new EdmSingletonInfoImpl(entityContainer.getName(), singleton.getName())); - } - } - } - return singletonInfos; - } - } - - @Override - public List getFunctionImportInfos() { - synchronized (this) { - if (functionImportInfos == null) { - functionImportInfos = new ArrayList(); - for (Schema schema : xmlSchemas) { - final EntityContainer entityContainer = (EntityContainer) schema.getDefaultEntityContainer(); - - for (CommonFunctionImport functionImport : entityContainer.getFunctionImports()) { - functionImportInfos.add( - new EdmFunctionImportInfoImpl(entityContainer.getName(), functionImport.getName())); - } - } - } - } - - return functionImportInfos; - } - - @Override - public List getActionImportInfos() { - synchronized (this) { - if (actionImportInfos == null) { - actionImportInfos = new ArrayList(); - for (Schema schema : xmlSchemas) { - final EntityContainer entityContainer = (EntityContainer) schema.getDefaultEntityContainer(); - for (ActionImport actionImport : entityContainer.getActionImports()) { - actionImportInfos.add(new EdmActionImportInfoImpl(entityContainer.getName(), actionImport.getName())); - } - } - } - return actionImportInfos; - } - } -} diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmConstantAnnotationExpressionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmConstantAnnotationExpressionImpl.java index e0ce3ba8c..aeded52ef 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmConstantAnnotationExpressionImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmConstantAnnotationExpressionImpl.java @@ -26,12 +26,12 @@ import org.apache.olingo.client.api.edm.xml.v4.annotation.ConstantAnnotationExpr import org.apache.olingo.commons.api.Constants; import org.apache.olingo.commons.api.domain.v4.ODataEnumValue; import org.apache.olingo.commons.api.domain.v4.ODataValue; -import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmPrimitiveType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.annotation.EdmConstantAnnotationExpression; import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression; +import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.commons.core.domain.v4.ODataCollectionValueImpl; import org.apache.olingo.commons.core.domain.v4.ODataEnumValueImpl; import org.apache.olingo.commons.core.domain.v4.ODataPrimitiveValueImpl; @@ -41,7 +41,7 @@ public class EdmConstantAnnotationExpressionImpl implements EdmConstantAnnotatio private final ODataValue value; - public EdmConstantAnnotationExpressionImpl(final Edm edm, final ConstantAnnotationExpression constExprConstruct) { + public EdmConstantAnnotationExpressionImpl(final ConstantAnnotationExpression constExprConstruct) { if (constExprConstruct.getType() == ConstantAnnotationExpression.Type.EnumMember) { final List enumValues = new ArrayList(); String enumTypeName = null; @@ -97,7 +97,7 @@ public class EdmConstantAnnotationExpressionImpl implements EdmConstantAnnotatio kind = EdmPrimitiveTypeKind.String; } final ODataPrimitiveValueImpl.BuilderImpl primitiveValueBuilder = - new ODataPrimitiveValueImpl.BuilderImpl(edm.getServiceMetadata().getDataServiceVersion()); + new ODataPrimitiveValueImpl.BuilderImpl(ODataServiceVersion.V40); primitiveValueBuilder.setType(kind); try { final EdmPrimitiveType primitiveType = EdmPrimitiveTypeFactory.getInstance(kind); diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java index 75f1c2a98..b84e11549 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java @@ -23,13 +23,9 @@ import org.apache.olingo.client.api.edm.xml.EntityType; import org.apache.olingo.client.api.edm.xml.Schema; import org.apache.olingo.client.api.edm.xml.XMLMetadata; import org.apache.olingo.client.api.edm.xml.v3.FunctionImport; -import org.apache.olingo.commons.api.http.HttpMethod; -import org.apache.olingo.client.api.v3.ODataClient; -import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.EdmActionImport; -import org.apache.olingo.commons.api.edm.EdmActionImportInfo; import org.apache.olingo.commons.api.edm.EdmBindingTarget; import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmEntityContainer; @@ -37,11 +33,14 @@ import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmFunctionImport; -import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo; import org.apache.olingo.commons.api.edm.EdmNavigationProperty; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmReturnType; +import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.FullQualifiedName; +import org.apache.olingo.commons.api.http.HttpMethod; +import org.apache.olingo.client.api.v3.ODataClient; +import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import org.junit.Test; @@ -260,10 +259,11 @@ public class MetadataTest extends AbstractTest { final Edm metadata = getClient().getReader(). readMetadata(getClass().getResourceAsStream("metadata.xml")); assertNotNull(metadata); + final EdmSchema schema = metadata.getSchemas().get(0); final Set actionImports = new HashSet(); - for (EdmActionImportInfo info : metadata.getServiceMetadata().getActionImportInfos()) { - actionImports.add(info.getActionImportName()); + for (EdmAction info : schema.getActions()) { + actionImports.add(info.getName()); } final Set expectedAI = new HashSet(Arrays.asList(new String[] { "ResetDataSource", @@ -274,8 +274,8 @@ public class MetadataTest extends AbstractTest { "ResetComputerDetailsSpecifications"})); assertEquals(expectedAI, actionImports); final Set functionImports = new HashSet(); - for (EdmFunctionImportInfo info : metadata.getServiceMetadata().getFunctionImportInfos()) { - functionImports.add(info.getFunctionImportName()); + for (EdmFunction info : schema.getFunctions()) { + functionImports.add(info.getName()); } final Set expectedFI = new HashSet(Arrays.asList(new String[] { "GetPrimitiveString", diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java index c804d13ab..ab58fffe2 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java @@ -55,7 +55,6 @@ import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmFunctionImport; -import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.EdmSchema; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; @@ -68,6 +67,8 @@ import org.apache.olingo.commons.core.edm.primitivetype.EdmInt32; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import org.junit.Test; +import java.util.List; + public class MetadataTest extends AbstractTest { @Override @@ -240,24 +241,29 @@ public class MetadataTest extends AbstractTest { final Edm edm = getClient().getReader().readMetadata(getClass().getResourceAsStream("fromdoc1-metadata.xml")); assertNotNull(edm); - final EdmFunctionImportInfo fiInfo = edm.getServiceMetadata().getFunctionImportInfos().get(0); - final EdmEntityContainer demoService = edm.getEntityContainer( - new FullQualifiedName(metadata.getSchema(0).getNamespace(), fiInfo.getEntityContainerName())); - assertNotNull(demoService); - final EdmFunctionImport fi = demoService.getFunctionImport(fiInfo.getFunctionImportName()); - assertNotNull(fi); - assertEquals(demoService.getEntitySet("Products"), fi.getReturnedEntitySet()); + List schemaList = edm.getSchemas(); + assertNotNull(schemaList); + assertEquals(1, schemaList.size()); + EdmSchema schema = schemaList.get(0); - final EdmFunction function = edm.getUnboundFunction( - new FullQualifiedName(metadata.getSchema(0).getNamespace(), "ProductsByRating"), null); - assertNotNull(function); - assertEquals(function.getName(), fi.getUnboundFunction(null).getName()); - assertEquals(function.getNamespace(), fi.getUnboundFunction(null).getNamespace()); - assertEquals(function.getParameterNames(), fi.getUnboundFunction(null).getParameterNames()); - assertEquals(function.getReturnType().getType().getName(), - fi.getUnboundFunction(null).getReturnType().getType().getName()); - assertEquals(function.getReturnType().getType().getNamespace(), - fi.getUnboundFunction(null).getReturnType().getType().getNamespace()); + EdmEntityContainer demoService = schema.getEntityContainer(); + assertNotNull(demoService); + for (EdmFunction function : schema.getFunctions()) { + final EdmFunctionImport fi = demoService.getFunctionImport(function.getName()); + assertNotNull(fi); + assertEquals(demoService.getEntitySet("Products"), fi.getReturnedEntitySet()); + + final EdmFunction edmFunction = edm.getUnboundFunction( + new FullQualifiedName(metadata.getSchema(0).getNamespace(), "ProductsByRating"), null); + assertNotNull(edmFunction); + assertEquals(edmFunction.getName(), fi.getUnboundFunction(null).getName()); + assertEquals(edmFunction.getNamespace(), fi.getUnboundFunction(null).getNamespace()); + assertEquals(edmFunction.getParameterNames(), fi.getUnboundFunction(null).getParameterNames()); + assertEquals(edmFunction.getReturnType().getType().getName(), + fi.getUnboundFunction(null).getReturnType().getType().getName()); + assertEquals(edmFunction.getReturnType().getType().getNamespace(), + fi.getUnboundFunction(null).getReturnType().getType().getNamespace()); + } final EdmTypeDefinition weight = edm.getTypeDefinition(new FullQualifiedName("ODataDemo", "Weight")); assertNotNull(weight); diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Edm.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Edm.java index eb609cd47..8790afb72 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Edm.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Edm.java @@ -172,13 +172,4 @@ public interface Edm { * @return {@link EdmAnnotation} */ EdmAnnotation getAnnotation(FullQualifiedName annotatableName, EdmTerm term); - - /** - * Get service metadata. - *
- * See {@link EdmMetadata} for more information. - * - * @return {@link EdmMetadata} - */ - EdmMetadata getServiceMetadata(); } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMetadata.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMetadata.java deleted file mode 100644 index 04b16aba5..000000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMetadata.java +++ /dev/null @@ -1,57 +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.commons.api.edm; - -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; - -import java.util.List; - -/** - * This interface gives an info list of all - * entity sets, singletons, and function imports inside the EntityDataModel. - */ -@Deprecated -public interface EdmMetadata { - - /** - * @return a list of {@link EdmEntitySetInfo} objects inside the data model - */ - List getEntitySetInfos(); - - /** - * @return a list of {@link EdmSingletonInfo} objects inside the data model - */ - List getSingletonInfos(); - - /** - * @return a list of {@link EdmActionImportInfo} objects inside the data model - */ - List getActionImportInfos(); - - /** - * @return a list of {@link EdmFunctionImportInfo} objects inside the data model - */ - List getFunctionImportInfos(); - - /** - * - * @return - */ - ODataServiceVersion getDataServiceVersion(); -} diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdm.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdm.java index 264603865..e9aea826d 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdm.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdm.java @@ -28,7 +28,6 @@ import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmSchema; -import org.apache.olingo.commons.api.edm.EdmMetadata; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; @@ -76,8 +75,6 @@ public abstract class AbstractEdm implements Edm { private final Map> annotations = new HashMap>(); - private EdmMetadata serviceMetadata; - private Map aliasToNamespaceInfo; @Override @@ -402,14 +399,6 @@ public abstract class AbstractEdm implements Edm { return result; } - @Override - public EdmMetadata getServiceMetadata() { - if (serviceMetadata == null) { - serviceMetadata = createServiceMetadata(); - } - return serviceMetadata; - } - private FullQualifiedName resolvePossibleAlias(final FullQualifiedName namespaceOrAliasFQN) { if (aliasToNamespaceInfo == null) { aliasToNamespaceInfo = createAliasToNamespaceInfo(); @@ -455,8 +444,6 @@ public abstract class AbstractEdm implements Edm { FullQualifiedName bindingParameterTypeName, Boolean isBindingParameterCollection, List parameterNames); - protected abstract EdmMetadata createServiceMetadata(); - protected abstract EdmTerm createTerm(FullQualifiedName termName); protected abstract EdmAnnotations createAnnotationGroup(FullQualifiedName targetName); diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java index e12229ac7..f35854394 100644 --- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java +++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java @@ -29,7 +29,6 @@ import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmSchema; -import org.apache.olingo.commons.api.edm.EdmMetadata; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; @@ -249,15 +248,6 @@ public class EdmImplCachingTest { assertNotSame(function, function2); } - @Test - public void cacheServiceMetadata() { - EdmMetadata serviceMetadata = edm.getServiceMetadata(); - EdmMetadata cachedMetadata = edm.getServiceMetadata(); - - assertTrue(serviceMetadata == cachedMetadata); - assertEquals(serviceMetadata, cachedMetadata); - } - @Before public void setup() { edm = new LocalEdm(); @@ -360,11 +350,6 @@ public class EdmImplCachingTest { return null; } - @Override - public EdmMetadata createServiceMetadata() { - return mock(EdmMetadata.class); - } - @Override protected Map createAliasToNamespaceInfo() { return new HashMap(); diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCallCreateTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCallCreateTest.java index 5b8adc984..87fe0e623 100644 --- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCallCreateTest.java +++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCallCreateTest.java @@ -28,7 +28,6 @@ import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmSchema; -import org.apache.olingo.commons.api.edm.EdmMetadata; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; @@ -151,11 +150,6 @@ public class EdmImplCallCreateTest { assertNull(edm.getUnboundFunction(WRONG_FQN, null)); } - @Test - public void callCreateServiceMetadata() { - assertNotNull(edm.getServiceMetadata()); - } - @Before public void setup() { edm = new LocalEdm(); @@ -243,11 +237,6 @@ public class EdmImplCallCreateTest { return null; } - @Override - public EdmMetadata createServiceMetadata() { - return mock(EdmMetadata.class); - } - @Override protected Map createAliasToNamespaceInfo() { return new HashMap(); diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmMetadataImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmMetadataImpl.java deleted file mode 100644 index 8306954ea..000000000 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmMetadataImpl.java +++ /dev/null @@ -1,173 +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.edm.provider; - -import org.apache.olingo.commons.api.ODataException; -import org.apache.olingo.commons.api.edm.*; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.commons.core.edm.EdmActionImportInfoImpl; -import org.apache.olingo.commons.core.edm.EdmEntitySetInfoImpl; -import org.apache.olingo.commons.core.edm.EdmFunctionImportInfoImpl; -import org.apache.olingo.commons.core.edm.EdmSingletonInfoImpl; -import org.apache.olingo.server.api.edm.provider.*; - -import java.util.ArrayList; -import java.util.List; - -public class EdmMetadataImpl implements EdmMetadata { - - private EdmProvider provider; - - private List schemas; - - private List entitySetInfos; - - private List singletonInfos; - - private List actionImportInfos; - - private List functionImportInfos; - - public EdmMetadataImpl(final EdmProvider provider) { - this.provider = provider; - } - - @Override - public List getEntitySetInfos() { - if (entitySetInfos == null) { - try { - entitySetInfos = new ArrayList(); - if (schemas == null) { - schemas = provider.getSchemas(); - if (schemas == null) { - throw new EdmException("Provider doe not define any schemas."); - } - } - for (Schema schema : schemas) { - final EntityContainer entityContainer = schema.getEntityContainer(); - if (entityContainer != null) { - final List entitySets = entityContainer.getEntitySets(); - if (entitySets != null) { - for (EntitySet set : entitySets) { - entitySetInfos.add(new EdmEntitySetInfoImpl(entityContainer.getName(), set.getName())); - } - } - } - } - } catch (ODataException e) { - throw new EdmException(e); - } - } - return entitySetInfos; - } - - @Override - public List getSingletonInfos() { - if (singletonInfos == null) { - try { - singletonInfos = new ArrayList(); - if (schemas == null) { - schemas = provider.getSchemas(); - if (schemas == null) { - throw new EdmException("Provider doe not define any schemas."); - } - } - for (Schema schema : schemas) { - final EntityContainer entityContainer = schema.getEntityContainer(); - if (entityContainer != null) { - final List singletons = entityContainer.getSingletons(); - if (singletons != null) { - for (Singleton singleton : singletons) { - singletonInfos.add(new EdmSingletonInfoImpl(entityContainer.getName(), singleton.getName())); - } - } - } - } - } catch (ODataException e) { - throw new EdmException(e); - } - } - return singletonInfos; - } - - @Override - public List getActionImportInfos() { - if (actionImportInfos == null) { - try { - actionImportInfos = new ArrayList(); - if (schemas == null) { - schemas = provider.getSchemas(); - if (schemas == null) { - throw new EdmException("Provider doe not define any schemas."); - } - } - for (Schema schema : schemas) { - final EntityContainer entityContainer = schema.getEntityContainer(); - if (entityContainer != null) { - final List actionImports = entityContainer.getActionImports(); - if (actionImports != null) { - for (ActionImport actionImport : actionImports) { - actionImportInfos.add(new EdmActionImportInfoImpl(entityContainer.getName(), actionImport.getName())); - } - } - } - } - } catch (ODataException e) { - throw new EdmException(e); - } - } - return actionImportInfos; - } - - @Override - public List getFunctionImportInfos() { - if (functionImportInfos == null) { - try { - functionImportInfos = new ArrayList(); - if (schemas == null) { - schemas = provider.getSchemas(); - if (schemas == null) { - throw new EdmException("Provider doe not define any schemas."); - } - } - for (Schema schema : schemas) { - final EntityContainer entityContainer = schema.getEntityContainer(); - if (entityContainer != null) { - final List functionImports = entityContainer.getFunctionImports(); - if (functionImports != null) { - for (FunctionImport functionImport : functionImports) { - functionImportInfos.add( - new EdmFunctionImportInfoImpl(entityContainer.getName(), functionImport.getName())); - } - } - } - } - } catch (ODataException e) { - throw new EdmException(e); - } - } - return functionImportInfos; - } - - @Override - public ODataServiceVersion getDataServiceVersion() { - return ODataServiceVersion.V40; - } - -} diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmProviderImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmProviderImpl.java index bf3bb4a76..baf80933f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmProviderImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/edm/provider/EdmProviderImpl.java @@ -29,7 +29,6 @@ import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.EdmException; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmSchema; -import org.apache.olingo.commons.api.edm.EdmMetadata; import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; @@ -209,11 +208,6 @@ public class EdmProviderImpl extends AbstractEdm { } } - @Override - public EdmMetadata createServiceMetadata() { - return new EdmMetadataImpl(provider); - } - @Override protected Map createAliasToNamespaceInfo() { final Map aliasToNamespaceInfos = new HashMap(); diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMetadataImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMetadataImplTest.java deleted file mode 100644 index 7090f5b2f..000000000 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmMetadataImplTest.java +++ /dev/null @@ -1,182 +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.edm.provider; - -import org.apache.olingo.commons.api.ODataException; -import org.apache.olingo.commons.api.edm.EdmEntitySetInfo; -import org.apache.olingo.commons.api.edm.EdmException; -import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo; -import org.apache.olingo.commons.api.edm.EdmMetadata; -import org.apache.olingo.commons.api.edm.EdmSingletonInfo; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.server.api.edm.provider.EdmProvider; -import org.apache.olingo.server.api.edm.provider.EntityContainer; -import org.apache.olingo.server.api.edm.provider.EntitySet; -import org.apache.olingo.server.api.edm.provider.FunctionImport; -import org.apache.olingo.server.api.edm.provider.Schema; -import org.apache.olingo.server.api.edm.provider.Singleton; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -public class EdmMetadataImplTest { - - @Test - public void allGettersMustDeliver() { - EdmMetadata serviceMetadata = new EdmMetadataImpl(new CustomProvider(true)); - List entitySetInfos = serviceMetadata.getEntitySetInfos(); - assertNotNull(entitySetInfos); - assertEquals(2, entitySetInfos.size()); - - List singletonInfos = serviceMetadata.getSingletonInfos(); - assertNotNull(singletonInfos); - assertEquals(2, singletonInfos.size()); - - List functionImportInfos = serviceMetadata.getFunctionImportInfos(); - assertNotNull(functionImportInfos); - assertEquals(2, functionImportInfos.size()); - - // Cache test - assertTrue(entitySetInfos == serviceMetadata.getEntitySetInfos()); - assertTrue(singletonInfos == serviceMetadata.getSingletonInfos()); - assertTrue(functionImportInfos == serviceMetadata.getFunctionImportInfos()); - } - - @Test - public void initialProvider() { - EdmProvider provider = new EdmProvider() {}; - EdmMetadata serviceMetadata = new EdmMetadataImpl(provider); - assertEquals(ODataServiceVersion.V40, serviceMetadata.getDataServiceVersion()); - } - - @Test(expected = EdmException.class) - public void initialProviderEntitySetInfo() { - EdmProvider provider = new EdmProvider() {}; - EdmMetadata serviceMetadata = new EdmMetadataImpl(provider); - serviceMetadata.getEntitySetInfos(); - } - - @Test(expected = EdmException.class) - public void initialProviderSingletonInfo() { - EdmProvider provider = new EdmProvider() {}; - EdmMetadata serviceMetadata = new EdmMetadataImpl(provider); - serviceMetadata.getSingletonInfos(); - } - - @Test(expected = EdmException.class) - public void initialProviderFunctionImportInfo() { - EdmProvider provider = new EdmProvider() {}; - EdmMetadata serviceMetadata = new EdmMetadataImpl(provider); - serviceMetadata.getFunctionImportInfos(); - } - - @Test - public void emptySchemaMustNotResultInException() { - EdmMetadata serviceMetadata = new EdmMetadataImpl(new CustomProvider(false)); - assertNotNull(serviceMetadata.getEntitySetInfos()); - assertEquals(0, serviceMetadata.getEntitySetInfos().size()); - - assertNotNull(serviceMetadata.getSingletonInfos()); - assertEquals(0, serviceMetadata.getSingletonInfos().size()); - - assertNotNull(serviceMetadata.getFunctionImportInfos()); - assertEquals(0, serviceMetadata.getFunctionImportInfos().size()); - } - - @Test - public void oDataExceptionsGetCaughtAndTransformed() { - EdmProvider provider = new EdmProvider() { - @Override - public List getSchemas() throws ODataException { - throw new ODataException("msg"); - } - }; - - EdmMetadata serviceMetadata = new EdmMetadataImpl(provider); - callGetEntitySetInfosAndExpectException(serviceMetadata); - callGetSingletonInfosAndExpectException(serviceMetadata); - callGetFunctionImportInfosAndExpectException(serviceMetadata); - } - - private void callGetFunctionImportInfosAndExpectException(final EdmMetadata svc) { - try { - svc.getFunctionImportInfos(); - } catch (EdmException e) { - assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage()); - return; - } - fail("Expected EdmException was not thrown"); - - } - - private void callGetSingletonInfosAndExpectException(final EdmMetadata svc) { - try { - svc.getSingletonInfos(); - } catch (EdmException e) { - assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage()); - return; - } - fail("Expected EdmException was not thrown"); - } - - private void callGetEntitySetInfosAndExpectException(final EdmMetadata svc) { - try { - svc.getEntitySetInfos(); - } catch (EdmException e) { - assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage()); - return; - } - fail("Expected EdmException was not thrown"); - } - - private class CustomProvider extends EdmProvider { - private List schemas; - - public CustomProvider(final boolean fillSchema) { - schemas = new ArrayList(); - if (fillSchema) { - List entitySets = new ArrayList(); - entitySets.add(new EntitySet().setName("1")); - entitySets.add(new EntitySet().setName("2")); - List singletons = new ArrayList(); - singletons.add(new Singleton().setName("1")); - singletons.add(new Singleton().setName("2")); - List functionImports = new ArrayList(); - functionImports.add(new FunctionImport().setName("1")); - functionImports.add(new FunctionImport().setName("2")); - EntityContainer entityContainer = - new EntityContainer().setName("cont").setEntitySets(entitySets).setSingletons(singletons) - .setFunctionImports(functionImports); - Schema schema = new Schema().setEntityContainer(entityContainer); - schemas.add(schema); - } - } - - @Override - public List getSchemas() throws ODataException { - return schemas; - } - } -} diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java index d25d4c4ff..c8a4e381c 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java @@ -98,7 +98,6 @@ public class EdmProviderImplTest { localEdm.getEntityType(FQN); localEdm.getEnumType(FQN); localEdm.getTypeDefinition(FQN); - localEdm.getServiceMetadata(); } @Test @@ -222,10 +221,4 @@ public class EdmProviderImplTest { assertNull(edm.getComplexType(WRONG_FQN)); } - - @Test - public void getServiceMetadata() { - assertNotNull(edm.getServiceMetadata()); - } - }