diff options
author | Unbit <info@unbit.it> | 2013-03-12 11:15:45 +0100 |
---|---|---|
committer | Unbit <info@unbit.it> | 2013-03-12 11:15:45 +0100 |
commit | fb8c4439c77371172312fca9c2d6b4f633ad639d (patch) | |
tree | 948dc30e3f315aaaf32dbb67e68c38a3b372ab52 /t | |
parent | 894be9c41edc5424d90d8cac7a502a2453f6abc2 (diff) | |
download | uwsgi-fb8c4439c77371172312fca9c2d6b4f633ad639d.tar.gz |
the whole ring test suite passes
Diffstat (limited to 't')
-rw-r--r-- | t/ring/config.ini | 10 | ||||
-rw-r--r-- | t/ring/project.clj | 5 | ||||
-rw-r--r-- | t/ring/src/uwsgi/ring/tests/app.clj | 2 | ||||
-rw-r--r-- | t/ring/src/uwsgi/ring/tests/body.clj | 4 | ||||
-rw-r--r-- | t/ring/src/uwsgi/ring/tests/simple.clj | 11 |
5 files changed, 19 insertions, 13 deletions
diff --git a/t/ring/config.ini b/t/ring/config.ini index fcb819bf..bfebd426 100644 --- a/t/ring/config.ini +++ b/t/ring/config.ini @@ -1,9 +1,11 @@ [uwsgi] -http = :9090 -http-modifier1 = 8 -http-modifier2 = 1 +http-socket = :9090 +http-socket-modifier1 = 8 +http-socket-modifier2 = 1 jvm-classpath = plugins/jvm/uwsgi.jar jvm-classpath = t/ring/target/uwsgi-ring-tests-0.0.1-standalone.jar -ring-app = uwsgi.ring.tests.app:app +jvm-class = uwsgi/ring/tests/app + +ring-app = uwsgi.ring.tests.app/app diff --git a/t/ring/project.clj b/t/ring/project.clj index 5549b83e..72cdc41e 100644 --- a/t/ring/project.clj +++ b/t/ring/project.clj @@ -1,7 +1,10 @@ (defproject unbit/uwsgi-ring-tests "0.0.1" :description "uwsgi-ring-tests: test cases for uwsgi ring server" :dependencies [[org.clojure/clojure "1.4.0"] - [compojure "1.1.3"] + [compojure "1.1.5"] [ring/ring "1.1.0"]] :source-paths ["src"] + + :aot [uwsgi.ring.tests.app] +) diff --git a/t/ring/src/uwsgi/ring/tests/app.clj b/t/ring/src/uwsgi/ring/tests/app.clj index 77cd493e..44c6d9db 100644 --- a/t/ring/src/uwsgi/ring/tests/app.clj +++ b/t/ring/src/uwsgi/ring/tests/app.clj @@ -15,7 +15,7 @@ (defn app-routes [req] (if (= (get req :uri) "/") (basic/index-page req) - ((routes simple/app-routes body/app-routes upload/app-routes) req))) + ((routes simple/app-routes body/app-routes upload/app-routes (route/not-found "<h1>Page not found</h1>")) req))) (def app (-> app-routes diff --git a/t/ring/src/uwsgi/ring/tests/body.clj b/t/ring/src/uwsgi/ring/tests/body.clj index 7847cf47..5e182c66 100644 --- a/t/ring/src/uwsgi/ring/tests/body.clj +++ b/t/ring/src/uwsgi/ring/tests/body.clj @@ -8,13 +8,13 @@ (lazy-seq (sieve (filter #(not= 0 (mod % (first s))) (rest s)))))) -(defn sequence [] (take 20 (sieve (iterate inc 2)))) +(defn numsequence [] (take 20 (sieve (iterate inc 2)))) (defn file [] (java.io.File. "CONTRIBUTORS")) (defn stream [] (java.io.FileInputStream. (java.io.File. "CONTRIBUTORS"))) (defroutes app-routes - (GET "/sequence" [] (sequence)) + (GET "/sequence" [] (numsequence)) (GET "/file" [] (file)) (GET "/stream" [] (stream))) diff --git a/t/ring/src/uwsgi/ring/tests/simple.clj b/t/ring/src/uwsgi/ring/tests/simple.clj index b151498c..b80820d3 100644 --- a/t/ring/src/uwsgi/ring/tests/simple.clj +++ b/t/ring/src/uwsgi/ring/tests/simple.clj @@ -1,13 +1,14 @@ (ns uwsgi.ring.tests.simple - (:use [compojure.core])) + (:use [compojure.core]) ) (defn hello [] "Hello, World!") (defn echo [msg] msg) -(defn palindrome [msg] (clojure.string/reverse msg)) +(defn palindrome [msg] (clojure.string/reverse msg) ) (defroutes app-routes - (GET "/hello" [] (hello)) - (GET "/echo" [msg] (echo msg)) - (GET "/palindrome" [msg] (palindrome msg))) + (GET "/hello" [] (hello) ) + (GET "/echo" [msg] (echo msg) ) + (GET "/palindrome" [msg] (palindrome msg) ) +) |