From 929db3d1d54887ab2dfe686a2fd40dbec6f3e6d9 Mon Sep 17 00:00:00 2001 From: geek Date: Thu, 11 May 2017 19:00:52 +0900 Subject: [PATCH] agent observer message modify --- config_manager_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config_manager_test.go b/config_manager_test.go index e2c37f1..7c4e416 100644 --- a/config_manager_test.go +++ b/config_manager_test.go @@ -17,7 +17,7 @@ func TestLoadConfig(t *testing.T) { // notify temp channel ch := make(chan interface{},0) - observer.Add(messages.CONFIGMANAGER_LOADED,ch) + observer.Add(messages.CFG_LOADED,ch) go func() { data :=<- ch c := data.(config_manager.ConfigManager) @@ -31,7 +31,7 @@ func TestLoadConfig(t *testing.T) { c.loadCrawlerConfigAll() assert.NotEqual(t, len(c.configs),0) - observer.Notify(messages.CONFIGMANAGER_LOADED,c) + observer.Notify(messages.CFG_LOADED,c) time.Sleep(1 * time.Second) } @@ -54,7 +54,7 @@ func TestAddConfig(t *testing.T) { ioutil.WriteFile("/root/gowork/src/loafle.com/overflow/config_manager_go/test_agent/" + m.Id,b,0644) // add test - observer.Notify(messages.ADD_SENSOR_0,"/root/gowork/src/loafle.com/overflow/config_manager_go/test_agent/" + m.Id) + observer.Notify(messages.TASK_SENSOR_ADD,"/root/gowork/src/loafle.com/overflow/config_manager_go/test_agent/" + m.Id) time.Sleep(1 * time.Second) } @@ -65,6 +65,6 @@ func TestRemoveConfig(t *testing.T) { _configManager.loadCrawlerConfigAll() // remove test - observer.Notify(messages.REMOVE_SENSOR_0,"d0fcc7b1-43a7-4acd-a7bf-c9572a9d4c9e") + observer.Notify(messages.TASK_SENSOR_REMOVE,"d0fcc7b1-43a7-4acd-a7bf-c9572a9d4c9e") time.Sleep(1 * time.Second) }