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

[0285] ShowConstantTBT Description Update #1581

Merged

Conversation

kboskin
Copy link
Contributor

@kboskin kboskin commented Dec 9, 2020

Fixes #1573

This PR is [ready] for review.

Related PR's

Core

Risk

This PR makes [minor] API changes.

Testing Plan

Testing Plan

  • I have run the unit tests with this PR
  • I have tested this PR against Core and verified the behavior
  • I have tested Android

Unit Tests

Added unit tests for the new structures

Summary

Changes according to #1573

CLA

- Implement changes according to the latest specification
@kboskin kboskin changed the base branch from master to develop December 9, 2020 20:01
@kboskin
Copy link
Contributor Author

kboskin commented Dec 9, 2020

@santanamk ready for the Ford review

Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

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

@KostyaBoss I have reviewed this PR. The code looks good. Please review whenever you get the chance, and make changes as needed.

@@ -4,7 +4,7 @@
import com.smartdevicelink.protocol.enums.FunctionID;

Choose a reason for hiding this comment

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

@KostyaBoss I would revert these changes in ShowConstantTbtTests.java. They are valid changes, but are out of scope of the PR.

@@ -3,7 +3,7 @@
import com.smartdevicelink.marshal.JsonRPCMarshaller;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCMessage;

Choose a reason for hiding this comment

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

@KostyaBoss I would revert these changes in ShowConstantTbtResponseTests.java. This PR only deals with the ShowConstantTbtRequest so these changes are out of scope of the PR.

