SMG - session indexing implementation with tests

This commit is contained in:
DanB
2016-08-25 09:21:32 +02:00
parent dda8fdd106
commit 8a27dfc4d2
10 changed files with 264 additions and 23 deletions

View File

@@ -42,7 +42,7 @@ func TestBalanceStoreRestore(t *testing.T) {
if err != nil {
t.Error("Error restoring balance: ", err)
}
t.Logf("INITIAL: %+v", b)
//t.Logf("INITIAL: %+v", b)
if !b.Equal(b1) {
t.Errorf("Balance store/restore failed: expected %+v was %+v", b, b1)
}
@@ -321,7 +321,7 @@ func TestDebitCreditZeroMinute(t *testing.T) {
if err != nil {
t.Error("Error debiting balance: ", err)
}
t.Logf("%+v", cc.Timespans)
//t.Logf("%+v", cc.Timespans)
if cc.Timespans[0].Increments[0].BalanceInfo.Unit.UUID != "testb" ||
cc.Timespans[0].Increments[0].Duration != time.Minute {
t.Error("Error setting balance id to increment: ", cc.Timespans[0].Increments[0])

View File

@@ -827,6 +827,11 @@ func (cdr *CDR) AsExportRecord(exportFields []*config.CfgCdrField, costShiftDigi
return expRecord, nil
}
// Part of event interface
func (cdr *CDR) AsMapStringIface() (map[string]interface{}, error) {
return nil, utils.ErrNotImplemented
}
type ExternalCDR struct {
CGRID string
RunID string

View File

@@ -51,4 +51,5 @@ type Event interface {
String() string
AsEvent(string) Event
ComputeLcr() bool
AsMapStringIface() (map[string]interface{}, error)
}