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/TestNewClassWizard.java

    r290 r291  
    4949import org.eclipse.swt.widgets.Combo;
    5050import org.eclipse.swt.widgets.Text;
    51 import org.eclipse.ui.PlatformUI;
     51import org.modelica.mdt.core.IModelicaProject;
    5252import org.modelica.mdt.core.ModelicaCore;
    5353import org.modelica.mdt.test.util.Utility;
     
    5959import abbot.tester.swt.TextTester;
    6060
     61import junit.framework.Assert;
    6162import junit.framework.TestCase;
    6263
     
    101102         */
    102103        project =
    103             ModelicaCore.createProject(PROJECT_NAME_1,
    104                     PlatformUI.getWorkbench().getActiveWorkbenchWindow());
    105         assertNotNull("failed to create project", project);
    106        
     104            ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME_1);
     105       
     106        /* create project only if it does not exist yet */
     107        if (!project.exists())
     108        {
     109            IModelicaProject mproj =
     110                ModelicaCore.getModelicaRoot().createProject(PROJECT_NAME_1);
     111            Assert.assertNotNull("failed to create project", mproj);
     112           
     113            project = mproj.getProject();
     114        }
     115           
    107116        /*
    108117         * create the selection that points at the root of the created project
    109118         */
    110         fileDestination =
    111             new StructuredSelection(ResourcesPlugin.getWorkspace().getRoot().
    112                     getProject(PROJECT_NAME_1));
     119        fileDestination = new StructuredSelection(project);
    113120       
    114121        /*
     
    120127               
    121128    }
    122    
    123 
    124129   
    125130    public void openWizardAndFetchWidgets()
     
    161166        assertNotNull("Problems finding classType widget", classType);
    162167       
    163        
    164168        /* make some checks on the state of the wizards */
    165169        assertEquals("Wrong source folder selected",
    166                 sourceFolder.getText(), PROJECT_NAME_1);       
     170                PROJECT_NAME_1, sourceFolder.getText());       
    167171        assertEquals("Junk present in class name field",
    168                 className.getText(), "");
     172                "", className.getText());
    169173        assertFalse("initial equation unexpectedly selected",
    170174                initialEquation.getSelection());
     
    173177        assertFalse("Finish button not disabled",
    174178                finish.getEnabled());
    175        
    176 
    177179    }
    178180   
Note: See TracChangeset for help on using the changeset viewer.