提交 9dc4bbfe 编写于 作者: C chengxingzhen

compilation problem

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 80c34241
......@@ -45,6 +45,7 @@ var subscriberInfo = {
events: ["CallTest"],
};
var caseDepBundles = [];
var subscriber = null;
class MySequenceable {
num: number = 0;
......@@ -134,6 +135,13 @@ export default function abilityTest(abilityContext) {
afterEach(async (done) => {
var testMissionId;
if (subscriber != null) {
commonEvent.unsubscribe(subscriber, () => {
console.log('======>afterEach unsubscribe<=======');
});
subscriber = null;
}
testMissionId = await getMissionId(sysAMainAbilityName, 0);
console.log('======>afterEach test missionId<=======' + testMissionId);
if (testMissionId != -1) {
......@@ -158,10 +166,10 @@ export default function abilityTest(abilityContext) {
*/
it('ACTS_CommonComponent_Call_0100', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0100 begin');
var subscriber;
function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_0100 unSubscribeCallBack')
subscriber = null;
done();
}
......@@ -241,11 +249,11 @@ export default function abilityTest(abilityContext) {
*/
it('ACTS_CommonComponent_Call_0300', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0300 begin');
var subscriber;
caseDepBundles = [systemAppCalleeABundleName];
function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_0300 unSubscribeCallBack')
subscriber = null;
done();
}
......@@ -327,13 +335,13 @@ export default function abilityTest(abilityContext) {
*/
it('ACTS_CommonComponent_Call_0500', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0500 begin');
var subscriber;
var caller1;
var caller2;
caseDepBundles = [systemAppCalleeABundleName];
function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_0500 unSubscribeCallBack')
subscriber = null;
caller1.release();
done();
}
......@@ -426,12 +434,12 @@ export default function abilityTest(abilityContext) {
*/
it('ACTS_CommonComponent_Call_0700', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0700 begin');
var subscriber;
var caller;
caseDepBundles = [systemAppCalleeABundleName];
function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_0700 unSubscribeCallBack')
subscriber = null;
done();
}
......@@ -549,12 +557,12 @@ export default function abilityTest(abilityContext) {
*/
it('ACTS_CommonComponent_Call_0900', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_0900 begin');
var subscriber;
caseDepBundles = [thirdAppABundleName];
var caller;
function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_0900 unSubscribeCallBack')
subscriber = null;
done();
}
......@@ -660,7 +668,6 @@ export default function abilityTest(abilityContext) {
*/
it('ACTS_CommonComponent_Call_1900', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_1900 begin');
var subscriber;
var callBackCnt = 0;
function checkFinish() {
......@@ -672,6 +679,7 @@ export default function abilityTest(abilityContext) {
function unSubscribeCallBack() {
console.log('ACTS_CommonComponent_Call_1900 unSubscribeCallBack')
subscriber = null;
done();
}
......
......@@ -14,7 +14,7 @@
*/
@Entry
@Component
struct Index {
struct Second {
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('SystemCallTest SecondAbility)')
......
......@@ -64,7 +64,7 @@ function testCall(data) {
commonEvent.publish('CallTest', commonEventData, (err) => {
console.log('======>CallTestSysA ThirdAbility Call_Finish<======')
})
return;
return recvSequence;
}
function testCallWithResult(data) {
......
......@@ -12,20 +12,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Core} from 'deccjsunit/index'
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
core.execute()
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
......
......@@ -15,6 +15,7 @@
import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent"
import rpc from '@ohos.rpc';
export default class ServiceAbility2 extends ServiceExtensionAbility {
onCreate(want) {
......@@ -39,6 +40,7 @@ export default class ServiceAbility2 extends ServiceExtensionAbility {
onConnect(want) {
console.log('ServiceAbility2 onConnect');
return new rpc.RemoteObject('connect');
}
onDisconnect(want) {
......
......@@ -15,6 +15,7 @@
import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent"
import rpc from '@ohos.rpc';
export default class ServiceAbility extends ServiceExtensionAbility {
onCreate(want) {
......@@ -35,6 +36,7 @@ export default class ServiceAbility extends ServiceExtensionAbility {
onConnect(want) {
console.log('ServiceAbility onConnect');
return new rpc.RemoteObject('connect');
}
onDisconnect(want) {
......
......@@ -13,6 +13,7 @@
* limitations under the License.
*/
import commonEvent from '@ohos.commonEvent'
import rpc from '@ohos.rpc';
import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility'
var conn = -1;
......@@ -41,6 +42,51 @@ function publishCallBackttwo () {
console.log("========Publish CallBack AMSc_disonnectAbility_0200_commonEvent========");
}
class Stub extends rpc.RemoteObject {
constructor(des) {
super(des);
}
onRemoteRequest(code, data, reply, option) {
reply.writeNoException();
reply.writeString("success");
return true;
}
}
function onConnectCallback(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onConnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onConnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback1(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback2(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback3(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback4(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback5(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onDisconnectCallback6(element) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.bundleName : ' + element.bundleName)
console.log('ACTS_ConnectAbility_0100 ConnectAbility onDisconnect element.abilityName : ' + element.abilityName)
}
function onFailedCallback(code) {
console.log('ACTS_ConnectAbility_0100 ConnectAbility onFailed errCode : ' + code)
}
export default class ServiceAbility extends ServiceExtensionAbility {
onCreate(want) {
console.log('ServiceAbility onCreate, want: ' + want.abilityName);
......@@ -85,16 +131,30 @@ export default class ServiceAbility extends ServiceExtensionAbility {
{
bundleName: "com.example.actsconnectabilitysystemabilitytest",
abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility2",
}
},
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback1,
onFailed: onFailedCallback,
},
);
var myStub4 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub4;
};
if (want.action == "Eight") {
extensionContext.connectAbility(
{
bundleName: "com.example.actsconnectabilitysystemabilitytest",
abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility3",
}
},
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback6,
onFailed: onFailedCallback,
},
);
var myStub1 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub1;
};
if (want.action == "Nine") {
console.log('connectAbility 111');
......@@ -102,12 +162,19 @@ export default class ServiceAbility extends ServiceExtensionAbility {
{
bundleName: 'com.example.actsconnectabilitysystemabilitytest',
abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2'
})
},
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback2,
onFailed: onFailedCallback,
},)
setTimeout(()=>{
extensionContext.disconnectAbility(num).then(()=>{
console.log('in disconnectAbility');
})
},1000)
var myStub2 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub2;
};
if (want.action == "Ten") {
......@@ -116,12 +183,19 @@ export default class ServiceAbility extends ServiceExtensionAbility {
{
bundleName: 'com.example.actsconnectabilitysystemabilitytest',
abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2'
})
},
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback3,
onFailed: onFailedCallback,
},)
setTimeout(()=>{
extensionContext.disconnectAbility(num).then(()=>{
console.log('in disconnectAbility2');
})
},1000)
var myStub3 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub3;
};
if (want.action == "Ten one") {
......@@ -130,12 +204,19 @@ export default class ServiceAbility extends ServiceExtensionAbility {
{
bundleName: 'com.example.actsconnectabilitysystemabilitytest',
abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2'
})
},
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback4,
onFailed: onFailedCallback,
},)
setTimeout(()=>{
extensionContext.disconnectAbility(2222).then(()=>{
console.log('in disconnectAbility3');
})
},1000)
var myStub5 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub5;
};
if (want.action == "Ten two") {
......@@ -144,12 +225,19 @@ export default class ServiceAbility extends ServiceExtensionAbility {
{
bundleName: 'com.example.actsconnectabilitysystemabilitytest',
abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2'
})
},
{
onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback5,
onFailed: onFailedCallback,
},)
setTimeout(()=>{
extensionContext.disconnectAbility(2222).then(()=>{
console.log('in disconnectAbility4');
})
},1000)
var myStub6 = new Stub("com.example.actsconnectabilitysystemabilitytest.MainAbility");
return myStub6;
};
}
......
......@@ -14,7 +14,8 @@
*/
import Extension from '@ohos.application.ServiceExtensionAbility'
import commonEvent from '@ohos.commonEvent'
import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc';
export default class ServiceExtAbility extends Extension {
onCreate(want) {
......@@ -26,7 +27,7 @@ export default class ServiceExtAbility extends Extension {
console.info('mxh ServiceAbility onRequest**');
}
onConnect(want) {
onConnect(want:Want) {
console.info('mxh ServiceAbility onConnect**');
commonEvent.publish("ACTS_ConnectAbility_0100_CommonEvent", {
parameters: {
......@@ -36,6 +37,7 @@ export default class ServiceExtAbility extends Extension {
console.log("Demo Publish CallBack MainAbility_Start_CommonEvent")
});
console.log('Demo SerivceAbilityServer OnConnect start 1');
return new rpc.RemoteObject('connect');
}
onDisconnect(want) {
......
......@@ -14,10 +14,12 @@
*/
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent"
import commonEvent from "@ohos.commonEvent";
import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc';
export default class ServiceAbility extends ServiceExtension {
onCreate(want,startId) {
onCreate(want:Want) {
globalThis.abilityWant = want;
console.log('ServiceAbility onCreate, want: ' + want.abilityName);
}
......@@ -40,7 +42,9 @@ export default class ServiceAbility extends ServiceExtension {
console.log("MainAbility Publish CallBack MainAbility_Start_CommonEvent")
});
console.log('stub SerivceAbilityServer OnConnect start 2');
}
return new rpc.RemoteObject('connect');
}
onDisconnect(want) {
......
......@@ -14,10 +14,12 @@
*/
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent"
import commonEvent from "@ohos.commonEvent";
import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc';
export default class ServiceAbility extends ServiceExtension {
onCreate(want,startId) {
onCreate(want:Want) {
globalThis.abilityWant = want;
console.log('ServiceAbility onCreate, want: ' + want.abilityName);
}
......@@ -41,7 +43,7 @@ export default class ServiceAbility extends ServiceExtension {
});
console.log('stub SerivceAbilityServer OnConnect start 1');
}
return new rpc.RemoteObject('connect');
}
onDisconnect(want) {
......
......@@ -237,7 +237,7 @@ export default function abilityTest(abilityContext) {
commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => {
console.debug("====>ACTS_getExtensionInfo_0200_Create Subscriber====>");
subscriber = data;
await commonEvent.subscribe(subscriber, subscribeCallBack);.
await commonEvent.subscribe(subscriber, subscribeCallBack);
connId = await abilityContext.connectAbility(
{
bundleName: "com.example.staticextensioninfotest",
......
......@@ -14,50 +14,22 @@
*/
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
@Entry
@Component
struct Index {
aboutToAppear(){
aboutToAppear() {
console.info("start run testcase!!!!")
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
const reportExtend = new ReportExtend(file)
core.addService('report', reportExtend)
core.init()
core.subscribeEvent('task', reportExtend)
const configService = core.getDefaultService('config')
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters)
testsuite(globalThis.abilityContext)
core.execute()
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('querytesttwo')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
......
......@@ -13,10 +13,12 @@
* limitations under the License.
*/
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc';
export default class ServiceAbility extends ServiceExtension {
onCreate(want,startId) {
onCreate(want:Want) {
globalThis.abilityWant = want;
console.log('ServiceAbility onCreate, want: ' + want.abilityName);
}
......@@ -43,7 +45,7 @@ export default class ServiceAbility extends ServiceExtension {
})
console.log('stub SerivceAbilityServer OnConnect start 2');
}
return new rpc.RemoteObject('connect');
}
onDisconnect(want) {
......
......@@ -13,11 +13,12 @@
* limitations under the License.
*/
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
// import commonEvent from '@ohos.commonEvent'
import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
import Want from '@ohos.application.Want';
import rpc from "@ohos.rpc";
export default class ServiceAbility extends ServiceExtension {
onCreate(want, startId) {
onCreate(want: Want) {
globalThis.abilityWant = want;
console.log('ACTS_NewWant ServiceAbility onCreate, want: ' + want.abilityName);
}
......@@ -40,6 +41,7 @@ export default class ServiceAbility extends ServiceExtension {
},
)
}
return new rpc.RemoteObject('connect');
}
onDisconnect(want) {
......
......@@ -12,7 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
import Want from '@ohos.application.Want';
import {voidOutStringCallback} from "./zidlTool/i_zidl_tool_test";
import {voidOutIntCallback} from "./zidlTool/i_zidl_tool_test";
import {voidOutMapStringIntCallback} from "./zidlTool/i_zidl_tool_test";
......@@ -408,7 +409,7 @@ class ZidlTestImp extends ZidlTestServiceStub {
}
export default class ServiceAbility extends ServiceExtension {
onCreate(want,startId) {
onCreate(want: Want) {
globalThis.abilityWant = want;
console.log('ZidlClientTest ServiceAbility onCreate, want: ' + want.abilityName);
}
......
......@@ -12,7 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import ServiceExtension from '@ohos.application.ServiceExtensionAbility';
import Want from '@ohos.application.Want';
import ZidlTestServiceStubOneway from './zidlToolOneWay/interface_attribute_declaratoin_oneway_stub';
import {voidVoidFirstCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway'
import {voidVoidSecondCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway'
......@@ -39,7 +40,7 @@ class ZidlTestImpOneway extends ZidlTestServiceStubOneway {
}
export default class ServiceAbility2 extends ServiceExtension {
onCreate(want,startId) {
onCreate(want: Want) {
globalThis.abilityWant = want;
console.log('ZidlClientTest ServiceAbility2 onCreate, want: ' + want.abilityName);
}
......
......@@ -13,6 +13,7 @@
* limitations under the License.
*/
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import Want from '@ohos.application.Want';
import {voidOutStringCallback} from "./zidlTool/i_zidl_tool_test";
import {voidOutIntCallback} from "./zidlTool/i_zidl_tool_test";
import {voidOutMapStringIntCallback} from "./zidlTool/i_zidl_tool_test";
......@@ -408,7 +409,7 @@ class ZidlTestImp extends ZidlTestServiceStub {
}
export default class ServiceAbility extends ServiceExtension {
onCreate(want,startId) {
onCreate(want: Want) {
globalThis.abilityWant = want;
console.log('ZidlService ServiceAbility onCreate, want: ' + want.abilityName);
}
......
......@@ -13,6 +13,7 @@
* limitations under the License.
*/
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import Want from '@ohos.application.Want';
import ZidlTestServiceStubOneway from './zidlToolOneWay/interface_attribute_declaratoin_oneway_stub';
import {voidVoidFirstCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway'
import {voidVoidSecondCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway'
......@@ -39,7 +40,7 @@ class ZidlTestImpOneway extends ZidlTestServiceStubOneway {
}
export default class ServiceAbility2 extends ServiceExtension {
onCreate(want,startId) {
onCreate(want: Want) {
globalThis.abilityWant = want;
console.log('ZidlService ServiceAbility2 onCreate, want: ' + want.abilityName);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册