This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The tests are been executed in wrong order. In the main class i have a method 'A' and a method 'B'. In my test class i placed the method 'B' before the method 'A' (both with @Test annotation), but when i run the test (Ctrl + F6), the method 'A' is executed before the method 'B' like the order of them in the main class. It should respect the order of the test class, that is, method B before the method A. If i change the order in the main class then i have the expected result but by the wrong way.
In fact, i discovered that the test are been made in a ramdon way. It's worse!
I executed the same test on version 6.9.1 and it doesn't happen.
It is a nature of JUnit that test cases are not executed in any particular order. Use @Before annotation or some other technique. http://junit.sourceforge.net/doc/faq/faq.htm#tests_2
I saw de link you've posted and everything seems right, but why i don't have this behavior in another versions of Netbeans. I am using the same project in nb 7 rc2 and nb 6.9.1. In nb 6.9.1, i don´t need to use @Before or anything else. The methods are executed in the same order they apeear in the class test.
I don't know if there are some changes in execution in NetBeans7.0.
NetBeans 7.0 rc2 uses JUnit 4.8.2 while NetBeans 6.9.1 uses 4.5 version of JUnit. I suppose this may cause the difference. Anyway, this is not a bug, so closing.
(In reply to comment #6) > NetBeans 7.0 rc2 uses JUnit 4.8.2 while NetBeans 6.9.1 uses 4.5 version of > JUnit. I suppose this may cause the difference. Anyway, this is not a bug, so > closing. It may not be a bug of nb 7 rc2 but you have to agree with that it is a piece of shit! They could implement a way to make a choice about what version of JUnit you want to use. I don't know but i think that i already saw this type of thing in older version of netbeans. Anyway, thanks!