3.x: Have all unit tests extend a base test class
See original GitHub issueBy adding a common base class, we can enable a “global” timeout and a per-class log output that prevents Travis CI to stop the build and also not flood the log with all methods:
package io.reactivex.testsupport;
public abstract class RxJavaTest {
@Rule
protected Timeout globalTimeout = new Timeout(5, TimeUnit.MINUTES);
@Test
@Ignore
public final void announce() {
}
}
This way, we no longer have to rely on the random ignores scattered along the codebase. This baseclass-ignore may seem unnecessarily complicated, but unfortunately, I was unable to create a working setting via Gradle’s test runner.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
JUnit extend base class and have tests in that class being run
Yes, I tried it from Eclipse with JUnit 3. I ran the MyTests class as a JUnit test and all tests passed successfully....
Read more >Three Reasons Why We Should Not Use Inheritance In Our ...
After all tests of a test class are executed, JUnit traverses the class hierarchy again and looks for methods annotated with the @AfterClass ......
Read more >Is it a bad practice for all test classes to extend a particular class
This base class usually runs some setup & cleanup code before each test class is run. In some cases, the base class is...
Read more >Extending the class to test it: is this testing approach fine?
It comes in two flavors: the extending class is a class that is only used in test. the test class (fixture) is itself...
Read more >Base Test Class Testing Pattern: Why and How to use
It is a simple approach to set up common initialization and cleanup in your tests. We commonly categorize it as a Testing pattern....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Don’t worry about them. Thanks for your diligent work!
Hey, There are a few remaining things to close the issue. First, I did not delete ignored tests for the fusion operator. Second, I don’t know what should be done to fix those non-deterministic and thread starvation tests:
Also, I did not update Technology Compatibility Kit (TCK) tests.