Author: ggregory Date: Mon Jul 4 14:50:30 2011 New Revision: 1142700 URL: http://svn.apache.org/viewvc?rev=1142700&view=rev Log: Port to JUnit 4.
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java?rev=1142700&r1=1142699&r2=1142700&view=diff ============================================================================== --- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java (original) +++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java Mon Jul 4 14:50:30 2011 @@ -16,15 +16,16 @@ */ package org.apache.commons.lang3.reflect; -import static org.junit.Assume.*; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; +import static org.junit.Assume.assumeNotNull; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import junit.framework.TestCase; - import org.apache.commons.lang3.reflect.testbed.Ambig; import org.apache.commons.lang3.reflect.testbed.Foo; import org.apache.commons.lang3.reflect.testbed.PrivatelyShadowedChild; @@ -1156,14 +1157,9 @@ public class FieldUtilsTest { assertEquals(new Double(0.0), FieldUtils.readDeclaredField(privatelyShadowedChild, "d", true)); } - @Test + @Test(expected=IllegalArgumentException.class) public void testAmbig() { - try { - FieldUtils.getField(Ambig.class, "VALUE"); - fail("should have failed on interface field ambiguity"); - } catch (IllegalArgumentException e) { - // pass - } + FieldUtils.getField(Ambig.class, "VALUE"); } }