Class JUnitLaunchShortcut

    • Constructor Detail

      • JUnitLaunchShortcut

        public JUnitLaunchShortcut()
        Default constructor.
    • Method Detail

      • getLaunchConfigurationTypeId

        protected String getLaunchConfigurationTypeId()
        Returns the launch configuration type id of the launch configuration this shortcut will create. Clients can override this method to return the id of their launch configuration.
        Returns:
        the launch configuration type id of the launch configuration this shortcut will create
      • createLaunchConfiguration

        protected ILaunchConfigurationWorkingCopy createLaunchConfiguration​(IJavaElement element,
                                                                            String testName)
                                                                     throws CoreException
        Creates a launch configuration working copy for the given element. The launch configuration type created will be of the type returned by getLaunchConfigurationTypeId(). The element type can only be of type IJavaProject, IPackageFragmentRoot, IPackageFragment, IType or IMethod.

        Clients can extend this method (should call super) to configure additional attributes on the launch configuration working copy.

        Parameters:
        element - element to launch
        testName - name of the test to launch, e.g. the method name or an artificial name created by a JUnit runner, or null if none. The testName is ignored if the element is an IMethod; the method name is used in that case.
        Returns:
        a launch configuration working copy for the given element
        Throws:
        CoreException - if creation failed
        Since:
        3.8
      • suggestLaunchConfigurationName

        protected String suggestLaunchConfigurationName​(IJavaElement element,
                                                        String fullTestName)
        Computes a human-readable name for a launch configuration. The name serves as a suggestion and it's the caller's responsibility to make it valid and unique.
        Parameters:
        element - The Java Element that will be executed.
        fullTestName - The test name. See org.eclipse.jdt.internal.junit4.runner.DescriptionMatcher for supported formats.
        Returns:
        The suggested name for the launch configuration.
        Since:
        3.8
      • getAttributeNamesToCompare

        protected String[] getAttributeNamesToCompare()
        Returns the attribute names of the attributes that are compared when looking for an existing similar launch configuration. Clients can override and replace to customize.
        Returns:
        the attribute names of the attributes that are compared