未验证 提交 c75afe04 编写于 作者: O openharmony_ci 提交者: Gitee

!7074 【Distributeddatamgr】【master】获取RDB 时,去掉version 信息

Merge pull request !7074 from yanglifeng/master
......@@ -30,7 +30,7 @@ const STORE_CONFIG = {
const DATABASE_BACKUP_NAME = "Backup.db"
async function CreatRdbStore(context, STORE_CONFIG) {
let RdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1)
let RdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG)
await RdbStore.executeSql(CREATE_TABLE_TEST, null)
let u8 = new Uint8Array([1, 2, 3])
{
......
......@@ -30,7 +30,7 @@ const STORE_CONFIG = {
const DATABASE_BACKUP_NAME = "Backup.db"
async function CreatRdbStore(context, STORE_CONFIG) {
let RdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1)
let RdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG)
await RdbStore.executeSql(CREATE_TABLE_TEST, null)
let u8 = new Uint8Array([1, 2, 3])
{
......
......@@ -34,7 +34,7 @@ describe('relationalStoreDeleteTest', function () {
beforeEach(async function () {
console.info(TAG + 'beforeEach')
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1);
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG);
await rdbStore.executeSql(CREATE_TABLE_TEST, null);
})
......
......@@ -67,7 +67,7 @@ export default function relationalStoreDistributedTest() {
describe('relationalStoreDistributedTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
rdbStore = await data_Rdb.getRdbStore(context, config, 1);
rdbStore = await data_Rdb.getRdbStore(context, config);
console.info(TAG + "create RelationalStore store success")
await executeSql1()
await executeSql2()
......@@ -399,7 +399,7 @@ describe('relationalStoreDistributedTest', function () {
"name": STORE_NAME,
securityLevel: data_Rdb.SecurityLevel.S1
}
rdbStore = await data_Rdb.getRdbStore(context, config, 1);
rdbStore = await data_Rdb.getRdbStore(context, config);
let errInfo = undefined
try{
rdbStore.obtainDistributedTableName(["deviceId"], "EMPLOYEE")
......
......@@ -41,7 +41,7 @@ const STORE_CONFIG_WRONG = {
export default function relationalStoreEncryptTest() {
async function CreatRdbStore(context, STORE_CONFIG) {
let rdbStore = await data_rdb.getRdbStore(context, STORE_CONFIG, 1)
let rdbStore = await data_rdb.getRdbStore(context, STORE_CONFIG)
await rdbStore.executeSql(CREATE_TABLE_TEST, null)
let u8 = new Uint8Array([1, 2, 3])
{
......@@ -107,7 +107,7 @@ describe('relationalStoreEncryptTest', function () {
it('RdbEncryptTest_0010', 0, async function (done) {
console.info(TAG + "************* RdbEncryptTest_0010 start *************")
context = ability_featureAbility.getContext()
data_rdb.getRdbStore(context, STORE_CONFIG_ENCRYPT, 1).then((store) => {
data_rdb.getRdbStore(context, STORE_CONFIG_ENCRYPT).then((store) => {
done()
expect(store != null).assertTrue();
}).catch((err) => {
......@@ -124,7 +124,7 @@ describe('relationalStoreEncryptTest', function () {
it('RdbEncryptTest_0020', 0, async function (done) {
console.info(TAG + "************* RdbEncryptTest_0020 start *************")
context = ability_featureAbility.getContext()
let storePromise = data_rdb.getRdbStore(context, STORE_CONFIG_UNENCRYPT, 1);
let storePromise = data_rdb.getRdbStore(context, STORE_CONFIG_UNENCRYPT);
storePromise.then((store) => {
expect(store != null).assertTrue();
done()
......
......@@ -30,7 +30,7 @@ export default function relationalStoreExcuteSqlTest() {
describe('relationalStoreExcuteSqlTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1);
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG);
await rdbStore.executeSql(CREATE_TABLE_TEST, null);
})
......
......@@ -37,7 +37,7 @@ export default function relationalStoreInsertTest() {
describe('relationalStoreInsertTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1);
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG);
await rdbStore.executeSql(CREATE_TABLE_TEST, null)
await rdbStore.executeSql(CREATE_TABLE_BATCHINSERT_TEST, null);
})
......
......@@ -57,7 +57,7 @@ describe('relationalStoreTest', function () {
*/
it('testRdbStore0001', 0, async function (done) {
console.info(TAG + "************* testRdbStore0001 start *************");
await data_Rdb.getRdbStore(context, STORE_CONFIG, 1).then(async (store) => {
await data_Rdb.getRdbStore(context, STORE_CONFIG).then(async (store) => {
try {
console.info(TAG + "getRdbStore done: " + store);
} catch (e) {
......@@ -77,7 +77,7 @@ describe('relationalStoreTest', function () {
*/
it('testRdbStore0002', 0, async function (done) {
console.info(TAG + "************* testRdbStore0002 start *************");
let storePromise = data_Rdb.getRdbStore(context, STORE_CONFIG, 2);
let storePromise = data_Rdb.getRdbStore(context, STORE_CONFIG);
storePromise.then(async (store) => {
try {
console.info(TAG + "getRdbStore done: " + store);
......@@ -107,7 +107,7 @@ describe('relationalStoreTest', function () {
securityLevel: data_Rdb.SecurityLevel.S1
}
try{
data_Rdb.getRdbStore(context, storeConfig, 4).then(async (ret) => {
data_Rdb.getRdbStore(context, storeConfig).then(async (ret) => {
console.info(TAG + "getRdbStore done" + ret);
expect(null).assertFail();
}).catch((err) => {
......@@ -130,7 +130,7 @@ describe('relationalStoreTest', function () {
it('testRdbStore0004', 0, async function (done) {
console.info(TAG + "************* testRdbStore0004 start *************");
try{
let store = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1)
let store = await data_Rdb.getRdbStore(context, STORE_CONFIG)
await store.executeSql(CREATE_TABLE_TEST);
await data_Rdb.deleteRdbStore(context, "rdbstore.db")
}catch (e) {
......@@ -148,7 +148,7 @@ describe('relationalStoreTest', function () {
it('testRdbStore0005', 0, async function (done) {
console.info(TAG + "************* testRdbStore0005 start *************");
try {
let store = await data_Rdb.getRdbStore(context, STORE_CONFIG, 2);
let store = await data_Rdb.getRdbStore(context, STORE_CONFIG);
console.info(TAG + "Get rdbstore success")
await store.executeSql(CREATE_TABLE_TEST);
await data_Rdb.deleteRdbStore(context, "rdbstore.db")
......@@ -172,7 +172,7 @@ describe('relationalStoreTest', function () {
name: "rdbstorecontext.db",
securityLevel: data_Rdb.SecurityLevel.S1
}
rdbstore = await data_Rdb.getRdbStore(context,STORE_CONFIG, 1)
rdbstore = await data_Rdb.getRdbStore(context,STORE_CONFIG)
console.info(TAG + "Get rdbstore success")
expect(rdbstore != null).assertTrue();
await data_Rdb.deleteRdbStore(context, STORE_CONFIG.name)
......@@ -198,7 +198,7 @@ describe('relationalStoreTest', function () {
name: "rdbstorecontext.db",
securityLevel: data_Rdb.SecurityLevel.S1
}
rdbstore = await data_Rdb.getRdbStore(contextApplication,STORE_CONFIG, 1)
rdbstore = await data_Rdb.getRdbStore(contextApplication,STORE_CONFIG)
console.info(TAG + "Get rdbstore success")
expect(rdbstore != null).assertTrue();
await data_Rdb.deleteRdbStore(context, STORE_CONFIG.name)
......@@ -218,7 +218,7 @@ describe('relationalStoreTest', function () {
*/
it('testRdbStore0008', 0, async function (done) {
console.info(TAG + "************* testRdbStore0008 start *************");
data_Rdb.getRdbStore(context, STORE_CONFIG, 1, async (err,data) => {
data_Rdb.getRdbStore(context, STORE_CONFIG, async (err,data) => {
console.info(TAG + "getRdbStore finish")
console.info(TAG + "getRdbStore success: " + data)
expect(data != null).assertTrue();
......@@ -236,7 +236,7 @@ describe('relationalStoreTest', function () {
*/
it('testRdbStore0009', 0, async function(done){
console.info(TAG + "************* testRdbStore0009 start *************");
data_Rdb.getRdbStore(contextApplication, STORE_CONFIG, 1, async (err,data) => {
data_Rdb.getRdbStore(contextApplication, STORE_CONFIG, async (err,data) => {
console.info(TAG + "getRdbStore finish")
console.info(TAG + "getRdbStore success: " + data)
expect(data != null).assertTrue();
......
......@@ -28,7 +28,7 @@ export default function relationalStorePredicatesComplexFiledTest(){
describe('relationalStorePredicatesComplexFiledTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1);
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG);
await generateTable();
})
......
......@@ -52,7 +52,7 @@ describe('relationalStorePredicatesJoinTest', function () {
beforeEach(async function () {
console.info(TAG + 'beforeEach')
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, CURRENT_STORE_VERSION);
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG);
await generateUserTable();
await generateBookTable();
console.info(TAG + 'beforeEach end')
......
......@@ -37,7 +37,7 @@ export default function relationalStorePredicatesTest() {
describe('relationalStorePredicatesTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1);
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG);
await rdbStore.executeSql(CREATE_TABLE_ALL_DATA_TYPE_SQL, null);
await buildAllDataType1();
await buildAllDataType2();
......
......@@ -33,7 +33,7 @@ var rdbStore
var context = ability_featureAbility.getContext()
async function CreatRdbStore(context, STORE_CONFIG) {
let RdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1)
let RdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG)
await RdbStore.executeSql(CREATE_TABLE_TEST, null)
let u8 = new Uint8Array([1, 2, 3])
{
......
......@@ -66,7 +66,7 @@ export default function relationalStoreResultSetTest() {
describe('relationalStoreResultSetTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1);
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG);
await rdbStore.executeSql(CREATE_TABLE_TEST, null);
await createTest();
})
......
......@@ -36,7 +36,7 @@ describe('relationalStoreTransactionTest', function () {
beforeEach(async function () {
console.info(TAG + 'beforeEach')
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1);
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG);
await rdbStore.executeSql(CREATE_TABLE_TEST, null);
})
......
......@@ -33,7 +33,7 @@ describe('relationalStoreUpdateTest', function () {
beforeEach(async function () {
console.info(TAG + 'beforeEach')
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG, 1);
rdbStore = await data_Rdb.getRdbStore(context, STORE_CONFIG);
await rdbStore.executeSql(CREATE_TABLE_TEST, null);
})
......
......@@ -34,7 +34,7 @@ describe('relationalStoreDistributedTest', function () {
})
beforeEach(async function () {
rdbStore = await dataRdb.getRdbStore(context, config, 1);
rdbStore = await dataRdb.getRdbStore(context, config);
await rdbStore.executeSql(CREATE_TABLE_TEST, null)
console.info(TAG + 'beforeEach')
})
......
......@@ -55,7 +55,7 @@ describe('relationalStoreTest', function () {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
let storePromise = dataRdb.getRdbStore(context, config, 1);
let storePromise = dataRdb.getRdbStore(context, config);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
......@@ -84,7 +84,7 @@ describe('relationalStoreTest', function () {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S2
}
let storePromise = dataRdb.getRdbStore(context, config, 1);
let storePromise = dataRdb.getRdbStore(context, config);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
......@@ -113,7 +113,7 @@ describe('relationalStoreTest', function () {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S3
}
let storePromise = dataRdb.getRdbStore(context, config, 1);
let storePromise = dataRdb.getRdbStore(context, config);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
......@@ -142,7 +142,7 @@ describe('relationalStoreTest', function () {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S4
}
let storePromise = dataRdb.getRdbStore(context, config, 1);
let storePromise = dataRdb.getRdbStore(context, config);
storePromise.then(async (store) => {
try {
await store.executeSql(CREATE_TABLE_TEST);
......@@ -171,7 +171,7 @@ describe('relationalStoreTest', function () {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S1
}
dataRdb.getRdbStore(context, config, 1, async (err,data) => {
dataRdb.getRdbStore(context, config, async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error" + err.message)
expect(null).assertFail();
......@@ -198,7 +198,7 @@ describe('relationalStoreTest', function () {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S2
}
dataRdb.getRdbStore(context, config, 1,async (err,data) => {
dataRdb.getRdbStore(context, config,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
......@@ -224,7 +224,7 @@ describe('relationalStoreTest', function () {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S3
}
dataRdb.getRdbStore(context, config, 1,async (err,data) => {
dataRdb.getRdbStore(context, config,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
......@@ -250,7 +250,7 @@ describe('relationalStoreTest', function () {
name: "secure.db",
securityLevel: dataRdb.SecurityLevel.S4
}
dataRdb.getRdbStore(context, config, 1,async (err,data) => {
dataRdb.getRdbStore(context, config,async (err,data) => {
if(err != null){
console.info(TAG + "get rdb store error")
expect(null).assertFail();
......@@ -277,7 +277,7 @@ describe('relationalStoreTest', function () {
securityLevel: dataRdb.SecurityLevel.S4
}
let deleteResult = false
await dataRdb.getRdbStore(context, config, 1).then(async (store) => {
await dataRdb.getRdbStore(context, config).then(async (store) => {
console.info(TAG + "create table success")
})
await dataRdb.deleteRdbStore(context,"secure.db").then(() => {
......@@ -302,7 +302,7 @@ describe('relationalStoreTest', function () {
securityLevel: dataRdb.SecurityLevel.S1
}
let deleteResult = false
await dataRdb.getRdbStore(context, config, 1).then(async (store) => {
await dataRdb.getRdbStore(context, config).then(async (store) => {
console.info(TAG + "create rdb store success")
})
dataRdb.deleteRdbStore(context,"secure.db", (err, data) => {
......
......@@ -29,7 +29,7 @@ export default function relationalStoreResultSetTest(context) {
describe('relationalStoreResultSetTest', function () {
beforeAll(async function () {
console.info(TAG + 'beforeAll')
rdbStore = await dataRdb.getRdbStore(context, STORE_CONFIG, 1);
rdbStore = await dataRdb.getRdbStore(context, STORE_CONFIG);
await rdbStore.executeSql(CREATE_TABLE_TEST, null);
await createTest();
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册