Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double clicking a executed test in Eclipse shows Method not found even it exists #10

Closed
aaschmid opened this issue May 1, 2013 · 8 comments

Comments

@aaschmid
Copy link
Member

aaschmid commented May 1, 2013

bildschirmfoto 2013-05-01 um 14 56 45

@tvinke
Copy link

tvinke commented Oct 18, 2013

Guys, I've just introduced your great into my project and I'm experiencing the same issue in Eclipse. This bug has already been reported 6 months ago. Is someone available to fix this?

@aaschmid
Copy link
Member Author

Hi @tvinke, unfortunately I have currently no really good idea to fix this.

Here same tipps to abate the pain:

  1. Doubling clicking a successful test will just show up the message (and does not jump anywhere).
  2. If you double click a failed test, the same message will appear and, though, the cursor jumps to the position where the assertion error/exception occurs.
  3. To find out the correct dataprovider row which causes the error may be simplified looking at the index or just commenting out some rows (if there are too many to count).

According to 1:
As far as I understand, Eclipse's JUnit-plugin tries to find a method with the full test name (= complete line shown up in JUnit view) which does not exist at all. Here the only way I see, is to adjust the plugin (and I neither know if this will work, how difficult it is, nor if they would accept the changes for a small JUnit plugin like the dataprovider even if they a few years ago decided to do not go the same way as TestNG dataprovider :( )

According to 2:
Hide the message can IMHO be just fixed by adjusting the Eclipse JUnit-plugin . Sure, I could adjust the test name but then other problems due to visualisation within Eclipse's JUnit-plugin will occur ...
And the rest (jumping to assertion error/exception) is just default behavior.

According to 3:
Even if one uses the internal concept for dataproviders (called parameterized in JUnit) the Eclipse JUnit-plugin does not jump to the correct parameter row however it is possible to jump to the correct (successful) test method. If I adjust the naming of JUnit-dataprovider test methods accordingly it does not work, see

JUnit parameterized test
vs.
JUnit-dataprovider test

I'm sorry that I don't have better news for you, but hope that my explanations let you understand why this is not a very easy issue ...

@aaschmid
Copy link
Member Author

One thing is to try to add an additional level to the output in JUnit view as the parameterized test does and if the helps. Therefore one has to move the base class of DataProviderRunner from BlockJUnit4ClassRunner to Suite and adjust the rest ...

At least it work more or less, see
JUnit parameterized example

@aaschmid
Copy link
Member Author

Well, I have now tested the enhancement described above but unfortunately the same problem occurs opening a successful test, see
dataprovider as suite

The problem must be anywhere else and I have no clue at all where because my read was that it depends on the naming of the tests and that is done via org.junit.runner.Description ...

@tvinke
Copy link

tvinke commented Oct 22, 2013

Hi Andreas,

I appreciate you looking into it!

Regards, Ted
Op 18 okt. 2013 16:50 schreef "Andreas Schmid" notifications@github.com:

Well, I have now tested the enhancement described above but unfortunately
the same problem occurs opening a successful test, see
[image: dataprovider as suite]https://f.cloud.github.com/assets/567653/1361252/9a0c6866-3804-11e3-801d-8211805ad892.png

The problem must be anywhere else ... My read is that it depends on the
naming of the tests and that will be my next try ...


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-26601768
.

@aaschmid
Copy link
Member Author

OK :)
But finally I found out that Eclipse's JUnit-plugin has to be adjusted to get the double click working. I added a patch to the proper ticket, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=343935. Please vote for it to get it solved faster!

@aaschmid aaschmid self-assigned this Mar 7, 2014
@aaschmid
Copy link
Member Author

Finally got issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=343935 with Eclipse JUnit plugin merged. It is scheduled for 4.4M7.

@aaschmid aaschmid added fixed and removed wontfix labels May 9, 2014
@aaschmid
Copy link
Member Author

aaschmid commented May 9, 2014

Finally the patch is released with Eclipse Luna 4.4 M7 and greater, very nice :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants