Source

clj-soap / test / clj_soap / test / core.clj

taka2ru 0c5560a 















(ns clj-soap.test.core
  (:use [clj-soap.core])
  (:use [clojure.test]))

(def test-value (ref false))

(defservice jp.myclass.MyApp
  (changeval [^String string] (dosync (ref-set test-value string)))
  ^Double (hypotenuse [^Double x ^Double y] (Math/sqrt (+ (* x x) (* y y)))))

(deftest test-my-app
  (serve "jp.myclass.MyApp")
  (let [cl (client-fn "http://localhost:6060/axis2/services/MyApp?wsdl")]
    (is (= 5.0 (cl :hypotenuse 3 4)) "SOAP call with return value")
    (cl :changeval "piyopiyo")
    (is (= "piyopiyo" @test-value) "SOAP call withoug return value")))