Email exchanges from the bug...
In these comments, Markus says he doesn't really like the design behind the bug, but is willing to use it as a fallback if they can't get the solution they want done in time. I believe his point is that the problem is setting VM arguments properly in launch configurations will solve the assertion enabling problem along with many others. If you go read the other related bugs, you see a lot of people complaining about different aspects of VM argument setting.
------- Comment #7 From Markus Keller 2006-01-09 05:13 [reply] -------
If the Debug team decides they won't fix this for 3.2, then we would have to go
------- Comment #8 From Markus Keller 2006-01-09 11:59 [reply] -------
(In reply to comment #5)
> Is anyone on fixing this one?
> It bothers me enough I'm willing to work on a fix.
John, if you could provide a patch for the solution from comment 4, that would
I don't think we should add a checkbox on the individual launch configuration
- - - - - - - - - - - - - -
My point is that many users won't necessarily understand that enabling assertions is related to VM arguments, so they'll want a feature that is more direct and higher level. I may be over-reaching at this point, but I make one more pitch for having a higher-level feature, like a checkbox on the launch configuration box.
------- Comment #9 From John Kaplan 2006-01-10 23:41 [reply] -------
I also like the solution from comment 4, but I do have an issue with only
The issue is that the workspace preferences page takes a fair amount of
So for usability, it's likely the option will be hidden and a lot of users
I think the fact that enabling assertions is a VM argument is an implementation
So, I would prefer to have a check box for defaulting the behavior per project on the preferences panel, but then have another check box on the run.../debug... dialog panels to override it per launch configuration, and to make it more manifest to the users for better usability.
But, as I always end up saying in these discussions, it ain't my code base, so I'll go with the committers decision.
- John
- - - - - - - - - - - -
At this point I do my surfing and analysis of the code that's there. Looks like it will be a fairly straightforward fix, and I'm not convinced I was right about the check boxes on the launch configurations anymore, so I'm willing to let that part go and just do the check box on the JUnit window preferences dialog.
------- Comment #10 From John Kaplan 2006-01-21 22:57 [reply] -------
Been looking at this trying to figure out a solution. I have one for the basic
I think the best design would be to initialize new launch configurations related to junit tests to be created with a default VM arg that enables assertions if the user has set the preference in the Window > Preferences... dialog. This way the VM arg is where users can see it if they look and there's no invisible creation of VM args in the background of a launch.
To implement this solution, I found 2 possible paths to create launch configurations for junit tests. One is in JUnitLaunchShortcut.createConfiguration() that is called when the user directly launches a new test. The other is in JUnitTabGroup.setDefaults() that is called when the user starts with the "Run..." or "Debug..." dialogs to create new configurations before they run something for the first time.
The JUnitLaunchShortcut.createConfiguration() change would be easy, but the JUnitTabGroup.setDefaults() looks like it will need one other workaround because the JUnit plug-in test doesn't jump through the same implementation as the JUnitTabGroup. It has a different implementation of setDefaults in AbstractPDELaunchConfigurationTabGroup, and it already messes with the VM args, so the implementation here will have to be more intelligent to avoid double-entering the VM arg.
So that's the implementation I'd go with if you guys agree. Anyone know of
- - - - - - - - - -
In his response, Markus comes through with some good advice. I didn't know about the DebugPlugin.parseArguments method, and it came in handy.
------- Comment #12 From John Kaplan 2006-01-24 00:18 [reply] -------
Thanks for the tip Markus.
One more question - Since it looks like I'll be making changes in 3 packages
I've already worked with jdt.ui.tests, so I know the drill there. Are tests for the junit preferences tab in the UI there, or in another package?
Can you point me to any similar kind of test junit test I could use as a model, and let me know where the best place to put new tests would be? (If the test junit plug-in tests are in a different place, let me know that too since I have to make the unique changes we discussed above.)
Thanks,
- John
------- Comment #13 From Markus Keller 2006-01-24 05:16 [reply] -------
We don't have many tests for the junit plugins. The existing tests are indeed
If you want to write a test for this bug, thats great, but it's also OK without
- - - - - - - - - -
Far be it for me to judge - but did I just hear the committer for JUnit support in eclipse tell me I don't have to write tests? I am too much of a TDD programmer to let this slide, will have to rib him about this at some point.
------- Comment #14 From John Kaplan 2006-01-24 14:51 [reply] -------
OK - good enough.
I'll move ahead on this info and see how far I get.
Thanks,
- John