Skip to content

Commit

Permalink
Fix Bug 202162 - JUnit messages says failed first but it is not (#1435)
Browse files Browse the repository at this point in the history
* Fix Bug 202162 - JUnit messages says failed first but it is not

- fix TestRunnerViewPart.prepareLaunchConfigForRelaunch() to strip
  the failed first part of a message as we are just rerunning
- also set the ATTR_FAILURES_NAMES to null instead of empty string
  so when we do failed first again we will create the proper
  message and do not add the Rerun to start of message as we do this
  inconsistently (only added after a failed run then rerun)
- fixes #1434
  • Loading branch information
jjohnstn committed Jun 8, 2024
1 parent f035a98 commit c96ba4f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.jdt.junit/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.jdt.junit
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.junit;singleton:=true
Bundle-Version: 3.16.400.qualifier
Bundle-Version: 3.16.500.qualifier
Bundle-Activator: org.eclipse.jdt.internal.junit.ui.JUnitPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2020 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -297,6 +297,8 @@ public final class JUnitMessages extends NLS {

public static String TestRunnerViewPart_ExportTestRunSessionAction_title;

public static String TestRunnerViewPart_failures_first_suffix;

public static String TestRunnerViewPart_ImportTestRunSessionAction_error_title;

public static String TestRunnerViewPart_ImportTestRunSessionAction_name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ OpenTestAction_dialog_title=Go to Test
OpenTestAction_error_methodNoFound=Method ''{0}'' not found. Opening the test class.
OpenTestAction_select_element=&Select or enter the element to open:


TestRunnerViewPart_failures_first_suffix=(Failed Tests first)
TestRunnerViewPart_jobName=Update JUnit
TestRunnerViewPart_history=&History...
TestRunnerViewPart_wrapperJobName=JUnit Starter Job
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2022 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -1426,9 +1426,12 @@ private ILaunchConfiguration prepareLaunchConfigForRelaunch(ILaunchConfiguration
try {
String attribute= configuration.getAttribute(JUnitLaunchConfigurationConstants.ATTR_FAILURES_NAMES, ""); //$NON-NLS-1$
if (attribute.length() != 0) {
String configName= Messages.format(JUnitMessages.TestRunnerViewPart_configName, configuration.getName());
String configName= configuration.getName();
if (configName.endsWith(JUnitMessages.TestRunnerViewPart_failures_first_suffix)) {
configName= configName.substring(0, configName.length() - JUnitMessages.TestRunnerViewPart_failures_first_suffix.length());
}
ILaunchConfigurationWorkingCopy tmp= configuration.copy(configName);
tmp.setAttribute(JUnitLaunchConfigurationConstants.ATTR_FAILURES_NAMES, ""); //$NON-NLS-1$
tmp.setAttribute(JUnitLaunchConfigurationConstants.ATTR_FAILURES_NAMES, (String)null);
return tmp;
}
} catch (CoreException e) {
Expand Down

0 comments on commit c96ba4f

Please sign in to comment.