|
@@ -43,7 +43,7 @@ func TestKernelBusHttp(t *testing.T) {
|
|
|
handServ: mock_hand_serve.NewMockHandlerServe(qNameServ, "name_serv"),
|
|
handServ: mock_hand_serve.NewMockHandlerServe(qNameServ, "name_serv"),
|
|
|
}
|
|
}
|
|
|
ctx := kctx.GetKernelCtx()
|
|
ctx := kctx.GetKernelCtx()
|
|
|
- ctx.Set(defs.Txt("monolitName"), "test_monolit", "comment")
|
|
|
|
|
|
|
+ ctx.Set(defs.TxtFix("monolitName"), "test_monolit", "comment")
|
|
|
sf.get()
|
|
sf.get()
|
|
|
sf.req()
|
|
sf.req()
|
|
|
sf.sub()
|
|
sf.sub()
|
|
@@ -69,7 +69,7 @@ func (sf *tester) unsubGood2() {
|
|
|
}
|
|
}
|
|
|
req := &dot.UnsubReq{
|
|
req := &dot.UnsubReq{
|
|
|
HandlerName_: sf.handSub.Name().Get(),
|
|
HandlerName_: sf.handSub.Name().Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
}
|
|
}
|
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
|
body := strings.NewReader(string(binReq))
|
|
body := strings.NewReader(string(binReq))
|
|
@@ -140,7 +140,7 @@ func (sf *tester) unsubGood1() {
|
|
|
}
|
|
}
|
|
|
req := &dot.UnsubReq{
|
|
req := &dot.UnsubReq{
|
|
|
HandlerName_: sf.handSub.Name().Get(),
|
|
HandlerName_: sf.handSub.Name().Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
}
|
|
}
|
|
|
resp := Bus_.processUnsubRequest(req)
|
|
resp := Bus_.processUnsubRequest(req)
|
|
|
if resp.Status_.Get() != "ok" {
|
|
if resp.Status_.Get() != "ok" {
|
|
@@ -159,7 +159,7 @@ func (sf *tester) unsubBad2() {
|
|
|
}
|
|
}
|
|
|
req := &dot.UnsubReq{
|
|
req := &dot.UnsubReq{
|
|
|
HandlerName_: sf.handSub.Name().Get(),
|
|
HandlerName_: sf.handSub.Name().Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
}
|
|
}
|
|
|
resp := Bus_.processUnsubRequest(req)
|
|
resp := Bus_.processUnsubRequest(req)
|
|
|
if resp.Status_.Get() == "ok" {
|
|
if resp.Status_.Get() == "ok" {
|
|
@@ -193,7 +193,7 @@ func (sf *tester) pubGood2() {
|
|
|
sf.t.Log("pubGood2")
|
|
sf.t.Log("pubGood2")
|
|
|
req := &dot.PublishReq{
|
|
req := &dot.PublishReq{
|
|
|
Topic_: qNameSub.Get(),
|
|
Topic_: qNameSub.Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
BinMsg_: []byte("http_pub"),
|
|
BinMsg_: []byte("http_pub"),
|
|
|
}
|
|
}
|
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
@@ -259,7 +259,7 @@ func (sf *tester) pubBad2() {
|
|
|
|
|
|
|
|
req := &dot.PublishReq{
|
|
req := &dot.PublishReq{
|
|
|
Topic_: qNameSub.Get(),
|
|
Topic_: qNameSub.Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
BinMsg_: []byte("test_pub"),
|
|
BinMsg_: []byte("test_pub"),
|
|
|
}
|
|
}
|
|
|
resp := Bus_.processPublish(req)
|
|
resp := Bus_.processPublish(req)
|
|
@@ -277,7 +277,7 @@ func (sf *tester) pubGood1() {
|
|
|
}
|
|
}
|
|
|
req := &dot.PublishReq{
|
|
req := &dot.PublishReq{
|
|
|
Topic_: qNameSub.Get(),
|
|
Topic_: qNameSub.Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
BinMsg_: []byte("test_pub"),
|
|
BinMsg_: []byte("test_pub"),
|
|
|
}
|
|
}
|
|
|
_ = Bus_.processPublish(req)
|
|
_ = Bus_.processPublish(req)
|
|
@@ -321,8 +321,8 @@ func (sf *tester) subGood2() {
|
|
|
sf.t.Log("subGood2")
|
|
sf.t.Log("subGood2")
|
|
|
req := &dot.SubscribeReq{
|
|
req := &dot.SubscribeReq{
|
|
|
Topic_: qNameServ.Get(),
|
|
Topic_: qNameServ.Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
- WebHook_: defs.Txt("http://localhost:18200/bus/pub/"),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
|
|
+ WebHook_: defs.TxtFix("http://localhost:18200/bus/pub/"),
|
|
|
}
|
|
}
|
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
|
body := strings.NewReader(string(binReq))
|
|
body := strings.NewReader(string(binReq))
|
|
@@ -359,8 +359,8 @@ func (sf *tester) subBad3() {
|
|
|
sf.t.Log("subBad3")
|
|
sf.t.Log("subBad3")
|
|
|
req := &dot.SubscribeReq{
|
|
req := &dot.SubscribeReq{
|
|
|
Topic_: qNameServ.Get(),
|
|
Topic_: qNameServ.Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
- WebHook_: defs.Txt("http://localhost:18200/bus/pub/"),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
|
|
+ WebHook_: defs.TxtFix("http://localhost:18200/bus/pub/"),
|
|
|
}
|
|
}
|
|
|
defer func() {
|
|
defer func() {
|
|
|
if _panic := recover(); _panic != nil {
|
|
if _panic := recover(); _panic != nil {
|
|
@@ -381,8 +381,8 @@ func (sf *tester) subGood1() {
|
|
|
sf.t.Log("subGood1")
|
|
sf.t.Log("subGood1")
|
|
|
req := &dot.SubscribeReq{
|
|
req := &dot.SubscribeReq{
|
|
|
Topic_: qNameServ.Get(),
|
|
Topic_: qNameServ.Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
- WebHook_: defs.Txt("http://localhost:18200/bus/"),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
|
|
+ WebHook_: defs.TxtFix("http://localhost:18200/bus/"),
|
|
|
}
|
|
}
|
|
|
defer func() {
|
|
defer func() {
|
|
|
if _panic := recover(); _panic != nil {
|
|
if _panic := recover(); _panic != nil {
|
|
@@ -452,7 +452,7 @@ func (sf *tester) reqBad4() {
|
|
|
defer sf.handServ.IsBad_.Reset()
|
|
defer sf.handServ.IsBad_.Reset()
|
|
|
req := &dot.ServeReq{
|
|
req := &dot.ServeReq{
|
|
|
Topic_: sf.handServ.Topic().Get(),
|
|
Topic_: sf.handServ.Topic().Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
BinReq_: []byte("test_msg"),
|
|
BinReq_: []byte("test_msg"),
|
|
|
}
|
|
}
|
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
@@ -489,7 +489,7 @@ func (sf *tester) reqGood1() {
|
|
|
sf.t.Log("reqGood1")
|
|
sf.t.Log("reqGood1")
|
|
|
req := &dot.ServeReq{
|
|
req := &dot.ServeReq{
|
|
|
Topic_: sf.handServ.Topic().Get(),
|
|
Topic_: sf.handServ.Topic().Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
BinReq_: []byte("test_msg"),
|
|
BinReq_: []byte("test_msg"),
|
|
|
}
|
|
}
|
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
@@ -531,7 +531,7 @@ func (sf *tester) reqBad3() {
|
|
|
sf.t.Log("reqBad3")
|
|
sf.t.Log("reqBad3")
|
|
|
req := &dot.ServeReq{
|
|
req := &dot.ServeReq{
|
|
|
Topic_: qNameBad.Get(),
|
|
Topic_: qNameBad.Get(),
|
|
|
- Uuid_: defs.Txt(test_uuid),
|
|
|
|
|
|
|
+ Uuid_: defs.TxtFix(test_uuid),
|
|
|
BinReq_: []byte("test_msg"),
|
|
BinReq_: []byte("test_msg"),
|
|
|
}
|
|
}
|
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
binReq, _ := json.MarshalIndent(req, "", " ")
|
|
@@ -598,5 +598,5 @@ func (sf *tester) get() {
|
|
|
sf.t.Fatalf("get(): bus==nil")
|
|
sf.t.Fatalf("get(): bus==nil")
|
|
|
}
|
|
}
|
|
|
_ = GetKernelBusHttp()
|
|
_ = GetKernelBusHttp()
|
|
|
- Bus_.RegisterServe(sf.handServ).Hassert(defs.Txt("get()"))
|
|
|
|
|
|
|
+ Bus_.RegisterServe(sf.handServ).Hassert("get()")
|
|
|
}
|
|
}
|