Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] Fix for Bug 75954

Below is the patch output generated by cvs for the changes I made that fix
bug #75954. I also looked up the bug referenced in the code (#65399), and I
believe this code solves both of them.

Basiclly my bug is that our project has test classes in one project that require
config files in another project so we need to run our test agains that project
but anytime you change the project in the JUnitMainTab it blows away the test
method. There are work arounds but they hinder my development and really bug
me. So I thought I'd try my hand a alittle bug fix.

Anyway, thanks for such a great IDE.

I checked out from HEAD on the pserver dev.eclipse.org. We tested in on both
WinXP, Win32, Suse 9.1 (32bit). I think we are running eclipse 3.0.1 but we may
be running 3.0.

I also posted this patch as an attachement to the bug.

Patch:

Index: JUnitMainTab.java
===================================================================
RCS file:
/home/eclipse/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/launcher/JUnitMainTab.java,v
retrieving revision 1.38
diff -u -r1.38 JUnitMainTab.java
--- JUnitMainTab.java	19 Sep 2004 21:10:11 -0000	1.38
+++ JUnitMainTab.java	8 Oct 2004 19:06:58 -0000
@@ -361,18 +361,15 @@
 			config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
fContainerElement.getJavaProject().getElementName());
 			config.setAttribute(JUnitBaseLaunchConfiguration.LAUNCH_CONTAINER_ATTR,
fContainerElement.getHandleIdentifier());
 			config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
""); //$NON-NLS-1$
+			 //workaround for bug 65399
+			config.setAttribute(JUnitBaseLaunchConfiguration.TESTNAME_ATTR, "");
 		} else {
 			config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
fProjText.getText());
 			config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
fTestText.getText());
-			config.setAttribute(JUnitBaseLaunchConfiguration.LAUNCH_CONTAINER_ATTR, "");
//$NON-NLS-1$
+			config.setAttribute(JUnitBaseLaunchConfiguration.LAUNCH_CONTAINER_ATTR, "");
//$NON-NLS-1$
+			config.setAttribute(JUnitBaseLaunchConfiguration.TESTNAME_ATTR,
fOriginalTestMethodName);
 		}
 		config.setAttribute(JUnitBaseLaunchConfiguration.ATTR_KEEPRUNNING,
fKeepRunning.getSelection());
-		config.setAttribute(JUnitBaseLaunchConfiguration.TESTNAME_ATTR,
fOriginalTestMethodName);
-		String testMethod= config.contentsEqual(config.getOriginal()) //workaround
for bug 65399
-			? fOriginalTestMethodName
-			: ""; //$NON-NLS-1$
-		config.setAttribute(JUnitBaseLaunchConfiguration.TESTNAME_ATTR, testMethod);
-		setTestMethodLabel(testMethod);
 	}

 	/**


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



Back to the top