Skip to content

Commit

Permalink
refactored datastore helper and removed lein-clojars from projects.clj
Browse files Browse the repository at this point in the history
  • Loading branch information
slagyr committed Aug 9, 2011
1 parent 15b77d8 commit 785fa8f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ lib
classes
.idea
*.iml
gaeshi-mvn
5 changes: 3 additions & 2 deletions TODO.md
@@ -1,11 +1,12 @@
== TODO
* Create WEB-INF dir if if doesn't exist when starting the server
* It seems like the core-handler used by GaeshiDevServlet is not being reloaded by fresh
* _ah/admin/backends and _ah/admin/inboundmail routes aren't working
* '_ah/admin/backends' and _ah/admin/inboundmail routes aren't working
* generate sample model, controller, view with specs
* spec_helpers/controller must record all views rendered in addition to the last.
* the devserver should run a repl server
* need to resolve conflict with hiccup files. The .clj extension should be removed, and prepare-views task updated to exclude *.clj files.
* Add session clearing cron job to generated project
* Add a away to bypass timestamp updates in the datastore
* Need to address problem where data is not loaded properly when the models haven't been loaded yet.
* Need to address problem where data is not loaded properly when the models haven't been loaded yet.
* Prepare task should run clean to empty classes dir. server task should not clean.
3 changes: 2 additions & 1 deletion kake/project.clj
Expand Up @@ -4,11 +4,12 @@
:url "file://LICENSE"
:distribution :repo
:comments "Copyright © 2011 Micah Martin All Rights Reserved."}
:repositories {"releases" "http://gaeshi-mvn.googlecode.com/svn/trunk/releases/"}
:dependencies [[org.clojure/clojure "1.2.1"]
[ring/ring-servlet "0.3.7"]
[compojure "0.6.2"]
[hiccup "0.3.1"]
[com.google.appengine/appengine-api-1.0-sdk "1.5.0"]
[com.google.appengine/appengine-api-1.0-sdk "1.5.1"]
[inflections "0.4.3"]]
:dev-dependencies [[speclj "1.4.0"]
[gaeshi/tsukuri "0.6.0-SNAPSHOT"]
Expand Down
14 changes: 7 additions & 7 deletions tsukuri/project.clj
Expand Up @@ -4,16 +4,16 @@
:url "file://LICENSE"
:distribution :repo
:comments "Copyright © 2011 Micah Martin All Rights Reserved."}
:repositories {"releases" "http://appengine-magic-mvn.googlecode.com/svn/releases/"}
:repositories {"releases" "http://gaeshi-mvn.googlecode.com/svn/trunk/releases/"}
:dependencies [[org.clojure/clojure "1.2.1"]
[speclj "1.3.1"]
[mmargs "1.2.0"]
[fresh "1.0.2"]
[com.google.appengine/appengine-api-labs "1.5.0"]
[com.google.appengine/appengine-api-stubs "1.5.0"]
[com.google.appengine/appengine-local-runtime "1.5.0"]
[com.google.appengine/appengine-local-runtime-shared "1.5.0"]
[com.google.appengine/appengine-testing "1.5.0"]
[com.google.appengine/appengine-api-labs "1.5.1"]
[com.google.appengine/appengine-api-stubs "1.5.1"]
[com.google.appengine/appengine-local-runtime "1.5.1"]
[com.google.appengine/appengine-local-runtime-shared "1.5.1"]
[com.google.appengine/appengine-testing "1.5.1"]
[tomcat/jasper-runtime "5.0.28"]
[jstl "1.1.2"]
[taglibs/standard "1.1.2"]
Expand All @@ -22,7 +22,7 @@
[filecabinet "1.0.1"]]
:dev-dependencies [[speclj "1.4.0"]
[lein-clojars "0.6.0"]
[com.google.appengine/appengine-api-1.0-sdk "1.5.0"]
[com.google.appengine/appengine-api-1.0-sdk "1.5.1"]
[ring/ring-servlet "0.3.7"]]
:test-path "spec/"
:java-source-path "src/")
15 changes: 9 additions & 6 deletions tsukuri/src/gaeshi/spec_helpers/datastore.clj
Expand Up @@ -9,15 +9,18 @@
LocalServiceTestHelper]
[com.google.apphosting.api ApiProxy]))

(defn tear-down []
(defn tear-down-local-datastore []
(.stop (ApiProxy/getDelegate))
(ApiProxy/clearEnvironmentForCurrentThread)
)
(ApiProxy/clearEnvironmentForCurrentThread))

(defn set-up-local-datastore []
(.setUp (LocalServiceTestHelper.
(into-array LocalServiceTestConfig
[(LocalBlobstoreServiceTestConfig.) (LocalDatastoreServiceTestConfig.)]))))

(defn with-local-datastore []
(around [it]
(try
(.setUp (LocalServiceTestHelper.
(into-array LocalServiceTestConfig [(LocalBlobstoreServiceTestConfig.) (LocalDatastoreServiceTestConfig.)])))
(set-up-local-datastore)
(it)
(finally (tear-down)))))
(finally (tear-down-local-datastore)))))

0 comments on commit 785fa8f

Please sign in to comment.