<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -7,10 +7,21 @@
 //
 
 #import &lt;SenTestingKit/SenTestingKit.h&gt;
+#import &quot;Person.h&quot;
 
 
 @interface ActiveObjectTestCase : SenTestCase {
 
 }
 
+
+- (void)setup;
+- (void)teardown;
+- (Person *)newPerson;
+- (void)comparePerson:(Person *)person1 withPerson:(Person *)person2;
+- (void)testSaveAndFind;
+- (void)testCount;
+- (void)testRemove;
+
+
 @end</diff>
      <filename>ActiveObjectTestCase.h</filename>
    </modified>
    <modified>
      <diff>@@ -11,19 +11,196 @@
 
 @implementation ActiveObjectTestCase
 
+- (void)setup {
+	[Person openDatabase];
+}
+
+- (void)teardown {
+	[Person closeDatabase];
+}
+
+
+- (Person *)newPerson {
+	Person *person = [[[Person alloc] init] autorelease];
+	person.birthdate = [[NSDate alloc]init];
+	int random = [person.birthdate timeIntervalSince1970];
+	person.age =  random % 30;
+	person.rank = random % 20;
+	person.votes = random % 10;
+	person.sex = 'M';
+	person.name = [NSString stringWithFormat:@&quot;Joe #%d&quot;, random % 1000];
+	person.income = random % 3000;
+	person.active = TRUE;
+	person.flags = random % 30 + 0.5;
+	person.rating = [NSNumber numberWithInt:20.5];	
+	return person;
+}
+
+- (void)comparePerson:(Person *)person1 withPerson:(Person *)person2 {
+	if (person1.age != person2.age) {
+		NSLog(@&quot;unexpected age %d&quot;, person2.age);
+	}
+	
+	if ([person1.birthdate timeIntervalSince1970] != [person2.birthdate timeIntervalSince1970]) {
+		NSLog(@&quot;unexpected birthdate %@  --- %d / %d&quot;, person1.birthdate, [person1.birthdate timeIntervalSince1970], [person2.birthdate timeIntervalSince1970]);
+	}
+	
+	if (person1.rank != person2.rank) {
+		NSLog(@&quot;unexpected age %d&quot;, person2.rank);
+	}
+	if (person1.votes != person2.votes) {
+		NSLog(@&quot;unexpected votes %d&quot;, person2.votes);
+	}
+	if (person1.sex != person2.sex) {
+		NSLog(@&quot;unexpected sex %c&quot;, person2.sex);
+	}
+	if (![person1.name isEqualToString: person2.name]) {
+		NSLog(@&quot;unexpected name %@&quot;, person2.name);
+	}
+	if (person1.income != person2.income) {
+		NSLog(@&quot;unexpected votes %f&quot;, person2.income);
+	}
+	if (person1.active != person2.active) {
+		NSLog(@&quot;unexpected active %d&quot;, person2.active);
+	}
+	if (person1.flags != person2.flags) {
+		NSLog(@&quot;unexpected flags %f&quot;, person2.flags);
+	}
+	if ([person1.rating intValue] != [person2.rating intValue]) {
+		NSLog(@&quot;unexpected rating %@&quot;, person2.rating);
+	}
+}
+
+
+- (void)testSaveAndFind {
+	/*
+	[Person removeAll];
+	
+	Person *person1 = [self newPerson];
+	[person1 save];
+	
+	Person *person2 = (Person *) [Person findByPrimaryKey:person1.objectId];
+	[self comparePerson:person1 withPerson:person2];
+	 */
+}
+
+
+- (void)testUpdateAndFind {
+	/*
+	[Person removeAll];
+	
+	Person *person = [self newPerson];
+	[person save];
+	
+	int count = [Person countAll];
+	if (count != 1) {
+		NSLog(@&quot;unexpected count %d&quot;, count);
+	}
+	
+	NSNumber *oldId = person.objectId;
+	
+	[person save];
+	if (person.objectId != oldId) {
+		NSLog(@&quot;unexpected object id %@&quot;, person.objectId);
+	}
+	count = [Person countAll];
+	if (count != 1) {
+		NSLog(@&quot;unexpected count %d&quot;, count);
+	}
+	*/
+}
+
+
+
+- (void)testSaveAndFindAll {
+	/*
+	[Person removeAll];
+	
+	Person *person1 = [self newPerson];
+	[person1 save];
+	
+	Person *person2 = [self newPerson];
+	[person2 save];
+	
+	Person *person3 = [self newPerson];
+	[person3 save];
+	
+	NSArray* persons = [Person findAll];
+	if ([persons count] != 3) {
+		NSLog(@&quot;count not 3 %d&quot;, [persons count]);
+	}
+	
+	if (![persons containsObject:person1]) {
+		NSLog(@&quot;count not 3 %d&quot;, [persons count]);
+	}
+	
+	if (![persons containsObject:person2]) {
+		NSLog(@&quot;count not 3 %d&quot;, [persons count]);
+	}
+	
+	if (![persons containsObject:person3]) {
+		NSLog(@&quot;count not 3 %d&quot;, [persons count]);
+	}
+	*/
+}
+
+
+- (void)testCount {
+	/*
+	[Person removeAll];
+	
+	Person *person1 = [self newPerson];
+	[person1 save];
+	
+	Person *person2 = [self newPerson];
+	[person2 save];
+	
+	NSDictionary *criteria = [NSDictionary dictionaryWithObjectsAndKeys:person1.objectId, @&quot;objectId&quot;, nil];	
+	int count = [Person countWithCriteria:criteria];
+	if (count != 1) {
+		NSLog(@&quot;unexpected count %d&quot;, count);
+	}
+	count = [Person countAll];
+	if (count != 2) {
+		NSLog(@&quot;unexpected count %d&quot;, count);
+	}
+	 */
+}
+
 
-- (void)testTestFramework
-{
-    NSString *string1 = @&quot;test&quot;;
-    NSString *string2 = @&quot;test&quot;;
-    STAssertEquals(string1,
-                   string2,
-                   @&quot;FAILURE&quot;);
-    NSUInteger uint_1 = 4;
-    NSUInteger uint_2 = 4;
-    STAssertEquals(uint_1,
-                   uint_2,
-                   @&quot;FAILURE&quot;);
+- (void)testRemove {
+	/*
+	[Person removeAll];
+	
+	Person *person1 = [self newPerson];
+	[person1 save];
+	
+	int count = [Person countAll];
+	if (count != 1) {
+		NSLog(@&quot;unexpected count %d&quot;, count);
+	}
+	
+	
+	NSLog(@&quot;find all %@\n\n&quot;, [Person findAll]);
+	
+	Person *person2 = (Person *) [Person findByPrimaryKey:person1.objectId];
+	
+	count = [Person removeWithCriteria: [[[NSDictionary alloc] initWithObjectsAndKeys:person1.objectId, @&quot;objectId&quot;, nil] autorelease]];
+	if (count != 1) {
+		NSLog(@&quot;unexpected count %d&quot;, count);
+	}
+	
+	@try {
+		person2 = (Person *) [Person findByPrimaryKey:person1.objectId];
+		if (person2 != nil) {
+			NSLog(@&quot;unexpected person %@&quot;, person2);
+		}		
+	} 
+	@catch (NSException *e) {
+	} 
+	@finally {
+	}
+	 */
 }
 
 </diff>
      <filename>ActiveObjectTestCase.m</filename>
    </modified>
    <modified>
      <diff>@@ -18,15 +18,14 @@
 		8F5D31860FE42BF40078D92A /* IntrospectHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D317D0FE42BF40078D92A /* IntrospectHelper.m */; };
 		8F5D31870FE42BF40078D92A /* SqliteHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F5D317E0FE42BF40078D92A /* SqliteHelper.h */; };
 		8F5D31880FE42BF40078D92A /* SqliteHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D317F0FE42BF40078D92A /* SqliteHelper.m */; };
