diff --git a/NSDictionary+OTRestRequestSerialization.h b/NSDictionary+OTRestRequestSerialization.h index f6f658a4..33d7aa90 100644 --- a/NSDictionary+OTRestRequestSerialization.h +++ b/NSDictionary+OTRestRequestSerialization.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 7/28/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import diff --git a/NSDictionary+OTRestRequestSerialization.m b/NSDictionary+OTRestRequestSerialization.m index d0c8dbc6..4af19d73 100644 --- a/NSDictionary+OTRestRequestSerialization.m +++ b/NSDictionary+OTRestRequestSerialization.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 7/28/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "NSDictionary+OTRestRequestSerialization.h" diff --git a/OTRestClient.h b/OTRestClient.h index dcfaa610..1778a9ce 100644 --- a/OTRestClient.h +++ b/OTRestClient.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 7/28/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestRequest.h" diff --git a/OTRestClient.m b/OTRestClient.m index 0c600c15..212a3147 100644 --- a/OTRestClient.m +++ b/OTRestClient.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 7/28/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestClient.h" diff --git a/OTRestFramework.xcodeproj/project.pbxproj b/OTRestFramework.xcodeproj/project.pbxproj index f89118c4..c2cf9ff9 100644 --- a/OTRestFramework.xcodeproj/project.pbxproj +++ b/OTRestFramework.xcodeproj/project.pbxproj @@ -35,6 +35,12 @@ 255DE0F410FFAC0A00A85891 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 255DE0F310FFAC0A00A85891 /* SystemConfiguration.framework */; }; 255DE1B110FFB16800A85891 /* OTRestSpecResponseLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 255DE1B010FFB16800A85891 /* OTRestSpecResponseLoader.m */; }; 255DE37810FFC26900A85891 /* OTRestClientSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 255DE37710FFC26900A85891 /* OTRestClientSpec.m */; }; + 255DE43211010EE700A85891 /* OTRestRequestSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 255DE43111010EE700A85891 /* OTRestRequestSpec.m */; }; + 255DE43B11010F8400A85891 /* OTRestResponseSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 255DE43A11010F8400A85891 /* OTRestResponseSpec.m */; }; + 255DE453110112DB00A85891 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 255DE449110112DB00A85891 /* OCMock.framework */; }; + 255DE4931101134300A85891 /* OCMock.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 255DE449110112DB00A85891 /* OCMock.framework */; }; + 255DE62B1104BA2B00A85891 /* OTRestModelMapperSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F6C3AD010FE76C1008F47C5 /* OTRestModelMapperSpec.m */; }; + 255DE62C1104BA2D00A85891 /* OTRestManagedModelSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 255DE03010FF9BDF00A85891 /* OTRestManagedModelSpec.m */; }; 2580B068102E0F1000832D07 /* OTRestModelLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2580B066102E0F1000832D07 /* OTRestModelLoader.h */; }; 2580B069102E0F1000832D07 /* OTRestModelLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2580B067102E0F1000832D07 /* OTRestModelLoader.m */; }; 2580B0C7102E1EBC00832D07 /* libElementParser.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F4E18DB102DD31E00320118 /* libElementParser.a */; }; @@ -127,6 +133,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 255DE3C210FFC86D00A85891 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3F4E18D6102DD31E00320118 /* ElementParser.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 25FCE09E10360372005418A7; + remoteInfo = Tests; + }; 3F4E18DA102DD31E00320118 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 3F4E18D6102DD31E00320118 /* ElementParser.xcodeproj */; @@ -178,6 +191,19 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 255DE48A110112F500A85891 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(BUILT_PRODUCTS_DIR)"; + dstSubfolderSpec = 0; + files = ( + 255DE4931101134300A85891 /* OCMock.framework in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 2525EBE9106961DD0069EBED /* OTRestManagedObjectStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRestManagedObjectStore.h; sourceTree = ""; }; 2525EBEA106961DD0069EBED /* OTRestManagedObjectStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRestManagedObjectStore.m; sourceTree = ""; }; @@ -189,12 +215,16 @@ 255DE05910FF9DA500A85891 /* OTRestModelManagerSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRestModelManagerSpec.m; sourceTree = ""; }; 255DE05C10FFA05800A85891 /* OTHuman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTHuman.h; sourceTree = ""; }; 255DE05D10FFA05800A85891 /* OTHuman.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTHuman.m; sourceTree = ""; }; - 255DE0B610FFA52E00A85891 /* Data Model.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; name = "Data Model.xcdatamodel"; path = "Models/Data Model.xcdatamodel"; sourceTree = ""; }; + 255DE0B610FFA52E00A85891 /* Data Model.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = folder; path = "Data Model.xcdatamodel"; sourceTree = ""; }; 255DE0E110FFABA500A85891 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 255DE0F310FFAC0A00A85891 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 255DE1AF10FFB16800A85891 /* OTRestSpecResponseLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRestSpecResponseLoader.h; sourceTree = ""; }; 255DE1B010FFB16800A85891 /* OTRestSpecResponseLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRestSpecResponseLoader.m; sourceTree = ""; }; 255DE37710FFC26900A85891 /* OTRestClientSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRestClientSpec.m; sourceTree = ""; }; + 255DE43111010EE700A85891 /* OTRestRequestSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRestRequestSpec.m; sourceTree = ""; }; + 255DE43A11010F8400A85891 /* OTRestResponseSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRestResponseSpec.m; sourceTree = ""; }; + 255DE449110112DB00A85891 /* OCMock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OCMock.framework; path = Support/OCMock.framework; sourceTree = ""; }; + 255DE4A4110113B700A85891 /* OTRestSpecEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRestSpecEnvironment.h; sourceTree = ""; }; 2580B066102E0F1000832D07 /* OTRestModelLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRestModelLoader.h; sourceTree = ""; }; 2580B067102E0F1000832D07 /* OTRestModelLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRestModelLoader.m; sourceTree = ""; }; 25FCDDD91035BC85005418A7 /* OTRestManagedModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRestManagedModel.h; sourceTree = ""; }; @@ -298,6 +328,7 @@ 3F6C3A9610FE7524008F47C5 /* UIKit.framework in Frameworks */, 255DE0E210FFABA500A85891 /* CoreData.framework in Frameworks */, 255DE0F410FFAC0A00A85891 /* SystemConfiguration.framework in Frameworks */, + 255DE453110112DB00A85891 /* OCMock.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -356,6 +387,7 @@ 255DE05B10FFA04200A85891 /* Models */ = { isa = PBXGroup; children = ( + 255DE0B610FFA52E00A85891 /* Data Model.xcdatamodel */, 255DE05C10FFA05800A85891 /* OTHuman.h */, 255DE05D10FFA05800A85891 /* OTHuman.m */, 3F032A7710FFB89100F35142 /* OTCat.h */, @@ -373,10 +405,20 @@ children = ( 255DE1AF10FFB16800A85891 /* OTRestSpecResponseLoader.h */, 255DE1B010FFB16800A85891 /* OTRestSpecResponseLoader.m */, + 255DE4A4110113B700A85891 /* OTRestSpecEnvironment.h */, ); path = Support; sourceTree = ""; }; + 255DE43011010ED400A85891 /* Core */ = { + isa = PBXGroup; + children = ( + 255DE43111010EE700A85891 /* OTRestRequestSpec.m */, + 255DE43A11010F8400A85891 /* OTRestResponseSpec.m */, + ); + name = Core; + sourceTree = ""; + }; 2580B1AA102F72D700832D07 /* Dependencies */ = { isa = PBXGroup; children = ( @@ -457,6 +499,7 @@ isa = PBXGroup; children = ( 3F4E18DB102DD31E00320118 /* libElementParser.a */, + 255DE3C310FFC86D00A85891 /* Tests.octest */, ); name = Products; sourceTree = ""; @@ -498,14 +541,15 @@ 3F6C3A9210FE750E008F47C5 /* Specs */ = { isa = PBXGroup; children = ( + 255DE43011010ED400A85891 /* Core */, 255DE0A110FFA43A00A85891 /* Support */, 255DE05B10FFA04200A85891 /* Models */, 3F6C3AD010FE76C1008F47C5 /* OTRestModelMapperSpec.m */, 255DE03010FF9BDF00A85891 /* OTRestManagedModelSpec.m */, 255DE05910FF9DA500A85891 /* OTRestModelManagerSpec.m */, 3F6C3A9310FE7519008F47C5 /* main.m */, - 255DE0B610FFA52E00A85891 /* Data Model.xcdatamodel */, 255DE37710FFC26900A85891 /* OTRestClientSpec.m */, + 255DE449110112DB00A85891 /* OCMock.framework */, ); path = Specs; sourceTree = ""; @@ -623,6 +667,7 @@ 3F6C39A210FE5C95008F47C5 /* Sources */, 3F6C39A310FE5C95008F47C5 /* Frameworks */, 255DE2B810FFBFBF00A85891 /* ShellScript */, + 255DE48A110112F500A85891 /* CopyFiles */, ); buildRules = ( ); @@ -684,6 +729,13 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + 255DE3C310FFC86D00A85891 /* Tests.octest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = Tests.octest; + remoteRef = 255DE3C210FFC86D00A85891 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 3F4E18DB102DD31E00320118 /* libElementParser.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -815,6 +867,10 @@ 3F032AA810FFBBCD00F35142 /* OTHouse.m in Sources */, 3F032AAB10FFBC1F00F35142 /* OTResident.m in Sources */, 255DE37810FFC26900A85891 /* OTRestClientSpec.m in Sources */, + 255DE43211010EE700A85891 /* OTRestRequestSpec.m in Sources */, + 255DE43B11010F8400A85891 /* OTRestResponseSpec.m in Sources */, + 255DE62B1104BA2B00A85891 /* OTRestModelMapperSpec.m in Sources */, + 255DE62C1104BA2D00A85891 /* OTRestManagedModelSpec.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1008,6 +1064,10 @@ BUILD_STYLE = Debug; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/Specs/Support\"", + ); GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -1035,6 +1095,10 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/Specs/Support\"", + ); GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h"; diff --git a/OTRestManagedModel.h b/OTRestManagedModel.h index b3cae586..73b81c18 100644 --- a/OTRestManagedModel.h +++ b/OTRestManagedModel.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/14/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import diff --git a/OTRestManagedModel.m b/OTRestManagedModel.m index ae519548..04ab0b24 100644 --- a/OTRestManagedModel.m +++ b/OTRestManagedModel.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/14/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestManagedModel.h" diff --git a/OTRestManagedObjectStore.h b/OTRestManagedObjectStore.h index 9d3d2b49..3d71d1c0 100644 --- a/OTRestManagedObjectStore.h +++ b/OTRestManagedObjectStore.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 9/22/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import diff --git a/OTRestManagedObjectStore.m b/OTRestManagedObjectStore.m index 1c383862..f16f994a 100644 --- a/OTRestManagedObjectStore.m +++ b/OTRestManagedObjectStore.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 9/22/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestManagedObjectStore.h" diff --git a/OTRestModelLoader.h b/OTRestModelLoader.h index ea87d39b..badca19f 100644 --- a/OTRestModelLoader.h +++ b/OTRestModelLoader.h @@ -3,15 +3,33 @@ // OTRestFramework // // Created by Blake Watters on 8/8/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import #import "OTRestModelMapper.h" +@class OTRestRequest; +@class OTRestResponse; + +@protocol OTRestModelLoaderDelegate + +/** + * Invoked when a request sent through the model manager encounters an error. The model will be nil if the request was + * not dispatched with a model object instance + */ +- (void)modelLoaderRequest:(OTRestRequest*)request didFailWithError:(NSError*)error response:(OTRestResponse*)response model:(id)model; + +/** + * Invoked when a request sent through the model manager returns an error message from the server. + */ +- (void)modelLoaderRequest:(OTRestRequest*)request didReturnErrorMessage:(NSString*)errorMessage response:(OTRestResponse*)response model:(id)model; + +@end + @interface OTRestModelLoader : NSObject { OTRestModelMapper* _mapper; - id _delegate; + NSObject* _delegate; SEL _callback; } diff --git a/OTRestModelLoader.m b/OTRestModelLoader.m index 094aba01..fe4fdd0a 100644 --- a/OTRestModelLoader.m +++ b/OTRestModelLoader.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/8/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestModelLoader.h" @@ -29,16 +29,46 @@ return @selector(loadModelsFromResponse:); } +- (BOOL)processResponse:(OTRestResponse*)response { + NSString* errorMessage; + OTRestRequest* request = response.request; + if ([response isFailure]) { + [_delegate modelLoaderRequest:response.request didFailWithError:response.failureError response:response model:(id)request.userData]; + return YES; + } else if ([response isClientError]) { + if ([response isXML]) { + errorMessage = [[(Element*)[response payloadXMLDocument] selectElement:@"error"] contentsText]; + } else if ([response isJSON]) { + // TODO - Need to test!!! + errorMessage = [[response payloadJSONDictionary] objectForKey:@"error"]; + } + if (nil == errorMessage) { + errorMessage = [response payloadString]; + } + [_delegate modelLoaderRequest:response.request didReturnErrorMessage:errorMessage response:response model:(id)request.userData]; + return YES; + } else if ([response isServerError]) { + errorMessage = [response payloadString]; + [_delegate modelLoaderRequest:response.request didReturnErrorMessage:errorMessage response:response model:(id)request.userData]; + return YES; + } + + return NO; +} + - (void)loadModelFromResponse:(OTRestResponse*)response { - NSLog(@"Attempting to build model from response: %@", [response payloadString]); - // TODO: This needs to handle errors!!! - id model = [_mapper buildModelFromString:[response payloadString]]; - [_delegate performSelector:self.callback withObject:model]; + if (NO == [self processResponse:response] && [response isSuccessful]) { + id model = [_mapper buildModelFromString:[response payloadString]]; + [_delegate performSelector:self.callback withObject:model]; + } + // TODO - What do we do??? } - (void)loadModelsFromResponse:(OTRestResponse*)response { - NSArray* models = [_mapper buildModelsFromString:[response payloadString]]; - [_delegate performSelector:self.callback withObject:models]; + if (NO == [self processResponse:response] && [response isSuccessful]) { + NSArray* models = [_mapper buildModelsFromString:[response payloadString]]; + [_delegate performSelector:self.callback withObject:models]; + } } @end diff --git a/OTRestModelManager.h b/OTRestModelManager.h index d2697a33..4863c634 100644 --- a/OTRestModelManager.h +++ b/OTRestModelManager.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Jeremy Ellison on 8/14/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestModelMapper.h" diff --git a/OTRestModelManager.m b/OTRestModelManager.m index bd844970..37b001c7 100644 --- a/OTRestModelManager.m +++ b/OTRestModelManager.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Jeremy Ellison on 8/14/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestModelManager.h" @@ -69,7 +69,7 @@ static OTRestModelManager* sharedManager = nil; - (void)registerModel:(Class)class forElementNamed:(NSString*)elementName { [_mapper registerModel:class forElementNamed:elementName]; } - + /** * Load a model from a restful resource and invoke the callback */ diff --git a/OTRestModelMappableProtocol.h b/OTRestModelMappableProtocol.h index 27f36dc8..4fdfce73 100644 --- a/OTRestModelMappableProtocol.h +++ b/OTRestModelMappableProtocol.h @@ -3,7 +3,7 @@ * OTRestFramework * * Created by Blake Watters on 8/14/09. - * Copyright 2009 Objective 3. All rights reserved. + * Copyright 2009 Two Toasters. All rights reserved. * */ @@ -46,6 +46,16 @@ */ - (NSString*)resourcePath; +/** + * The path to the RESTful resource collection this object belongs to. i.e. /books + */ +- (NSString*)collectionPath; + +/** + * The path to the RESTful resource this object represents. i.e. /books/1 + */ +- (NSString*)memberPath; + /** * Must return the put/post params for the instance */ diff --git a/OTRestModelMapper.h b/OTRestModelMapper.h index 1ed60206..14bad006 100644 --- a/OTRestModelMapper.h +++ b/OTRestModelMapper.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/14/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import diff --git a/OTRestModelMapper.m b/OTRestModelMapper.m index 9848ac73..10c3e2ad 100644 --- a/OTRestModelMapper.m +++ b/OTRestModelMapper.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/14/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // // #import diff --git a/OTRestModelMapperTest.h b/OTRestModelMapperTest.h index 14fc6ede..7fffe762 100644 --- a/OTRestModelMapperTest.h +++ b/OTRestModelMapperTest.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Jeremy Ellison on 8/17/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // // See Also: http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/135-Unit_Testing_Applications/unit_testing_applications.html diff --git a/OTRestModelMapperTest.m b/OTRestModelMapperTest.m index 35df83da..91180738 100644 --- a/OTRestModelMapperTest.m +++ b/OTRestModelMapperTest.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Jeremy Ellison on 8/17/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestModelMapperTest.h" diff --git a/OTRestModelMapper_Private.h b/OTRestModelMapper_Private.h index e89361aa..72c9ffe2 100644 --- a/OTRestModelMapper_Private.h +++ b/OTRestModelMapper_Private.h @@ -3,7 +3,7 @@ * OTRestFramework * * Created by Jeremy Ellison on 8/18/09. - * Copyright 2009 Objective3. All rights reserved. + * Copyright 2009 Two Toasters. All rights reserved. * */ diff --git a/OTRestNotifications.h b/OTRestNotifications.h index ca82e2ba..87c30de2 100644 --- a/OTRestNotifications.h +++ b/OTRestNotifications.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 9/24/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import diff --git a/OTRestNotifications.m b/OTRestNotifications.m index 51fe1074..40e439fa 100644 --- a/OTRestNotifications.m +++ b/OTRestNotifications.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 9/24/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestNotifications.h" diff --git a/OTRestParams.h b/OTRestParams.h index cd274714..91ce17f7 100644 --- a/OTRestParams.h +++ b/OTRestParams.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/3/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import diff --git a/OTRestParams.m b/OTRestParams.m index 1f7299e5..ff43f20d 100644 --- a/OTRestParams.m +++ b/OTRestParams.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/3/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestParams.h" diff --git a/OTRestParamsAttachment.h b/OTRestParamsAttachment.h index b86fb561..f5eacb4c 100644 --- a/OTRestParamsAttachment.h +++ b/OTRestParamsAttachment.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/6/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import diff --git a/OTRestParamsAttachment.m b/OTRestParamsAttachment.m index 55a03a86..56aca7f6 100644 --- a/OTRestParamsAttachment.m +++ b/OTRestParamsAttachment.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/6/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestParamsAttachment.h" diff --git a/OTRestParamsDataAttachment.h b/OTRestParamsDataAttachment.h index c1689607..86762d85 100644 --- a/OTRestParamsDataAttachment.h +++ b/OTRestParamsDataAttachment.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/6/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestParamsAttachment.h" diff --git a/OTRestParamsDataAttachment.m b/OTRestParamsDataAttachment.m index 839f8891..97efd05d 100644 --- a/OTRestParamsDataAttachment.m +++ b/OTRestParamsDataAttachment.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/6/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestParamsDataAttachment.h" diff --git a/OTRestParamsFileAttachment.h b/OTRestParamsFileAttachment.h index b91ccf72..4528b429 100644 --- a/OTRestParamsFileAttachment.h +++ b/OTRestParamsFileAttachment.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/6/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestParamsAttachment.h" diff --git a/OTRestParamsFileAttachment.m b/OTRestParamsFileAttachment.m index 5abfa73b..da725f20 100644 --- a/OTRestParamsFileAttachment.m +++ b/OTRestParamsFileAttachment.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/6/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestParamsFileAttachment.h" diff --git a/OTRestRequest.h b/OTRestRequest.h index c8b44c73..776ba71f 100644 --- a/OTRestRequest.h +++ b/OTRestRequest.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Jeremy Ellison on 7/27/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import @@ -17,6 +17,7 @@ NSObject* _params; id _delegate; SEL _callback; + id _userData; } @property(nonatomic, readonly) NSURL* URL; @@ -41,6 +42,11 @@ */ @property(nonatomic, assign) SEL callback; +/** + * An opaque pointer to associate user defined data with the request. + */ +@property(nonatomic, assign) id userData; + /** * A Dictionary of additional HTTP Headers to send with the request */ diff --git a/OTRestRequest.m b/OTRestRequest.m index ef792620..205718bc 100644 --- a/OTRestRequest.m +++ b/OTRestRequest.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Jeremy Ellison on 7/27/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestRequest.h" @@ -14,7 +14,7 @@ @implementation OTRestRequest @synthesize URL = _URL, URLRequest = _URLRequest, delegate = _delegate, callback = _callback, additionalHTTPHeaders = _additionalHTTPHeaders, - params = _params; + params = _params, userData = _userData; + (OTRestRequest*)requestWithURL:(NSURL*)URL delegate:(id)delegate callback:(SEL)callback { OTRestRequest* request = [[OTRestRequest alloc] initWithURL:URL delegate:delegate callback:callback]; diff --git a/OTRestRequestSerializable.h b/OTRestRequestSerializable.h index 12d4a2b6..2d421409 100644 --- a/OTRestRequestSerializable.h +++ b/OTRestRequestSerializable.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 8/3/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // /* diff --git a/OTRestResponse.h b/OTRestResponse.h index 65fc8bce..7bad8d9f 100644 --- a/OTRestResponse.h +++ b/OTRestResponse.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 7/28/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import @@ -14,7 +14,7 @@ OTRestRequest* _request; NSHTTPURLResponse* _httpURLResponse; NSMutableData* _payload; - NSError* _error; + NSError* _failureError; } /** @@ -48,9 +48,9 @@ @property(nonatomic, readonly) NSData* payload; /** - * The error returned if the url connection fails + * The error returned if the URL connection fails */ -@property(nonatomic, readonly) NSError* error; +@property(nonatomic, readonly) NSError* failureError; /** @@ -74,10 +74,109 @@ - (DocumentRoot*)payloadXMLDocument; /** - * Will determine if there is an error object and use it's localized message - * or - * take the first element out of the returned document. + * Parse the response into a dictionary from JSON */ -- (NSString*)errorDescription; +- (NSDictionary*)payloadJSONDictionary; + +/** + * Will determine if there is an error object and use it's localized message + */ +- (NSString*)failureErrorDescription; + +/** + * Indicates that the connection failed to reach the remote server. The details of the failure + * are available on the failureError reader. + */ +- (BOOL)isFailure; + +/** + * Indicates an invalid HTTP response code less than 100 or greater than 600 + */ +- (BOOL)isInvalid; + +/** + * Indicates an HTTP response code between 100 and 199 + */ +- (BOOL)isInformational; + +/** + * Indicates an HTTP response code between 200 and 299 + */ +- (BOOL)isSuccessful; + +/** + * Indicates an HTTP response code between 300 and 399 + */ +- (BOOL)isRedirection; + +/** + * Indicates an HTTP response code between 400 and 499 + */ +- (BOOL)isClientError; + +/** + * Indicates an HTTP response code between 500 and 599 + */ +- (BOOL)isServerError; + +/** + * Indicates that the response is either a server or a client error + */ +- (BOOL)isError; + +/** + * Indicates an HTTP response code of 200 + */ +- (BOOL)isOK; + +/** + * Indicates an HTTP response code of 201 + */ +- (BOOL)isCreated; + +/** + * Indicates an HTTP response code of 403 + */ +- (BOOL)isForbidden; + +/** + * Indicates an HTTP response code of 404 + */ +- (BOOL)isNotFound; + +/** + * Indicates an HTTP response code of 301, 302, 303 or 307 + */ +- (BOOL)isRedirect; + +/** + * Indicates an empty HTTP response code of 201, 204, or 304 + */ +- (BOOL)isEmpty; + +/** + * Returns the value of 'Content-Type' HTTP header + */ +- (NSString*)contentType; + +/** + * Returns the value of the 'Content-Length' HTTP header + */ +- (NSString*)contentLength; + +/** + * Returns the value of the 'Location' HTTP Header + */ +- (NSString*)location; + +/** + * True when the server turned an XML response (MIME type is application/xml) + */ +- (BOOL)isXML; + +/** + * True when the server turned an XML response (MIME type is application/json) + */ +- (BOOL)isJSON; @end diff --git a/OTRestResponse.m b/OTRestResponse.m index 60186f1e..8fd5b5b8 100644 --- a/OTRestResponse.m +++ b/OTRestResponse.m @@ -3,20 +3,21 @@ // OTRestFramework // // Created by Blake Watters on 7/28/09. -// Copyright 2009 Objective 3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "OTRestResponse.h" #import "OTRestNotifications.h" +#import "SBJSON.h" @implementation OTRestResponse -@synthesize payload = _payload, request = _request, error = _error; +@synthesize payload = _payload, request = _request, failureError = _failureError; - (id)init { if (self = [super init]) { _payload = [[NSMutableData alloc] init]; - _error = nil; + _failureError = nil; } return self; @@ -33,7 +34,7 @@ [_httpURLResponse release]; [_payload release]; [_request release]; - [_error release]; + [_failureError release]; [super dealloc]; } @@ -54,7 +55,7 @@ } - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { - _error = [error retain]; + _failureError = [error retain]; [[_request delegate] performSelector:[_request callback] withObject:self]; } @@ -70,18 +71,16 @@ return [DocumentRoot parseXML:[self payloadString]]; } -- (NSString*)errorDescription { - NSString* desc; - if (_error != nil) { - desc = [_error localizedDescription]; +- (NSDictionary*)payloadJSONDictionary { + return [[[[SBJSON alloc] init] autorelease] objectWithString:[self payloadString]]; +} + +- (NSString*)failureErrorDescription { + if ([self isFailure]) { + return [_failureError localizedDescription]; } else { - NSString* contentsText = [[(Element*)[self payloadXMLDocument] selectElement:@"error"] contentsText]; - if (contentsText == nil) { - contentsText = @""; - } - desc = [NSString stringWithFormat:@"#%d %@", [self statusCode], contentsText]; + return nil; } - return desc; } - (NSURL*)URL { @@ -100,4 +99,80 @@ return [_httpURLResponse allHeaderFields]; } +- (BOOL)isFailure { + return (nil != _failureError); +} + +- (BOOL)isInvalid { + return ([self statusCode] < 100 || [self statusCode] > 600); +} + +- (BOOL)isInformational { + return ([self statusCode] >= 100 && [self statusCode] < 200); +} + +- (BOOL)isSuccessful { + return ([self statusCode] >= 200 && [self statusCode] < 300); +} + +- (BOOL)isRedirection { + return ([self statusCode] >= 300 && [self statusCode] < 400); +} + +- (BOOL)isClientError { + return ([self statusCode] >= 400 && [self statusCode] < 500); +} + +- (BOOL)isServerError { + return ([self statusCode] >= 500 && [self statusCode] < 600); +} + +- (BOOL)isError { + return ([self isClientError] || [self isServerError]); +} + +- (BOOL)isOK { + return ([self statusCode] == 200); +} + +- (BOOL)isCreated { + return ([self statusCode] == 201); +} + +- (BOOL)isForbidden { + return ([self statusCode] == 403); +} + +- (BOOL)isNotFound { + return ([self statusCode] == 404); +} + +- (BOOL)isRedirect { + return ([self statusCode] == 301 || [self statusCode] == 302 || [self statusCode] == 303 || [self statusCode] == 307); +} + +- (BOOL)isEmpty { + return ([self statusCode] == 201 || [self statusCode] == 204 || [self statusCode] == 304); +} + +- (NSString*)contentType { + return ([[self allHeaderFields] objectForKey:@"Content-Type"]); +} + +- (NSString*)contentLength { + return ([[self allHeaderFields] objectForKey:@"Content-Length"]); +} + +- (NSString*)location { + return ([[self allHeaderFields] objectForKey:@"Location"]); +} + +- (BOOL)isXML { + return [[self contentType] isEqualToString:@"application/xml"]; +} + +- (BOOL)isJSON { + return [[self contentType] isEqualToString:@"application/json"]; +} + @end diff --git a/Specs/Models/OTHuman.h b/Specs/Models/OTHuman.h index 2fb66bc3..c51248a8 100644 --- a/Specs/Models/OTHuman.h +++ b/Specs/Models/OTHuman.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 1/14/10. -// Copyright 2010 Objective 3. All rights reserved. +// Copyright 2010 Two Toasters. All rights reserved. // #import "OTRestManagedModel.h" diff --git a/Specs/Models/OTHuman.m b/Specs/Models/OTHuman.m index 3b04a496..75f52bc4 100644 --- a/Specs/Models/OTHuman.m +++ b/Specs/Models/OTHuman.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 1/14/10. -// Copyright 2010 Objective 3. All rights reserved. +// Copyright 2010 Two Toasters. All rights reserved. // #import "OTHuman.h" diff --git a/Specs/OTRestClientSpec.m b/Specs/OTRestClientSpec.m index ef1df01b..1e557c9a 100644 --- a/Specs/OTRestClientSpec.m +++ b/Specs/OTRestClientSpec.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 1/14/10. -// Copyright 2010 Objective 3. All rights reserved. +// Copyright 2010 Two Toasters. All rights reserved. // diff --git a/Specs/OTRestManagedModelSpec.m b/Specs/OTRestManagedModelSpec.m index ef7c11be..ec779651 100644 --- a/Specs/OTRestManagedModelSpec.m +++ b/Specs/OTRestManagedModelSpec.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 1/14/10. -// Copyright 2010 Objective 3. All rights reserved. +// Copyright 2010 Two Toasters. All rights reserved. // @@ -11,7 +11,7 @@ #import "dsl/UIExpectation.h" #import "OTRestModelManager.h" -#import "Human.h" +#import "OTHuman.h" @interface OTRestManagedModelSpec : NSObject { diff --git a/Specs/OTRestModelManagerSpec.m b/Specs/OTRestModelManagerSpec.m index 091883aa..cb4180fd 100644 --- a/Specs/OTRestModelManagerSpec.m +++ b/Specs/OTRestModelManagerSpec.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 1/14/10. -// Copyright 2010 Objective 3. All rights reserved. +// Copyright 2010 Two Toasters. All rights reserved. // #import "UISpec.h" @@ -28,36 +28,9 @@ _modelManager = [OTRestModelManager managerWithBaseURL:localBaseURL]; _modelManager.objectStore = [[OTRestManagedObjectStore alloc] initWithStoreFilename:@"OTRest_Specs.sqlite"]; [_modelManager registerModel:[OTHuman class] forElementNamed:@"human"]; - // TODO: Set the accept header... - _responseLoader = [[OTRestSpecResponseLoader alloc] init]; } -- (void)itShouldLoadAHuman { - NSLog(@"Model Manager: %@", _modelManager); - NSLog(@"Response Loader: %@", _responseLoader); - OTRestRequest* request = [_modelManager loadModel:@"/humans/1" delegate:_responseLoader callback:@selector(loadResponse:)]; - NSLog(@"Request: %@", request); - [_responseLoader waitForResponse]; - OTHuman* blake = (OTHuman*) _responseLoader.response; - [expectThat(blake.name) should:be(@"Blake Watters")]; -} - -- (void)itShouldLoadAllHumans { - OTRestRequest* request = [_modelManager loadModels:@"/humans" delegate:_responseLoader callback:@selector(loadResponse:)]; - NSLog(@"Request: %@", request); - [_responseLoader waitForResponse]; - NSArray* humans = (NSArray*) _responseLoader.response; - [expectThat([humans count]) should:be(4)]; - [expectThat([[humans objectAtIndex:0] class]) should:be([OTHuman class])]; -} - -- (void)itShouldLoadHumansInPages { -} - -- (void)itShouldHandleConnectionFailures { -} - - (void)itShouldDefaultToAnXMLMappingFormat { [expectThat(_modelManager.format) should:be(OTRestMappingFormatXML)]; } @@ -69,4 +42,30 @@ [expectThat([_modelManager.client.HTTPHeaders valueForKey:@"Accept"]) should:be(@"application/json")]; } +- (void)itShouldHandleConnectionFailures { + NSString* localBaseURL = [NSString stringWithFormat:@"http://%s:3001", getenv("OTREST_IP_ADDRESS")]; + OTRestModelManager* modelManager = [OTRestModelManager managerWithBaseURL:localBaseURL]; + [modelManager loadModel:@"/humans/1" delegate:_responseLoader callback:@selector(loadResponse:)]; + [_responseLoader waitForResponse]; + [expectThat(_responseLoader.success) should:be(NO)]; +} + +- (void)itShouldLoadAHuman { + [_modelManager loadModel:@"/humans/1" delegate:_responseLoader callback:@selector(loadResponse:)]; + [_responseLoader waitForResponse]; + OTHuman* blake = (OTHuman*) _responseLoader.response; + [expectThat(blake.name) should:be(@"Blake Watters")]; +} + +- (void)itShouldLoadAllHumans { + [_modelManager loadModels:@"/humans" delegate:_responseLoader callback:@selector(loadResponse:)]; + [_responseLoader waitForResponse]; + NSArray* humans = (NSArray*) _responseLoader.response; + [expectThat([humans count]) should:be(4)]; + [expectThat([[humans objectAtIndex:0] class]) should:be([OTHuman class])]; +} + +- (void)itShouldLoadHumansInPages { +} + @end diff --git a/Specs/OTRestModelMapperSpec.m b/Specs/OTRestModelMapperSpec.m index 9cffe6c2..64f6aeb2 100644 --- a/Specs/OTRestModelMapperSpec.m +++ b/Specs/OTRestModelMapperSpec.m @@ -3,7 +3,7 @@ // Cash Register // // Created by Jeremy Ellison on 12/8/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // diff --git a/Specs/Support/OTRestSpecResponseLoader.h b/Specs/Support/OTRestSpecResponseLoader.h index 17723116..bf0cdba0 100644 --- a/Specs/Support/OTRestSpecResponseLoader.h +++ b/Specs/Support/OTRestSpecResponseLoader.h @@ -3,20 +3,32 @@ // OTRestFramework // // Created by Blake Watters on 1/14/10. -// Copyright 2010 Objective 3. All rights reserved. +// Copyright 2010 Two Toasters. All rights reserved. // #import +#import "OTRestModelLoader.h" - -@interface OTRestSpecResponseLoader : NSObject { +@interface OTRestSpecResponseLoader : NSObject { BOOL _awaitingResponse; + BOOL _success; id _response; + NSError* _failureError; + NSString* _errorMessage; } // The object that was loaded from the web request @property (nonatomic, readonly) id response; +// True when the response is success +@property (nonatomic, readonly) BOOL success; + +// The error that was returned from a failure to connect +@property (nonatomic, readonly) NSError* failureError; + +// The error message returned by the server +@property (nonatomic, readonly) NSString* errorMessage; + // Wait for a response to load - (void)waitForResponse; - (void)loadResponse:(id)response; diff --git a/Specs/Support/OTRestSpecResponseLoader.m b/Specs/Support/OTRestSpecResponseLoader.m index b62f1967..2548e766 100644 --- a/Specs/Support/OTRestSpecResponseLoader.m +++ b/Specs/Support/OTRestSpecResponseLoader.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Blake Watters on 1/14/10. -// Copyright 2010 Objective 3. All rights reserved. +// Copyright 2010 Two Toasters. All rights reserved. // #import "OTRestSpecResponseLoader.h" @@ -12,9 +12,14 @@ @implementation OTRestSpecResponseLoader @synthesize response = _response; +@synthesize failureError = _failureError; +@synthesize errorMessage = _errorMessage; +@synthesize success = _success; - (void)dealloc { [_response release]; + [_failureError release]; + [_errorMessage release]; [super dealloc]; } @@ -30,6 +35,19 @@ NSLog(@"The response: %@", response); _response = [response retain]; _awaitingResponse = NO; + _success = YES; +} + +- (void)modelLoaderRequest:(OTRestRequest*)request didFailWithError:(NSError*)error response:(OTRestResponse*)response model:(id)model { + _awaitingResponse = NO; + _success = NO; + _failureError = [error retain]; +} + +- (void)modelLoaderRequest:(OTRestRequest*)request didReturnErrorMessage:(NSString*)errorMessage response:(OTRestResponse*)response model:(id)model { + _awaitingResponse = NO; + _success = NO; + _errorMessage = [errorMessage retain]; } @end diff --git a/Specs/Support/set_ip_address.scpt b/Specs/Support/set_ip_address.scpt index 14ae5808..d8c2a6d0 100644 Binary files a/Specs/Support/set_ip_address.scpt and b/Specs/Support/set_ip_address.scpt differ diff --git a/Specs/main.m b/Specs/main.m index 2c86dc5f..a9553df1 100644 --- a/Specs/main.m +++ b/Specs/main.m @@ -3,7 +3,7 @@ // Cash Register // // Created by Jeremy Ellison on 12/7/09. -// Copyright Objective3 2009. All rights reserved. +// Copyright Two Toasters 2009. All rights reserved. // #import diff --git a/TestSerialization.h b/TestSerialization.h index 4e0c53e3..0edf3946 100644 --- a/TestSerialization.h +++ b/TestSerialization.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Jeremy Ellison on 8/17/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import diff --git a/TestSerialization.m b/TestSerialization.m index 0342b4c8..a31826c1 100644 --- a/TestSerialization.m +++ b/TestSerialization.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Jeremy Ellison on 8/17/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "TestSerialization.h" diff --git a/TestSerializationAssociation.h b/TestSerializationAssociation.h index 9c3a324b..95b02394 100644 --- a/TestSerializationAssociation.h +++ b/TestSerializationAssociation.h @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Jeremy Ellison on 8/17/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import diff --git a/TestSerializationAssociation.m b/TestSerializationAssociation.m index bc7f6ee3..631ef984 100644 --- a/TestSerializationAssociation.m +++ b/TestSerializationAssociation.m @@ -3,7 +3,7 @@ // OTRestFramework // // Created by Jeremy Ellison on 8/17/09. -// Copyright 2009 Objective3. All rights reserved. +// Copyright 2009 Two Toasters. All rights reserved. // #import "TestSerializationAssociation.h"