Skip to content

Commit

Permalink
add a description to JUnit launcher in plugin.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
plaird committed Jul 15, 2021
1 parent f4c5f10 commit e861ce4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions bundles/com.salesforce.bazel.eclipse.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
<launchDelegate
name="Bazel JUnit"
modes="run, debug"
delegateDescription="The Bazel JUnit Launcher *must* be used for launching JUnit tests in a Bazel workspace. See the Bazel Eclipse Feature launcher documentation for more details."
type="org.eclipse.jdt.junit.launchconfig"
delegate="com.salesforce.bazel.eclipse.launch.BazelJunitLaunchConfigurationDelegate"
id="bazel.junit.launcher">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,19 @@
/**
* Plug point into the Eclipse JUnit launcher call chain; allows us to inject the Bazel runtime classpath provider so
* the test uses the Bazel computed classpath.
* <p>
* Note that the user must elect to use this delegate (referred to as the 'Launcher' in the UI). This delegate is
* registered in plugin.xml as a "org.eclipse.jdt.junit.launchconfig" type delegate. This means it will compete with the
* native Eclipse delegate for JUnit launching duties. The user will be presented with a UI for them to choose the
* delegate they want, and they *must* choose the Bazel one.
*/
public class BazelJunitLaunchConfigurationDelegate extends JUnitLaunchConfigurationDelegate {

@Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
throws CoreException {

// the enable method sets an attribute on the configuration to use the Bazel test classpath provider
BazelTestClasspathProvider.enable(configuration);
BazelTestClasspathProvider.canOpenErrorDialog.set(true);

Expand Down

0 comments on commit e861ce4

Please sign in to comment.