Skip to content

Commit a0f34b2

Browse files
author
Julian Kast
committed
testInitializationFailure is not needed, because even if it fails, it passes a ready state to allow sdlManager to start
baseFileManger line 163 : "file list could not be received. assume that setting can work and allow SDLManager to start"
1 parent 905ae95 commit a0f34b2

1 file changed

Lines changed: 0 additions & 54 deletions

File tree

android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,6 @@ public Void answer(InvocationOnMock invocation) {
136136
}
137137
};
138138

139-
private Answer<Void> onListFilesFailure = new Answer<Void>() {
140-
@Override
141-
public Void answer(InvocationOnMock invocation) {
142-
Object[] args = invocation.getArguments();
143-
RPCRequest message = (RPCRequest) args[0];
144-
if(message instanceof ListFiles){
145-
int correlationId = message.getCorrelationID();
146-
ListFilesResponse listFilesResponse = new ListFilesResponse();
147-
listFilesResponse.setSuccess(false);
148-
message.getOnRPCResponseListener().onResponse(correlationId, listFilesResponse);
149-
}
150-
return null;
151-
}
152-
};
153-
154139
private Answer<Void> onPutFileSuccess = new Answer<Void>() {
155140
@Override
156141
public Void answer(InvocationOnMock invocation) {
@@ -182,25 +167,6 @@ public Void answer(InvocationOnMock invocation) {
182167
}
183168
};
184169

185-
private Answer<Void> onSendRequestsSuccess = new Answer<Void>() {
186-
@Override
187-
public Void answer(InvocationOnMock invocation) {
188-
Object[] args = invocation.getArguments();
189-
List<RPCRequest> rpcs = (List<RPCRequest>) args[0];
190-
OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];
191-
if(rpcs.get(0) instanceof PutFile){
192-
for(RPCRequest message : rpcs){
193-
int correlationId = message.getCorrelationID();
194-
listener.addCorrelationId(correlationId);
195-
PutFileResponse putFileResponse = new PutFileResponse();
196-
putFileResponse.setSuccess(true);
197-
listener.onResponse(correlationId, putFileResponse);
198-
}
199-
}
200-
return null;
201-
}
202-
};
203-
204170
private Answer<Void> onListDeleteRequestSuccess = new Answer<Void>() {
205171
@Override
206172
public Void answer(InvocationOnMock invocation) {
@@ -242,10 +208,6 @@ public Void answer(InvocationOnMock invocation) {
242208
}
243209
};
244210

245-
/**
246-
* Flips between calling onError and onResponse.
247-
* simulating uploading files, with some failing to upload
248-
*/
249211
private Answer<Void> onSendRequestsFailPartialOnError = new Answer<Void>() {
250212
@Override
251213
public Void answer(InvocationOnMock invocation) throws Throwable {
@@ -490,22 +452,6 @@ public void onComplete(boolean success) {
490452
});
491453
}
492454

493-
public void testInitializationFailure(){
494-
ISdl internalInterface = mock(ISdl.class);
495-
496-
doAnswer(onListFilesFailure).when(internalInterface).sendRPCRequest(any(ListFiles.class));
497-
498-
final FileManager fileManager = new FileManager(internalInterface, mTestContext);
499-
fileManager.start(new CompletionListener() {
500-
@Override
501-
public void onComplete(boolean success) {
502-
assertFalse(success);
503-
assertEquals(fileManager.getState(), BaseSubManager.ERROR);
504-
assertEquals(BaseFileManager.SPACE_AVAILABLE_MAX_VALUE, fileManager.getBytesAvailable());
505-
}
506-
});
507-
}
508-
509455
/**
510456
* Test file upload, success
511457
*/

0 commit comments

Comments
 (0)