use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project xtext-xtend by eclipse.
the class RenameJavaClassSwtBotTest method renameJavaClassXtendReference.
@Test
public void renameJavaClassXtendReference() {
SWTWorkbenchBot _bot = this.getBot();
StringConcatenation _builder = new StringConcatenation();
_builder.append("package test;");
_builder.newLine();
_builder.append("public class JavaClass {}");
_builder.newLine();
final SWTBotEclipseEditor javaEditor = SwtBotProjectHelper.newJavaEditor(_bot, "JavaClass", "test", _builder);
SWTWorkbenchBot _bot_1 = this.getBot();
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("package test");
_builder_1.newLine();
_builder_1.append("class XtendClass extends ?JavaClass? {");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
final SWTBotEclipseEditor xtendEditor = SwtBotProjectHelper.newXtendEditor(_bot_1, "XtendClass", "test", _builder_1);
this.renameInXtendEditor(xtendEditor, "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());
}
use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project xtext-xtend by eclipse.
the class RenameXtendClassSwtBotTest method renameXtendClass.
@Test
public void renameXtendClass() {
SWTWorkbenchBot _bot = this.getBot();
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo extends Bar {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final SWTBotEclipseEditor fooEditor = SwtBotProjectHelper.newXtendEditor(_bot, "Foo", _builder);
SWTWorkbenchBot _bot_1 = this.getBot();
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("class ?Bar? {}");
_builder_1.newLine();
final SWTBotEclipseEditor barEditor = SwtBotProjectHelper.newXtendEditor(_bot_1, "Bar", _builder_1);
this.renameInXtendEditor(barEditor, "NewBar", "Rename Element");
StringConcatenation _builder_2 = new StringConcatenation();
_builder_2.append("class Foo extends NewBar {");
_builder_2.newLine();
_builder_2.append("}");
_builder_2.newLine();
this.assertEquals(_builder_2, fooEditor.getText());
StringConcatenation _builder_3 = new StringConcatenation();
_builder_3.append("class NewBar {}");
_builder_3.newLine();
this.assertEquals(_builder_3, barEditor.getText());
this.assertEquals("NewBar.xtend", barEditor.getTitle());
}
use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project xtext-xtend by eclipse.
the class RenameXtendClassSwtBotTest method renameXtendClassReference.
@Test
public void renameXtendClassReference() {
SWTWorkbenchBot _bot = this.getBot();
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Bar {}");
_builder.newLine();
final SWTBotEclipseEditor barEditor = SwtBotProjectHelper.newXtendEditor(_bot, "Bar", _builder);
SWTWorkbenchBot _bot_1 = this.getBot();
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("class Foo extends ?Bar? {");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
final SWTBotEclipseEditor fooEditor = SwtBotProjectHelper.newXtendEditor(_bot_1, "Foo", _builder_1);
this.renameInXtendEditor(fooEditor, "NewBar", "Rename Element");
StringConcatenation _builder_2 = new StringConcatenation();
_builder_2.append("class Foo extends NewBar {");
_builder_2.newLine();
_builder_2.append("}");
_builder_2.newLine();
this.assertEquals(_builder_2, fooEditor.getText());
StringConcatenation _builder_3 = new StringConcatenation();
_builder_3.append("class NewBar {}");
_builder_3.newLine();
this.assertEquals(_builder_3, barEditor.getText());
this.assertEquals("NewBar.xtend", barEditor.getTitle());
}
use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project linuxtools by eclipse.
the class PreferencesTest method testProfileProject.
@Ignore
@Test
public void testProfileProject() throws Exception {
SWTWorkbenchBot bot = new SWTWorkbenchBot();
proj = createProjectAndBuild(FrameworkUtil.getBundle(this.getClass()), PROJ_NAME);
try {
testProfileProjectActions(bot);
} finally {
deleteProject(proj);
}
}
use of org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot in project linuxtools by eclipse.
the class PreferencesTest method testPreferencesPage.
@Test
public void testPreferencesPage() {
SWTWorkbenchBot bot = new SWTWorkbenchBot();
// Set default tool for "timing" profiling.
checkDefaultPreference(PROFILING_PREFS_CATEGORY, PROFILING_PREFS_TYPE);
// Open preferences shell.
// $NON-NLS-1$
SWTBotMenu windowsMenu = bot.menu("Window");
// $NON-NLS-1$
windowsMenu.menu("Preferences").click();
// $NON-NLS-1$
SWTBotShell shell = bot.shell("Preferences");
shell.activate();
// Go to "Profiling Categories" preferences page.
bot.text().setText(PROFILING_PREFS_CATEGORY);
bot.waitUntil(new NodeAvailableAndSelect(bot.tree(), "C/C++", "Profiling", "Categories", // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PROFILING_PREFS_CATEGORY));
// Get name of default tool to deselect.
String defaultToolId = ProviderFramework.getProviderIdToRun(null, PROFILING_PREFS_TYPE);
// $NON-NLS-1$
String defaultToolName = ProviderFramework.getToolInformationFromId(defaultToolId, "name");
// Workaround for BZ #344484.
deselectSelectionByName(defaultToolName, bot);
// Assert specified tool to select is what we expect and select it.
SWTBotRadio stubRadio = bot.radio(STUB_LABEL);
assertNotNull(stubRadio);
assertEquals(STUB_TOOLTIP, stubRadio.getToolTipText());
stubRadio.click();
// $NON-NLS-1$
bot.button("Apply").click();
// $NON-NLS-1$
bot.button("Apply and Close").click();
}
Aggregations