Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » JUnit question(JUnit display in Eclipse)
JUnit question [message #1797476] Wed, 31 October 2018 12:44 Go to next message
Reinhardt Christiansen is currently offline Reinhardt ChristiansenFriend
Messages: 73
Registered: March 2010
I have a question about JUnit5 test cases in Eclipse 2018-19: how is the order of the methods in a test case determined for the panel that shows the different methods executing and indicates which ones worked, which ones didn't, and how much time each took?

I can't see any pattern to it at all and I even tend to believe the order changes over time. For instance, I have 20-odd methods in my current Test Case and I can't see any natural sequence to the DisplayNames. They aren't in alphabetic order, they certainly aren't in the same sequence as they appear in the Test Case, they don't seem to be grouped so that successful tests are all together and failed tests all together.

Is there any way I can control what sequence they appear? Ideally, I think I'd like them to appear in either alphabetic order or the same order as they appear in the Test Case. I don't see any preferences governing the display sequence in JUnit.
Re: JUnit question [message #1797481 is a reply to message #1797476] Wed, 31 October 2018 13:57 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33073
Registered: July 2009
Senior Member
I'm not totally sure, but I believe it shows them in the order in which they are really executed. And I think by default, this is some less than obvious order determine by JUnit itself. There are annotations you can add to affect the JUnit's order, e.g., to make it alphabetic, but I forget what they are. You could Google for that.

Ed Merks
Professional Support:
Previous Topic:Basic Code Coverage Question
Next Topic:Why is "Preference AND Property page" not standard API?
Goto Forum:

Current Time: Wed Feb 21 19:45:10 GMT 2024

Powered by FUDForum. Page generated in 0.02688 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top