package jetbrains.mps.lang.editor.menus.tests; /*Generated by MPS */ import jetbrains.mps.MPSLaunch; import jetbrains.mps.lang.test.runtime.BaseTransformationTest; import org.junit.Test; import jetbrains.mps.lang.test.runtime.BaseEditorTestBody; import java.util.List; import jetbrains.mps.openapi.editor.menus.transformation.TransformationMenuItem; import jetbrains.mps.smodel.SNodePointer; import junit.framework.Assert; import jetbrains.mps.internal.collections.runtime.ListSequence; import jetbrains.mps.internal.collections.runtime.IWhereFilter; import jetbrains.mps.openapi.editor.menus.transformation.ActionItem; @MPSLaunch public class LoadNamedMenu_Test extends BaseTransformationTest { @Test public void test_LoadNamedMenu() throws Throwable { initTest("${mps_home}", "r:4f8193a2-048e-4ddf-b505-dfca00e8c910(jetbrains.mps.lang.editor.menus.tests@tests)"); runTest("jetbrains.mps.lang.editor.menus.tests.LoadNamedMenu_Test$TestBody", "testMethod", false); } @MPSLaunch public static class TestBody extends BaseEditorTestBody { @Override public void testMethodImpl() throws Exception { initEditorComponent("6202297022023746489", ""); List<TransformationMenuItem> items = MenuLoadingUtils.loadNamedMenu(getEditorComponent(), new SNodePointer("r:3b1c2f8c-f04f-4186-97fc-85ed47ba8aeb(jetbrains.mps.lang.editor.menus.testLanguage.editor)", "6202297022023752048"), "test location"); Assert.assertTrue("named menu should contain an item labelled 'named menu item'", ListSequence.fromList(items).any(new IWhereFilter<TransformationMenuItem>() { public boolean accept(TransformationMenuItem it) { return it instanceof ActionItem && "named menu item".equals(((ActionItem) it).getLabelText("")); } })); } } }