scoringmgr_test dynamic loading mysum so file and run
authorjaehoon.hyun <jaehoon.hyun@samsung.com>
Thu, 28 Mar 2019 08:02:24 +0000 (17:02 +0900)
committerjaehoon.hyun <jaehoon.hyun@samsung.com>
Thu, 28 Mar 2019 08:02:24 +0000 (17:02 +0900)
src/scoringmgr/scoringmgr_test.go [new file with mode: 0644]

diff --git a/src/scoringmgr/scoringmgr_test.go b/src/scoringmgr/scoringmgr_test.go
new file mode 100644 (file)
index 0000000..8dbc174
--- /dev/null
@@ -0,0 +1,38 @@
+package scoringmgr_test
+
+import (
+  "testing"
+  "time"
+
+  confdescription "configuremgr/description"
+  scoringmgr      "scoringmgr"
+  mockscoringmgr  "scoringmgr/mock"
+
+  "gopkg.in/sconf/ini.v0"
+       "gopkg.in/sconf/sconf.v0"
+)
+
+
+func TestBasicMockScoringMgr(t *testing.T){
+
+  scoringHandlers := scoringmgr.Init()
+  scoringHandlers.IloadScoringLibrary = mockscoringmgr.LoadScoringAdd
+  scoringHandlers.Ch                  = make(chan interface{}, 1024)
+
+  scoringHandlers.Listening()
+
+  time.Sleep(time.Duration(1 * time.Second))
+  
+  libPath  := "mock/mysum/libmysum.so"
+  confPath := "mock/mysum/mysum.conf"
+
+  cfg := new(confdescription.Doc)
+  sconf.Must(cfg).Read(ini.File(confPath))
+  scoringmgr.PushLibPath(libPath, cfg, scoringHandlers.Ch)
+  
+  time.Sleep(time.Duration(5) * time.Second)
+
+
+
+
+}
\ No newline at end of file