提交 68ecafa9 编写于 作者: Y yanglifeng

<yanglifeng5@huawei.com>

Signed-off-by: Nyanglifeng <yanglifeng5@huawei.com>
上级 047e3194
......@@ -7,7 +7,7 @@
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
......@@ -15,11 +15,11 @@
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import dataRdb from '@ohos.data.rdb'
const TAG = "[RDB_JSKITS_TEST]"
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "data1 text," + "data2 long, " + "data3 double," + "data4 blob)";
const TAG = '[RDB_JSKITS_TEST]'
const CREATE_TABLE_TEST = 'CREATE TABLE IF NOT EXISTS test (' + 'id INTEGER PRIMARY KEY AUTOINCREMENT, ' + 'data1 text,' + 'data2 long, ' + 'data3 double,' + 'data4 blob)';
const STORE_CONFIG = {
name: "Resultset.db",
name: 'Resultset.db',
}
var rdbStore = undefined;
......@@ -42,42 +42,42 @@ describe('rdbResultSetTest', function () {
afterAll(async function () {
console.info(TAG + 'afterAll')
rdbStore = null
await dataRdb.deleteRdbStore("Resultset.db");
await dataRdb.deleteRdbStore('Resultset.db');
})
//插入数据
async function createTest() {
console.log(TAG + "createTest data start");
console.log(TAG + 'createTest data start');
{
var u8 = new Uint8Array([1, 2, 3])
const valueBucket = {
"data1": "hello",
"data2": 10,
"data3": 1.0,
"data4": u8,
'data1': 'hello',
'data2': 10,
'data3': 1.0,
'data4': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
var u8 = new Uint8Array([3, 4, 5])
const valueBucket = {
"data1": "2",
"data2": -5,
"data3": 2.5,
"data4": u8,
'data1': '2',
'data2': -5,
'data3': 2.5,
'data4': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
var u8 = new Uint8Array(0)
const valueBucket = {
"data1": "hello world",
"data2": 3,
"data3": 1.8,
"data4": u8,
'data1': 'hello world',
'data2': 3,
'data3': 1.8,
'data4': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
console.log(TAG + "createTest data end");
console.log(TAG + 'createTest data end');
}
/**
......@@ -86,15 +86,15 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getBlob normal test
*/
it('testGetBlob0001', 0, async function (done) {
console.log(TAG + "************* testGetBlob0001 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testGetBlob0001 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
{
expect(true).assertEqual(resultSet.goToFirstRow())
const id = resultSet.getLong(resultSet.getColumnIndex("id"))
const data4 = resultSet.getBlob(resultSet.getColumnIndex("data4"))
console.log(TAG + "id=" + id + ", data4=" + data4);
const id = resultSet.getLong(resultSet.getColumnIndex('id'))
const data4 = resultSet.getBlob(resultSet.getColumnIndex('data4'))
console.log(TAG + 'id=' + id + ', data4=' + data4);
expect(1).assertEqual(data4[0]);
expect(2).assertEqual(data4[1]);
expect(3).assertEqual(data4[2]);
......@@ -106,7 +106,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testGetBlob0001 end *************");
console.log(TAG + '************* testGetBlob0001 end *************');
})
/**
......@@ -115,16 +115,16 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getBlob normal test
*/
it('testGetBlob0002', 0, async function (done) {
console.log(TAG + "************* testGetBlob0002 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testGetBlob0002 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
{
expect(true).assertEqual(resultSet.goToFirstRow())
expect(true).assertEqual(resultSet.goToNextRow())
const id = resultSet.getLong(resultSet.getColumnIndex("id"))
const data4 = resultSet.getBlob(resultSet.getColumnIndex("data4"))
console.log(TAG + "id=" + id + ", data4=" + data4);
const id = resultSet.getLong(resultSet.getColumnIndex('id'))
const data4 = resultSet.getBlob(resultSet.getColumnIndex('data4'))
console.log(TAG + 'id=' + id + ', data4=' + data4);
expect(3).assertEqual(data4[0]);
expect(4).assertEqual(data4[1]);
expect(5).assertEqual(data4[2]);
......@@ -136,7 +136,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testGetBlob0002 end *************");
console.log(TAG + '************* testGetBlob0002 end *************');
})
/**
......@@ -145,17 +145,17 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getBlob normal test
*/
it('testGetBlob0003', 0, async function (done) {
console.log(TAG + "************* testGetBlob0003 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testGetBlob0003 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
{
expect(true).assertEqual(resultSet.goToFirstRow())
expect(true).assertEqual(resultSet.goToNextRow())
expect(true).assertEqual(resultSet.goToNextRow())
const id = resultSet.getLong(resultSet.getColumnIndex("id"))
const data4 = resultSet.getBlob(resultSet.getColumnIndex("data4"))
console.log(TAG + "id=" + id);
const id = resultSet.getLong(resultSet.getColumnIndex('id'))
const data4 = resultSet.getBlob(resultSet.getColumnIndex('data4'))
console.log(TAG + 'id=' + id);
}
resultSet.close();
expect(true).assertEqual(resultSet.isClosed)
......@@ -164,7 +164,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testGetBlob0003 end *************");
console.log(TAG + '************* testGetBlob0003 end *************');
})
/**
......@@ -173,8 +173,8 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isStarted normal test
*/
it('testIsStarted0001', 0, async function (done) {
console.log(TAG + "************* testIsStarted0001 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testIsStarted0001 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
expect(false).assertEqual(resultSet.isStarted)
......@@ -183,7 +183,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testIsStarted0001 end *************");
console.log(TAG + '************* testIsStarted0001 end *************');
})
/**
......@@ -192,8 +192,8 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isStarted normal test
*/
it('testIsStarted0002', 0, async function (done) {
console.log(TAG + "************* testIsStarted0002 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testIsStarted0002 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
resultSet.goTo(1)
......@@ -203,7 +203,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testIsStarted0002 end *************");
console.log(TAG + '************* testIsStarted0002 end *************');
})
/**
......@@ -212,8 +212,8 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isStarted normal test
*/
it('testIsStarted0003', 0, async function (done) {
console.log(TAG + "************* testIsStarted0003 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testIsStarted0003 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
expect(true).assertEqual(resultSet.goToNextRow())
......@@ -225,7 +225,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testIsStarted0003 end *************");
console.log(TAG + '************* testIsStarted0003 end *************');
})
/**
......@@ -234,8 +234,8 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isStarted with no result test
*/
it('testIsStarted0004', 0, async function (done) {
console.log(TAG + "************* testIsStarted0004 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testIsStarted0004 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
expect(true).assertEqual(resultSet.goToNextRow())
......@@ -246,7 +246,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testIsStarted0004 end *************");
console.log(TAG + '************* testIsStarted0004 end *************');
})
......@@ -256,8 +256,8 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isEnded normal test
*/
it('testIsEnded0001', 0, async function (done) {
console.log(TAG + "************* testIsEnded0001 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testIsEnded0001 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -267,7 +267,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testIsEnded0001 end *************");
console.log(TAG + '************* testIsEnded0001 end *************');
})
/**
......@@ -276,8 +276,8 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isEnded normal test
*/
it('testIsEnded0002', 0, async function (done) {
console.log(TAG + "************* testIsEnded0002 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testIsEnded0002 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
expect(true).assertEqual(resultSet.goToLastRow())
......@@ -287,7 +287,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testIsEnded0002 end *************");
console.log(TAG + '************* testIsEnded0002 end *************');
})
/**
......@@ -296,8 +296,8 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isEnded normal test
*/
it('testIsEnded0003', 0, async function (done) {
console.log(TAG + "************* testIsEnded0003 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testIsEnded0003 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
resultSet.goToRow(3)
......@@ -307,7 +307,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testIsEnded0003 end *************");
console.log(TAG + '************* testIsEnded0003 end *************');
})
/**
......@@ -316,8 +316,8 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isEnded normal test
*/
it('testIsEnded0004', 0, async function (done) {
console.log(TAG + "************* testIsEnded0004 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testIsEnded0004 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
resultSet.goToRow(3)
......@@ -328,7 +328,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testIsEnded0004 end *************");
console.log(TAG + '************* testIsEnded0004 end *************');
})
/**
......@@ -337,8 +337,8 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet rowCount normal test
*/
it('testRowCount0001', 0, async function (done) {
console.log(TAG + "************* testRowCount0001 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testRowCount0001 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
expect(3).assertEqual(resultSet.rowCount)
......@@ -347,7 +347,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testRowCount0001 end *************");
console.log(TAG + '************* testRowCount0001 end *************');
})
/**
......@@ -356,9 +356,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet rowCount with no result test
*/
it('testRowCount0002', 0, async function (done) {
console.log(TAG + "************* testRowCount0002 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
console.log(TAG + '************* testRowCount0002 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
try {
expect(-1).assertEqual(resultSet.rowCount)
......@@ -367,7 +367,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testRowCount0002 end *************");
console.log(TAG + '************* testRowCount0002 end *************');
})
/**
......@@ -376,9 +376,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet rowCount test
*/
it('testRowCount0003', 0, async function (done) {
console.log(TAG + "************* testRowCount0003 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("data1", "hello");
console.log(TAG + '************* testRowCount0003 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('data1', 'hello');
let resultSet = await rdbStore.query(predicates)
try {
expect(1).assertEqual(resultSet.rowCount)
......@@ -387,7 +387,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testRowCount0003 end *************");
console.log(TAG + '************* testRowCount0003 end *************');
})
/**
......@@ -396,10 +396,10 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet rowCount test
*/
it('testRowCount0004', 0, async function (done) {
console.log(TAG + "************* testRowCount0004 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("data1", "hello");
predicates.equalTo("data2", 3);
console.log(TAG + '************* testRowCount0004 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('data1', 'hello');
predicates.equalTo('data2', 3);
let resultSet = await rdbStore.query(predicates)
try {
expect(0).assertEqual(resultSet.rowCount)
......@@ -408,7 +408,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testRowCount0003 end *************");
console.log(TAG + '************* testRowCount0003 end *************');
})
/**
......@@ -417,15 +417,15 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getLong test
*/
it('testGetLong0001', 0, async function (done) {
console.log(TAG + "************* testGetLong0001 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testGetLong0001 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
{
expect(true).assertEqual(resultSet.goToFirstRow())
const id = resultSet.getLong(resultSet.getColumnIndex("id"))
const data2 = resultSet.getLong(resultSet.getColumnIndex("data2"))
console.log(TAG + "id=" + id + ", data2=" + data2);
const id = resultSet.getLong(resultSet.getColumnIndex('id'))
const data2 = resultSet.getLong(resultSet.getColumnIndex('data2'))
console.log(TAG + 'id=' + id + ', data2=' + data2);
expect(10).assertEqual(data2);
}
resultSet.close();
......@@ -435,7 +435,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testGetLong0001 end *************");
console.log(TAG + '************* testGetLong0001 end *************');
})
/**
......@@ -444,14 +444,14 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getLong test
*/
it('testGetLong0002', 0, async function (done) {
console.log(TAG + "************* testGetLong0002 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testGetLong0002 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
{
expect(true).assertEqual(resultSet.goToFirstRow())
expect(true).assertEqual(resultSet.goToNextRow())
const data1 = resultSet.getLong(resultSet.getColumnIndex("data1"))
const data1 = resultSet.getLong(resultSet.getColumnIndex('data1'))
expect(2).assertEqual(data1);
}
resultSet.close();
......@@ -461,7 +461,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testGetLong0002 end *************");
console.log(TAG + '************* testGetLong0002 end *************');
})
/**
......@@ -470,14 +470,14 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getLong test
*/
it('testGetLong0003', 0, async function (done) {
console.log(TAG + "************* testGetLong0003 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testGetLong0003 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
{
expect(true).assertEqual(resultSet.goToFirstRow())
expect(true).assertEqual(resultSet.goToNextRow())
const data2 = resultSet.getLong(resultSet.getColumnIndex("data2"))
const data2 = resultSet.getLong(resultSet.getColumnIndex('data2'))
expect(-5).assertEqual(data2);
}
resultSet.close();
......@@ -487,7 +487,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testGetLong0003 end *************");
console.log(TAG + '************* testGetLong0003 end *************');
})
/**
......@@ -496,17 +496,17 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getString test
*/
it('testGetString0001', 0, async function (done) {
console.log(TAG + "************* testGetString0001 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testGetString0001 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
const data1 = resultSet.getString(resultSet.getColumnIndex("data1"))
expect("hello").assertEqual(data1);
const data1 = resultSet.getString(resultSet.getColumnIndex('data1'))
expect('hello').assertEqual(data1);
}
resultSet = null
done();
console.log(TAG + "************* testGetString0001 end *************");
console.log(TAG + '************* testGetString0001 end *************');
})
/**
......@@ -515,17 +515,17 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getString test
*/
it('testGetString0002', 0, async function (done) {
console.log(TAG + "************* testGetString0002 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testGetString0002 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
const data2 = resultSet.getString(resultSet.getColumnIndex("data2"))
expect("10").assertEqual(data2);
const data2 = resultSet.getString(resultSet.getColumnIndex('data2'))
expect('10').assertEqual(data2);
}
resultSet = null
done();
console.log(TAG + "************* testGetString0002 end *************");
console.log(TAG + '************* testGetString0002 end *************');
})
/**
......@@ -534,18 +534,18 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getString test
*/
it('testGetString0003', 0, async function (done) {
console.log(TAG + "************* testGetString0003 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testGetString0003 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
expect(true).assertEqual(resultSet.goToNextRow())
const data3 = resultSet.getString(resultSet.getColumnIndex("data3"))
expect("2.5").assertEqual(data3);
const data3 = resultSet.getString(resultSet.getColumnIndex('data3'))
expect('2.5').assertEqual(data3);
}
resultSet = null
done();
console.log(TAG + "************* testGetString0003 end *************");
console.log(TAG + '************* testGetString0003 end *************');
})
/**
......@@ -554,23 +554,23 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getString test
*/
it('testGetString0004', 0, async function (done) {
console.log(TAG + "************* testGetString0004 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testGetString0004 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
expect(true).assertEqual(resultSet.goToNextRow())
expect(true).assertEqual(resultSet.goToNextRow())
const data1 = resultSet.getString(resultSet.getColumnIndex("data1"))
const data2 = resultSet.getString(resultSet.getColumnIndex("data2"))
const data3 = resultSet.getString(resultSet.getColumnIndex("data3"))
expect("hello world").assertEqual(data1);
expect("3").assertEqual(data2);
expect("1.8").assertEqual(data3);
const data1 = resultSet.getString(resultSet.getColumnIndex('data1'))
const data2 = resultSet.getString(resultSet.getColumnIndex('data2'))
const data3 = resultSet.getString(resultSet.getColumnIndex('data3'))
expect('hello world').assertEqual(data1);
expect('3').assertEqual(data2);
expect('1.8').assertEqual(data3);
}
resultSet = null
done();
console.log(TAG + "************* testGetString0004 end *************");
console.log(TAG + '************* testGetString0004 end *************');
})
/**
......@@ -579,8 +579,8 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isClosed test
*/
it('testIsClosed0001', 0, async function (done) {
console.log(TAG + "************* testIsClosed0001 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testIsClosed0001 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
expect(3).assertEqual(resultSet.rowCount)
......@@ -589,7 +589,7 @@ describe('rdbResultSetTest', function () {
resultSet = null
done();
console.log(TAG + "************* testIsClosed0001 end *************");
console.log(TAG + '************* testIsClosed0001 end *************');
})
/**
......@@ -598,14 +598,14 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isClosed with not close test
*/
it('testIsClosed0002', 0, async function (done) {
console.log(TAG + "************* testIsClosed0002 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
console.log(TAG + '************* testIsClosed0002 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
expect(false).assertEqual(resultSet.isClosed)
resultSet = null
done();
console.log(TAG + "************* testIsClosed0002 end *************");
console.log(TAG + '************* testIsClosed0002 end *************');
})
/**
......@@ -614,15 +614,15 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isClosed with not close test
*/
it('testIsClosed0003', 0, async function (done) {
console.log(TAG + "************* testIsClosed0003 start *************");
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
console.log(TAG + '************* testIsClosed0003 start *************');
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
expect(false).assertEqual(resultSet.isClosed)
resultSet = null
done();
console.log(TAG + "************* testIsClosed0003 end *************");
console.log(TAG + '************* testIsClosed0003 end *************');
})
/**
......@@ -631,14 +631,14 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet columnCount test
*/
it('testColumnCount0001', 0, async function (done) {
console.log(TAG + "************* testColumnCount0001 start *************");
console.log(TAG + '************* testColumnCount0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
expect(5).assertEqual(resultSet.columnCount);
resultSet = null;
done();
console.log(TAG + "************* testColumnCount0001 end *************");
console.log(TAG + '************* testColumnCount0001 end *************');
}
})
......@@ -648,15 +648,15 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet columnCount test
*/
it('testColumnCount0002', 0, async function (done) {
console.log(TAG + "************* testColumnCount0002 start *************");
console.log(TAG + '************* testColumnCount0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
expect(0).assertEqual(resultSet.columnCount);
resultSet = null;
done();
console.log(TAG + "************* testColumnCount0002 end *************");
console.log(TAG + '************* testColumnCount0002 end *************');
}
})
......@@ -666,9 +666,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet rowIndex test
*/
it('testRowIndex0001', 0, async function (done) {
console.log(TAG + "************* testRowIndex0001 *************");
console.log(TAG + '************* testRowIndex0001 *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -677,7 +677,7 @@ describe('rdbResultSetTest', function () {
resultSet = null;
done();
console.log(TAG + "************* testRowIndex0001 end *************");
console.log(TAG + '************* testRowIndex0001 end *************');
}
})
......@@ -687,9 +687,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet rowIndex at last row test
*/
it('testRowIndex0002', 0, async function (done) {
console.log(TAG + "************* testRowIndex0002 *************");
console.log(TAG + '************* testRowIndex0002 *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToLastRow())
......@@ -698,7 +698,7 @@ describe('rdbResultSetTest', function () {
resultSet = null;
done();
console.log(TAG + "************* testRowIndex0002 end *************");
console.log(TAG + '************* testRowIndex0002 end *************');
}
})
......@@ -708,9 +708,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToFirstRow normal test
*/
it('testGoToFirstRow0001', 0, async function (done) {
console.log(TAG + "************* testGoToFirstRow0001 start *************");
console.log(TAG + '************* testGoToFirstRow0001 start *************');
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -720,7 +720,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testGoToFirstRow0001 end *************");
console.log(TAG + '************* testGoToFirstRow0001 end *************');
})
/**
......@@ -729,10 +729,10 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToFirstRow with no result test
*/
it('testGoToFirstRow0002', 0, async function (done) {
console.log(TAG + "************* testGoToFirstRow0002 start *************");
console.log(TAG + '************* testGoToFirstRow0002 start *************');
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
try {
expect(false).assertEqual(resultSet.goToFirstRow())
......@@ -741,7 +741,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testGoToFirstRow0002 end *************");
console.log(TAG + '************* testGoToFirstRow0002 end *************');
})
/**
......@@ -750,9 +750,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToFirstRow test
*/
it('testGoToFirstRow0003', 0, async function (done) {
console.log(TAG + "************* testGoToFirstRow0003 start *************");
console.log(TAG + '************* testGoToFirstRow0003 start *************');
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
try {
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -763,7 +763,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null
done();
console.log(TAG + "************* testGoToFirstRow0003 end *************");
console.log(TAG + '************* testGoToFirstRow0003 end *************');
})
/**
......@@ -772,16 +772,16 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToFirstRow test
*/
it('testGoToLastRow0001', 0, async function (done) {
console.log(TAG + "************* testGoToLastRow0001 start *************");
console.log(TAG + '************* testGoToLastRow0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToLastRow())
}
resultSet = null;
done();
console.log(TAG + "************* testGoToLastRow0001 end *************");
console.log(TAG + '************* testGoToLastRow0001 end *************');
}
})
......@@ -791,17 +791,17 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToLastRow with no result test
*/
it('testGoToLastRow0002', 0, async function (done) {
console.log(TAG + "************* testGoToLastRow0002 start *************");
console.log(TAG + '************* testGoToLastRow0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
{
expect(false).assertEqual(resultSet.goToLastRow())
}
resultSet = null;
done();
console.log(TAG + "************* testGoToLastRow0002 end *************");
console.log(TAG + '************* testGoToLastRow0002 end *************');
}
})
......@@ -811,9 +811,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToLastRow test
*/
it('testGoToLastRow0003', 0, async function (done) {
console.log(TAG + "************* testGoToLastRow0003 start *************");
console.log(TAG + '************* testGoToLastRow0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToLastRow())
......@@ -822,7 +822,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoToLastRow0003 end *************");
console.log(TAG + '************* testGoToLastRow0003 end *************');
}
})
......@@ -832,16 +832,16 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToNextRow test
*/
it('testGoToNextRow0001', 0, async function (done) {
console.log(TAG + "************* testGoToNextRow0001 start *************");
console.log(TAG + '************* testGoToNextRow0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToNextRow())
}
resultSet = null;
done();
console.log(TAG + "************* testGoToNextRow0001 end *************");
console.log(TAG + '************* testGoToNextRow0001 end *************');
}
})
......@@ -851,17 +851,17 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToNextRow with no result test
*/
it('testGoToNextRow0002', 0, async function (done) {
console.log(TAG + "************* testGoToNextRow0002 start *************");
console.log(TAG + '************* testGoToNextRow0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
{
expect(false).assertEqual(resultSet.goToNextRow())
}
resultSet = null;
done();
console.log(TAG + "************* testGoToNextRow0002 end *************");
console.log(TAG + '************* testGoToNextRow0002 end *************');
}
})
......@@ -871,9 +871,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToNextRow test
*/
it('testGoToNextRow0003', 0, async function (done) {
console.log(TAG + "************* testGoToNextRow0003 start *************");
console.log(TAG + '************* testGoToNextRow0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -883,7 +883,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoToNextRow0003 end *************");
console.log(TAG + '************* testGoToNextRow0003 end *************');
}
})
......@@ -893,9 +893,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToNextRow after last row test
*/
it('testGoToNextRow0004', 0, async function (done) {
console.log(TAG + "************* testGoToNextRow0004 start *************");
console.log(TAG + '************* testGoToNextRow0004 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToLastRow())
......@@ -903,7 +903,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoToNextRow0004 end *************");
console.log(TAG + '************* testGoToNextRow0004 end *************');
}
})
......@@ -913,16 +913,16 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToPreviousRow test
*/
it('testGoToPreviousRow0001', 0, async function (done) {
console.log(TAG + "************* testGoToPreviousRow0001 start *************");
console.log(TAG + '************* testGoToPreviousRow0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(false).assertEqual(resultSet.goToPreviousRow())
}
resultSet = null;
done();
console.log(TAG + "************* testGoToPreviousRow0001 end *************");
console.log(TAG + '************* testGoToPreviousRow0001 end *************');
}
})
......@@ -932,17 +932,17 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToPreviousRow with no result test
*/
it('testGoToPreviousRow0002', 0, async function (done) {
console.log(TAG + "************* testGoToPreviousRow0002 start *************");
console.log(TAG + '************* testGoToPreviousRow0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
{
expect(false).assertEqual(resultSet.goToPreviousRow())
}
resultSet = null;
done();
console.log(TAG + "************* testGoToPreviousRow0002 end *************");
console.log(TAG + '************* testGoToPreviousRow0002 end *************');
}
})
......@@ -952,9 +952,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToPreviousRow test
*/
it('testGoToPreviousRow0003', 0, async function (done) {
console.log(TAG + "************* testGoToPreviousRow0003 start *************");
console.log(TAG + '************* testGoToPreviousRow0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -963,7 +963,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoToPreviousRow0003 end *************");
console.log(TAG + '************* testGoToPreviousRow0003 end *************');
}
})
......@@ -973,9 +973,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToPreviousRow after last row test
*/
it('testGoToPreviousRow0004', 0, async function (done) {
console.log(TAG + "************* testGoToPreviousRow0004 start *************");
console.log(TAG + '************* testGoToPreviousRow0004 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToLastRow())
......@@ -983,7 +983,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoToPreviousRow0004 end *************");
console.log(TAG + '************* testGoToPreviousRow0004 end *************');
}
})
......@@ -993,9 +993,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goTo test
*/
it('testGoTo0001', 0, async function (done) {
console.log(TAG + "************* testGoTo0001 start *************");
console.log(TAG + '************* testGoTo0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -1004,7 +1004,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoTo0001 end *************");
console.log(TAG + '************* testGoTo0001 end *************');
}
})
......@@ -1014,10 +1014,10 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goTo with no result test
*/
it('testGoTo0002', 0, async function (done) {
console.log(TAG + "************* testGoTo0002 start *************");
console.log(TAG + '************* testGoTo0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
{
resultSet.goTo(1)
......@@ -1025,7 +1025,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoTo0002 end *************");
console.log(TAG + '************* testGoTo0002 end *************');
}
})
......@@ -1035,9 +1035,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goTo test
*/
it('testGoTo0003', 0, async function (done) {
console.log(TAG + "************* testGoTo0003 start *************");
console.log(TAG + '************* testGoTo0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -1047,7 +1047,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoTo0003 end *************");
console.log(TAG + '************* testGoTo0003 end *************');
}
})
......@@ -1057,9 +1057,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goTo after last row test
*/
it('testGoTo0004', 0, async function (done) {
console.log(TAG + "************* testGoTo0004 start *************");
console.log(TAG + '************* testGoTo0004 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToLastRow())
......@@ -1068,7 +1068,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoTo0004 end *************");
console.log(TAG + '************* testGoTo0004 end *************');
}
})
......@@ -1078,9 +1078,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToRow test
*/
it('testGoToRow0001', 0, async function (done) {
console.log(TAG + "************* testGoToRow0001 start *************");
console.log(TAG + '************* testGoToRow0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -1089,7 +1089,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoToRow0001 end *************");
console.log(TAG + '************* testGoToRow0001 end *************');
}
})
......@@ -1099,10 +1099,10 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToRow with no result test
*/
it('testGoToRow0002', 0, async function (done) {
console.log(TAG + "************* testGoToRow0002 start *************");
console.log(TAG + '************* testGoToRow0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
{
resultSet.goToRow(1)
......@@ -1110,7 +1110,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoToRow0002 end *************");
console.log(TAG + '************* testGoToRow0002 end *************');
}
})
......@@ -1120,9 +1120,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToRow test
*/
it('testGoToRow0003', 0, async function (done) {
console.log(TAG + "************* testGoToRow0003 start *************");
console.log(TAG + '************* testGoToRow0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -1133,7 +1133,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoToRow0003 end *************");
console.log(TAG + '************* testGoToRow0003 end *************');
}
})
......@@ -1143,9 +1143,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet goToRow after last row test
*/
it('testGoToRow0004', 0, async function (done) {
console.log(TAG + "************* testGoToRow0004 start *************");
console.log(TAG + '************* testGoToRow0004 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToLastRow())
......@@ -1154,7 +1154,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testGoToRow0004 end *************");
console.log(TAG + '************* testGoToRow0004 end *************');
}
})
......@@ -1164,9 +1164,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isAtFirstRow test
*/
it('testIsAtFirstRow0001', 0, async function (done) {
console.log(TAG + "************* testIsAtFirstRow0001 start *************");
console.log(TAG + '************* testIsAtFirstRow0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -1174,7 +1174,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtFirstRow0001 end *************");
console.log(TAG + '************* testIsAtFirstRow0001 end *************');
}
})
......@@ -1184,17 +1184,17 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isAtFirstRow with no result test
*/
it('testIsAtFirstRow0002', 0, async function (done) {
console.log(TAG + "************* testIsAtFirstRow0002 start *************");
console.log(TAG + '************* testIsAtFirstRow0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
{
expect(false).assertEqual(resultSet.isAtFirstRow)
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtFirstRow0002 end *************");
console.log(TAG + '************* testIsAtFirstRow0002 end *************');
}
})
......@@ -1204,9 +1204,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isAtFirstRow test
*/
it('testIsAtFirstRow0003', 0, async function (done) {
console.log(TAG + "************* testIsAtFirstRow0003 start *************");
console.log(TAG + '************* testIsAtFirstRow0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -1215,7 +1215,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtFirstRow0003 end *************");
console.log(TAG + '************* testIsAtFirstRow0003 end *************');
}
})
......@@ -1225,9 +1225,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isAtFirstRow after last row test
*/
it('testIsAtFirstRow0004', 0, async function (done) {
console.log(TAG + "************* testIsAtFirstRow0004 start *************");
console.log(TAG + '************* testIsAtFirstRow0004 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToLastRow())
......@@ -1235,7 +1235,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtFirstRow0004 end *************");
console.log(TAG + '************* testIsAtFirstRow0004 end *************');
}
})
......@@ -1245,9 +1245,9 @@ describe('rdbResultSetTest', function () {
* @tc.descresultSet isAtFirstRow test
*/
it('testIsAtFirstRow0005', 0, async function (done) {
console.log(TAG + "************* testIsAtFirstRow0005 start *************");
console.log(TAG + '************* testIsAtFirstRow0005 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
resultSet.goTo(1)
......@@ -1256,7 +1256,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtFirstRow0005 end *************");
console.log(TAG + '************* testIsAtFirstRow0005 end *************');
}
})
......@@ -1266,9 +1266,9 @@ describe('rdbResultSetTest', function () {
* @tc.descresultSet isAtFirstRow test
*/
it('testIsAtFirstRow0006', 0, async function (done) {
console.log(TAG + "************* testIsAtFirstRow0006 start *************");
console.log(TAG + '************* testIsAtFirstRow0006 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
resultSet.goTo(1)
......@@ -1277,7 +1277,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtFirstRow0006 end *************");
console.log(TAG + '************* testIsAtFirstRow0006 end *************');
}
})
......@@ -1287,9 +1287,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isAtLastRow test
*/
it('testIsAtLastRow0001', 0, async function (done) {
console.log(TAG + "************* testIsAtLastRow0001 start *************");
console.log(TAG + '************* testIsAtLastRow0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -1297,7 +1297,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtLastRow0001 end *************");
console.log(TAG + '************* testIsAtLastRow0001 end *************');
}
})
......@@ -1307,17 +1307,17 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isAtLastRow with no result test
*/
it('testIsAtLastRow0002', 0, async function (done) {
console.log(TAG + "************* testIsAtLastRow0002 start *************");
console.log(TAG + '************* testIsAtLastRow0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
{
expect(false).assertEqual(resultSet.isAtLastRow)
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtLastRow0002 end *************");
console.log(TAG + '************* testIsAtLastRow0002 end *************');
}
})
......@@ -1327,9 +1327,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isAtLastRow test
*/
it('testIsAtLastRow0003', 0, async function (done) {
console.log(TAG + "************* testIsAtLastRow0003 start *************");
console.log(TAG + '************* testIsAtLastRow0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
......@@ -1338,7 +1338,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtLastRow0003 end *************");
console.log(TAG + '************* testIsAtLastRow0003 end *************');
}
})
......@@ -1348,9 +1348,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isAtLastRow after last row test
*/
it('testIsAtLastRow0004', 0, async function (done) {
console.log(TAG + "************* testIsAtLastRow0004 start *************");
console.log(TAG + '************* testIsAtLastRow0004 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToLastRow())
......@@ -1358,7 +1358,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtLastRow0004 end *************");
console.log(TAG + '************* testIsAtLastRow0004 end *************');
}
})
......@@ -1368,9 +1368,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isAtLastRow test
*/
it('testIsAtLastRow0005', 0, async function (done) {
console.log(TAG + "************* testIsAtLastRow0005 start *************");
console.log(TAG + '************* testIsAtLastRow0005 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
resultSet.goToRow(2)
......@@ -1379,7 +1379,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsAtLastRow0005 end *************");
console.log(TAG + '************* testIsAtLastRow0005 end *************');
}
})
......@@ -1389,18 +1389,18 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getDouble test
*/
it('testGetDouble0001', 0, async function (done) {
console.log(TAG + "************* testGetDouble0001 start *************");
console.log(TAG + '************* testGetDouble0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
resultSet.goTo(1)
const data3 = resultSet.getDouble(resultSet.getColumnIndex("data3"))
const data3 = resultSet.getDouble(resultSet.getColumnIndex('data3'))
expect(1.0).assertEqual(data3)
}
resultSet = null;
done();
console.log(TAG + "************* testGetDouble0001 end *************");
console.log(TAG + '************* testGetDouble0001 end *************');
}
})
......@@ -1410,18 +1410,18 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getDouble test
*/
it('testGetDouble0002', 0, async function (done) {
console.log(TAG + "************* testGetDouble0002 start *************");
console.log(TAG + '************* testGetDouble0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
resultSet.goTo(2)
const data3 = resultSet.getDouble(resultSet.getColumnIndex("data3"))
const data3 = resultSet.getDouble(resultSet.getColumnIndex('data3'))
expect(2.5).assertEqual(data3)
}
resultSet = null;
done();
console.log(TAG + "************* testGetDouble0002 end *************");
console.log(TAG + '************* testGetDouble0002 end *************');
}
})
......@@ -1431,18 +1431,18 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getDouble test
*/
it('testGetDouble0003', 0, async function (done) {
console.log(TAG + "************* testGetDouble0003 start *************");
console.log(TAG + '************* testGetDouble0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
resultSet.goTo(3)
const data3 = resultSet.getDouble(resultSet.getColumnIndex("data3"))
const data3 = resultSet.getDouble(resultSet.getColumnIndex('data3'))
expect(1.8).assertEqual(data3)
}
resultSet = null;
done();
console.log(TAG + "************* testGetDouble0003 end *************");
console.log(TAG + '************* testGetDouble0003 end *************');
}
})
......@@ -1452,18 +1452,18 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getDouble test
*/
it('testGetDouble0004', 0, async function (done) {
console.log(TAG + "************* testGetDouble0004 start *************");
console.log(TAG + '************* testGetDouble0004 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
resultSet.goTo(1)
const data2 = resultSet.getDouble(resultSet.getColumnIndex("data2"))
const data2 = resultSet.getDouble(resultSet.getColumnIndex('data2'))
expect(10).assertEqual(data2)
}
resultSet = null;
done();
console.log(TAG + "************* testGetDouble0004 end *************");
console.log(TAG + '************* testGetDouble0004 end *************');
}
})
......@@ -1473,20 +1473,20 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isColumnNull test
*/
it('testIsColumnNull0001', 0, async function (done) {
console.log(TAG + "************* testIsColumnNull0001 start *************");
console.log(TAG + '************* testIsColumnNull0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
expect(true).assertEqual(resultSet.goToNextRow())
expect(true).assertEqual(resultSet.goToNextRow())
const isColumnNull1 = resultSet.isColumnNull(resultSet.getColumnIndex("data1"))
const isColumnNull1 = resultSet.isColumnNull(resultSet.getColumnIndex('data1'))
expect(false).assertEqual(isColumnNull1)
}
resultSet = null;
done();
console.log(TAG + "************* testIsColumnNull0001 end *************");
console.log(TAG + '************* testIsColumnNull0001 end *************');
}
})
......@@ -1496,20 +1496,20 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isColumnNull test
*/
it('testIsColumnNull0002', 0, async function (done) {
console.log(TAG + "************* testIsColumnNull0002 start *************");
console.log(TAG + '************* testIsColumnNull0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
expect(true).assertEqual(resultSet.goToFirstRow())
expect(true).assertEqual(resultSet.goToNextRow())
expect(true).assertEqual(resultSet.goToNextRow())
const isColumnNull4 = resultSet.isColumnNull(resultSet.getColumnIndex("data4"))
const isColumnNull4 = resultSet.isColumnNull(resultSet.getColumnIndex('data4'))
expect(true).assertEqual(isColumnNull4)
}
resultSet = null;
done();
console.log(TAG + "************* testIsColumnNull0002 end *************");
console.log(TAG + '************* testIsColumnNull0002 end *************');
}
})
......@@ -1519,9 +1519,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isColumnNull test
*/
it('testIsColumnNull0003', 0, async function (done) {
console.log(TAG + "************* testIsColumnNull0003 start *************");
console.log(TAG + '************* testIsColumnNull0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
resultSet.goToRow(5)
......@@ -1529,7 +1529,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsColumnNull0003 end *************");
console.log(TAG + '************* testIsColumnNull0003 end *************');
}
})
/**
......@@ -1538,9 +1538,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet isColumnNull test
*/
it('testIsColumnNull0004', 0, async function (done) {
console.log(TAG + "************* testIsColumnNull0004 start *************");
console.log(TAG + '************* testIsColumnNull0004 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
{
resultSet.goToRow(2)
......@@ -1548,7 +1548,7 @@ describe('rdbResultSetTest', function () {
}
resultSet = null;
done();
console.log(TAG + "************* testIsColumnNull0004 end *************");
console.log(TAG + '************* testIsColumnNull0004 end *************');
}
})
......@@ -1558,16 +1558,16 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getColumnIndex test
*/
it('testGetColumnIndex0001', 0, async function (done) {
console.log(TAG + "************* testGetColumnIndex0001 start *************");
console.log(TAG + '************* testGetColumnIndex0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
expect(true).assertEqual(resultSet.goToFirstRow())
expect(1).assertEqual(resultSet.getColumnIndex("data1"))
expect(1).assertEqual(resultSet.getColumnIndex('data1'))
resultSet = null;
done();
console.log(TAG + "************* testGetColumnIndex0001 end *************");
console.log(TAG + '************* testGetColumnIndex0001 end *************');
}
})
......@@ -1577,16 +1577,16 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getColumnIndex test
*/
it('testGetColumnIndex0002', 0, async function (done) {
console.log(TAG + "************* testGetColumnIndex0002 start *************");
console.log(TAG + '************* testGetColumnIndex0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
expect(-1).assertEqual(resultSet.getColumnIndex("data1"))
expect(-1).assertEqual(resultSet.getColumnIndex('data1'))
resultSet = null;
done();
console.log(TAG + "************* testGetColumnIndex0002 end *************");
console.log(TAG + '************* testGetColumnIndex0002 end *************');
}
})
......@@ -1596,15 +1596,15 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getColumnIndex test
*/
it('testGetColumnIndex0003', 0, async function (done) {
console.log(TAG + "************* testGetColumnIndex0003 start *************");
console.log(TAG + '************* testGetColumnIndex0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
expect(-1).assertEqual(resultSet.getColumnIndex("dataX"))
expect(-1).assertEqual(resultSet.getColumnIndex('dataX'))
resultSet = null;
done();
console.log(TAG + "************* testGetColumnIndex0003 end *************");
console.log(TAG + '************* testGetColumnIndex0003 end *************');
}
})
......@@ -1614,15 +1614,15 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getColumnIndex test
*/
it('testGetColumnIndex0004', 0, async function (done) {
console.log(TAG + "************* testGetColumnIndex0004 start *************");
console.log(TAG + '************* testGetColumnIndex0004 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
expect(-1).assertEqual(resultSet.getColumnIndex(""))
expect(-1).assertEqual(resultSet.getColumnIndex(''))
resultSet = null;
done();
console.log(TAG + "************* testGetColumnIndex0004 end *************");
console.log(TAG + '************* testGetColumnIndex0004 end *************');
}
})
......@@ -1632,17 +1632,17 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getColumnName test
*/
it('testGetColumnName0001', 0, async function (done) {
console.log(TAG + "************* testGetColumnIndex0001 start *************");
console.log(TAG + '************* testGetColumnIndex0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
expect("data1").assertEqual(resultSet.getColumnName(1))
expect("data4").assertEqual(resultSet.getColumnName(4))
expect('data1').assertEqual(resultSet.getColumnName(1))
expect('data4').assertEqual(resultSet.getColumnName(4))
resultSet = null;
done();
console.log(TAG + "************* testGetColumnName0001 end *************");
console.log(TAG + '************* testGetColumnName0001 end *************');
}
})
......@@ -1652,18 +1652,18 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getColumnName test
*/
it('testGetColumnName0002', 0, async function (done) {
console.log(TAG + "************* testGetColumnName0002 start *************");
console.log(TAG + '************* testGetColumnName0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
expect("").assertEqual(resultSet.getColumnName(1))
expect("").assertEqual(resultSet.getColumnName(4))
expect('').assertEqual(resultSet.getColumnName(1))
expect('').assertEqual(resultSet.getColumnName(4))
resultSet = null;
done();
console.log(TAG + "************* testGetColumnName0002 end *************");
console.log(TAG + '************* testGetColumnName0002 end *************');
}
})
......@@ -1673,16 +1673,16 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getColumnName test
*/
it('testGetColumnName0003', 0, async function (done) {
console.log(TAG + "************* testGetColumnName0003 start *************");
console.log(TAG + '************* testGetColumnName0003 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
expect("").assertEqual(resultSet.getColumnName(10))
expect('').assertEqual(resultSet.getColumnName(10))
resultSet = null;
done();
console.log(TAG + "************* testGetColumnName0003 end *************");
console.log(TAG + '************* testGetColumnName0003 end *************');
}
})
......@@ -1692,17 +1692,17 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet getColumnName test
*/
it('testGetColumnName0004', 0, async function (done) {
console.log(TAG + "************* testGetColumnName0004 start *************");
console.log(TAG + '************* testGetColumnName0004 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
expect("").assertEqual(resultSet.getColumnName(10))
expect('').assertEqual(resultSet.getColumnName(10))
resultSet = null;
done();
console.log(TAG + "************* testGetColumnName0004 end *************");
console.log(TAG + '************* testGetColumnName0004 end *************');
}
})
......@@ -1712,9 +1712,9 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet close test
*/
it('testClose0001', 0, async function (done) {
console.log(TAG + "************* testClose0001 start *************");
console.log(TAG + '************* testClose0001 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let resultSet = await rdbStore.query(predicates)
resultSet.goToRow(1)
resultSet.close()
......@@ -1722,7 +1722,7 @@ describe('rdbResultSetTest', function () {
resultSet = null;
done();
console.log(TAG + "************* testClose0001 end *************");
console.log(TAG + '************* testClose0001 end *************');
}
})
......@@ -1732,19 +1732,19 @@ describe('rdbResultSetTest', function () {
* @tc.desc resultSet close test
*/
it('testClose0002', 0, async function (done) {
console.log(TAG + "************* testClose0002 start *************");
console.log(TAG + '************* testClose0002 start *************');
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "wangwu");
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'wangwu');
let resultSet = await rdbStore.query(predicates)
resultSet.close()
expect(true).assertEqual(resultSet.isClosed)
resultSet = null;
done();
console.log(TAG + "************* testClose0002 end *************");
console.log(TAG + '************* testClose0002 end *************');
}
})
console.log(TAG + "*************Unit Test End*************");
console.log(TAG + '*************Unit Test End*************');
})
\ No newline at end of file
......@@ -15,13 +15,13 @@
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import dataRdb from '@ohos.data.rdb';
const TAG = "[RDB_JSKITS_TEST]"
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)";
const TAG = '[RDB_JSKITS_TEST]'
const CREATE_TABLE_TEST = 'CREATE TABLE IF NOT EXISTS test (' + 'id INTEGER PRIMARY KEY AUTOINCREMENT, ' + 'name TEXT NOT NULL, ' + 'age INTEGER, ' + 'salary REAL, ' + 'blobType BLOB)';
const STORE_CONFIG = {
name: "Delete.db",
name: 'Delete.db',
}
var rdbStore = undefined;
let rdbStore = undefined;
describe('rdbStoreDeleteTest', function () {
beforeAll(function () {
......@@ -36,65 +36,65 @@ describe('rdbStoreDeleteTest', function () {
afterEach(async function () {
console.info(TAG + 'afterEach')
await rdbStore.executeSql("DELETE FROM test");
await rdbStore.executeSql('DELETE FROM test');
rdbStore = null
await dataRdb.deleteRdbStore("Delete.db");
await dataRdb.deleteRdbStore('Delete.db');
})
afterAll(async function () {
console.info(TAG + 'afterAll')
})
console.log(TAG + "*************Unit Test Begin*************");
console.log(TAG + '*************Unit Test Begin*************');
/**
* @tc.name rdb delete test
* @tc.number SUB_DDM_AppDataFWK_JSRDB_Delete_0010
* @tc.desc rdb delete test
*/
it('testRdbStoreDelete0001', 0, async function (done) {
console.log(TAG + "************* testRdbStoreDelete0001 start *************");
var u8 = new Uint8Array([1, 2, 3])
console.log(TAG + '************* testRdbStoreDelete0001 start *************');
let u8 = new Uint8Array([1, 2, 3])
{
const valueBucket = {
"name": "zhangsan",
"age": 18,
"salary": 100.5,
"blobType": u8,
'name': 'zhangsan',
'age': 18,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 28,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 28,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 38,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 38,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
//删除
{
let predicates = await new dataRdb.RdbPredicates("test")
let predicates = await new dataRdb.RdbPredicates('test')
let deletePromise = rdbStore.delete(predicates)
deletePromise.then(async (ret) => {
expect(3).assertEqual(ret)
console.log(TAG + "Delete done: " + ret)
console.log(TAG + 'Delete done: ' + ret)
}).catch((err) => {
expect(null).assertFail()
})
await deletePromise
}
done()
console.log(TAG + "************* testRdbStoreDelete0001 end *************");
console.log(TAG + '************* testRdbStoreDelete0001 end *************');
})
/**
......@@ -103,50 +103,50 @@ describe('rdbStoreDeleteTest', function () {
* @tc.desc rdb delete test
*/
it('testRdbStoreDelete0002', 0, async function (done) {
console.log(TAG + "************* testRdbStoreDelete0002 start *************");
var u8 = new Uint8Array([1, 2, 3])
console.log(TAG + '************* testRdbStoreDelete0002 start *************');
let u8 = new Uint8Array([1, 2, 3])
{
const valueBucket = {
"name": "zhangsan",
"age": 18,
"salary": 100.5,
"blobType": u8,
'name': 'zhangsan',
'age': 18,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 28,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 28,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 38,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 38,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
//删除
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "zhangsan")
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'zhangsan')
let deletePromise = rdbStore.delete(predicates)
deletePromise.then(async (ret) => {
await expect(1).assertEqual(ret)
await console.log(TAG + "Delete done: " + ret)
await console.log(TAG + 'Delete done: ' + ret)
}).catch((err) => {
expect(null).assertFail()
})
await deletePromise
}
done()
console.log(TAG + "************* testRdbStoreDelete0002 end *************");
console.log(TAG + '************* testRdbStoreDelete0002 end *************');
})
/**
......@@ -155,41 +155,41 @@ describe('rdbStoreDeleteTest', function () {
* @tc.desc rdb delete test
*/
it('testRdbStoreDelete0003', 0, async function (done) {
console.log(TAG + "************* testRdbStoreDelete0003 start *************");
var u8 = new Uint8Array([1, 2, 3])
console.log(TAG + '************* testRdbStoreDelete0003 start *************');
let u8 = new Uint8Array([1, 2, 3])
{
const valueBucket = {
"name": "zhangsan",
"age": 18,
"salary": 100.5,
"blobType": u8,
'name': 'zhangsan',
'age': 18,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 28,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 28,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
//删除前查询
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("age", 28)
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('age', 28)
let resultSet = await rdbStore.query(predicates)
expect(1).assertEqual(resultSet.rowCount)
}
//删除
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("age", 28)
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('age', 28)
let deletePromise = rdbStore.delete(predicates)
deletePromise.then(async (ret) => {
expect(1).assertEqual(ret)
console.log(TAG + "Delete done: " + ret)
console.log(TAG + 'Delete done: ' + ret)
}).catch((err) => {
expect(null).assertFail()
})
......@@ -197,13 +197,13 @@ describe('rdbStoreDeleteTest', function () {
}
//删除后查询
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("age", 28)
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('age', 28)
let resultSet = await rdbStore.query(predicates)
expect(0).assertEqual(resultSet.rowCount)
}
done()
console.log(TAG + "************* testRdbStoreDelete0003 end *************");
console.log(TAG + '************* testRdbStoreDelete0003 end *************');
})
/**
......@@ -212,49 +212,49 @@ describe('rdbStoreDeleteTest', function () {
* @tc.desc rdb delete test
*/
it('testRdbStoreDelete0004', 0, async function (done) {
console.log(TAG + "************* testRdbStoreDelete0004 start *************");
var u8 = new Uint8Array([1, 2, 3])
console.log(TAG + '************* testRdbStoreDelete0004 start *************');
let u8 = new Uint8Array([1, 2, 3])
{
const valueBucket = {
"name": "zhangsan",
"age": 18,
"salary": 100.5,
"blobType": u8,
'name': 'zhangsan',
'age': 18,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 28,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 28,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 38,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 38,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
//删除
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("aaa id", 1)
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('aaa id', 1)
let deletePromise = rdbStore.delete(predicates)
deletePromise.then(async (ret) => {
console.log(TAG + "delete done: " + ret)
console.log(TAG + 'delete done: ' + ret)
expect(null).assertFail()
}).catch((err) => {
console.log(TAG + "delete with wrong conditions")
console.log(TAG + 'delete with wrong conditions')
})
}
done()
console.log(TAG + "************* testRdbStoreDelete0004 end *************");
console.log(TAG + '************* testRdbStoreDelete0004 end *************');
})
/**
......@@ -263,50 +263,50 @@ describe('rdbStoreDeleteTest', function () {
* @tc.desc rdb delete test
*/
it('testRdbStoreDelete0005', 0, async function (done) {
console.log(TAG + "************* testRdbStoreDelete0005 start *************");
var u8 = new Uint8Array([1, 2, 3])
console.log(TAG + '************* testRdbStoreDelete0005 start *************');
let u8 = new Uint8Array([1, 2, 3])
{
const valueBucket = {
"name": "zhangsan",
"age": 18,
"salary": 100.5,
"blobType": u8,
'name': 'zhangsan',
'age': 18,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 28,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 28,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 38,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 38,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
//删除
{
let predicates = await new dataRdb.RdbPredicates("test")
predicates.equalTo("name", "lisi")
let predicates = await new dataRdb.RdbPredicates('test')
predicates.equalTo('name', 'lisi')
let deletePromise = rdbStore.delete(predicates)
deletePromise.then(async (ret) => {
expect(2).assertEqual(ret)
console.log(TAG + "Delete done: " + ret)
console.log(TAG + 'Delete done: ' + ret)
}).catch((err) => {
expect(null).assertFail()
})
await deletePromise
}
done()
console.log(TAG + "************* testRdbStoreDelete0005 end *************");
console.log(TAG + '************* testRdbStoreDelete0005 end *************');
})
/**
......@@ -315,49 +315,49 @@ describe('rdbStoreDeleteTest', function () {
* @tc.desc rdb delete test
*/
it('testRdbStoreDelete0006', 0, async function (done) {
console.log(TAG + "************* testRdbStoreDelete0006 start *************");
var u8 = new Uint8Array([1, 2, 3])
console.log(TAG + '************* testRdbStoreDelete0006 start *************');
let u8 = new Uint8Array([1, 2, 3])
{
const valueBucket = {
"name": "zhangsan",
"age": 18,
"salary": 100.5,
"blobType": u8,
'name': 'zhangsan',
'age': 18,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 28,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 28,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
{
const valueBucket = {
"name": "lisi",
"age": 38,
"salary": 100.5,
"blobType": u8,
'name': 'lisi',
'age': 38,
'salary': 100.5,
'blobType': u8,
}
await rdbStore.insert("test", valueBucket)
await rdbStore.insert('test', valueBucket)
}
//删除
{
let predicates = await new dataRdb.RdbPredicates("")
let predicates = await new dataRdb.RdbPredicates('')
let deletePromise = rdbStore.delete(predicates)
deletePromise.then(async (ret) => {
console.log(TAG + "delete done: " + ret)
console.log(TAG + 'delete done: ' + ret)
expect(null).assertFail()
}).catch((err) => {
console.log(TAG + "delete with null")
console.log(TAG + 'delete with null')
})
}
done()
console.log(TAG + "************* testRdbStoreDelete0006 end *************");
console.log(TAG + '************* testRdbStoreDelete0006 end *************');
})
console.log(TAG + "*************Unit Test End*************");
console.log(TAG + '*************Unit Test End*************');
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册