use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-hibernate by jbosstools.
the class PersistenceXMLFileTest method prepare.
private void prepare() {
importProject(prj, null);
ProjectExplorer pe = new ProjectExplorer();
pe.open();
PropertyDialog pd = pe.getProject(prj).openProperties();
FacetsPropertyPage fp = new FacetsPropertyPage(pd);
pd.select(fp);
List<TreeItem> facets = fp.getSelectedFacets();
boolean javaFacet = false;
boolean jpaFacet = false;
for (TreeItem facet : facets) {
if (facet.getText().equals("Java")) {
javaFacet = true;
} else if (facet.getText().equals("JPA")) {
jpaFacet = true;
}
}
if (!javaFacet) {
fp.selectFacet("Java");
new DefaultHyperlink(pd).activate();
Shell s = new DefaultShell("Modify Faceted Project");
new OkButton(s).click();
new WaitWhile(new ShellIsAvailable(s));
}
if (!jpaFacet) {
fp.selectFacet("JPA");
new DefaultHyperlink(pd).activate();
Shell s = new DefaultShell("Modify Faceted Project");
new NextButton(s).click();
JpaFacetInstallPage installPage = new JpaFacetInstallPage(s);
installPage.setPlatform("Hibernate (JPA 2.1)");
installPage.setJpaImplementation("Disable Library Configuration");
new OkButton(s).click();
new WaitWhile(new ShellIsAvailable(s));
}
pd.ok();
}
use of org.eclipse.reddeer.common.wait.WaitWhile 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.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class DeleteResourceTest method testDeletePod.
@Test
public void testDeletePod() {
OpenShiftResource applicationPod = OpenShiftUtils.getOpenShiftPod(projectReq.getProjectName(), new StringStartsWith("eap-app-"), connectionReq.getConnection());
String podName = applicationPod.getName();
applicationPod.delete();
try {
OpenShiftResourceExists openShiftResourceExists = new OpenShiftResourceExists(Resource.POD, podName, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection());
new WaitWhile(openShiftResourceExists, TimePeriod.getCustom(15));
} catch (WaitTimeoutExpiredException ex) {
fail("Application pod should be deleted at this point, but it it still present.");
}
}
use of org.eclipse.reddeer.common.wait.WaitWhile 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.common.wait.WaitWhile 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