use of org.eclipse.reddeer.swt.api.TreeItem 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.swt.api.TreeItem in project jbosstools-openshift by jbosstools.
the class DeployDockerImageTest method debugDockerImageTest.
/**
* Auxiliary method for helping with debugging JBIDE-23841.
* This method maximizes Docker explorer view, captures screenshot and restores the view back.
* It also gathers some info and returns it.
*/
private static String debugDockerImageTest() {
String message = "";
DockerExplorerView dockerExplorerView = new DockerExplorerView();
dockerExplorerView.maximize();
try {
ScreenshotCapturer.getInstance().captureScreenshot("DeployDockerImageTest#setup");
} catch (CaptureScreenshotException e) {
// Capturing screenshot was not successfull. No big deal.
LOGGER.debug("Capturing screenshot was not succesfull.");
}
dockerExplorerView.restore();
List<String> names = dockerExplorerView.getDockerConnectionNames();
for (String name : names) {
DockerConnection connection = dockerExplorerView.getDockerConnectionByName(name);
TreeItem treeItem = connection.getTreeItem();
message += "TreeItem for connection \"" + name + "\": " + treeItem.getText() + "\n";
}
return message;
}
use of org.eclipse.reddeer.swt.api.TreeItem in project jbosstools-openshift by jbosstools.
the class CDKServerWizardAbstractTest method assertServerType.
protected void assertServerType(final String serverType) {
NewCDKServerWizard wizard = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
try {
TreeItem item = new DefaultTreeItem(new String[] { SERVER_TYPE_GROUP }).getItem(serverType);
item.select();
assertTrue(item.getText().equalsIgnoreCase(serverType));
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
} catch (CoreLayerException coreExp) {
log.error(coreExp.getMessage());
fail("Server type " + serverType + " was not found in New Server Wizard");
}
assertEquals(new LabeledText("Server's host name:").getText(), "localhost");
assertEquals(new LabeledText("Server name:").getText(), getServerAdapter());
new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.MEDIUM, false);
assertTrue("Dialog button Next is not enabled!", wizard.isNextEnabled());
try {
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
new CancelButton().click();
} catch (WaitTimeoutExpiredException exc) {
exc.printStackTrace();
log.error("Dialog could not be canceled because there were unfinished jobs running after timeout" + "\n\rTrying to cancel dialog manually");
new DefaultShell("New Server").close();
}
}
use of org.eclipse.reddeer.swt.api.TreeItem in project jbosstools-openshift by jbosstools.
the class DebuggingEAPAppTest method checkDebugView.
private void checkDebugView() {
LaunchView debugView = new LaunchView();
debugView.open();
TreeItem createHelloMessageDebugItem = ensureCorrectFrameIsSelected(debugView);
assertTrue(createHelloMessageDebugItem.getText().contains("createHelloMessage"));
}
use of org.eclipse.reddeer.swt.api.TreeItem in project jbosstools-openshift by jbosstools.
the class NodeJSAppDebugTest method getVariable.
/**
* getVariable from Variables view.
*
* @param variable
* name
* @return TreeItem
*/
protected TreeItem getVariable(String name) {
WorkbenchView variables = new WorkbenchView("Variables");
variables.activate();
DefaultTree variablesTree = new DefaultTree();
TreeItem var = null;
try {
new WaitUntil(new TreeContainsItem(variablesTree, new WithTextMatcher(name), false));
} catch (WaitTimeoutExpiredException e) {
// not found
return null;
}
List<TreeItem> vars = variablesTree.getItems();
for (TreeItem i : vars) {
if (i.getText().equals(name)) {
var = i;
}
}
return var;
}
Aggregations