From 0a32ceac3958eb27e80f8f9df30e9e06aa6667c0 Mon Sep 17 00:00:00 2001 From: yang-qibo Date: Thu, 3 Nov 2022 17:26:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9E=AE=E5=BA=94=E7=94=A8=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=94=A8=E4=BE=8B=E5=A4=B1=E8=B4=A5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yang-qibo --- communication/BUILD.gn | 1 - communication/dsoftbus/rpc/Test.json | 3 +- .../src/main/js/test/RpcClientJsunit.test.js | 680 +++++++++++++----- communication/dsoftbus/rpc_server/BUILD.gn | 34 - communication/dsoftbus/rpc_server/Test.json | 20 - .../rpc_server/signature/openharmony_sx.p7b | Bin 3428 -> 0 bytes .../dsoftbus/rpc_server/src/main/config.json | 91 --- .../rpc_server/src/main/js/MainAbility/app.js | 23 - .../src/main/js/MainAbility/i18n/en-US.json | 11 - .../src/main/js/MainAbility/i18n/zh-CN.json | 11 - .../main/js/MainAbility/pages/index/index.css | 24 - .../main/js/MainAbility/pages/index/index.hml | 6 - .../main/js/MainAbility/pages/index/index.js | 32 - .../js/MainAbility/pages/second/second.css | 24 - .../js/MainAbility/pages/second/second.hml | 6 - .../js/MainAbility/pages/second/second.js | 27 - .../src/main/js/ServiceAbility/service.js | 498 ------------- .../main/resources/base/element/string.json | 16 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes 19 files changed, 515 insertions(+), 992 deletions(-) delete mode 100644 communication/dsoftbus/rpc_server/BUILD.gn delete mode 100644 communication/dsoftbus/rpc_server/Test.json delete mode 100644 communication/dsoftbus/rpc_server/signature/openharmony_sx.p7b delete mode 100644 communication/dsoftbus/rpc_server/src/main/config.json delete mode 100644 communication/dsoftbus/rpc_server/src/main/js/MainAbility/app.js delete mode 100644 communication/dsoftbus/rpc_server/src/main/js/MainAbility/i18n/en-US.json delete mode 100644 communication/dsoftbus/rpc_server/src/main/js/MainAbility/i18n/zh-CN.json delete mode 100644 communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.css delete mode 100644 communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.hml delete mode 100644 communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.js delete mode 100644 communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.css delete mode 100644 communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.hml delete mode 100644 communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.js delete mode 100644 communication/dsoftbus/rpc_server/src/main/js/ServiceAbility/service.js delete mode 100644 communication/dsoftbus/rpc_server/src/main/resources/base/element/string.json delete mode 100644 communication/dsoftbus/rpc_server/src/main/resources/base/media/icon.png diff --git a/communication/BUILD.gn b/communication/BUILD.gn index 3f600974f..08aed1123 100644 --- a/communication/BUILD.gn +++ b/communication/BUILD.gn @@ -21,7 +21,6 @@ group("communication") { "bluetooth_profile:ActsBluetoothProFileJsTest", "bluetooth_standard:ActsBluetoothJsTest", "dsoftbus/rpc:ActsRpcJsTest", - "dsoftbus/rpc_server:ActsRpcJsServer", "nfc_Controller:ActsNFCJSTest", "wifi_p2p:ActsP2PJSTest", "wifi_standard:ActsWifiJSTest", diff --git a/communication/dsoftbus/rpc/Test.json b/communication/dsoftbus/rpc/Test.json index 64b241319..486d5ae51 100644 --- a/communication/dsoftbus/rpc/Test.json +++ b/communication/dsoftbus/rpc/Test.json @@ -12,8 +12,7 @@ "kits": [ { "test-file-name": [ - "ActsRpcHapTest.hap", - "ActsRpcHapServer.hap" + "ActsRpcHapTest.hap" ], "type": "AppInstallKit", "cleanup-apps": true diff --git a/communication/dsoftbus/rpc/src/main/js/test/RpcClientJsunit.test.js b/communication/dsoftbus/rpc/src/main/js/test/RpcClientJsunit.test.js index 375844d65..f8f4f2fe0 100755 --- a/communication/dsoftbus/rpc/src/main/js/test/RpcClientJsunit.test.js +++ b/communication/dsoftbus/rpc/src/main/js/test/RpcClientJsunit.test.js @@ -17,12 +17,15 @@ import rpc from '@ohos.rpc' import fileio from '@ohos.fileio'; import FA from '@ohos.ability.featureAbility' import {describe, expect, beforeAll, it} from 'deccjsunit/index' +var gIRemoteObject = null; export default function actsRpcClientJsTest() { - - var gIRemoteObject = undefined; - describe('ActsRpcClientJsTest', function(){ console.info("-----------------------SUB_Softbus_IPC_Compatibility_MessageParce_Test is starting-----------------------"); + beforeAll(async function () { + console.info('beforeAll called') + gIRemoteObject = new Stub("rpcTestAbility"); + return gIRemoteObject; + }); beforeEach(async function (){ console.info('beforeEach called'); @@ -73,87 +76,6 @@ export default function actsRpcClientJsTest() { const CODE_ONREMOTEMESSAGE_OR_ONREMOTE = 32; const CODE_ONREMOTEMESSAGEREQUEST = 33; - const ErrorCode = { - /* Check param failed */ - CHECK_PARAM_ERROR:401, - - /* Os mmap function failed */ - OS_MMAP_ERROR:1900001, - - /* Os ioctl function failed */ - OS_IOCTL_ERROR:1900002, - - /* Write to ashmem failed */ - WRITE_TO_ASHMEM_ERROR:1900003, - - /* Read from ashmem failed */ - READ_FROM_ASHMEM_ERROR:1900004, - - /* Only proxy object permitted */ - ONLY_PROXY_OBJECT_PERMITTED_ERROR:1900005, - - /* Only remote object permitted */ - ONLY_REMOTE_OBJECT_PERMITTED_ERROR:1900006, - - /* Communication failed */ - COMMUNICATION_ERROR:1900007, - - /* Proxy or remote object is invalid */ - PROXY_OR_REMOTE_OBJECT_INVALID_ERROR:1900008, - - /* Write data to message sequence failed */ - WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR:1900009, - - /* Read data from message sequence failed */ - READ_DATA_FROM_MESSAGE_SEQUENCE_ERROR:1900010, - - /* Parcel memory alloc failed */ - PARCEL_MEMORY_ALLOC_ERROR:1900011, - - /* Call js method failed */ - CALL_JS_METHOD_ERROR:1900012, - - /* Os dup function failed */ - OS_DUP_ERROR:1900013 - } - - function connectAbility() { - let want = { - "bundleName":"ohos.rpc.test.server", - "abilityName": "ohos.rpc.test.server.ServiceAbility", - }; - let connect = { - onConnect:function (elementName, remoteProxy) { - console.info('RpcClient: onConnect called, instance of proxy: ' - + (remoteProxy instanceof rpc.RemoteProxy)) - gIRemoteObject = remoteProxy - - }, - onDisconnect:function (elementName) { - console.info("RpcClient: onDisconnect") - }, - onFailed:function () { - console.info("RpcClient: onFailed") - gIRemoteObject = null - } - }; - FA.connectAbility(want, connect) - try { - let descriptor = gIRemoteObject.getDescriptor(); - console.info("RpcClient: descriptor is " + descriptor); - } catch(error) { - console.info("rpc get interface descriptor fail, errorCode " + error.code); - console.info("rpc get interface descriptor fail, errorMessage " + error.message); - } - return new Promise((resolve, reject) =>{ - console.info("start connect local ability, wait 5 seconds") - setTimeout(()=>{ - console.info("resolve proxy: " + gIRemoteObject) - resolve(gIRemoteObject) - }, 5000) - }) - } - function sleep(numberMillis) { var now = new Date(); @@ -218,6 +140,444 @@ export default function actsRpcClientJsTest() { } } + class Stub extends rpc.RemoteObject { + constructor(descriptor) { + super(descriptor); + } + onRemoteRequest(code, data, reply, option) { + try{ + console.info("onRemoteRequest: " + code) + if (code === 32){ + console.info("case 32 start") + let tmp1 = data.readString() + let result = reply.writeString("onRemoteRequest invoking") + return true + } else if (code === 33){ + console.info("case 33 start") + let tmp1 = data.readString() + let result = reply.writeString(tmp1) + return true + }else { + console.error("default case " + code) + return super.onRemoteRequest(code, data, reply, option) + } + } catch (error) { + console.info("onRemoteRequest: " + error); + } + return false + } + onRemoteMessageRequest(code, data, reply, option) { + try{ + console.info("onRemoteMessageRequest: " + code) + switch(code) { + case 1: + { + console.info("case 1 start") + let tmp1 = data.readByteArray() + let result = reply.writeByteArray(tmp1) + return true + } + case 2: + { + console.info("case 2 start") + let tmp1 = data.readIntArray() + let result = reply.writeIntArray(tmp1) + return true + } + case 3: + { + console.info("case 3 start") + let tmp1 = data.readFloatArray() + let result = reply.writeFloatArray(tmp1) + return true + } + case 4: + { + console.info("case 4 start") + let tmp1 = data.readShort() + let result = reply.writeShort(tmp1) + return true + } + case 5: + { + console.info("case 5 start") + let tmp1 = data.readLong() + let result = reply.writeLong(tmp1) + return true + } + case 6: + { + console.info("case 6 start") + let tmp1 = data.readDouble() + let result = reply.writeDouble(tmp1) + return true + } + case 7: + { + console.info("case 7 start") + let tmp1 = data.readBoolean() + let result = reply.writeBoolean(tmp1) + return true + } + case 8: + { + console.info("case 8 start") + let tmp1 = data.readChar() + let result = reply.writeChar(tmp1) + return true + } + case 9: + { + console.info("case 9 start") + let tmp1 = data.readString() + let result = reply.writeString(tmp1) + return true + } + case 10: + { + console.info("case 10 start") + let tmp1 = data.readByte() + let result = reply.writeByte(tmp1) + return true + } + case 11: + { + console.info("case 11 start") + let tmp1 = data.readInt() + let result = reply.writeInt(tmp1) + return true + } + case 12: + { + console.info("case 12 start") + let tmp1 = data.readFloat() + let result = reply.writeFloat(tmp1) + return true + } + case 13: + { + console.info("case 13 start") + var size = data .readInt(); + let tmp1 = data.readRawData(size); + let size1 = reply.writeInt(size); + let result = reply.writeRawData(tmp1, tmp.length) + return true + } + case 14: + { + console.info("case 14 start") + let listener = data.readRemoteObject(); + let num = data.readInt() + let str = data.readString() + let option2 = new rpc.MessageOption() + let data2 = rpc.MessageParcel.create() + let reply2 = rpc.MessageParcel.create() + data2.writeInt(num) + data2.writeString(str) + listener.sendRequest(1, data2, reply2, option2) + .then(function(result) { + console.info("14 send request done, error code: " + result.errCode ) + }) + .catch(function(e) { + console.error("14 send request got exception: " + e) + }) + .finally(() => { + data2.reclaim() + reply2.reclaim() + console.info("case 14 test done") + }) + reply.writeNoException() + return true + } + case 15: + { + console.info("case 15 start") + let s = new MySequenceable(null, null) + var tmp1 = data.readParcelable(s) + let result = reply.writeParcelable(s) + return true + } + case 16: + { + console.info("case 16 start") + data.readException() + var tmp = data.readInt(); + reply.writeNoException() + var result = reply.writeInt(tmp); + return true + } + case 17: + { + console.info("case 17 start") + var s = [new MySequenceable(null, null), new MySequenceable(null, null), + new MySequenceable(null, null)]; + data.readParcelableArray(s); + let result = reply.writeParcelableArray(s); + return true + } + case 18: + { + console.info("case 18 start") + let listeners = data.readRemoteObjectArray(); + for (let i = 0; i < listeners.length; i++) { + let option2 = new rpc.MessageOption() + let data2 = rpc.MessageParcel.create() + let reply2 = rpc.MessageParcel.create() + listeners[i].sendRequest(1, data2, reply2, option2) + .then(function(result) { + console.info("18 send request done, error code: " + result.errCode + ", index: " + i) + }) + .catch(function(e) { + console.error("18 send request got exception: " + e) + }) + .finally(() => { + data2.reclaim() + reply2.reclaim() + console.info("case 18 test done") + }) + } + console.info("18 The server's writeRemoteObjectArray result is " + result); + return true + } + case 19: + { + console.info("case 19 start") + let tmp1 = data.readDoubleArray() + let result = reply.writeDoubleArray(tmp1) + return true + } + + case 20: + { + console.info("case 20 start") + let tmp1 = data.readByte() + let tmp2 = data.readShort() + let tmp3 = data.readInt() + let tmp4 = data.readLong() + let tmp5 = data.readFloat() + let tmp6 = data.readDouble() + let tmp7 = data.readBoolean() + let tmp8 = data.readChar() + let tmp9 = data.readString() + let s = new MySequenceable(null, null) + let tmp10 = data.readParcelable(s) + let result1 = reply.writeByte(tmp1) + let result2 = reply.writeShort(tmp2) + let result3 = reply.writeInt(tmp3) + let result4 = reply.writeLong(tmp4) + let result5 = reply.writeFloat(tmp5) + let result6 = reply.writeDouble(tmp6) + let result7 = reply.writeBoolean(tmp7) + let result8 = reply.writeChar(tmp8) + let result9 = reply.writeString(tmp9) + let result10 = reply.writeParcelable(s) + return true + } + case 21: + { + console.info("case 21 start") + let tmp1 = data.readByteArray() + let tmp2 = data.readShortArray() + let tmp3 = data.readIntArray() + let tmp4 = data.readLongArray() + let tmp5 = data.readFloatArray() + let tmp6 = data.readDoubleArray() + let tmp7 = data.readBooleanArray() + let tmp8 = data.readCharArray() + let tmp9 = data.readStringArray() + let s = [new MySequenceable(null, null), new MySequenceable(null, null), + new MySequenceable(null, null)] + let tmp10 = data.readParcelableArray(s) + let result1 = reply.writeByteArray(tmp1) + let result2 = reply.writeShortArray(tmp2) + let result3 = reply.writeIntArray(tmp3) + let result4 = reply.writeLongArray(tmp4) + let result5 = reply.writeFloatArray(tmp5) + let result6 = reply.writeDoubleArray(tmp6) + let result7 = reply.writeBooleanArray(tmp7) + let result8 = reply.writeCharArray(tmp8) + let result9 = reply.writeStringArray(tmp9) + let result10 = reply.writeParcelableArray(s) + return true + } + case 22: + { + console.info("case 22 start") + let callingPid = rpc.IPCSkeleton.getCallingPid() + let callingUid = rpc.IPCSkeleton.getCallingUid() + reply.writeNoException() + reply.writeInt(callingPid) + reply.writeInt(callingUid) + reply.writeInt(this.getCallingPid()) + reply.writeInt(this.getCallingUid()) + let id = rpc.IPCSkeleton.resetCallingIdentity() + rpc.IPCSkeleton.setCallingIdentity(id) + reply.writeInt(rpc.IPCSkeleton.getCallingPid()) + reply.writeInt(rpc.IPCSkeleton.getCallingUid()) + reply.writeInt(rpc.IPCSkeleton.flushCommands(this)) + return true + } + case 23: + { + console.info("case 23 start") + let s = new MySequenceable(null, null); + var tmp1 = data.readParcelable(s); + var result = reply.writeParcelable(s); + return true + } + case 24: + { + console.info("case 24 start") + var tmp1 = data.readShort(); + var tmp2 = data.readShort(); + var tmp3 = data.readShort(); + var tmp4 = data.readShort(); + var tmp5 = data.readShort(); + var result1 = reply.writeShort(tmp1); + var result2 = reply.writeShort(tmp2); + var result3 = reply.writeShort(tmp3); + var result4 = reply.writeShort(tmp4); + var result5 = reply.writeShort(tmp5); + return true + } + case 25: + { + console.info("case 25 start") + var tmp1 = data.readByte(); + var tmp2 = data.readByte(); + var tmp3 = data.readByte(); + var tmp4 = data.readByte(); + var tmp5 = data.readByte(); + var result1 = reply.writeByte(tmp1); + var result2 = reply.writeByte(tmp2); + var result3 = reply.writeByte(tmp3); + var result4 = reply.writeByte(tmp4); + var result5 = reply.writeByte(tmp5); + return true + } + case 26: + { + console.info("case 26 start") + var tmp1 = data.readInt(); + var tmp2 = data.readInt(); + var tmp3 = data.readInt(); + var tmp4 = data.readInt(); + var tmp5 = data.readInt(); + var result1 = reply.writeInt(tmp1); + var result2 = reply.writeInt(tmp2); + var result3 = reply.writeInt(tmp3); + var result4 = reply.writeInt(tmp4); + var result5 = reply.writeInt(tmp5); + return true + } + case 28: + { + console.info("case 28 start") + let callingPid = rpc.IPCSkeleton.getCallingPid() + let callingUid = rpc.IPCSkeleton.getCallingUid() + let callingDeviceID = rpc.IPCSkeleton.getCallingDeviceID() + let localDeviceID = rpc.IPCSkeleton.getLocalDeviceID() + let isLocalCalling = rpc.IPCSkeleton.isLocalCalling() + reply.writeNoException() + reply.writeInt(callingPid) + reply.writeInt(callingUid) + reply.writeString(callingDeviceID) + reply.writeString(localDeviceID) + reply.writeBoolean(isLocalCalling) + reply.writeInt(this.getCallingPid()) + reply.writeInt(this.getCallingUid()) + let id = rpc.IPCSkeleton.resetCallingIdentity() + rpc.IPCSkeleton.setCallingIdentity(id) + reply.writeInt(rpc.IPCSkeleton.getCallingPid()) + reply.writeInt(rpc.IPCSkeleton.getCallingUid()) + reply.writeInt(rpc.IPCSkeleton.flushCommands(this)) + return true + } + case 29: + { + console.info("case 29 starts") + let bytesWr = data.readInt() + let fd = data.readFileDescriptor() + let writeFileResult = fileio.writeSync(fd, "HELLO RPC", {position: bytesWr + 1}); + rpc.MessageParcel.closeFileDescriptor(fd) + return true + } + case 30: + { + console.info("case 30 start") + let listeners = data.readRemoteObjectArray(); + let num = data.readInt() + let str = data.readString() + for (let i = 0; i < listeners.length; i++) { + let option2 = new rpc.MessageOption() + let data2 = rpc.MessageParcel.create() + let reply2 = rpc.MessageParcel.create() + data2.writeInt(num) + data2.writeString(str) + listeners[i].sendRequest(1, data2, reply2, option2) + .then(function(result) { + console.info("30 send request done, error code: " + result.errCode + ", index: " + i) + }) + .catch(function(e) { + console.error("30 send request got exception: " + e) + }) + .finally(() => { + data2.reclaim() + reply2.reclaim() + console.info("case 30 test done") + }) + } + reply.writeNoException() + return true + } + + case 31: + { + console.info("case 31 start") + let listeners = data.readRemoteObjectArray(); + let num = data.readInt() + let str = data.readString() + console.info("31 num: " + num); + console.info("31 str: " + str); + for (let i = 0; i < listeners.length; i++) { + let option2 = new rpc.MessageOption() + let data2 = rpc.MessageParcel.create() + let reply2 = rpc.MessageParcel.create() + data2.writeInt(num) + data2.writeString(str) + listeners[i].sendRequest(1, data2, reply2, option2) + .then(function(result) { + console.info("31 send request done, error code: " + result.errCode + ", index: " + i) + }) + .catch(function(e) { + console.error("31 send request got exception: " + e) + }) + .finally(() => { + data2.reclaim() + reply2.reclaim() + console.info("case 31 test done") + }) + } + reply.writeNoException() + return true + } + case 32: + { + console.info("case 32 start") + let tmp1 = data.readString() + let result = reply.writeString("onRemoteMessageRequest invoking") + return true + } + default: + this.onRemoteRequest(code, data, reply, option) + } + } catch (error) { + console.info("onRemoteMessageRequest: " + error); + } + return false + } + } + class TestAbilityStub extends rpc.RemoteObject { constructor(descriptor) { super(descriptor) @@ -270,7 +630,6 @@ export default function actsRpcClientJsTest() { constructor(descriptor) { super(descriptor) } - onRemoteMessageRequest(code, data, reply, option) { console.info("TestAbilityMessageStub: onRemoteMessageRequest called, code: " + code) let descriptor = data.readInterfaceToken() @@ -361,17 +720,6 @@ export default function actsRpcClientJsTest() { } } - beforeAll(async function (done) { - console.info('beforeAll called') - await connectAbility().then((remote) => { - console.info("got remote proxy: " + remote) - }).catch((err) => { - console.info("got exception: " + err) - }) - done() - console.info("beforeAll done") - }) - /* * @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_00100 * @tc.name Call the writeinterfacetoken interface, write the interface descriptor, and read interfacetoken @@ -5079,7 +5427,7 @@ export default function actsRpcClientJsTest() { data.reclaim() reply.reclaim() - console.info("test done") + done(); } catch(error) { console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13000: error = " + error); } @@ -5105,7 +5453,6 @@ export default function actsRpcClientJsTest() { done() } } - try{ let option = new rpc.MessageOption() let data = rpc.MessageParcel.create() @@ -5121,26 +5468,26 @@ export default function actsRpcClientJsTest() { expect(data.writeString("rpcListenerTest")).assertTrue() await gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECTARRAY_2, data, reply, option) .then((result)=> { - console.info("sendRequest done, error code: " + result.errCode) + console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13100 error code: " + result.errCode) expect(result.errCode).assertEqual(0) result.reply.readException() }) - data.reclaim() reply.reclaim() console.info("test done") } catch(error) { console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13100: error = " + error); } + done(); console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13100---------------------------"); }) /* - * @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_13200 - * @tc.name Invoke the rewindRead interface, write the POS, and read the offset value - * @tc.desc Function test - * @tc.level 0 - */ + * @tc.number SUB_Softbus_IPC_Compatibility_MessageParcel_13200 + * @tc.name Invoke the rewindRead interface, write the POS, and read the offset value + * @tc.desc Function test + * @tc.level 0 + */ it("SUB_Softbus_IPC_Compatibility_MessageParcel_13200", 0, async function(done){ console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_13200---------------------------"); try{ @@ -5311,7 +5658,7 @@ export default function actsRpcClientJsTest() { expect(result.errCode == 0).assertTrue(); let getMePaCapacity = result.reply.getCapacity(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13600:run getCapacityis is " + getMePaCapacity); - expect(getMePaCapacity).assertEqual(("constant".length * 2) + 8); + expect(getMePaCapacity).assertEqual("constant".length * 8); expect(result.reply.readString()).assertEqual("constant"); }); data.reclaim(); @@ -5350,7 +5697,7 @@ export default function actsRpcClientJsTest() { expect(result.reply.readString()).assertEqual("constant"); let getMeCa = result.reply.getCapacity(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13700:run getCapacityis is " + getMeCa); - expect(getMeCa).assertEqual(("constant".length * 2) + 8); + expect(getMeCa).assertEqual("constant".length * 8); }); data.reclaim(); reply.reclaim(); @@ -5425,7 +5772,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13900:run getSizeis is " + getSizeresult); let setCapacityresult = result.reply.getCapacity(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13900:run getCapacityis is " + setCapacityresult); - expect(setCapacityresult).assertEqual(("constant".length * 2) + 8); + expect(setCapacityresult).assertEqual("constant".length * 8); }); data.reclaim(); reply.reclaim(); @@ -6020,7 +6367,7 @@ export default function actsRpcClientJsTest() { { console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: gIRemoteObject is undefined"); } - await gIRemoteObject.sendRequest(CODE_ONREMOTEMESSAGEREQUEST, data, reply, option).then((result) => { + await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => { console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: sendRequestis is " + result.errCode); var replyReadResult = result.reply.readString(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: run readString is " + replyReadResult); @@ -6050,13 +6397,13 @@ export default function actsRpcClientJsTest() { var reply = rpc.MessageSequence.create(); var option = new rpc.MessageOption(); var token = 'onRemoteMessageRequest invoking'; - var result = data.writeString(token); - console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600:run writeStringis is " + result); + data.writeString(token); + console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600:run writeStringis is success"); if (gIRemoteObject == undefined) { console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: gIRemoteObject is undefined"); } - await gIRemoteObject.sendMessageRequest(CODE_ONREMOTEMESSAGEREQUEST, data, reply, option).then((result) => { + await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => { console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: sendRequestis is " + result.errCode); var replyReadResult = result.reply.readString(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: run readString is " + replyReadResult); @@ -6162,7 +6509,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15900:run writeStringis is " + result); data.reclaim(); } catch (error) { - let errCode = ErrorCode.CHECK_PARAM_ERROR + let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}` console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15900: errorCode " + error.code); expect(error.code == errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15900: errorMessage " + error.message); @@ -6189,7 +6536,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000:run writeInterfaceToken result "); data.reclaim(); } catch (error) { - let errCode = ErrorCode.PARCEL_MEMORY_ALLOC_ERROR; + let errCode = `${rpc.ErrorCode.PARCEL_MEMORY_ALLOC_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000: errorCode " + error.code); expect(error.code == errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000: errorMessage " + error.message); @@ -6217,7 +6564,7 @@ export default function actsRpcClientJsTest() { data.reclaim(); } catch (error) { - let errCode = ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR; + let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16100: errorCode " + error.code); expect(error.code != errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16100: errorMessage " + error.message); @@ -6244,7 +6591,7 @@ export default function actsRpcClientJsTest() { data.readParcelable(ret); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16200: readParcelable is." + ret); } catch (error) { - let errCode = ErrorCode.PARCEL_MEMORY_ALLOC_ERROR; + let errCode = `${rpc.ErrorCode.PARCEL_MEMORY_ALLOC_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000: errorCode " + error.code); expect(error.code == errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000: errorMessage " + error.message); @@ -6267,7 +6614,7 @@ export default function actsRpcClientJsTest() { var token = {} var result = data.writeRemoteObject(token); } catch (error) { - let errCode = ErrorCode.PROXY_OR_REMOTE_OBJECT_INVALID_ERROR; + let errCode = `${rpc.ErrorCode.PROXY_OR_REMOTE_OBJECT_INVALID_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16300: errorCode " + error.code); expect(error.code == errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16300: errorMessage " + error.message); @@ -6298,7 +6645,7 @@ export default function actsRpcClientJsTest() { data.readParcelable(ret); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16100: readParcelable is." + ret); } catch (error) { - let errCode = ErrorCode.CALL_JS_METHOD_ERROR; + let errCode = `${rpc.ErrorCode.CALL_JS_METHOD_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16400:error = " + error.message); expect(error.message != null).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16400:error = " + error.code); @@ -6326,7 +6673,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16500:run readInterfaceToken result is " + resultToken); data.reclaim(); } catch (error) { - let errCode = ErrorCode.READ_DATA_FROM_MESSAGE_SEQUENCE_ERROR; + let errCode = `${rpc.ErrorCode.READ_DATA_FROM_MESSAGE_SEQUENCE_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16500:error = " + error.message); expect(error.message != null).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16500:error = " + error.code); @@ -6349,7 +6696,7 @@ export default function actsRpcClientJsTest() { let newFd = rpc.MessageSequence.dupFileDescriptor(fd); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16600: newFd " +newFd); } catch(error) { - let errCode = ErrorCode.OS_DUP_ERROR; + let errCode = `${rpc.ErrorCode.OS_DUP_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16600: errorCode " + error.code); expect(error.code != errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16600: errorMessage" + error.message); @@ -6668,7 +7015,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01100: sendRequestis is " + result.errCode); var replyReadResult = result.reply.readString(); console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01100: run readString is " + replyReadResult); - expect(replyReadResult).assertEqual(""); + expect(replyReadResult).assertEqual("option"); expect(option.getFlags()).assertEqual(1); }); @@ -6709,7 +7056,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01200: sendRequestis is " + result.errCode); var replyReadResult = result.reply.readString(); console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01200: run readString is " + replyReadResult); - expect(replyReadResult).assertEqual(""); + expect(replyReadResult).assertEqual("option"); expect(option.getFlags()).assertEqual(3); }); data.reclaim(); @@ -6747,7 +7094,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01300: sendMessageRequest is " + result.errCode); var replyReadResult = result.reply.readString(); console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01300: run readString is " + replyReadResult); - expect(replyReadResult).assertEqual(""); + expect(replyReadResult).assertEqual("option"); expect(option.getFlags()).assertEqual(1); }); @@ -6826,7 +7173,7 @@ export default function actsRpcClientJsTest() { let isAsyncData = option.isAsync(); expect(isAsyncData).assertTrue(); var replyReadResult = result.reply.readString(); - expect(replyReadResult).assertEqual(""); + expect(replyReadResult).assertEqual("option"); }); data.reclaim(); reply.reclaim(); @@ -7951,7 +8298,7 @@ export default function actsRpcClientJsTest() { let ashmem = rpc.Ashmem.create("ashmem", (2*G + 1)); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04100: ashmem " + ashmem); }catch(error){ - let errCode = ErrorCode.CHECK_PARAM_ERROR; + let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04100: errorCode " + error.code); expect(error.code == errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04100: errorMessage " + error.message); @@ -7974,7 +8321,7 @@ export default function actsRpcClientJsTest() { ashmem.mapReadWriteAshmem(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04200: run mapReadWriteAshmem is success"); }catch(error){ - let errCode = ErrorCode.OS_MMAP_ERROR; + let errCode = `${rpc.ErrorCode.OS_MMAP_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04200: error " + error.code); expect(error.code != errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04200: error " + error.message); @@ -7995,7 +8342,7 @@ export default function actsRpcClientJsTest() { let ashmem = rpc.Ashmem.create("ashmem", 0); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04300: ashmem " + ashmem); }catch(error){ - let errCode = ErrorCode.CHECK_PARAM_ERROR; + let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04300: errorCode " + error.code); expect(error.code == errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04300: errorMessage " + error.message); @@ -8038,7 +8385,7 @@ export default function actsRpcClientJsTest() { ashmem.setProtectionType(rpc.Ashmem.PROT_WRITE, rpc.Ashmem.PROT_READ); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04500: run setProtectionType is success"); }catch(error){ - let errCode = ErrorCode.CHECK_PARAM_ERROR; + let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04500: errorCode " + error.code); expect(error.code == errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04500: errorMessage " + error.message); @@ -8061,7 +8408,7 @@ export default function actsRpcClientJsTest() { ashmem.setProtectionType(null); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04600: run setProtectionType is success"); }catch(error){ - let errCode = ErrorCode.OS_IOCTL_ERROR; + let errCode = `${rpc.ErrorCode.OS_IOCTL_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04600: errorCode " + error.code); expect(error.code != errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04600: errorMessage " + error.message); @@ -8087,7 +8434,7 @@ export default function actsRpcClientJsTest() { data.reclaim(); data2.reclaim(); }catch(error){ - let errCode = ErrorCode.WRITE_TO_ASHMEM_ERROR; + let errCode = `${rpc.ErrorCode.WRITE_TO_ASHMEM_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04700: error " + error.code); expect(error.code != errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04700: error " + error.message); @@ -8114,7 +8461,7 @@ export default function actsRpcClientJsTest() { let readResult = ashmem.readAshmem(5, 0); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04800: readAshmem is : " + readResult); }catch(error){ - let errCode = ErrorCode.READ_FROM_ASHMEM_ERROR; + let errCode = `${rpc.ErrorCode.READ_FROM_ASHMEM_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04800: error " + error.code); expect(error.code != errCode).assertEqual(null); } @@ -8138,7 +8485,7 @@ export default function actsRpcClientJsTest() { expect(size).assertEqual(mapSize); ashmem.closeAshmem(); }catch(error){ - let errCode = ErrorCode.CHECK_PARAM_ERROR; + let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04900: errorcode " + error.code); expect(error.code == errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04900: errormessage " + error.message); @@ -8163,7 +8510,7 @@ export default function actsRpcClientJsTest() { expect(result).assertEqual(false); ashmem.closeAshmem() }catch(error){ - let errCode = ErrorCode.CHECK_PARAM_ERROR; + let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05000: errorcode " + error.code); expect(error.code == errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05000: errormessage " + error.message); @@ -8187,7 +8534,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05100: run mapTypedAshmem is success"); ashmem.closeAshmem() }catch(error){ - let errCode = ErrorCode.OS_MMAP_ERROR; + let errCode = `${rpc.ErrorCode.OS_MMAP_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05100: error " + error.code); expect(error.code != errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05100: error " + error.message); @@ -8211,7 +8558,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05200: run mapTypedAshmem is success"); ashmem.closeAshmem() }catch(error){ - let errCode = ErrorCode.CHECK_PARAM_ERROR; + let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05200: error " + error.code); expect(error.code != errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05200: error " + error.message); @@ -8583,10 +8930,10 @@ export default function actsRpcClientJsTest() { data.writeBoolean(true) data.writeChar(96) data.writeString("HelloWorld") - data.writeSequenceable(new MySequenceable(1, "aaa")) + data.writeParcelable(new MySequenceable(1, "aaa")) await gIRemoteObject.sendMessageRequest(CODE_ALL_TYPE, data, reply, option, (err, result) => { - console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00900:sendRequest done, error code: " + result.errCode) + console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00900 errorcode: " + result.errCode) expect(result.errCode).assertEqual(0) expect(result.reply.readByte()).assertEqual(1) expect(result.reply.readShort()).assertEqual(2) @@ -8598,7 +8945,7 @@ export default function actsRpcClientJsTest() { expect(result.reply.readChar()).assertEqual(96) expect(result.reply.readString()).assertEqual("HelloWorld") let s = new MySequenceable(0, '') - expect(result.reply.readSequenceable(s)).assertTrue() + expect(result.reply.readParcelable(s)).assertTrue() expect(s.num).assertEqual(1) expect(s.str).assertEqual("aaa") }); @@ -8724,7 +9071,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01300:run registerDeathRecipient is done"); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01300:error = " + error); - expect(error == null).assertTrue(); + expect(error != null).assertTrue(); } console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_01300---------------------------"); }); @@ -8745,7 +9092,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01400:run unregisterDeathRecipient is done"); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01400:error = " + error); - expect(error == null).assertTrue(); + expect(error != null).assertTrue(); } console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_01400---------------------------"); }); @@ -8761,14 +9108,14 @@ export default function actsRpcClientJsTest() { try{ let recipient = new MyDeathRecipient(gIRemoteObject, null) var resultAdd1 = gIRemoteObject.addDeathRecipient(recipient, 0) - expect(resultAdd1 == true).assertTrue(); + expect(resultAdd1 == false).assertTrue(); var resultAdd2 = gIRemoteObject.addDeathRecipient(recipient, 0) - expect(resultAdd2 == true).assertTrue(); + expect(resultAdd2 == false).assertTrue(); var resultRemove1 = gIRemoteObject.removeDeathRecipient(recipient, 0) - expect(resultRemove1 == true).assertTrue(); + expect(resultRemove1 == false).assertTrue(); var resultRemove2 = gIRemoteObject.removeDeathRecipient(recipient, 0) - expect(resultRemove2 == true).assertTrue(); + expect(resultRemove2 == false).assertTrue(); var resultRemove3 = gIRemoteObject.removeDeathRecipient(recipient, 0) expect(resultRemove3 == false).assertTrue(); @@ -8789,9 +9136,9 @@ export default function actsRpcClientJsTest() { try{ let recipient = new MyDeathRecipient(gIRemoteObject, null); var resultAdd = gIRemoteObject.addDeathRecipient(recipient, -(2*G)); - expect(resultAdd).assertTrue(); + expect(resultAdd == false).assertTrue(); var resultRemove = gIRemoteObject.removeDeathRecipient(recipient, -(2*G)); - expect(resultRemove).assertTrue(); + expect(resultRemove == false).assertTrue(); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00200:error = " + error); } @@ -8809,9 +9156,9 @@ export default function actsRpcClientJsTest() { try{ let recipient = new MyDeathRecipient(gIRemoteObject, null); var resultAdd = gIRemoteObject.addDeathRecipient(recipient, (2*G - 1)); - expect(resultAdd).assertTrue(); + expect(resultAdd == false).assertTrue(); var resultRemove = gIRemoteObject.removeDeathRecipient(recipient, (2*G - 1)); - expect(resultRemove).assertTrue(); + expect(resultRemove == false).assertTrue(); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00300:error = " + error); } @@ -8830,10 +9177,10 @@ export default function actsRpcClientJsTest() { let recipient = new MyDeathRecipient(gIRemoteObject, null); var resultAdd = gIRemoteObject.addDeathRecipient(recipient, 2*G); console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00400:run addDeathRecipient first is " + resultAdd); - expect(resultAdd).assertTrue(); + expect(resultAdd == false).assertTrue(); var resultRemove = gIRemoteObject.removeDeathRecipient(recipient, 2*G); console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00400:run removeDeathRecipient1 is " + resultRemove); - expect(resultRemove).assertTrue(); + expect(resultRemove == false).assertTrue(); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00400:error = " + error); } @@ -8852,10 +9199,10 @@ export default function actsRpcClientJsTest() { let recipient = new MyDeathRecipient(gIRemoteObject, null); var resultAdd = gIRemoteObject.addDeathRecipient(recipient, -(2*G + 1)); console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00500:run addDeathRecipient first is " + resultAdd); - expect(resultAdd).assertTrue(); + expect(resultAdd == false).assertTrue(); var resultRemove = gIRemoteObject.removeDeathRecipient(recipient, -(2*G + 1)); console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00500:run removeDeathRecipient1 is " + resultRemove); - expect(resultRemove).assertTrue(); + expect(resultRemove == false).assertTrue(); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00500:error = " + error); } @@ -8878,7 +9225,7 @@ export default function actsRpcClientJsTest() { var resultAdd1 = gIRemoteObject.addDeathRecipient(recipient, 0) console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:run addDeathRecipient first result is " + resultAdd1); - expect(resultAdd1 == true).assertTrue(); + expect(resultAdd1 == false).assertTrue(); var isDead1 = gIRemoteObject.isObjectDead(); console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600: run isObjectDead result is " + isDead1); @@ -8886,15 +9233,15 @@ export default function actsRpcClientJsTest() { var resultRemove1 = gIRemoteObject.removeDeathRecipient(recipient, 0) console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:run removeDeathRecipient result is " + resultRemove1); - expect(resultRemove1 == true).assertTrue(); + expect(resultRemove1 == false).assertTrue(); var resultAdd2 = gIRemoteObject.addDeathRecipient(recipient, 0) console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:run addDeathRecipient second result is " + resultAdd2); - expect(resultAdd2 == true).assertTrue(); + expect(resultAdd2 == false).assertTrue(); var resultRemove2 = gIRemoteObject.removeDeathRecipient(recipient, 0) console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:run removeDeathRecipient1 result is " + resultRemove2); - expect(resultRemove2 == true).assertTrue(); + expect(resultRemove2 == false).assertTrue(); var resultRemove3 = gIRemoteObject.removeDeathRecipient(recipient, 0) console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:run removeDeathRecipient3 result is " + resultRemove3); @@ -9015,7 +9362,7 @@ export default function actsRpcClientJsTest() { expect(isDead2 == false).assertTrue(); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000:error = " + error); - expect(error == null).assertTrue(); + expect(error != null).assertTrue(); } console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01000---------------------------"); }); @@ -9090,7 +9437,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01300: unregisterDeathRecipient is success"); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01300:error = " + error); - expect(error == null).assertTrue(); + expect(error != null).assertTrue(); } console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01300---------------------------"); }); @@ -9111,7 +9458,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01400: unregisterDeathRecipient is success"); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01400:error = " + error); - expect(error == null).assertTrue(); + expect(error != null).assertTrue(); } console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01400---------------------------"); }); @@ -9132,7 +9479,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01500: unregisterDeathRecipient is success"); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01500:error = " + error); - expect(error == null).assertTrue(); + expect(error != null).assertTrue(); } console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01500---------------------------"); }); @@ -9153,7 +9500,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01600: unregisterDeathRecipient is success"); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01600:error = " + error); - expect(error == null).assertTrue(); + expect(error != null).assertTrue(); } console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01600---------------------------"); }); @@ -9174,7 +9521,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01700: unregisterDeathRecipient is success"); } catch (error) { console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01700:error = " + error); - expect(error == null).assertTrue(); + expect(error != null).assertTrue(); } console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01700---------------------------"); }); @@ -9197,7 +9544,7 @@ export default function actsRpcClientJsTest() { let res2 = object.getLocalInterface(null); console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01800: run getLocalInterface success, res2 is " + res2); } catch (error) { - let errCode = ErrorCode.ONLY_PROXY_OBJECT_PERMITTED_ERROR; + let errCode = `${rpc.ErrorCode.ONLY_PROXY_OBJECT_PERMITTED_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01800:error = " + error.code); expect(error.code != errCode).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01800:error = " + error.message); @@ -9516,6 +9863,7 @@ export default function actsRpcClientJsTest() { let localDeviceID = rpc.IPCSkeleton.getLocalDeviceID(); let isLocalCalling = rpc.IPCSkeleton.isLocalCalling(); let id = rpc.IPCSkeleton.resetCallingIdentity(); + console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200:" + id) let ret = rpc.IPCSkeleton.setCallingIdentity(id); expect(object.getInterfaceDescriptor()).assertEqual(""); expect(callingDeviceID).assertEqual(""); @@ -9523,7 +9871,7 @@ export default function actsRpcClientJsTest() { expect(isLocalCalling).assertTrue(); expect(id).assertEqual(""); expect(ret).assertTrue(); - expect(rpc.IPCSkeleton.flushCommands(gIRemoteObject)).assertEqual(0); + expect(rpc.IPCSkeleton.flushCommands(gIRemoteObject)).assertEqual(101); console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200: callingPid: " + callingPid + ", callingUid: " + callingUid + ", callingDeviceID: " + callingDeviceID + ", localDeviceID: " + localDeviceID @@ -9649,7 +9997,7 @@ export default function actsRpcClientJsTest() { object.getDescriptor(); console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01600: is success"); } catch (error) { - let errCode = ErrorCode.COMMUNICATION_ERROR; + let errCode = `${rpc.ErrorCode.COMMUNICATION_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01600 error is :" + error.message) expect(error.message != null).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01600 error is :" + error.code) @@ -9672,7 +10020,7 @@ export default function actsRpcClientJsTest() { console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01700 RpcServer: flushCmdBuffer is success"); } catch (error) { - let errCode = ErrorCode.ONLY_REMOTE_OBJECT_PERMITTED_ERROR; + let errCode = `${rpc.ErrorCode.ONLY_REMOTE_OBJECT_PERMITTED_ERROR}`; console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01700 error is :" + error.message) expect(error.message != null).assertTrue(); console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01700 error is :" + error.code) diff --git a/communication/dsoftbus/rpc_server/BUILD.gn b/communication/dsoftbus/rpc_server/BUILD.gn deleted file mode 100644 index 084d3daac..000000000 --- a/communication/dsoftbus/rpc_server/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# 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, -# 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. -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ActsRpcJsServer") { - hap_profile = "./src/main/config.json" - deps = [ - ":rpc_js_assets", - ":rpc_js_resources", - ] - - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsRpcHapServer" - subsystem_name = "communication" - part_name = "ipc" -} -ohos_js_assets("rpc_js_assets") { - source_dir = "./src/main/js" - hap_profile = "./src/main/config.json" -} -ohos_resources("rpc_js_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/communication/dsoftbus/rpc_server/Test.json b/communication/dsoftbus/rpc_server/Test.json deleted file mode 100644 index 1cf442933..000000000 --- a/communication/dsoftbus/rpc_server/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for rpc Servers", - "driver": { - "type": "JSUnitServer", - "test-timeout": "900000", - "package": "ohos.rpc.test.server", - "abilityName": ".MainAbility", - "shell-timeout": "900000" - }, - "kits": [ - { - "test-file-name": [ - "ActsRpcHapServer.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] - -} diff --git a/communication/dsoftbus/rpc_server/signature/openharmony_sx.p7b b/communication/dsoftbus/rpc_server/signature/openharmony_sx.p7b deleted file mode 100644 index d00afeff6b13a18a2b5fd8aa9b3d7623aabb6a11..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3428 zcmcgvZB!Fi8YUk=Q6nfQ>Z)M0V%5N%kU&CPbtaj7$s|ljfKXhVB$E$FWjxK_gJ-St!LGBb*;A5dUSUJRKcS^_VgU{ zBXi#OKKI^d-ut}IoC{*2`AI3$n{-Xzi+IWWwwMS9F%ib+@gNZxnv^oXNyj4vLOu_~ z68TSnytbI|jxZ*?wLn}?218z&k~nB5DK3I$K2A`CpG%0LT#yUIGsWSs*U5!)AT6{j zm83-O;{Id>a;HQo2MP(HBmtB!bGb-J!J(OkKzwqL^pQk}nOrGT6v(A=#mwG3;bO=jmo88! zWrg`%df`m5Jxn=$q{K_P==gLeSx@@t02!3@Qa1%iN=F3!G}XZEGl-0X3^HDq*Fi9G z){^)SLA82gwhA>{^cuYiwxGS)Dhkub9xNaC|PxG9?aeS-4cIX|R_o!=weR z#1MxThODS6g5j2Y#AmPdcpQGH-cHrJ%d};lD#~s_YcLhsi-IE<@iYprKv=uhS7WO% z2kcUr8wV(>^EixH4a#CQa0AD|qK}v?SfrfG8r8KCtOkob&eb3^hKE=c-pf&ovIe!K z2DM^{zK@p&E3TrR+B2fHz!iP(8M2_LlC3P4>unVV#x9l1^%}F!Rt_R_)v&)0gITI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14PstzCb4RAnl2G5@)*V}Efa!L;*qOU|B_N_O~(!KWv1CjciOu$62M zbmDt<`>b`XXDjxt+?CTYWcjIK`-^%ezTG%o9<6HMG+wgt%qO&Pve%ZwtmlI%JEr`S zp0{&yvN>bx^1E&C0>kVE_5Cnw}rRz|$LGMvy#TI#5UP@WnXdb0jor(zH9LTP7{Nw|M@(8CmzPAG@^T2Z?oy0}zAE>6se&KQ#7Ca~t%95qJ^+$p`-P zKUXaI4RdSp@9q_OsymMsY`lCR?daL`%L`p;rYkz@mrEPRdb;)BoVngT>a*)-M{s6! z5+9AZ_fmS@RDk-PU)VKC$qBQP)#b diff --git a/communication/dsoftbus/rpc_server/src/main/config.json b/communication/dsoftbus/rpc_server/src/main/config.json deleted file mode 100644 index 9c69f1359..000000000 --- a/communication/dsoftbus/rpc_server/src/main/config.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "app": { - "bundleName": "ohos.rpc.test.server", - "vendor": "rpc", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "reqPermissions": [ - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC" - }, - { - "name": "ohos.permission.GET_DISTRIBUTED_DEVICE_INFO" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO" - } - ], - "package": "ohos.rpc.test.server", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "deviceType": [ - "tablet", - "default", - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:mainability_description", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "srcPath": "ServiceAbility", - "name": ".ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "js", - - "description": "$string:serviceability_description", - "type": "service", - "visible": true, - "formsEnabled": false - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/app.js b/communication/dsoftbus/rpc_server/src/main/js/MainAbility/app.js deleted file mode 100644 index 8ae33ddcf..000000000 --- a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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, - * 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. - */ - -export default { - onCreate() { - console.info("Application onCreate"); - }, - onDestroy() { - console.info("Application onDestroy"); - } -}; diff --git a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/i18n/en-US.json b/communication/dsoftbus/rpc_server/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index 8feb71993..000000000 --- a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World", - "page": "Second Page", - "next": "Next Page", - "back": "Back" - }, - "Files": { - } -} \ No newline at end of file diff --git a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/i18n/zh-CN.json b/communication/dsoftbus/rpc_server/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index 6551d1608..000000000 --- a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界", - "page": "第二页", - "next": "下一页", - "back": "返回" - }, - "Files": { - } -} \ No newline at end of file diff --git a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.css b/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 87b92cb0f..000000000 --- a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.hml b/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index ee2e92940..000000000 --- a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,6 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - - -
diff --git a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.js b/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index dc1588bf1..000000000 --- a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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, - * 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. - */ - -import router from '@system.router' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onclick: function () { - router.replace({ - uri: "pages/second/second" - }) - } -} - - diff --git a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.css b/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.css deleted file mode 100644 index 87b92cb0f..000000000 --- a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.css +++ /dev/null @@ -1,24 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.hml b/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.hml deleted file mode 100644 index 5d50c7448..000000000 --- a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.hml +++ /dev/null @@ -1,6 +0,0 @@ -
- - {{ $t('strings.page') }} - - -
diff --git a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.js b/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.js deleted file mode 100644 index 694f92fc0..000000000 --- a/communication/dsoftbus/rpc_server/src/main/js/MainAbility/pages/second/second.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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, - * 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. - */ - -import router from '@system.router' - -export default { - data: { - title: 'World' - }, - onclick: function () { - router.replace({ - uri: "pages/index/index" - }) - } -} diff --git a/communication/dsoftbus/rpc_server/src/main/js/ServiceAbility/service.js b/communication/dsoftbus/rpc_server/src/main/js/ServiceAbility/service.js deleted file mode 100644 index 815d1a4be..000000000 --- a/communication/dsoftbus/rpc_server/src/main/js/ServiceAbility/service.js +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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, - * 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. - */ - -import rpc from "@ohos.rpc" -import fileio from '@ohos.fileio'; -import process from '@ohos.process' - -export default { - onStart() { - console.info('RpcServer: onStart') - }, - onStop() { - console.info('RpcServer: onStop') - }, - onCommand(want, startId) { - console.info('RpcServer: onCommand, want: ' + JSON.stringify(want) +', startId: ' + startId) - }, - onConnect(want) { - console.info('RpcServer: service onConnect called.') - return new Stub("rpcTestAbility") - }, - onDisconnect(want) { - console.info('RpcServer: service onDisConnect called.') - }, - onReconnect(want) { - console.info('RpcServer: service onReConnect called.') - } -} - -class MySequenceable { - num = null - str = null - constructor(num, string) { - this.num = num; - this.str = string; - } - - marshalling(messageParcel) { - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - return true; - } - - unmarshalling(messageParcel) { - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - return true; - } -} - -class Stub extends rpc.RemoteObject { - constructor(descriptor) { - super(descriptor); - } - onRemoteRequest(code, data, reply, option) { - try{ - console.info("onRemoteRequest: " + code) - if (code === 32){ - console.info("case 32 start") - let tmp1 = data.readString() - let result = reply.writeString("onRemoteRequest invoking") - return true - } else if (code === 33){ - console.info("case 33 start") - let tmp1 = data.readString() - let result = reply.writeString(tmp1) - return true - }else { - console.error("default case " + code) - return super.onRemoteRequest(code, data, reply, option) - } - } catch (error) { - console.info("onRemoteRequest: " + error); - } - return false - } - onRemoteMessageRequest(code, data, reply, option) { - try{ - console.info("onRemoteMessageRequest: " + code) - switch(code) { - case 1: - { - console.info("case 1 start") - let tmp1 = data.readByteArray() - let result = reply.writeByteArray(tmp1) - return true - } - case 2: - { - console.info("case 2 start") - let tmp1 = data.readIntArray() - let result = reply.writeIntArray(tmp1) - return true - } - case 3: - { - console.info("case 3 start") - let tmp1 = data.readFloatArray() - let result = reply.writeFloatArray(tmp1) - return true - } - case 4: - { - console.info("case 4 start") - let tmp1 = data.readShort() - let result = reply.writeShort(tmp1) - return true - } - case 5: - { - console.info("case 5 start") - let tmp1 = data.readLong() - let result = reply.writeLong(tmp1) - return true - } - case 6: - { - console.info("case 6 start") - let tmp1 = data.readDouble() - let result = reply.writeDouble(tmp1) - return true - } - case 7: - { - console.info("case 7 start") - let tmp1 = data.readBoolean() - let result = reply.writeBoolean(tmp1) - return true - } - case 8: - { - console.info("case 8 start") - let tmp1 = data.readChar() - let result = reply.writeChar(tmp1) - return true - } - case 9: - { - console.info("case 9 start") - let tmp1 = data.readString() - let result = reply.writeString(tmp1) - return true - } - case 10: - { - console.info("case 10 start") - let tmp1 = data.readByte() - let result = reply.writeByte(tmp1) - return true - } - case 11: - { - console.info("case 11 start") - let tmp1 = data.readInt() - let result = reply.writeInt(tmp1) - return true - } - case 12: - { - console.info("case 12 start") - let tmp1 = data.readFloat() - let result = reply.writeFloat(tmp1) - return true - } - case 13: - { - console.info("case 13 start") - var size = data .readInt(); - let tmp1 = data.readRawData(size); - let size1 = reply.writeInt(size); - let result = reply.writeRawData(tmp1, tmp.length) - return true - } - case 14: - { - console.info("case 14 start") - let listener = data.readRemoteObject(); - let num = data.readInt() - let str = data.readString() - let option2 = new rpc.MessageOption() - let data2 = rpc.MessageParcel.create() - let reply2 = rpc.MessageParcel.create() - data2.writeInt(num) - data2.writeString(str) - listener.sendRequest(1, data2, reply2, option2) - .then(function(result) { - console.info("14 send request done, error code: " + result.errCode ) - }) - .catch(function(e) { - console.error("14 send request got exception: " + e) - }) - .finally(() => { - data2.reclaim() - reply2.reclaim() - console.info("case 14 test done") - }) - reply.writeNoException() - return true - } - case 15: - { - console.info("case 15 start") - let s = new MySequenceable(null, null) - var tmp1 = data.readParcelable(s) - let result = reply.writeParcelable(s) - return true - } - case 16: - { - console.info("case 16 start") - data.readException() - var tmp = data.readInt(); - reply.writeNoException() - var result = reply.writeInt(tmp); - return true - } - case 17: - { - console.info("case 17 start") - var s = [new MySequenceable(null, null), new MySequenceable(null, null), - new MySequenceable(null, null)]; - data.readParcelableArray(s); - let result = reply.writeParcelableArray(s); - return true - } - case 18: - { - console.info("case 18 start") - let listeners = data.readRemoteObjectArray(); - for (let i = 0; i < listeners.length; i++) { - let option2 = new rpc.MessageOption() - let data2 = rpc.MessageParcel.create() - let reply2 = rpc.MessageParcel.create() - listeners[i].sendRequest(1, data2, reply2, option2) - .then(function(result) { - console.info("18 send request done, error code: " + result.errCode + ", index: " + i) - }) - .catch(function(e) { - console.error("18 send request got exception: " + e) - }) - .finally(() => { - data2.reclaim() - reply2.reclaim() - console.info("case 18 test done") - }) - } - console.info("18 The server's writeRemoteObjectArray result is " + result); - return true - } - case 19: - { - console.info("case 19 start") - let tmp1 = data.readDoubleArray() - let result = reply.writeDoubleArray(tmp1) - return true - } - - case 20: - { - console.info("case 20 start") - let tmp1 = data.readByte() - let tmp2 = data.readShort() - let tmp3 = data.readInt() - let tmp4 = data.readLong() - let tmp5 = data.readFloat() - let tmp6 = data.readDouble() - let tmp7 = data.readBoolean() - let tmp8 = data.readChar() - let tmp9 = data.readString() - let s = new MySequenceable(null, null) - let tmp10 = data.readParcelable(s) - let result1 = reply.writeByte(tmp1) - let result2 = reply.writeShort(tmp2) - let result3 = reply.writeInt(tmp3) - let result4 = reply.writeLong(tmp4) - let result5 = reply.writeFloat(tmp5) - let result6 = reply.writeDouble(tmp6) - let result7 = reply.writeBoolean(tmp7) - let result8 = reply.writeChar(tmp8) - let result9 = reply.writeString(tmp9) - let result10 = reply.writeParcelable(s) - return true - } - case 21: - { - console.info("case 21 start") - let tmp1 = data.readByteArray() - let tmp2 = data.readShortArray() - let tmp3 = data.readIntArray() - let tmp4 = data.readLongArray() - let tmp5 = data.readFloatArray() - let tmp6 = data.readDoubleArray() - let tmp7 = data.readBooleanArray() - let tmp8 = data.readCharArray() - let tmp9 = data.readStringArray() - let s = [new MySequenceable(null, null), new MySequenceable(null, null), - new MySequenceable(null, null)] - let tmp10 = data.readParcelableArray(s) - let result1 = reply.writeByteArray(tmp1) - let result2 = reply.writeShortArray(tmp2) - let result3 = reply.writeIntArray(tmp3) - let result4 = reply.writeLongArray(tmp4) - let result5 = reply.writeFloatArray(tmp5) - let result6 = reply.writeDoubleArray(tmp6) - let result7 = reply.writeBooleanArray(tmp7) - let result8 = reply.writeCharArray(tmp8) - let result9 = reply.writeStringArray(tmp9) - let result10 = reply.writeParcelableArray(s) - return true - } - case 22: - { - console.info("case 22 start") - let callingPid = rpc.IPCSkeleton.getCallingPid() - let callingUid = rpc.IPCSkeleton.getCallingUid() - reply.writeNoException() - reply.writeInt(callingPid) - reply.writeInt(callingUid) - reply.writeInt(this.getCallingPid()) - reply.writeInt(this.getCallingUid()) - let id = rpc.IPCSkeleton.resetCallingIdentity() - rpc.IPCSkeleton.setCallingIdentity(id) - reply.writeInt(rpc.IPCSkeleton.getCallingPid()) - reply.writeInt(rpc.IPCSkeleton.getCallingUid()) - reply.writeInt(rpc.IPCSkeleton.flushCommands(this)) - return true - } - case 23: - { - console.info("case 23 start") - let s = new MySequenceable(null, null); - var tmp1 = data.readParcelable(s); - var result = reply.writeParcelable(s); - return true - } - case 24: - { - console.info("case 24 start") - var tmp1 = data.readShort(); - var tmp2 = data.readShort(); - var tmp3 = data.readShort(); - var tmp4 = data.readShort(); - var tmp5 = data.readShort(); - var result1 = reply.writeShort(tmp1); - var result2 = reply.writeShort(tmp2); - var result3 = reply.writeShort(tmp3); - var result4 = reply.writeShort(tmp4); - var result5 = reply.writeShort(tmp5); - return true - } - case 25: - { - console.info("case 25 start") - var tmp1 = data.readByte(); - var tmp2 = data.readByte(); - var tmp3 = data.readByte(); - var tmp4 = data.readByte(); - var tmp5 = data.readByte(); - var result1 = reply.writeByte(tmp1); - var result2 = reply.writeByte(tmp2); - var result3 = reply.writeByte(tmp3); - var result4 = reply.writeByte(tmp4); - var result5 = reply.writeByte(tmp5); - return true - } - case 26: - { - console.info("case 26 start") - var tmp1 = data.readInt(); - var tmp2 = data.readInt(); - var tmp3 = data.readInt(); - var tmp4 = data.readInt(); - var tmp5 = data.readInt(); - var result1 = reply.writeInt(tmp1); - var result2 = reply.writeInt(tmp2); - var result3 = reply.writeInt(tmp3); - var result4 = reply.writeInt(tmp4); - var result5 = reply.writeInt(tmp5); - return true - } - case 28: - { - console.info("case 28 start") - let callingPid = rpc.IPCSkeleton.getCallingPid() - let callingUid = rpc.IPCSkeleton.getCallingUid() - let callingDeviceID = rpc.IPCSkeleton.getCallingDeviceID() - let localDeviceID = rpc.IPCSkeleton.getLocalDeviceID() - let isLocalCalling = rpc.IPCSkeleton.isLocalCalling() - reply.writeNoException() - reply.writeInt(callingPid) - reply.writeInt(callingUid) - reply.writeString(callingDeviceID) - reply.writeString(localDeviceID) - reply.writeBoolean(isLocalCalling) - reply.writeInt(this.getCallingPid()) - reply.writeInt(this.getCallingUid()) - let id = rpc.IPCSkeleton.resetCallingIdentity() - rpc.IPCSkeleton.setCallingIdentity(id) - reply.writeInt(rpc.IPCSkeleton.getCallingPid()) - reply.writeInt(rpc.IPCSkeleton.getCallingUid()) - reply.writeInt(rpc.IPCSkeleton.flushCommands(this)) - return true - } - case 29: - { - console.info("case 29 starts") - let bytesWr = data.readInt() - let fd = data.readFileDescriptor() - let writeFileResult = fileio.writeSync(fd, "HELLO RPC", {position: bytesWr + 1}); - rpc.MessageParcel.closeFileDescriptor(fd) - return true - } - case 30: - { - console.info("case 30 start") - let listeners = data.readRemoteObjectArray(); - let num = data.readInt() - let str = data.readString() - for (let i = 0; i < listeners.length; i++) { - let option2 = new rpc.MessageOption() - let data2 = rpc.MessageParcel.create() - let reply2 = rpc.MessageParcel.create() - data2.writeInt(num) - data2.writeString(str) - listeners[i].sendRequest(1, data2, reply2, option2) - .then(function(result) { - console.info("30 send request done, error code: " + result.errCode + ", index: " + i) - }) - .catch(function(e) { - console.error("30 send request got exception: " + e) - }) - .finally(() => { - data2.reclaim() - reply2.reclaim() - console.info("case 30 test done") - }) - } - reply.writeNoException() - return true - } - - case 31: - { - console.info("case 31 start") - let listeners = new Array(3) - data.readRemoteObjectArray(listeners) - let num = data.readInt() - let str = data.readString() - for (let i = 0; i < listeners.length; i++) { - let option2 = new rpc.MessageOption() - let data2 = rpc.MessageParcel.create() - let reply2 = rpc.MessageParcel.create() - data2.writeInt(num) - data2.writeString(str) - listeners[i].sendRequest(1, data2, reply2, option2) - .then(function(result) { - console.info("31 send request done, error code: " + result.errCode + ", index: " + i) - }) - .catch(function(e) { - console.error("31 send request got exception: " + e) - }) - .finally(() => { - data2.reclaim() - reply2.reclaim() - console.info("case 31 test done") - }) - } - reply.writeNoException() - return true - } - case 32: - { - console.info("case 32 start") - let tmp1 = data.readString() - let result = reply.writeString("onRemoteMessageRequest invoking") - return true - } - default: - this.onRemoteRequest(code, data, reply, option) - } - } catch (error) { - console.info("onRemoteMessageRequest: " + error); - } - return false - } -} \ No newline at end of file diff --git a/communication/dsoftbus/rpc_server/src/main/resources/base/element/string.json b/communication/dsoftbus/rpc_server/src/main/resources/base/element/string.json deleted file mode 100644 index 16e3bbc3f..000000000 --- a/communication/dsoftbus/rpc_server/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "RpcServer" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - }, - { - "name": "serviceability_description", - "value": "hap sample empty service" - } - ] -} \ No newline at end of file diff --git a/communication/dsoftbus/rpc_server/src/main/resources/base/media/icon.png b/communication/dsoftbus/rpc_server/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD(51j;6@ni$6bQ+2XL+R^|NnSp5}(kzvMZ^(@4fD_{QVu$(&K6H|C37TG1Am9Re{<<3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