From 765297b79ccb4781350fa85fba4a4e0b7e048943 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Mon, 4 Jul 2011 14:50:30 +0000 Subject: [PATCH] Port to JUnit 4. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1142700 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/lang3/reflect/FieldUtilsTest.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java b/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java index 61936f4d2..14c7ddfbc 100644 --- a/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java @@ -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"); } }