JUnit4:Test文档中的解释:
The Test annotation supports two optional parameters.
The first, expected, declares that a test method should throw an exception.
If it doesn't throw an exception or if it throws a different exception than the one declared, the test fails.
可以看下这个链接,写的真的是挺详细的:http://www.cnblogs.com/mengdd/archive/2013/04/13/3019278.html