2 Replies Last post: Jan 13, 2003 8:31 PM by Carlos Costa e Silva  
Currently Being Moderated

Jan 13, 2003 7:20 PM

How to enable assert



I have a project targeting 1.4.1, I checked the Project Properties box

"Enable 'assert' keyword and then restarted IntelliJ.


I then wrote a test program (see below) that has the following line in it:


assert(false) : "This should fail";


I ran this via IntelliJ both in 'release' and in 'debug' mode. I was

expecting to see a message in the IntelliJ output window telling me that the

assetion had failed. I did not see any such message in either release or

debug mode.


Is there something else that I need to do to enable assert other than simply

checking the check box and restarting IntelliJ?




Ted Hill



public class AssertionTestFrame extends JPanel



    public AssertionTestFrame()



        assert(false) : "This should fail";



    public static void main(String[ ] args)


        JFrame frame = new JFrame("AssertionTestFrame");




        frame.getContentPane( ).add(new AssertionTestFrame( ),


        frame.setSize(400, 200);







More Like This

  • Retrieving data ...