Search in sources :

Example 1 with AboutDialog

use of org.eclipse.ui.internal.dialogs.AboutDialog in project jbosstools-integration-tests by jbosstools.

the class SeamPluginsTest method testSeamIsNotPresent.

@Test
public void testSeamIsNotPresent() {
    log.info("Navigate to installation details");
    WorkbenchShell ws = new WorkbenchShell();
    ws.maximize();
    // for OSX (MacOS) use eclipse API to open About dialog
    if (RunningPlatform.isOSX()) {
        log.info("Open " + HELP_BUTTON + " -> " + ABOUT_MENU_BUTTON + "directly on Mac OSX");
        Display.asyncExec(new Runnable() {

            @Override
            public void run() {
                @SuppressWarnings("restriction") AboutDialog dialog = new AboutDialog(ws.getSWTWidget());
                dialog.open();
            }
        });
    } else {
        new ShellMenuItem(new WithTextMatcher(new RegexMatcher(HELP_BUTTON)), new WithTextMatcher(new RegexMatcher(ABOUT_MENU_BUTTON))).select();
    }
    new DefaultShell(new WithTextMatcher(new RegexMatcher(ABOUT_MENU_BUTTON)));
    new PushButton("Installation Details").click();
    new DefaultShell(new WithTextMatcher(new RegexMatcher(".*Installation Details")));
    new DefaultCTabItem("Plug-ins").activate();
    new DefaultText().setText("seam");
    Table pluginsTable = new DefaultTable();
    List<TableItem> items = pluginsTable.getItems();
    int columntIndex = pluginsTable.getHeaderIndex("Plug-in Id");
    List<String> foundSeamPlugins = new ArrayList<String>();
    for (TableItem ti : items) {
        String pluginId = ti.getText(columntIndex);
        if (pluginId.equals("org.jboss.tools.cdi.xml") || pluginId.equals("org.jboss.tools.cdi.xml.ui") || pluginId.equals("org.jboss.tools.cdi.seam.solder.core") || pluginId.equals("org.jboss.tools.seam.reddeer")) {
        // these seam plugins can exist in default installation (seam3 or reddeer)
        } else {
            foundSeamPlugins.add(pluginId);
        }
    }
    new PushButton("Close").click();
    new PushButton("Close").click();
    if (!foundSeamPlugins.isEmpty()) {
        fail("seam plugins " + foundSeamPlugins + " is/are present but all seam2 plugins should be removed");
    }
}
Also used : AboutDialog(org.eclipse.ui.internal.dialogs.AboutDialog) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) Table(org.eclipse.reddeer.swt.api.Table) TableItem(org.eclipse.reddeer.swt.api.TableItem) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) ArrayList(java.util.ArrayList) DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) ShellMenuItem(org.eclipse.reddeer.swt.impl.menu.ShellMenuItem) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) RegexMatcher(org.eclipse.reddeer.common.matcher.RegexMatcher) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) DefaultCTabItem(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabItem) AbstractMavenSWTBotTest(org.jboss.tools.maven.ui.bot.test.AbstractMavenSWTBotTest) Test(org.junit.Test)

Example 2 with AboutDialog

use of org.eclipse.ui.internal.dialogs.AboutDialog in project eclipse.platform.ui by eclipse-platform.

the class UIDialogs method testAbout.

@Test
public void testAbout() {
    Dialog dialog = null;
    dialog = new AboutDialog(getShell());
    DialogCheck.assertDialog(dialog);
}
Also used : AboutDialog(org.eclipse.ui.internal.dialogs.AboutDialog) SelectPerspectiveDialog(org.eclipse.ui.internal.dialogs.SelectPerspectiveDialog) ProjectLocationSelectionDialog(org.eclipse.ui.dialogs.ProjectLocationSelectionDialog) TypeFilteringDialog(org.eclipse.ui.dialogs.TypeFilteringDialog) ContainerSelectionDialog(org.eclipse.ui.dialogs.ContainerSelectionDialog) FileExtensionDialog(org.eclipse.ui.internal.dialogs.FileExtensionDialog) EditorSelectionDialog(org.eclipse.ui.dialogs.EditorSelectionDialog) AboutDialog(org.eclipse.ui.internal.dialogs.AboutDialog) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) SaveAsDialog(org.eclipse.ui.dialogs.SaveAsDialog) SavePerspectiveDialog(org.eclipse.ui.internal.dialogs.SavePerspectiveDialog) Dialog(org.eclipse.jface.dialogs.Dialog) ListSelectionDialog(org.eclipse.ui.dialogs.ListSelectionDialog) ShowViewDialog(org.eclipse.ui.internal.dialogs.ShowViewDialog) Test(org.junit.Test)

Example 3 with AboutDialog

use of org.eclipse.ui.internal.dialogs.AboutDialog in project jbosstools-integration-tests by jbosstools.

the class InstallationDetailsTest method setup.

