mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-06 10:08:32 +00:00
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:
parent
8ed194eb19
commit
d52b75e314
@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.commons.lang;
|
package org.apache.commons.lang;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.lang.reflect.Modifier;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -363,6 +365,7 @@ public void testAllElementsOfType() {
|
|||||||
coll.add("a");
|
coll.add("a");
|
||||||
coll.add("b");
|
coll.add("b");
|
||||||
Validate.allElementsOfType(coll, String.class, "MSG");
|
Validate.allElementsOfType(coll, String.class, "MSG");
|
||||||
|
Validate.allElementsOfType(coll, String.class);
|
||||||
try {
|
try {
|
||||||
Validate.allElementsOfType(coll, Integer.class, "MSG");
|
Validate.allElementsOfType(coll, Integer.class, "MSG");
|
||||||
fail("Expecting IllegalArgumentException");
|
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()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user