Add locking
This commit is contained in:
parent
62f12e75ee
commit
5e2c2a7ba0
9 changed files with 239 additions and 902 deletions
|
|
@ -11,7 +11,7 @@ jobs:
|
|||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
# GRAALVM_HOME: /home/circleci/graalvm-ce-java8-19.3.0
|
||||
BABASHKA_PLATFORM: linux # could be used in jar name
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
|
|
@ -52,7 +52,7 @@ jobs:
|
|||
mkdir -p /tmp/release
|
||||
lein do clean, uberjar
|
||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
cp target/babashka-$VERSION-standalone.jar /tmp/release
|
||||
cp target/babashka-$VERSION-linux-standalone.jar /tmp/release
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
|
|
@ -115,6 +115,7 @@ jobs:
|
|||
name: Run tests
|
||||
command: |
|
||||
script/test
|
||||
script/clj_http_lite_test
|
||||
# - run:
|
||||
# name: Performance report
|
||||
# command: |
|
||||
|
|
@ -178,6 +179,7 @@ jobs:
|
|||
name: Run tests
|
||||
command: |
|
||||
script/test
|
||||
script/clj_http_lite_test
|
||||
# - run:
|
||||
# name: Performance report
|
||||
# command: |
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -16,3 +16,4 @@ pom.xml.asc
|
|||
!test-resources/babashka/src_for_classpath_test/foo.jar
|
||||
.cpcache
|
||||
deps.edn
|
||||
reflection.json
|
||||
|
|
|
|||
554
reflection.json
554
reflection.json
|
|
@ -1,554 +0,0 @@
|
|||
[ {
|
||||
"name" : "clojure.lang.Delay",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "clojure.lang.ExceptionInfo",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "clojure.lang.IEditableCollection",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "clojure.lang.IObj",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "clojure.lang.LineNumberingPushbackReader",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "clojure.lang.MapEntry",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "clojure.lang.PersistentQueue",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.io.BufferedReader",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.io.BufferedWriter",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.io.ByteArrayInputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.io.ByteArrayOutputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.io.File",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.io.IOException",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.io.InputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.io.OutputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.io.StringReader",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.io.StringWriter",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.ArithmeticException",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.AssertionError",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.Boolean",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.Class",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.Double",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.Exception",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.Integer",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.Math",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.Process",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.ProcessBuilder",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.ProcessBuilder$Redirect",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.String",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.System",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.Throwable",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.UNIXProcess",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.lang.UNIXProcess$ProcessPipeOutputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.net.HttpURLConnection",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.net.ServerSocket",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.net.Socket",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.net.URI",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.net.URLDecoder",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.net.URLEncoder",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.net.UnknownHostException",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.CopyOption",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.FileAlreadyExistsException",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.Files",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.LinkOption",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.NoSuchFileException",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.Path",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.Paths",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.StandardCopyOption",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.attribute.FileAttribute",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.attribute.FileTime",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.attribute.PosixFilePermission",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.nio.file.attribute.PosixFilePermissions",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.Clock",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.DateTimeException",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.DayOfWeek",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.Duration",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.Instant",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.LocalDate",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.LocalDateTime",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.LocalTime",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.Month",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.MonthDay",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.OffsetDateTime",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.OffsetTime",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.Period",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.Year",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.YearMonth",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.ZoneId",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.ZoneOffset",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.ZonedDateTime",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.format.DateTimeFormatter",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.time.temporal.TemporalAccessor",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.Base64",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.Base64$Decoder",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.Base64$Encoder",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.UUID",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.concurrent.LinkedBlockingQueue",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.concurrent.TimeUnit",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.regex.Pattern",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.zip.DeflaterInputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.zip.GZIPInputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.zip.GZIPOutputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "java.util.zip.InflaterInputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "sun.net.www.http.PosterOutputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "sun.net.www.protocol.http.HttpURLConnection",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "sun.net.www.protocol.http.HttpURLConnection$HttpInputStream",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "sun.net.www.protocol.https.HttpsURLConnectionImpl",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"name" : "sun.nio.fs.UnixPath",
|
||||
"allPublicMethods" : true,
|
||||
"allPublicFields" : true,
|
||||
"allPublicConstructors" : true
|
||||
}, {
|
||||
"allPublicConstructors" : true,
|
||||
"methods" : [ {
|
||||
"name" : "activeCount"
|
||||
}, {
|
||||
"name" : "checkAccess"
|
||||
}, {
|
||||
"name" : "currentThread"
|
||||
}, {
|
||||
"name" : "dumpStack"
|
||||
}, {
|
||||
"name" : "enumerate"
|
||||
}, {
|
||||
"name" : "getAllStackTraces"
|
||||
}, {
|
||||
"name" : "getContextClassLoader"
|
||||
}, {
|
||||
"name" : "getDefaultUncaughtExceptionHandler"
|
||||
}, {
|
||||
"name" : "getId"
|
||||
}, {
|
||||
"name" : "getName"
|
||||
}, {
|
||||
"name" : "getPriority"
|
||||
}, {
|
||||
"name" : "getStackTrace"
|
||||
}, {
|
||||
"name" : "getState"
|
||||
}, {
|
||||
"name" : "getThreadGroup"
|
||||
}, {
|
||||
"name" : "getUncaughtExceptionHandler"
|
||||
}, {
|
||||
"name" : "holdsLock"
|
||||
}, {
|
||||
"name" : "interrupt"
|
||||
}, {
|
||||
"name" : "interrupted"
|
||||
}, {
|
||||
"name" : "isAlive"
|
||||
}, {
|
||||
"name" : "isDaemon"
|
||||
}, {
|
||||
"name" : "isInterrupted"
|
||||
}, {
|
||||
"name" : "join"
|
||||
}, {
|
||||
"name" : "run"
|
||||
}, {
|
||||
"name" : "setContextClassLoader"
|
||||
}, {
|
||||
"name" : "setDaemon"
|
||||
}, {
|
||||
"name" : "setDefaultUncaughtExceptionHandler"
|
||||
}, {
|
||||
"name" : "setName"
|
||||
}, {
|
||||
"name" : "setPriority"
|
||||
}, {
|
||||
"name" : "setUncaughtExceptionHandler"
|
||||
}, {
|
||||
"name" : "sleep"
|
||||
}, {
|
||||
"name" : "start"
|
||||
}, {
|
||||
"name" : "toString"
|
||||
}, {
|
||||
"name" : "yield"
|
||||
} ],
|
||||
"name" : "java.lang.Thread"
|
||||
}, {
|
||||
"allPublicConstructors" : true,
|
||||
"allPublicFields" : true,
|
||||
"methods" : [ {
|
||||
"name" : "equals"
|
||||
}, {
|
||||
"name" : "getAuthority"
|
||||
}, {
|
||||
"name" : "getContent"
|
||||
}, {
|
||||
"name" : "getDefaultPort"
|
||||
}, {
|
||||
"name" : "getFile"
|
||||
}, {
|
||||
"name" : "getHost"
|
||||
}, {
|
||||
"name" : "getPath"
|
||||
}, {
|
||||
"name" : "getPort"
|
||||
}, {
|
||||
"name" : "getProtocol"
|
||||
}, {
|
||||
"name" : "getQuery"
|
||||
}, {
|
||||
"name" : "getRef"
|
||||
}, {
|
||||
"name" : "getUserInfo"
|
||||
}, {
|
||||
"name" : "hashCode"
|
||||
}, {
|
||||
"name" : "openConnection"
|
||||
}, {
|
||||
"name" : "openStream"
|
||||
}, {
|
||||
"name" : "sameFile"
|
||||
}, {
|
||||
"name" : "toExternalForm"
|
||||
}, {
|
||||
"name" : "toString"
|
||||
}, {
|
||||
"name" : "toURI"
|
||||
} ],
|
||||
"name" : "java.net.URL"
|
||||
} ]
|
||||
|
|
@ -1,185 +0,0 @@
|
|||
[
|
||||
{
|
||||
"name":"java.lang.ArithmeticException",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.AssertionError",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.Boolean",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.io.BufferedWriter",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.io.BufferedReader",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name": "java.lang.Class",
|
||||
"allDeclaredConstructors": true,
|
||||
"allPublicConstructors": true,
|
||||
"allDeclaredMethods": true,
|
||||
"allPublicMethods": true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.Double",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.Exception",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name": "clojure.lang.ExceptionInfo",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.Integer",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.io.File",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"clojure.lang.LineNumberingPushbackReader",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.util.concurrent.LinkedBlockingQueue",
|
||||
"allPublicMethods":true
|
||||
},
|
||||
{
|
||||
"name":"java.util.regex.Pattern",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.Process",
|
||||
"allPublicMethods":true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.ProcessBuilder",
|
||||
"allPublicConstructors":true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.String",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.io.StringReader",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.io.StringWriter",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.System",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.Thread",
|
||||
"methods": [{"name":"run"},{"name":"toString"},{"name":"isInterrupted"},{"name":"currentThread"},{"name":"getName"},{"name":"join"},{"name":"getThreadGroup"},{"name":"getStackTrace"},{"name":"holdsLock"},{"name":"checkAccess"},{"name":"dumpStack"},{"name":"yield"},{"name":"setPriority"},{"name":"setDaemon"},{"name":"start"},{"name":"sleep"},{"name":"interrupt"},{"name":"interrupted"},{"name":"isAlive"},{"name":"getPriority"},{"name":"setName"},{"name":"activeCount"},{"name":"enumerate"},{"name":"isDaemon"},{"name":"getContextClassLoader"},{"name":"setContextClassLoader"},{"name":"getAllStackTraces"},{"name":"getId"},{"name":"getState"},{"name":"setDefaultUncaughtExceptionHandler"},{"name":"getDefaultUncaughtExceptionHandler"},{"name":"getUncaughtExceptionHandler"},{"name":"setUncaughtExceptionHandler"}],
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.UNIXProcess",
|
||||
"allPublicMethods":true
|
||||
},
|
||||
{
|
||||
"name":"java.nio.file.attribute.FileAttribute",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.nio.file.attribute.PosixFilePermission",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.nio.file.attribute.PosixFilePermissions",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.nio.file.Path",
|
||||
"allPublicMethods":true
|
||||
},
|
||||
{
|
||||
"name":"java.nio.file.CopyOption",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.nio.file.FileAlreadyExistsException",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.nio.file.Files",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.nio.file.NoSuchFileException",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"java.nio.file.StandardCopyOption",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
},
|
||||
{
|
||||
"name":"sun.nio.fs.UnixPath",
|
||||
"allPublicMethods":true,
|
||||
"allPublicFields": true,
|
||||
"allPublicConstructors": true
|
||||
}
|
||||
]
|
||||
15
script/clj_http_lite_test
Executable file
15
script/clj_http_lite_test
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
export BABASHKA_CLASSPATH=$(clojure -Sdeps '{:deps {clj-http-lite {:git/url "https://github.com/borkdude/clj-http-lite" :sha "f44ebe45446f0f44f2b73761d102af3da6d0a13e"}}}' -Spath)
|
||||
|
||||
./bb -e "
|
||||
(require '[clj-http.lite.client :as client])
|
||||
|
||||
(prn (:status (client/get \"https://www.clojure.org\")))
|
||||
|
||||
(prn (:status (client/get \"https://postman-echo.com/get?foo1=bar1&foo2=bar2\")))
|
||||
|
||||
(prn (:status (client/post \"https://postman-echo.com/post\")))
|
||||
|
||||
(prn (:status (client/put \"https://postman-echo.com/put\")))
|
||||
"
|
||||
|
|
@ -1,164 +1,186 @@
|
|||
(ns babashka.impl.classes
|
||||
{:no-doc true}
|
||||
(:require
|
||||
[cheshire.core :as json]))
|
||||
[cheshire.core :as json]
|
||||
[clojure.string :as str]))
|
||||
|
||||
(def os-name (str/lower-case (System/getProperty "os.name")))
|
||||
(def os (cond (str/includes? os-name "mac") :mac
|
||||
(or (str/includes? os-name "nix")
|
||||
(str/includes? os-name "nux")) :linux
|
||||
(str/includes? os-name "win") :windows))
|
||||
(def unix-like? (or (identical? os :linux)
|
||||
(identical? os :mac)))
|
||||
|
||||
(def classes
|
||||
{:default-classes '[clojure.lang.Delay
|
||||
clojure.lang.ExceptionInfo
|
||||
clojure.lang.IObj
|
||||
clojure.lang.IEditableCollection
|
||||
clojure.lang.LineNumberingPushbackReader
|
||||
clojure.lang.MapEntry
|
||||
clojure.lang.PersistentQueue
|
||||
java.io.BufferedReader
|
||||
java.io.BufferedWriter
|
||||
java.io.ByteArrayInputStream
|
||||
java.io.ByteArrayOutputStream
|
||||
java.io.File
|
||||
java.io.InputStream
|
||||
java.io.IOException
|
||||
java.io.OutputStream
|
||||
java.io.StringReader
|
||||
java.io.StringWriter
|
||||
java.lang.ArithmeticException
|
||||
java.lang.AssertionError
|
||||
java.lang.Boolean
|
||||
java.lang.Class
|
||||
java.lang.Double
|
||||
java.lang.Exception
|
||||
java.lang.Integer
|
||||
java.lang.Math
|
||||
java.util.concurrent.LinkedBlockingQueue
|
||||
java.lang.String
|
||||
java.lang.System
|
||||
java.lang.Throwable
|
||||
java.lang.Process
|
||||
java.lang.UNIXProcess
|
||||
java.lang.UNIXProcess$ProcessPipeOutputStream
|
||||
java.lang.ProcessBuilder
|
||||
java.lang.ProcessBuilder$Redirect
|
||||
java.net.URI
|
||||
java.net.HttpURLConnection
|
||||
java.net.ServerSocket
|
||||
java.net.Socket
|
||||
java.net.UnknownHostException
|
||||
java.net.URLEncoder
|
||||
java.net.URLDecoder
|
||||
java.nio.file.CopyOption
|
||||
java.nio.file.FileAlreadyExistsException
|
||||
java.nio.file.Files
|
||||
java.nio.file.LinkOption
|
||||
java.nio.file.NoSuchFileException
|
||||
java.nio.file.Path
|
||||
java.nio.file.Paths
|
||||
java.nio.file.StandardCopyOption
|
||||
java.nio.file.attribute.FileAttribute
|
||||
java.nio.file.attribute.FileTime
|
||||
java.nio.file.attribute.PosixFilePermission
|
||||
java.nio.file.attribute.PosixFilePermissions
|
||||
java.time.format.DateTimeFormatter
|
||||
java.time.Clock
|
||||
java.time.DateTimeException
|
||||
java.time.DayOfWeek
|
||||
java.time.Duration
|
||||
java.time.Instant
|
||||
java.time.LocalDate
|
||||
java.time.LocalDateTime
|
||||
java.time.LocalTime
|
||||
java.time.Month
|
||||
java.time.MonthDay
|
||||
java.time.OffsetDateTime
|
||||
java.time.OffsetTime
|
||||
java.time.Period
|
||||
java.time.Year
|
||||
java.time.YearMonth
|
||||
java.time.ZonedDateTime
|
||||
java.time.ZoneId
|
||||
java.time.ZoneOffset
|
||||
java.time.temporal.TemporalAccessor
|
||||
java.util.regex.Pattern
|
||||
java.util.Base64
|
||||
java.util.Base64$Decoder
|
||||
java.util.Base64$Encoder
|
||||
java.util.UUID
|
||||
java.util.concurrent.TimeUnit
|
||||
java.util.zip.InflaterInputStream
|
||||
java.util.zip.DeflaterInputStream
|
||||
java.util.zip.GZIPInputStream
|
||||
java.util.zip.GZIPOutputStream
|
||||
sun.nio.fs.UnixPath ;; included because of permission check
|
||||
sun.net.www.protocol.https.HttpsURLConnectionImpl ;; needed fo clj-http.lite
|
||||
sun.net.www.protocol.http.HttpURLConnection ;; needed for clj.http.lite http calls
|
||||
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream ;; needed for clj-http.lite
|
||||
sun.net.www.http.PosterOutputStream ;; needed for clj-http.lite
|
||||
]
|
||||
:custom-classes {'java.lang.Thread
|
||||
{:allPublicConstructors true
|
||||
;; generated with `public-declared-method-names`, see in
|
||||
;; `comment` below
|
||||
:methods [{:name "activeCount"}
|
||||
{:name "checkAccess"}
|
||||
{:name "currentThread"}
|
||||
{:name "dumpStack"}
|
||||
{:name "enumerate"}
|
||||
{:name "getAllStackTraces"}
|
||||
{:name "getContextClassLoader"}
|
||||
{:name "getDefaultUncaughtExceptionHandler"}
|
||||
{:name "getId"}
|
||||
{:name "getName"}
|
||||
{:name "getPriority"}
|
||||
{:name "getStackTrace"}
|
||||
{:name "getState"}
|
||||
{:name "getThreadGroup"}
|
||||
{:name "getUncaughtExceptionHandler"}
|
||||
{:name "holdsLock"}
|
||||
{:name "interrupt"}
|
||||
{:name "interrupted"}
|
||||
{:name "isAlive"}
|
||||
{:name "isDaemon"}
|
||||
{:name "isInterrupted"}
|
||||
{:name "join"}
|
||||
{:name "run"}
|
||||
{:name "setContextClassLoader"}
|
||||
{:name "setDaemon"}
|
||||
{:name "setDefaultUncaughtExceptionHandler"}
|
||||
{:name "setName"}
|
||||
{:name "setPriority"}
|
||||
{:name "setUncaughtExceptionHandler"}
|
||||
{:name "sleep"}
|
||||
{:name "start"}
|
||||
{:name "toString"}
|
||||
{:name "yield"}]}
|
||||
'java.net.URL
|
||||
{:allPublicConstructors true
|
||||
:allPublicFields true
|
||||
;; generated with `public-declared-method-names`, see in
|
||||
;; `comment` below
|
||||
:methods [{:name "equals"}
|
||||
{:name "getAuthority"}
|
||||
{:name "getContent"}
|
||||
{:name "getDefaultPort"}
|
||||
{:name "getFile"}
|
||||
{:name "getHost"}
|
||||
{:name "getPath"}
|
||||
{:name "getPort"}
|
||||
{:name "getProtocol"}
|
||||
{:name "getQuery"}
|
||||
{:name "getRef"}
|
||||
{:name "getUserInfo"}
|
||||
{:name "hashCode"}
|
||||
{:name "openConnection"}
|
||||
{:name "openStream"}
|
||||
{:name "sameFile"}
|
||||
;; not supported: {:name "setURLStreamHandlerFactory"}
|
||||
{:name "toExternalForm"}
|
||||
{:name "toString"}
|
||||
{:name "toURI"}]}}})
|
||||
(cond->
|
||||
'{:all [java.io.BufferedReader
|
||||
java.io.BufferedWriter
|
||||
java.io.ByteArrayInputStream
|
||||
java.io.ByteArrayOutputStream
|
||||
java.io.File
|
||||
java.io.InputStream
|
||||
java.io.IOException
|
||||
java.io.OutputStream
|
||||
java.io.StringReader
|
||||
java.io.StringWriter
|
||||
java.lang.ArithmeticException
|
||||
java.lang.AssertionError
|
||||
java.lang.Boolean
|
||||
java.lang.Class
|
||||
java.lang.Double
|
||||
java.lang.Exception
|
||||
java.lang.Integer
|
||||
java.lang.Math
|
||||
java.util.concurrent.LinkedBlockingQueue
|
||||
java.lang.Object
|
||||
java.lang.String
|
||||
java.lang.System
|
||||
java.lang.Throwable
|
||||
java.lang.Process
|
||||
java.lang.ProcessBuilder
|
||||
java.lang.ProcessBuilder$Redirect
|
||||
java.net.URI
|
||||
java.net.HttpURLConnection
|
||||
java.net.ServerSocket
|
||||
java.net.Socket
|
||||
java.net.UnknownHostException
|
||||
java.net.URLEncoder
|
||||
java.net.URLDecoder
|
||||
java.nio.file.CopyOption
|
||||
java.nio.file.FileAlreadyExistsException
|
||||
java.nio.file.Files
|
||||
java.nio.file.LinkOption
|
||||
java.nio.file.NoSuchFileException
|
||||
java.nio.file.Path
|
||||
java.nio.file.Paths
|
||||
java.nio.file.StandardCopyOption
|
||||
java.nio.file.attribute.FileAttribute
|
||||
java.nio.file.attribute.FileTime
|
||||
java.nio.file.attribute.PosixFilePermission
|
||||
java.nio.file.attribute.PosixFilePermissions
|
||||
java.time.format.DateTimeFormatter
|
||||
java.time.Clock
|
||||
java.time.DateTimeException
|
||||
java.time.DayOfWeek
|
||||
java.time.Duration
|
||||
java.time.Instant
|
||||
java.time.LocalDate
|
||||
java.time.LocalDateTime
|
||||
java.time.LocalTime
|
||||
java.time.Month
|
||||
java.time.MonthDay
|
||||
java.time.OffsetDateTime
|
||||
java.time.OffsetTime
|
||||
java.time.Period
|
||||
java.time.Year
|
||||
java.time.YearMonth
|
||||
java.time.ZonedDateTime
|
||||
java.time.ZoneId
|
||||
java.time.ZoneOffset
|
||||
java.time.temporal.TemporalAccessor
|
||||
java.util.regex.Pattern
|
||||
java.util.Base64
|
||||
java.util.Base64$Decoder
|
||||
java.util.Base64$Encoder
|
||||
java.util.Date
|
||||
java.util.UUID
|
||||
java.util.concurrent.TimeUnit
|
||||
java.util.zip.InflaterInputStream
|
||||
java.util.zip.DeflaterInputStream
|
||||
java.util.zip.GZIPInputStream
|
||||
java.util.zip.GZIPOutputStream
|
||||
]
|
||||
:constructors []
|
||||
:methods [borkdude.graal.LockFix ;; support for locking
|
||||
sun.net.www.http.PosterOutputStream ;; support for clj-http-lite
|
||||
sun.net.www.protocol.https.HttpsURLConnectionImpl ;; support for clj-http-lite
|
||||
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream ;; support for clj-http-lite
|
||||
]
|
||||
:fields [clojure.lang.PersistentQueue]
|
||||
:instance-checks [clojure.lang.Delay
|
||||
clojure.lang.ExceptionInfo
|
||||
clojure.lang.IObj
|
||||
clojure.lang.IEditableCollection
|
||||
clojure.lang.LineNumberingPushbackReader
|
||||
clojure.lang.MapEntry]
|
||||
:custom {clojure.lang.LineNumberingPushbackReader {:allPublicConstructors true
|
||||
:allPublicMethods true}
|
||||
java.lang.Thread
|
||||
{:allPublicConstructors true
|
||||
;; generated with `public-declared-method-names`, see in
|
||||
;; `comment` below
|
||||
:methods [{:name "activeCount"}
|
||||
{:name "checkAccess"}
|
||||
{:name "currentThread"}
|
||||
{:name "dumpStack"}
|
||||
{:name "enumerate"}
|
||||
{:name "getAllStackTraces"}
|
||||
{:name "getContextClassLoader"}
|
||||
{:name "getDefaultUncaughtExceptionHandler"}
|
||||
{:name "getId"}
|
||||
{:name "getName"}
|
||||
{:name "getPriority"}
|
||||
{:name "getStackTrace"}
|
||||
{:name "getState"}
|
||||
{:name "getThreadGroup"}
|
||||
{:name "getUncaughtExceptionHandler"}
|
||||
{:name "holdsLock"}
|
||||
{:name "interrupt"}
|
||||
{:name "interrupted"}
|
||||
{:name "isAlive"}
|
||||
{:name "isDaemon"}
|
||||
{:name "isInterrupted"}
|
||||
{:name "join"}
|
||||
{:name "run"}
|
||||
{:name "setContextClassLoader"}
|
||||
{:name "setDaemon"}
|
||||
{:name "setDefaultUncaughtExceptionHandler"}
|
||||
{:name "setName"}
|
||||
{:name "setPriority"}
|
||||
{:name "setUncaughtExceptionHandler"}
|
||||
{:name "sleep"}
|
||||
{:name "start"}
|
||||
{:name "toString"}
|
||||
{:name "yield"}]}
|
||||
java.net.URL
|
||||
{:allPublicConstructors true
|
||||
:allPublicFields true
|
||||
;; generated with `public-declared-method-names`, see in
|
||||
;; `comment` below
|
||||
:methods [{:name "equals"}
|
||||
{:name "getAuthority"}
|
||||
{:name "getContent"}
|
||||
{:name "getDefaultPort"}
|
||||
{:name "getFile"}
|
||||
{:name "getHost"}
|
||||
{:name "getPath"}
|
||||
{:name "getPort"}
|
||||
{:name "getProtocol"}
|
||||
{:name "getQuery"}
|
||||
{:name "getRef"}
|
||||
{:name "getUserInfo"}
|
||||
{:name "hashCode"}
|
||||
{:name "openConnection"}
|
||||
{:name "openStream"}
|
||||
{:name "sameFile"}
|
||||
;; not supported: {:name "setURLStreamHandlerFactory"}
|
||||
{:name "toExternalForm"}
|
||||
{:name "toString"}
|
||||
{:name "toURI"}]}}}
|
||||
unix-like? (->
|
||||
(update :methods conj 'sun.nio.fs.UnixPath)
|
||||
(update :all conj
|
||||
'java.lang.UNIXProcess
|
||||
'java.lang.UNIXProcess$ProcessPipeOutputStream))))
|
||||
|
||||
(defmacro gen-class-map []
|
||||
(let [classes (concat (:default-classes classes)
|
||||
(keys (:custom-classes classes)))]
|
||||
(let [classes (concat (:all classes)
|
||||
(keys (:custom classes))
|
||||
(:constructors classes)
|
||||
(:methods classes)
|
||||
(:fields classes)
|
||||
(:instance-checks classes))]
|
||||
(apply hash-map
|
||||
(for [c classes
|
||||
c [(list 'quote c) c]]
|
||||
|
|
@ -166,22 +188,31 @@
|
|||
|
||||
(def class-map (gen-class-map))
|
||||
|
||||
#_(defn sym->class-name [sym]
|
||||
(-> sym str (str/replace "$" ".")))
|
||||
|
||||
(defn generate-reflection-file
|
||||
"Generate reflection.json file"
|
||||
[& args]
|
||||
(let [entries (vec (for [c (sort (:default-classes classes))
|
||||
(let [entries (vec (for [c (sort (:all classes))
|
||||
:let [class-name (str c)]]
|
||||
{:name class-name
|
||||
:allPublicMethods true
|
||||
:allPublicFields true
|
||||
:allPublicConstructors true}))
|
||||
custom-entries (for [[c v] (:custom-classes classes)
|
||||
constructors (vec (for [c (sort (:constructors classes))
|
||||
:let [class-name (str c)]]
|
||||
{:name class-name
|
||||
:allPublicConstructors true}))
|
||||
methods (vec (for [c (sort (:methods classes))
|
||||
:let [class-name (str c)]]
|
||||
{:name class-name
|
||||
:allPublicMethods true}))
|
||||
fields (vec (for [c (sort (:fields classes))
|
||||
:let [class-name (str c)]]
|
||||
{:name class-name
|
||||
:allPublicFields true}))
|
||||
custom-entries (for [[c v] (:custom classes)
|
||||
:let [class-name (str c)]]
|
||||
(assoc v :name class-name))
|
||||
all-entries (concat entries custom-entries)]
|
||||
all-entries (concat entries constructors methods fields custom-entries)]
|
||||
(spit (or
|
||||
(first args)
|
||||
"reflection.json") (json/generate-string all-entries {:pretty true}))))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
(ns babashka.impl.clojure.core
|
||||
{:no-doc true}
|
||||
(:refer-clojure :exclude [future]))
|
||||
(:refer-clojure :exclude [future])
|
||||
(:require [borkdude.graal.locking :as locking]))
|
||||
|
||||
(defn locking* [form bindings v f & args]
|
||||
(apply @#'locking/locking form bindings v f args))
|
||||
|
||||
(def core-extras
|
||||
{'file-seq file-seq
|
||||
|
|
@ -10,6 +14,7 @@
|
|||
'send-off send-off
|
||||
'promise promise
|
||||
'deliver deliver
|
||||
'locking (with-meta locking* {:sci/macro true})
|
||||
'shutdown-agents shutdown-agents
|
||||
'slurp slurp
|
||||
'spit spit
|
||||
|
|
|
|||
|
|
@ -307,6 +307,7 @@ Everything after that is bound to *command-line-args*."))
|
|||
Integer java.lang.Integer
|
||||
File java.io.File
|
||||
Math java.lang.Math
|
||||
Object java.lang.Object
|
||||
ProcessBuilder java.lang.ProcessBuilder
|
||||
String java.lang.String
|
||||
System java.lang.System
|
||||
|
|
|
|||
21
test/babashka/http_connection_test.clj
Normal file
21
test/babashka/http_connection_test.clj
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
(ns babashka.http-connection-test
|
||||
(:require
|
||||
[babashka.test-utils :as tu]
|
||||
[clojure.test :as t :refer [deftest is]]
|
||||
[clojure.string :as str]))
|
||||
|
||||
(defn bb [& args]
|
||||
(apply tu/bb nil (map str args)))
|
||||
|
||||
(deftest open-connection-test
|
||||
(is (= "\"1\"" (str/trim (bb "-e" "
|
||||
(require '[cheshire.core :as json])
|
||||
(let [conn (.openConnection (java.net.URL. \"https://postman-echo.com/get?foo=1\"))]
|
||||
(.setConnectTimeout conn 1000)
|
||||
(.setRequestProperty conn \"Content-Type\" \"application/json\") ;; nonsensical, but to test if this method exists
|
||||
(.connect conn)
|
||||
(let [is (.getInputStream conn)
|
||||
err (.getErrorStream conn)
|
||||
response (json/decode (slurp is) true)]
|
||||
(-> response :args :foo)))
|
||||
")))))
|
||||
Loading…
Reference in a new issue