From e62fd7b28be1093b09401e396c4c88076e77dfa8 Mon Sep 17 00:00:00 2001 From: andronache Date: Thu, 17 Dec 2020 14:55:59 +0200 Subject: [PATCH] Continuing tests for services --- services/sipagent_it_test.go | 4 ++++ services/stordb_it_test.go | 39 ++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 services/stordb_it_test.go diff --git a/services/sipagent_it_test.go b/services/sipagent_it_test.go index e22d8a851..b88218574 100644 --- a/services/sipagent_it_test.go +++ b/services/sipagent_it_test.go @@ -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 ,\n Received <%+v>", err) diff --git a/services/stordb_it_test.go b/services/stordb_it_test.go new file mode 100644 index 000000000..bd806cfae --- /dev/null +++ b/services/stordb_it_test.go @@ -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 +*/ +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") + } + +}