Skip to content
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

80% code coverage for StorIO-Common #461

Merged
merged 1 commit into from
Jul 27, 2015
Merged

Conversation

artem-zinnatullin
Copy link
Member

Part of #450.

This PR adds tests for StorIO-Common, now coverage of this module is about 99%.

@nikitin-da PTAL

@artem-zinnatullin
Copy link
Member Author

YES, I've finally fixed the problem with test coverage of OnSubscribeExecuteAsBlocking.

It was race condition which never happens on build machine with more than one Processor Core but on Travis CI and on our Jenkins we have only one core and test execution became different.

@nikitin-da PTAL!

field.set(null, prevValue);

// Restoring FINAL modifier (for better tests performance)
modifiersFieldOfTheField.setInt(field, field.getModifiers() & FINAL);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why should it be faster withfinal? As for me it's not uniquely (http://stackoverflow.com/a/4279442)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, I think it will be faster because of JIT.
27 июля 2015 г. 8:59 AM пользователь "Dmitrii Nikitin" <
notifications@github.com> написал:

In
storio-common/src/test/java/com/pushtorefresh/storio/internal/EnvironmentTest.java
#461 (comment):

  •    field.set(null, false); // No Environment will think that RxJava is not in the ClassPath
    
  •    try {
    
  •        Environment.throwExceptionIfRxJavaIsNotAvailable("yolo");
    
  •        fail();
    
  •    } catch (IllegalStateException expected) {
    
  •        assertEquals("yolo requires RxJava in classpath," +
    
  •                        " please add it as compile dependency to the application",
    
  •                expected.getMessage()
    
  •        );
    
  •    } finally {
    
  •        // Return previous value of the field
    
  •        field.set(null, prevValue);
    
  •        // Restoring FINAL modifier (for better tests performance)
    
  •        modifiersFieldOfTheField.setInt(field, field.getModifiers() & FINAL);
    

Why should it be faster withfinal? As for me it's not uniquely (
http://stackoverflow.com/a/4279442)


Reply to this email directly or view it on GitHub
https://github.com/pushtorefresh/storio/pull/461/files#r35507387.

nikitin-da added a commit that referenced this pull request Jul 27, 2015
@nikitin-da nikitin-da merged commit f227a56 into master Jul 27, 2015
@nikitin-da nikitin-da deleted the storio-common-coverage branch July 27, 2015 06:06
@nikitin-da
Copy link
Collaborator

Well done!

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.

2 participants