當前位置: 首頁>>代碼示例>>Golang>>正文


Golang engine.InitDataDb函數代碼示例

本文整理匯總了Golang中github.com/cgrates/cgrates/engine.InitDataDb函數的典型用法代碼示例。如果您正苦於以下問題:Golang InitDataDb函數的具體用法?Golang InitDataDb怎麽用?Golang InitDataDb使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了InitDataDb函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: TestSMGRplcResetDB

// Remove data in both rating and accounting db
func TestSMGRplcResetDB(t *testing.T) {
	if err := engine.InitDataDb(smgRplcMasterCfg); err != nil {
		t.Fatal(err)
	}
	if err := engine.InitStorDb(smgRplcMasterCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:cgrates,項目名稱:cgrates,代碼行數:9,代碼來源:smgreplc_it_test.go

示例2: TestSTIResetDataDb

// Remove data in both rating and accounting db
func TestSTIResetDataDb(t *testing.T) {
	if !*testSureTax {
		return
	}
	if err := engine.InitDataDb(stiCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:henrylee2cn,項目名稱:cgrates,代碼行數:9,代碼來源:suretax_it_test.go

示例3: TestV2CdrsMongoInitDataDb

func TestV2CdrsMongoInitDataDb(t *testing.T) {
	if !*testLocal {
		return
	}
	if err := engine.InitDataDb(cdrsMongoCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:iwada,項目名稱:cgrates,代碼行數:8,代碼來源:cdrs_mongo_local_test.go

示例4: TestApierV2itResetDataDb

// Remove data in both rating and accounting db
func TestApierV2itResetDataDb(t *testing.T) {
	if !*testIT {
		return
	}
	if err := engine.InitDataDb(apierCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:rinor,項目名稱:cgrates,代碼行數:9,代碼來源:apierv2_it_test.go

示例5: TestTutKamCallsResetDataDb

// Remove data in both rating and accounting db
func TestTutKamCallsResetDataDb(t *testing.T) {
	if !*testCalls {
		return
	}
	if err := engine.InitDataDb(tutKamCallsCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:bhepp,項目名稱:cgrates,代碼行數:9,代碼來源:tutorial_kam_calls_test.go

示例6: TestV2CDRsPSQLInitDataDb

func TestV2CDRsPSQLInitDataDb(t *testing.T) {
	if !*testLocal {
		return
	}
	if err := engine.InitDataDb(cdrsPsqlCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:iwada,項目名稱:cgrates,代碼行數:8,代碼來源:cdrs_psql_local_test.go

示例7: TestCDRStatsLclInitDataDb

func TestCDRStatsLclInitDataDb(t *testing.T) {
	if !*testLocal {
		return
	}
	if err := engine.InitDataDb(cdrstCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:eloycoto,項目名稱:cgrates,代碼行數:8,代碼來源:cdrstatsv1_local_test.go

示例8: TestSMGV1ResetDataDb

// Remove data in both rating and accounting db
func TestSMGV1ResetDataDb(t *testing.T) {
	if !*testLocal {
		return
	}
	if err := engine.InitDataDb(smgV1Cfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:kevinlovesing,項目名稱:cgrates,代碼行數:9,代碼來源:smgenericv1_it_test.go

示例9: TestTutLocalResetDataDb

// Remove data in both rating and accounting db
func TestTutLocalResetDataDb(t *testing.T) {
	if !*testLocal {
		return
	}
	if err := engine.InitDataDb(tutFsLocalCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:nikbyte,項目名稱:cgrates,代碼行數:9,代碼來源:tutorial_local_test.go

示例10: TestMCDRCResetDataDb

// Remove data in both rating and accounting db
func TestMCDRCResetDataDb(t *testing.T) {
	if !*testLocal {
		return
	}
	if err := engine.InitDataDb(cfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:eloycoto,項目名稱:cgrates,代碼行數:9,代碼來源:multiplecdrc_local_test.go

示例11: TestTPitResetDataDb

// Remove data in both rating and accounting db
func TestTPitResetDataDb(t *testing.T) {
	if !*testTP {
		return
	}
	if err := engine.InitDataDb(tpCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:iwada,項目名稱:cgrates,代碼行數:9,代碼來源:tp_it_test.go

示例12: TestSMGResetDataDb

// Remove data in both rating and accounting db
func TestSMGResetDataDb(t *testing.T) {
	if !*testIntegration {
		return
	}
	if err := engine.InitDataDb(daCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:bhepp,項目名稱:cgrates,代碼行數:9,代碼來源:smg_it_test.go

示例13: TestDestManagCacheWithGetCache

func TestDestManagCacheWithGetCache(t *testing.T) {
	if !*testIntegration {
		return
	}
	if err := engine.InitDataDb(destCfg); err != nil {
		t.Fatal(err)
	}
	var reply string
	if err := destRPC.Call("ApierV1.ReloadCache", utils.AttrReloadCache{}, &reply); err != nil {
		t.Error("Got error on ApierV1.ReloadCache: ", err.Error())
	} else if reply != utils.OK {
		t.Errorf("Calling ApierV1.ReloadCache received: %+v", reply)
	}
	attrs := &utils.AttrLoadTpFromFolder{FolderPath: path.Join(*dataDir, "tariffplans", "test", "destinations", "cacheall"), FlushDb: true}
	if err := destRPC.Call("ApierV2.LoadTariffPlanFromFolder", attrs, &destLoadInst); err != nil {
		t.Error(err)
	} else if destLoadInst.RatingLoadID == "" || destLoadInst.AccountingLoadID == "" {
		t.Error("Empty loadId received, loadInstance: ", destLoadInst)
	}
	time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Give time for scheduler to execute topups

	dests := make([]*engine.Destination, 0)
	if err := destRPC.Call("ApierV2.GetDestinations", v2.AttrGetDestinations{DestinationIDs: []string{}}, &dests); err != nil {
		t.Error("Got error on ApierV2.GetDestinations: ", err.Error())
	} else if len(dests) != 1 {
		t.Errorf("Calling ApierV2.GetDestinations got reply: %v", utils.ToIJSON(dests))
	}

	var rcvStats utils.CacheStats
	if err := destRPC.Call("ApierV1.GetCacheStats", utils.AttrCacheStats{}, &rcvStats); err != nil {
		t.Error("Got error on ApierV1.GetCacheStats: ", err.Error())
	} else if rcvStats.Destinations != 2 {
		t.Errorf("Calling ApierV1.GetCacheStats received: %+v", rcvStats)
	}

	attrs = &utils.AttrLoadTpFromFolder{FolderPath: path.Join(*dataDir, "tariffplans", "test", "destinations", "cacheone"), FlushDb: true}
	if err := destRPC.Call("ApierV2.LoadTariffPlanFromFolder", attrs, &destLoadInst); err != nil {
		t.Error(err)
	} else if destLoadInst.RatingLoadID == "" || destLoadInst.AccountingLoadID == "" {
		t.Error("Empty loadId received, loadInstance: ", destLoadInst)
	}
	time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Give time for scheduler to execute topups

	dests = make([]*engine.Destination, 0)
	if err := destRPC.Call("ApierV2.GetDestinations", v2.AttrGetDestinations{DestinationIDs: []string{}}, &dests); err != nil {
		t.Error("Got error on ApierV2.GetDestinations: ", err.Error())
	} else if len(dests) != 1 {
		t.Errorf("Calling ApierV2.GetDestinations got reply: %v", utils.ToIJSON(dests))
	}

	if err := destRPC.Call("ApierV1.GetCacheStats", utils.AttrCacheStats{}, &rcvStats); err != nil {
		t.Error("Got error on ApierV1.GetCacheStats: ", err.Error())
	} else if rcvStats.Destinations != 1 {
		t.Errorf("Calling ApierV1.GetCacheStats received: %+v", rcvStats)
	}
}
開發者ID:iwada,項目名稱:cgrates,代碼行數:56,代碼來源:dest_management_it_test.go

示例14: TestRPCITLclInitCfg

func TestRPCITLclInitCfg(t *testing.T) {
	rpcITCfgPath1 = path.Join(*dataDir, "conf", "samples", "multiral1")
	rpcITCfgPath2 = path.Join(*dataDir, "conf", "samples", "multiral2")
	rpcITCfg1, err = config.NewCGRConfigFromFolder(rpcITCfgPath1)
	if err != nil {
		t.Error(err)
	}
	rpcITCfg2, err = config.NewCGRConfigFromFolder(rpcITCfgPath2)
	if err != nil {
		t.Error(err)
	}
	if err := engine.InitDataDb(rpcITCfg1); err != nil {
		t.Fatal(err)
	}
}
開發者ID:cgrates,項目名稱:cgrates,代碼行數:15,代碼來源:rpcclient_it_test.go

示例15: testV2CDRsInitDataDb

func testV2CDRsInitDataDb(t *testing.T) {
	if err := engine.InitDataDb(cdrsCfg); err != nil {
		t.Fatal(err)
	}
}
開發者ID:cgrates,項目名稱:cgrates,代碼行數:5,代碼來源:cdrs_it_test.go


注:本文中的github.com/cgrates/cgrates/engine.InitDataDb函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。