|
|
|
@ -27,63 +27,78 @@ var protected Database.DBQueryResult resultType;
|
|
|
|
|
var protected Database.DataType resultDataType; |
|
|
|
|
var protected HashTable resultData; |
|
|
|
|
var protected AcediaObject resultObject; |
|
|
|
|
var protected int resultRequestID; |
|
|
|
|
|
|
|
|
|
protected function DBReadingHandler( |
|
|
|
|
Database.DBQueryResult result, |
|
|
|
|
AcediaObject data, |
|
|
|
|
Database source) |
|
|
|
|
Database source, |
|
|
|
|
int requestID) |
|
|
|
|
{ |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultObject = data; |
|
|
|
|
default.resultData = HashTable(data); |
|
|
|
|
default.resultRequestID = requestID; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected function DBKeysHandler( |
|
|
|
|
Database.DBQueryResult result, |
|
|
|
|
ArrayList keys, |
|
|
|
|
Database source) |
|
|
|
|
Database source, |
|
|
|
|
int requestID) |
|
|
|
|
{ |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultKeys = keys; |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultKeys = keys; |
|
|
|
|
default.resultRequestID = requestID; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected function DBCheckHandler( |
|
|
|
|
Database.DBQueryResult result, |
|
|
|
|
Database.DataType type, |
|
|
|
|
Database source) |
|
|
|
|
Database source, |
|
|
|
|
int requestID) |
|
|
|
|
{ |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultDataType = type; |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultDataType = type; |
|
|
|
|
default.resultRequestID = requestID; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected function DBSizeHandler( |
|
|
|
|
Database.DBQueryResult result, |
|
|
|
|
int size, |
|
|
|
|
Database source) |
|
|
|
|
Database source, |
|
|
|
|
int requestID) |
|
|
|
|
{ |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultSize = size; |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultSize = size; |
|
|
|
|
default.resultRequestID = requestID; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected function DBWritingHandler( |
|
|
|
|
Database.DBQueryResult result, |
|
|
|
|
Database source) |
|
|
|
|
Database source, |
|
|
|
|
int requestID) |
|
|
|
|
{ |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultRequestID = requestID; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected function DBIncrementHandler( |
|
|
|
|
Database.DBQueryResult result, |
|
|
|
|
Database source) |
|
|
|
|
Database source, |
|
|
|
|
int requestID) |
|
|
|
|
{ |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultRequestID = requestID; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected function DBRemoveHandler( |
|
|
|
|
Database.DBQueryResult result, |
|
|
|
|
Database source) |
|
|
|
|
Database source, |
|
|
|
|
int requestID) |
|
|
|
|
{ |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultType = result; |
|
|
|
|
default.resultRequestID = requestID; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function ReadFromDB(LocalDatabaseInstance db, string pointer) |
|
|
|
@ -117,7 +132,7 @@ local LocalDatabaseInstance db;
|
|
|
|
|
source = GetJSONTemplateString(); |
|
|
|
|
parser = __().text.ParseString(source); |
|
|
|
|
root = HashTable(__().json.ParseWith(parser)); |
|
|
|
|
db = __().db.NewLocal(P("TEST_ReadOnly")); |
|
|
|
|
db = __core().db.NewLocal(P("TEST_ReadOnly")); |
|
|
|
|
db.WriteData(__().json.Pointer(), root); |
|
|
|
|
*/ |
|
|
|
|
protected static function string GetJSONTemplateString() |
|
|
|
@ -220,19 +235,20 @@ protected static function TESTS()
|
|
|
|
|
Test_TaskChaining(); |
|
|
|
|
Test_Removal(); |
|
|
|
|
Test_Increment(); |
|
|
|
|
Test_RequestID(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function Test_LoadingPrepared() |
|
|
|
|
{ |
|
|
|
|
local LocalDatabaseInstance db; |
|
|
|
|
db = __().db.LoadLocal(P("TEST_ReadOnly")); |
|
|
|
|
db = __core().db.LoadLocal(P("TEST_ReadOnly")); |
|
|
|
|
Context("Testing reading prepared data from the local database."); |
|
|
|
|
Issue("Existing database reported as missing."); |
|
|
|
|
TEST_ExpectTrue(__().db.ExistsLocal(P("TEST_ReadOnly"))); |
|
|
|
|
TEST_ExpectTrue(__core().db.ExistsLocal(P("TEST_ReadOnly"))); |
|
|
|
|
|
|
|
|
|
Issue("Loading same database several times produces different" |
|
|
|
|
@ "`LocalDatabaseInstance` objects."); |
|
|
|
|
TEST_ExpectTrue(__().db.LoadLocal(P("TEST_ReadOnly")) == db); |
|
|
|
|
TEST_ExpectTrue(__core().db.LoadLocal(P("TEST_ReadOnly")) == db); |
|
|
|
|
// Groups of read-only tests |
|
|
|
|
SubTest_LoadingPreparedSuccessRoot(db); |
|
|
|
|
SubTest_LoadingPreparedSuccessSubValues(db); |
|
|
|
@ -471,18 +487,18 @@ protected static function SubTest_LoadingPreparedGetKeysFail(
|
|
|
|
|
protected static function Test_Writing() |
|
|
|
|
{ |
|
|
|
|
local LocalDatabaseInstance db; |
|
|
|
|
db = __().db.NewLocal(P("TEST_DB")); |
|
|
|
|
db = __core().db.NewLocal(P("TEST_DB")); |
|
|
|
|
Context("Testing (re-)creating and writing into a new local database."); |
|
|
|
|
Issue("Cannot create a new database."); |
|
|
|
|
TEST_ExpectNotNone(db); |
|
|
|
|
TEST_ExpectTrue(__().db.ExistsLocal(P("TEST_DB"))); |
|
|
|
|
TEST_ExpectTrue(__core().db.ExistsLocal(P("TEST_DB"))); |
|
|
|
|
|
|
|
|
|
Issue("Freshly created database is not empty."); |
|
|
|
|
TEST_ExpectTrue(CountRecordsInPackage("TEST_DB") == 1); // 1 root object |
|
|
|
|
|
|
|
|
|
Issue("Loading just created database produces different" |
|
|
|
|
@ "`LocalDatabaseInstance` object."); |
|
|
|
|
TEST_ExpectTrue(__().db.LoadLocal(P("TEST_DB")) == db); |
|
|
|
|
TEST_ExpectTrue(__core().db.LoadLocal(P("TEST_DB")) == db); |
|
|
|
|
// This set of tests fills our test database with objects |
|
|
|
|
SubTest_WritingSuccess(db); |
|
|
|
|
SubTest_WritingDataCheck(db); |
|
|
|
@ -495,33 +511,33 @@ protected static function Test_Writing()
|
|
|
|
|
@ "local database."); |
|
|
|
|
__().memory.Free(db); // For `NewLocal()` call |
|
|
|
|
__().memory.Free(db); // For `LoadLocal()` call |
|
|
|
|
TEST_ExpectTrue(__().db.DeleteLocal(P("TEST_DB"))); |
|
|
|
|
TEST_ExpectTrue(__core().db.DeleteLocal(P("TEST_DB"))); |
|
|
|
|
|
|
|
|
|
Issue("Newly created database is reported to still exist after deletion."); |
|
|
|
|
TEST_ExpectFalse(__().db.ExistsLocal(P("TEST_DB"))); |
|
|
|
|
TEST_ExpectFalse(__core().db.ExistsLocal(P("TEST_DB"))); |
|
|
|
|
TEST_ExpectFalse(db.IsAllocated()); |
|
|
|
|
|
|
|
|
|
Issue("`DeleteLocal()` does not return `false` after trying to delete" |
|
|
|
|
@ "non-existing local database."); |
|
|
|
|
TEST_ExpectFalse(__().db.DeleteLocal(P("TEST_DB"))); |
|
|
|
|
TEST_ExpectFalse(__core().db.DeleteLocal(P("TEST_DB"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function Test_Recreate() |
|
|
|
|
{ |
|
|
|
|
local LocalDatabaseInstance db; |
|
|
|
|
Issue("Freshly created database is not empty."); |
|
|
|
|
db = __().db.NewLocal(P("TEST_DB")); |
|
|
|
|
db = __core().db.NewLocal(P("TEST_DB")); |
|
|
|
|
TEST_ExpectTrue(CountRecordsInPackage("TEST_DB") == 1); |
|
|
|
|
|
|
|
|
|
Issue("Cannot create a database after database with the same name was" |
|
|
|
|
@ "just deleted."); |
|
|
|
|
TEST_ExpectNotNone(db); |
|
|
|
|
TEST_ExpectTrue(__().db.ExistsLocal(P("TEST_DB"))); |
|
|
|
|
TEST_ExpectTrue(__core().db.ExistsLocal(P("TEST_DB"))); |
|
|
|
|
SubTest_WritingArrayIndicies(db); |
|
|
|
|
__().db.DeleteLocal(P("TEST_DB")); |
|
|
|
|
__core().db.DeleteLocal(P("TEST_DB")); |
|
|
|
|
Issue("Newly created database is reported to still exist after deletion."); |
|
|
|
|
__().memory.Free(db); |
|
|
|
|
TEST_ExpectFalse(__().db.ExistsLocal(P("TEST_DB"))); |
|
|
|
|
TEST_ExpectFalse(__core().db.ExistsLocal(P("TEST_DB"))); |
|
|
|
|
TEST_ExpectFalse(db.IsAllocated()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -530,15 +546,15 @@ protected static function Test_TaskChaining()
|
|
|
|
|
local LocalDatabaseInstance db; |
|
|
|
|
Context("Testing (re-)creating and writing into a new local database."); |
|
|
|
|
Issue("Freshly created database is not empty."); |
|
|
|
|
db = __().db.NewLocal(P("TEST_DB")); |
|
|
|
|
db = __core().db.NewLocal(P("TEST_DB")); |
|
|
|
|
TEST_ExpectTrue(CountRecordsInPackage("TEST_DB") == 1); |
|
|
|
|
|
|
|
|
|
Issue("Cannot create a database after database with the same name was" |
|
|
|
|
@ "just deleted."); |
|
|
|
|
TEST_ExpectNotNone(db); |
|
|
|
|
TEST_ExpectTrue(__().db.ExistsLocal(P("TEST_DB"))); |
|
|
|
|
TEST_ExpectTrue(__core().db.ExistsLocal(P("TEST_DB"))); |
|
|
|
|
SubTest_TaskChaining(db); |
|
|
|
|
__().db.DeleteLocal(P("TEST_DB")); |
|
|
|
|
__core().db.DeleteLocal(P("TEST_DB")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function HashTable GetJSONSubTemplateObject() |
|
|
|
@ -776,7 +792,7 @@ protected static function Test_Removal()
|
|
|
|
|
local HashTable templateObject; |
|
|
|
|
templateObject = GetJSONSubTemplateObject(); |
|
|
|
|
templateArray = GetJSONSubTemplateArray(); |
|
|
|
|
db = __().db.NewLocal(P("TEST_DB")); |
|
|
|
|
db = __core().db.NewLocal(P("TEST_DB")); |
|
|
|
|
db.WriteData(__().json.Pointer(P("")), templateObject); |
|
|
|
|
db.WriteData(__().json.Pointer(P("/B")), templateObject); |
|
|
|
|
db.WriteData(__().json.Pointer(P("/B/A")), templateArray); |
|
|
|
@ -787,7 +803,7 @@ protected static function Test_Removal()
|
|
|
|
|
SubTest_RemovalResult(db); |
|
|
|
|
SubTest_RemovalCheckValuesAfter(db); |
|
|
|
|
SubTest_RemovalRoot(db); |
|
|
|
|
__().db.DeleteLocal(P("TEST_DB")); |
|
|
|
|
__core().db.DeleteLocal(P("TEST_DB")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function SubTest_RemovalResult(LocalDatabaseInstance db) |
|
|
|
@ -861,7 +877,7 @@ protected static function Test_Increment()
|
|
|
|
|
local HashTable templateObject; |
|
|
|
|
templateObject = GetJSONSubTemplateObject(); |
|
|
|
|
templateArray = GetJSONSubTemplateArray(); |
|
|
|
|
db = __().db.NewLocal(P("TEST_DB")); |
|
|
|
|
db = __core().db.NewLocal(P("TEST_DB")); |
|
|
|
|
db.WriteData(__().json.Pointer(P("")), templateObject); |
|
|
|
|
db.WriteData(__().json.Pointer(P("/B")), templateObject); |
|
|
|
|
db.WriteData(__().json.Pointer(P("/C")), __().box.int(-5)); |
|
|
|
@ -904,7 +920,7 @@ protected static function Test_Increment()
|
|
|
|
|
Issue("Incrementing database values has created garbage objects."); |
|
|
|
|
// 5 initial records + 1 made for a new array in `SubTest_IncrementNull()` |
|
|
|
|
TEST_ExpectTrue(CountRecordsInPackage("TEST_DB") == 6); |
|
|
|
|
__().db.DeleteLocal(P("TEST_DB")); |
|
|
|
|
__core().db.DeleteLocal(P("TEST_DB")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function SubTest_IncrementNull(LocalDatabaseInstance db) |
|
|
|
@ -1232,8 +1248,9 @@ protected static function SubTest_IncrementRewriteArray(
|
|
|
|
|
|
|
|
|
|
protected static function SubTest_IncrementMissing(LocalDatabaseInstance db) |
|
|
|
|
{ |
|
|
|
|
local DBIncrementTask task; |
|
|
|
|
Issue("New values are created in database after incrementing with path" |
|
|
|
|
local DBIncrementTask task; |
|
|
|
|
local DBCheckTask checkTask; |
|
|
|
|
Issue("New values are not created in database after incrementing with path" |
|
|
|
|
@ "pointing to non-existing value."); |
|
|
|
|
task = db.IncrementData(__().json.Pointer(P("/L")), __().box.int(345)); |
|
|
|
|
task.connect = DBIncrementHandler; |
|
|
|
@ -1245,13 +1262,168 @@ protected static function SubTest_IncrementMissing(LocalDatabaseInstance db)
|
|
|
|
|
task.connect = DBIncrementHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultType == DBR_Success); |
|
|
|
|
db.CheckDataType(__().json.Pointer(P("/L"))).connect = DBCheckHandler; |
|
|
|
|
checkTask = db.CheckDataType(__().json.Pointer(P("/L"))); |
|
|
|
|
checkTask.connect = DBCheckHandler; |
|
|
|
|
checkTask.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultDataType == JSON_Number); |
|
|
|
|
TEST_ExpectTrue(default.resultType == DBR_Success); |
|
|
|
|
ReadFromDB(db, "/B/A/1/"); |
|
|
|
|
TEST_ExpectTrue(default.resultDataType == JSON_Number); |
|
|
|
|
TEST_ExpectTrue(ArrayList(default.resultObject).GetLength() == 12); |
|
|
|
|
TEST_ExpectTrue(ArrayList(default.resultObject).GetInt(11) == 85); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function Test_RequestID() |
|
|
|
|
{ |
|
|
|
|
local LocalDatabaseInstance db; |
|
|
|
|
local ArrayList templateArray; |
|
|
|
|
local HashTable templateObject; |
|
|
|
|
templateObject = GetJSONSubTemplateObject(); |
|
|
|
|
templateArray = GetJSONSubTemplateArray(); |
|
|
|
|
db = __core().db.NewLocal(P("TEST_DB")); |
|
|
|
|
db.WriteData(__().json.Pointer(P("")), templateObject); |
|
|
|
|
db.WriteData(__().json.Pointer(P("/B")), templateObject); |
|
|
|
|
db.WriteData(__().json.Pointer(P("/C")), __().box.int(-5)); |
|
|
|
|
db.WriteData(__().json.Pointer(P("/D")), __().box.bool(false)); |
|
|
|
|
db.WriteData(__().json.Pointer(P("/B/A")), templateArray); |
|
|
|
|
db.WriteData(__().json.Pointer(P("/B/A/1")), templateObject); |
|
|
|
|
db.WriteData(__().json.Pointer(P("/B/A/1/")), templateArray); |
|
|
|
|
/* `db` now contains: |
|
|
|
|
{ |
|
|
|
|
"A": "simpleValue", |
|
|
|
|
"B": { |
|
|
|
|
"A": [true, { |
|
|
|
|
"A": "simpleValue", |
|
|
|
|
"B": 11.12, |
|
|
|
|
"": [true, null, "huh"] |
|
|
|
|
}, "huh"], |
|
|
|
|
"B": 11.12 |
|
|
|
|
}, |
|
|
|
|
"C": -5, |
|
|
|
|
"D": false |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
// Constantly recreating `db` takes time, so we make test dependent |
|
|
|
|
// on each other. |
|
|
|
|
// Generally speaking this is not great, but we cannot run them in |
|
|
|
|
// parallel anyway. |
|
|
|
|
Context("Testing whether database operations report correct request ID."); |
|
|
|
|
SubTest_RequestIDForCheck(db); |
|
|
|
|
SubTest_RequestIDForIncrement(db); |
|
|
|
|
SubTest_RequestIDForKeys(db); |
|
|
|
|
SubTest_RequestIDForRead(db); |
|
|
|
|
SubTest_RequestIDForRemove(db); |
|
|
|
|
SubTest_RequestIDForSize(db); |
|
|
|
|
SubTest_RequestIDForWrite(db); |
|
|
|
|
__core().db.DeleteLocal(P("TEST_DB")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function SubTest_RequestIDForCheck(LocalDatabaseInstance db) |
|
|
|
|
{ |
|
|
|
|
local DBCheckTask task; |
|
|
|
|
|
|
|
|
|
Issue("Type checking operation isn't returning correct request ID."); |
|
|
|
|
task = db.CheckDataType(__().json.Pointer(P("/L"))); |
|
|
|
|
task.connect = DBCheckHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 0); |
|
|
|
|
task = db.CheckDataType(__().json.Pointer(P("/L")), 29); |
|
|
|
|
task.connect = DBCheckHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 29); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function SubTest_RequestIDForIncrement( |
|
|
|
|
LocalDatabaseInstance db) |
|
|
|
|
{ |
|
|
|
|
local DBIncrementTask task; |
|
|
|
|
|
|
|
|
|
Issue("Increment operation isn't returning correct request ID."); |
|
|
|
|
task = db.IncrementData(__().json.Pointer(P("/L")), __().box.int(29)); |
|
|
|
|
task.connect = DBIncrementHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 0); |
|
|
|
|
task = db.IncrementData(__().json.Pointer(P("/L")), __().box.int(29), -7); |
|
|
|
|
task.connect = DBIncrementHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == -7); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function SubTest_RequestIDForKeys(LocalDatabaseInstance db) |
|
|
|
|
{ |
|
|
|
|
local DBKeysTask task; |
|
|
|
|
|
|
|
|
|
Issue("Keys list operation isn't returning correct request ID."); |
|
|
|
|
task = db.GetDataKeys(__().json.Pointer(P(""))); |
|
|
|
|
task.connect = DBKeysHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 0); |
|
|
|
|
task = db.GetDataKeys(__().json.Pointer(P("")), 11); |
|
|
|
|
task.connect = DBKeysHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 11); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function SubTest_RequestIDForRead(LocalDatabaseInstance db) |
|
|
|
|
{ |
|
|
|
|
local DBReadTask task; |
|
|
|
|
|
|
|
|
|
Issue("Reading operation isn't returning correct request ID."); |
|
|
|
|
task = db.ReadData(__().json.Pointer(P("/L")),); |
|
|
|
|
task.connect = DBReadingHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 0); |
|
|
|
|
task = db.ReadData(__().json.Pointer(P("/L")),, 666); |
|
|
|
|
task.connect = DBReadingHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 666); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function SubTest_RequestIDForRemove(LocalDatabaseInstance db) |
|
|
|
|
{ |
|
|
|
|
local DBRemoveTask task; |
|
|
|
|
|
|
|
|
|
Issue("Removing operation isn't returning correct request ID."); |
|
|
|
|
task = db.RemoveData(__().json.Pointer(P("/L"))); |
|
|
|
|
task.connect = DBRemoveHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 0); |
|
|
|
|
task = db.RemoveData(__().json.Pointer(P("/L")), 80); |
|
|
|
|
task.connect = DBRemoveHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 80); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function SubTest_RequestIDForSize(LocalDatabaseInstance db) |
|
|
|
|
{ |
|
|
|
|
local DBSizeTask task; |
|
|
|
|
|
|
|
|
|
Issue("Size getting operation isn't returning correct request ID."); |
|
|
|
|
task = db.GetDataSize(__().json.Pointer(P("/L"))); |
|
|
|
|
task.connect = DBSizeHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 0); |
|
|
|
|
task = db.GetDataSize(__().json.Pointer(P("/L")), 7); |
|
|
|
|
task.connect = DBSizeHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 7); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected static function SubTest_RequestIDForWrite(LocalDatabaseInstance db) |
|
|
|
|
{ |
|
|
|
|
local DBWriteTask task; |
|
|
|
|
|
|
|
|
|
Issue("Writing operation isn't returning correct request ID."); |
|
|
|
|
task = db.WriteData(__().json.Pointer(P("/L")), none); |
|
|
|
|
task.connect = DBWritingHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 0); |
|
|
|
|
task = db.WriteData(__().json.Pointer(P("/L")), none, 42); |
|
|
|
|
task.connect = DBWritingHandler; |
|
|
|
|
task.TryCompleting(); |
|
|
|
|
TEST_ExpectTrue(default.resultRequestID == 42); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
defaultproperties |
|
|
|
|
{ |
|
|
|
|
caseGroup = "Database" |
|
|
|
|