@@ -44,23 +44,31 @@
*
* @since SmartDeviceLink 2.0
*/
public class ShowConstantTbtResponse extends RPCResponse {

Choose a reason for hiding this comment

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

@KostyaBoss I would revert these changes in ShowConstantTbtResponse.java. This PR only deals with the ShowConstantTbtRequest so these changes are out of scope of the PR.


public static final String KEY_TEXT1 = "navigationText1";
public static final String KEY_TEXT2 = "navigationText2";
public static final String KEY_ETA = "eta";
public static final String KEY_TOTAL_DISTANCE = "totalDistance";
public static final String KEY_MANEUVER_DISTANCE = "distanceToManeuver";

Choose a reason for hiding this comment

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

@KostyaBoss Lines 59-60 and 206-252 are good.

I would revert the other changes, since they are out of scope of the PR.

@kboskin
Copy link
Contributor Author

kboskin commented Dec 20, 2020

@santhanamk implementing experience gained while fixing the 0236 - this will cause the crash of the generic tests, which are testing the structures under the hood. Do we still need to rollback these changes? (they are according to XML provided)

@santhanamk
Copy link

@santhanamk implementing experience gained while fixing the 0236 - this will cause the crash of the generic tests, which are testing the structures under the hood. Do we still need to rollback these changes? (they are according to XML provided)

@KostyaBoss I would roll back the changes in:
ShowConstantTbtTests.java,
ShowConstantTbtResponseTests.java,
ShowConstantTbtResponse.java.

I believe that the changes in these three files are out of the scope of the PR.

I went through and reviewed what needs to be changed in ShowConstantTbt.java. I would not rename the file since it is out of scope of the PR.

Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

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

@KostyaBoss I have reviewed the PR. Please take a look at the suggestions, and make the changes as needed whenever you get the chance.

@@ -49,34 +50,33 @@
* @see UpdateTurnList
* @since SmartDeviceLink 2.0
*/
public class ShowConstantTbt extends RPCRequest {
public class ShowConstantTBT extends RPCRequest {

Choose a reason for hiding this comment

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

@KostyaBoss I would keep the name as ShowConstantTbt on line 53. Changing the name of the class is out of scope of the PR.

*/
public ShowConstantTbt() {
public ShowConstantTBT() {

Choose a reason for hiding this comment

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

@KostyaBoss I would keep the name as ShowConstantTbt on line 70. Changing the name of the class is out of scope of the PR.

public static final String KEY_MANEUVER_IMAGE = "turnIcon";
public static final String KEY_NEXT_MANEUVER_IMAGE = "nextTurnIcon";
public static final String KEY_MANEUVER_COMPLETE = "maneuverComplete";
public static final String KEY_SOFT_BUTTONS = "softButtons";
public static final String KEY_TIME_TO_DESTINATION = "timeToDestination";

/**
* Constructs a new ShowConstantTbt object
* Constructs a new ShowConstantTBT object

Choose a reason for hiding this comment

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

@KostyaBoss I would keep the name as ShowConstantTbt on line 68. Changing the name of the class is out of scope of the PR.

*
* @param hash The Hashtable to use
*/
public ShowConstantTbt(Hashtable<String, Object> hash) {
public ShowConstantTBT(Hashtable<String, Object> hash) {

Choose a reason for hiding this comment

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

@KostyaBoss I would keep the name as ShowConstantTbt on line 79. Changing the name of the class is out of scope of the PR.

super(FunctionID.SHOW_CONSTANT_TBT.toString());
}

/**
* Constructs a new ShowConstantTbt object indicated by the Hashtable parameter
* <p>
* Constructs a new ShowConstantTBT object indicated by the Hashtable parameter

Choose a reason for hiding this comment

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

@KostyaBoss I would keep the name as ShowConstantTbt on line 75. Changing the name of the class is out of scope of the PR.

*/
public ShowConstantTbt setDistanceToManeuver(Double distanceToManeuver) {
setParameters(KEY_MANEUVER_DISTANCE, distanceToManeuver);
public ShowConstantTBT setDistanceToManeuver(Double distanceToManeuver) {

Choose a reason for hiding this comment

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

@KostyaBoss I would keep the name as ShowConstantTbt on line 212. Changing the name of the class is out of scope of the PR.

*/
public ShowConstantTbt setDistanceToManeuverScale(Double distanceToManeuverScale) {
setParameters(KEY_MANEUVER_DISTANCE_SCALE, distanceToManeuverScale);
public ShowConstantTBT setDistanceToManeuverScale(Double distanceToManeuverScale) {

Choose a reason for hiding this comment

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

@KostyaBoss I would keep the name as ShowConstantTbt on line 237. Changing the name of the class is out of scope of the PR.

@@ -251,7 +259,7 @@ public Double getDistanceToManeuverScale() {
*
* @param maneuverComplete a Boolean value
*/
public ShowConstantTbt setManeuverComplete(Boolean maneuverComplete) {
public ShowConstantTBT setManeuverComplete(Boolean maneuverComplete) {

Choose a reason for hiding this comment

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

@KostyaBoss I would keep the name as ShowConstantTbt on line 262. Changing the name of the class is out of scope of the PR.

@@ -273,7 +281,7 @@ public Boolean getManeuverComplete() {
*
* @param softButtons a List<SoftButton> value
*/
public ShowConstantTbt setSoftButtons(List<SoftButton> softButtons) {
public ShowConstantTBT setSoftButtons(List<SoftButton> softButtons) {

Choose a reason for hiding this comment

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

@KostyaBoss I would keep the name as ShowConstantTbt on line 284. Changing the name of the class is out of scope of the PR.

@@ -289,7 +297,7 @@ public ShowConstantTbt setSoftButtons(List<SoftButton> softButtons) {
return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
}

public ShowConstantTbt setTimeToDestination(String timeToDestination) {
public ShowConstantTBT setTimeToDestination(String timeToDestination) {

Choose a reason for hiding this comment

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

@KostyaBoss I would keep the name as ShowConstantTbt on line 300. Changing the name of the class is out of scope of the PR.

@kboskin
Copy link
Contributor Author

kboskin commented Dec 29, 2020

@santhanamk I am sorry for the big delay providing this answer but if we will rollback these changes, what we know from the other pr's - the generic internal tests, which are testing the RPC in the documentation will fail. These changes - according to XML file. Do we still need to rollback?

@santhanamk
Copy link

@santhanamk I am sorry for the big delay providing this answer but if we will rollback these changes, what we know from the other pr's - the generic internal tests, which are testing the RPC in the documentation will fail. These changes - according to XML file. Do we still need to rollback?

@KostyaBoss So I spoke with Michael Crimando about this. He wrote the proposal.

This is purely a description change, and nothing else. You just need to change the descriptions for those two parameters distanceToManeuver and distanceToManeuverScale in ShowConstantTbt.java. No other changes are needed.

- Changes rollback
@codecov
Copy link

codecov bot commented Jan 6, 2021

Codecov Report

Merging #1581 (c1dd605) into develop (def46af) will increase coverage by 0.29%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1581      +/-   ##
=============================================
+ Coverage      56.09%   56.39%   +0.29%     
- Complexity      5021     5076      +55     
=============================================
  Files            515      521       +6     
  Lines          22297    22621     +324     
  Branches        2777     2822      +45     
=============================================
+ Hits           12508    12756     +248     
- Misses          8848     8882      +34     
- Partials         941      983      +42     
Impacted Files Coverage Δ Complexity Δ
...com/smartdevicelink/proxy/rpc/ShowConstantTbt.java 100.00% <ø> (ø) 24.00 <0.00> (ø)
...tdevicelink/managers/screen/menu/VoiceCommand.java 59.09% <0.00%> (-40.91%) 8.00% <0.00%> (+1.00%) ⬇️
...proxy/rpc/listeners/OnMultipleRequestListener.java 35.71% <0.00%> (-14.29%) 1.00% <0.00%> (-1.00%)
.../main/java/com/smartdevicelink/util/DebugTool.java 15.05% <0.00%> (-2.16%) 11.00% <0.00%> (-1.00%)
...smartdevicelink/managers/file/BaseFileManager.java 66.84% <0.00%> (-2.13%) 30.00% <0.00%> (+1.00%) ⬇️
...nk/managers/screen/SoftButtonReplaceOperation.java 44.87% <0.00%> (-0.47%) 18.00% <0.00%> (-3.00%)
...rs/screen/choiceset/PresentChoiceSetOperation.java 41.21% <0.00%> (-0.26%) 17.00% <0.00%> (ø%)
...managers/screen/TextAndGraphicUpdateOperation.java 71.15% <0.00%> (-0.12%) 117.00% <0.00%> (+1.00%) ⬇️
.../com/smartdevicelink/protocol/SdlProtocolBase.java 15.58% <0.00%> (-0.04%) 22.00% <0.00%> (ø%)
...elink/managers/lifecycle/BaseLifecycleManager.java 14.78% <0.00%> (-0.03%) 11.00% <0.00%> (ø%)
... and 12 more

@kboskin
Copy link
Contributor Author

kboskin commented Jan 6, 2021

@santhanamk I've updated the pr, please, re-review

Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

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

@KostyaBoss I reviewed the changes for the PR. I have a few more suggestions. They are pretty minor. The idea is just to change the descriptions for the parameters, and nothing else. Please take a look at the suggestions whenever you get the chance.

@@ -30,7 +30,7 @@

/**
* This is a unit test class for the SmartDeviceLink library project class :
* {@link com.smartdevicelink.proxy.rpc.ShowConstantTbt}
* {@link ShowConstantTbt}

Choose a reason for hiding this comment

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

@KostyaBoss On line 33 I would remove it and change it back to {@link com.smartdevicelink.proxy.rpc.ShowConstantTbt}

The idea is that nothing should be changed in this class.

@@ -71,8 +71,8 @@ protected JSONObject getExpectedParameters(int sdlVersion) {
result.put(ShowConstantTbt.KEY_SOFT_BUTTONS, TestValues.JSON_SOFTBUTTONS);
result.put(ShowConstantTbt.KEY_ETA, TestValues.GENERAL_STRING);
result.put(ShowConstantTbt.KEY_MANEUVER_COMPLETE, true);
result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE, TestValues.GENERAL_DOUBLE);
result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE, TestValues.GENERAL_DOUBLE);
result.put(ShowConstantTbt.KEY_DISTANCE_TO_MANEUVER, TestValues.GENERAL_DOUBLE);

Choose a reason for hiding this comment

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

@KostyaBoss On line 74 I would rename KEY_DISTANCE_TO_MANEUVER back to its old variable name KEY_MANEUVER_DISTANCE. You can apply this change throughout the class.

result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE, TestValues.GENERAL_DOUBLE);
result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE, TestValues.GENERAL_DOUBLE);
result.put(ShowConstantTbt.KEY_DISTANCE_TO_MANEUVER, TestValues.GENERAL_DOUBLE);
result.put(ShowConstantTbt.KEY_DISTANCE_TO_MANEUVER_SCALE, TestValues.GENERAL_DOUBLE);

Choose a reason for hiding this comment

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

@KostyaBoss On line 75 I would rename KEY_DISTANCE_TO_MANEUVER_SCALE back to its old variable name KEY_MANEUVER_DISTANCE_SCALE. You can apply this change throughout the class.

@@ -21,7 +21,7 @@

/**
* This is a unit test class for the SmartDeviceLink library project class :
* {@link com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse}
* {@link ShowConstantTbtResponse}

Choose a reason for hiding this comment

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

@KostyaBoss I would delete line 24 and replace it with its old line {@link com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse}

@@ -33,6 +33,7 @@

import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.util.SdlDataTypeConverter;

Choose a reason for hiding this comment

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

@KostyaBoss I would remove this import on line 36 import com.smartdevicelink.util.SdlDataTypeConverter;.

(The idea is to just make the description changes and nothing else)

*/
public Double getDistanceToManeuverScale() {
return getDouble(KEY_MANEUVER_DISTANCE_SCALE);
Object object = getParameters(KEY_DISTANCE_TO_MANEUVER_SCALE);

Choose a reason for hiding this comment

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

@KostyaBoss I would delete lines 252-253 and replace it with the old code return getDouble(KEY_MANEUVER_DISTANCE_SCALE);.

@@ -46,19 +46,27 @@
*/
public class ShowConstantTbtResponse extends RPCResponse {

/**

Choose a reason for hiding this comment

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

@KostyaBoss I would delete the comment block on lines 49-51. The idea is that nothing should be changed in this file.

public ShowConstantTbtResponse() {
super(FunctionID.SHOW_CONSTANT_TBT.toString());
}

/**

Choose a reason for hiding this comment

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

@KostyaBoss I would delete the comment block on lines 56-60. The idea is that nothing should be changed in this file.

public ShowConstantTbtResponse(Hashtable<String, Object> hash) {
super(hash);
}

/**
* Constructs a new ShowConstantTbtResponse object
*
* @param success whether the request is successfully processed
* @param resultCode whether the request is successfully processed
* @param success whether the request is successfully processed

Choose a reason for hiding this comment

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

@KostyaBoss I would delete lines 68-69 and bring back the old formatted code.

*/
public Double getDistanceToManeuver() {
return getDouble(KEY_MANEUVER_DISTANCE);
Object object = getParameters(KEY_DISTANCE_TO_MANEUVER);

Choose a reason for hiding this comment

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

@KostyaBoss I would delete lines 226 and 227 and replace it with the old code return getDouble(KEY_MANEUVER_DISTANCE);.

kboskin added 2 commits January 11, 2021 12:26
- Fix showConstantTbt
- Changes rollback
@kboskin
Copy link
Contributor Author

kboskin commented Jan 11, 2021

@santhanamk rollbacked the required changes according to your request and double-checked everything, all the comments seem to be processed. Please, let me know if some additional changes are required there

Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

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

@KostyaBoss Code looks good. I have approved the PR.

Once you have tested against Core and HMI (if applicable), please put the links for those PRs. Please mark the PR as ready for review, and you can tag Livio once the testing is done on your end.

@kboskin
Copy link
Contributor Author

kboskin commented Jan 11, 2021

@bilal-alsharifi , @jordynmackool This pr is ready for the Livio review

@kboskin kboskin marked this pull request as ready for review January 11, 2021 20:24
@bilal-alsharifi bilal-alsharifi merged commit 69cc4b8 into smartdevicelink:develop Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SDL 0285] ShowConstantTBT Description Update
3 participants