Ejemplo n.º 1
0
 private void createElementInEditor(String tool, GraphicalEditor editor) {
   Point clearPoint = UITestingUtilities.getClearPoint(editor);
   String[] toolParts = tool.split("::");
   String toolSet = toolParts[0];
   if (toolParts.length > 1) {
     String toolName = toolParts[1];
     UITestingUtilities.createConnectorInDiagram(
         editor, clearPoint, new Point(clearPoint.x + 100, clearPoint.y), toolSet, toolName);
   } else {
     UITestingUtilities.createConnectorInDiagram(
         editor, clearPoint, new Point(clearPoint.x + 100, clearPoint.y), toolSet);
   }
 }
Ejemplo n.º 2
0
 public void testRenamePackageNoName() {
   createElement("Newpackage", testPackage);
   Package_c[] pkgs =
       Package_c.getManyEP_PKGsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   Package_c pkg = pkgs[pkgs.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(pkg);
   doRenameTest(Messages.resources_nameEmpty, "");
 }
Ejemplo n.º 3
0
 public void testOperationWithSpaces() {
   createElement("Newclass", testPackage);
   ModelClass_c[] classes =
       ModelClass_c.getManyO_OBJsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   ModelClass_c clazz = classes[classes.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(clazz);
   doNewCMETest("Operation", CorePlugin.INVALID_NAME_SPACES);
 }
Ejemplo n.º 4
0
 public void testInterfaceRenameWithInvalidCharacter() {
   createElement("Newinterface", testPackage);
   Interface_c[] is =
       Interface_c.getManyC_IsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   Interface_c i = is[is.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(i);
   doRenameTest(INVALID_CHAR_ERROR, "*");
 }
Ejemplo n.º 5
0
 public void testRenameComponentNoName() {
   createElement("Newcomponent", testPackage);
   Component_c[] cs =
       Component_c.getManyC_CsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   Component_c c = cs[cs.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(c);
   doRenameTest(Messages.resources_nameEmpty, "");
 }
Ejemplo n.º 6
0
 public void testClassRenameWithInvalidCharacter() {
   createElement("Newclass", testPackage);
   ModelClass_c[] objs =
       ModelClass_c.getManyO_OBJsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   ModelClass_c obj = objs[objs.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(obj);
   doRenameTest(INVALID_CHAR_ERROR, "*");
 }
Ejemplo n.º 7
0
 public void testComponentRenameWithInvalidCharacter() {
   createElement("Newcomponent", testPackage);
   Component_c[] cs =
       Component_c.getManyC_CsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   Component_c c = cs[cs.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(c);
   doRenameTest(INVALID_CHAR_ERROR, "*");
 }
Ejemplo n.º 8
0
 public void testPackageRenameWithInvalidCharacter() {
   createElement("Newpackage", testPackage);
   Package_c[] pkgs =
       Package_c.getManyEP_PKGsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   Package_c pkg = pkgs[pkgs.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(pkg);
   doRenameTest(INVALID_CHAR_ERROR, "*");
 }
Ejemplo n.º 9
0
 public void testInterfaceSignalWithSpaces() {
   createElement("Newinterface", testPackage);
   Interface_c[] ifaces =
       Interface_c.getManyC_IsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   Interface_c iface = ifaces[ifaces.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(iface);
   doNewCMETest("Signal", CorePlugin.INVALID_NAME_SPACES);
 }
Ejemplo n.º 10
0
 public void testRenameInterfaceNoName() {
   createElement("Newinterface", testPackage);
   Interface_c[] is =
       Interface_c.getManyC_IsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   Interface_c i = is[is.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(i);
   doRenameTest(Messages.resources_nameEmpty, "");
 }
Ejemplo n.º 11
0
 public void testRenameClassNoName() {
   createElement("Newclass", testPackage);
   ModelClass_c[] objs =
       ModelClass_c.getManyO_OBJsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   ModelClass_c obj = objs[objs.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(obj);
   doRenameTest(Messages.resources_nameEmpty, "");
 }
Ejemplo n.º 12
0
 public void testLiteralSymbolicConstantWithSpaces() {
   createElement("Newconstantspecification", testPackage);
   ConstantSpecification_c[] cs =
       ConstantSpecification_c.getManyCNST_CSPsOnR8001(
           PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   ConstantSpecification_c c = cs[cs.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(c);
   doNewCMETest("Constant", CorePlugin.INVALID_NAME_SPACES);
 }
Ejemplo n.º 13
0
 public void testBridgeWithSpaces() {
   createElement("Newexternalentity", testPackage);
   ExternalEntity_c[] ees =
       ExternalEntity_c.getManyS_EEsOnR8001(
           PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   ExternalEntity_c ee = ees[ees.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(ee);
   doNewCMETest("Bridge Operation", CorePlugin.INVALID_NAME_SPACES);
 }
Ejemplo n.º 14
0
 public void testMessageArgumentWithSpaces() {
   createElementInEditor("Interaction::Synchronous Message", editor);
   Message_c[] msgs =
       Message_c.getManyMSG_MsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   Message_c msg = msgs[msgs.length - 1];
   SynchronousMessage_c sync = SynchronousMessage_c.getOneMSG_SMOnR1018(msg);
   UITestingUtilities.addElementToGraphicalSelection(sync);
   doNewCMETest("Argument", CorePlugin.INVALID_NAME_SPACES);
 }
Ejemplo n.º 15
0
 public void testMemberWithSpaces() {
   createElement("Newstructureddatatype", testPackage);
   StructuredDataType_c[] sdts =
       StructuredDataType_c.getManyS_SDTsOnR17(
           DataType_c.getManyS_DTsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage)));
   StructuredDataType_c sdt = sdts[sdts.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(sdt);
   doNewCMETest("Member", CorePlugin.INVALID_NAME_SPACES);
 }
Ejemplo n.º 16
0
 public void testEnumeratorWithSpaces() {
   createElement("Newenumeration", testPackage);
   EnumerationDataType_c[] edts =
       EnumerationDataType_c.getManyS_EDTsOnR17(
           DataType_c.getManyS_DTsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage)));
   EnumerationDataType_c edt = edts[edts.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(edt);
   doNewCMETest("Enumerator", CorePlugin.INVALID_NAME_SPACES);
 }
Ejemplo n.º 17
0
 @Override
 public void tearDown() {
   errorTxt = "";
   while (PlatformUI.getWorkbench().getDisplay().readAndDispatch()) ;
   UITestingUtilities.clearGraphicalSelection();
   CorePlugin.getDefault()
       .getPreferenceStore()
       .setValue(BridgePointPreferencesStore.USE_DEFAULT_NAME_FOR_CREATION, true);
   Ooaofooa.setPersistEnabled(false);
 }
Ejemplo n.º 18
0
 @Override
 public void initialSetup() throws CoreException {
   // create test system
   project = TestingUtilities.createProject("CanvasInitialNameTests");
   m_sys = getSystemModel(project.getName());
   m_sys.Newpackage();
   Package_c[] testPackages = Package_c.getManyEP_PKGsOnR1401(m_sys);
   testPackage = testPackages[testPackages.length - 1];
   CanvasTestUtilities.openDiagramEditor(testPackage);
   editor = (GraphicalEditor) UITestingUtilities.getActiveEditor();
 }
Ejemplo n.º 19
0
 public void testRenameInterfaceExistingFolder() throws CoreException {
   // create existing folder first
   ResourcesPlugin.getWorkspace()
       .getRoot()
       .getFolder(new Path(testPackage.getFile().getParent().getFullPath() + "/" + getName()))
       .create(true, true, new NullProgressMonitor());
   BaseTest.dispatchEvents(0);
   createElement("Newinterface", testPackage);
   Interface_c[] is =
       Interface_c.getManyC_IsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   Interface_c i = is[is.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(i);
   doRenameTest(EXISTING_FOLDER_ERROR, getName());
 }
Ejemplo n.º 20
0
 public void testRenameClassExistingFolder() throws CoreException {
   // create existing folder first
   ResourcesPlugin.getWorkspace()
       .getRoot()
       .getFolder(new Path(testPackage.getFile().getParent().getFullPath() + "/" + getName()))
       .create(true, true, new NullProgressMonitor());
   BaseTest.dispatchEvents(0);
   createElement("Newclass", testPackage);
   ModelClass_c[] objs =
       ModelClass_c.getManyO_OBJsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPackage));
   ModelClass_c obj = objs[objs.length - 1];
   UITestingUtilities.addElementToGraphicalSelection(obj);
   doRenameTest(EXISTING_FOLDER_ERROR, getName());
 }
Ejemplo n.º 21
0
 private void doNewCMETest(String menuPath, String expectedResult, String value) {
   validateErrorMessage(expectedResult, value);
   UITestingUtilities.activateMenuItem(editor.getCanvas().getMenu(), "New::" + menuPath);
   assertEquals("Did not find expected error text in input dialog.", expectedResult, errorTxt);
 }
Ejemplo n.º 22
0
 private void doRenameTest(String expectedResult, String name) {
   validateErrorMessage(expectedResult, "*");
   UITestingUtilities.activateMenuItem(editor.getCanvas().getMenu(), "Rename");
 }