Ignore:
Timestamp:
02/05/06 15:03:38 (19 years ago)
Author:
boris
Message:
  • moved the modelica project creation code where it belongs IMHO
  • wraped the call to modelica project creation operation from new project wizard into IWorkspaceRunnable to improve batching of change events
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.test/src/org/modelica/mdt/test/TestNewPackageWizard.java

    r290 r291  
    5050import org.eclipse.swt.widgets.Button;
    5151import org.eclipse.swt.widgets.Text;
    52 import org.eclipse.ui.PlatformUI;
     52import org.modelica.mdt.core.IModelicaProject;
    5353import org.modelica.mdt.core.ModelicaCore;
    5454import org.modelica.mdt.test.util.Utility;
     
    5959import abbot.tester.swt.TextTester;
    6060
     61import junit.framework.Assert;
    6162import junit.framework.TestCase;
    6263
     
    9091         */
    9192        project =
    92             ModelicaCore.createProject(PROJECT_NAME_1,
    93                     PlatformUI.getWorkbench().getActiveWorkbenchWindow());
    94         assertNotNull("failed to create project", project);
    95        
     93            ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME_1);
     94       
     95        /* create project only if it does not exist yet */
     96        if (!project.exists())
     97        {
     98            IModelicaProject mproj =
     99                ModelicaCore.getModelicaRoot().createProject(PROJECT_NAME_1);
     100            Assert.assertNotNull("failed to create project", mproj);
     101           
     102            project = mproj.getProject();
     103        }
     104
    96105        /*
    97106         * create the selection that points at the root of the created project
    98107         */
    99         fileDestination =
    100             new StructuredSelection(ResourcesPlugin.getWorkspace().getRoot().
    101                     getProject(PROJECT_NAME_1));       
     108        fileDestination = new StructuredSelection(project);
     109       
    102110        /*
    103111         * setup testing support objects
Note: See TracChangeset for help on using the changeset viewer.