Continuing tests for services

This commit is contained in:
andronache
2020-12-17 14:55:59 +02:00
committed by Dan Christian Bogos
parent a97fd0ed22
commit e62fd7b28b
2 changed files with 43 additions and 0 deletions

View File

@@ -78,6 +78,10 @@ func TestSIPAgentReload(t *testing.T) {
if !srv.IsRunning() {
t.Errorf("Expected service to be running")
}
srvStart := srv.Start()
if srvStart != utils.ErrServiceAlreadyRunning {
t.Errorf("\nExpecting <%+v>,\n Received <%+v>", utils.ErrServiceAlreadyRunning, srvStart)
}
err := srv.Reload()
if err != nil {
t.Errorf("\nExpecting <err>,\n Received <%+v>", err)

View File

@@ -0,0 +1,39 @@
// +build integration
/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package services
import (
"sync"
"testing"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/utils"
)
//TestStorDBServiceCoverage for cover testing
func TestStorDBServiceCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
srv := NewStorDBService(cfg, srvDep)
if srv.IsRunning() {
t.Errorf("Expected service to be running")
}
}