Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Implemented empty Couchbase Mobile app.

  • Loading branch information...
commit cae895ef3d56017aa2dc91e5ae941e3ef9223b9d 1 parent fe2dfab
@snej snej authored
View
7 .gitignore
@@ -0,0 +1,7 @@
+.DS_Store
+*.pbxuser
+*.perspectivev3
+*.mode1v3
+xcuserdata/
+build/
+Frameworks/
View
60 Empty App.xcodeproj/project.pbxproj
@@ -18,6 +18,15 @@
27B28FC014314FB900B86F18 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27B28FA714314FB800B86F18 /* Foundation.framework */; };
27B28FC814314FB900B86F18 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 27B28FC614314FB900B86F18 /* InfoPlist.strings */; };
27B28FCB14314FB900B86F18 /* Empty_AppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B28FCA14314FB900B86F18 /* Empty_AppTests.m */; };
+ 27B28FD91431516600B86F18 /* Couchbase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27B28FD81431516600B86F18 /* Couchbase.framework */; };
+ 27B28FDA1431516600B86F18 /* Couchbase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27B28FD81431516600B86F18 /* Couchbase.framework */; };
+ 27B28FDC1431517600B86F18 /* CouchCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27B28FDB1431517600B86F18 /* CouchCocoa.framework */; };
+ 27B28FDD1431517600B86F18 /* CouchCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27B28FDB1431517600B86F18 /* CouchCocoa.framework */; };
+ 27B28FDF1431549200B86F18 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27B28FDE1431549200B86F18 /* Security.framework */; };
+ 27B28FE11431549E00B86F18 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 27B28FE01431549E00B86F18 /* libz.dylib */; };
+ 27B28FE3143154B700B86F18 /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 27B28FE2143154B700B86F18 /* libstdc++.dylib */; };
+ 27B28FEB1431552800B86F18 /* CouchbaseResources in Resources */ = {isa = PBXBuildFile; fileRef = 27B28FEA1431552800B86F18 /* CouchbaseResources */; };
+ 27B28FFD14315D7700B86F18 /* CouchTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B28FFC14315D7600B86F18 /* CouchTestCase.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -35,18 +44,25 @@
27B28FA514314FB800B86F18 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
27B28FA714314FB800B86F18 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
27B28FA914314FB800B86F18 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- 27B28FAD14314FB800B86F18 /* Empty App-Info.plist */ = {isa = PBXFileReference; path = "Empty App-Info.plist"; sourceTree = "<group>"; };
+ 27B28FAD14314FB800B86F18 /* Empty App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Empty App-Info.plist"; sourceTree = "<group>"; };
27B28FAF14314FB800B86F18 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
27B28FB114314FB800B86F18 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- 27B28FB314314FB800B86F18 /* Empty App-Prefix.pch */ = {isa = PBXFileReference; path = "Empty App-Prefix.pch"; sourceTree = "<group>"; };
- 27B28FB414314FB800B86F18 /* AppDelegate.h */ = {isa = PBXFileReference; path = AppDelegate.h; sourceTree = "<group>"; };
+ 27B28FB314314FB800B86F18 /* Empty App-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Empty App-Prefix.pch"; sourceTree = "<group>"; };
+ 27B28FB414314FB800B86F18 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
27B28FB514314FB800B86F18 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
27B28FBC14314FB900B86F18 /* Empty AppTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Empty AppTests.octest"; sourceTree = BUILT_PRODUCTS_DIR; };
27B28FBD14314FB900B86F18 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
- 27B28FC514314FB900B86F18 /* Empty AppTests-Info.plist */ = {isa = PBXFileReference; path = "Empty AppTests-Info.plist"; sourceTree = "<group>"; };
+ 27B28FC514314FB900B86F18 /* Empty AppTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Empty AppTests-Info.plist"; sourceTree = "<group>"; };
27B28FC714314FB900B86F18 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- 27B28FC914314FB900B86F18 /* Empty_AppTests.h */ = {isa = PBXFileReference; path = Empty_AppTests.h; sourceTree = "<group>"; };
27B28FCA14314FB900B86F18 /* Empty_AppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Empty_AppTests.m; sourceTree = "<group>"; };
+ 27B28FD81431516600B86F18 /* Couchbase.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Couchbase.framework; path = Frameworks/Couchbase.framework; sourceTree = "<group>"; };
+ 27B28FDB1431517600B86F18 /* CouchCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CouchCocoa.framework; path = Frameworks/CouchCocoa.framework; sourceTree = "<group>"; };
+ 27B28FDE1431549200B86F18 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
+ 27B28FE01431549E00B86F18 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
+ 27B28FE2143154B700B86F18 /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "usr/lib/libstdc++.dylib"; sourceTree = SDKROOT; };
+ 27B28FEA1431552800B86F18 /* CouchbaseResources */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CouchbaseResources; path = Frameworks/Couchbase.framework/CouchbaseResources; sourceTree = SOURCE_ROOT; };
+ 27B28FFB14315D7600B86F18 /* CouchTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CouchTestCase.h; sourceTree = "<group>"; };
+ 27B28FFC14315D7600B86F18 /* CouchTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CouchTestCase.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -57,6 +73,11 @@
27B28FA614314FB800B86F18 /* UIKit.framework in Frameworks */,
27B28FA814314FB800B86F18 /* Foundation.framework in Frameworks */,
27B28FAA14314FB800B86F18 /* CoreGraphics.framework in Frameworks */,
+ 27B28FDC1431517600B86F18 /* CouchCocoa.framework in Frameworks */,
+ 27B28FD91431516600B86F18 /* Couchbase.framework in Frameworks */,
+ 27B28FDF1431549200B86F18 /* Security.framework in Frameworks */,
+ 27B28FE3143154B700B86F18 /* libstdc++.dylib in Frameworks */,
+ 27B28FE11431549E00B86F18 /* libz.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -67,6 +88,8 @@
27B28FBE14314FB900B86F18 /* SenTestingKit.framework in Frameworks */,
27B28FBF14314FB900B86F18 /* UIKit.framework in Frameworks */,
27B28FC014314FB900B86F18 /* Foundation.framework in Frameworks */,
+ 27B28FDA1431516600B86F18 /* Couchbase.framework in Frameworks */,
+ 27B28FDD1431517600B86F18 /* CouchCocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -99,6 +122,11 @@
27B28FA714314FB800B86F18 /* Foundation.framework */,
27B28FA914314FB800B86F18 /* CoreGraphics.framework */,
27B28FBD14314FB900B86F18 /* SenTestingKit.framework */,
+ 27B28FD81431516600B86F18 /* Couchbase.framework */,
+ 27B28FDB1431517600B86F18 /* CouchCocoa.framework */,
+ 27B28FE2143154B700B86F18 /* libstdc++.dylib */,
+ 27B28FE01431549E00B86F18 /* libz.dylib */,
+ 27B28FDE1431549200B86F18 /* Security.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -120,6 +148,7 @@
27B28FAE14314FB800B86F18 /* InfoPlist.strings */,
27B28FB114314FB800B86F18 /* main.m */,
27B28FB314314FB800B86F18 /* Empty App-Prefix.pch */,
+ 27B28FEA1431552800B86F18 /* CouchbaseResources */,
);
name = "Supporting Files";
sourceTree = "<group>";
@@ -127,8 +156,9 @@
27B28FC314314FB900B86F18 /* Empty AppTests */ = {
isa = PBXGroup;
children = (
- 27B28FC914314FB900B86F18 /* Empty_AppTests.h */,
27B28FCA14314FB900B86F18 /* Empty_AppTests.m */,
+ 27B28FFB14315D7600B86F18 /* CouchTestCase.h */,
+ 27B28FFC14315D7600B86F18 /* CouchTestCase.m */,
27B28FC414314FB900B86F18 /* Supporting Files */,
);
path = "Empty AppTests";
@@ -214,6 +244,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 27B28FEB1431552800B86F18 /* CouchbaseResources in Resources */,
27B28FB014314FB800B86F18 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -259,6 +290,7 @@
buildActionMask = 2147483647;
files = (
27B28FCB14314FB900B86F18 /* Empty_AppTests.m in Sources */,
+ 27B28FFD14315D7700B86F18 /* CouchTestCase.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -307,11 +339,12 @@
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
@@ -325,11 +358,12 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 4.3;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -340,6 +374,10 @@
27B28FCF14314FB900B86F18 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/Frameworks\"",
+ );
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Empty App/Empty App-Prefix.pch";
INFOPLIST_FILE = "Empty App/Empty App-Info.plist";
@@ -351,6 +389,10 @@
27B28FD014314FB900B86F18 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/Frameworks\"",
+ );
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Empty App/Empty App-Prefix.pch";
INFOPLIST_FILE = "Empty App/Empty App-Info.plist";
@@ -366,6 +408,7 @@
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
+ "\"$(SRCROOT)/Frameworks\"",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Empty App/Empty App-Prefix.pch";
@@ -383,6 +426,7 @@
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(DEVELOPER_LIBRARY_DIR)/Frameworks",
+ "\"$(SRCROOT)/Frameworks\"",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Empty App/Empty App-Prefix.pch";
View
7 Empty App.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:Empty App.xcodeproj">
+ </FileRef>
+</Workspace>
View
8 Empty App/AppDelegate.h
@@ -7,9 +7,15 @@
//
#import <UIKit/UIKit.h>
+#import <Couchbase/CouchbaseMobile.h>
+@class CouchDatabase;
-@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate, CouchbaseDelegate>
@property (strong, nonatomic) UIWindow *window;
+/** The database this app is using. (The unit tests access this property; see CouchTestCase.m.) */
+@property (strong, nonatomic) CouchDatabase* database;
+
@end
View
93 Empty App/AppDelegate.m
@@ -7,63 +7,100 @@
//
#import "AppDelegate.h"
+#import <CouchCocoa/CouchCocoa.h>
+
+
+/** This is the name of the database the app will use -- customize it as you like,
+ but the name must contain only *lowercase* letters, digits, and "-". */
+#define kDatabaseName @"data"
+
@implementation AppDelegate
@synthesize window = _window;
+@synthesize database = _database;
- (void)dealloc
{
[_window release];
+ [_database release];
[super dealloc];
}
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+- (BOOL)application:(UIApplication *)application
+ didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
+ NSLog(@"------ application:didFinishLaunchingWithOptions:");
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- // Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
+
+ // Create & configure a CouchbaseMobile instance:
+ CouchbaseMobile* cb = [[CouchbaseMobile alloc] init];
+ cb.delegate = self;
+
+/* Uncomment this block if you want to override CouchDB settings in a custom .ini file
+ NSString* iniPath = [[NSBundle mainBundle] pathForResource: @"couchdb" ofType: @"ini"];
+ NSAssert(iniPath, @"Couldn't find couchdb.ini resource");
+ NSLog(@"Registering custom .ini file %@", iniPath);
+ cb.iniFilePath = iniPath;
+*/
+
+ // Now tell the database to start:
+ if (![cb start])
+ [self couchbaseMobile:cb failedToStart:cb.error];
+
return YES;
}
-- (void)applicationWillResignActive:(UIApplication *)application
+-(void)couchbaseMobile:(CouchbaseMobile*)couchbase didStart:(NSURL*)serverURL
{
- /*
- Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
- Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
- */
-}
+ NSLog(@"Couchbase is Ready, go!");
-- (void)applicationDidEnterBackground:(UIApplication *)application
-{
- /*
- Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
- If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
- */
+ gCouchLogLevel = 2;
+ gRESTLogLevel = 1;
+
+ if (!self.database) {
+ // Do this on launch, but not when returning to the foreground:
+ CouchServer* server = [[CouchServer alloc] initWithURL:serverURL];
+ // Track active operations so we can wait for their completion in didEnterBackground, below
+ server.tracksActiveOperations = YES;
+ CouchDatabase* database = [server databaseNamed: kDatabaseName];
+ self.database = database;
+ [server release];
+
+ // Create the database on the first run of the app.
+ if (![[database GET] wait]) {
+ [[database create] wait];
+ }
+ }
+
+ // For most purposes you will want to track changes.
+ self.database.tracksChanges = YES;
+
}
-- (void)applicationWillEnterForeground:(UIApplication *)application
+-(void)couchbaseMobile:(CouchbaseMobile*)couchbase failedToStart:(NSError*)error
{
- /*
- Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
- */
+ NSAssert(NO, @"Couchbase failed to initialize: %@", error);
}
-- (void)applicationDidBecomeActive:(UIApplication *)application
+- (void)applicationDidEnterBackground:(UIApplication *)application
{
- /*
- Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
- */
+ NSLog(@"------ applicationDidEnterBackground");
+ // Turn off the _changes watcher:
+ self.database.tracksChanges = NO;
+
+ // Make sure all transactions complete, because going into the background will
+ // close down the CouchDB server:
+ [RESTOperation wait: self.database.server.activeOperations];
}
-- (void)applicationWillTerminate:(UIApplication *)application
+- (void)applicationWillEnterForeground:(UIApplication *)application
{
- /*
- Called when the application is about to terminate.
- Save data if appropriate.
- See also applicationDidEnterBackground:.
- */
+ NSLog(@"------ applicationWillEnterForeground");
+ // Don't reconnect to the server yet ... wait for it to tell us it's back up,
+ // by calling couchbaseMobile:didStart: again.
}
@end
View
30 Empty AppTests/CouchTestCase.h
@@ -0,0 +1,30 @@
+//
+// CouchTestCase.h
+// Empty App
+//
+// Created by Jens Alfke on 9/26/11.
+// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
+//
+
+#import <SenTestingKit/SenTestingKit.h>
+@class CouchDatabase;
+
+
+// Utility that waits for a RESTOperation to complete and raises an assertion failure if
+// it got an error. Else returns the operation.
+#define AssertWait(OP) ({RESTOperation* i_op = (OP);\
+ STAssertTrue([i_op wait], @"%@ failed: %@", i_op, i_op.error);\
+ i_op = i_op;})
+
+
+/** A base unit-test class for CouchCocoa apps.
+ Provides an accessor for the database. */
+@interface CouchTestCase : SenTestCase
+{
+ CouchDatabase* _db;
+}
+
+/** The database the AppDelegate is using. */
+@property (nonatomic, readonly) CouchDatabase* db;
+
+@end
View
38 Empty AppTests/CouchTestCase.m
@@ -0,0 +1,38 @@
+//
+// CouchTestCase.m
+// Empty App
+//
+// Created by Jens Alfke on 9/26/11.
+// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
+//
+
+#import "CouchTestCase.h"
+#import "AppDelegate.h"
+#import <CouchCocoa/CouchCocoa.h>
+
+@implementation CouchTestCase
+
+@synthesize db = _db;
+
+- (void)setUp
+{
+ [super setUp];
+
+ // The unit tests will probably start running before the Couchbase Mobile server thread is
+ // ready. So wait till the app delegate sets up its database:
+ AppDelegate* appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+ STAssertNotNil(appDelegate, @"Missing app delegate");
+ _db = appDelegate.database;
+ if (!_db) {
+ NSLog(@"Empty_AppTests: Waiting for database...");
+ NSDate* timeout = [NSDate dateWithTimeIntervalSinceNow: 10.0];
+ while (!_db && [timeout timeIntervalSinceNow] > 0) {
+ [[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.5]];
+ _db = appDelegate.database;
+ }
+ STAssertNotNil(_db, @"Couchbase Mobile failed to start", nil);
+ NSLog(@"Empty_AppTests: Database ready!\n\n");
+ }
+}
+
+@end
View
13 Empty AppTests/Empty_AppTests.h
@@ -1,13 +0,0 @@
-//
-// Empty_AppTests.h
-// Empty AppTests
-//
-// Created by Jens Alfke on 9/26/11.
-// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
-//
-
-#import <SenTestingKit/SenTestingKit.h>
-
-@interface Empty_AppTests : SenTestCase
-
-@end
View
13 Empty AppTests/Empty_AppTests.m
@@ -6,7 +6,13 @@
// Copyright (c) 2011 Couchbase, Inc. All rights reserved.
//
-#import "Empty_AppTests.h"
+#import "CouchTestCase.h"
+#import <CouchCocoa/CouchCocoa.h>
+
+
+@interface Empty_AppTests : CouchTestCase
+@end
+
@implementation Empty_AppTests
@@ -26,7 +32,10 @@ - (void)tearDown
- (void)testExample
{
- STFail(@"Unit tests are not implemented yet in Empty AppTests");
+ // As a simple example, test that a basic GET of the database works.
+ RESTOperation* op = AssertWait([self.db GET]);
+ NSDictionary* info = op.responseBody.fromJSON;
+ NSLog(@"Database info = %@", info);
}
@end
Please sign in to comment.
Something went wrong with that request. Please try again.