Skip to content

Commit

Permalink
fix another batch of tests, fixes eclipse-archived#2156
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Dockal <[email protected]>
  • Loading branch information
odockal committed Aug 31, 2022
1 parent f870ab2 commit 43d4d6d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.eclipse.reddeer.common.matcher.RegexMatcher;
import org.eclipse.reddeer.common.wait.TimePeriod;
import org.eclipse.reddeer.common.wait.WaitUntil;
import org.eclipse.reddeer.common.wait.WaitWhile;
import org.eclipse.reddeer.core.matcher.WithTextMatcher;
import org.eclipse.reddeer.swt.api.TableItem;
import org.eclipse.reddeer.swt.condition.TableHasRows;
Expand All @@ -44,6 +45,7 @@ public default void addExtendedInterface(String interfaceName) {
new DefaultShell(new WithTextMatcher(new RegexMatcher("[Extended|Implemented].*Interfaces Selection")));
new DefaultText(0).setText(interfaceName);
new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM, false);
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
new WaitUntil(new TableHasRows(new DefaultTable(0)), TimePeriod.DEFAULT, false);

switch (new DefaultTable(0).getItems().size()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import org.eclipse.reddeer.core.reference.ReferencedComposite;
import org.eclipse.reddeer.swt.impl.button.CheckBox;
import org.eclipse.reddeer.swt.impl.button.LabeledCheckBox;
import org.eclipse.reddeer.swt.impl.text.LabeledText;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,18 @@ public NewJavaProjectWizardPageOne createModuleInfoFile(boolean check) {
box.toggle(check);
return this;
}

/**
* Sets module name
* @param String name
* sets default module name labeled text input.
* @return
*/
public NewJavaProjectWizardPageOne setModuleInfoFileName(String name) {
LabeledText moduleInput = new LabeledText(this, "Module name:");
log.debug("Setting 'Module name:' to " + name);
moduleInput.setText(name);
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public class JUnitRunTest {
public static void createTestProject() {
JavaProjectWizard projectWizard = new JavaProjectWizard();
projectWizard.open();
new NewJavaProjectWizardPageOne(projectWizard).setProjectName(PROJECT_NAME);
NewJavaProjectWizardPageOne page = new NewJavaProjectWizardPageOne(projectWizard);
page.setProjectName(PROJECT_NAME);
page.createModuleInfoFile(false);
projectWizard.finish();

NewClassCreationWizard classWizard = new NewClassCreationWizard();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public void testJavaProjectWizardCreateInfoModule() {
new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM, false);
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
pageOne.createModuleInfoFile(true);
pageOne.setModuleInfoFileName(JAVA_MODULE_NAME);

dialog.finish(true, JAVA_MODULE_NAME);

Expand All @@ -137,7 +138,7 @@ public void testJavaProjectWizardCreateInfoModuleDefaultName() {
explorer.open();

assertTrue(explorer.containsProject(JAVA_PROJECT));
assertTrue(!explorer.getProject(JAVA_PROJECT).containsResource("src", JAVA_MODULE_INFO, JAVA_PROJECT));
assertTrue(explorer.getProject(JAVA_PROJECT).containsResource("src", JAVA_MODULE_INFO, JAVA_PROJECT));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public void setUp() {
dialog.open();
NewJavaProjectWizardPageOne page1 = new NewJavaProjectWizardPageOne(dialog);
page1.setProjectName(PROJECT_NAME);
page1.createModuleInfoFile(false);
dialog.finish(TimePeriod.LONG, false, null);
new WaitUntil(new ProjectExists(PROJECT_NAME), TimePeriod.DEFAULT, false);
}
Expand Down

0 comments on commit 43d4d6d

Please sign in to comment.