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.
I have found a problem in 6.0M9 and recent daily builds (such as 200705131800) when running tests for a NetBeans platform application, built on the IDE itself. To reproduce is simple: 1. Create a new suite project 2. Add a new module to the suite from step #1 3. Create a basic class in your module, such as: public class SimpleMath { public long add(int n1, int n2) { return n1 + n2; } } 4. Right-click your new class and use Tools -> Create JUnit tests 5. Update your test with a working implementation, such as: public void testAdd() { SimpleMath instance = new SimpleMath(); long result = instance.add(5, 8); assertEquals(13L, result); } 6. Right-click on your module and choose "Run unit tests". The error seems to vary based on whether I am using a daily build or M9, but it cannot either find the junit.framework.TestCase class or the assert methods. I verified that the JUnit library is shown under Unit Test Libraries of the module, but it doesn't find these classes/methods anyway. Repeating these steps in 6.0M8 or 5.5 works as expected -- I can compile and run the unit test without errors.
I verified this on a colleague's computer with M9 as well. It fails to effectively find JUnit as previously described. Both machines are running Windows XP, though I can try on Mac, Solaris, Linux and others if it is needed.
moving this to IDE because that may be a better component.
I just installed a recent daily build (20070528) and verified this problem still exists. A workaround is to set test.unit.cp.extra in each module's project.properties file to the path of a junit jar, e.g.: test.unit.cp.extra=${harness.dir}/extras/junit-3.8.1.jar However, this should not be necessary as it used to work out of the box in previous versions of NetBeans.
I think we shouldn't limit what third party libraries can be used for tests. Some people will love Netbeans junits, most will prefer junits (some 3.8 and others 4.0), others will want to use mock libraries (easymock, jmock...) and so on. My suggestion is to make third party libraries for tests configurable the same way as we configure them for normal applications. Eduard
*** This issue has been marked as a duplicate of 108686 ***