From 4830883d78f491fa97a17fd1ed165e2dce5f5a49 Mon Sep 17 00:00:00 2001 From: circlespainter Date: Fri, 29 May 2015 15:46:51 +0200 Subject: [PATCH] :fire: Remove stale test file --- src/main/clojure/test.clj | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/main/clojure/test.clj diff --git a/src/main/clojure/test.clj b/src/main/clojure/test.clj deleted file mode 100644 index 46ffb8b..0000000 --- a/src/main/clojure/test.clj +++ /dev/null @@ -1,28 +0,0 @@ -(ns test -"Verify that exceptions thrown on a thread pool managed by -core.async will propagate out to the JVM's default uncaught -exception handler." -(:require - [clojure.stacktrace :refer [root-cause]] - [co.paralleluniverse.pulsar.core :as p] - [co.paralleluniverse.pulsar.async :refer [chan go thread put! take! !!]]) -(:import (co.paralleluniverse.fibers Fiber) - (co.paralleluniverse.strands Strand$UncaughtExceptionHandler))) - -(defn with-default-uncaught-exception-handler-thread [handler f] - (let [old-handler-thread (Thread/getDefaultUncaughtExceptionHandler)] - (Thread/setDefaultUncaughtExceptionHandler - (reify Thread$UncaughtExceptionHandler - (uncaughtException [_ thread throwable] - (println "Called generic handler") (handler thread throwable)))) - (f) - (Thread/setDefaultUncaughtExceptionHandler old-handler-thread))) - -(defn -main [] - (let [log (p/promise) - ex (Exception. "This exception is expected")] - (with-default-uncaught-exception-handler-thread - (fn [_ throwable] (println "Called handler") (deliver log throwable)) - #(let [ret (thread (println "Throwing") (throw ex))] - (