use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-hibernate by jbosstools.
the class ConsoleConfigurationTest method prepareConsoleConfiguration.
public void prepareConsoleConfiguration(String hibernateVersion) {
KnownConfigurationsView v = new KnownConfigurationsView();
v.open();
EditConfigurationShell s = v.addConfiguration();
s.setName(CONSOLE_NAME);
EditConfigurationMainPage p = s.getMainPage();
p.setProject(prjName);
p.setDatabaseConnection(PredefinedConnection.HIBERNATE_CONFIGURED_CONNECTION);
p.setConfigurationFile("/" + prjName + "/" + HIBERNATE_CFG_FILE);
p.setHibernateVersion(hibernateVersion);
// ANY ERROR IN WIZARD ??
s.ok();
v.open();
EditConfigurationShell s2 = v.openConsoleConfiguration(CONSOLE_NAME);
s2.close();
v.open();
try {
v.selectNode(CONSOLE_NAME, "Database", "SAKILA.PUBLIC", "ACTOR");
} catch (WaitTimeoutExpiredException e) {
log.info("Wait timeout occured, try rebuilding console config");
v.selectConsole(CONSOLE_NAME);
new ContextMenuItem("Rebuild configuration").select();
new WaitWhile(new JobIsRunning());
v.selectNode(CONSOLE_NAME, "Database", "SAKILA.PUBLIC", "ACTOR");
}
}
use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-hibernate by jbosstools.
the class MappingDiagramTest method checkMappingDiagram.
private void checkMappingDiagram() {
AutoBuilding ab = new AutoBuilding() {
@Override
public Class<? extends Annotation> annotationType() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean value() {
return false;
}
@Override
public boolean cleanup() {
// TODO Auto-generated method stub
return true;
}
};
AutoBuildingRequirement abr = new AutoBuildingRequirement();
abr.setDeclaration(ab);
openMappingDiagram();
try {
new DefaultEditor(prj + ": Actor and 15 others");
} catch (RedDeerException e) {
// workaroud due to buggy auto building
abr.fulfill();
PackageExplorerPart pe = new PackageExplorerPart();
pe.getProject(prj).select();
new ShellMenuItem("Project", "Build Project").select();
new WaitWhile(new JobIsRunning());
openMappingDiagram();
new DefaultEditor(prj + ": Actor and 15 others");
} finally {
abr.cleanUp();
}
}
use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-hibernate by jbosstools.
the class ProjectImporter method importProjectWithoutErrors.
/**
* Import porject and requires no errors in problems log
* @param pluginId plug-in id of project where project resources are located
* @param projectName project name to import
*/
public static void importProjectWithoutErrors(String pluginId, String projectName, Map<String, String> libraryPathMap) {
importProject(pluginId, projectName);
if (libraryPathMap != null) {
Map<String, String> fullPathJars = new HashMap<>();
for (String jar : libraryPathMap.keySet()) {
if (libraryPathMap.get(jar) == null) {
fullPathJars.put(jar, LIB_DIR);
} else {
fullPathJars.put(jar, LIB_DIR + libraryPathMap.get(jar));
}
}
ProjectHelper.addLibrariesIntoProject(projectName, fullPathJars);
}
new WaitUntil(new JobIsRunning(), TimePeriod.SHORT, false);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
ProblemsView problemsView = new ProblemsView();
problemsView.open();
new WaitWhile(new JobIsRunning());
List<Problem> problems = problemsView.getProblems(ProblemType.ERROR);
for (Problem p : problems) {
log.error("Unexpected " + problems.size() + " problem(s):");
log.dump("Problem: " + p.toString());
}
assertTrue("No problems after import are expected", problems.size() == 0);
}
use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-openshift by jbosstools.
the class PublishChangesTest method verifyChangesTookEffect.
private void verifyChangesTookEffect() {
new ServerAdapter(Version.OPENSHIFT3, "eap-app", "Service").select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.SHOW_IN_WEB_BROWSER).select();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
try {
new WaitUntil(new BrowserContainsText("Hello"), TimePeriod.VERY_LONG);
} catch (WaitTimeoutExpiredException ex) {
fail("Application was not deployed successfully because it is not shown in web browser properly.");
}
}
use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-openshift by jbosstools.
the class PublishChangesTest method removeAdapterAndApplication.
@AfterClass
public static void removeAdapterAndApplication() {
try {
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new ServerAdapter(Version.OPENSHIFT3, "eap-app", "Service").delete();
} catch (OpenShiftToolsException ex) {
// do nothing, adapter does not exists
}
new ProjectExplorer().getProject(PROJECT_NAME).delete(false);
TestUtils.cleanupGitFolder(new File(GIT_REPO_DIRECTORY));
}
Aggregations