Changeset 3268

Show
Ignore:
Timestamp:
06/15/08 09:40:59 (7 months ago)
Author:
ksprotte
Message:

added a test to the bos test-suite that requests the start-page via drakma

will fail! :(

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/bos/test/bos.test.asd

    r3141 r3268  
    33(asdf:defsystem :bos.test 
    44  :description "BOS Online-System test-suite" 
    5   :depends-on (:bos.web :fiveam
     5  :depends-on (:bos.web :fiveam :drakma
    66  :components ((:file "packages-test") 
    77               (:file "test-suites" :depends-on ("packages-test")) 
  • trunk/projects/bos/test/web/startup.lisp

    r3022 r3268  
    22(in-suite :bos.test.web) 
    33 
    4 (test web-init 
    5   (let ((server (bos.web::init :port 75253))) 
    6     (hunchentoot:stop-server server) 
     4(defmacro with-bos-test-server ((port-var) &body body) 
     5  (check-type port-var symbol) 
     6  `(let* ((,port-var (+ 70000 (random 5253))) 
     7          (server (bos.web::init :port ,port-var))) 
     8     (unwind-protect 
     9          (progn ,@body) 
     10       (hunchentoot:stop-server server)))) 
     11 
     12(test web-init     
     13  (with-bos-test-server (port) 
    714    (pass))) 
    815 
     16(test request-start-page   
     17  (with-bos-test-server (port) 
     18    (let ((uri (format nil "http://localhost:~D" port))) 
     19      (is (= 200 (nth-value 1 (drakma:http-request uri))))))) 
     20