-		8F5D31E70FE432910078D92A /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F5D31E60FE432910078D92A /* SenTestingKit.framework */; };
-		8F5D31E80FE432910078D92A /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F5D31E60FE432910078D92A /* SenTestingKit.framework */; };
-		8F5D32980FE44AA90078D92A /* ActiveObjectTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D32810FE43E820078D92A /* ActiveObjectTest.m */; };
-		8F5D32990FE44AAA0078D92A /* ActiveObjectTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D32810FE43E820078D92A /* ActiveObjectTest.m */; };
-		8F5D329B0FE44AC10078D92A /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D327E0FE43E3E0078D92A /* Person.m */; };
-		8F5D329C0FE44AC20078D92A /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D327E0FE43E3E0078D92A /* Person.m */; };
-		8F5D329E0FE44AD60078D92A /* ActiveObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D317B0FE42BF40078D92A /* ActiveObject.m */; };
-		8F5D329F0FE44ADF0078D92A /* IntrospectHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D317D0FE42BF40078D92A /* IntrospectHelper.m */; };
-		8F5D32A00FE44AE40078D92A /* SqliteHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D317F0FE42BF40078D92A /* SqliteHelper.m */; };
+		F7B3AC780FEAF8B400171A94 /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D327E0FE43E3E0078D92A /* Person.m */; };
+		F7B3AC790FEAF8C100171A94 /* ActiveObjectTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D32810FE43E820078D92A /* ActiveObjectTest.m */; };
+		F7B3AC7B0FEAF8ED00171A94 /* ActiveObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D317B0FE42BF40078D92A /* ActiveObject.m */; };
+		F7B3AC7C0FEAF8F900171A94 /* IntrospectHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D317D0FE42BF40078D92A /* IntrospectHelper.m */; };
+		F7B3AC7D0FEAF90000171A94 /* SqliteHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F5D317F0FE42BF40078D92A /* SqliteHelper.m */; };
+		F7B3AC7F0FEAF91300171A94 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F5D31E60FE432910078D92A /* SenTestingKit.framework */; };
+		F7B3AC800FEAF91700171A94 /* libsqlite3.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F5D31750FE42B9B0078D92A /* libsqlite3.0.dylib */; };
+		F7B3AC810FEAF91B00171A94 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F5D31710FE42AE70078D92A /* Foundation.framework */; };
 		F7D33F8D0FE9F42900F315AC /* ActiveObjectTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D33F8C0FE9F42900F315AC /* ActiveObjectTestCase.m */; };
 /* End PBXBuildFile section */
 
