forked from junit-team/junit4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request junit-team#319 from stefanbirkner/issue318
Fixed junit-teamgh-318 (Empty message instead of null)
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/test/java/junit/tests/framework/AssertionFailedErrorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package junit.tests.framework; | ||
|
||
import junit.framework.AssertionFailedError; | ||
import junit.framework.TestCase; | ||
|
||
public class AssertionFailedErrorTest extends TestCase { | ||
private static final String ARBITRARY_MESSAGE= "arbitrary message"; | ||
|
||
public void testCreateErrorWithoutMessage() throws Exception { | ||
AssertionFailedError error= new AssertionFailedError(); | ||
assertNull(error.getMessage()); | ||
} | ||
|
||
public void testCreateErrorWithMessage() throws Exception { | ||
AssertionFailedError error= new AssertionFailedError(ARBITRARY_MESSAGE); | ||
assertEquals(ARBITRARY_MESSAGE, error.getMessage()); | ||
} | ||
|
||
public void testCreateErrorWithoutMessageInsteadOfNull() throws Exception { | ||
AssertionFailedError error= new AssertionFailedError(null); | ||
assertEquals("", error.getMessage()); | ||
} | ||
} |