Fix Actions.Clone(), activate test

This commit is contained in:
DanB
2016-11-25 19:43:39 +01:00
parent f29def2577
commit 309878d418
3 changed files with 17 additions and 23 deletions

View File

@@ -89,23 +89,21 @@ type actionTypeFunc func(*Account, *StatsQueueTriggered, *Action, Actions) error
func getActionFunc(typ string) (actionTypeFunc, bool) {
actionFuncMap := map[string]actionTypeFunc{
LOG: logAction,
CDRLOG: cdrLogAction,
RESET_TRIGGERS: resetTriggersAction,
SET_RECURRENT: setRecurrentAction,
UNSET_RECURRENT: unsetRecurrentAction,
ALLOW_NEGATIVE: allowNegativeAction,
DENY_NEGATIVE: denyNegativeAction,
RESET_ACCOUNT: resetAccountAction,
TOPUP_RESET: topupResetAction,
TOPUP: topupAction,
DEBIT_RESET: debitResetAction,
DEBIT: debitAction,
RESET_COUNTERS: resetCountersAction,
ENABLE_ACCOUNT: enableAccountAction,
DISABLE_ACCOUNT: disableAccountAction,
//case ENABLE_DISABLE_BALANCE:
// return enableDisableBalanceAction, true
LOG: logAction,
CDRLOG: cdrLogAction,
RESET_TRIGGERS: resetTriggersAction,
SET_RECURRENT: setRecurrentAction,
UNSET_RECURRENT: unsetRecurrentAction,
ALLOW_NEGATIVE: allowNegativeAction,
DENY_NEGATIVE: denyNegativeAction,
RESET_ACCOUNT: resetAccountAction,
TOPUP_RESET: topupResetAction,
TOPUP: topupAction,
DEBIT_RESET: debitResetAction,
DEBIT: debitAction,
RESET_COUNTERS: resetCountersAction,
ENABLE_ACCOUNT: enableAccountAction,
DISABLE_ACCOUNT: disableAccountAction,
CALL_URL: callUrl,
CALL_URL_ASYNC: callUrlAsync,
MAIL_ASYNC: mailAsync,
@@ -748,8 +746,7 @@ func (apl Actions) Sort() {
sort.Sort(apl)
}
func (apl *Actions) Clone() (interface{}, error) {
func (apl Actions) Clone() (interface{}, error) {
var cln Actions
if err := utils.Clone(apl, &cln); err != nil {
return nil, err

View File

@@ -65,7 +65,7 @@ func (apl *ActionPlan) Clone() (interface{}, error) {
if err := utils.Clone(*apl, cln); err != nil {
return nil, err
}
return interface{}(cln), nil
return cln, nil
}
func (t *Task) Execute() error {

View File

@@ -2373,7 +2373,6 @@ func TestClonedActions(t *testing.T) {
}
/**
func TestCacheGetClonedActions(t *testing.T) {
actions := Actions{
&Action{
@@ -2408,8 +2407,6 @@ func TestCacheGetClonedActions(t *testing.T) {
}
}
*/
/**************** Benchmarks ********************************/
func BenchmarkUUID(b *testing.B) {