Skip to content

Commit

Permalink
增加单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Nov 22, 2023
1 parent faa1940 commit 10e2411
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions trace/trace_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package trace

import (
"fmt"
"github.com/farseer-go/fs/trace/eumCallType"
"testing"
)

func TestTrace(t *testing.T) {
emptyManager := EmptyManager{}
emptyManager.GetCurTrace()
emptyManager.TraceDatabase()
emptyManager.TraceEtcd("", "", 0)
emptyManager.TraceElasticsearch("", "", "")
emptyManager.TraceHand("")
emptyManager.TraceMq("", "", "")
emptyManager.EntryFSchedule("", 0, 0)
emptyManager.EntryMqConsumer("", "", "")
emptyManager.EntryQueueConsumer("")
emptyManager.EntryTask("")
emptyManager.EntryWatchKey("")
emptyManager.EntryWebApi("", "", "", "", nil, "", "")
emptyManager.TraceDatabaseOpen("", "")
emptyManager.TraceHttp("", "")
emptyManager.TraceKeyLocation("")
emptyManager.TraceMqSend("", "", "", "")
emptyManager.TraceRedis("", "", "")

eumCallType.Http.ToString()
eumCallType.Grpc.ToString()
eumCallType.Database.ToString()
eumCallType.Redis.ToString()
eumCallType.Mq.ToString()
eumCallType.Elasticsearch.ToString()
eumCallType.Etcd.ToString()
eumCallType.Hand.ToString()
eumCallType.KeyLocation.ToString()

detail := BaseTraceDetail{}
detail.End(fmt.Errorf(""))
detail.Ignore()
detail.GetLevel()
detail.IsIgnore()
detail.SetSql("", "", "", 0)
}

0 comments on commit 10e2411

Please sign in to comment.