@Test(expected = ODataException.class) public void errorEdmProviderServiceVersion() throws Exception { EdmServiceMetadata serviceMetadata = new EdmServiceMetadataImplProv(null); serviceMetadata.getDataServiceVersion(); }
@Override public String getDataServiceVersion() throws ODataException { if(edmProvider == null){ throw new ODataException(EDM_PROVIDER_EXEPTION); } if (schemas == null) { schemas = edmProvider.getSchemas(); } if (dataServiceVersion == null) { dataServiceVersion = ODataServiceVersion.V10; for (Schema schema : listOrEmptyList(schemas)) { List<EntityType> entityTypes = listOrEmptyList(schema.getEntityTypes()); for (EntityType entityType : entityTypes) { List<Property> properties = listOrEmptyList(entityType.getProperties()); for (Property property : properties) { if (property.getCustomizableFeedMappings() != null) { if (property.getCustomizableFeedMappings().getFcKeepInContent() != null) { if (!property.getCustomizableFeedMappings().getFcKeepInContent()) { dataServiceVersion = ODataServiceVersion.V20; return dataServiceVersion; } } if (entityType.getCustomizableFeedMappings() != null) { if (entityType.getCustomizableFeedMappings().getFcKeepInContent() != null) { if (entityType.getCustomizableFeedMappings().getFcKeepInContent()) { dataServiceVersion = ODataServiceVersion.V20; return dataServiceVersion; } } } } } } } } return dataServiceVersion; }
EdmServiceMetadataImplProv implements EdmServiceMetadata { @Override public String getDataServiceVersion() throws ODataException { if(edmProvider == null){ throw new ODataException(EDM_PROVIDER_EXEPTION); } if (schemas == null) { schemas = edmProvider.getSchemas(); } if (dataServiceVersion == null) { dataServiceVersion = ODataServiceVersion.V10; for (Schema schema : listOrEmptyList(schemas)) { List<EntityType> entityTypes = listOrEmptyList(schema.getEntityTypes()); for (EntityType entityType : entityTypes) { List<Property> properties = listOrEmptyList(entityType.getProperties()); for (Property property : properties) { if (property.getCustomizableFeedMappings() != null) { if (property.getCustomizableFeedMappings().getFcKeepInContent() != null) { if (!property.getCustomizableFeedMappings().getFcKeepInContent()) { dataServiceVersion = ODataServiceVersion.V20; return dataServiceVersion; } } if (entityType.getCustomizableFeedMappings() != null) { if (entityType.getCustomizableFeedMappings().getFcKeepInContent() != null) { if (entityType.getCustomizableFeedMappings().getFcKeepInContent()) { dataServiceVersion = ODataServiceVersion.V20; return dataServiceVersion; } } } } } } } } return dataServiceVersion; } }
EdmServiceMetadataImplProv implements EdmServiceMetadata { @Override public String getDataServiceVersion() throws ODataException { if(edmProvider == null){ throw new ODataException(EDM_PROVIDER_EXEPTION); } if (schemas == null) { schemas = edmProvider.getSchemas(); } if (dataServiceVersion == null) { dataServiceVersion = ODataServiceVersion.V10; for (Schema schema : listOrEmptyList(schemas)) { List<EntityType> entityTypes = listOrEmptyList(schema.getEntityTypes()); for (EntityType entityType : entityTypes) { List<Property> properties = listOrEmptyList(entityType.getProperties()); for (Property property : properties) { if (property.getCustomizableFeedMappings() != null) { if (property.getCustomizableFeedMappings().getFcKeepInContent() != null) { if (!property.getCustomizableFeedMappings().getFcKeepInContent()) { dataServiceVersion = ODataServiceVersion.V20; return dataServiceVersion; } } if (entityType.getCustomizableFeedMappings() != null) { if (entityType.getCustomizableFeedMappings().getFcKeepInContent() != null) { if (entityType.getCustomizableFeedMappings().getFcKeepInContent()) { dataServiceVersion = ODataServiceVersion.V20; return dataServiceVersion; } } } } } } } } return dataServiceVersion; } EdmServiceMetadataImplProv(final EdmProvider edmProvider); }
EdmServiceMetadataImplProv implements EdmServiceMetadata { @Override public String getDataServiceVersion() throws ODataException { if(edmProvider == null){ throw new ODataException(EDM_PROVIDER_EXEPTION); } if (schemas == null) { schemas = edmProvider.getSchemas(); } if (dataServiceVersion == null) { dataServiceVersion = ODataServiceVersion.V10; for (Schema schema : listOrEmptyList(schemas)) { List<EntityType> entityTypes = listOrEmptyList(schema.getEntityTypes()); for (EntityType entityType : entityTypes) { List<Property> properties = listOrEmptyList(entityType.getProperties()); for (Property property : properties) { if (property.getCustomizableFeedMappings() != null) { if (property.getCustomizableFeedMappings().getFcKeepInContent() != null) { if (!property.getCustomizableFeedMappings().getFcKeepInContent()) { dataServiceVersion = ODataServiceVersion.V20; return dataServiceVersion; } } if (entityType.getCustomizableFeedMappings() != null) { if (entityType.getCustomizableFeedMappings().getFcKeepInContent() != null) { if (entityType.getCustomizableFeedMappings().getFcKeepInContent()) { dataServiceVersion = ODataServiceVersion.V20; return dataServiceVersion; } } } } } } } } return dataServiceVersion; } EdmServiceMetadataImplProv(final EdmProvider edmProvider); @Override InputStream getMetadata(); @Override String getDataServiceVersion(); @Override List<EdmEntitySetInfo> getEntitySetInfos(); }
EdmServiceMetadataImplProv implements EdmServiceMetadata { @Override public String getDataServiceVersion() throws ODataException { if(edmProvider == null){ throw new ODataException(EDM_PROVIDER_EXEPTION); } if (schemas == null) { schemas = edmProvider.getSchemas(); } if (dataServiceVersion == null) { dataServiceVersion = ODataServiceVersion.V10; for (Schema schema : listOrEmptyList(schemas)) { List<EntityType> entityTypes = listOrEmptyList(schema.getEntityTypes()); for (EntityType entityType : entityTypes) { List<Property> properties = listOrEmptyList(entityType.getProperties()); for (Property property : properties) { if (property.getCustomizableFeedMappings() != null) { if (property.getCustomizableFeedMappings().getFcKeepInContent() != null) { if (!property.getCustomizableFeedMappings().getFcKeepInContent()) { dataServiceVersion = ODataServiceVersion.V20; return dataServiceVersion; } } if (entityType.getCustomizableFeedMappings() != null) { if (entityType.getCustomizableFeedMappings().getFcKeepInContent() != null) { if (entityType.getCustomizableFeedMappings().getFcKeepInContent()) { dataServiceVersion = ODataServiceVersion.V20; return dataServiceVersion; } } } } } } } } return dataServiceVersion; } EdmServiceMetadataImplProv(final EdmProvider edmProvider); @Override InputStream getMetadata(); @Override String getDataServiceVersion(); @Override List<EdmEntitySetInfo> getEntitySetInfos();  }