Add test for ClassPathUtils accessebility

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1561014 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benedikt Ritter 2014-01-24 14:03:52 +00:00
parent 1e355cfb10
commit 66243d1058
1 changed files with 17 additions and 0 deletions

View File

@ -17,7 +17,14 @@
package org.apache.commons.lang3;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;
import org.apache.commons.lang3.text.WordUtils;
import org.junit.Test;
/**
@ -25,6 +32,16 @@ import org.junit.Test;
*/
public class ClassPathUtilsTest {
@Test
public void testConstructor() {
assertNotNull(new ClassPathUtils());
final Constructor<?>[] cons = ClassPathUtils.class.getDeclaredConstructors();
assertEquals(1, cons.length);
assertTrue(Modifier.isPublic(cons[0].getModifiers()));
assertTrue(Modifier.isPublic(ClassPathUtils.class.getModifiers()));
assertFalse(Modifier.isFinal(ClassPathUtils.class.getModifiers()));
}
@Test(expected = NullPointerException.class)
public void testToFullyQualifiedNameNullClassString() throws Exception {
ClassPathUtils.toFullyQualifiedName((Class<?>) null, "Test.properties");