/**
  * This method may be overridden by subclasses as restore tests are doing.
  *
  * @throws CoreException
  */
 protected void setupProjectAndTestModel() throws CoreException {
   m_sys = getSystemModel(projectName);
   if (firstTime) {
     // ensureAvailableAndLoaded(domainName, false,false);
     loadProject(projectName);
     firstTime = false;
   }
   project = getProjectHandle(projectName);
   modelRoot =
       Ooaofooa.getInstance(
           Ooaofooa.createModelRootId(getProjectHandle(projectName), "MultiLevelModel", true),
           true);
   graphicsModelRoot = Ooaofgraphics.getInstance(modelRoot.getId());
   Ooaofooa.setPersistEnabled(true);
 }
  //  System
  @Test
  public void testRenameSystem_ThruME_NoEditor() throws Exception {
    performRenameComponentThruMEGenerics(
        "SystemModel", projectName, EditorTestUtilities.EDITOR_TYPE_NONE, false, 0);
    if (toRunTests()) // avoid to rename in setup pass
    projectName += "_n"; // projectName changed for coming tests
    //   super.setupProject(projectName);
    // ((BaseTest)this).get// = getProjectHandle(projectName).getProject();
    super.setupProject(projectName);
    m_sys = getSystemModel(projectName);
    modelRoot =
        Ooaofooa.getInstance(
            Ooaofooa.createModelRootId(getProjectHandle(projectName), projectName, true), true);

    //    graphicsModelRoot = Ooaofgraphics.getInstance(modelRoot.getId());
    getProject().delete(true, null);
  }
Ejemplo n.º 3
0
  /* (non-Javadoc)
   * @see junit.framework.TestCase#setUp()
   */
  protected void setUp() throws Exception {
    super.setUp();

    if (!firstSetup) {

      String modelName = "testOAL1";

      TestingUtilities.importTestingProjectIntoWorkspace("testOAL1");

      project = ResourcesPlugin.getWorkspace().getRoot().getProject("testOAL1");
      m_sys = getSystemModel(project.getName());

      String modelRootId = Ooaofooa.createModelRootId(project, modelName, true);
      modelRoot = Ooaofooa.getInstance(modelRootId, true);
    }

    firstSetup = true;

    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 diskObj =
        ModelClass_c.ModelClassInstance(modelRoot, new Object_test1_c("D_D")); // $NON-NLS-1$
    ModelClass_c libObj =
        ModelClass_c.ModelClassInstance(modelRoot, new Object_test1_c("D_H")); // $NON-NLS-1$
    populateTransformerInstances(diskObj, false);
    populateTransformerInstances(libObj, true);
    populateStateActionInstances();
    populateMDAInstances();
  }