Enabling assertions in Netbeans

前端 未结 8 2106
花落未央
花落未央 2020-12-07 00:40

I wanna do something like

java -enableassertions com.geeksanonymous.TestClass

How do I do this?

8条回答
  •  不思量自难忘°
    2020-12-07 01:17

    Yes, it's a bug in NetBeans that it does not enable assertions when running unit tests (https://netbeans.org/bugzilla/show_bug.cgi?id=139035). What Adrian suggests will work (although the test failed, yet assertions were enabled for the code that I was concerned with). Another way is to edit build-impl.xml and add in the macro definition for junit (just search for "junit").

提交回复
热议问题