exception « unit test « Java Testing Q&A

Home
Java Testing Q&A
1.Development
2.FindBugs
3.HTMLUnit
4.hudson
5.junit
6.performance
7.plugin
8.profile
9.selenium
10.Tools
11.unit test
Java Testing Q&A » unit test » exception 

1. Can you or do you write Junit style unit tests without expliciting using 'assertEquals', exceptions fail test    stackoverflow.com

I noticed some unit tests, like in the spring framework where you setup the object and the test but don't explicitly use the assert methods. Essentially, you have an exception or not. Is ...

2. Junit (3.8.1) testing that an exception is thrown (works in unit test, fails when added to a testSuite)    stackoverflow.com

I'm trying to test that I'm throwing an exception when appropriate. In my test class I have a method similar to the following:

public void testParseException() {

    try ...

3. How to do unit test for Exceptions?    stackoverflow.com

As you know, exception is thrown at the condition of abnormal scenarios. So how to analog these exceptions? I feel it is challenge. For such code snippets:

public String getServerName() {
  ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.