-
Notifications
You must be signed in to change notification settings - Fork 131
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
Bugfix/issue 1828 Good text failing #1831
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1831 +/- ##
=============================================
- Coverage 54.04% 54.02% -0.02%
- Complexity 5532 5534 +2
=============================================
Files 562 562
Lines 25821 25862 +41
Branches 3398 3411 +13
=============================================
+ Hits 13954 13971 +17
- Misses 10596 10610 +14
- Partials 1271 1281 +10
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round code review
base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
Outdated
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
Outdated
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
Outdated
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
Outdated
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
Outdated
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
Outdated
Show resolved
Hide resolved
…supersedePreviousOperations and currentOperationListener variables. Changed passed in reference from updatedState to null for currentScreenDataListener.onError() when text update has not been sent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't stress about code coverage, given the design, it would require a lot of rewriting of current unit tests to get coverage in areas we did not have before to get to 60%
base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
Outdated
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
Outdated
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
Outdated
Show resolved
Hide resolved
…rentScreenDataUpdateListener.onError(updatedState) from null to updatedState.
Fixes #1828
This PR is ready for review.
Risk
This PR makes minor API changes.
Testing Plan
Unit Tests
*Note: This branch has been tested for Android by Chloe, Julian Tested JavaSE
testOnShowFailBadDataDoesNotUpdateScreen()
: Tests the show failure branch within thesendShow
method which notifies thecurrentScreenDataUpdateListener
of anerrorState
.testUpdateTargetStateWithErrorStateNullDoesNotUpdateCurrentScreen()
: Tests theupdateTargetStateWithErrorState
method to ensure that fields set to null will not be updated on the current screen.testUpdateTargetStateWithErrorBadDataDoesNotUpdateCurrentScreen()
: Tests theupdateTargetStateWithErrorState
method to ensure that fields set to bad data will not be updated on the current screen.testUpdateTargetStateWithErrorBadDataAndGoodData()
: Tests theupdateTargetStateWithErrorState
method to ensure that fields set to bad data will not be updated on the current screen but fields set with good data will be updated.Core Tests
In Manticore verified that properties in screen manager when set would not fail when one attribute was given bad data
Summary
TextAndGraphicUpdateOperation:
modified thesendShow
method to callcurrentScreenDataUpdateListener.onError(updatedState)
on failure.onError
path of thecurrentScreenDataUpdateListener
override to callupdatePendingOperationsWithFailedScreenState(errorState)
, passing in anerrorState
.BaseTextAndGraphicManager
: added in methodupdatePendingOperationsWithFailedScreenState
which sends theerrorState
toupdateOperation.updateTargetStateWithErrorState(errorState)
TextAndGraphicUpdateOperation
: added methodupdateTargetStateWithErrorState
that ensures every field is null safe and compares theerrorState
to theupdatedState
. If they are the same, then it sets theupdatedState
to thecurrentScreenData
associated with the field to keep the field from being updated with bad data.Changelog
Enhancements
Bug Fixes
Tasks Remaining
CLA