[OLINGO-595] Make EdmProvider an Interface
This commit is contained in:
parent
92e201b0a8
commit
d94edf568c
|
@ -24,13 +24,13 @@ import java.util.Map;
|
||||||
|
|
||||||
import org.apache.olingo.commons.api.ODataException;
|
import org.apache.olingo.commons.api.ODataException;
|
||||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||||
|
import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider;
|
||||||
import org.apache.olingo.commons.api.edm.provider.Action;
|
import org.apache.olingo.commons.api.edm.provider.Action;
|
||||||
import org.apache.olingo.commons.api.edm.provider.ActionImport;
|
import org.apache.olingo.commons.api.edm.provider.ActionImport;
|
||||||
import org.apache.olingo.commons.api.edm.provider.AliasInfo;
|
import org.apache.olingo.commons.api.edm.provider.AliasInfo;
|
||||||
import org.apache.olingo.commons.api.edm.provider.Annotatable;
|
import org.apache.olingo.commons.api.edm.provider.Annotatable;
|
||||||
import org.apache.olingo.commons.api.edm.provider.Annotations;
|
import org.apache.olingo.commons.api.edm.provider.Annotations;
|
||||||
import org.apache.olingo.commons.api.edm.provider.ComplexType;
|
import org.apache.olingo.commons.api.edm.provider.ComplexType;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EdmProvider;
|
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
|
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo;
|
import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntitySet;
|
import org.apache.olingo.commons.api.edm.provider.EntitySet;
|
||||||
|
@ -43,7 +43,7 @@ import org.apache.olingo.commons.api.edm.provider.Singleton;
|
||||||
import org.apache.olingo.commons.api.edm.provider.Term;
|
import org.apache.olingo.commons.api.edm.provider.Term;
|
||||||
import org.apache.olingo.commons.api.edm.provider.TypeDefinition;
|
import org.apache.olingo.commons.api.edm.provider.TypeDefinition;
|
||||||
|
|
||||||
public class ClientEdmProvider extends EdmProvider {
|
public class ClientEdmProvider extends AbstractEdmProvider {
|
||||||
|
|
||||||
private final Map<String, Schema> xmlSchemas;
|
private final Map<String, Schema> xmlSchemas;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
/*
|
||||||
|
* 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.provider;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.olingo.commons.api.ODataException;
|
||||||
|
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||||
|
|
||||||
|
public abstract class AbstractEdmProvider implements EdmProvider {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Action> getActions(final FullQualifiedName actionName) throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Term getTerm(final FullQualifiedName termName) throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
|
||||||
|
throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
|
||||||
|
throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
|
||||||
|
throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
|
||||||
|
throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AliasInfo> getAliasInfos() throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Schema> getSchemas() throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityContainer getEntityContainer() throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Annotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Annotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,7 +23,7 @@ import java.util.List;
|
||||||
import org.apache.olingo.commons.api.ODataException;
|
import org.apache.olingo.commons.api.ODataException;
|
||||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||||
|
|
||||||
public abstract class EdmProvider {
|
public interface EdmProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return an {@link EnumType} or <b>null</b> if nothing is found
|
* This method should return an {@link EnumType} or <b>null</b> if nothing is found
|
||||||
|
@ -32,9 +32,7 @@ public abstract class EdmProvider {
|
||||||
* @return {@link EnumType} for given name
|
* @return {@link EnumType} for given name
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
|
public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return an {@link TypeDefinition} or <b>null</b> if nothing is found
|
* This method should return an {@link TypeDefinition} or <b>null</b> if nothing is found
|
||||||
|
@ -43,9 +41,7 @@ public abstract class EdmProvider {
|
||||||
* @return {@link TypeDefinition} for given name
|
* @return {@link TypeDefinition} for given name
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException {
|
public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return an {@link EntityType} or <b>null</b> if nothing is found
|
* This method should return an {@link EntityType} or <b>null</b> if nothing is found
|
||||||
|
@ -54,9 +50,7 @@ public abstract class EdmProvider {
|
||||||
* @return {@link EntityType} for the given name
|
* @return {@link EntityType} for the given name
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
|
public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return a {@link ComplexType} or <b>null</b> if nothing is found.
|
* This method should return a {@link ComplexType} or <b>null</b> if nothing is found.
|
||||||
|
@ -65,9 +59,7 @@ public abstract class EdmProvider {
|
||||||
* @return {@link ComplexType} for the given name
|
* @return {@link ComplexType} for the given name
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
|
public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return a list of all {@link Action} for the FullQualifiedname or <b>null</b> if nothing is found
|
* This method should return a list of all {@link Action} for the FullQualifiedname or <b>null</b> if nothing is found
|
||||||
|
@ -76,9 +68,7 @@ public abstract class EdmProvider {
|
||||||
* @return List of {@link Action} or null
|
* @return List of {@link Action} or null
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public List<Action> getActions(final FullQualifiedName actionName) throws ODataException {
|
public List<Action> getActions(final FullQualifiedName actionName) throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return a list of all {@link Function} for the FullQualifiedname or <b>null</b> if nothing is
|
* This method should return a list of all {@link Function} for the FullQualifiedname or <b>null</b> if nothing is
|
||||||
|
@ -88,9 +78,7 @@ public abstract class EdmProvider {
|
||||||
* @return List of {@link Function} or null
|
* @return List of {@link Function} or null
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException {
|
public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return a {@link Term} for the FullQualifiedName or <b>null</b> if nothing is found.
|
* This method should return a {@link Term} for the FullQualifiedName or <b>null</b> if nothing is found.
|
||||||
|
@ -98,9 +86,7 @@ public abstract class EdmProvider {
|
||||||
* @return {@link Term} or null
|
* @return {@link Term} or null
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public Term getTerm(final FullQualifiedName termName) throws ODataException {
|
public Term getTerm(final FullQualifiedName termName) throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return an {@link EntitySet} or <b>null</b> if nothing is found
|
* This method should return an {@link EntitySet} or <b>null</b> if nothing is found
|
||||||
|
@ -111,9 +97,7 @@ public abstract class EdmProvider {
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
|
public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
|
||||||
throws ODataException {
|
throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return an {@link Singleton} or <b>null</b> if nothing is found
|
* This method should return an {@link Singleton} or <b>null</b> if nothing is found
|
||||||
|
@ -124,9 +108,7 @@ public abstract class EdmProvider {
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
|
public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
|
||||||
throws ODataException {
|
throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return an {@link ActionImport} or <b>null</b> if nothing is found
|
* This method should return an {@link ActionImport} or <b>null</b> if nothing is found
|
||||||
|
@ -137,9 +119,7 @@ public abstract class EdmProvider {
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
|
public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
|
||||||
throws ODataException {
|
throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return a {@link FunctionImport} or <b>null</b> if nothing is found
|
* This method should return a {@link FunctionImport} or <b>null</b> if nothing is found
|
||||||
|
@ -150,9 +130,7 @@ public abstract class EdmProvider {
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
|
public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
|
||||||
throws ODataException {
|
throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return an {@link EntityContainerInfo} or <b>null</b> if nothing is found
|
* This method should return an {@link EntityContainerInfo} or <b>null</b> if nothing is found
|
||||||
|
@ -161,9 +139,7 @@ public abstract class EdmProvider {
|
||||||
* @return {@link EntityContainerInfo} for the given name
|
* @return {@link EntityContainerInfo} for the given name
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException {
|
public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return a list of all namespaces which have an alias
|
* This method should return a list of all namespaces which have an alias
|
||||||
|
@ -171,9 +147,7 @@ public abstract class EdmProvider {
|
||||||
* @return List of alias info
|
* @return List of alias info
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public List<AliasInfo> getAliasInfos() throws ODataException {
|
public List<AliasInfo> getAliasInfos() throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should return a collection of all {@link Schema}
|
* This method should return a collection of all {@link Schema}
|
||||||
|
@ -181,31 +155,23 @@ public abstract class EdmProvider {
|
||||||
* @return List<{@link Schema}>
|
* @return List<{@link Schema}>
|
||||||
* @throws ODataException
|
* @throws ODataException
|
||||||
*/
|
*/
|
||||||
public List<Schema> getSchemas() throws ODataException {
|
public List<Schema> getSchemas() throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the entity container of this edm
|
* Returns the entity container of this edm
|
||||||
* @return {@link EntityContainer} of this edm
|
* @return {@link EntityContainer} of this edm
|
||||||
*/
|
*/
|
||||||
public EntityContainer getEntityContainer() throws ODataException {
|
public EntityContainer getEntityContainer() throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param targetName
|
* @param targetName
|
||||||
* @return {@link Annotations} group for the given Target
|
* @return {@link Annotations} group for the given Target
|
||||||
*/
|
*/
|
||||||
public Annotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException {
|
public Annotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param annotatedName
|
* @param annotatedName
|
||||||
* @return Annotatble element by target name
|
* @return Annotatble element by target name
|
||||||
*/
|
*/
|
||||||
public Annotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException {
|
public Annotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,17 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.olingo.server.core.edm.provider;
|
package org.apache.olingo.server.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.junit.Assert.fail;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.olingo.commons.api.ODataException;
|
import org.apache.olingo.commons.api.ODataException;
|
||||||
import org.apache.olingo.commons.api.edm.EdmActionImport;
|
import org.apache.olingo.commons.api.edm.EdmActionImport;
|
||||||
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
|
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
|
||||||
|
@ -26,6 +37,7 @@ import org.apache.olingo.commons.api.edm.EdmException;
|
||||||
import org.apache.olingo.commons.api.edm.EdmFunctionImport;
|
import org.apache.olingo.commons.api.edm.EdmFunctionImport;
|
||||||
import org.apache.olingo.commons.api.edm.EdmSingleton;
|
import org.apache.olingo.commons.api.edm.EdmSingleton;
|
||||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||||
|
import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider;
|
||||||
import org.apache.olingo.commons.api.edm.provider.ActionImport;
|
import org.apache.olingo.commons.api.edm.provider.ActionImport;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EdmProvider;
|
import org.apache.olingo.commons.api.edm.provider.EdmProvider;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
|
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
|
||||||
|
@ -38,17 +50,6 @@ import org.apache.olingo.commons.core.edm.provider.EdmProviderImpl;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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.assertNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.when;
|
|
||||||
|
|
||||||
public class EdmEntityContainerImplTest {
|
public class EdmEntityContainerImplTest {
|
||||||
|
|
||||||
EdmEntityContainer container;
|
EdmEntityContainer container;
|
||||||
|
@ -231,7 +232,7 @@ public class EdmEntityContainerImplTest {
|
||||||
assertNull(container.getEntitySet(null));
|
assertNull(container.getEntitySet(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
private class CustomProvider extends EdmProvider {
|
private class CustomProvider extends AbstractEdmProvider {
|
||||||
@Override
|
@Override
|
||||||
public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
|
public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
|
||||||
throws ODataException {
|
throws ODataException {
|
||||||
|
|
|
@ -18,6 +18,15 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.olingo.server.core.edm.provider;
|
package org.apache.olingo.server.core.edm.provider;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.olingo.commons.api.ODataException;
|
import org.apache.olingo.commons.api.ODataException;
|
||||||
import org.apache.olingo.commons.api.edm.Edm;
|
import org.apache.olingo.commons.api.edm.Edm;
|
||||||
import org.apache.olingo.commons.api.edm.EdmAction;
|
import org.apache.olingo.commons.api.edm.EdmAction;
|
||||||
|
@ -34,6 +43,7 @@ import org.apache.olingo.commons.api.edm.EdmSchema;
|
||||||
import org.apache.olingo.commons.api.edm.EdmSingleton;
|
import org.apache.olingo.commons.api.edm.EdmSingleton;
|
||||||
import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
|
import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
|
||||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||||
|
import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider;
|
||||||
import org.apache.olingo.commons.api.edm.provider.Action;
|
import org.apache.olingo.commons.api.edm.provider.Action;
|
||||||
import org.apache.olingo.commons.api.edm.provider.ActionImport;
|
import org.apache.olingo.commons.api.edm.provider.ActionImport;
|
||||||
import org.apache.olingo.commons.api.edm.provider.AliasInfo;
|
import org.apache.olingo.commons.api.edm.provider.AliasInfo;
|
||||||
|
@ -54,15 +64,6 @@ import org.apache.olingo.commons.core.edm.provider.EdmProviderImpl;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.when;
|
|
||||||
|
|
||||||
public class EdmSchemaImplTest {
|
public class EdmSchemaImplTest {
|
||||||
|
|
||||||
private EdmSchema schema;
|
private EdmSchema schema;
|
||||||
|
@ -204,7 +205,7 @@ public class EdmSchemaImplTest {
|
||||||
assertTrue(container == edm.getEntityContainer(null));
|
assertTrue(container == edm.getEntityContainer(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
private class LocalProvider extends EdmProvider {
|
private class LocalProvider extends AbstractEdmProvider {
|
||||||
|
|
||||||
private static final String ALIAS = "alias";
|
private static final String ALIAS = "alias";
|
||||||
private static final String NAMESPACE = "org.namespace";
|
private static final String NAMESPACE = "org.namespace";
|
||||||
|
|
|
@ -38,6 +38,7 @@ import org.apache.olingo.commons.api.edm.EdmComplexType;
|
||||||
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
|
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
|
||||||
import org.apache.olingo.commons.api.edm.EdmSchema;
|
import org.apache.olingo.commons.api.edm.EdmSchema;
|
||||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||||
|
import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider;
|
||||||
import org.apache.olingo.commons.api.edm.provider.Action;
|
import org.apache.olingo.commons.api.edm.provider.Action;
|
||||||
import org.apache.olingo.commons.api.edm.provider.ActionImport;
|
import org.apache.olingo.commons.api.edm.provider.ActionImport;
|
||||||
import org.apache.olingo.commons.api.edm.provider.AliasInfo;
|
import org.apache.olingo.commons.api.edm.provider.AliasInfo;
|
||||||
|
@ -262,7 +263,7 @@ public class MetadataDocumentXmlSerializerTest {
|
||||||
+ "</ComplexType>"));
|
+ "</ComplexType>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private class LocalProvider extends EdmProvider {
|
private class LocalProvider extends AbstractEdmProvider {
|
||||||
private final static String nameSpace = "namespace";
|
private final static String nameSpace = "namespace";
|
||||||
|
|
||||||
private final FullQualifiedName nameETAbstract = new FullQualifiedName(nameSpace, "ETAbstract");
|
private final FullQualifiedName nameETAbstract = new FullQualifiedName(nameSpace, "ETAbstract");
|
||||||
|
|
|
@ -18,14 +18,17 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.olingo.server.tecsvc.provider;
|
package org.apache.olingo.server.tecsvc.provider;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.olingo.commons.api.ODataException;
|
import org.apache.olingo.commons.api.ODataException;
|
||||||
import org.apache.olingo.server.api.edmx.EdmxReference;
|
|
||||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||||
|
import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider;
|
||||||
import org.apache.olingo.commons.api.edm.provider.Action;
|
import org.apache.olingo.commons.api.edm.provider.Action;
|
||||||
import org.apache.olingo.commons.api.edm.provider.ActionImport;
|
import org.apache.olingo.commons.api.edm.provider.ActionImport;
|
||||||
import org.apache.olingo.commons.api.edm.provider.AliasInfo;
|
import org.apache.olingo.commons.api.edm.provider.AliasInfo;
|
||||||
import org.apache.olingo.commons.api.edm.provider.ComplexType;
|
import org.apache.olingo.commons.api.edm.provider.ComplexType;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EdmProvider;
|
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
|
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo;
|
import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntitySet;
|
import org.apache.olingo.commons.api.edm.provider.EntitySet;
|
||||||
|
@ -37,12 +40,9 @@ import org.apache.olingo.commons.api.edm.provider.Schema;
|
||||||
import org.apache.olingo.commons.api.edm.provider.Singleton;
|
import org.apache.olingo.commons.api.edm.provider.Singleton;
|
||||||
import org.apache.olingo.commons.api.edm.provider.Term;
|
import org.apache.olingo.commons.api.edm.provider.Term;
|
||||||
import org.apache.olingo.commons.api.edm.provider.TypeDefinition;
|
import org.apache.olingo.commons.api.edm.provider.TypeDefinition;
|
||||||
|
import org.apache.olingo.server.api.edmx.EdmxReference;
|
||||||
|
|
||||||
import java.util.Arrays;
|
public class EdmTechProvider extends AbstractEdmProvider {
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class EdmTechProvider extends EdmProvider {
|
|
||||||
|
|
||||||
public static final String nameSpace = "olingo.odata.test1";
|
public static final String nameSpace = "olingo.odata.test1";
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.olingo.commons.api.ODataException;
|
import org.apache.olingo.commons.api.ODataException;
|
||||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||||
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
|
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EdmProvider;
|
import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntitySet;
|
import org.apache.olingo.commons.api.edm.provider.EntitySet;
|
||||||
import org.apache.olingo.commons.api.format.ContentType;
|
import org.apache.olingo.commons.api.format.ContentType;
|
||||||
import org.apache.olingo.commons.api.format.ODataFormat;
|
import org.apache.olingo.commons.api.format.ODataFormat;
|
||||||
|
@ -223,7 +223,7 @@ public class ODataHandlerTest {
|
||||||
public void uriParserExceptionResultsInRightResponseEdmCause() throws Exception {
|
public void uriParserExceptionResultsInRightResponseEdmCause() throws Exception {
|
||||||
final OData odata = OData.newInstance();
|
final OData odata = OData.newInstance();
|
||||||
final ServiceMetadata serviceMetadata = odata.createServiceMetadata(
|
final ServiceMetadata serviceMetadata = odata.createServiceMetadata(
|
||||||
new EdmProvider() {
|
new AbstractEdmProvider() {
|
||||||
public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
|
public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
|
||||||
throws ODataException {
|
throws ODataException {
|
||||||
throw new ODataException("msg");
|
throw new ODataException("msg");
|
||||||
|
|
|
@ -25,8 +25,8 @@ import java.util.List;
|
||||||
import org.apache.olingo.commons.api.ODataException;
|
import org.apache.olingo.commons.api.ODataException;
|
||||||
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
|
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
|
||||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||||
|
import org.apache.olingo.commons.api.edm.provider.AbstractEdmProvider;
|
||||||
import org.apache.olingo.commons.api.edm.provider.ComplexType;
|
import org.apache.olingo.commons.api.edm.provider.ComplexType;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EdmProvider;
|
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
|
import org.apache.olingo.commons.api.edm.provider.EntityContainer;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo;
|
import org.apache.olingo.commons.api.edm.provider.EntityContainerInfo;
|
||||||
import org.apache.olingo.commons.api.edm.provider.EntitySet;
|
import org.apache.olingo.commons.api.edm.provider.EntitySet;
|
||||||
|
@ -37,7 +37,7 @@ import org.apache.olingo.commons.api.edm.provider.Property;
|
||||||
import org.apache.olingo.commons.api.edm.provider.PropertyRef;
|
import org.apache.olingo.commons.api.edm.provider.PropertyRef;
|
||||||
import org.apache.olingo.commons.api.edm.provider.Schema;
|
import org.apache.olingo.commons.api.edm.provider.Schema;
|
||||||
|
|
||||||
public class CarsEdmProvider extends EdmProvider {
|
public class CarsEdmProvider extends AbstractEdmProvider {
|
||||||
|
|
||||||
// Service Namespace
|
// Service Namespace
|
||||||
public static final String NAMESPACE = "olingo.odata.sample";
|
public static final String NAMESPACE = "olingo.odata.sample";
|
||||||
|
|
Loading…
Reference in New Issue