@@ -42,7 +41,7 @@
 			isa = PBXContainerItemProxy;
 			containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
 			proxyType = 1;
-			remoteGlobalIDString = F7D33F700FE9F11A00F315AC /* Test Suite */;
+			remoteGlobalIDString = F7D33F700FE9F11A00F315AC;
 			remoteInfo = &quot;Test Suite&quot;;
 		};
 /* End PBXContainerItemProxy section */
@@ -79,7 +78,6 @@
 			files = (
 				8F5D31720FE42AE70078D92A /* Foundation.framework in Frameworks */,
 				8F5D31760FE42B9B0078D92A /* libsqlite3.0.dylib in Frameworks */,
-				8F5D31E70FE432910078D92A /* SenTestingKit.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -89,7 +87,6 @@
 			files = (
 				8F5D31730FE42AE70078D92A /* Foundation.framework in Frameworks */,
 				8F5D31770FE42B9B0078D92A /* libsqlite3.0.dylib in Frameworks */,
-				8F5D31E80FE432910078D92A /* SenTestingKit.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -97,6 +94,9 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				F7B3AC7F0FEAF91300171A94 /* SenTestingKit.framework in Frameworks */,
+				F7B3AC800FEAF91700171A94 /* libsqlite3.0.dylib in Frameworks */,
+				F7B3AC810FEAF91B00171A94 /* Foundation.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -308,11 +308,6 @@
 			buildActionMask = 2147483647;
 			files = (
 				1D60589B0D05DD56006BFB54 /* main.m in Sources */,
-				8F5D32990FE44AAA0078D92A /* ActiveObjectTest.m in Sources */,
-				8F5D329C0FE44AC20078D92A /* Person.m in Sources */,
-				8F5D329E0FE44AD60078D92A /* ActiveObject.m in Sources */,
-				8F5D329F0FE44ADF0078D92A /* IntrospectHelper.m in Sources */,
-				8F5D32A00FE44AE40078D92A /* SqliteHelper.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -323,8 +318,6 @@
 				8F5D31840FE42BF40078D92A /* ActiveObject.m in Sources */,
 				8F5D31860FE42BF40078D92A /* IntrospectHelper.m in Sources */,
 				8F5D31880FE42BF40078D92A /* SqliteHelper.m in Sources */,
-				8F5D32980FE44AA90078D92A /* ActiveObjectTest.m in Sources */,
-				8F5D329B0FE44AC10078D92A /* Person.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -333,6 +326,11 @@
 			buildActionMask = 2147483647;
 			files = (
 				F7D33F8D0FE9F42900F315AC /* ActiveObjectTestCase.m in Sources */,
+				F7B3AC780FEAF8B400171A94 /* Person.m in Sources */,
+				F7B3AC790FEAF8C100171A94 /* ActiveObjectTest.m in Sources */,
+				F7B3AC7B0FEAF8ED00171A94 /* ActiveObject.m in Sources */,
+				F7B3AC7C0FEAF8F900171A94 /* IntrospectHelper.m in Sources */,
+				F7B3AC7D0FEAF90000171A94 /* SqliteHelper.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -452,7 +450,10 @@
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				COPY_PHASE_STRIP = NO;
-				FRAMEWORK_SEARCH_PATHS = &quot;$(DEVELOPER_LIBRARY_DIR)/Frameworks&quot;;
+				FRAMEWORK_SEARCH_PATHS = (
+					&quot;$(DEVELOPER_LIBRARY_DIR)/Frameworks&quot;,
+					&quot;\&quot;$(SDKROOT)$(DEVELOPER_FRAMEWORKS_DIR)\&quot;&quot;,
+				);
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_FIX_AND_CONTINUE = NO;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -480,7 +481,10 @@
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				COPY_PHASE_STRIP = YES;
 				DEBUG_INFORMATION_FORMAT = &quot;dwarf-with-dsym&quot;;
-				FRAMEWORK_SEARCH_PATHS = &quot;$(DEVELOPER_LIBRARY_DIR)/Frameworks&quot;;
+				FRAMEWORK_SEARCH_PATHS = (
+					&quot;$(DEVELOPER_LIBRARY_DIR)/Frameworks&quot;,
+					&quot;\&quot;$(SDKROOT)$(DEVELOPER_FRAMEWORKS_DIR)\&quot;&quot;,
+				);
 				GCC_ENABLE_FIX_AND_CONTINUE = NO;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_MODEL_TUNING = G5;</diff>
      <filename>OCActiveObjects.xcodeproj/project.pbxproj</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/categories.pbxbtree</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/cdecls.pbxbtree</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/decls.pbxbtree</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/files.pbxbtree</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/imports.pbxbtree</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/pbxindex.header</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/protocols.pbxbtree</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/refs.pbxbtree</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/strings.pbxstrings/control</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/strings.pbxstrings/strings</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/subclasses.pbxbtree</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>build/OCActiveObjects.build/OCActiveObjects.pbxindex/symbols0.pbxsymbols</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,7 @@
 int main(int argc, char *argv[]) {
     
     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+	/*
 	ActiveObjectTest *test = [[[ActiveObjectTest alloc] init] autorelease];
 	[test setup];
 	[test testSaveAndFind];
@@ -24,6 +25,7 @@ int main(int argc, char *argv[]) {
 	[test setup];
 	[test testRemove];
 	[test teardown];
+	 */
 	NSLog(@&quot;ALL DONE&quot;);
     [pool release];
     return 0;</diff>
      <filename>main.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>25ecf77f628e6c315cb0223dbccf9b129ebcc5e9</id>
    </parent>
  </parents>
  <author>
    <name>Shahzad Bhatti</name>
    <email>bhatti@plexobject.com</email>
  </author>
  <url>http://github.com/bhatti/OCActiveObjects/commit/739f14a0b5924cdefe6634355013a18ffbf6f6fd</url>
  <id>739f14a0b5924cdefe6634355013a18ffbf6f6fd</id>
  <committed-date>2009-06-18T15:39:51-07:00</committed-date>
  <authored-date>2009-06-18T15:39:51-07:00</authored-date>
  <message>added test case</message>
  <tree>ed4f5126af42b2f085b6503b595c64c6bfef20e6</tree>
  <committer>
    <name>Shahzad Bhatti</name>
    <email>bhatti@plexobject.com</email>
  </committer>
</commit>
