Bugfix/issue 1828 Good text failing#1831
Merged
JulianKast merged 9 commits intodevelopfrom Sep 21, 2022
Merged
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
|
JulianKast
requested changes
Sep 15, 2022
Contributor
JulianKast
left a comment
There was a problem hiding this comment.
First round code review
base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
Show resolved
Hide resolved
base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
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
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.
JulianKast
requested changes
Sep 19, 2022
Contributor
JulianKast
left a comment
There was a problem hiding this comment.
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.
JulianKast
approved these changes
Sep 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thesendShowmethod which notifies thecurrentScreenDataUpdateListenerof anerrorState.testUpdateTargetStateWithErrorStateNullDoesNotUpdateCurrentScreen(): Tests theupdateTargetStateWithErrorStatemethod to ensure that fields set to null will not be updated on the current screen.testUpdateTargetStateWithErrorBadDataDoesNotUpdateCurrentScreen(): Tests theupdateTargetStateWithErrorStatemethod to ensure that fields set to bad data will not be updated on the current screen.testUpdateTargetStateWithErrorBadDataAndGoodData(): Tests theupdateTargetStateWithErrorStatemethod 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 thesendShowmethod to callcurrentScreenDataUpdateListener.onError(updatedState)on failure.onErrorpath of thecurrentScreenDataUpdateListeneroverride to callupdatePendingOperationsWithFailedScreenState(errorState), passing in anerrorState.BaseTextAndGraphicManager: added in methodupdatePendingOperationsWithFailedScreenStatewhich sends theerrorStatetoupdateOperation.updateTargetStateWithErrorState(errorState)TextAndGraphicUpdateOperation: added methodupdateTargetStateWithErrorStatethat ensures every field is null safe and compares theerrorStateto theupdatedState. If they are the same, then it sets theupdatedStateto thecurrentScreenDataassociated with the field to keep the field from being updated with bad data.Changelog
Enhancements
Bug Fixes
Tasks Remaining
CLA