[claw-cvs] r12 - trunk/main/claw-core/tests

achiumenti at common-lisp.net achiumenti at common-lisp.net
Sun Feb 17 19:43:03 UTC 2008


Author: achiumenti
Date: Sun Feb 17 14:43:03 2008
New Revision: 12

Modified:
   trunk/main/claw-core/tests/test1.lisp
Log:
test for realm page corrected


Modified: trunk/main/claw-core/tests/test1.lisp
==============================================================================
--- trunk/main/claw-core/tests/test1.lisp	(original)
+++ trunk/main/claw-core/tests/test1.lisp	Sun Feb 17 14:43:03 2008
@@ -46,7 +46,7 @@
 ;;(defparameter *clawserver* (make-instance 'clawserver :port 4242))
 
 (defparameter *clawserver* (make-instance 'clawserver :port 4242 :sslport 4445 
-					  :mod-lisp-p t
+					  :mod-lisp-p nil
 					:ssl-certificate-file #P"/home/kiuma/pem/cacert.pem" 
 					:ssl-privatekey-file #P"/home/kiuma/pem/privkey.pem"))
 
@@ -159,29 +159,28 @@
 (defclass realm-page (page) ())
 
 (defmethod page-content ((o realm-page))  
-  (let ((lisplet (page-lisplet o)))    
-    (when (or (null *session*) (not (string= (session-realm *session*) (lisplet-realm lisplet))))
-      (progn	 	  
-	(lisplet-start-session)
-	(setf (session-value 'RND-NUMBER) (random 1000))))
-    (site-template> :title "Realm test page"		  			
-		    (p>
-		     "session"			 
-		     (ul>
-		      (li> (a> :href "http://www.gentoo.org" :target "gentoo" 
-			       "gentoo"))
-		      (li> (a> :href "../test/realm.html" :target "clwo1" 
-			       "realm on lisplet 'test'"))
-		      (li> (a> :href "../test2/realm.html" :target "clwo2" 
+  (when (null *session*)     
+    (lisplet-start-session))
+  (unless (session-value 'RND-NUMBER)
+    (setf (session-value 'RND-NUMBER) (random 1000)))
+  (site-template> :title "Realm test page"		  			
+		  (p>
+		   "session"			 
+		   (ul>
+		    (li> (a> :href "http://www.gentoo.org" :target "gentoo" 
+			     "gentoo"))
+		    (li> (a> :href "../test/realm.html" :target "clwo1" 
+			     "realm on lisplet 'test'"))
+		    (li> (a> :href "../test2/realm.html" :target "clwo2" 
 			       "realm on lisplet 'test2'"))
-		      (li> "Rnd number value: " (format nil "~d" (session-value 'RND-NUMBER)))
-		      (li> "Remote Addr: " (session-remote-addr  *session*))
-		      (li> "User agent: " (session-user-agent *session*))
-		      (li> "Lisplet Realm: " (lisplet-realm (page-lisplet o)))
-		      (li> "Session Realm: " (session-realm *session*))
-		      (li> "Session value: " (format nil "~a" (hunchentoot::session-string *session*)))
-		      (li> "Request Realm: " (hunchentoot::realm *request*)))))))
-    
+		    (li> "Rnd number value: " (format nil "~d" (session-value 'RND-NUMBER)))
+		    (li> "Remote Addr: " (session-remote-addr  *session*))
+		    (li> "User agent: " (session-user-agent *session*))
+		    (li> "Lisplet Realm: " (lisplet-realm (page-lisplet o)))
+		    (li> "Session Realm: " (session-realm *session*))
+		    (li> "Session value: " (format nil "~a" (hunchentoot::session-string *session*)))
+		    (li> "Request Realm: " (hunchentoot::realm *request*))))))
+
 (lisplet-register-page-location *test-lisplet* 'realm-page "realm.html")
 (lisplet-register-page-location *test-lisplet2* 'realm-page "realm.html")
 



More information about the Claw-cvs mailing list