Skip to content

1.x: improve coverage of rx.Observable methods #4178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 8, 2016

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Jul 8, 2016

This PR improves the coverage of rx.Observable methods plus

  • fixes a javadoc issue
  • fixes an enum-coverage anomaly in Notification (now it is simply biased towards onNext signals)
  • removes equals() from TestException as it caused anomalies with deduplication inside CompositeException
  • fixes 3 PMD rule violations (2 suppressed, 1 corrected)
  • timestamp and timeInterval now use the Schedulers.computation() as the source for the current time instead of Schedulers.immediate() which can't be properly hooked. By default, they both return System.currentTimeMillis().

@akarnokd akarnokd added this to the 1.2 milestone Jul 8, 2016
@codecov-io
Copy link

codecov-io commented Jul 8, 2016

Current coverage is 83.04%

Merging #4178 into 1.x will increase coverage by 1.64%

@@                1.x      #4178   diff @@
==========================================
  Files           261        261          
  Lines         16921      16918     -3   
  Methods           0          0          
  Messages          0          0          
  Branches       2554       2555     +1   
==========================================
+ Hits          13773      14049   +276   
+ Misses         2251       1993   -258   
+ Partials        897        876    -21   

Powered by Codecov. Last updated by 978825e...e594d06

new FailingObservable().subscribe(ts);
fail("Should have thrown OnErrorFailedException");
} catch (OnErrorFailedException ex) {
// expected
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you really wanted to be comprehensive here you could put TestException in a method local and verify assertSame(ex.getCause(), testException).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just add a message to TestException and assert the cause's message would basically achieve the same thing.

@JakeWharton
Copy link
Contributor

lgtm 👍

@@ -10699,14 +10702,14 @@ public final Subscription subscribe(Subscriber<? super T> subscriber) {
* <dd>The operator doesn't interfere with backpressure which is determined by the source {@code Observable}'s backpressure
* behavior.</dd>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code timeInterval} operates by default on the {@code immediate} {@link Scheduler}.</dd>
* <dd>{@code timeInterval} operates by default on the {@code computation} {@link Scheduler}.</dd>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this operator does not "operate" on the scheduler, it uses it only as source of time

@akarnokd
Copy link
Member Author

akarnokd commented Jul 8, 2016

Updated.

@akarnokd
Copy link
Member Author

akarnokd commented Jul 8, 2016

Thanks for the review. I'm merging this as it may contain the cure for the memory-kill on Travis. Let me know if there are tests that need more tidying up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants