Skip to content

Commit

Permalink
added simple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
source-c committed Nov 2, 2022
1 parent 606c136 commit 943d96a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
8 changes: 7 additions & 1 deletion profiles.clj
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{:dev {:global-vars {*warn-on-reflection* true}
:dependencies [[org.clojure/clojure "1.11.1"]]}
:dependencies [[org.clojure/clojure "1.11.1"]
[ch.qos.logback/logback-classic "1.2.11"
:exclusions [org.slf4j/slf4j-api]]
[org.slf4j/jul-to-slf4j "1.7.36"]
[org.slf4j/jcl-over-slf4j "1.7.36"]
[org.slf4j/log4j-over-slf4j "1.7.36"]
[org.clojure/tools.logging "1.2.4"]]}
:provided {:jar-exclusions [#"test.properties"]}}
6 changes: 6 additions & 0 deletions resources/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ front.2.0.mode=some
front.2.1.type=ttt
front.4.2.mode=zzz
front.4.2.type=1

service[0]="foo"
service[1].bar = "bar"
service[2][1]= "baz"

scheduler."threadPool.threadCount"=12
15 changes: 15 additions & 0 deletions test/base.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(ns base
(:require [clojure.test :refer :all]
[java-properties.core :refer :all]
[clojure.tools.logging :as log]))

(deftest basic
(testing "embedded sample (simple test)"
(let [config (load-config "test")]
(log/info nil config)
(is (-> config :backend :0 :enabled))
(is (= (-> config :scheduler :threadPool.threadCount) 12)))
(let [config (load-config "test" {:with-arrays true})]
(log/info {:with-arrays true} config)
(is (-> config :backend first :enabled))
(is (= (-> config :scheduler :threadPool.threadCount) 12)))))

0 comments on commit 943d96a

Please sign in to comment.