Community
Participate
Working Groups
Build Identifier: 20100917-0705 I have some JUnit 4 unit tests where I've marked the whole class with @Ignore. This gives a (correct) output on the JUnit view. If I want to open those tests via double-click in the JUnit view, I get a "Method '...' not found. Opening the test class." warning. This is not ok, since I never indended to open a method but the whole class. Clicking on ok opens the class (which is again ok) --> please don't show that warning in that case since it makes no sense Reproducible: Always Steps to Reproduce: 1. write a Junit 4 unit test 2. mark the whole class with @Ignore 3. run your tests 4. double-click on the ignored test in the Junit view
That's a bug in the JUnit 4 model. In JUnit4TestClassReference#sendDescriptionTree(IVisitsTestTrees, Description), we call org.junit.runner.Description#isTest(), which returns true for an ignored class (because it has no children). package testcase; import org.junit.Ignore; import org.junit.Test; @Ignore public class T4 { @Test public void myTest() throws Exception { org.junit.Assert.assertEquals("the expected String", "the actual String"); } @Test public void anotherTest() throws Exception { junit.framework.Assert.assertEquals("the expected String", "the actual String"); } }
Created attachment 187482 [details] Workaround
Fixed in HEAD.