mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-21 01:15:36 +00:00
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:
parent
95e3fccc98
commit
62bf5bfcb0
@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.commons.lang.exception;
|
package org.apache.commons.lang.exception;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.lang.reflect.Modifier;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintStream;
|
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() {
|
public void testCauseMethodNameOps() {
|
||||||
this.testCauseMethodNameOps(null);
|
this.testCauseMethodNameOps(null);
|
||||||
this.testCauseMethodNameOps("");
|
this.testCauseMethodNameOps("");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user