当前位置: 首页>>代码示例>>Java>>正文


Java EdmServiceMetadata.getEntitySetInfos方法代码示例

本文整理汇总了Java中org.apache.olingo.odata2.api.edm.EdmServiceMetadata.getEntitySetInfos方法的典型用法代码示例。如果您正苦于以下问题:Java EdmServiceMetadata.getEntitySetInfos方法的具体用法?Java EdmServiceMetadata.getEntitySetInfos怎么用?Java EdmServiceMetadata.getEntitySetInfos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.olingo.odata2.api.edm.EdmServiceMetadata的用法示例。


在下文中一共展示了EdmServiceMetadata.getEntitySetInfos方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: twoEntitySetsOneContainerForInfo

import org.apache.olingo.odata2.api.edm.EdmServiceMetadata; //导入方法依赖的package包/类
@Test
public void twoEntitySetsOneContainerForInfo() throws Exception {
  List<EntitySet> entitySets = new ArrayList<EntitySet>();
  EntitySet entitySet = new EntitySet().setName("Employees");
  entitySets.add(entitySet);
  entitySets.add(entitySet);

  List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
  EntityContainer container =
      new EntityContainer().setDefaultEntityContainer(true).setName("Container").setEntitySets(entitySets);
  entityContainers.add(container);

  List<Schema> schemas = new ArrayList<Schema>();
  schemas.add(new Schema().setEntityContainers(entityContainers));

  EdmProvider edmProvider = mock(EdmProvider.class);
  when(edmProvider.getSchemas()).thenReturn(schemas);

  EdmServiceMetadata serviceMetadata = new EdmServiceMetadataImplProv(edmProvider);

  List<EdmEntitySetInfo> infos = serviceMetadata.getEntitySetInfos();
  assertNotNull(infos);
  assertEquals(2, infos.size());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:25,代码来源:EdmServiceMetadataImplProvTest.java

示例2: oneEntitySetsOneContainerTwoSchemadForInfo

import org.apache.olingo.odata2.api.edm.EdmServiceMetadata; //导入方法依赖的package包/类
@Test
public void oneEntitySetsOneContainerTwoSchemadForInfo() throws Exception {
  List<EntitySet> entitySets = new ArrayList<EntitySet>();
  EntitySet entitySet = new EntitySet().setName("Employees");
  entitySets.add(entitySet);

  List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
  EntityContainer container =
      new EntityContainer().setDefaultEntityContainer(true).setName("Container").setEntitySets(entitySets);
  entityContainers.add(container);

  List<Schema> schemas = new ArrayList<Schema>();
  schemas.add(new Schema().setEntityContainers(entityContainers));
  schemas.add(new Schema().setEntityContainers(entityContainers));

  EdmProvider edmProvider = mock(EdmProvider.class);
  when(edmProvider.getSchemas()).thenReturn(schemas);

  EdmServiceMetadata serviceMetadata = new EdmServiceMetadataImplProv(edmProvider);

  List<EdmEntitySetInfo> infos = serviceMetadata.getEntitySetInfos();
  assertNotNull(infos);
  assertEquals(2, infos.size());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:25,代码来源:EdmServiceMetadataImplProvTest.java

示例3: getEntitySetInfosForEmptyEdmProvider

import org.apache.olingo.odata2.api.edm.EdmServiceMetadata; //导入方法依赖的package包/类
@Test
public void getEntitySetInfosForEmptyEdmProvider() throws Exception {
  EdmProvider edmProvider = mock(EdmProvider.class);
  EdmServiceMetadata serviceMetadata = new EdmServiceMetadataImplProv(edmProvider);

  List<EdmEntitySetInfo> infos = serviceMetadata.getEntitySetInfos();
  assertNotNull(infos);
  assertTrue(infos.isEmpty());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:10,代码来源:EdmServiceMetadataImplProvTest.java

示例4: getEntitySetInfosForEmptyEdmProviderSchemas

import org.apache.olingo.odata2.api.edm.EdmServiceMetadata; //导入方法依赖的package包/类
@Test
public void getEntitySetInfosForEmptyEdmProviderSchemas() throws Exception {
  List<Schema> schemas = new ArrayList<Schema>();

  EdmProvider edmProvider = mock(EdmProvider.class);
  when(edmProvider.getSchemas()).thenReturn(schemas);

  EdmServiceMetadata serviceMetadata = new EdmServiceMetadataImplProv(edmProvider);

  List<EdmEntitySetInfo> infos = serviceMetadata.getEntitySetInfos();
  assertNotNull(infos);
  assertTrue(infos.isEmpty());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:14,代码来源:EdmServiceMetadataImplProvTest.java

示例5: getEntitySetInfosForNewEdmProviderSchemas

import org.apache.olingo.odata2.api.edm.EdmServiceMetadata; //导入方法依赖的package包/类
/**
 * Check that no NPE can occur with a new created Schema
 *
 * @throws Exception
 */
@Test
public void getEntitySetInfosForNewEdmProviderSchemas() throws Exception {
  List<Schema> schemas = new ArrayList<Schema>();
  schemas.add(new Schema());

  EdmProvider edmProvider = mock(EdmProvider.class);
  when(edmProvider.getSchemas()).thenReturn(schemas);

  EdmServiceMetadata serviceMetadata = new EdmServiceMetadataImplProv(edmProvider);

  List<EdmEntitySetInfo> infos = serviceMetadata.getEntitySetInfos();
  assertNotNull(infos);
  assertTrue(infos.isEmpty());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:20,代码来源:EdmServiceMetadataImplProvTest.java

示例6: oneEntitySetOneContainerForInfo

import org.apache.olingo.odata2.api.edm.EdmServiceMetadata; //导入方法依赖的package包/类
@Test
public void oneEntitySetOneContainerForInfo() throws Exception {
  String entitySetUriString = new URI("Employees").toASCIIString();

  List<EntitySet> entitySets = new ArrayList<EntitySet>();
  EntitySet entitySet = new EntitySet().setName("Employees");
  entitySets.add(entitySet);

  List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
  EntityContainer container =
      new EntityContainer().setDefaultEntityContainer(true).setName("Container").setEntitySets(entitySets);
  entityContainers.add(container);

  List<Schema> schemas = new ArrayList<Schema>();
  schemas.add(new Schema().setEntityContainers(entityContainers));

  EdmProvider edmProvider = mock(EdmProvider.class);
  when(edmProvider.getSchemas()).thenReturn(schemas);

  EdmServiceMetadata serviceMetadata = new EdmServiceMetadataImplProv(edmProvider);

  List<EdmEntitySetInfo> infos = serviceMetadata.getEntitySetInfos();
  assertNotNull(infos);
  assertEquals(1, infos.size());

  assertEquals(infos.get(0).getEntitySetName(), "Employees");
  assertEquals(infos.get(0).getEntityContainerName(), "Container");
  assertEquals(infos.get(0).getEntitySetUri().toASCIIString(), entitySetUriString);
  assertTrue(infos.get(0).isDefaultEntityContainer());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:31,代码来源:EdmServiceMetadataImplProvTest.java

示例7: twoContainersWithOneEntitySetEachForInfo

import org.apache.olingo.odata2.api.edm.EdmServiceMetadata; //导入方法依赖的package包/类
@Test
public void twoContainersWithOneEntitySetEachForInfo() throws Exception {
  String entitySetUriString = new URI("Employees").toASCIIString();
  String entitySetUriString2 = new URI("Container2.Employees").toASCIIString();

  List<EntitySet> entitySets = new ArrayList<EntitySet>();
  EntitySet entitySet = new EntitySet().setName("Employees");
  entitySets.add(entitySet);

  List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
  EntityContainer container =
      new EntityContainer().setDefaultEntityContainer(true).setName("Container").setEntitySets(entitySets);
  entityContainers.add(container);

  EntityContainer container2 =
      new EntityContainer().setDefaultEntityContainer(false).setName("Container2").setEntitySets(entitySets);
  entityContainers.add(container2);

  List<Schema> schemas = new ArrayList<Schema>();
  schemas.add(new Schema().setEntityContainers(entityContainers));

  EdmProvider edmProvider = mock(EdmProvider.class);
  when(edmProvider.getSchemas()).thenReturn(schemas);

  EdmServiceMetadata serviceMetadata = new EdmServiceMetadataImplProv(edmProvider);

  List<EdmEntitySetInfo> infos = serviceMetadata.getEntitySetInfos();
  assertNotNull(infos);
  assertEquals(2, infos.size());

  assertEquals(infos.get(0).getEntitySetName(), "Employees");
  assertEquals(infos.get(0).getEntityContainerName(), "Container");
  assertEquals(infos.get(0).getEntitySetUri().toASCIIString(), entitySetUriString);
  assertTrue(infos.get(0).isDefaultEntityContainer());

  assertEquals(infos.get(1).getEntitySetName(), "Employees");
  assertEquals(infos.get(1).getEntityContainerName(), "Container2");
  assertEquals(infos.get(1).getEntitySetUri().toASCIIString(), entitySetUriString2);
  assertFalse(infos.get(1).isDefaultEntityContainer());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:41,代码来源:EdmServiceMetadataImplProvTest.java


注:本文中的org.apache.olingo.odata2.api.edm.EdmServiceMetadata.getEntitySetInfos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。