Search in sources :

Example 16 with SWTWorkbenchBot

use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project linuxtools by eclipse.

the class BaseSWTBotTest method beforeClass.

@BeforeClass
public static void beforeClass() {
    bot = new SWTWorkbenchBot();
    bot.views().stream().filter(v -> v.getReference().getTitle().equals("Welcome")).forEach(v -> v.close());
    bot.perspectiveById("org.eclipse.linuxtools.docker.ui.perspective").activate();
}
Also used : IDockerConnection(org.eclipse.linuxtools.docker.core.IDockerConnection) MockDockerConnectionStorageManagerFactory(org.eclipse.linuxtools.internal.docker.ui.testutils.MockDockerConnectionStorageManagerFactory) SWTBotJunit4ClassRunner(org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner) DockerExplorerView(org.eclipse.linuxtools.internal.docker.ui.views.DockerExplorerView) BeforeClass(org.junit.BeforeClass) DockerConnectionManager(org.eclipse.linuxtools.docker.core.DockerConnectionManager) RunWith(org.junit.runner.RunWith) SWTUtils(org.eclipse.linuxtools.internal.docker.ui.testutils.swt.SWTUtils) SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) BeforeClass(org.junit.BeforeClass)

Example 17 with SWTWorkbenchBot

use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project eclipse-pmd by acanda.

the class GUITestCase method initSWTBotPreferencesAndOpenJavaPerspective.

@BeforeClass
public static void initSWTBotPreferencesAndOpenJavaPerspective() {
    SWTBotPreferences.TIMEOUT = 10000;
    final SWTWorkbenchBot workbenchBot = new SWTWorkbenchBot();
    closeWelcomeView(workbenchBot);
    openJavaPerspective(workbenchBot);
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) BeforeClass(org.junit.BeforeClass)

Example 18 with SWTWorkbenchBot

use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project xtext-xtend by eclipse.

the class AbstractRefactoringSwtBotTest method initialize.

@BeforeClass
public static void initialize() {
    try {
        TargetPlatformUtil.setTargetPlatform(AbstractRefactoringSwtBotTest.class);
        IResourcesSetupUtil.cleanWorkspace();
        SWTWorkbenchBot _sWTWorkbenchBot = new SWTWorkbenchBot();
        AbstractRefactoringSwtBotTest.bot = _sWTWorkbenchBot;
        UIThreadRunnable.syncExec(new VoidResult() {

            @Override
            public void run() {
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().forceActive();
            }
        });
        SwtBotProjectHelper.newXtendProject(AbstractRefactoringSwtBotTest.bot, "test");
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) VoidResult(org.eclipse.swtbot.swt.finder.results.VoidResult) BeforeClass(org.junit.BeforeClass)

Example 19 with SWTWorkbenchBot

use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project xtext-xtend by eclipse.

the class RenameJavaClassSwtBotTest method renameJavaClass.

@Test
public void renameJavaClass() {
    SWTWorkbenchBot _bot = this.getBot();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("package test");
    _builder.newLine();
    _builder.append("class XtendClass extends JavaClass {");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    final SWTBotEclipseEditor xtendEditor = SwtBotProjectHelper.newXtendEditor(_bot, "XtendClass", "test", _builder);
    SWTWorkbenchBot _bot_1 = this.getBot();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("package test;");
    _builder_1.newLine();
    _builder_1.append("public class ?JavaClass? {}");
    _builder_1.newLine();
    final SWTBotEclipseEditor javaEditor = SwtBotProjectHelper.newJavaEditor(_bot_1, "JavaClass", "test", _builder_1);
    this.renameInJavaEditor(javaEditor, "NewJavaClass", "Rename Type");
    StringConcatenation _builder_2 = new StringConcatenation();
    _builder_2.append("package test");
    _builder_2.newLine();
    _builder_2.append("class XtendClass extends NewJavaClass {");
    _builder_2.newLine();
    _builder_2.append("}");
    _builder_2.newLine();
    this.assertEquals(_builder_2, xtendEditor.getText());
    Assert.assertFalse(xtendEditor.isDirty());
    StringConcatenation _builder_3 = new StringConcatenation();
    _builder_3.append("package test;");
    _builder_3.newLine();
    _builder_3.append("public class NewJavaClass {}");
    _builder_3.newLine();
    this.assertEquals(_builder_3, javaEditor.getText());
    Assert.assertFalse(javaEditor.isDirty());
    this.assertEquals("NewJavaClass.java", javaEditor.getTitle());
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) SWTBotEclipseEditor(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Test(org.junit.Test) AbstractRefactoringSwtBotTest(org.eclipse.xtend.ide.tests.AbstractRefactoringSwtBotTest)

Example 20 with SWTWorkbenchBot

use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project xtext-xtend by eclipse.

the class RenameXtendClassSwtBotTest method renameXtendClassWithAA.

@Test
public void renameXtendClassWithAA() {
    SWTWorkbenchBot _bot = this.getBot();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import org.eclipse.xtend.lib.annotations.Data");
    _builder.newLine();
    _builder.append("@Data");
    _builder.newLine();
    _builder.append("class ?Fonk? {}");
    _builder.newLine();
    final SWTBotEclipseEditor barEditor = SwtBotProjectHelper.newXtendEditor(_bot, "Fonk", _builder);
    this.renameInXtendEditor(barEditor, "NewFonk", "Rename Element");
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import org.eclipse.xtend.lib.annotations.Data");
    _builder_1.newLine();
    _builder_1.append("@Data");
    _builder_1.newLine();
    _builder_1.append("class NewFonk {}");
    _builder_1.newLine();
    this.assertEquals(_builder_1, barEditor.getText());
    this.assertEquals("NewFonk.xtend", barEditor.getTitle());
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) SWTBotEclipseEditor(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Test(org.junit.Test) AbstractRefactoringSwtBotTest(org.eclipse.xtend.ide.tests.AbstractRefactoringSwtBotTest)

Aggregations

SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)37 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)15 BeforeClass (org.junit.BeforeClass)15 Test (org.junit.Test)10 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)8 SWTBotEclipseEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor)5 AbstractRefactoringSwtBotTest (org.eclipse.xtend.ide.tests.AbstractRefactoringSwtBotTest)5 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)5 DockerClient (com.spotify.docker.client.DockerClient)4 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)4 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)4 SWTBotMenu (org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)4 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 SWTUtils (org.eclipse.linuxtools.internal.docker.ui.testutils.swt.SWTUtils)3 Before (org.junit.Before)3 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 IWorkspace (org.eclipse.core.resources.IWorkspace)2 IWorkspaceDescription (org.eclipse.core.resources.IWorkspaceDescription)2