コード例 #1
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, "");
 }
コード例 #2
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, "*");
 }
コード例 #3
0
 public void testRenameComponentExistingFolder() 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("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(EXISTING_FOLDER_ERROR, getName());
 }
  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);
  }
コード例 #5
0
  protected void setUp() throws Exception {
    super.setUp();
    String componentPackageName = "Arrays";
    PersistableModelComponent domainComponentPackage =
        ensureAvailableAndLoaded(
            projectName, componentPackageName, false, false, "Component Package");
    arrayModelRoot = (Ooaofooa) domainComponentPackage.getRootModelElement().getModelRoot();

    IPreferenceStore store = CorePlugin.getDefault().getPreferenceStore();
    store.setValue(BridgePointPreferencesStore.ALLOW_IMPLICIT_COMPONENT_ADDRESSING, true);

    class ComponentNameTest implements ClassQueryInterface_c {
      public boolean evaluate(Object candidate) {
        Component_c selected = (Component_c) candidate;
        return selected.getName().equals("SingleDimensionFixedArrays");
      }
    }
    Component_c comp = Component_c.ComponentInstance(arrayModelRoot, new ComponentNameTest());

    populateFunctionInstances();
    populateBridgeInstances();
    class Object_test1_c implements ClassQueryInterface_c {
      Object_test1_c(String id) {
        m_id = id;
      }

      private String m_id;

      public boolean evaluate(Object inst) {
        ModelClass_c selected = (ModelClass_c) inst;
        return selected.getKey_lett().equals(m_id);
      }
    }
    ModelClass_c testObj =
        ModelClass_c.ModelClassInstance(arrayModelRoot, new Object_test1_c("A_T")); // $NON-NLS-1$

    populateTransformerInstances(testObj, false);

    populateInterfaceOperationInstances(comp, "Port1", true);
    populateInterfaceOperationInstances(comp, "Port2", false);
    populateArrayStateActionInstances();
  }
コード例 #6
0
 public boolean evaluate(Object candidate) {
   Component_c selected = (Component_c) candidate;
   return selected.getName().equals("SingleDimensionFixedArrays");
 }