Menu

Button click

Help
2005-06-29
2013-04-09
  • Gaurav Tanna

    Gaurav Tanna - 2005-06-29

    Hi,
    While using JFCUnit I found out that enterClickAndLeave on the JButton component works even when the button is not enabled. No exception is thrown or any error recorded. May be it is because the enterClickAndLeave is a TestHelper method and not specific for components. But I feel either the mouse click methods can be added to the individual components as we can have more flexibility. Any comments ??

    :)

    Thanks,
    Gaurav

     
    • Kevin Duffey

      Kevin Duffey - 2005-06-29

      Interesting, yet not totally a bad thing. I agree that if a button is disabled (or component), that perhaps the test should fail... however, that may not always be the way you want a test to fail.. if a component is disabled. You can easily check if the button is enabled, and IF you want your test to fail if it isn't, fail it right then and there. You can also easily wrap your own method that calls the enterClickAndLeave and just checks any component if its enabled or not and fails it or not if it isn't so that you don't have to write the same if() check in multiple places.

       

Log in to post a comment.