From 10800a009a4032615148b472b542295b7c56f846 Mon Sep 17 00:00:00 2001
From: Slava Pestov <slava@slava-pestovs-macbook-pro.local>
Date: Fri, 20 Nov 2009 03:23:15 -0600
Subject: [PATCH] tools.deploy.test.17: database deployment test

---
 basis/tools/deploy/deploy-tests.factor   |  2 ++
 basis/tools/deploy/test/17/17.factor     | 31 ++++++++++++++++++++++++
 basis/tools/deploy/test/17/deploy.factor | 14 +++++++++++
 3 files changed, 47 insertions(+)
 create mode 100644 basis/tools/deploy/test/17/17.factor
 create mode 100644 basis/tools/deploy/test/17/deploy.factor

diff --git a/basis/tools/deploy/deploy-tests.factor b/basis/tools/deploy/deploy-tests.factor
index 9244f06b4e..1412e65f95 100644
--- a/basis/tools/deploy/deploy-tests.factor
+++ b/basis/tools/deploy/deploy-tests.factor
@@ -115,3 +115,5 @@ os macosx? [
 ] unit-test
 
 [ ] [ "tools.deploy.test.16" shake-and-bake run-temp-image ] unit-test
+
+[ ] [ "tools.deploy.test.17" shake-and-bake run-temp-image ] unit-test
diff --git a/basis/tools/deploy/test/17/17.factor b/basis/tools/deploy/test/17/17.factor
new file mode 100644
index 0000000000..31984940dd
--- /dev/null
+++ b/basis/tools/deploy/test/17/17.factor
@@ -0,0 +1,31 @@
+USING: accessors calendar db db.sqlite db.tuples db.types
+io.files.temp kernel urls ;
+IN: tools.deploy.test.17
+
+TUPLE: person name birthday homepage occupation ;
+
+person "PEOPLE" {
+    { "name" "NAME" { VARCHAR 256 } +not-null+ +user-assigned-id+ }
+    { "birthday" "BIRTHDAY" DATETIME +not-null+ }
+    { "homepage" "HOMEPAGE" URL +not-null+ }
+    { "occupation" "OCCUPATION" { VARCHAR 256 } +not-null+ }
+} define-persistent
+
+: db-deploy-test ( -- ) ;
+    "test.db" temp-file <sqlite-db> [
+        person recreate-table
+        
+        person new
+            "Stephen Hawking" >>name
+            timestamp new 8 >>day 0 >>month 1942 >>year >>birthday
+            "http://en.wikipedia.org/wiki/Stephen_Hawking" >url >>homepage
+            "Dope MC" >>occupation
+        dup
+        insert-tuple
+        person new
+            "Stephen Hawking" >>name
+        select-tuple
+        assert=
+    ] with-db ;
+
+MAIN: db-deploy-test
diff --git a/basis/tools/deploy/test/17/deploy.factor b/basis/tools/deploy/test/17/deploy.factor
new file mode 100644
index 0000000000..62cc2cac7b
--- /dev/null
+++ b/basis/tools/deploy/test/17/deploy.factor
@@ -0,0 +1,14 @@
+USING: tools.deploy.config ;
+H{
+    { deploy-name "tools.deploy.test.17" }
+    { deploy-ui? f }
+    { deploy-c-types? f }
+    { deploy-unicode? f }
+    { "stop-after-last-window?" t }
+    { deploy-io 3 }
+    { deploy-reflection 5 }
+    { deploy-word-props? f }
+    { deploy-math? t }
+    { deploy-threads? t }
+    { deploy-word-defs? f }
+}