diff --git a/ace/ace_ets_component_four/entry/src/main/config.json b/ace/ace_ets_component_four/entry/src/main/config.json index 75119998a5336fcfd4b62fb7036ec3daf00e24a8..a0e5430f100d22ac9eba373ce9da5fe2c1e33775 100755 --- a/ace/ace_ets_component_four/entry/src/main/config.json +++ b/ace/ace_ets_component_four/entry/src/main/config.json @@ -59,7 +59,6 @@ }, "pages": [ "pages/index", - "pages/calendar", "pages/customDialogController", "pages/dragEvent", "pages/dragEvent2", diff --git a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/calendar.ets b/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/calendar.ets deleted file mode 100755 index 41b1465952ef883fd6080ea711e34b11633434cd..0000000000000000000000000000000000000000 --- a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/pages/calendar.ets +++ /dev/null @@ -1,203 +0,0 @@ -// @ts-nocheck -/** - * 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 events_emitter from '@ohos.emitter'; - -@Entry -@Component -struct CalendarComponentExample { - calendarController: CalendarController = new CalendarController(); - @State CalendarDayArray: CalendarDay[] = [{ - index: 1, - lunarMonth: "five", - lunarDay: "6", - dayMark: "六", - dayMarkValue: "儿童节", - year: 2020, - month: 11, - day: 10, - isFirstOfLunar: false, - markLunarDay: false - }]; - @State currentMonthday: MonthData = { - year: 2021, - month: 3, - data: this.CalendarDayArray - }; - @State preMonthday: MonthData = { - year: 2021, - month: 2, - data: this.CalendarDayArray - }; - @State nextMonthday: MonthData = { - year: 2021, - month: 4, - data: this.CalendarDayArray - }; - @State colorValue: Color = Color.Blue; - @State calendarDay1: CalendarDay = { - index: 6, - lunarMonth: "111", - lunarDay: "222", - dayMark: "333", - dayMarkValue: "444", - year: 2022, - month: 3, - day: 11, - isFirstOfLunar: false, - hasSchedule: false, - markLunarDay: false - } - @State calendarDay2: CalendarDay = { - index: 6, - lunarMonth: "111", - lunarDay: "222", - dayMark: "333", - dayMarkValue: "444", - year: 2022, - month: 3, - day: 10, - isFirstOfLunar: false, - hasSchedule: false, - markLunarDay: false - } - @State calendarDay3: CalendarDay = { - index: 6, - lunarMonth: "111", - lunarDay: "222", - dayMark: "333", - dayMarkValue: "444", - year: 2022, - month: 3, - day: 12, - isFirstOfLunar: false, - hasSchedule: false, - markLunarDay: false - } - @State currentData_: MonthData = { year: 2022, month: 3, data: [this.calendarDay1] }; - @State preData_: MonthData = { year: 2022, month: 3, data: [this.calendarDay2] }; - @State nextData_: MonthData = { year: 2022, month: 3, data: [this.calendarDay3] }; - - @State colSpace: number = 5; - @State dailyFiveRowSpace: number = 4; - @State dailySixRowSpace: number = 5; - @State lunarHeight: number = 20; - @State underscoreWidth: number = 10; - @State underscoreLength: number = 6; - @State scheduleMarkerRadius: number = 3; - @State boundaryRowOffset: number = 3; - @State weekAndDayRowSpace: number = 3; - @State direction: Axis = Axis.Horizontal; - @State weekStyle: WeekStyle = { - weekColor: Color.black, - weekendDayColor: Color.red, - weekendLunarColor: Color.green, - weekFontSize: 1, - weekHeight: 2, - weekWidth: 3, - weekAndDayRowSpace: this.weekAndDayRowSpace - }; - private stateChangCallBack = (eventData) => { - if (eventData != null) { - console.info("Calendar page state change called:" + JSON.stringify(eventData)); - if (eventData.data.colSpace != null) { - this.colSpace = eventData.data.colSpace; - console.log("Calendar page colSpace value" + this.colSpace); - } - if (eventData.data.dailyFiveRowSpace != null) { - this.dailyFiveRowSpace = eventData.data.dailyFiveRowSpace; - console.log("Calendar page dailyFiveRowSpace value" + this.dailyFiveRowSpace); - } - if (eventData.data.dailySixRowSpace != null) { - this.dailySixRowSpace = eventData.data.dailySixRowSpace; - console.log("Calendar page dailySixRowSpace value" + this.dailySixRowSpace); - } - if (eventData.data.underscoreWidth != null) { - this.underscoreWidth = eventData.data.underscoreWidth; - console.log("Calendar page underscoreWidth value" + this.underscoreWidth); - } - if (eventData.data.underscoreLength != null) { - this.underscoreLength = eventData.data.underscoreLength; - console.log("Calendar page underscoreLength value" + this.underscoreLength); - } - if (eventData.data.lunarHeight != null) { - this.lunarHeight = eventData.data.lunarHeight; - console.log("Calendar page lunarHeight value" + this.lunarHeight); - } - if (eventData.data.scheduleMarkerRadius != null) { - this.scheduleMarkerRadius = eventData.data.scheduleMarkerRadius; - console.log("Calendar page scheduleMarkerRadius value" + this.scheduleMarkerRadius); - } - if (eventData.data.boundaryRowOffset != null) { - this.boundaryRowOffset = eventData.data.boundaryRowOffset; - console.log("Calendar page boundaryRowOffset value" + this.boundaryRowOffset); - } - - if (eventData.data.weekAndDayRowSpace != null) { - this.weekAndDayRowSpace = eventData.data.weekAndDayRowSpace; - console.log("Calendar page weekAndDayRowSpace value" + this.weekAndDayRowSpace); - } - - if (eventData.data.direction != null) { - this.direction = eventData.data.direction; - console.log("Calendar page direction value" + this.direction); - } - } - } - - onPageShow() { - console.info('Calendar page show called'); - var stateChangeEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - events_emitter.on(stateChangeEvent, this.stateChangCallBack); - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.SpaceBetween }) { - Calendar({ - year: 2020, - month: 5, - day: 12 - }, this.currentMonthday, this.preMonthday, this.nextMonthday, this.calendarController) - .currentDayStyle({ - dayHeight: 30, - dayWidth: 30, - gregorianCalendarHeight: 30, - dayYAxisOffset: 1, - lunarDayYAxisOffset: 1, - underscoreXAxisOffset: 1, - underscoreYAxisOffset: 1, - scheduleMarkerXAxisOffset: 0, - scheduleMarkerYAxisOffset: 0, - colSpace: this.colSpace, - dailyFiveRowSpace: this.dailyFiveRowSpace, - dailySixRowSpace: this.dailySixRowSpace, - lunarHeight: this.lunarHeight, - underscoreWidth: this.underscoreWidth, - underscoreLength: this.underscoreLength, - scheduleMarkerRadius: this.scheduleMarkerRadius, - boundaryRowOffset: this.boundaryRowOffset - }) - .weekStyle(this.weekStyle) - .direction(this.direction) - .backgroundColor(0x317aff) - .width(100) - .height(50) - .key('calender') - }.height(400).padding({ left: 35, right: 35, top: 35 }) - } -} \ No newline at end of file diff --git a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/AppStorageJsunit.test.ets b/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/AppStorageJsunit.test.ets index f087c78a8ac8439e0fa79ae98b0a5d5244213352..2a2c9624e4f216be9c15f130c8573556e6c9b5b7 100755 --- a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/AppStorageJsunit.test.ets +++ b/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/AppStorageJsunit.test.ets @@ -67,36 +67,6 @@ export default function AppStorageJsunit() { done(); }); - /** - * @tc.number stateManagement_Storage_setOrCreate_0100 - * @tc.name stateManagement Storage validation - * @tc.desc Function test - */ - it('stateManagement_Storage_set_0100', 0, function (done) { - done(); - return; - - console.info('[stateManagement_Storage_set_0100] START'); - let storage = new Storage(); - console.info('[stateManagement_Storage_set_0100] 0000'); - storage.set("key5", "value5"); - storage.set("key6", "value6"); - console.info('[stateManagement_Storage_set_0100] 1111'); - let key5 = storage.get("key5"); - let key6 = storage.get("key6"); - console.info('[stateManagement_Storage_set_0100] 2222' + key5); - storage.delete("key5"); - key5 = storage.get("key5"); - console.info('[stateManagement_Storage_set_0100] 3333'); - console.info('[stateManagement_Storage_set_0100] key5 =' + key5); - console.info('[stateManagement_Storage_set_0100] key6 =' + key6); - storage.clear(); - key6 = storage.get("key6"); - console.info('[stateManagement_Storage_set_0100] key6 =' + key6); - console.info('[stateManagement_Storage_set_0100] END'); - done(); - }); - /** * @tc.number stateManagement_Environment_EnvProp_0100 * @tc.name stateManagement Environment validation diff --git a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/CalendarJsunit.test.ets b/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/CalendarJsunit.test.ets deleted file mode 100755 index 0430aad9f62eeafbf97c251286294d41829d5036..0000000000000000000000000000000000000000 --- a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/CalendarJsunit.test.ets +++ /dev/null @@ -1,267 +0,0 @@ -// @ts-nocheck -/** - * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets" -import router from '@system.router'; -import events_emitter from '@ohos.events.emitter' -import Utils from './Utils'; - -export default function calendarJsunit() { - describe('appInfoTest', function () { - beforeEach(async function (done) { - console.info("calendar beforeEach start"); - let options = { - uri: 'pages/calendar', - } - let result; - try { - router.clear(); - let pages = router.getState(); - console.info("get calendar state pages: " + JSON.stringify(pages)); - if (!("calendar" == pages.name)) { - console.info("get calendar state pages.name: " + JSON.stringify(pages.name)); - result = await router.push(options); - await Utils.sleep(2000); - console.info("push calendar page result: " + JSON.stringify(result)); - } - } catch (err) { - console.error("push calendar page error: " + err); - } - done() - }); - - afterEach(async function () { - await Utils.sleep(1000); - console.info("calendar after each called"); - }) - - it('ACE_calendar_CurrentDayStyle_colSpace', 0, async function (done) { - console.info('[ACE_calendar_CurrentDayStyle_colSpace] START'); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "colSpace": 10, - } - } - var innerEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - console.info("[ACE_calendar_CurrentDayStyle_colSpace] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ACE_calendar_CurrentDayStyle_colSpace] change component data error: " + err.message); - } - done(); - }); - - it('ACE_calendar_CurrentDayStyle_dailyFiveRowSpace', 0, async function (done) { - console.info('[ACE_calendar_CurrentDayStyle_dailyFiveRowSpace] START'); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "dailyFiveRowSpace": 11, - } - } - var innerEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - console.info("[ACE_calendar_CurrentDayStyle_dailyFiveRowSpace] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ACE_calendar_CurrentDayStyle_dailyFiveRowSpace] change component data error: " + err.message); - } - done(); - }); - - - it('ACE_calendar_CurrentDayStyle_dailySixRowSpace', 0, async function (done) { - console.info('[ACE_calendar_CurrentDayStyle_dailySixRowSpace] START'); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "dailySixRowSpace": 12, - } - } - var innerEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - console.info("[ACE_calendar_CurrentDayStyle_dailySixRowSpace] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ACE_calendar_CurrentDayStyle_dailySixRowSpace] change component data error: " + err.message); - } - done(); - }); - - - it('ACE_calendar_CurrentDayStyle_lunarHeight', 0, async function (done) { - console.info('[ACE_calendar_CurrentDayStyle_lunarHeight] START'); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "lunarHeight": 13, - } - } - var innerEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - console.info("[ACE_calendar_CurrentDayStyle_lunarHeight] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ACE_calendar_CurrentDayStyle_lunarHeight] change component data error: " + err.message); - } - done(); - }); - - - it('ACE_calendar_CurrentDayStyle_underscoreWidth', 0, async function (done) { - console.info('[ACE_calendar_CurrentDayStyle_underscoreWidth] START'); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "underscoreWidth": 14, - } - } - var innerEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - console.info("[ACE_calendar_CurrentDayStyle_underscoreWidth] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ACE_calendar_CurrentDayStyle_underscoreWidth] change component data error: " + err.message); - } - done(); - }); - - - it('ACE_calendar_CurrentDayStyle_underscoreLength', 0, async function (done) { - console.info('[ACE_calendar_CurrentDayStyle_underscoreLength] START'); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "underscoreLength": 15, - } - } - var innerEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - console.info("[ACE_calendar_CurrentDayStyle_underscoreLength] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ACE_calendar_CurrentDayStyle_underscoreLength] change component data error: " + err.message); - } - done(); - }); - - - it('ACE_calendar_CurrentDayStyle_scheduleMarkerRadius', 0, async function (done) { - console.info('[ACE_calendar_CurrentDayStyle_scheduleMarkerRadius] START'); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "scheduleMarkerRadius": 16, - } - } - var innerEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - console.info("[ACE_calendar_CurrentDayStyle_scheduleMarkerRadius] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ACE_calendar_CurrentDayStyle_scheduleMarkerRadius] change component data error: " + err.message); - } - done(); - }); - - - it('ACE_calendar_CurrentDayStyle_boundaryRowOffset', 0, async function (done) { - console.info('[ACE_calendar_CurrentDayStyle_boundaryRowOffset] START'); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "boundaryRowOffset": 17, - } - } - var innerEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - console.info("[ACE_calendar_CurrentDayStyle_boundaryRowOffset] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ACE_calendar_CurrentDayStyle_boundaryRowOffset] change component data error: " + err.message); - } - done(); - }); - - it('ACE_calendar_WeekStyle_weekAndDayRowSpace', 0, async function (done) { - console.info('[ACE_calendar_WeekStyle_weekAndDayRowSpace] START'); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "weekAndDayRowSpace": 18, - } - } - var innerEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - console.info("[ACE_calendar_WeekStyle_weekAndDayRowSpace] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ACE_calendar_WeekStyle_weekAndDayRowSpace] change component data error: " + err.message); - } - done(); - }); - - - it('ACE_calendar_CalendarAttribute_direction', 0, async function (done) { - console.info('[ACE_calendar_CalendarAttribute_direction] START'); - await Utils.sleep(1000); - try { - var eventData = { - data: { - "direction": Axis.Vertical, - } - } - var innerEvent = { - eventId: 74, - priority: events_emitter.EventPriority.LOW - } - console.info("[ACE_calendar_CalendarAttribute_direction] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ACE_calendar_CalendarAttribute_direction] change component data error: " + err.message); - } - done(); - }); - }) -} diff --git a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/List.test.ets b/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/List.test.ets index 6c737f1aaf2ce0eac1aedce5e7e09eda6e0acba9..643fd75e271d2ad0c03b4d042e8453746c3afb6b 100755 --- a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/List.test.ets +++ b/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/List.test.ets @@ -22,10 +22,8 @@ import refreshJsunit from './RefreshJsunit.test.ets'; import richTextJsunit from './RichTextJsunit.test.ets'; import textPickerJsunit from './TextPickerJsunit.test.ets'; import textTimerJsunit from './TextTimerJsunit.test.ets'; -import subscribedAbstractPropertyJsunit from './SubscribedAbstractPropertyJsunit.test.ets'; import contentStorageJsunit from './ContentStorage.test.ets'; import appStorageJsunit from './AppStorageJsunit.test.ets'; -import subscribaleAbstractJsunit from './SubscribaleAbstractJsunit.test.ets'; import pathJsunit from './PathJsunit.test.ets'; import enumsLineCapStyleJsunit from './EnmusLineCapStyleJsunit.test.ets'; import enmusItemAlignJsunit from './EnmusItemAlignJsunit.test.ets'; @@ -36,7 +34,6 @@ import basicJsunit from './BasicJsunit.test.ets'; import focusJsunit from './FocusJsunit.test.ets'; import textAreaJsunit from './TextAreaJsunit.test.ets'; import dragEventJsunit from './DragEventJsunit.test.ets'; -import calendarJsunit from './CalendarJsunit.test.ets'; import geometryTransitionJsunit from './GeometryTransitionJsunit.test.ets'; import textClockJsunit from './TextClockJsunit.test.ets'; import textInputJsunit from './TextInputJsunit.test.ets'; @@ -57,11 +54,9 @@ export default function testsuite() { imageJsunit(); textPickerJsunit(); textTimerJsunit(); - subscribedAbstractPropertyJsunit(); contentStorageJsunit(); textClockJsunit(); appStorageJsunit(); - subscribaleAbstractJsunit(); pathJsunit(); enumsLineCapStyleJsunit(); playModeJsunit(); @@ -71,7 +66,6 @@ export default function testsuite() { textAreaJsunit(); textInputJsunit(); polylineJsunit(); - calendarJsunit(); PanDirectionJsunit(); geometryTransitionJsunit(); systemRouterJsunit(); diff --git a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/SubscribaleAbstractJsunit.test.ets b/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/SubscribaleAbstractJsunit.test.ets deleted file mode 100755 index f59acce3a9498a4812582b41cce693563f84b252..0000000000000000000000000000000000000000 --- a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/SubscribaleAbstractJsunit.test.ets +++ /dev/null @@ -1,162 +0,0 @@ -// @ts-nocheck -/** - * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"; - -export default function SubscribaleAbstractJsunit() { - describe('SubscribaleAbstract', function () { - - /** - * @tc.number stateManagement_SubscribaleAbstract_setOrCreate_0100 - * @tc.name stateManagement SubscribaleAbstract setOrCreate validation - * @tc.desc Function test - */ - it('stateManagement_SubscribaleAbstract_addOwningProperty_0100', 0, function (done) { - done(); - return; - console.info('[stateManagement_SubscribaleAbstract_addOwningProperty_0100] START'); - let subscriber = new IPropertySubscriber(); - let abstract = new SubscribaleAbstract(); - abstract.addOwningProperty(subscriber); - let numbers = abstract.owningProperties_; - abstract.removeOwningProperty(subscriber) - abstract.removeOwningPropertyById(1); - abstract.notifyPropertyHasChanged("key1", "value1"); - expect(true).assertTrue(); - console.info('[stateManagement_SubscribaleAbstract_addOwningProperty_0100] END'); - done(); - }); - - /** - * @tc.number stateManagement_ISinglePropertyChangeSubscriber_hasChanged_0100 - * @tc.name stateManagement ISinglePropertyChangeSubscriber hasChanged validation - * @tc.desc Function test - */ - it('stateManagement_ISinglePropertyChangeSubscriber_hasChanged_0100', 0, function (done) { - done(); - return; - console.info('[stateManagement_ISinglePropertyChangeSubscriber_hasChanged_0100] START'); - let subscriber = new ISinglePropertyChangeSubscriber( - (data) => { - console.info('[stateManagement_SubscribaleAbstract_addOwningProperty_0100] data = ' + data); - } - ); - expect(true).assertTrue(); - console.info('[stateManagement_ISinglePropertyChangeSubscriber_hasChanged_0100] END'); - done(); - }); - - /** - * @tc.number stateManagement_PersistentStorage_0100 - * @tc.name stateManagement PersistentStorage validation - * @tc.desc Function test - */ - it('stateManagement_PersistentStorage_0100', 0, function (done) { - done(); - return; - console.info('[stateManagement_PersistentStorage_0100] Start'); - let persistentStorage = new PersistentStorage(AppStorage, new Storage()); - persistentStorage.PersistProp("key10", "value10"); - let persistProp = { - "properties": [{ - key: "colorMode", defaultValue: ColorMode.LIGHT - }, { - key: "layoutDirection", defaultValue: LayoutDirection.LTR - }] - }; - persistentStorage.PersistProps(persistProp);IPropertySubscriber - persistentStorage.DeleteProp("colorMode"); - expect(true).assertTrue(); - console.info('[stateManagement_PersistentStorage_0100] END'); - done(); - }); - - /** - * @tc.number stateManagement_IPropertySubscriber_0100 - * @tc.name stateManagement IPropertySubscriber validation - * @tc.desc Function test - */ - it('stateManagement_IPropertySubscriber_0100', 0, function (done) { - done(); - return; - console.info('[stateManagement_IPropertySubscriber_0100] Start'); - let iPropertySubscriber =new IPropertySubscriber(); - let id = iPropertySubscriber.id(); - let aboutToBeDeleted = iPropertySubscriber.aboutToBeDeleted(); - expect(true).assertTrue(); - console.info('[stateManagement_IPropertySubscriber_0100] END'); - done(); - }); - - /** - * @tc.number stateManagement_IPropertySubscriber_0100 - * @tc.name stateManagement IPropertySubscriber validation - * @tc.desc Function test - */ - it('stateManagement_IPropertySubscriber_0100', 0, function (done) { - done(); - return; - console.info('[stateManagement_IPropertySubscriber_0100] Start'); - let iPropertySubscriber =new IPropertySubscriber(); - let id = iPropertySubscriber.id(); - let aboutToBeDeleted = iPropertySubscriber.aboutToBeDeleted(); - expect(true).assertTrue(); - console.info('[stateManagement_IPropertySubscriber_0100] END'); - done(); - }); - - /** - * @tc.number stateManagement_SyncedPropertyOneWay_0100 - * @tc.name stateManagement stateManagement_SyncedPropertyOneWay_0100 validation - * @tc.desc Function test - */ - it('stateManagement_SyncedPropertyOneWay_0100', 0, function (done) { - done(); - return; - console.info('[stateManagement_SyncedPropertyOneWay_0100] Start'); - let oneWay = new SyncedPropertyOneWay(new SubscribedAbstractProperty()); - oneWay.set("key12"); - let key12 = oneWay.get(); - oneWay.hasChanged("key12"); - oneWay.aboutToBeDeleted(new SubscribedAbstractProperty()); - let source_ = oneWay.source_; - let wrappedValue_ = oneWay.oneWay; - expect(true).assertTrue(); - console.info('[stateManagement_SyncedPropertyOneWay_0100] END'); - done(); - }); - - /** - * @tc.number stateManagement_SyncedPropertyTwoWay_0100 - * @tc.name stateManagement SyncedPropertyTwoWay validation - * @tc.desc Function test - */ - it('stateManagement_SyncedPropertyTwoWay_0100', 0, function (done) { - done(); - return; - console.info('[stateManagement_SyncedPropertyTwoWay_0100] Start'); - let twoWay = new SyncedPropertyTwoWay(new SubscribedAbstractProperty()); - twoWay.set("key12"); - let key12 = twoWay.get(); - twoWay.hasChanged("key12"); - twoWay.aboutToBeDeleted(new SubscribedAbstractProperty()); - let source_ = twoWay.source_; - let wrappedValue_ = twoWay.oneWay; - expect(true).assertTrue(); - console.info('[stateManagement_SyncedPropertyTwoWay_0100] END'); - done(); - }); - }) -} diff --git a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/SubscribedAbstractPropertyJsunit.test.ets b/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/SubscribedAbstractPropertyJsunit.test.ets deleted file mode 100755 index b355282585735ce5a27a365d3bbaccd9f5cae562..0000000000000000000000000000000000000000 --- a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/SubscribedAbstractPropertyJsunit.test.ets +++ /dev/null @@ -1,42 +0,0 @@ -// @ts-nocheck -/** - * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets" - -export default function subscribedAbstractPropertyJsunit() { - describe('appInfoTest', function () { - it('subscribedAbstractProperty0100', 0, async function (done) { - console.info('[subscribedAbstractProperty0100] START'); - if(true){ - done(); - return; - } - const subscribedAbstractProperty = new SubscribedAbstractProperty('subscribtest'); - let number = subscribedAbstractProperty.numberOfSubscrbers(); - subscribedAbstractProperty.notifyPropertyRead(); - subscribedAbstractProperty.notifyHasChanged('subscribtest'); - subscribedAbstractProperty.unlinkSuscriber(0); - subscribedAbstractProperty.createOneWaySync('subscribtest'); - subscribedAbstractProperty.createTwoWaySync('subscribtest'); - subscribedAbstractProperty.set('subscribtest'); - subscribedAbstractProperty.get(); - subscribedAbstractProperty.info(); - subscribedAbstractProperty.info_ = "subscribtest"; - subscribedAbstractProperty.subscribers_ = 'subscribtest'; - console.info('[subscribedAbstractProperty0100] END'); - done(); - }); - }) -} diff --git a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/SystemAppJsunit.test.ets b/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/SystemAppJsunit.test.ets index 582e5655450b42278d331c6176ae2e745af9bbce..85b7ff3ae68217a8db5433b2f6d70a5d5c6d0be2 100755 --- a/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/SystemAppJsunit.test.ets +++ b/ace/ace_ets_component_four/entry/src/main/ets/MainAbility/test/SystemAppJsunit.test.ets @@ -47,18 +47,6 @@ export default function systemAppJsunit() { done(); }); - it('systemAppTest_0400', 0, async function (done) { - console.info('systemAppTest_0400 START'); - try { - var a = 2000; - app.requestFullWindow(a); - } catch (err) { - console.log("systemAppTest_0400 error: " + err); - } - console.info('systemAppTest_0400 END'); - done(); - }); - it('systemAppTest_0500', 0, async function (done) { console.info('systemAppTest_0500 START'); try { diff --git a/ace/ace_ets_test/entry/src/main/config.json b/ace/ace_ets_test/entry/src/main/config.json index a3146946928e5081e5fb05fb33cdeab883fb1e21..63e3a86d8c48dbb2fbd381e2ea02167031a0d641 100644 --- a/ace/ace_ets_test/entry/src/main/config.json +++ b/ace/ace_ets_test/entry/src/main/config.json @@ -70,7 +70,6 @@ "pages/Row", "pages/Swiper", "pages/Tab", - "pages/Calendar", "pages/AlertDialog", "pages/Prop", "pages/Link", @@ -86,8 +85,6 @@ "pages/components/Select", "pages/components/Shape", "pages/components/Sidebar", - "pages/components/FormComponentPage", - "pages/components/XComponentPage", "pages/components/WebPage" ], "name": ".MainAbility", diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets deleted file mode 100644 index 7d2c9bccc4f64278e93b784fe343e44d3f07920b..0000000000000000000000000000000000000000 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets +++ /dev/null @@ -1,192 +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. - */ - -@Entry -@Component -struct calendar { - @State curMonth: MonthData = { year: 0, month: 0, data: [] }; - @State preMonth: MonthData = { year: 0, month: 0, data: [] }; - @State nextMonth: MonthData = { year: 0, month: 0, data: [] } - @State year: number = 0 - @State month: number = 0 - Controller: CalendarController = new CalendarController(); - private lunarMonthDays: string[] = [ - '初一', '初二', '初三', '初四', '初五', '初六', '初七', '初八', '初九', '初十', - '十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '二十', - '廿一', '廿二', '廿三', '廿四', '廿五', '廿六', '廿七', '廿八', '廿九', '三十'] - private lunarMonthNames: string[] = ['正月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '冬月', '腊月'] - - build() { - - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Start - }) { - - Row() { - Text(`${this.year} 年 ${this.month + 1} 月`) - .fontSize(20) - .fontWeight(FontWeight.Bold) - } - - Calendar({ - date: { year: 2021, month: 8, day: 35 }, - currentData: this.curMonth, - preData: this.preMonth, - nextData: this.nextMonth, - controller: this.Controller - }) - .showLunar(true) - .showHoliday(true) - .needSlide(true) - .offDays(Week.Tue | Week.Wed) - .startOfWeek(Week.Sun) - .direction(Axis.Horizontal) - .currentDayStyle({ - dayColor: Color.Black, - lunarColor: Color.Gray, - markLunarColor: Color.Black, - dayFontSize: 15, - lunarDayFontSize: 10, - boundaryColOffset: 10, - }) - .nonCurrentDayStyle({ - nonCurrentMonthDayColor: Color.Black, - nonCurrentMonthLunarColor: Color.Gray, - nonCurrentMonthWorkDayMarkColor: Color.Green, - nonCurrentMonthOffDayMarkColor: Color.Brown, - }) - .todayStyle({ - focusedDayColor: Color.Red, - focusedLunarColor: Color.Orange, - focusedAreaBackgroundColor: Color.Blue, - focusedAreaRadius: 20 - }) - .weekStyle({ - weekColor: Color.Black, - weekendDayColor: Color.Orange, - weekendLunarColor: Color.Blue, - weekFontSize: 20, - weekHeight: 5, - weekWidth: 48, - }) - .workStateStyle({ - workDayMarkColor: Color.Red, - offDayMarkColor: Color.Orange, - workDayMarkSize: 10, - offDayMarkSize: 2, - workStateWidth: 12, - workStateHorizontalMovingDistance: 0, - workStateVerticalMovingDistance: 12, - }) - .onRequestData((request) => { - switch (request.monthState) { - case 0: - this.year = request.currentYear; - this.month = request.currentMonth; - this.curMonth.year = request.year; - this.curMonth.month = request.month; - this.curMonth.data = []; - for (var i = 0; i < 35; ++i) { - this.curMonth.data.push({ - index: i, - lunarMonth: this.lunarMonthNames[i%12], - lunarDay: this.lunarMonthDays[i % 30], - dayMark: "work", - dayMarkValue: "", - year: request.year, - month: request.month, - day: i + 1, - isFirstOfLunar: false, - hasSchedule: false, - markLunarDay: false - }); - - if (i % 7 == 0 || i % 7 == 6) { - this.curMonth.data[i].dayMarkValue = "休" - } - } - break; - case 1: - this.year = request.currentYear; - this.month = request.currentMonth; - this.preMonth.year = request.year; - this.preMonth.month = request.month - this.preMonth.data = []; - for (var i = 0; i < 35; ++i) { - this.preMonth.data.push({ - index: i, - lunarMonth: this.lunarMonthNames[i%12], - lunarDay: this.lunarMonthDays[i % 30], - dayMark: "work", - dayMarkValue: "", - year: request.year, - month: request.month, - day: i + 1, - isFirstOfLunar: false, - hasSchedule: false, - markLunarDay: false - }); - if (i % 7 == 0 || i % 7 == 6) { - this.preMonth.data[i].dayMarkValue = "休" - } - } - break; - case 2: - this.year = request.currentYear; - this.month = request.currentMonth; - this.nextMonth.year = request.year; - this.nextMonth.month = request.month; - this.nextMonth.data = []; - for (var i = 0; i < 35; ++i) { - this.nextMonth.data.push({ - index: i, - lunarMonth: this.lunarMonthNames[i%12], - lunarDay: this.lunarMonthDays[i % 30], - dayMark: "work", - dayMarkValue: "", - year: request.year, - month: request.month, - day: i + 1, - isFirstOfLunar: false, - hasSchedule: false, - markLunarDay: false - }); - if (i % 7 == 0 || i % 7 == 6) { - this.nextMonth.data[i].dayMarkValue = "休" - } - } - break; - } - }) - .onSelectChange((request) => { - this.year = request.year; - this.month = request.month; - console.info('On Select change: ' + this.year + '/' + this.month) - }) - Row() { - Button("back To Today").onClick(() => { - this.Controller.backToToday(); - console.info("back To Today") - }); - Button("go To").onClick(() => { - this.Controller.goTo({ year: 2021, month: 9, day: 10 }); - console.info("go To : 2021/9/10") - }); - } - }.margin({ bottom: 10, right: 20, left: 20, top: 0 }) - .height("50%") - } -} \ No newline at end of file diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/FormComponentPage.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/FormComponentPage.ets deleted file mode 100644 index 34058a6faf66fb680f3e7208c17507f4839ab1f1..0000000000000000000000000000000000000000 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/FormComponentPage.ets +++ /dev/null @@ -1,93 +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. - */ - - -@Entry -@Component -struct FormComponentPage { - @State dimension:FormDimension = FormDimension.Dimension_2_2 - build() { - Column(){ - - FormComponent({ - id:0, - name:"four_four", - bundle:"com.example.myapplication", - ability:"com.example.myapplication.MainAbility", - module:"fa_widget", - dimension:this.dimension, - temporary:true - }) - .size({width:100,height:100}) - .moduleName("fa_widget") - .dimension(this.dimension) - .allowUpdate(true) - .visibility(Visibility.Visible) - .onAcquired((e)=>{ - console.log('onAcquired id : '+ e.id) - }) - .onRouter(()=>{ - console.log('onRouter : ') - }) - .onError((error)=>{ - console.log('error code :'+error.errcode); - console.log('error msg :'+error.msg); - }) - - - Text('卡片格式 :') - .fontSize(15) - .width('100%') - .backgroundColor(0xFAEEE0) - .height(40) - .textAlign(TextAlign.Start) - .fontWeight(FontWeight.Bolder) - Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start }) { - Button('1X2') - .margin({ right: 10 }) - .fontSize(15) - .width(150) - .onClick(() => { - this.dimension = FormDimension.Dimension_1_2 - }) - Button('2X2') - .margin({ right: 10 }) - .fontSize(15) - .width(150) - .onClick(() => { - this.dimension = FormDimension.Dimension_2_2 - }) - Button('2X4') - .margin({ right: 10 }) - .fontSize(15) - .width(150) - .onClick(() => { - this.dimension = FormDimension.Dimension_2_4 - }) - Button('4X4') - .margin({ right: 10 }) - .fontSize(15) - .width(150) - .onClick(() => { - this.dimension = FormDimension.Dimension_4_4 - }) - - } - .width('90%') - .margin({ top: 5, bottom: 5, left: 10, right: 10 }) - - } - } -} \ No newline at end of file diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/XComponentPage.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/XComponentPage.ets deleted file mode 100644 index 224d45742deb27381adb6200ab3c8035aa23b093..0000000000000000000000000000000000000000 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/components/XComponentPage.ets +++ /dev/null @@ -1,40 +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. - */ - -@Entry -@Component -struct XComponentPage { - xComponentController: XComponentController = new XComponentController() - - build() { - Column() { - - Button('getXComponentSurfaceId') - .onClick(() => { - this.xComponentController.getXComponentSurfaceId() - console.log('getXComponentSurfaceId ...') - - }) - - XComponent({ id: '1', type: '2', libraryname: '3', controller: this.xComponentController }) - .onLoad((e) => { - console.log('onLoad ...' + JSON.stringify(e)) - }) - .onDestroy(() => { - console.log('onDestroy ...') - }) - } - } -} \ No newline at end of file