summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2018-08-14 10:37:31 -0400
committerNicoleYarroch <nicole@livio.io>2018-08-14 10:37:31 -0400
commit0b64697c9d190094dfcb75a94323ca74e1a7967c (patch)
tree5431e7ce3da5c3a516f09bb77f52c8132cffbc6f
parentc873b4f9a1a70108919c834c782a2689cdc8ed27 (diff)
downloadsdl_ios-0b64697c9d190094dfcb75a94323ca74e1a7967c.tar.gz
Fixed deprecated methods & refactored function names
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r--SmartDeviceLink/SDLConfiguration.m4
-rw-r--r--SmartDeviceLink/SDLFileManager.m24
-rw-r--r--SmartDeviceLink/SDLFileManagerConfiguration.m4
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m3
-rw-r--r--SmartDeviceLink/SDLManager.m3
-rw-r--r--SmartDeviceLink/SDLTextAndGraphicManager.m14
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLCheckChoiceVROptionalOperationSpec.m6
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m16
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m9
-rw-r--r--SmartDeviceLinkTests/SDLFileManagerConfigurationSpec.m6
10 files changed, 50 insertions, 39 deletions
diff --git a/SmartDeviceLink/SDLConfiguration.m b/SmartDeviceLink/SDLConfiguration.m
index 59747348e..a96b27d68 100644
--- a/SmartDeviceLink/SDLConfiguration.m
+++ b/SmartDeviceLink/SDLConfiguration.m
@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
}
- (instancetype)initWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfig lockScreen:(nullable SDLLockScreenConfiguration *)lockScreenConfig {
- return [self initWithLifecycle:lifecycleConfig lockScreen:lockScreenConfig logging:nil];
+ return [self initWithLifecycle:lifecycleConfig lockScreen:lockScreenConfig logging:nil fileManager:nil];
}
- (instancetype)initWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfig lockScreen:(nullable SDLLockScreenConfiguration *)lockScreenConfig logging:(nullable SDLLogConfiguration *)logConfig {
@@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
}
+ (instancetype)configurationWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfig lockScreen:(nullable SDLLockScreenConfiguration *)lockScreenConfig {
- return [self configurationWithLifecycle:lifecycleConfig lockScreen:lockScreenConfig logging:nil];
+ return [self configurationWithLifecycle:lifecycleConfig lockScreen:lockScreenConfig logging:nil fileManager:nil];
}
+ (instancetype)configurationWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfig lockScreen:(nullable SDLLockScreenConfiguration *)lockScreenConfig logging:(nullable SDLLogConfiguration *)logConfig {
diff --git a/SmartDeviceLink/SDLFileManager.m b/SmartDeviceLink/SDLFileManager.m
index 2dfaff7de..a3cb03eea 100644
--- a/SmartDeviceLink/SDLFileManager.m
+++ b/SmartDeviceLink/SDLFileManager.m
@@ -395,9 +395,9 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError";
} else {
self.failedFileUploadsCount = [self.class sdl_incrementFailedUploadCountForFileName:file.name failedFileUploadsCount:self.failedFileUploadsCount];
- UInt8 maxRetryCount = [file isKindOfClass:[SDLArtwork class]] ? self.maxArtworkUploadAttempts : self.maxFileUploadAttempts;
- if ([self sdl_canFileBeUploadedAgain:file maxRetryCount:maxRetryCount failedFileUploadsCount:self.failedFileUploadsCount]) {
- SDLLogV(@"Attempting to resend file with name %@ after a failed upload attempt", file.name);
+ UInt8 maxUploadCount = [file isKindOfClass:[SDLArtwork class]] ? self.maxArtworkUploadAttempts : self.maxFileUploadAttempts;
+ if ([self sdl_canFileBeUploadedAgain:file maxUploadCount:maxUploadCount failedFileUploadsCount:self.failedFileUploadsCount]) {
+ SDLLogD(@"Attempting to resend file with name %@ after a failed upload attempt", file.name);
return [self sdl_uploadFile:file completionHandler:handler];
} else {
SDLLogE(@"File named %@ failed to upload. Max number of upload attempts reached", file.name);
@@ -517,15 +517,15 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError";
* Checks if an artwork needs to be uploaded to Core. The arwork should not be sent to Core if the artwork is already on Core or if the artwork is not on Core after the maximum number of repeated upload attempts has been reached.
*
* @param file The file to be uploaded to Core
- * @param maxRetryCount The max number of times the file is allowed to be uploaded to Core
- * @return True if the file still needs to be (re)sent to Core; false if not.
+ * @param maxUploadCount The max number of times the file is allowed to be uploaded to Core
+ * @return True if the file still needs to be (re)sent to Core; false if not.
*/
-- (BOOL)sdl_canFileBeUploadedAgain:(nullable SDLFile *)file maxRetryCount:(UInt8)maxRetryCount failedFileUploadsCount:(NSMutableDictionary<SDLFileName *, NSNumber<SDLUInt> *> *)failedFileUploadsCount {
+- (BOOL)sdl_canFileBeUploadedAgain:(nullable SDLFile *)file maxUploadCount:(UInt8)maxUploadCount failedFileUploadsCount:(NSMutableDictionary<SDLFileName *, NSNumber<SDLUInt> *> *)failedFileUploadsCount {
if (!file || [self hasUploadedFile:file]) {
return NO;
}
- NSNumber *uploadRetryCount = failedFileUploadsCount[file.name];
- return (uploadRetryCount == nil) ? YES : (uploadRetryCount.integerValue < maxRetryCount);
+ NSNumber *failedUploadCount = failedFileUploadsCount[file.name];
+ return (failedUploadCount == nil) ? YES : (failedUploadCount.integerValue < maxUploadCount);
}
/**
@@ -534,10 +534,10 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError";
* @param fileName The name used to upload the file to Core
*/
+ (NSMutableDictionary<SDLFileName *, NSNumber<SDLUInt> *> *)sdl_incrementFailedUploadCountForFileName:(SDLFileName *)fileName failedFileUploadsCount:(NSMutableDictionary<SDLFileName *, NSNumber<SDLUInt> *> *)failedFileUploadsCount {
- NSNumber *currentRetryCount = failedFileUploadsCount[fileName];
- NSNumber *newRetryCount = (currentRetryCount != nil) ? @(currentRetryCount.integerValue + 1) : @1;
- failedFileUploadsCount[fileName] = newRetryCount;
- SDLLogW(@"File with name %@ failed to upload %@ times", fileName, newRetryCount);
+ NSNumber *currentFailedUploadCount = failedFileUploadsCount[fileName];
+ NSNumber *newFailedUploadCount = (currentFailedUploadCount != nil) ? @(currentFailedUploadCount.integerValue + 1) : @1;
+ failedFileUploadsCount[fileName] = newFailedUploadCount;
+ SDLLogW(@"File with name %@ failed to upload %@ times", fileName, newFailedUploadCount);
return failedFileUploadsCount;
}
diff --git a/SmartDeviceLink/SDLFileManagerConfiguration.m b/SmartDeviceLink/SDLFileManagerConfiguration.m
index f2b47060f..4b125feb1 100644
--- a/SmartDeviceLink/SDLFileManagerConfiguration.m
+++ b/SmartDeviceLink/SDLFileManagerConfiguration.m
@@ -19,7 +19,7 @@ static NSUInteger const DefaultRetryCount = 1;
}
- (instancetype)init {
- return [self initWithArtworkRetryCount:0 fileRetryCount:0];
+ return [self.class defaultConfiguration];
}
- (instancetype)initWithArtworkRetryCount:(UInt8)artworkRetryCount fileRetryCount:(UInt8)fileRetryCount {
@@ -38,7 +38,7 @@ static NSUInteger const DefaultRetryCount = 1;
#pragma mark - NSCopying
- (id)copyWithZone:(nullable NSZone *)zone {
- SDLFileManagerConfiguration *new = [[SDLFileManagerConfiguration allocWithZone:zone] initWithArtworkRetryCount:(UInt8)_artworkRetryCount fileRetryCount:(UInt8)_fileRetryCount];
+ SDLFileManagerConfiguration *new = [[SDLFileManagerConfiguration allocWithZone:zone] initWithArtworkRetryCount:_artworkRetryCount fileRetryCount:_fileRetryCount];
return new;
}
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index 47b8a1657..d41f01cf8 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -21,6 +21,7 @@
#import "SDLError.h"
#import "SDLFile.h"
#import "SDLFileManager.h"
+#import "SDLFileManagerConfiguration.h"
#import "SDLLifecycleConfiguration.h"
#import "SDLLifecycleConfigurationUpdate.h"
#import "SDLLockScreenConfiguration.h"
@@ -88,7 +89,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
#pragma mark Lifecycle
- (instancetype)init {
- return [self initWithConfiguration:[SDLConfiguration configurationWithLifecycle:[SDLLifecycleConfiguration defaultConfigurationWithAppName:@"SDL APP" appId:@"001"] lockScreen:[SDLLockScreenConfiguration disabledConfiguration] logging:[SDLLogConfiguration defaultConfiguration]] delegate:nil];
+ return [self initWithConfiguration:[SDLConfiguration configurationWithLifecycle:[SDLLifecycleConfiguration defaultConfigurationWithAppName:@"SDL APP" appId:@"001"] lockScreen:[SDLLockScreenConfiguration disabledConfiguration] logging:[SDLLogConfiguration defaultConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]] delegate:nil];
}
- (instancetype)initWithConfiguration:(SDLConfiguration *)configuration delegate:(nullable id<SDLManagerDelegate>)delegate {
diff --git a/SmartDeviceLink/SDLManager.m b/SmartDeviceLink/SDLManager.m
index e30ae87ea..61d135c9a 100644
--- a/SmartDeviceLink/SDLManager.m
+++ b/SmartDeviceLink/SDLManager.m
@@ -7,6 +7,7 @@
#import "NSMapTable+Subscripting.h"
#import "SDLConfiguration.h"
#import "SDLConnectionManagerType.h"
+#import "SDLFileManagerConfiguration.h"
#import "SDLLifecycleConfiguration.h"
#import "SDLLifecycleManager.h"
#import "SDLLockScreenConfiguration.h"
@@ -39,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark Lifecycle
- (instancetype)init {
- return [self initWithConfiguration:[SDLConfiguration configurationWithLifecycle:[SDLLifecycleConfiguration defaultConfigurationWithAppName:@"SDL APP" appId:@"001"] lockScreen:[SDLLockScreenConfiguration enabledConfiguration] logging:[SDLLogConfiguration defaultConfiguration]] delegate:nil];
+ return [self initWithConfiguration:[SDLConfiguration configurationWithLifecycle:[SDLLifecycleConfiguration defaultConfigurationWithAppName:@"SDL APP" appId:@"001"] lockScreen:[SDLLockScreenConfiguration enabledConfiguration] logging:[SDLLogConfiguration defaultConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]] delegate:nil];
}
- (instancetype)initWithConfiguration:(SDLConfiguration *)configuration delegate:(nullable id<SDLManagerDelegate>)delegate {
diff --git a/SmartDeviceLink/SDLTextAndGraphicManager.m b/SmartDeviceLink/SDLTextAndGraphicManager.m
index 454306556..644200215 100644
--- a/SmartDeviceLink/SDLTextAndGraphicManager.m
+++ b/SmartDeviceLink/SDLTextAndGraphicManager.m
@@ -162,7 +162,7 @@ NS_ASSUME_NONNULL_BEGIN
SDLLogV(@"No images to send, sending text");
// If there are no images to update, just send the text
self.inProgressUpdate = [self sdl_extractTextFromShow:fullShow];
- } else if ([self sdl_artworkAlreadyUploadedOrNonExistent:self.primaryGraphic] && [self sdl_artworkAlreadyUploadedOrNonExistent:self.secondaryGraphic]) {
+ } else if ([self sdl_isArtworkUploadedOrNonExistent:self.primaryGraphic] && [self sdl_isArtworkUploadedOrNonExistent:self.secondaryGraphic]) {
SDLLogV(@"Images already uploaded, sending full update");
// The files to be updated are already uploaded, send the full show immediately
self.inProgressUpdate = fullShow;
@@ -179,7 +179,7 @@ NS_ASSUME_NONNULL_BEGIN
__strong typeof(weakSelf) strongSelf = weakSelf;
if (error != nil) {
- SDLShow *showWithGraphics = [self sdl_createShowWithUploadedImages:self.primaryGraphic secondaryGraphic:self.secondaryGraphic];
+ SDLShow *showWithGraphics = [self sdl_createImageOnlyShowWithPrimaryArtwork:self.primaryGraphic secondaryArtwork:self.secondaryGraphic];
if (showWithGraphics != nil) {
SDLLogW(@"Some images failed to upload. Sending update with the successfully uploaded images");
self.inProgressUpdate = showWithGraphics;
@@ -240,7 +240,7 @@ NS_ASSUME_NONNULL_BEGIN
[self.fileManager uploadArtworks:artworksToUpload completionHandler:^(NSArray<NSString *> * _Nonnull artworkNames, NSError * _Nullable error) {
if (error != nil) {
- SDLLogW(@"Text and graphic manager artwork failed to upload");
+ SDLLogW(@"Text and graphic manager artwork failed to upload with error: %@", error.localizedDescription);
}
handler(error);
@@ -455,10 +455,10 @@ NS_ASSUME_NONNULL_BEGIN
return newShow;
}
-- (nullable SDLShow *)sdl_createShowWithUploadedImages:(nullable SDLArtwork *)primaryGraphic secondaryGraphic:(nullable SDLArtwork *)secondaryGraphic {
+- (nullable SDLShow *)sdl_createImageOnlyShowWithPrimaryArtwork:(nullable SDLArtwork *)primaryArtwork secondaryArtwork:(nullable SDLArtwork *)secondaryArtwork {
SDLShow *newShow = [[SDLShow alloc] init];
- newShow.graphic = [self sdl_artworkAlreadyUploadedOrNonExistent:primaryGraphic] ? [[SDLImage alloc] initWithName:primaryGraphic.name ofType:SDLImageTypeDynamic isTemplate:primaryGraphic.isTemplate] : nil;
- newShow.secondaryGraphic = [self sdl_artworkAlreadyUploadedOrNonExistent:secondaryGraphic] ? [[SDLImage alloc] initWithName:secondaryGraphic.name ofType:SDLImageTypeDynamic isTemplate:secondaryGraphic.isTemplate] : nil;
+ newShow.graphic = [self sdl_isArtworkUploadedOrNonExistent:primaryArtwork] ? [[SDLImage alloc] initWithName:primaryArtwork.name ofType:SDLImageTypeDynamic isTemplate:primaryArtwork.isTemplate] : nil;
+ newShow.secondaryGraphic = [self sdl_isArtworkUploadedOrNonExistent:secondaryArtwork] ? [[SDLImage alloc] initWithName:secondaryArtwork.name ofType:SDLImageTypeDynamic isTemplate:secondaryArtwork.isTemplate] : nil;
if (newShow.graphic == nil && newShow.secondaryGraphic == nil) {
SDLLogV(@"No graphics to upload");
@@ -489,7 +489,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param artwork The artwork to be uploaded to Core
* @return True if the artwork does not need to be uploaded to Core; false if artwork stills needs to be sent to Core.
*/
-- (BOOL)sdl_artworkAlreadyUploadedOrNonExistent:(SDLArtwork *)artwork {
+- (BOOL)sdl_isArtworkUploadedOrNonExistent:(SDLArtwork *)artwork {
return (!artwork || [self.fileManager hasUploadedFile:artwork]);
}
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLCheckChoiceVROptionalOperationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLCheckChoiceVROptionalOperationSpec.m
index 975a4f35e..2809c3871 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLCheckChoiceVROptionalOperationSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLCheckChoiceVROptionalOperationSpec.m
@@ -110,9 +110,9 @@ describe(@"check choice VR optional operation", ^{
});
it(@"should have called the completion handler with proper data", ^{
- expect(hasCalledOperationCompletionHandler).to(beTrue());
- expect(resultVROptional).to(beFalse());
- expect(resultError).to(beNil());
+ expect(hasCalledOperationCompletionHandler).toEventually(beTrue());
+ expect(resultVROptional).toEventually(beFalse());
+ expect(resultError).toEventually(beNil());
});
it(@"should be set to finished", ^{
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
index ffc21f5b1..8a5ea9318 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m
@@ -31,7 +31,7 @@ SDLFileManagerState *const SDLFileManagerStateReady = @"Ready";
@property (assign, nonatomic) UInt8 maxFileUploadAttempts;
@property (assign, nonatomic) UInt8 maxArtworkUploadAttempts;
-- (BOOL)sdl_canFileBeUploadedAgain:(nullable SDLFile *)file maxRetryCount:(int)maxRetryCount failedFileUploadsCount:(NSMutableDictionary<SDLFileName *, NSNumber<SDLUInt> *> *)failedFileUploadsCount;
+- (BOOL)sdl_canFileBeUploadedAgain:(nullable SDLFile *)file maxUploadCount:(int)maxRetryCount failedFileUploadsCount:(NSMutableDictionary<SDLFileName *, NSNumber<SDLUInt> *> *)failedFileUploadsCount;
+ (NSMutableDictionary<SDLFileName *, NSNumber<SDLUInt> *> *)sdl_incrementFailedUploadCountForFileName:(SDLFileName *)fileName failedFileUploadsCount:(NSMutableDictionary<SDLFileName *, NSNumber<SDLUInt> *> *)failedFileUploadsCount;
@end
@@ -1551,12 +1551,12 @@ describe(@"SDLFileManager reupload failed files", ^{
__block TestConnectionManager *testConnectionManager = nil;
__block SDLFileManagerConfiguration *testFileManagerConfiguration = nil;
- it(@"should set the max upload attempts to 1 if the configuration properties are not set", ^{
+ it(@"should set the max upload attempts to 2 if the configuration properties are not set", ^{
testFileManagerConfiguration = [[SDLFileManagerConfiguration alloc] init];
testFileManager = [[SDLFileManager alloc] initWithConnectionManager:testConnectionManager configuration:testFileManagerConfiguration];
- expect(testFileManager.maxFileUploadAttempts).to(equal(1));
- expect(testFileManager.maxArtworkUploadAttempts).to(equal(1));
+ expect(testFileManager.maxFileUploadAttempts).to(equal(2));
+ expect(testFileManager.maxArtworkUploadAttempts).to(equal(2));
});
it(@"should set the max upload attempts to 1 if retry attempts are disabled", ^{
@@ -1621,13 +1621,13 @@ describe(@"SDLFileManager reupload failed files", ^{
describe(@"the file cannot be uploaded again", ^{
it(@"should not upload a file that is nil", ^{
testFile = nil;
- BOOL canUploadAgain = [testFileManager sdl_canFileBeUploadedAgain:testFile maxRetryCount:5 failedFileUploadsCount:testFailedFileUploadsCount];
+ BOOL canUploadAgain = [testFileManager sdl_canFileBeUploadedAgain:testFile maxUploadCount:5 failedFileUploadsCount:testFailedFileUploadsCount];
expect(canUploadAgain).to(equal(NO));
});
it(@"should not upload a file that has already been uploaded the max number of times", ^{
testFailedFileUploadsCount[testFileName] = @4;
- BOOL canUploadAgain = [testFileManager sdl_canFileBeUploadedAgain:testFile maxRetryCount:4 failedFileUploadsCount:testFailedFileUploadsCount];
+ BOOL canUploadAgain = [testFileManager sdl_canFileBeUploadedAgain:testFile maxUploadCount:4 failedFileUploadsCount:testFailedFileUploadsCount];
expect(canUploadAgain).to(equal(NO));
});
});
@@ -1635,13 +1635,13 @@ describe(@"SDLFileManager reupload failed files", ^{
describe(@"the file can be uploaded again", ^{
it(@"should upload a file that has not yet failed to upload", ^{
testFailedFileUploadsCount = [NSMutableDictionary dictionary];
- BOOL canUploadAgain = [testFileManager sdl_canFileBeUploadedAgain:testFile maxRetryCount:2 failedFileUploadsCount:testFailedFileUploadsCount];
+ BOOL canUploadAgain = [testFileManager sdl_canFileBeUploadedAgain:testFile maxUploadCount:2 failedFileUploadsCount:testFailedFileUploadsCount];
expect(canUploadAgain).to(equal(YES));
});
it(@"should upload a file that has not been reuploaded the max number of times", ^{
testFailedFileUploadsCount[testFileName] = @2;
- BOOL canUploadAgain = [testFileManager sdl_canFileBeUploadedAgain:testFile maxRetryCount:4 failedFileUploadsCount:testFailedFileUploadsCount];
+ BOOL canUploadAgain = [testFileManager sdl_canFileBeUploadedAgain:testFile maxUploadCount:4 failedFileUploadsCount:testFailedFileUploadsCount];
expect(canUploadAgain).to(equal(YES));
});
});
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
index acdcb833c..9f3390589 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
@@ -228,6 +228,9 @@ describe(@"a lifecycle manager", ^{
describe(@"in the connected state", ^{
beforeEach(^{
[testManager.lifecycleStateMachine setToState:SDLLifecycleStateConnected fromOldState:nil callEnterTransition:NO];
+
+ // Need to wait state machine transitions to complete before sending RPCs
+ [NSThread sleepForTimeInterval:0.1];
});
describe(@"after receiving a register app interface response", ^{
@@ -286,6 +289,9 @@ describe(@"a lifecycle manager", ^{
testManager.registerResponse = response;
[testManager.lifecycleStateMachine setToState:SDLLifecycleStateSettingUpHMI fromOldState:nil callEnterTransition:YES];
+
+ // Need to wait state machine transitions to complete before sending RPCs
+ [NSThread sleepForTimeInterval:0.1];
expect(@(readyHandlerSuccess)).to(equal(@NO));
expect(readyHandlerError).to(beNil());
@@ -405,6 +411,9 @@ describe(@"a lifecycle manager", ^{
describe(@"in the ready state", ^{
beforeEach(^{
[testManager.lifecycleStateMachine setToState:SDLLifecycleStateReady fromOldState:nil callEnterTransition:NO];
+
+ // Need to wait state machine transitions to complete before sending RPCs
+ [NSThread sleepForTimeInterval:0.1];
});
it(@"can send an RPC", ^{
diff --git a/SmartDeviceLinkTests/SDLFileManagerConfigurationSpec.m b/SmartDeviceLinkTests/SDLFileManagerConfigurationSpec.m
index 04c289e56..5b7742be2 100644
--- a/SmartDeviceLinkTests/SDLFileManagerConfigurationSpec.m
+++ b/SmartDeviceLinkTests/SDLFileManagerConfigurationSpec.m
@@ -25,11 +25,11 @@ describe(@"A file manager configuration", ^{
expect(testConfig.fileRetryCount).to(equal(1));
});
- it(@"should be disabled if not set", ^{
+ it(@"should be set to default configuration if parameters are not set", ^{
testConfig = [[SDLFileManagerConfiguration alloc] init];
- expect(testConfig.artworkRetryCount).to(equal(0));
- expect(testConfig.fileRetryCount).to(equal(0));
+ expect(testConfig.artworkRetryCount).to(equal(1));
+ expect(testConfig.fileRetryCount).to(equal(1));
});
it(@"should instantiate correctly with the default configuration", ^{