summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2017-02-16 14:43:01 -0800
committerMuller, Alexander (A.) <amulle19@ford.com>2017-02-16 14:43:01 -0800
commit4af40893805080df90d462f78375d31f7a43042f (patch)
tree499dbd745c3f992147c88f4096cb9f4f8d5b71c6
parente59b4153baee836f974fbc3953434c81aae9ef9e (diff)
downloadsdl_ios-4af40893805080df90d462f78375d31f7a43042f.tar.gz
Updated SDLLifecycleManager tests to include checking for SDLStreamingMediaManager.
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/project.pbxproj3
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.h2
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m1
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m11
4 files changed, 11 insertions, 6 deletions
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
index 2908d727d..c4c4a86ec 100644
--- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
+++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
@@ -4154,7 +4154,6 @@
TargetAttributes = {
5D4019AE1A76EC350006B0C2 = {
CreatedOnToolsVersion = 6.1.1;
- DevelopmentTeam = ACNGAAM3M7;
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 1;
@@ -5000,7 +4999,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
- DEVELOPMENT_TEAM = ACNGAAM3M7;
INFOPLIST_FILE = "$(SRCROOT)/SmartDeviceLink_Example/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -5014,7 +5012,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
- DEVELOPMENT_TEAM = ACNGAAM3M7;
INFOPLIST_FILE = "$(SRCROOT)/SmartDeviceLink_Example/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
diff --git a/SmartDeviceLink/SDLLifecycleManager.h b/SmartDeviceLink/SDLLifecycleManager.h
index 7d7c3d2e1..11fff2ec6 100644
--- a/SmartDeviceLink/SDLLifecycleManager.h
+++ b/SmartDeviceLink/SDLLifecycleManager.h
@@ -57,7 +57,7 @@ typedef void (^SDLManagerReadyBlock)(BOOL success, NSError *_Nullable error);
@property (strong, nonatomic) SDLFileManager *fileManager;
@property (strong, nonatomic) SDLPermissionManager *permissionManager;
-@property (strong, nonatomic, readonly, nullable) SDLStreamingMediaManager *streamManager;
+@property (strong, nonatomic, nullable) SDLStreamingMediaManager *streamManager;
@property (strong, nonatomic) SDLLockScreenManager *lockScreenManager;
@property (strong, nonatomic, readonly) SDLNotificationDispatcher *notificationDispatcher;
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index c8b50590e..5e059567c 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -63,7 +63,6 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
@property (strong, nonatomic, readwrite) SDLNotificationDispatcher *notificationDispatcher;
@property (strong, nonatomic, readwrite) SDLResponseDispatcher *responseDispatcher;
@property (strong, nonatomic, readwrite) SDLStateMachine *lifecycleStateMachine;
-@property (strong, nonatomic, readwrite) SDLStreamingMediaManager* streamManager;
// Private properties
@property (copy, nonatomic) SDLManagerReadyBlock readyHandler;
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
index 8b0a276d4..873ec62f7 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
@@ -19,6 +19,7 @@
#import "SDLPermissionManager.h"
#import "SDLProxy.h"
#import "SDLProxyFactory.h"
+#import "SDLProtocol.h"
#import "SDLRegisterAppInterface.h"
#import "SDLRegisterAppInterfaceResponse.h"
#import "SDLResult.h"
@@ -61,23 +62,28 @@ describe(@"a lifecycle manager", ^{
__block SDLConfiguration *testConfig = nil;
__block id managerDelegateMock = OCMProtocolMock(@protocol(SDLManagerDelegate));
+ __block id protocolMock = OCMClassMock([SDLAbstractProtocol class]);
__block id proxyBuilderClassMock = OCMStrictClassMock([SDLProxyFactory class]);
__block id proxyMock = OCMClassMock([SDLProxy class]);
__block id lockScreenManagerMock = OCMClassMock([SDLLockScreenManager class]);
__block id fileManagerMock = OCMClassMock([SDLFileManager class]);
__block id permissionManagerMock = OCMClassMock([SDLPermissionManager class]);
+ __block id streamingManagerMock = OCMClassMock([SDLStreamingMediaManager class]);
beforeEach(^{
OCMStub([proxyBuilderClassMock buildSDLProxyWithListener:[OCMArg any]]).andReturn(proxyMock);
+ OCMStub([(SDLProxy*)proxyMock protocol]).andReturn(protocolMock);
SDLLifecycleConfiguration *testLifecycleConfig = [SDLLifecycleConfiguration defaultConfigurationWithAppName:@"Test App" appId:@"Test Id"];
testLifecycleConfig.shortAppName = @"Short Name";
+ testLifecycleConfig.appType = SDLAppHMITypeNavigation;
testConfig = [SDLConfiguration configurationWithLifecycle:testLifecycleConfig lockScreen:[SDLLockScreenConfiguration disabledConfiguration]];
testManager = [[SDLLifecycleManager alloc] initWithConfiguration:testConfig delegate:managerDelegateMock];
testManager.lockScreenManager = lockScreenManagerMock;
testManager.fileManager = fileManagerMock;
testManager.permissionManager = permissionManagerMock;
+ testManager.streamManager = streamingManagerMock;
});
it(@"should initialize properties", ^{
@@ -87,7 +93,7 @@ describe(@"a lifecycle manager", ^{
expect(@(testManager.lastCorrelationId)).to(equal(@0));
expect(testManager.fileManager).toNot(beNil());
expect(testManager.permissionManager).toNot(beNil());
- expect(testManager.streamManager).to(beNil());
+ expect(testManager.streamManager).toNot(beNil());
expect(testManager.proxy).to(beNil());
expect(testManager.registerResponse).to(beNil());
expect(testManager.lockScreenManager).toNot(beNil());
@@ -222,11 +228,13 @@ describe(@"a lifecycle manager", ^{
describe(@"after receiving a register app interface response", ^{
__block NSError *fileManagerStartError = [NSError errorWithDomain:@"testDomain" code:0 userInfo:nil];
__block NSError *permissionManagerStartError = [NSError errorWithDomain:@"testDomain" code:0 userInfo:nil];
+ __block NSError *streamingManagerStartError = [NSError errorWithDomain:@"testDomain" code:0 userInfo:nil];
beforeEach(^{
OCMStub([(SDLLockScreenManager *)lockScreenManagerMock start]);
OCMStub([fileManagerMock startWithCompletionHandler:([OCMArg invokeBlockWithArgs:@(YES), fileManagerStartError, nil])]);
OCMStub([permissionManagerMock startWithCompletionHandler:([OCMArg invokeBlockWithArgs:@(YES), permissionManagerStartError, nil])]);
+ OCMStub([streamingManagerMock startWithProtocol:protocolMock completionHandler:([OCMArg invokeBlockWithArgs:@(YES), streamingManagerStartError, nil])]);
// Send an RAI response to move the lifecycle forward
[testManager.lifecycleStateMachine transitionToState:SDLLifecycleStateRegistered];
@@ -238,6 +246,7 @@ describe(@"a lifecycle manager", ^{
OCMVerify([(SDLLockScreenManager *)lockScreenManagerMock start]);
OCMVerify([fileManagerMock startWithCompletionHandler:[OCMArg any]]);
OCMVerify([permissionManagerMock startWithCompletionHandler:[OCMArg any]]);
+ OCMVerify([streamingManagerMock startWithProtocol:[OCMArg any] completionHandler:[OCMArg any]]);
});
itBehavesLike(@"unable to send an RPC", ^{ return @{ @"manager": testManager }; });