From 0d0559198cd93712ae94139af81ec6924c96ee4b Mon Sep 17 00:00:00 2001 From: Ben Copsey Date: Sun, 2 Aug 2009 17:56:13 +0100 Subject: [PATCH] Added proxy tests to iphone test target Remove debugging logs --- Classes/ASIHTTPRequest.m | 2 +- Classes/Tests/ProxyTests.m | 4 ++-- Mac.xcodeproj/project.pbxproj | 2 -- iPhone.xcodeproj/project.pbxproj | 6 ++++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Classes/ASIHTTPRequest.m b/Classes/ASIHTTPRequest.m index 1c3cc7a2..ca1cb59d 100644 --- a/Classes/ASIHTTPRequest.m +++ b/Classes/ASIHTTPRequest.m @@ -1196,7 +1196,7 @@ - (BOOL)applyProxyCredentials:(NSMutableDictionary *)newCredentials [self setProxyAuthenticationRetryCount:[self proxyAuthenticationRetryCount]+1]; if (newCredentials && proxyAuthentication && request) { - NSLog(@"%@",newCredentials); + // Apply whatever credentials we've built up to the old request if (CFHTTPMessageApplyCredentialDictionary(request, proxyAuthentication, (CFMutableDictionaryRef)newCredentials, NULL)) { diff --git a/Classes/Tests/ProxyTests.m b/Classes/Tests/ProxyTests.m index 24875725..e51bb24b 100644 --- a/Classes/Tests/ProxyTests.m +++ b/Classes/Tests/ProxyTests.m @@ -25,7 +25,7 @@ - (void)testAutoConfigureWithPAC ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com"]]; [request setPACurl:[NSURL URLWithString:pacurl]]; [request start]; - NSLog(@"%@",[request proxyHost]); + BOOL success = [[request proxyHost] isEqualToString:@"proxy1.apple.com"]; GHAssertTrue(success,@"Failed to use the correct proxy"); @@ -40,7 +40,7 @@ - (void)testAutoConfigureWithSystemPAC // To run this test, specify the pac script above in your network settings ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com"]]; [request start]; - NSLog(@"%@",[request proxyHost]); + BOOL success = [[request proxyHost] isEqualToString:@"proxy1.apple.com"]; GHAssertTrue(success,@"Failed to use the correct proxy"); diff --git a/Mac.xcodeproj/project.pbxproj b/Mac.xcodeproj/project.pbxproj index 15f3e232..0caab391 100644 --- a/Mac.xcodeproj/project.pbxproj +++ b/Mac.xcodeproj/project.pbxproj @@ -9,7 +9,6 @@ /* Begin PBXBuildFile section */ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; B502441B1025D36B002B13E1 /* ProxyTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B502441A1025D36B002B13E1 /* ProxyTests.m */; }; - B51791291024BF0F00583567 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B51791281024BF0F00583567 /* Security.framework */; }; B51E5F3B100B829D004A300D /* ASIS3BucketObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B51E5F3A100B829D004A300D /* ASIS3BucketObject.m */; }; B51E5F3C100B829D004A300D /* ASIS3BucketObject.m in Sources */ = {isa = PBXBuildFile; fileRef = B51E5F3A100B829D004A300D /* ASIS3BucketObject.m */; }; B51E5F56100B83F7004A300D /* ASIS3ListRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B51E5F55100B83F7004A300D /* ASIS3ListRequest.m */; }; @@ -120,7 +119,6 @@ B55B60140F7659A30064029C /* libz.1.2.3.dylib in Frameworks */, B5B513680FBEE435002C74D0 /* GHUnit.framework in Frameworks */, B53FADE80FF38B2A002E2DE6 /* SystemConfiguration.framework in Frameworks */, - B51791291024BF0F00583567 /* Security.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/iPhone.xcodeproj/project.pbxproj b/iPhone.xcodeproj/project.pbxproj index 2ddbe671..7e13b1ed 100644 --- a/iPhone.xcodeproj/project.pbxproj +++ b/iPhone.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ B522EF78101C795F00A902FC /* RunTests.sh in Resources */ = {isa = PBXBuildFile; fileRef = B522EF72101C795F00A902FC /* RunTests.sh */; }; B522EF79101C795F00A902FC /* GHUnitIPhoneTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = B522EF76101C795F00A902FC /* GHUnitIPhoneTestMain.m */; }; B522EF7A101C795F00A902FC /* libGHUnitIPhone3_0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B522EF77101C795F00A902FC /* libGHUnitIPhone3_0.a */; }; + B5254FF91025F9BF00CF7BC4 /* ProxyTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5254FF71025F9BF00CF7BC4 /* ProxyTests.m */; }; B55B604D0F765A320064029C /* ASIFormDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60460F765A320064029C /* ASIFormDataRequest.m */; }; B55B604E0F765A320064029C /* ASIHTTPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B60480F765A320064029C /* ASIHTTPRequest.m */; }; B55B604F0F765A320064029C /* ASINetworkQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = B55B604A0F765A320064029C /* ASINetworkQueue.m */; }; @@ -77,6 +78,8 @@ B522EF75101C795F00A902FC /* GHTestGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GHTestGroup.h; path = Frameworks/libGHUnitIPhone/GHTestGroup.h; sourceTree = SOURCE_ROOT; }; B522EF76101C795F00A902FC /* GHUnitIPhoneTestMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GHUnitIPhoneTestMain.m; path = Frameworks/libGHUnitIPhone/GHUnitIPhoneTestMain.m; sourceTree = SOURCE_ROOT; }; B522EF77101C795F00A902FC /* libGHUnitIPhone3_0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libGHUnitIPhone3_0.a; path = Frameworks/libGHUnitIPhone/libGHUnitIPhone3_0.a; sourceTree = SOURCE_ROOT; }; + B5254FF71025F9BF00CF7BC4 /* ProxyTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxyTests.m; sourceTree = ""; }; + B5254FF81025F9BF00CF7BC4 /* ProxyTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyTests.h; sourceTree = ""; }; B55B60450F765A320064029C /* ASIFormDataRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIFormDataRequest.h; sourceTree = ""; }; B55B60460F765A320064029C /* ASIFormDataRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIFormDataRequest.m; sourceTree = ""; }; B55B60470F765A320064029C /* ASIHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIHTTPRequest.h; sourceTree = ""; }; @@ -254,6 +257,8 @@ B55B60570F765A3C0064029C /* ASINetworkQueueTests.m */, B5C6663C100A82D7004F3C96 /* ASIS3RequestTests.h */, B5C6663D100A82D7004F3C96 /* ASIS3RequestTests.m */, + B5254FF81025F9BF00CF7BC4 /* ProxyTests.h */, + B5254FF71025F9BF00CF7BC4 /* ProxyTests.m */, ); path = Tests; sourceTree = ""; @@ -409,6 +414,7 @@ B5E2A9AC100C89D900B70E26 /* ASIS3ListRequest.m in Sources */, B522EF79101C795F00A902FC /* GHUnitIPhoneTestMain.m in Sources */, B5652920101C8BD7000499CF /* ASITestCase.m in Sources */, + B5254FF91025F9BF00CF7BC4 /* ProxyTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };