X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fteststub%2Ftestwrapper.go;h=7752be825bc2357ffc279aaae2d3d3048ac666f0;hb=9dc5adc78d459157a42ef8997eeced82a3616f01;hp=f27392dbeda6909acf242e1dda976dd06db58537;hpb=f3f4efb9be78f25d3417ecbbce3ea988550e5381;p=ric-plt%2Fsubmgr.git diff --git a/pkg/teststub/testwrapper.go b/pkg/teststub/testwrapper.go index f27392d..7752be8 100644 --- a/pkg/teststub/testwrapper.go +++ b/pkg/teststub/testwrapper.go @@ -20,23 +20,31 @@ package teststub import ( "fmt" - "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/xapptweaks" + "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" + "strings" "testing" ) type TestWrapper struct { - xapptweaks.LogWrapper + *xapp.Log + desc string } func (tw *TestWrapper) Init(desc string) { - tw.LogWrapper.Init(desc) + tw.desc = strings.ToUpper(desc) + tw.Log = xapp.NewLogger(tw.desc) + //tw.SetLevel(defaultLogLevel) +} + +func (tw *TestWrapper) GetDesc() string { + return tw.desc } //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- func (tw *TestWrapper) TestError(t *testing.T, pattern string, args ...interface{}) { - tw.Logger.Error(fmt.Sprintf(pattern, args...)) + tw.Error(fmt.Sprintf(pattern, args...)) t.Errorf(fmt.Sprintf(pattern, args...)) } @@ -44,7 +52,7 @@ func (tw *TestWrapper) TestError(t *testing.T, pattern string, args ...interface // //----------------------------------------------------------------------------- func (tw *TestWrapper) TestLog(t *testing.T, pattern string, args ...interface{}) { - tw.Logger.Info(fmt.Sprintf(pattern, args...)) + tw.Info(fmt.Sprintf(pattern, args...)) t.Logf(fmt.Sprintf(pattern, args...)) }