use of org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText in project linuxtools by eclipse.
the class EditDockerFileTest method testEditDockerFile.
@Test
public void testEditDockerFile() {
getConnection();
DockerImagesTab imageTab = openDockerImagesTab();
try {
String dockerFilePath = new File(EDIT_DOCKERFILE_FOLDER).getCanonicalPath();
getConnection();
imageTab.activate();
new DefaultToolItem("Build Image").click();
new WaitUntil(new ShellIsAvailable("Build a Docker Image"));
new LabeledText("Image Name:").setText(IMAGE_NAME);
new LabeledText("Directory:").setText(dockerFilePath);
new PushButton("Edit Dockerfile").click();
new WaitUntil(new ShellIsAvailable("Dockerfile Editor"), TimePeriod.LONG);
DefaultStyledText defaultStyledText = new DefaultStyledText();
String editorText = defaultStyledText.getText();
assertTrue("Editor is empty!", StringUtils.isNotEmpty(editorText));
defaultStyledText.setText(BUILD_IMAGE);
CTabFolder tabFolder = new DefaultCTabFolder();
CTabItem tabItem = tabFolder.getSelection();
KeyboardFactory.getKeyboard().invokeKeyCombination(SWT.CTRL, 'S');
tabItem.close();
new DefaultShell("Build a Docker Image").setFocus();
new FinishButton().click();
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
} catch (IOException ex) {
fail("Resource file not found!");
}
}
use of org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText in project jbosstools-hibernate by jbosstools.
the class JpaXmlEditor method getSourceText.
/**
* Returns editor's source text
* @return editor source text
*/
public String getSourceText() {
activateSourceTab();
DefaultStyledText dst = new DefaultStyledText(this);
String source = dst.getText();
return source;
}
use of org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText in project jbosstools-hibernate by jbosstools.
the class CodeGenerationKeyWordsTest method createRevengFile.
private void createRevengFile() {
ProjectExplorer pe = new ProjectExplorer();
pe.open();
pe.selectProjects(prj);
NewReverseEngineeringFileWizard wizard = new NewReverseEngineeringFileWizard();
wizard.open();
wizard.next();
TableFilterWizardPage page = new TableFilterWizardPage(wizard);
page.setConsoleConfiguration(prj);
page.refreshDatabaseSchema();
page.pressInclude();
wizard.finish();
ReverseEngineeringEditor re = new ReverseEngineeringEditor();
re.activateSourceTab();
DefaultStyledText ds = new DefaultStyledText();
ds.selectPosition(ds.getPositionOfText("</hibernate-reverse-engineering>"));
ds.insertText("<table catalog=\"SAKILA\" schema=\"PUBLIC\" name=\"ACTOR\">" + "<column name=\"FIRST_NAME\" property=\"implements\" type=\"string\" /></table>");
re.save();
}
use of org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText in project jbosstools-hibernate by jbosstools.
the class JPADetailsViewTest method testJPADetailView.
@Test
public void testJPADetailView() {
ProjectUtils.getItem(PRJ, "org.gen", "Actor.java").open();
TextEditor textEditor = new TextEditor("Actor.java");
textEditor.setCursorPosition(20, 1);
JPADetailsView jpaDetailsView = new JPADetailsView();
jpaDetailsView.open();
try {
new DefaultStyledText("Type 'Actor' is mapped as entity.");
} catch (RedDeerException e) {
fail("JPA details should be available - known issue - https://issues.jboss.org/browse/JBIDE-17940");
}
}
use of org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText in project jbosstools-openshift by jbosstools.
the class ServerAdapterFromResourceTest method newAdapterFromResource.
private void newAdapterFromResource(Resource type, String name) {
project.refresh();
project.getOpenShiftResource(type, name).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
String resourceType = null;
String selectors = name + " name=" + name;
if (type.equals(Resource.DEPLOYMENT)) {
resourceType = "ReplicationController";
selectors = name + " deploymentconfig=" + serviceReq.getService().getName() + ", name=" + serviceReq.getService().getName() + ", deployment=" + name;
} else {
resourceType = type.toString().replaceFirst(".$", "").replaceAll(" ", "");
}
assertTrue("Resource should be preselected for new OpenShift 3 server adapter", new DefaultTreeItem(project.getName(), selectors).isSelected());
try {
new DefaultStyledText(resourceType);
} catch (RedDeerException e) {
fail("Resource type does not match");
}
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(""));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, name, resourceType).test());
adapter = new ServerAdapter(Version.OPENSHIFT3, name, resourceType);
}
Aggregations