Change error text to be more clear
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137455 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2a1cabe169
commit
f52c84195f
|
@ -58,18 +58,19 @@ package org.apache.commons.lang;
|
|||
* not have been.</p>
|
||||
*
|
||||
* @author Matthew Hawthorne
|
||||
* @author Stephen Colebourne
|
||||
* @since 2.0
|
||||
* @version $Id: NullArgumentException.java,v 1.3 2003/07/14 22:25:02 bayard Exp $
|
||||
* @version $Id: NullArgumentException.java,v 1.4 2003/07/19 20:19:24 scolebourne Exp $
|
||||
*/
|
||||
public class NullArgumentException extends IllegalArgumentException {
|
||||
|
||||
/**
|
||||
* <p>Instantiates with the given argument name.</p>
|
||||
*
|
||||
*
|
||||
* @param argName the name of the argument that was <code>null</code>.
|
||||
*/
|
||||
public NullArgumentException(String argName) {
|
||||
super(argName + " cannot be null.");
|
||||
super(argName + " must not be null.");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -62,7 +62,8 @@ import junit.textui.TestRunner;
|
|||
* JUnit tests.
|
||||
*
|
||||
* @author Matthew Hawthorne
|
||||
* @version $Id: NullArgumentExceptionTest.java,v 1.1 2003/05/15 04:05:11 bayard Exp $
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id: NullArgumentExceptionTest.java,v 1.2 2003/07/19 20:19:24 scolebourne Exp $
|
||||
* @see NullArgumentException
|
||||
*/
|
||||
public class NullArgumentExceptionTest extends TestCase {
|
||||
|
@ -89,13 +90,13 @@ public class NullArgumentExceptionTest extends TestCase {
|
|||
|
||||
public void testGetMessage_nullConstructorInput() {
|
||||
final Throwable t = new NullArgumentException(null);
|
||||
assertEquals("null cannot be null.", t.getMessage());
|
||||
assertEquals("null must not be null.", t.getMessage());
|
||||
}
|
||||
|
||||
public void testGetMessage_validConstructorInput() {
|
||||
final String argName = "name";
|
||||
final Throwable t = new NullArgumentException(argName);
|
||||
assertEquals(argName + " cannot be null.", t.getMessage());
|
||||
assertEquals(argName + " must not be null.", t.getMessage());
|
||||
}
|
||||
|
||||
} // NullArgumentExceptionTest
|
||||
|
|
Loading…
Reference in New Issue