use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException in project linuxtools by eclipse.
the class CreaterepoDeltaPropertyPageTest method setUpBeforeClass.
/**
* Initialize the test project.
*
* @throws CoreException
*/
@BeforeClass
public static void setUpBeforeClass() throws CoreException {
testProject = new TestCreaterepoProject();
assertTrue(testProject.getProject().exists());
bot = new SWTWorkbenchBot();
testProject.restoreDefaults();
try {
bot.shell(ICreaterepoTestConstants.MAIN_SHELL).activate();
} catch (WidgetNotFoundException e) {
// cannot activate main shell, continue anyways
}
TestUtils.openResourcePerspective(bot);
navigator = TestUtils.enterProjectFolder(bot);
}
use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException in project linuxtools by eclipse.
the class CreaterepoDeltaPropertyPageTest method tearDown.
/**
* Restore the defaults for the general preference page.
*
* @throws BackingStoreException
*/
@After
public void tearDown() throws BackingStoreException {
try {
if (bot.shell(String.format(ICreaterepoTestConstants.PROPERTIES_SHELL, ICreaterepoTestConstants.REPO_NAME)).isActive()) {
bot.shell(String.format(ICreaterepoTestConstants.PROPERTIES_SHELL, ICreaterepoTestConstants.REPO_NAME)).close();
}
} catch (WidgetNotFoundException e) {
// cannot close property shell
}
testProject.restoreDefaults();
IEclipsePreferences pref = project.getEclipsePreferences();
pref.clear();
pref.flush();
assertEquals(0, pref.keys().length);
}
use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException in project linuxtools by eclipse.
the class CreaterepoGeneralPropertyPageTest method tearDown.
/**
* Restore the defaults for the general preference page.
*
* @throws BackingStoreException
*/
@After
public void tearDown() throws BackingStoreException {
try {
if (bot.shell(String.format(ICreaterepoTestConstants.PROPERTIES_SHELL, ICreaterepoTestConstants.REPO_NAME)).isActive()) {
bot.shell(String.format(ICreaterepoTestConstants.PROPERTIES_SHELL, ICreaterepoTestConstants.REPO_NAME)).close();
}
} catch (WidgetNotFoundException e) {
// cannot close property shell
}
testProject.restoreDefaults();
IEclipsePreferences pref = project.getEclipsePreferences();
pref.clear();
pref.flush();
assertEquals(0, pref.keys().length);
}
use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException in project linuxtools by eclipse.
the class AbstractSWTBotTest method setUpWorkbench.
@BeforeClass
public static void setUpWorkbench() throws Exception {
SWTWorkbenchBot bot = new SWTWorkbenchBot();
try {
bot.viewByTitle("Welcome").close();
// hide Subclipse Usage stats popup if present/installed
bot.shell("Subclipse Usage").activate();
bot.button("Cancel").click();
} catch (WidgetNotFoundException e) {
// ignore
}
// Set C/C++ perspective.
bot.perspectiveByLabel("C/C++").activate();
bot.sleep(500);
for (SWTBotShell sh : bot.shells()) {
if (sh.getText().startsWith("C/C++")) {
sh.activate();
bot.sleep(500);
break;
}
}
// Turn off automatic building by default to avoid timing issues
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription desc = workspace.getDescription();
boolean isAutoBuilding = desc.isAutoBuilding();
if (isAutoBuilding) {
desc.setAutoBuilding(false);
workspace.setDescription(desc);
}
projectExplorer = bot.viewByTitle("Project Explorer");
}
Aggregations