Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public void setUp() throws Exception {
public Void answer(InvocationOnMock invocation) {
Object[] args = invocation.getArguments();
OnPermissionChangeListener onPermissionChangeListener = (OnPermissionChangeListener) args[2];
Map<FunctionID, PermissionStatus > allowedPermissions = new HashMap<>();
Map<FunctionID, PermissionStatus> allowedPermissions = new HashMap<>();
int permissionGroupStatus = PermissionManager.PERMISSION_GROUP_STATUS_DISALLOWED;
onPermissionChangeListener.onPermissionsChange(allowedPermissions,permissionGroupStatus);
onPermissionChangeListener.onPermissionsChange(allowedPermissions, permissionGroupStatus);
return null;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ public void testPresentAlertTruncatedText() {

windowCapability = getWindowCapability(2);

presentAlertOperation = new PresentAlertOperation(internalInterface, alertView, windowCapability, speechCapabilities, fileManager, 1, alertCompletionListener, alertSoftButtonClearListener);
presentAlertOperation = new PresentAlertOperation(internalInterface, alertView, windowCapability, speechCapabilities, fileManager, 1, alertCompletionListener, alertSoftButtonClearListener);
alert = presentAlertOperation.alertRpc();
assertEquals(alert.getAlertText1(), alertView.getText());
assertEquals(alert.getAlertText2(),alertView.getSecondaryText() + " - " + alertView.getTertiaryText());
assertEquals(alert.getAlertText2(), alertView.getSecondaryText() + " - " + alertView.getTertiaryText());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,8 @@ public void testSettingSoftButtonId() {
SoftButtonObject softButtonObject3 = new SoftButtonObject("object1", Arrays.asList(softButtonState1, softButtonState2), softButtonState1.getName(), null);
SoftButtonObject softButtonObject4 = new SoftButtonObject("object2", Arrays.asList(softButtonState3, softButtonState4), softButtonState3.getName(), null);
assertTrue(screenManager.checkAndAssignButtonIds(softButtonObjects, BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER));





}

@Test
public void testAssigningIdsToSoftButtonObjects() {
SoftButtonObject sbo1, sbo2, sbo3, sbo4, sbo5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,15 @@ public void testDefaultWindowCapabilityNotSet() throws NoSuchFieldException, Ill
newCSM.setKeyboardConfiguration(newCSM.defaultKeyboardConfiguration());
Field field = BaseChoiceSetManager.class.getDeclaredField("keyboardConfiguration");
field.setAccessible(true);
KeyboardProperties properties = (KeyboardProperties)field.get(newCSM);
KeyboardProperties properties = (KeyboardProperties) field.get(newCSM);
assertEquals(properties, csm.defaultKeyboardConfiguration());

// Test presentKeyboard
newCSM = new ChoiceSetManager(internalInterface, fileManager);
newCSM.presentKeyboard("qwerty", newCSM.defaultKeyboardConfiguration(), null);
field = BaseChoiceSetManager.class.getDeclaredField("keyboardConfiguration");
field.setAccessible(true);
properties = (KeyboardProperties)field.get(newCSM);
properties = (KeyboardProperties) field.get(newCSM);
assertEquals(properties, csm.defaultKeyboardConfiguration());
}

Expand All @@ -314,7 +314,7 @@ public void testDefaultWindowCapabilityTooManyKeys() throws NoSuchFieldException
Field field = BaseChoiceSetManager.class.getDeclaredField("keyboardConfiguration");
field.setAccessible(true);

KeyboardProperties getProperties = (KeyboardProperties)field.get(newCSM);
KeyboardProperties getProperties = (KeyboardProperties) field.get(newCSM);

assertEquals(getProperties.getCustomKeys().size(), 1);
}
Expand Down Expand Up @@ -342,7 +342,7 @@ public void testCustomKeysNull() throws NoSuchFieldException, IllegalAccessExcep
Field field = BaseChoiceSetManager.class.getDeclaredField("keyboardConfiguration");
field.setAccessible(true);

KeyboardProperties getProperties = (KeyboardProperties)field.get(newCSM);
KeyboardProperties getProperties = (KeyboardProperties) field.get(newCSM);

assertNull(getProperties.getCustomKeys());
}
Expand Down Expand Up @@ -373,7 +373,7 @@ public void testMaskInputCharactersNotSupported() throws NoSuchFieldException, I
Field field = BaseChoiceSetManager.class.getDeclaredField("keyboardConfiguration");
field.setAccessible(true);

KeyboardProperties getProperties = (KeyboardProperties)field.get(newCSM);
KeyboardProperties getProperties = (KeyboardProperties) field.get(newCSM);

assertNull(getProperties.getMaskInputCharacters());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public void testCancelingChoiceSetIfThreadHasFinished() {
when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(6, 0));
WindowCapability windowCapability = new WindowCapability();
HashSet<ChoiceCell> loadedCells = new HashSet<>();
presentChoicesOperation = new PreloadPresentChoicesOperation(internalInterface, fileManager, choiceSet, InteractionMode.MANUAL_ONLY, null, null, TestValues.GENERAL_INTEGER,null, windowCapability, true, loadedCells, null, null);
presentChoicesOperation = new PreloadPresentChoicesOperation(internalInterface, fileManager, choiceSet, InteractionMode.MANUAL_ONLY, null, null, TestValues.GENERAL_INTEGER, null, windowCapability, true, loadedCells, null, null);
presentChoicesOperation.finishOperation(false);

assertEquals(Task.FINISHED, presentChoicesOperation.getState());
Expand All @@ -360,7 +360,7 @@ public void testCancelingChoiceSetIfThreadHasCanceled() {
when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(6, 0));
WindowCapability windowCapability = new WindowCapability();
HashSet<ChoiceCell> loadedCells = new HashSet<>();
presentChoicesOperation = new PreloadPresentChoicesOperation(internalInterface, fileManager, choiceSet, InteractionMode.MANUAL_ONLY, null, null, TestValues.GENERAL_INTEGER,null, windowCapability, true, loadedCells, null, null);
presentChoicesOperation = new PreloadPresentChoicesOperation(internalInterface, fileManager, choiceSet, InteractionMode.MANUAL_ONLY, null, null, TestValues.GENERAL_INTEGER, null, windowCapability, true, loadedCells, null, null);
presentChoicesOperation.cancelTask();

assertEquals(Task.CANCELED, presentChoicesOperation.getState());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public void run() {
transactionQueue.add(operation, false);
}

private Answer<Void> createSetGlobalPropertiesAnswer(final boolean success){
private Answer<Void> createSetGlobalPropertiesAnswer(final boolean success) {
return new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) {
Expand All @@ -206,7 +206,7 @@ public Void answer(InvocationOnMock invocation) {
};
}

private WindowCapability createWindowCapability (boolean supportsList, boolean supportsTile) {
private WindowCapability createWindowCapability(boolean supportsList, boolean supportsTile) {
WindowCapability windowCapability = new WindowCapability();
windowCapability.setMenuLayoutsAvailable(new ArrayList<MenuLayout>());
if (supportsList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public Void answer(InvocationOnMock invocation) {
@Override
public Void answer(InvocationOnMock invocation) {
Object[] args = invocation.getArguments();
List<RPCMessage> rpcs = (List<RPCMessage>) args[0];
List<RPCMessage> rpcs = (List<RPCMessage>) args[0];
OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];

for (RPCMessage rpcMessage : rpcs) {
Expand Down Expand Up @@ -550,7 +550,7 @@ public void testClearingMenu() {
// Sleep to give time to Taskmaster to run the operations
sleep();

assertEquals(0 , menuManager.currentMenuCells.size());
assertEquals(0, menuManager.currentMenuCells.size());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public void testShouldCellIncludeImage() {
assertTrue(MenuReplaceUtilities.shouldCellIncludePrimaryImageFromCell(internalInterface, menuCell, fileManager, windowCapability));
}

private WindowCapability createWindowCapability (boolean supportsCmdIcon, boolean supportsSubMenuIcon) {
private WindowCapability createWindowCapability(boolean supportsCmdIcon, boolean supportsSubMenuIcon) {
WindowCapability windowCapability = new WindowCapability();
windowCapability.setImageFields(new ArrayList<ImageField>());
if (supportsCmdIcon) {
Expand All @@ -343,7 +343,7 @@ private WindowCapability createWindowCapability (boolean supportsCmdIcon, boolea
return windowCapability;
}

private FileManager createMockFileManager (boolean hasUploadedFile) {
private FileManager createMockFileManager(boolean hasUploadedFile) {
FileManager fileManager = mock(FileManager.class);
when(fileManager.hasUploadedFile(any(SdlArtwork.class))).thenReturn(hasUploadedFile);
return fileManager;
Expand Down Expand Up @@ -392,7 +392,7 @@ private List<MenuCell> createMenuCellList() {
List<MenuCell> menuCellList = new ArrayList<>(Arrays.asList(menuCell1, menuCell2, menuCell3, menuCell4));
addIdsToMenuCells(menuCellList, parentIdNotFound);

return menuCellList ;
return menuCellList;
}

private List<MenuCell> createNewMenuList() {
Expand Down Expand Up @@ -422,6 +422,6 @@ private List<MenuCell> createNewMenuList() {
List<MenuCell> newMenuList = new ArrayList<>(Arrays.asList(menuCell5));
addIdsToMenuCells(newMenuList, parentIdNotFound);

return newMenuList ;
return newMenuList;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void testOpenSubMenu() {
verify(internalInterface, Mockito.times(1)).sendRPC(any(ShowAppMenu.class));
}

private Answer<Void> createShowAppMenuAnswer(final boolean success, final Integer menuIdToAssert){
private Answer<Void> createShowAppMenuAnswer(final boolean success, final Integer menuIdToAssert) {
return new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) {
Expand All @@ -118,7 +118,7 @@ public Void answer(InvocationOnMock invocation) {
@Override
public void run() {
ShowAppMenu showAppMenu = (ShowAppMenu) request;
assertEquals(showAppMenu.getMenuID(), menuIdToAssert);
assertEquals(showAppMenu.getMenuID(), menuIdToAssert);
}
});
RPCResponse response = new RPCResponse(request.getFunctionID().toString());
Expand Down
Loading