- Timestamp:
- 10/11/05 10:22:45 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/org.modelica.mdt.test/src/org/modelica/mdt/test/TestNewProjectWizard.java
r62 r65 42 42 package org.modelica.mdt.test; 43 43 44 import org.eclipse.core.resources.IProject;45 import org.eclipse.core.resources.ResourcesPlugin;46 import org.eclipse.core.runtime.CoreException;47 44 import org.eclipse.swt.widgets.Button; 48 45 import org.eclipse.swt.widgets.Text; 49 46 import org.eclipse.ui.IWorkbenchWizard; 50 import org.eclipse.ui.PlatformUI;51 47 import org.modelica.mdt.NewProjectWizard; 52 48 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;58 49 import abbot.tester.swt.ButtonTester; 59 50 import abbot.tester.swt.TextTester; … … 82 73 83 74 /* 84 * create project 75 * create project by clicking finish button 85 76 */ 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(); 102 78 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 108 82 ButtonTester.getButtonTester().actionClick(finish); 83 84 /* 85 * check that project was created 86 */ 109 87 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 try119 {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 131 88 } 132 89
Note: See TracChangeset
for help on using the changeset viewer.