本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}