提交 e4e1f623 编写于 作者: Z zhangfuzhi

add smsmmsbatchinsert

Signed-off-by: Nzhangfuzhi <zhangfuzhi1@huawei.com>
上级 9e6aa9f7
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"apiVersion": { "apiVersion": {
"compatible": 4, "compatible": 4,
"target": 5, "target": 7,
"releaseType": "Release" "releaseType": "Release"
} }
}, },
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"apiVersion": { "apiVersion": {
"compatible": 4, "compatible": 4,
"target": 5, "target": 7,
"releaseType": "Release" "releaseType": "Release"
} }
}, },
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"apiVersion": { "apiVersion": {
"compatible": 4, "compatible": 4,
"target": 5, "target": 7,
"releaseType": "Release" "releaseType": "Release"
} }
}, },
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
*/ */
export default { export default {
onCreate() { onCreate() {
console.info('TestApplication onCreate') console.info('TestApplication onCreate');
}, },
onDestroy() { onDestroy() {
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import { Hypium } from '@ohos/hypium' import { Hypium } from '@ohos/hypium';
import testsuite from '../../../test/List.test' import testsuite from '../../../test/List.test';
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
...@@ -25,13 +25,13 @@ export default { ...@@ -25,13 +25,13 @@ export default {
title: '' title: ''
}, },
onInit () { onInit () {
this.title = this.$t('strings.world'); this.title = this.$t('strings.world')
}, },
onShow () { onShow () {
console.info('onShow finish!'); console.info('onShow finish!');
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!') console.info('start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}, },
onReady () { onReady () {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
function translateParamsToString(parameters) { function translateParamsToString(parameters) {
const keySet = new Set([ const keySet = new Set([
...@@ -32,10 +32,10 @@ function translateParamsToString(parameters) { ...@@ -32,10 +32,10 @@ function translateParamsToString(parameters) {
export default { export default {
onPrepare() { onPrepare() {
console.info('OpenHarmonyTestRunner OnPrepare') console.info('OpenHarmonyTestRunner OnPrepare');
}, },
onRun() { onRun() {
console.log('OpenHarmonyTestRunner onRun run') console.log('OpenHarmonyTestRunner onRun run');
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
...@@ -44,12 +44,12 @@ function translateParamsToString(parameters) { ...@@ -44,12 +44,12 @@ function translateParamsToString(parameters) {
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
var debug = abilityDelegatorArguments.parameters["-D"] var debug = abilityDelegatorArguments.parameters["-D"]
console.info('debug value : '+debug) console.info('debug value : '+debug);
if (debug == 'true') if (debug == 'true')
{ {
cmd += ' -D' cmd += ' -D'
} }
console.info('cmd : '+cmd) console.info('cmd : '+cmd);
abilityDelegator.executeShellCommand(cmd, (err, data) => { abilityDelegator.executeShellCommand(cmd, (err, data) => {
console.info('executeShellCommand : err : ' + JSON.stringify(err)); console.info('executeShellCommand : err : ' + JSON.stringify(err));
console.info('executeShellCommand : data : ' + data.stdResult); console.info('executeShellCommand : data : ' + data.stdResult);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import SmsMmsBatchInsert from './SmsMmsBatchInsert.test' import SmsMmsBatchInsert from './SmsMmsBatchInsert.test';
export default function testsuite() { export default function testsuite() {
SmsMmsBatchInsert(); SmsMmsBatchInsert();
......
...@@ -96,10 +96,11 @@ export default function SmsMmsBatchInsert() { ...@@ -96,10 +96,11 @@ export default function SmsMmsBatchInsert() {
var exitTime = now.getTime() + numberMillis; var exitTime = now.getTime() + numberMillis;
while (true) { while (true) {
now = new Date(); now = new Date();
if (now.getTime() > exitTime) if (now.getTime() > exitTime){
return; return;
} }
} }
}
function ExpectTrue(data) { function ExpectTrue(data) {
try { try {
...@@ -138,8 +139,8 @@ export default function SmsMmsBatchInsert() { ...@@ -138,8 +139,8 @@ export default function SmsMmsBatchInsert() {
} }
ExpectTrue(data.code === 0); ExpectTrue(data.code === 0);
console.log(CASE_NAME + ' batchInsert Success, data:' + JSON.stringify(data)); console.log(CASE_NAME + ' batchInsert Success, data:' + JSON.stringify(data));
}) });
await sleep(100); sleep(100);
try { try {
let data = await DAHelper.query(URL_INFO); let data = await DAHelper.query(URL_INFO);
ExpectTrue(data.rowCount === num); ExpectTrue(data.rowCount === num);
...@@ -175,7 +176,7 @@ export default function SmsMmsBatchInsert() { ...@@ -175,7 +176,7 @@ export default function SmsMmsBatchInsert() {
ExpectFalse(); ExpectFalse();
console.log(CASE_NAME + ' batchInsert failed, data:' + JSON.stringify(data)); console.log(CASE_NAME + ' batchInsert failed, data:' + JSON.stringify(data));
done(); done();
}) });
}); });
/* /*
...@@ -195,8 +196,8 @@ export default function SmsMmsBatchInsert() { ...@@ -195,8 +196,8 @@ export default function SmsMmsBatchInsert() {
} }
ExpectTrue(data.code === 0); ExpectTrue(data.code === 0);
console.log(CASE_NAME + ' batchInsert Success, data:' + JSON.stringify(data)); console.log(CASE_NAME + ' batchInsert Success, data:' + JSON.stringify(data));
}) });
await sleep(100); sleep(100);
try { try {
let data = await DAHelper.query(URL_INFO); let data = await DAHelper.query(URL_INFO);
ExpectTrue(data.rowCount === 0); ExpectTrue(data.rowCount === 0);
...@@ -229,8 +230,8 @@ export default function SmsMmsBatchInsert() { ...@@ -229,8 +230,8 @@ export default function SmsMmsBatchInsert() {
} }
ExpectTrue(data.code === 0); ExpectTrue(data.code === 0);
console.log(CASE_NAME + ' batchInsert Success, data:' + JSON.stringify(data)); console.log(CASE_NAME + ' batchInsert Success, data:' + JSON.stringify(data));
}) });
await sleep(2000); sleep(2000);
try { try {
let data = await DAHelper.query(URL_INFO); let data = await DAHelper.query(URL_INFO);
ExpectTrue(data.rowCount === num); ExpectTrue(data.rowCount === num);
...@@ -266,7 +267,7 @@ export default function SmsMmsBatchInsert() { ...@@ -266,7 +267,7 @@ export default function SmsMmsBatchInsert() {
ExpectFalse(); ExpectFalse();
console.log(CASE_NAME + ' batchInsert failed, data:' + JSON.stringify(data)); console.log(CASE_NAME + ' batchInsert failed, data:' + JSON.stringify(data));
done(); done();
}) });
}); });
/* /*
...@@ -347,7 +348,7 @@ export default function SmsMmsBatchInsert() { ...@@ -347,7 +348,7 @@ export default function SmsMmsBatchInsert() {
done(); done();
return; return;
} }
await sleep(100); sleep(100);
try { try {
let data = await DAHelper.query(URL_INFO); let data = await DAHelper.query(URL_INFO);
ExpectTrue(data.rowCount === 0); ExpectTrue(data.rowCount === 0);
...@@ -383,7 +384,7 @@ export default function SmsMmsBatchInsert() { ...@@ -383,7 +384,7 @@ export default function SmsMmsBatchInsert() {
done(); done();
return; return;
} }
await sleep(100); sleep(100);
try { try {
let data = await DAHelper.query(URL_INFO); let data = await DAHelper.query(URL_INFO);
ExpectTrue(data.rowCount === num); ExpectTrue(data.rowCount === num);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册