homberghp commented on PR #8545:
URL: https://github.com/apache/netbeans/pull/8545#issuecomment-2962018535

   > I had a look at this and I think this is the wrong location to fix this. 
Try these two runs:
   > 
   > 1. run the full unittests and try to invoke "Run again" from the failing 
test `t01Max`
   > 2. open `RangeTest.java` and run that single test:
   >    
![grafik](https://private-user-images.githubusercontent.com/2179736/449820197-5319a143-42d9-424a-860f-ea2e54ba1f4d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDk2MzUyNTUsIm5iZiI6MTc0OTYzNDk1NSwicGF0aCI6Ii8yMTc5NzM2LzQ0OTgyMDE5Ny01MzE5YTE0My00MmQ5LTQyNGEtODYwZi1lYTJlNTRiYTFmNGQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MTFUMDk0MjM1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWUyNTQwMzE1NDk1ZDk2MWNkNmU5NDE0ZWVmOGVlMTY1ZjU4Nzc0YTMyMzM3ZmRmNGM0NzBhOTRlMTU1NTUyMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.h2kv35bOooDM67fxhK6NfjXTwyn1HK3eF7EA8e4cAlE)
   >    now try "Run again" in the test results window for that run.
   > 
   > The first run shows the problem you are observing, while the second does 
not. The difference between the two can be found in the JUnit Integration for 
maven:
   > 
   > 
https://github.com/apache/netbeans/blob/1947efd398f35c19c524c93749b42bf63813fd94/java/maven.junit.ui/src/org/netbeans/modules/maven/junit/ui/MavenJUnitTestMethodNode.java#L72-L82
   > 
   > The critical section is line 73. For the first run returns 
`io.github.jristretto.ranges.RangeTest.t01Max` for `testcase.getName()` while 
the second run yields `t01Max`. The difference comes from here:
   > 
   > 
https://github.com/apache/netbeans/blob/1947efd398f35c19c524c93749b42bf63813fd94/java/junit/src/org/netbeans/modules/junit/api/JUnitTestcase.java#L55-L68
   > 
   > For the full run you get a `suiteName` and thus you get the method name 
prefixed with the class. Case 1 goes through line 67, while case 2 goes through 
line 64.
   > 
   > Looking at the NB history (Link goes to a git clone of the original 
mercurial history):
   > 
   > 
[emilianbold/netbeans-releases@3364af5](https://github.com/emilianbold/netbeans-releases/commit/3364af50e2d9714524b6873125dc5ab1f4c36b38)
   > 
   > this strange behavior was introduces to handle nested tests and that does 
not even work correctly.
   > 
   > I get `io.github.jristretto.ranges.SampleTest$NestedClass2.testMyMethod1` 
for the `getName()` call and 
`io.github.jristretto.ranges.SampleTest$NestedClass2` for the `getClassName()` 
call. So you could just check in `MavenJUnitTestMethodNode.java` if class name 
is a prefix of name and if so strip it away. For the nested case more is 
required (check for `$` and split them, but that is a different case and is 
already broken, so does not need to be fixed here).
   
   I have tried what you suggested, but that appears not to cut it.
   Reverted the commits in the PR back to my 'hacky solution'
   
   Will create a better example project.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to