Documentation ¶
Index ¶
- Constants
- Variables
- func BuildTestLockInformation(t *testing.T, version ...storage.Version) *storage.LockInformation
- func TestEnsureLockNotExists(t *testing.T, s storage.Storage, lockId ...string)
- func TestStorage(t *testing.T, storage storage.Storage)
- func TestStorage_Close(t *testing.T, storage storage.Storage)
- func TestStorage_CreateWithVersion(t *testing.T, s storage.Storage)
- func TestStorage_DeleteWithVersion(t *testing.T, s storage.Storage)
- func TestStorage_Get(t *testing.T, s storage.Storage)
- func TestStorage_GetName(t *testing.T, storage storage.Storage)
- func TestStorage_GetTime(t *testing.T, s storage.Storage)
- func TestStorage_Init(t *testing.T, storage storage.Storage)
- func TestStorage_List(t *testing.T, s storage.Storage)
- func TestStorage_UpdateWithVersion(t *testing.T, storage storage_pkg.Storage)
Constants ¶
View Source
const ( // TestDatabaseName 测试时使用到的数据库的名称 TestDatabaseName = "storage_lock_test" // TestTableName 测试时使用到的表的名称 TestTableName = "storage_lock_test" // TestLockId 测试时使用的锁的名称 TestLockId = "lock_id_for_test" // TestLockVersion 测试时使用到的版本号 TestLockVersion = 1 // TestOwnerIdA 竞争锁的其中一个owner TestOwnerIdA = "owner_id_A" // TestOwnerIdB 竞争锁的另一个owner TestOwnerIdB = "owner_id_B" )
单元测试统一使用的一些常量
Variables ¶
View Source
var ( // DefaultContextTimeout 操作需要在五分钟内完成 DefaultContextTimeout = time.Minute * 5 )
Functions ¶
func BuildTestLockInformation ¶
BuildTestLockInformation 创建一个单元测试中使用的锁的信息
func TestEnsureLockNotExists ¶
TestEnsureLockNotExists 确保给定的锁在数据库中不存在,如果存在的话则将其删除
func TestStorage ¶
TestStorage 用于测试Storage的实现是否OK
func TestStorage_Close ¶
TestStorage_Close 用于测试Storage的Close实现是否正确
func TestStorage_CreateWithVersion ¶ added in v0.0.2
func TestStorage_Get ¶
func TestStorage_GetName ¶
func TestStorage_GetTime ¶
func TestStorage_Init ¶
func TestStorage_List ¶ added in v0.0.3
func TestStorage_UpdateWithVersion ¶
func TestStorage_UpdateWithVersion(t *testing.T, storage storage_pkg.Storage)
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.