16 changed files with 77 additions and 34 deletions
@ -0,0 +1,21 @@ |
|||||
|
package dtmsvr |
||||
|
|
||||
|
import ( |
||||
|
"testing" |
||||
|
|
||||
|
"github.com/stretchr/testify/assert" |
||||
|
"github.com/yedf/dtm/dtmcli" |
||||
|
) |
||||
|
|
||||
|
func TestUtils(t *testing.T) { |
||||
|
db := dbGet() |
||||
|
db.NoMust() |
||||
|
CronTransOnce(0) |
||||
|
err := dtmcli.CatchP(func() { |
||||
|
checkAffected(db.DB) |
||||
|
}) |
||||
|
assert.Error(t, err) |
||||
|
|
||||
|
CronExpiredTrans(1) |
||||
|
go sleepCronTime() |
||||
|
} |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"fmt" |
"fmt" |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"fmt" |
"fmt" |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"fmt" |
"fmt" |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"fmt" |
"fmt" |
||||
@ -0,0 +1,29 @@ |
|||||
|
package test |
||||
|
|
||||
|
import ( |
||||
|
"github.com/yedf/dtm/common" |
||||
|
"github.com/yedf/dtm/dtmcli" |
||||
|
"github.com/yedf/dtm/dtmsvr" |
||||
|
) |
||||
|
|
||||
|
var config = common.DtmConfig |
||||
|
|
||||
|
func dbGet() *common.DB { |
||||
|
return common.DbGet(config.DB) |
||||
|
} |
||||
|
|
||||
|
// WaitTransProcessed alias
|
||||
|
var WaitTransProcessed = dtmsvr.WaitTransProcessed |
||||
|
|
||||
|
// CronTransOnce alias
|
||||
|
var CronTransOnce = dtmsvr.CronTransOnce |
||||
|
var e2p = dtmcli.E2P |
||||
|
|
||||
|
// TransGlobal alias
|
||||
|
type TransGlobal = dtmsvr.TransGlobal |
||||
|
|
||||
|
// TransBranch alias
|
||||
|
type TransBranch = dtmsvr.TransBranch |
||||
|
|
||||
|
// M alias
|
||||
|
type M = dtmcli.M |
||||
@ -1,4 +1,4 @@ |
|||||
package dtmsvr |
package test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
Loading…
Reference in new issue