History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-24365
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Alexey Kudravtsev
Reporter: Bjørn Bjerkeli
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

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

Created: 05 Aug 07 15:05   Updated: 21 Jan 08 12:54
Component/s: Unit Testing. JUnit
Fix Version/s: Diana 8243, Selena 7.0.3

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Ubuntu

Build: 6,827
Fixed in build: 8,115
Severity: Medium


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.