JUnit Practice Problems


  1. Write a JUnit test assuming you have two String references named strOne an strTwo and you only want it to pass if the two Strings contain the same characters.

  2. Write a JUnit test assuming you have an array of int valus and you only want the JUnit test to fail if any of the values are less than 20.

  3. Write a JUnit test assuming you have two StringBuffer references named sbOne and sbTwo and you only want it to pass if the two refernces point to the same StringBuffer object.

  4. If you have three JUnit test methods written in the same testing class and the first one fails its assertions, will he other methods still be executed?