提交 44334064 编写于 作者: L lixinyi

xts_acts_dstributeddatemgr1

Signed-off-by: Nlixinyi <lixinyi38@huawei.com>
上级 b00e24d7
...@@ -118,8 +118,8 @@ function publicBackup(kvStore,file){ ...@@ -118,8 +118,8 @@ function publicBackup(kvStore,file){
function publicDeleteBackup(kvStore,files){ function publicDeleteBackup(kvStore,files){
console.log(`Test deleteBackup ${JSON.stringify(files)}`) console.log(`Test deleteBackup ${JSON.stringify(files)}`)
try{
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
try{
kvStore.deleteBackup(files, function(err, data){ kvStore.deleteBackup(files, function(err, data){
console.log("Test deleteBackup BackUpInfo =" + data); console.log("Test deleteBackup BackUpInfo =" + data);
if (err != undefined) { if (err != undefined) {
...@@ -133,10 +133,10 @@ function publicDeleteBackup(kvStore,files){ ...@@ -133,10 +133,10 @@ function publicDeleteBackup(kvStore,files){
resolve(data); resolve(data);
} }
}) })
})
} catch (e) { } catch (e) {
console.log("111Test deleteBackup err information: " + e ); console.log("111Test deleteBackup err information: " + e );
} }
})
} }
function publicRestoreSp(kvStore,file){ function publicRestoreSp(kvStore,file){
...@@ -198,7 +198,12 @@ export default function kvStoreBackupCallbackJsunittest(){ ...@@ -198,7 +198,12 @@ export default function kvStoreBackupCallbackJsunittest(){
afterEach( async function () { afterEach( async function () {
console.info('afterEach: Test case-level clearance conditions, ' + console.info('afterEach: Test case-level clearance conditions, ' +
'which are executed after each test case is executed.'); 'which are executed after each test case is executed.');
try{
await publicDeleteBackup(kvStore,files); await publicDeleteBackup(kvStore,files);
}catch(e){
console.log("222Test deleteBackup err information: " + e );
};
await publicCloseKvStore(); await publicCloseKvStore();
files = [] files = []
}) })
...@@ -225,7 +230,7 @@ export default function kvStoreBackupCallbackJsunittest(){ ...@@ -225,7 +230,7 @@ export default function kvStoreBackupCallbackJsunittest(){
done(); done();
}).catch((err) => { }).catch((err) => {
console.log("SUB_DDM_DKV_KVBACKUP_MANALRESTORE_CALLBACK_0100 Manualrestore fail 1" + err); console.log("SUB_DDM_DKV_KVBACKUP_MANALRESTORE_CALLBACK_0100 Manualrestore fail 1" + err);
expect(err.code == 401 ).assertEqual(true); expect(err.code == "401" ).assertEqual(true);
done(); done();
}) })
} catch (e) { } catch (e) {
......
...@@ -113,8 +113,8 @@ function publicBackup(kvStore,file){ ...@@ -113,8 +113,8 @@ function publicBackup(kvStore,file){
function publicDeleteBackup(kvStore,files){ function publicDeleteBackup(kvStore,files){
console.log(`Test deleteBackup ${JSON.stringify(files)}`) console.log(`Test deleteBackup ${JSON.stringify(files)}`)
try{
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
try{
kvStore.deleteBackup(files, function(err, data){ kvStore.deleteBackup(files, function(err, data){
console.log("Test deleteBackup BackUpInfo =" + data); console.log("Test deleteBackup BackUpInfo =" + data);
if (err != undefined) { if (err != undefined) {
...@@ -128,10 +128,10 @@ function publicDeleteBackup(kvStore,files){ ...@@ -128,10 +128,10 @@ function publicDeleteBackup(kvStore,files){
resolve(data); resolve(data);
} }
}) })
})
} catch (e) { } catch (e) {
console.log("111Test deleteBackup err information: " + e ); console.log("111Test deleteBackup err information: " + e );
} }
})
} }
function publicRestoreSp(kvStore,file){ function publicRestoreSp(kvStore,file){
...@@ -190,7 +190,12 @@ export default function kvStoreBackupPromiseJsunittest(){ ...@@ -190,7 +190,12 @@ export default function kvStoreBackupPromiseJsunittest(){
afterEach( async function () { afterEach( async function () {
console.info('afterEach: Test case-level clearance conditions, ' + console.info('afterEach: Test case-level clearance conditions, ' +
'which are executed after each test case is executed.'); 'which are executed after each test case is executed.');
try{
await publicDeleteBackup(kvStore,files); await publicDeleteBackup(kvStore,files);
}catch(e){
console.log("222Test deleteBackup err information: " + e );
}
}) })
afterAll( async function () { afterAll( async function () {
console.info('afterAll: Test suite-level cleanup condition, ' + console.info('afterAll: Test suite-level cleanup condition, ' +
...@@ -213,11 +218,11 @@ export default function kvStoreBackupPromiseJsunittest(){ ...@@ -213,11 +218,11 @@ export default function kvStoreBackupPromiseJsunittest(){
publicRestore(kvStore).then((data) => { publicRestore(kvStore).then((data) => {
console.log("SUB_DDM_DKV_KVBACKUP_MANALRESTORE_PROMISE_0100 going restore = " + JSON.stringify(data)); console.log("SUB_DDM_DKV_KVBACKUP_MANALRESTORE_PROMISE_0100 going restore = " + JSON.stringify(data));
expect(true).assertEqual(data == 'code数字'); expect().assertFail();
done(); done();
}).catch((err) => { }).catch((err) => {
console.log("SUB_DDM_DKV_KVBACKUP_MANALRESTORE_PROMISE_0100 Manualrestore fail 1" + err); console.log("SUB_DDM_DKV_KVBACKUP_MANALRESTORE_PROMISE_0100 Manualrestore fail 1" + err);
expect(true).assertEqual(JSON.stringify(err) == '{}'); expect(err.code == "401" ).assertEqual(true);
done(); done();
}) })
} catch (e) { } catch (e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册