ResourceSetBasedResourceDescriptionsTest.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:xtext-core 作者:
@Test public void testOneElement_Match() {
    QualifiedName qualifiedName = QualifiedName.create("SomeName");
    EClass type = EcorePackage.Literals.EPACKAGE;
    Resource resource = createResource();
    ENamedElement element = createNamedElement(qualifiedName, type, resource);
    Iterable<IEObjectDescription> iterable = container.getExportedObjectsByType(EcorePackage.Literals.EPACKAGE);
    assertSame(element, Iterables.getOnlyElement(iterable).getEObjectOrProxy());
    iterable = container.getExportedObjectsByType(EcorePackage.Literals.EOBJECT);
    assertSame(element, Iterables.getOnlyElement(iterable).getEObjectOrProxy());
    iterable = container.getExportedObjects(EcorePackage.Literals.EPACKAGE, qualifiedName, false);
    assertSame(element, Iterables.getOnlyElement(iterable).getEObjectOrProxy());
    iterable = container.getExportedObjects(EcorePackage.Literals.ENAMED_ELEMENT, qualifiedName, false);
    assertSame(element, Iterables.getOnlyElement(iterable).getEObjectOrProxy());
    iterable = container.getExportedObjects(EcorePackage.Literals.EOBJECT, qualifiedName, false);
    assertSame(element, Iterables.getOnlyElement(iterable).getEObjectOrProxy());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号