Added unit test to enforce the existence of the empty constructor

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@436670 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2006-08-25 06:11:47 +00:00
parent 95e3fccc98
commit 62bf5bfcb0

View File

@ -15,6 +15,8 @@
*/
package org.apache.commons.lang.exception;
import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
@ -117,6 +119,17 @@ private Throwable createExceptionWithCause() {
//-----------------------------------------------------------------------
public void testConstructor() {
assertNotNull(new ExceptionUtils());
Constructor[] cons = ExceptionUtils.class.getDeclaredConstructors();
assertEquals(1, cons.length);
assertEquals(true, Modifier.isPublic(cons[0].getModifiers()));
assertEquals(true, Modifier.isPublic(ExceptionUtils.class.getModifiers()));
assertEquals(false, Modifier.isFinal(ExceptionUtils.class.getModifiers()));
}
//-----------------------------------------------------------------------
public void testCauseMethodNameOps() {
this.testCauseMethodNameOps(null);
this.testCauseMethodNameOps("");