From 62bf5bfcb018ef4058b561dae3590a2ca2e9e551 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Fri, 25 Aug 2006 06:11:47 +0000 Subject: [PATCH] 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 --- .../lang/exception/ExceptionUtilsTestCase.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java b/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java index 7160e9842..e4d0ca105 100644 --- a/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java +++ b/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java @@ -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("");