--- /dev/null
+package servicemgr
+
+import (
+ "strings"
+ "testing"
+)
+
+
+const (
+ serviceName = "ls"
+ serviceName2 = "main2"
+)
+
+func assertEqualStr(t *testing.T, a, b string) {
+ t.Helper()
+ if strings.Compare(a, b) != 0 {
+ t.Errorf("%s != %s", a, b)
+ }
+}
+
+func retError(t *testing.T, err error) {
+ t.Helper()
+
+ if err != nil {
+ t.Error(err.Error())
+ }
+}
serviceID uint64
)
-const (
- serviceName = "ls"
- serviceName2 = "main2"
-)
-
func init() {
- InitServiceMap()
-}
-
-func retError(t *testing.T, err error) {
- t.Helper()
-
- if err != nil {
- t.Error(err.Error())
- }
+ Init()
}
func TestExecuteApp(t *testing.T) {
retError(t, err)
statusNotificationRequest := make(map[string]interface{})
- statusNotificationRequest["ServiceID"] = id
- statusNotificationRequest["Status"] = ConstServiceStatusFinished
+ statusNotificationRequest[ConstKeyServiceID] = id
+ statusNotificationRequest[ConstKeyStatus] = ConstServiceStatusFinished
HandleNoti(statusNotificationRequest)