From: David S. <ds...@us...> - 2006-04-27 22:11:57
|
Update of /cvsroot/junit/junit/org/junit/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7286/org/junit/tests Modified Files: TestMethodTest.java Log Message: An annotated method is no longer hidden by an overloading method. Index: TestMethodTest.java =================================================================== RCS file: /cvsroot/junit/junit/org/junit/tests/TestMethodTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TestMethodTest.java 15 Feb 2006 22:55:29 -0000 1.2 +++ TestMethodTest.java 27 Apr 2006 22:11:51 -0000 1.3 @@ -15,6 +15,7 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.internal.runners.InitializationError; +import org.junit.internal.runners.MethodValidator; import org.junit.internal.runners.TestClassRunner; import org.junit.runner.JUnitCore; import org.junit.runner.Result; @@ -110,6 +111,20 @@ assertEquals(1, result.runCount()); } + public static class Confused { + @Test public void a(Object b) { + } + + @Test public void a() { + } + } + + @Test public void overloaded() { + MethodValidator validator= new MethodValidator(Confused.class); + List<Throwable> errors= validator.validateAllMethods(); + assertEquals(1, errors.size()); + } + public static junit.framework.Test suite() { return new JUnit4TestAdapter(TestMethodTest.class); } |