package jetbrains.mps.lang.editor.diagram.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 jetbrains.mps.smodel.action.SNodeFactoryOperations; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.smodel.ModelAccess; import java.awt.Component; import java.awt.event.MouseEvent; @MPSLaunch public class CreatePort_Test extends BaseTransformationTest { @Test public void test_CreatePort() throws Throwable { initTest("${mps_home}", "r:e41d7e03-7ef3-4161-a48a-e48d8152e422(jetbrains.mps.lang.editor.diagram.tests@tests)"); runTest("jetbrains.mps.lang.editor.diagram.tests.CreatePort_Test$TestBody", "testMethod", false); } @MPSLaunch public static class TestBody extends BaseEditorTestBody { @Override public void testMethodImpl() throws Exception { initEditorComponent("2278461409093572745", "2278461409093572838"); getEditorComponent().getEditorContext().getRepository().getModelAccess().executeCommandInEDT(new Runnable() { public void run() { SNodeFactoryOperations.addNewChild(SNodeOperations.cast(getNodeById("2278461409093572746"), SNodeOperations.asSConcept(MetaAdapterFactory.getConcept(MetaAdapterFactory.getLanguage(0x50560c9658e49c5L, 0xb8e79e4db4c7e97fL, "jetbrains.mps.lang.editor.diagram.testLanguage"), 0x4ce40ecaf41f71d1L, "NodeWithPorts"))), MetaAdapterFactory.getContainmentLink(0x50560c9658e49c5L, 0xb8e79e4db4c7e97fL, 0x4ce40ecaf41f71d1L, 0x4ce40ecaf41f7252L, "outputs"), SNodeFactoryOperations.asInstanceConcept(MetaAdapterFactory.getConcept(0x50560c9658e49c5L, 0xb8e79e4db4c7e97fL, 0x4ce40ecaf41f722aL, "jetbrains.mps.lang.editor.diagram.testLanguage.structure.OutputPort"))); } }); ModelAccess.instance().flushEventQueue(); { int x_rszpwe_c0 = 87; int y_rszpwe_c0 = 42; Component eventTargetComponent_rszpwe_c0 = processMouseEvent(x_rszpwe_c0, y_rszpwe_c0, MouseEvent.MOUSE_PRESSED); processSecondaryMouseEvent(eventTargetComponent_rszpwe_c0, x_rszpwe_c0, y_rszpwe_c0, MouseEvent.MOUSE_RELEASED); processSecondaryMouseEvent(eventTargetComponent_rszpwe_c0, x_rszpwe_c0, y_rszpwe_c0, MouseEvent.MOUSE_CLICKED); } } } }