Skip to content

Commit

Permalink
Merge pull request #485 from dmbelina/config-common-tab
Browse files Browse the repository at this point in the history
Add Common tab with test
  • Loading branch information
scottkurz authored Jan 26, 2024
2 parents 4c0b3ae + a3cffa7 commit 49dcf25
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package io.openliberty.tools.eclipse.ui.launch;

import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
import org.eclipse.debug.ui.CommonTab;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
Expand All @@ -27,6 +28,6 @@ public class LaunchConfigTabGroup extends AbstractLaunchConfigurationTabGroup {
*/
@Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
setTabs(new ILaunchConfigurationTab[] { new StartTab(), new JRETab(), new SourceLookupTab() });
setTabs(new ILaunchConfigurationTab[] { new StartTab(), new JRETab(), new SourceLookupTab(), new CommonTab() });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.launchStopWithRunAsShortcut;
import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.launchViewITReportWithRunDebugAsShortcut;
import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.launchViewUTReportWithRunDebugAsShortcut;
import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.openCommonTab;
import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.openJRETab;
import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.openJavaPerspectiveViaMenu;
import static io.openliberty.tools.eclipse.test.it.utils.SWTBotPluginOperations.openSourceTab;
Expand Down Expand Up @@ -897,8 +898,35 @@ public void testDefaultJRECompliance() {
go("Close", configShell);
}
}



/**
* Tests that the Common Tab is added and can be opened
*/
@Test
public void testDefaultCommonTab() {

deleteLibertyToolsRunConfigEntriesFromAppRunAs(MVN_APP_NAME);

Shell configShell = launchRunConfigurationsDialogFromAppRunAs(MVN_APP_NAME);

try {

TreeItem libertyConfigTree = getLibertyTreeItemNoBot(configShell);

context(libertyConfigTree, "New Configuration");

openCommonTab(bot);

} finally {

go("Close", configShell);
}


}

/**
* Tests that a non-Liberty project can be manually be categorized to be Liberty project. This test also tests the refresh
* function.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,20 @@ public static void openSourceTab(SWTWorkbenchBot bot) {
SWTBotCTabItem tabItem = shellBot.cTabItem("Source");
tabItem.activate().setFocus();
}

/**
* Switches the Liberty run configuration main tab to the Common Tab. This operation will fail if tab is not
* successfully launched or switched to
*
* @param bot The SWTWorkbenchBot instance.
*/
public static void openCommonTab(SWTWorkbenchBot bot) {
SWTBotShell shell = bot.shell("Run Configurations");
shell.activate().setFocus();
SWTBot shellBot = shell.bot();
SWTBotCTabItem tabItem = shellBot.cTabItem("Common");
tabItem.activate().setFocus();
}

/**
* Presses the Proceed button if it exists on the error in workspace dialog.
Expand Down

0 comments on commit 49dcf25

Please sign in to comment.