Search in sources :

Example 1 with TextEditor

use of org.eclipse.reddeer.workbench.impl.editor.TextEditor 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");
    }
}
Also used : JPADetailsView(org.jboss.tools.hibernate.reddeer.view.JPADetailsView) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) Test(org.junit.Test)

Example 2 with TextEditor

use of org.eclipse.reddeer.workbench.impl.editor.TextEditor in project jbosstools-openshift by jbosstools.

the class PublishChangesTest method changeProjectAndVerifyAutoPublish.

private void changeProjectAndVerifyAutoPublish() {
    ProjectExplorer projectExplorer = new ProjectExplorer();
    projectExplorer.open();
    projectExplorer.getProject(PROJECT_NAME).select();
    ProjectItem projectItem = projectExplorer.getProject(PROJECT_NAME).getProjectItem("Java Resources", "src/main/java", "org.jboss.as.quickstarts.helloworld", "HelloService.java");
    projectItem.select();
    projectItem.open();
    TextEditor textEditor = new TextEditor("HelloService.java");
    textEditor.setText(PUBLISHED_CODE);
    textEditor.close(true);
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT);
    new WaitUntil(new ConsoleHasNoChange(), TimePeriod.VERY_LONG);
    assertTrue("Local changes performed to project have not been autopublished, or at least rsync " + "output in console view does not contain information about sending incremental list of changes," + "specifically with changed class " + changedClass, new ConsoleView().getConsoleText().contains(changedClass));
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) ProjectItem(org.eclipse.reddeer.eclipse.core.resources.ProjectItem) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 3 with TextEditor

use of org.eclipse.reddeer.workbench.impl.editor.TextEditor in project jbosstools-openshift by jbosstools.

the class EditResourcesTest method getBuildConfigTextEditor.

private TextEditor getBuildConfigTextEditor() {
    getBuildConfig().select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT).select();
    System.out.println("TESTING:" + "[" + requiredProject.getProjectName() + "] Build Config : eap-app.json");
    return new TextEditor("[" + requiredProject.getProjectName() + "] Build Config : eap-app.json");
}
Also used : TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)

Example 4 with TextEditor

use of org.eclipse.reddeer.workbench.impl.editor.TextEditor in project jbosstools-openshift by jbosstools.

the class EditResourcesTest method testEditBuildConfigAndCheckChangesInExplorer.

@Test
public void testEditBuildConfigAndCheckChangesInExplorer() {
    TextEditor editor = getBuildConfigTextEditor();
    String text = editor.getText();
    if (buildConfig == null) {
        buildConfig = text;
    }
    editor.setText(text.replace(originalRepo, customRepo));
    editor.close(true);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    assertTrue("Changes from updating of a build config should be shown " + "in Properties view, but it is not.", getBuildConfig().getPropertyValue("Source", "URI").equals(customRepo));
}
Also used : TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 5 with TextEditor

use of org.eclipse.reddeer.workbench.impl.editor.TextEditor in project jbosstools-openshift by jbosstools.

the class EditResourcesTest method setOriginalBuildConfigContent.

@After
public void setOriginalBuildConfigContent() {
    if (buildConfig != null) {
        getBuildConfig().select();
        new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT).select();
        TextEditor editor = new TextEditor(BUILD_CONFIG_EDITOR);
        editor.setText(buildConfig);
        editor.close(true);
        new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    }
}
Also used : TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) After(org.junit.After)

Aggregations

TextEditor (org.eclipse.reddeer.workbench.impl.editor.TextEditor)14 Test (org.junit.Test)7 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)5 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)5 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)4 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)4 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)4 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)3 PackageExplorerPart (org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart)2 EditorWithTitleIsActive (org.eclipse.reddeer.workbench.condition.EditorWithTitleIsActive)2 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)1 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)1 ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)1 ProjectItem (org.eclipse.reddeer.eclipse.core.resources.ProjectItem)1 ConsoleView (org.eclipse.reddeer.eclipse.ui.console.ConsoleView)1 ProblemsView (org.eclipse.reddeer.eclipse.ui.views.markers.ProblemsView)1 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)1 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)1