Priority
Normal
Type
Bug 
State
Fixed 
Assignee
Alexey Kudravtsev 
Subsystem
Unit Testing. JUnit 
Affected versions
Fixed in
Fixed in build
Next build 
Build
6827
Fixed in build
8115
Severity
0
  • Submitted by   Bjørn Bjerkeli
    2 years ago (05 Aug 2007 15:05)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:50)
  • Jira: IDEA-40262
    (history, comments)

IDEA-40262

Run test option missing for annotation based tests when only superclass contains test methods

2
Subclass of JUnit 4 annotation-based test won't be properly recognized as a JUnit test unless it contains at least one @Test annotated method, hence the Run test option is not available.

Consider the following example:

public class AbstractRepositoryTest {
private Repository repository;

protected AbstractRepositoryTest(Repository repository){
this.repository = repository;
}

@Test
public void testStore() {
.....
}
}


and the subclass:

public class MyRepositoryTest extends AbstractRepositoryTest {
public MyRepositoryTest() {
super(new MyRepository());
}
}

This is a very useful technique for verifying the same contract for different implementations. I do not want to add test-methods in the subclass. but if I do, the run test option is available and all the tests are executed properly.

Environment: Ubuntu

Issue was resolved
Comments (0)
 
History (1)
 
Links
 
Issue has no comments