Add some Serializable tests (exceptions)

This commit is contained in:
Peter Taoussanis 2013-10-24 13:50:55 +07:00
parent 9448d2b3ce
commit 8f8ab99e95
3 changed files with 13 additions and 3 deletions

View file

@ -90,7 +90,12 @@ nippy/stress-data
:uuid (java.util.UUID/randomUUID)
:date (java.util.Date.)
:stress-record (->StressRecord "data")}
:stress-record (->StressRecord "data")
;; Serializable
:throwable (Throwable. "Yolo")
:exception (try (/ 1 0) (catch Exception e e))
:ex-info (ex-info "ExInfo" {:data "data"})}
```
Serialize it:

View file

@ -481,7 +481,12 @@
:uuid (java.util.UUID/randomUUID)
:date (java.util.Date.)
:stress-record (->StressRecord "data")}))
:stress-record (->StressRecord "data")
;; Serializable
:throwable (Throwable. "Yolo")
:exception (try (/ 1 0) (catch Exception e e))
:ex-info (ex-info "ExInfo" {:data "data"})}))
;;;; Deprecated API

View file

@ -5,7 +5,7 @@
[taoensso.nippy.benchmarks :as benchmarks]))
;; Remove stuff from stress-data that breaks roundtrip equality
(def test-data (dissoc nippy/stress-data :bytes))
(def test-data (dissoc nippy/stress-data :bytes :throwable :exception :ex-info))
(defn- before-run {:expectations-options :before-run} [])
(defn- after-run {:expectations-options :after-run} [])