public void doTestParseErrorPreferencesComponent() throws BackingStoreException, CoreException {
    project = getProjectHandle(projectName);
    Package_c testPkg =
        Package_c.getOneEP_PKGOnR1401(
            m_sys,
            new ClassQueryInterface_c() {

              @Override
              public boolean evaluate(Object candidate) {
                return ((Package_c) candidate).getName().equals("Component-Test");
              }
            });
    setProjectPreference(
        BridgePointProjectActionLanguagePreferences.ENABLE_ERROR_FOR_EMPTY_SYNCHRONOUS_MESSAGE,
        true);
    setProjectPreference(
        BridgePointProjectActionLanguagePreferences
            .ENABLE_ERROR_FOR_EMPTY_SYNCHRONOUS_MESSAGE_REALIZED,
        false);
    IMarker[] errors = parseModel(testPkg);
    assertEquals("Incorrect number of parse errors were found.", 0, errors.length);
    ExternalEntity_c ee =
        ExternalEntity_c.getOneS_EEOnR8001(
            PackageableElement_c.getManyPE_PEsOnR8000(
                Package_c.getManyEP_PKGsOnR8001(
                    PackageableElement_c.getManyPE_PEsOnR8003(
                        Component_c.getManyC_CsOnR8001(
                            PackageableElement_c.getManyPE_PEsOnR8000(testPkg))))));
    Bridge_c bridge = Bridge_c.getOneS_BRGOnR19(ee);
    bridge.setAction_semantics_internal("// test comment");
    errors = parseModel(testPkg);
    assertEquals("Incorrect number of parse errors were found.", 1, errors.length);
    setProjectPreference(
        BridgePointProjectActionLanguagePreferences
            .ENABLE_ERROR_FOR_EMPTY_SYNCHRONOUS_MESSAGE_REALIZED,
        true);
    errors = parseModel(testPkg);
    assertEquals("Incorrect number of parse errors were found.", 5, errors.length);
    setProjectPreference(
        BridgePointProjectActionLanguagePreferences
            .ENABLE_ERROR_FOR_EMPTY_SYNCHRONOUS_MESSAGE_REALIZED,
        false);
    setProjectPreference(
        BridgePointProjectActionLanguagePreferences.ENABLE_ERROR_FOR_EMPTY_SYNCHRONOUS_MESSAGE,
        false);
    errors = parseModel(testPkg);
    assertEquals("Incorrect number of parse errors were found.", 1, errors.length);
  }
  public void doTestParseErrorPreferencesPackage() throws BackingStoreException, CoreException {
    Package_c testPkg =
        Package_c.getOneEP_PKGOnR1401(
            m_sys,
            new ClassQueryInterface_c() {

              @Override
              public boolean evaluate(Object candidate) {
                return ((Package_c) candidate).getName().equals("Package-Test");
              }
            });
    IMarker[] errors = parseModel(testPkg);
    assertEquals("Incorrect number of parse errors were found.", 5, errors.length);
    ExternalEntity_c ee =
        ExternalEntity_c.getOneS_EEOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(testPkg));
    ee.setIsrealized(true);
    errors = parseModel(testPkg);
    assertEquals("Incorrect number of parse errors were found.", 4, errors.length);
    setProjectPreference(
        BridgePointProjectActionLanguagePreferences
            .ENABLE_ERROR_FOR_EMPTY_SYNCHRONOUS_MESSAGE_REALIZED,
        true);
    errors = parseModel(testPkg);
    assertEquals("Incorrect number of parse errors were found.", 5, errors.length);
    setProjectPreference(
        BridgePointProjectActionLanguagePreferences
            .ENABLE_ERROR_FOR_EMPTY_SYNCHRONOUS_MESSAGE_REALIZED,
        false);
    setProjectPreference(
        BridgePointProjectActionLanguagePreferences.ENABLE_ERROR_FOR_EMPTY_SYNCHRONOUS_MESSAGE,
        false);
    errors = parseModel(testPkg);
    assertEquals("Incorrect number of parse errors were found.", 0, errors.length);
  }
 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);
 }
 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, "*");
 }
 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, "");
 }
 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, "");
 }
 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, "");
 }
 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, "");
 }
 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, "*");
 }
 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, "*");
 }
 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);
 }
 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, "*");
 }
 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);
 }
 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);
 }
 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);
 }
 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);
 }
 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);
 }
 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());
 }
 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());
 }