[#460] fix interop with environment
This commit is contained in:
parent
ed263b1089
commit
566eff4b94
2 changed files with 13 additions and 4 deletions
|
|
@ -197,6 +197,7 @@
|
||||||
java.util.Base64$Decoder
|
java.util.Base64$Decoder
|
||||||
java.util.Base64$Encoder
|
java.util.Base64$Encoder
|
||||||
java.util.Date
|
java.util.Date
|
||||||
|
java.util.Map
|
||||||
java.util.MissingResourceException
|
java.util.MissingResourceException
|
||||||
java.util.Properties
|
java.util.Properties
|
||||||
java.util.Set
|
java.util.Set
|
||||||
|
|
@ -235,19 +236,24 @@
|
||||||
c))]
|
c))]
|
||||||
(assoc m :public-class
|
(assoc m :public-class
|
||||||
(fn [v]
|
(fn [v]
|
||||||
(cond (instance? java.nio.file.Path v)
|
(cond (instance? java.lang.Process v)
|
||||||
java.nio.file.Path
|
|
||||||
(instance? java.lang.Process v)
|
|
||||||
java.lang.Process
|
java.lang.Process
|
||||||
|
;; added for calling .put on .environment from ProcessBuilder
|
||||||
|
(instance? java.util.Map v)
|
||||||
|
java.util.Map
|
||||||
;; added for issue #239 regarding clj-http-lite
|
;; added for issue #239 regarding clj-http-lite
|
||||||
(instance? java.io.ByteArrayOutputStream v)
|
(instance? java.io.ByteArrayOutputStream v)
|
||||||
java.io.ByteArrayOutputStream
|
java.io.ByteArrayOutputStream
|
||||||
(instance? java.security.MessageDigest v)
|
(instance? java.security.MessageDigest v)
|
||||||
java.security.MessageDigest
|
java.security.MessageDigest
|
||||||
|
;; streams
|
||||||
(instance? java.io.InputStream v)
|
(instance? java.io.InputStream v)
|
||||||
java.io.InputStream
|
java.io.InputStream
|
||||||
(instance? java.io.OutputStream v)
|
(instance? java.io.OutputStream v)
|
||||||
java.io.OutputStream
|
java.io.OutputStream
|
||||||
|
;; java nio
|
||||||
|
(instance? java.nio.file.Path v)
|
||||||
|
java.nio.file.Path
|
||||||
(instance? java.nio.file.FileSystem v)
|
(instance? java.nio.file.FileSystem v)
|
||||||
java.nio.file.FileSystem
|
java.nio.file.FileSystem
|
||||||
(instance? java.nio.file.PathMatcher v)
|
(instance? java.nio.file.PathMatcher v)
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,10 @@
|
||||||
|
|
||||||
(deftest process-builder-test
|
(deftest process-builder-test
|
||||||
(is (str/includes? (bb nil "
|
(is (str/includes? (bb nil "
|
||||||
(def ls (-> (ProcessBuilder. [\"ls\"]) (.start)))
|
(def pb (ProcessBuilder. [\"ls\"]))
|
||||||
|
(def env (.environment pb))
|
||||||
|
(.put env \"FOO\" \"BAR\") ;; test for issue 460
|
||||||
|
(def ls (-> pb (.start)))
|
||||||
(def input (.getOutputStream ls))
|
(def input (.getOutputStream ls))
|
||||||
(.write (io/writer input) \"hello\") ;; dummy test just to see if this works
|
(.write (io/writer input) \"hello\") ;; dummy test just to see if this works
|
||||||
(def output (.getInputStream ls))
|
(def output (.getInputStream ls))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue