diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2015-05-05 15:52:01 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2015-05-05 15:52:01 -0230 |
commit | b61582b1c6b16be4339aa0bded3ad8f542a01df9 (patch) | |
tree | 2040386a942217e2412e48c1e56465817ecac3d5 /objective-c/test | |
parent | Missing export declarations (diff) | |
download | ice-b61582b1c6b16be4339aa0bded3ad8f542a01df9.tar.bz2 ice-b61582b1c6b16be4339aa0bded3ad8f542a01df9.tar.xz ice-b61582b1c6b16be4339aa0bded3ad8f542a01df9.zip |
ICE-6471 Add support for IceSSL endpoint/connection info to Python/Ruby/PHP
Diffstat (limited to 'objective-c/test')
-rw-r--r-- | objective-c/test/Ice/info/AllTests.m | 24 | ||||
-rw-r--r-- | objective-c/test/Ice/info/TestI.m | 12 |
2 files changed, 30 insertions, 6 deletions
diff --git a/objective-c/test/Ice/info/AllTests.m b/objective-c/test/Ice/info/AllTests.m index c4f290e5693..b2eb99227f7 100644 --- a/objective-c/test/Ice/info/AllTests.m +++ b/objective-c/test/Ice/info/AllTests.m @@ -171,13 +171,25 @@ infoAllTests(id<ICECommunicator> communicator) test([[ctx objectForKey:@"remotePort"] intValue] == info.localPort); test([[ctx objectForKey:@"localPort"] intValue] == info.remotePort); - if([info isKindOfClass:[ICEWSConnectionInfo class]]) + if([info isKindOfClass:[ICEWSConnectionInfo class]] || [info isKindOfClass:[ICESSLWSSConnectionInfo class]]) { - ICEWSConnectionInfo* wsinfo = (ICEWSConnectionInfo*)info; - test([[wsinfo.headers objectForKey:@"Upgrade"] isEqualToString:@"websocket"]); - test([[wsinfo.headers objectForKey:@"Connection"] isEqualToString:@"Upgrade"]); - test([[wsinfo.headers objectForKey:@"Sec-WebSocket-Protocol"] isEqualToString:@"ice.zeroc.com"]); - test([wsinfo.headers objectForKey:@"Sec-WebSocket-Accept"] != nil); + ICEHeaderDict* headers; + if([info isKindOfClass:[ICEWSConnectionInfo class]]) + { + ICEWSConnectionInfo* wsinfo = (ICEWSConnectionInfo*)info; + headers = wsinfo.headers; + } + + if([info isKindOfClass:[ICESSLWSSConnectionInfo class]]) + { + ICESSLWSSConnectionInfo* wssinfo = (ICESSLWSSConnectionInfo*)info; + headers = wssinfo.headers; + } + + test([[headers objectForKey:@"Upgrade"] isEqualToString:@"websocket"]); + test([[headers objectForKey:@"Connection"] isEqualToString:@"Upgrade"]); + test([[headers objectForKey:@"Sec-WebSocket-Protocol"] isEqualToString:@"ice.zeroc.com"]); + test([headers objectForKey:@"Sec-WebSocket-Accept"] != nil); test([[ctx objectForKey:@"ws.Upgrade"] isEqualToString:@"websocket"]); test([[ctx objectForKey:@"ws.Connection"] isEqualToString:@"Upgrade"]); diff --git a/objective-c/test/Ice/info/TestI.m b/objective-c/test/Ice/info/TestI.m index cbc6a257664..9c4fb5895a5 100644 --- a/objective-c/test/Ice/info/TestI.m +++ b/objective-c/test/Ice/info/TestI.m @@ -8,6 +8,7 @@ // ********************************************************************** #import <objc/Ice.h> +#import <objc/IceSSL.h> #import <info/TestI.h> #import <TestCommon.h> @@ -50,11 +51,13 @@ ICEConnectionInfo* info = [[current con] getInfo]; ICEMutableContext* ctx = [ICEMutableContext dictionaryWithObject:[info adapterName] forKey:@"adapterName"]; [ctx setObject:info.incoming ? @"true" : @"false" forKey:@"incoming"]; + ICEIPConnectionInfo* ipinfo = (ICEIPConnectionInfo*)info; [ctx setObject:ipinfo.localAddress forKey:@"localAddress"]; [ctx setObject:[NSString stringWithFormat:@"%d", ipinfo.localPort] forKey:@"localPort"]; [ctx setObject:ipinfo.remoteAddress forKey:@"remoteAddress"]; [ctx setObject:[NSString stringWithFormat:@"%d", ipinfo.remotePort] forKey:@"remotePort"]; + if([info isKindOfClass:[ICEWSConnectionInfo class]]) { ICEWSConnectionInfo* wsinfo = (ICEWSConnectionInfo*)info; @@ -63,6 +66,15 @@ [ctx setObject:[wsinfo.headers objectForKey:key] forKey:[NSString stringWithFormat:@"ws.%@", key]]; } } + + if([info isKindOfClass:[ICESSLWSSConnectionInfo class]]) + { + ICESSLWSSConnectionInfo* wssinfo = (ICESSLWSSConnectionInfo*)info; + for(NSString* key in wssinfo.headers) + { + [ctx setObject:[wssinfo.headers objectForKey:key] forKey:[NSString stringWithFormat:@"ws.%@", key]]; + } + } return ctx; } @end |