Ignore:
Timestamp:
10/11/05 10:22:45 (19 years ago)
Author:
boris
Message:
  • added some tests for new class wizard
File:
1 edited

Legend:

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

    r62 r65  
    4242package org.modelica.mdt.test;
    4343
    44 import org.eclipse.core.resources.IProject;
    45 import org.eclipse.core.resources.ResourcesPlugin;
    46 import org.eclipse.core.runtime.CoreException;
    4744import org.eclipse.swt.widgets.Button;
    4845import org.eclipse.swt.widgets.Text;
    4946import org.eclipse.ui.IWorkbenchWizard;
    50 import org.eclipse.ui.PlatformUI;
    5147import org.modelica.mdt.NewProjectWizard;
    5248
    53 import abbot.finder.matchers.swt.TextMatcher;
    54 import abbot.finder.swt.BasicFinder;
    55 import abbot.finder.swt.MultipleWidgetsFoundException;
    56 import abbot.finder.swt.TestHierarchy;
    57 import abbot.finder.swt.WidgetNotFoundException;
    5849import abbot.tester.swt.ButtonTester;
    5950import abbot.tester.swt.TextTester;
     
    8273
    8374        /*
    84          * create project
     75         * create project by clicking finish button
    8576         */
    86         BasicFinder finder =  /* find finish button */
    87             new BasicFinder(new TestHierarchy(PlatformUI.getWorkbench().getDisplay()));
    88 
    89         Button finish = null;
    90         try
    91         {
    92             finish = (Button) finder.find(new TextMatcher("&Finish"));
    93         }
    94         catch (WidgetNotFoundException e)
    95         {
    96             fail("Finish button not found.");
    97         }
    98         catch (MultipleWidgetsFoundException e)
    99         {
    100             fail("Multiple finish buttons found.");
    101         }
     77        Button finish = Utility.findFinishButton();
    10278       
    103         /* create project by clicking finish button */
    104         while (!finish.getEnabled())
    105         {
    106             /* wait for the name changed to propogate to enable the finish button */
    107         }       
     79        /* wait for the name change to propogate to enable the finish button */
     80        while (!finish.getEnabled()) { Utility.sleep(this, 100); }
     81       
    10882        ButtonTester.getButtonTester().actionClick(finish);
     83   
     84        /*
     85         * check that project was created
     86         */
    10987       
    110        
    111         /* check that project was created */
    112         IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
    113                
    114         assertTrue("new wizard failed to create project", project.exists());
    115         assertTrue("new wizard didnt open the created project", project.isOpen());
    116        
    117         /* check that it have modelica nature */
    118         try         
    119         {
    120             assertTrue("modelica nature not added to the project",
    121                     project.hasNature("org.modelica.mdt.ModelicaNature"));
    122             assertTrue("modelica nature was not enabled on the project",
    123                     project.isNatureEnabled("org.modelica.mdt.ModelicaNature"));
    124 
    125         }
    126         catch (CoreException e)
    127         {
    128             fail("CoreException thrown while probing for modelica nature " + e.getMessage());
    129         }
    130 
    13188    }
    13289
Note: See TracChangeset for help on using the changeset viewer.