creating runnable configurations and run/debug context menu

I have started a thread in the tracker
http://www.intellij.net/tracker/idea/viewSCR?publicId=12038
"There should be an easy way to debug a single junit. testcase testXXX
method" and also in the eap forum ("do you ever need to debug (not just
run) a single junit test XXXmethod ?")

but I also noticed other tracker requests (Thomas) about often ending up
with way too many target configurations, and I agree with them.

as you can read in the above tracker thread with Dmitry Peshehonov,
to solve both issues we may end up with :

====================
neither run nor debug should create a saved configuration, but there
should be a 3rd ctx menu entry along besides run/debug (create target)
option for each of the 3 pairs above, that should not also start a process.

====================

when a class is both a TestCase and contains a main() it is not obvious
what should be used to run it.

while we may have all these ways of running it (if a single method is
selected) :

1 main run
2 main debug

3 junitrunner whole class run
4 junitrunner whole class debug

5 junitrunner selectedmethod run
6 junitrunner selectedmethod debug


I'd be happy if the ctx menu would be thinned down depending on where
the cursor is:
- if the cursor is on a single method, then only the choices 5 and 6
need to be shown
- if the cursor is on main then show 1 and 2
- else show 3 and 4

====================
when a class has just a main or is just a TestCase only options 1,2 and
3,4 respectively may appear in the ctx menu..

comments ?

Edo

3 comments

Now I think it will good enough to show one pair (three) for tests and do nothing with main. The menu will look like:

Create . Run . Debug . Run Debug ]]>

First three are for test configurations, last two for applications.
To avoid confusions ("Run XXX" as test class vs "Run XXX" as XXX.main) icons seem to be enough. Possibly icons will be better than words run/debug/create.

I do not think that "create" is meaningful for applications, does anyone? So, Run and Debug for applications will create configurations.

0

Please search the newsgroups, I always wanted to have an easier way to just
run/debug an application/test vs. creating an run/debug configuration.
Thanks in advance.

Tom

0

Dmitry Peshehonov wrote:

I do not think that "create" is meaningful for applications, does anyone? So, Run and Debug for applications will create configurations.


no please, be consistent.

for an app have:
run (does not create anything)
debug (does not create anything)
create target (does not run anything)

for a testcase/testuite (without main)

if the cursor is on a testMethod
junitrun testClass.testMethod (does not create anything)
junitdebug testClass.testMethod (does not create anything)
create target testClass.testMethod (does not run anything)

if the cursor is not on a testMethod (or is on the suite method)
(or if the context menu is invoked on the node in the project tree)
junitrun testClass (does not create anything)
junitdebug testClass (does not create anything)
create target testClass (does not run anything)

I leave to your good will showing the testcase as an app if the cursor
is on the main defined in a TestCase

Edo

0

Please sign in to leave a comment.