[OLINGO-575] Rename getV4 method to getClient
This commit is contained in:
parent
68ddcaf37f
commit
033f35d617
|
@ -90,7 +90,7 @@ public abstract class AbstractService<C extends EdmEnabledODataClient> {
|
||||||
throw new ODataRuntimeException("Only OData V4 or higher supported.");
|
throw new ODataRuntimeException("Only OData V4 or higher supported.");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.client = ODataClientFactory.getEdmEnabledV4(serviceRoot, edm, metadataETag);
|
this.client = ODataClientFactory.getEdmEnabledClient(serviceRoot, edm, metadataETag);
|
||||||
this.client.getConfiguration().setDefaultPubFormat(ODataFormat.JSON_FULL_METADATA);
|
this.client.getConfiguration().setDefaultPubFormat(ODataFormat.JSON_FULL_METADATA);
|
||||||
this.transactional = transactional;
|
this.transactional = transactional;
|
||||||
this.context = new Context();
|
this.context = new Context();
|
||||||
|
|
|
@ -49,6 +49,6 @@ public class V4POJOGenMojo extends AbstractPOJOGenMojo {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
return ODataClientFactory.getV4();
|
return ODataClientFactory.getClient();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -393,7 +393,7 @@ public class BasicITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
ODataClient odata = ODataClientFactory.getV4();
|
ODataClient odata = ODataClientFactory.getClient();
|
||||||
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
||||||
return odata;
|
return odata;
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,7 +217,7 @@ public class BindingITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
ODataClient odata = ODataClientFactory.getV4();
|
ODataClient odata = ODataClientFactory.getClient();
|
||||||
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
||||||
return odata;
|
return odata;
|
||||||
}
|
}
|
||||||
|
|
|
@ -353,7 +353,7 @@ public class DeepInsertITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
ODataClient odata = ODataClientFactory.getV4();
|
ODataClient odata = ODataClientFactory.getClient();
|
||||||
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
||||||
return odata;
|
return odata;
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,6 @@ public final class ExpandSelectITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
return ODataClientFactory.getEdmEnabledV4(TecSvcConst.BASE_URI);
|
return ODataClientFactory.getEdmEnabledClient(TecSvcConst.BASE_URI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -985,7 +985,7 @@ public class FilterSystemQueryITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
ODataClient odata = ODataClientFactory.getV4();
|
ODataClient odata = ODataClientFactory.getClient();
|
||||||
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
||||||
return odata;
|
return odata;
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ public final class MediaITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
ODataClient odata = ODataClientFactory.getV4();
|
ODataClient odata = ODataClientFactory.getClient();
|
||||||
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
||||||
return odata;
|
return odata;
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ public final class NavigationITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
ODataClient odata = ODataClientFactory.getV4();
|
ODataClient odata = ODataClientFactory.getClient();
|
||||||
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
||||||
return odata;
|
return odata;
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ public class OrderBySystemQueryITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
ODataClient odata = ODataClientFactory.getV4();
|
ODataClient odata = ODataClientFactory.getClient();
|
||||||
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
||||||
return odata;
|
return odata;
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,7 +226,7 @@ public class PrimitiveComplexITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
ODataClient odata = ODataClientFactory.getV4();
|
ODataClient odata = ODataClientFactory.getClient();
|
||||||
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
||||||
return odata;
|
return odata;
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,7 +301,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ODataClient getClient() {
|
protected ODataClient getClient() {
|
||||||
ODataClient odata = ODataClientFactory.getV4();
|
ODataClient odata = ODataClientFactory.getClient();
|
||||||
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON);
|
||||||
return odata;
|
return odata;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
public abstract class AbstractTestITCase extends AbstractBaseTestITCase {
|
public abstract class AbstractTestITCase extends AbstractBaseTestITCase {
|
||||||
|
|
||||||
protected static final ODataClient client = ODataClientFactory.getV4();
|
protected static final ODataClient client = ODataClientFactory.getClient();
|
||||||
|
|
||||||
protected static EdmEnabledODataClient edmClient;
|
protected static EdmEnabledODataClient edmClient;
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ public abstract class AbstractTestITCase extends AbstractBaseTestITCase {
|
||||||
testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc/V40/Static.svc";
|
testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc/V40/Static.svc";
|
||||||
testOAuth2ServiceRootURL = "http://localhost:9080/stub/StaticService/V40/OAuth2.svc";
|
testOAuth2ServiceRootURL = "http://localhost:9080/stub/StaticService/V40/OAuth2.svc";
|
||||||
|
|
||||||
edmClient = ODataClientFactory.getEdmEnabledV4(testStaticServiceRootURL);
|
edmClient = ODataClientFactory.getEdmEnabledClient(testStaticServiceRootURL);
|
||||||
|
|
||||||
edmClient.getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
|
edmClient.getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
|
||||||
client.getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
|
client.getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
|
||||||
|
|
|
@ -48,20 +48,20 @@ public class AuthBatchTestITCase extends AbstractTestITCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void clean() throws EdmPrimitiveTypeException {
|
public void clean() throws EdmPrimitiveTypeException {
|
||||||
final ODataClient authclient = ODataClientFactory.getV4();
|
final ODataClient authclient = ODataClientFactory.getClient();
|
||||||
batchRequest(authclient, testStaticServiceRootURL);
|
batchRequest(authclient, testStaticServiceRootURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void authorized() throws EdmPrimitiveTypeException {
|
public void authorized() throws EdmPrimitiveTypeException {
|
||||||
final ODataClient authclient = ODataClientFactory.getV4();
|
final ODataClient authclient = ODataClientFactory.getClient();
|
||||||
authclient.getConfiguration().setHttpClientFactory(new BasicAuthHttpClientFactory("odatajclient", "odatajclient"));
|
authclient.getConfiguration().setHttpClientFactory(new BasicAuthHttpClientFactory("odatajclient", "odatajclient"));
|
||||||
batchRequest(authclient, testAuthServiceRootURL);
|
batchRequest(authclient, testAuthServiceRootURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = HttpClientException.class)
|
@Test(expected = HttpClientException.class)
|
||||||
public void unauthorized() throws EdmPrimitiveTypeException {
|
public void unauthorized() throws EdmPrimitiveTypeException {
|
||||||
final ODataClient unauthclient = ODataClientFactory.getV4();
|
final ODataClient unauthclient = ODataClientFactory.getClient();
|
||||||
unauthclient.getConfiguration().setHttpClientFactory(new BasicAuthHttpClientFactory("not_auth", "not_auth"));
|
unauthclient.getConfiguration().setHttpClientFactory(new BasicAuthHttpClientFactory("not_auth", "not_auth"));
|
||||||
batchRequest(unauthclient, testAuthServiceRootURL);
|
batchRequest(unauthclient, testAuthServiceRootURL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void readAsJSON() throws IOException {
|
public void readAsJSON() throws IOException {
|
||||||
read(ODataClientFactory.getEdmEnabledV4(testDemoServiceRootURL), ODataFormat.JSON);
|
read(ODataClientFactory.getEdmEnabledClient(testDemoServiceRootURL), ODataFormat.JSON);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class OAuth2TestITCase extends AbstractTestITCase {
|
||||||
|
|
||||||
protected EdmEnabledODataClient getEdmClient() {
|
protected EdmEnabledODataClient getEdmClient() {
|
||||||
if (_edmClient == null) {
|
if (_edmClient == null) {
|
||||||
_edmClient = ODataClientFactory.getEdmEnabledV4(testOAuth2ServiceRootURL);
|
_edmClient = ODataClientFactory.getEdmEnabledClient(testOAuth2ServiceRootURL);
|
||||||
_edmClient.getConfiguration().setHttpClientFactory(
|
_edmClient.getConfiguration().setHttpClientFactory(
|
||||||
new CXFOAuth2HttpClientFactory(OAUTH2_GRANT_SERVICE_URI, OAUTH2_TOKEN_SERVICE_URI));
|
new CXFOAuth2HttpClientFactory(OAUTH2_GRANT_SERVICE_URI, OAUTH2_TOKEN_SERVICE_URI));
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,15 +25,15 @@ import org.apache.olingo.commons.api.format.ODataFormat;
|
||||||
|
|
||||||
public final class ODataClientFactory {
|
public final class ODataClientFactory {
|
||||||
|
|
||||||
public static ODataClient getV4() {
|
public static ODataClient getClient() {
|
||||||
return new ODataClientImpl();
|
return new ODataClientImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EdmEnabledODataClient getEdmEnabledV4(final String serviceRoot) {
|
public static EdmEnabledODataClient getEdmEnabledClient(final String serviceRoot) {
|
||||||
return getEdmEnabledV4(serviceRoot, null, null);
|
return getEdmEnabledClient(serviceRoot, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EdmEnabledODataClient getEdmEnabledV4(
|
public static EdmEnabledODataClient getEdmEnabledClient(
|
||||||
final String serviceRoot, final Edm edm, final String metadataETag) {
|
final String serviceRoot, final Edm edm, final String metadataETag) {
|
||||||
|
|
||||||
final EdmEnabledODataClient instance =
|
final EdmEnabledODataClient instance =
|
||||||
|
|
|
@ -43,8 +43,6 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
|
||||||
|
|
||||||
private final EntityContainer xmlEntityContainer;
|
private final EntityContainer xmlEntityContainer;
|
||||||
|
|
||||||
private final List<? extends Schema> xmlSchemas;
|
|
||||||
|
|
||||||
private EdmAnnotationHelper helper;
|
private EdmAnnotationHelper helper;
|
||||||
|
|
||||||
public EdmEntityContainerImpl(final Edm edm, final FullQualifiedName entityContainerName,
|
public EdmEntityContainerImpl(final Edm edm, final FullQualifiedName entityContainerName,
|
||||||
|
@ -54,7 +52,6 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
|
||||||
? null : new FullQualifiedName(xmlEntityContainer.getExtends()));
|
? null : new FullQualifiedName(xmlEntityContainer.getExtends()));
|
||||||
|
|
||||||
this.xmlEntityContainer = xmlEntityContainer;
|
this.xmlEntityContainer = xmlEntityContainer;
|
||||||
this.xmlSchemas = xmlSchemas;
|
|
||||||
if (xmlEntityContainer instanceof EntityContainer) {
|
if (xmlEntityContainer instanceof EntityContainer) {
|
||||||
this.helper = new EdmAnnotationHelperImpl(edm,
|
this.helper = new EdmAnnotationHelperImpl(edm,
|
||||||
(EntityContainer) xmlEntityContainer);
|
(EntityContainer) xmlEntityContainer);
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class EdmSchemaImpl extends AbstractEdmSchema {
|
||||||
|
|
||||||
private final Edm edm;
|
private final Edm edm;
|
||||||
|
|
||||||
private final List<? extends Schema> xmlSchemas;
|
private final List<Schema> xmlSchemas;
|
||||||
|
|
||||||
private final Schema schema;
|
private final Schema schema;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public class EdmSchemaImpl extends AbstractEdmSchema {
|
||||||
private List<EdmEntityContainer> entityContainers;
|
private List<EdmEntityContainer> entityContainers;
|
||||||
|
|
||||||
public EdmSchemaImpl(final ODataServiceVersion version, final Edm edm,
|
public EdmSchemaImpl(final ODataServiceVersion version, final Edm edm,
|
||||||
final List<? extends Schema> xmlSchemas, final Schema schema) {
|
final List<Schema> xmlSchemas, final Schema schema) {
|
||||||
|
|
||||||
super(schema.getNamespace(), schema.getAlias());
|
super(schema.getNamespace(), schema.getAlias());
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
* distributed with this work for additional information
|
* distributed with this work for additional information
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
* to you under the Apache License, Version 2.0 (the
|
* to you under the Apache License, Version 2.0 (the
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
@ -22,6 +22,7 @@ import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.olingo.client.api.edm.xml.ComplexType;
|
||||||
import org.apache.olingo.client.api.edm.xml.EntityType;
|
import org.apache.olingo.client.api.edm.xml.EntityType;
|
||||||
import org.apache.olingo.client.api.edm.xml.NavigationProperty;
|
import org.apache.olingo.client.api.edm.xml.NavigationProperty;
|
||||||
import org.apache.olingo.client.api.edm.xml.Property;
|
import org.apache.olingo.client.api.edm.xml.Property;
|
||||||
|
@ -39,28 +40,25 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper {
|
||||||
|
|
||||||
private final FullQualifiedName structuredTypeName;
|
private final FullQualifiedName structuredTypeName;
|
||||||
|
|
||||||
private final StructuralType complexType;
|
private final StructuralType structuralType;
|
||||||
|
|
||||||
private final List<? extends Schema> xmlSchemas;
|
|
||||||
|
|
||||||
private Map<String, EdmProperty> properties;
|
private Map<String, EdmProperty> properties;
|
||||||
|
|
||||||
private Map<String, EdmNavigationProperty> navigationProperties;
|
private Map<String, EdmNavigationProperty> navigationProperties;
|
||||||
|
|
||||||
public EdmStructuredTypeHelperImpl(final Edm edm, final FullQualifiedName structuredTypeName,
|
public EdmStructuredTypeHelperImpl(final Edm edm, final FullQualifiedName structuredTypeName,
|
||||||
final List<? extends Schema> xmlSchemas, final StructuralType structuralType) {
|
final List<? extends Schema> xmlSchemas, final StructuralType structuralType) {
|
||||||
|
|
||||||
this.edm = edm;
|
this.edm = edm;
|
||||||
this.structuredTypeName = structuredTypeName;
|
this.structuredTypeName = structuredTypeName;
|
||||||
this.complexType = structuralType;
|
this.structuralType = structuralType;
|
||||||
this.xmlSchemas = xmlSchemas;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, EdmProperty> getProperties() {
|
public Map<String, EdmProperty> getProperties() {
|
||||||
if (properties == null) {
|
if (properties == null) {
|
||||||
properties = new LinkedHashMap<String, EdmProperty>();
|
properties = new LinkedHashMap<String, EdmProperty>();
|
||||||
for (Property property : complexType.getProperties()) {
|
for (Property property : structuralType.getProperties()) {
|
||||||
properties.put(property.getName(), new EdmPropertyImpl(edm, structuredTypeName, property));
|
properties.put(property.getName(), new EdmPropertyImpl(edm, structuredTypeName, property));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,11 +69,11 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper {
|
||||||
public Map<String, EdmNavigationProperty> getNavigationProperties() {
|
public Map<String, EdmNavigationProperty> getNavigationProperties() {
|
||||||
if (navigationProperties == null) {
|
if (navigationProperties == null) {
|
||||||
navigationProperties = new LinkedHashMap<String, EdmNavigationProperty>();
|
navigationProperties = new LinkedHashMap<String, EdmNavigationProperty>();
|
||||||
for (NavigationProperty navigationProperty : complexType.getNavigationProperties()) {
|
for (NavigationProperty navigationProperty : structuralType.getNavigationProperties()) {
|
||||||
if (navigationProperty instanceof org.apache.olingo.client.api.edm.xml.NavigationProperty) {
|
if (navigationProperty instanceof org.apache.olingo.client.api.edm.xml.NavigationProperty) {
|
||||||
navigationProperties.put(navigationProperty.getName(), new EdmNavigationPropertyImpl(
|
navigationProperties.put(navigationProperty.getName(), new EdmNavigationPropertyImpl(
|
||||||
edm, structuredTypeName,
|
edm, structuredTypeName,
|
||||||
(org.apache.olingo.client.api.edm.xml.NavigationProperty) navigationProperty));
|
(org.apache.olingo.client.api.edm.xml.NavigationProperty) navigationProperty));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,19 +82,23 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpenType() {
|
public boolean isOpenType() {
|
||||||
return complexType instanceof org.apache.olingo.client.api.edm.xml.ComplexType
|
boolean isOpen = false;
|
||||||
? ((org.apache.olingo.client.api.edm.xml.ComplexType) complexType).isOpenType()
|
if(structuralType instanceof ComplexType){
|
||||||
: complexType instanceof EntityType
|
isOpen = ((ComplexType) structuralType).isOpenType();
|
||||||
? ((EntityType) complexType).isOpenType()
|
}else if(structuralType instanceof EntityType){
|
||||||
: false;
|
isOpen = ((EntityType) structuralType).isOpenType();
|
||||||
|
}
|
||||||
|
return isOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAbstract() {
|
public boolean isAbstract() {
|
||||||
return complexType instanceof org.apache.olingo.client.api.edm.xml.ComplexType
|
boolean isAbstract = false;
|
||||||
? ((org.apache.olingo.client.api.edm.xml.ComplexType) complexType).isAbstractType()
|
if(structuralType instanceof ComplexType){
|
||||||
: complexType instanceof EntityType
|
isAbstract = ((ComplexType) structuralType).isAbstractType();
|
||||||
? ((EntityType) complexType).isAbstractType()
|
}else if(structuralType instanceof EntityType){
|
||||||
: false;
|
isAbstract = ((EntityType) structuralType).isAbstractType();
|
||||||
|
}
|
||||||
|
return isAbstract;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public abstract class AbstractTest {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setClientInstances() {
|
public static void setClientInstances() {
|
||||||
v4Client = ODataClientFactory.getV4();
|
v4Client = ODataClientFactory.getClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getSuffix(final ODataFormat format) {
|
protected String getSuffix(final ODataFormat format) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class ODataClientTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void before() {
|
public void before() {
|
||||||
ODataClient client = ODataClientFactory.getV4();
|
ODataClient client = ODataClientFactory.getClient();
|
||||||
assertNotNull(client);
|
assertNotNull(client);
|
||||||
assertEquals(ODataServiceVersion.V40, client.getServiceVersion());
|
assertEquals(ODataServiceVersion.V40, client.getServiceVersion());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue