Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Common tab with test #485

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading