NewChildTest.java 文件源码

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

项目:library-training 作者:
/**
 * Check that referenced element type are in the registry
 */
@Test
public void checkMenuNewChildElementTypeIdRefs() {
    URI createPlatformPluginURI = URI.createPlatformPluginURI(NEW_CHILD_MENU_PATH, true);
    ResourceSetImpl resourceSetImpl = new ResourceSetImpl();
    Resource resource = resourceSetImpl.getResource(createPlatformPluginURI, true);

    TreeIterator<EObject> allContents = resource.getAllContents();
    while (allContents.hasNext()) {
        EObject eObject = (EObject) allContents.next();
        if (eObject instanceof CreationMenu) {
            String iconPath = ((CreationMenu) eObject).getIcon();
             if (iconPath != null && !"".equals(iconPath)){
                    try {
                        Assert.assertNotNull("The icon "+iconPath+" can't be found", FileLocator.find(new URL(iconPath)));
                    } catch (MalformedURLException e) {
                        Assert.fail("The new child menu is refering to a malformed url "+iconPath);
                    }
             }
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号