File: custom_exit_behavior_test.clj

package info (click to toggle)
trapperkeeper-clojure 4.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 964 kB
  • sloc: sh: 189; xml: 73; makefile: 25; java: 5
file content (16 lines) | stat: -rw-r--r-- 606 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(ns puppetlabs.trapperkeeper.custom-exit-behavior-test
  (:require
   [puppetlabs.trapperkeeper.core :as core]))

(defprotocol CustomExitBehaviorTestService)

(core/defservice custom-exit-behavior-test-service
  CustomExitBehaviorTestService
  [[:ShutdownService request-shutdown]]
  (init [this context] context)
  (start [this context]
         (request-shutdown {::core/exit {:messages [["Some excitement!\n" *out*]
                                                    ["More excitement!\n" *err*]]
                                         :status 7}})
         context)
  (stop [this context] context))