Esempio n. 1
0
  @Override
  protected void initialSetup() throws Exception {
    // disable auto build
    WorkspaceUtil.setAutobuilding(false);

    TestingUtilities.importTestingProjectIntoWorkspace("RTOMoveTests");

    IProject testProject = getProjectHandle("RTOMoveTests");
    m_sys = getSystemModel(testProject.getName());
    m_sys.setUseglobals(true);
    m_sys.getPersistableComponent().loadComponentAndChildren(new NullProgressMonitor());

    IScopeContext projectScope = new ProjectScope(testProject);
    Preferences projectNode =
        projectScope.getNode(BridgePointProjectPreferences.BP_PROJECT_PREFERENCES_ID);
    projectNode.putBoolean(BridgePointProjectReferencesPreferences.BP_PROJECT_REFERENCES_ID, true);

    IProject inscope = TestingUtilities.createProject("InScope Other");
    inscopeOtherProject = getSystemModel(inscope.getName());
    inscopeOtherProject.setUseglobals(true);
    projectScope = new ProjectScope(inscope);
    projectNode = projectScope.getNode(BridgePointProjectPreferences.BP_PROJECT_PREFERENCES_ID);
    projectNode.putBoolean(BridgePointProjectReferencesPreferences.BP_PROJECT_REFERENCES_ID, true);
    inscopeOtherProject.Newpackage();
    IProject outOfScope = TestingUtilities.createProject("OutOfScope Other");
    outOfScopeOtherProject = getSystemModel(outOfScope.getName());
    outOfScopeOtherProject.Newpackage();
  }
  @Before
  public void setUp() throws Exception {
    super.setUp();
    if (!initialized) {
      CorePlugin.disableParseAllOnResourceChange();
      TestVerifierRunTimeErrorMsgs.projectName = projectName;

      // set perspective switch dialog on launch
      DebugUIPlugin.getDefault()
          .getPluginPreferences()
          .setValue(IDebugUIConstants.PLUGIN_ID + ".switch_to_perspective", "always");

      CorePlugin.getDefault()
          .getPluginPreferences()
          .setDefault(BridgePointPreferencesStore.ALLOW_IMPLICIT_COMPONENT_ADDRESSING, true);

      // initialize test model
      final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);

      loadProject(projectName);

      m_sys =
          SystemModel_c.SystemModelInstance(
              Ooaofooa.getDefaultInstance(),
              new ClassQueryInterface_c() {

                public boolean evaluate(Object candidate) {
                  return ((SystemModel_c) candidate).getName().equals(project.getName());
                }
              });

      Ooaofooa.setPersistEnabled(true);
      delayGlobalUpgrade = false;
      modelRoot = (Ooaofooa) m_sys.getModelRoot();
      initialized = true;
    }
  }