@Before
public void setup() {
    log.info("Navigate to installation details");
    WorkbenchShell ws = new WorkbenchShell();
    ws.maximize();
    // for OSX (MacOS) use eclipse API to open About dialog
    if (RunningPlatform.isOSX()) {
        log.info("Open " + HELP_BUTTON + " -> " + ABOUT_MENU_BUTTON + "directly on Mac OSX");
        Display.asyncExec(new Runnable() {

            @Override
            public void run() {
                @SuppressWarnings("restriction") AboutDialog dialog = new AboutDialog(ws.getSWTWidget());
                dialog.open();
            }
        });
    } else {
        new ShellMenuItem(new WithTextMatcher(new RegexMatcher(HELP_BUTTON)), new WithTextMatcher(new RegexMatcher(ABOUT_MENU_BUTTON))).select();
    }
    about = new DefaultShell(new WithTextMatcher(new RegexMatcher(ABOUT_MENU_BUTTON)));
    // get styled text from help
    DefaultStyledText dt = new DefaultStyledText();
    String text = dt.getText();
    // TODO use
    // org.eclipse.core.runtime.Platform.getBundle("org.jbosstools").getVersion();
    int versionIndex = 0;
    jbossToolsVersion = text.substring(versionIndex = text.indexOf("Version:") + 9, text.indexOf("Build id", ++versionIndex));
    log.info("JBossTools version: " + jbossToolsVersion);
    assertFalse("The JBossTools version value is empty!", jbossToolsVersion.isEmpty());
    new PushButton(new WithTextMatcher(new RegexMatcher(MODAL_DIALOG_ABOUT_DEVSTUDIO_INSTALLATION_DETAILS_BUTTON))).click();
    // validate that shell opened
    installationDetails = new DefaultShell(new WithTextMatcher(new RegexMatcher(MODAL_DIALOG_ABOUT_DEVSTUDIO_INSTALLATION_DETAILS_TITLE)));
    CTabFolder tabFolder = new DefaultCTabItem(MODAL_DIALOG_CONFIG_MENU_BUTTON).getFolder();
    String[] labels = tabFolder.getTabItemLabels();
    Boolean isTabPresent = Arrays.stream(labels).anyMatch(MODAL_DIALOG_CONFIG_MENU_BUTTON::equals);
    assertTrue("Tab item '" + MODAL_DIALOG_CONFIG_MENU_BUTTON + "' is missing", isTabPresent);
    new DefaultCTabItem(MODAL_DIALOG_CONFIG_MENU_BUTTON).activate();
    new WaitWhile(new JobIsRunning(new RegexMatcher("Fetching configuration"), true), TimePeriod.LONG);
}
Also used : AboutDialog(org.eclipse.ui.internal.dialogs.AboutDialog) CTabFolder(org.eclipse.reddeer.swt.api.CTabFolder) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) ShellMenuItem(org.eclipse.reddeer.swt.impl.menu.ShellMenuItem) WorkbenchShell(org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) RegexMatcher(org.eclipse.reddeer.common.matcher.RegexMatcher) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) DefaultCTabItem(org.eclipse.reddeer.swt.impl.ctab.DefaultCTabItem) Before(org.junit.Before)

Example 4 with AboutDialog

use of org.eclipse.ui.internal.dialogs.AboutDialog in project eclipse.platform.ui by eclipse-platform.

the class UIDialogsAuto method testAbout.

@Test
public void testAbout() {
    Dialog dialog = null;
    dialog = new AboutDialog(getShell());
    DialogCheck.assertDialogTexts(dialog);
}
Also used : AboutDialog(org.eclipse.ui.internal.dialogs.AboutDialog) SelectPerspectiveDialog(org.eclipse.ui.internal.dialogs.SelectPerspectiveDialog) ProjectLocationSelectionDialog(org.eclipse.ui.dialogs.ProjectLocationSelectionDialog) TypeFilteringDialog(org.eclipse.ui.dialogs.TypeFilteringDialog) ContainerSelectionDialog(org.eclipse.ui.dialogs.ContainerSelectionDialog) FileExtensionDialog(org.eclipse.ui.internal.dialogs.FileExtensionDialog) EditorSelectionDialog(org.eclipse.ui.dialogs.EditorSelectionDialog) AboutDialog(org.eclipse.ui.internal.dialogs.AboutDialog) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) SaveAsDialog(org.eclipse.ui.dialogs.SaveAsDialog) AboutPluginsDialog(org.eclipse.ui.internal.dialogs.AboutPluginsDialog) SavePerspectiveDialog(org.eclipse.ui.internal.dialogs.SavePerspectiveDialog) Dialog(org.eclipse.jface.dialogs.Dialog) ListSelectionDialog(org.eclipse.ui.dialogs.ListSelectionDialog) ShowViewDialog(org.eclipse.ui.internal.dialogs.ShowViewDialog) Test(org.junit.Test)

Aggregations

AboutDialog (org.eclipse.ui.internal.dialogs.AboutDialog)4 Test (org.junit.Test)3 Dialog (org.eclipse.jface.dialogs.Dialog)2 ProgressMonitorDialog (org.eclipse.jface.dialogs.ProgressMonitorDialog)2 RegexMatcher (org.eclipse.reddeer.common.matcher.RegexMatcher)2 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)2 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)2 DefaultCTabItem (org.eclipse.reddeer.swt.impl.ctab.DefaultCTabItem)2 ShellMenuItem (org.eclipse.reddeer.swt.impl.menu.ShellMenuItem)2 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)2 WorkbenchShell (org.eclipse.reddeer.workbench.impl.shell.WorkbenchShell)2 ContainerSelectionDialog (org.eclipse.ui.dialogs.ContainerSelectionDialog)2 EditorSelectionDialog (org.eclipse.ui.dialogs.EditorSelectionDialog)2 ListSelectionDialog (org.eclipse.ui.dialogs.ListSelectionDialog)2 ProjectLocationSelectionDialog (org.eclipse.ui.dialogs.ProjectLocationSelectionDialog)2 SaveAsDialog (org.eclipse.ui.dialogs.SaveAsDialog)2 TypeFilteringDialog (org.eclipse.ui.dialogs.TypeFilteringDialog)2 FileExtensionDialog (org.eclipse.ui.internal.dialogs.FileExtensionDialog)2 SavePerspectiveDialog (org.eclipse.ui.internal.dialogs.SavePerspectiveDialog)2 SelectPerspectiveDialog (org.eclipse.ui.internal.dialogs.SelectPerspectiveDialog)2