fixes for cache movement

This commit is contained in:
Radu Ioan Fericean
2016-06-20 13:53:17 +03:00
parent 07479dcce0
commit 6eb68b5db7
7 changed files with 22 additions and 29 deletions

View File

@@ -22,7 +22,6 @@ import (
"testing"
"time"
"github.com/cgrates/cgrates/cache2go"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
@@ -78,16 +77,16 @@ RP_ANY,DR_ANY_1CNT,*any,10`
ratingDbAuth.CacheRatingAll()
acntDbAuth.CacheAccountingAll()
if cachedDests := cache2go.CountEntries(utils.DESTINATION_PREFIX); cachedDests != 1 {
if cachedDests := engine.CacheCountEntries(utils.DESTINATION_PREFIX); cachedDests != 1 {
t.Error("Wrong number of cached destinations found", cachedDests)
}
if cachedRPlans := cache2go.CountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 2 {
if cachedRPlans := engine.CacheCountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 2 {
t.Error("Wrong number of cached rating plans found", cachedRPlans)
}
if cachedRProfiles := cache2go.CountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 3 {
if cachedRProfiles := engine.CacheCountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 3 {
t.Error("Wrong number of cached rating profiles found", cachedRProfiles)
}
if cachedActions := cache2go.CountEntries(utils.ACTION_PREFIX); cachedActions != 1 {
if cachedActions := engine.CacheCountEntries(utils.ACTION_PREFIX); cachedActions != 1 {
t.Error("Wrong number of cached actions found", cachedActions)
}
}

View File

@@ -21,7 +21,6 @@ package general_tests
import (
"testing"
"github.com/cgrates/cgrates/cache2go"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -78,10 +77,10 @@ RP_SMS1,DR_SMS_1,ALWAYS,10`
ratingDb.CacheRatingAll()
acntDb.CacheAccountingAll()
if cachedRPlans := cache2go.CountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 3 {
if cachedRPlans := engine.CacheCountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 3 {
t.Error("Wrong number of cached rating plans found", cachedRPlans)
}
if cachedRProfiles := cache2go.CountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 3 {
if cachedRProfiles := engine.CacheCountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 3 {
t.Error("Wrong number of cached rating profiles found", cachedRProfiles)
}
}

View File

@@ -22,7 +22,6 @@ import (
"testing"
"time"
"github.com/cgrates/cgrates/cache2go"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -65,10 +64,10 @@ RP_DATA1,DR_DATA_2,TM2,10`
ratingDb.CacheRatingAll()
acntDb.CacheAccountingAll()
if cachedRPlans := cache2go.CountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 1 {
if cachedRPlans := engine.CacheCountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 1 {
t.Error("Wrong number of cached rating plans found", cachedRPlans)
}
if cachedRProfiles := cache2go.CountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 1 {
if cachedRProfiles := engine.CacheCountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 1 {
t.Error("Wrong number of cached rating profiles found", cachedRProfiles)
}
}

View File

@@ -22,7 +22,6 @@ import (
"testing"
"time"
"github.com/cgrates/cgrates/cache2go"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/scheduler"
"github.com/cgrates/cgrates/utils"
@@ -114,16 +113,16 @@ TOPUP10_AT,TOPUP10_AC1,ASAP,10`
ratingDb.CacheRatingAll()
acntDb.CacheAccountingAll()
if cachedDests := cache2go.CountEntries(utils.DESTINATION_PREFIX); cachedDests != 2 {
if cachedDests := engine.CacheCountEntries(utils.DESTINATION_PREFIX); cachedDests != 2 {
t.Error("Wrong number of cached destinations found", cachedDests)
}
if cachedRPlans := cache2go.CountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 2 {
if cachedRPlans := engine.CacheCountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 2 {
t.Error("Wrong number of cached rating plans found", cachedRPlans)
}
if cachedRProfiles := cache2go.CountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 2 {
if cachedRProfiles := engine.CacheCountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 2 {
t.Error("Wrong number of cached rating profiles found", cachedRProfiles)
}
if cachedActions := cache2go.CountEntries(utils.ACTION_PREFIX); cachedActions != 2 {
if cachedActions := engine.CacheCountEntries(utils.ACTION_PREFIX); cachedActions != 2 {
t.Error("Wrong number of cached actions found", cachedActions)
}
}

View File

@@ -22,7 +22,6 @@ import (
"testing"
"time"
"github.com/cgrates/cgrates/cache2go"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/scheduler"
"github.com/cgrates/cgrates/utils"
@@ -113,16 +112,16 @@ TOPUP10_AT,TOPUP10_AC1,ASAP,10`
ratingDb2.CacheRatingAll()
acntDb2.CacheAccountingAll()
if cachedDests := cache2go.CountEntries(utils.DESTINATION_PREFIX); cachedDests != 2 {
if cachedDests := engine.CacheCountEntries(utils.DESTINATION_PREFIX); cachedDests != 2 {
t.Error("Wrong number of cached destinations found", cachedDests)
}
if cachedRPlans := cache2go.CountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 2 {
if cachedRPlans := engine.CacheCountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 2 {
t.Error("Wrong number of cached rating plans found", cachedRPlans)
}
if cachedRProfiles := cache2go.CountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 2 {
if cachedRProfiles := engine.CacheCountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 2 {
t.Error("Wrong number of cached rating profiles found", cachedRProfiles)
}
if cachedActions := cache2go.CountEntries(utils.ACTION_PREFIX); cachedActions != 2 {
if cachedActions := engine.CacheCountEntries(utils.ACTION_PREFIX); cachedActions != 2 {
t.Error("Wrong number of cached actions found", cachedActions)
}
}

View File

@@ -22,7 +22,6 @@ import (
"testing"
"time"
"github.com/cgrates/cgrates/cache2go"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/scheduler"
"github.com/cgrates/cgrates/utils"
@@ -111,16 +110,16 @@ RP_UK,DR_UK_Mobile_BIG5,ALWAYS,10`
ratingDb3.CacheRatingAll()
acntDb3.CacheAccountingAll()
if cachedDests := cache2go.CountEntries(utils.DESTINATION_PREFIX); cachedDests != 2 {
if cachedDests := engine.CacheCountEntries(utils.DESTINATION_PREFIX); cachedDests != 2 {
t.Error("Wrong number of cached destinations found", cachedDests)
}
if cachedRPlans := cache2go.CountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 2 {
if cachedRPlans := engine.CacheCountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 2 {
t.Error("Wrong number of cached rating plans found", cachedRPlans)
}
if cachedRProfiles := cache2go.CountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 2 {
if cachedRProfiles := engine.CacheCountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 2 {
t.Error("Wrong number of cached rating profiles found", cachedRProfiles)
}
if cachedActions := cache2go.CountEntries(utils.ACTION_PREFIX); cachedActions != 1 {
if cachedActions := engine.CacheCountEntries(utils.ACTION_PREFIX); cachedActions != 1 {
t.Error("Wrong number of cached actions found", cachedActions)
}
}

View File

@@ -22,7 +22,6 @@ import (
"testing"
"time"
"github.com/cgrates/cgrates/cache2go"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -61,10 +60,10 @@ func TestSMSLoadCsvTpSmsChrg1(t *testing.T) {
ratingDb.CacheRatingAll()
acntDb.CacheAccountingAll()
if cachedRPlans := cache2go.CountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 1 {
if cachedRPlans := engine.CacheCountEntries(utils.RATING_PLAN_PREFIX); cachedRPlans != 1 {
t.Error("Wrong number of cached rating plans found", cachedRPlans)
}
if cachedRProfiles := cache2go.CountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 1 {
if cachedRProfiles := engine.CacheCountEntries(utils.RATING_PROFILE_PREFIX); cachedRProfiles != 1 {
t.Error("Wrong number of cached rating profiles found", cachedRProfiles)
}
}