use of org.eclipse.reddeer.common.wait.GroupWait in project reddeer by eclipse.
the class TaskList method delete.
/**
* Deletes the task list. The stop first option not yet implemented!
*
* @param stopFirst Whether to stop first
*/
public void delete(boolean stopFirst) {
log.info("Deleting Repository");
select();
new ContextMenuItem("Delete").select();
new PushButton("OK").click();
new GroupWait(TIMEOUT, waitUntil(new TreeItemIsDisposed(treeItem)), waitWhile(new JobIsRunning()));
}
use of org.eclipse.reddeer.common.wait.GroupWait in project reddeer by eclipse.
the class MavenProjectWizardArchetypePage method selectArchetypeCatalog.
/**
* Select catalog.
*
* @param catalog to choose archetype from
*/
public MavenProjectWizardArchetypePage selectArchetypeCatalog(String catalog) {
new DefaultCombo(this, 0).setSelection(catalog);
new GroupWait(TimePeriod.VERY_LONG, waitWhile(new JobIsRunning()), waitUntil(new TableHasRows(new DefaultTable(this))));
return this;
}
use of org.eclipse.reddeer.common.wait.GroupWait in project reddeer by eclipse.
the class ProblemsViewTest method testFilterWarnings.
@Test
public void testFilterWarnings() {
final String warningDescription = "The value of the field " + DEFAULT_WARNING_CLASS_NAME + ".i is not used";
final String projectPath = "/" + PROJECT_NAME + "/" + "src";
final String resource = DEFAULT_WARNING_CLASS_NAME + ".java";
/* create 1 error and 2 warnings */
createWarning();
createProblem(false, "NextWarningTestClass");
createError();
/* get filtered warnings */
new GroupWait(waitUntil(new ProblemExists(ProblemType.WARNING)), WaitProvider.waitUntil(new ProblemExists(ProblemType.ERROR)));
List<Problem> warnings = new ProblemsView().getProblems(ProblemType.WARNING, new MarkerDescriptionMatcher(Is.is(warningDescription)), new MarkerResourceMatcher(Is.is(resource)), new MarkerPathMatcher(StringStartsWith.startsWith(projectPath)), new MarkerLocationMatcher(Is.is(WARNING_LOCATION)), new MarkerTypeMatcher(Is.is(JAVA_PROBLEM)));
assertEquals(1, warnings.size());
Problem warning = warnings.get(0);
assertEquals("Warning description", warningDescription, warning.getDescription());
assertEquals("Warning resource", resource, warning.getResource());
assertEquals("Warning path", projectPath, warning.getPath());
assertEquals("Warning location", WARNING_LOCATION, warning.getLocation());
assertEquals("Warning type", JAVA_PROBLEM, warning.getType());
/* verify filtered warnings in the specified location of the specified project*/
warnings = problemsView.getProblems(ProblemType.WARNING, new MarkerPathMatcher(StringStartsWith.startsWith(projectPath)), new MarkerLocationMatcher(Is.is(WARNING_LOCATION)));
assertEquals("Warnings node should contain two " + JAVA_PROBLEM + " warnings in the location \"" + WARNING_LOCATION + "\" of the project with path \"" + projectPath + "\", but:\n" + getProblems(), 2, warnings.size());
}
use of org.eclipse.reddeer.common.wait.GroupWait in project reddeer by eclipse.
the class AbstractServer method operateServerState.
/**
* Operate server state.
*
* @param menuItem
* the menu item
* @param resultState
* the result state
*/
protected void operateServerState(String menuItem, ServerState resultState) {
log.debug("Triggering action: " + menuItem + " on server " + getLabel().getName());
select();
ServerListenerCondition listenerCondition = null;
switch(resultState) {
case STARTED:
listenerCondition = new ServerListenerCondition(IServer.STATE_STARTED, "run");
break;
case STOPPED:
listenerCondition = new ServerListenerCondition(IServer.STATE_STOPPED, null);
break;
case DEBUGGING:
listenerCondition = new ServerListenerCondition(IServer.STATE_STARTED, "debug");
break;
case PROFILING:
listenerCondition = new ServerListenerCondition(IServer.STATE_STARTED, "profile");
break;
default:
throw new EclipseLayerException("Unknown state " + resultState);
}
try {
new ContextMenuItem(menuItem).select();
new GroupWait(getServerStateChangeTimeout(), waitUntil(listenerCondition), waitUntil(new ServerHasState(this, resultState)), waitWhile(new JobIsRunning()));
log.debug("Operate server's state finished, the result server's state is: '" + getLabel().getState() + "'");
} catch (CoreLayerException exc) {
exc.printStackTrace();
throw exc;
} finally {
cleanupServerListener(listenerCondition.getServerListener());
}
}
use of org.eclipse.reddeer.common.wait.GroupWait in project reddeer by eclipse.
the class ServerModule method remove.
/**
* Removes the server module.
*/
public void remove() {
select();
if (treeItem == null) {
throw new EclipseLayerException("ServerModule was already removed");
}
log.info("Remove server module with name '" + getLabel().getName() + "'");
new WaitUntil(new MenuItemIsEnabled(new ShellMenuItem("Edit", "Delete")), TimePeriod.LONG);
new ShellMenuItem("Edit", "Delete").select();
Shell serverShell = new DefaultShell("Server");
new PushButton("OK").click();
new GroupWait(waitWhile(new ShellIsAvailable(serverShell)), waitWhile(new JobIsRunning()), waitUntil(new WidgetIsDisposed(treeItem.getSWTWidget())));
treeItem = null;
WithTextMatcher shellMatcher = new WithTextMatcher(new RegexMatcher("Publishing to .*"));
new WaitUntil(new ShellIsAvailable(shellMatcher), TimePeriod.DEFAULT, false);
new WaitWhile(new ShellIsAvailable(shellMatcher), TimePeriod.LONG);
}
Aggregations