added skeleton 'caseALoadCommand3' from DepthFirstAdapter
[bkell-clj.git] / testing.clj
bloba5cdc7c1f17a3b6def60d04444670b40b8e0980d
2 ;; performance stuff
3 (set! *warn-on-reflection* true)
6 (use 'clojure.xml)    ;; use XML library
7 (def flareXML (parse "etc/xml/bookkeeping.system.xml"))   ;; load XML from file
9 (. System/out println (str "parsed XML [" (.getClass flareXML) "] [" flareXML "]") )
10 ;;(. System/out println (str "raw XML [" (emit flareXML) "]") )
12 (require 'clojure.contrib.http.agent)   ;; use HTTP client library
13 (require 'clojure.contrib.io)
16 ;; connect to a eXist server ; push the XML object out 
17 (clojure.contrib.http.agent/result  (clojure.contrib.http.agent/http-agent "http://localhost:8080/exist/rest/thing" 
18                                        :method "PUT" 
19                                        :header {"Content-Type" "text/xml"} 
20                                        :body (with-out-str (emit flareXML))  
21                                        ;; :handler (fn [agnt]   (with-open [w (clojure.contrib.io/writer "/tmp/out")]    (clojure.contrib.io/copy (clojure.contrib.http.agent/stream agnt) w)))
22                                     )