increase Validate test coverage as reported by clover

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@234407 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Caswell 2005-08-22 00:55:37 +00:00
parent 8ed194eb19
commit d52b75e314
1 changed files with 12 additions and 0 deletions

View File

@ -15,6 +15,8 @@
*/
package org.apache.commons.lang;
import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@ -363,6 +365,7 @@ public void testAllElementsOfType() {
coll.add("a");
coll.add("b");
Validate.allElementsOfType(coll, String.class, "MSG");
Validate.allElementsOfType(coll, String.class);
try {
Validate.allElementsOfType(coll, Integer.class, "MSG");
fail("Expecting IllegalArgumentException");
@ -395,4 +398,13 @@ public void testAllElementsOfType() {
}
}
public void testConstructor() {
assertNotNull(new Validate());
Constructor[] cons = Validate.class.getDeclaredConstructors();
assertEquals(1, cons.length);
assertEquals(true, Modifier.isPublic(cons[0].getModifiers()));
assertEquals(true, Modifier.isPublic(Validate.class.getModifiers()));
assertEquals(false, Modifier.isFinal(Validate.class.getModifiers()));
}
}