!529 Modify container Mock

Merge pull request !529 from parrotli/MyContainer
This commit is contained in:
openharmony_ci
2022-07-22 09:57:51 +00:00
committed by Gitee
14 changed files with 292 additions and 292 deletions
@@ -17,8 +17,8 @@ import { paramMock } from "../utils"
export function mockArrayList() {
const paramArrayList = {
paramAnyMock : '[PC Preview] unknow any',
paramArrayListMock : '[PC Preview] unknow ArrayList'
paramAnyMock: '[PC Preview] unknow any',
paramArrayListMock: '[PC Preview] unknow ArrayList'
}
const ArrayListClass = class ArrayList {
constructor(...args) {
@@ -121,27 +121,27 @@ export function mockArrayList() {
console.warn("ArrayList.trimToCurrentLength interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
};
}
[Symbol.iterator](){
console.warn("ArrayList.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramArrayList.paramAnyMock,
done: false
};
} else {
return {
done: true
};
this[Symbol.iterator] = function (...args) {
console.warn("ArrayList.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramArrayList.paramAnyMock,
done: false
};
} else {
return {
done: true
};
}
}
}
};
return IteratorMock;
};
return IteratorMock;
}
}
}
return ArrayListClass;
@@ -65,27 +65,27 @@ export function mockDeque() {
args[0].call(this, paramDeque.businessErrorMock)
}
};
}
[Symbol.iterator]() {
console.warn("Deque.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramDeque.paramAnyMock,
done: false
};
} else {
return {
done: true
};
this[Symbol.iterator] = function (...args) {
console.warn("Deque.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramDeque.paramAnyMock,
done: false
};
} else {
return {
done: true
};
}
}
}
};
return IteratorMock;
};
return IteratorMock;
}
}
}
return DequeClass;
@@ -107,28 +107,28 @@ export function mockHashMap() {
};
return IteratorEntriesMock;
};
}
[Symbol.iterator]() {
console.warn("HashMap.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramHashMap.paramIterMock_K, paramHashMap.paramIterMock_V];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
this[Symbol.iterator] = function (...args) {
console.warn("HashMap.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramHashMap.paramIterMock_K, paramHashMap.paramIterMock_V];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
}
}
}
};
return IteratorMock;
};
return IteratorMock;
}
}
}
return HashMapClass;
@@ -74,29 +74,29 @@ export function mockHashSet() {
}
};
return IteratorEntriesMock;
}
}
[Symbol.iterator]() {
console.warn("HashSet.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramHashSet.paramAnyMock, paramHashSet.paramAnyMock];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
}
}
};
return IteratorMock;
this[Symbol.iterator] = function (...args) {
console.warn("HashSet.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramHashSet.paramAnyMock, paramHashSet.paramAnyMock];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
}
}
};
return IteratorMock;
}
}
}
return HashSetClass;
@@ -144,28 +144,28 @@ export function mockLightWeightMap() {
};
return IteratorVMock;
};
}
[Symbol.iterator]() {
console.warn("LightWeightMap.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramLightWeightMap.paramAnyMock_K, paramLightWeightMap.paramAnyMock_V];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
this[Symbol.iterator] = function (...args) {
console.warn("LightWeightMap.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramLightWeightMap.paramAnyMock_K, paramLightWeightMap.paramAnyMock_V];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
}
}
}
};
return IteratorMock;
};
return IteratorMock;
}
}
}
return LightWeightMapClass;
@@ -17,8 +17,8 @@ import { paramMock } from "../utils"
export function mockLightWeightSet() {
const paramLightWeightSet = {
paramAnyMock : '[PC Preview] unknow any',
paramIterMock_T : '[PC Preview] unknow IterableIterator_t'
paramAnyMock: '[PC Preview] unknow any',
paramIterMock_T: '[PC Preview] unknow IterableIterator_t'
}
const LightWeightSetClass = class LightWeightSet {
constructor(...args) {
@@ -119,35 +119,35 @@ export function mockLightWeightSet() {
}
};
return IteratorEntriesMock;
}
};
this.isEmpty = function (...args) {
console.warn("LightWeightSet.isEmpty interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return paramMock.paramBooleanMock;
};
this[Symbol.iterator] = function (...args) {
console.warn("LightWeightSet.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramLightWeightSet.paramIterMock_T, paramLightWeightSet.paramIterMock_T];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
}
}
};
return IteratorMock;
}
}
[Symbol.iterator]() {
console.warn("LightWeightSet.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramLightWeightSet.paramIterMock_T, paramLightWeightSet.paramIterMock_T];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
}
}
};
return IteratorMock;
}
}
return LightWeightSetClass;
return LightWeightSetClass;
}
@@ -125,27 +125,27 @@ export function mockLinkedList() {
" may be different from that on a real device.")
return paramMock.paramArrayMock;
};
}
[Symbol.iterator]() {
console.warn("LinkedList.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramLinkedList.paramAnyMock,
done: false
};
} else {
return {
done: true
};
this[Symbol.iterator] = function (...args) {
console.warn("LinkedList.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramLinkedList.paramAnyMock,
done: false
};
} else {
return {
done: true
};
}
}
}
};
return IteratorMock;
};
return IteratorMock;
}
}
}
return LinkedListClass;
@@ -125,10 +125,9 @@ export function mockList() {
" may be different from that on a real device.")
return paramMock.paramBooleanMock;
};
}
[Symbol.iterator]() {
console.warn("List.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
this[Symbol.iterator] = function (...args) {
console.warn("List.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
@@ -146,6 +145,7 @@ export function mockList() {
}
};
return IteratorMock;
}
}
}
return ListClass;
@@ -106,28 +106,28 @@ export function mockPlainArray() {
args[0].call(this, paramMock.businessErrorMock)
}
};
}
[Symbol.iterator]() {
console.warn("PlainArray.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramPlainArray.paramIterMock_K, paramPlainArray.paramIterMock_V];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
this[Symbol.iterator] = function (...args) {
console.warn("PlainArray.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramPlainArray.paramIterMock_K, paramPlainArray.paramIterMock_V];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
}
}
}
};
return IteratorMock;
};
return IteratorMock;
}
}
}
return PlainArrayClass;
@@ -47,27 +47,27 @@ export function mockQueue() {
args[0].call(this, paramMock.businessErrorMock)
}
};
}
[Symbol.iterator]() {
console.warn("Queue.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramQueue.paramAnyMock,
done: false
};
} else {
return {
done: true
};
this[Symbol.iterator] = function (...args) {
console.warn("Queue.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramQueue.paramAnyMock,
done: false
};
} else {
return {
done: true
};
}
}
}
};
return IteratorMock;
};
return IteratorMock;
}
}
}
return QueueClass;
@@ -57,27 +57,27 @@ export function mockStack() {
args[0].call(this, paramMock.businessErrorMock)
}
};
}
[Symbol.iterator]() {
console.warn("Stack.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramStack.paramAnyMock,
done: false
};
} else {
return {
done: true
};
this[Symbol.iterator] = function (...args) {
console.warn("Stack.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramStack.paramAnyMock,
done: false
};
} else {
return {
done: true
};
}
}
}
};
return IteratorMock;
};
return IteratorMock;
}
}
}
return StackClass;
@@ -17,8 +17,8 @@ import { paramMock } from "../utils"
export function mockTreeMap() {
const paramTreeMap = {
paramIterMock_K : '[PC Preview] unknow iterableiterator_k',
paramIterMock_V : '[PC Preview] unknow iterableiterator_v'
paramIterMock_K: '[PC Preview] unknow iterableiterator_k',
paramIterMock_V: '[PC Preview] unknow iterableiterator_v'
}
const TreeMapClass = class TreeMap {
constructor(...args) {
@@ -125,28 +125,28 @@ export function mockTreeMap() {
};
return IteratorEntriesMock;
};
}
[Symbol.iterator]() {
console.warn("TreeMap.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramTreeMap.paramIterMock_K, paramTreeMap.paramIterMock_V];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
this[Symbol.iterator] = function (...args) {
console.warn("TreeMap.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
const returnValue = [paramTreeMap.paramIterMock_K, paramTreeMap.paramIterMock_V];
index++;
return {
value: returnValue,
done: false
};
} else {
return {
done: true
};
}
}
}
};
return IteratorMock;
};
return IteratorMock;
}
}
}
return TreeMapClass;
@@ -17,9 +17,9 @@ import { paramMock } from "../utils"
export function mockTreeSet() {
const paramTreeSet = {
paramAnyMock : '[PC Preview] unknow any',
paramIterMock_TT : '[PC Preview] unknow IterableIterator_tt',
paramIterMock : '[PC Preview] unknow IterableIterator'
paramAnyMock: '[PC Preview] unknow any',
paramIterMock_TT: '[PC Preview] unknow IterableIterator_tt',
paramIterMock: '[PC Preview] unknow IterableIterator'
}
const TreeSetClass = class TreeSet {
constructor(...args) {
@@ -100,34 +100,34 @@ export function mockTreeSet() {
this.entries = function (...args) {
console.warn("TreeSet.entries interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
const IteratorVMock = {
*[Symbol.iterator]() {
yield paramTreeSet.paramIterMock;
}
};
return IteratorVMock;
};
}
[Symbol.iterator]() {
console.warn("TreeSet.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramTreeSet.paramAnyMock,
done: false
};
} else {
return {
done: true
};
const IteratorVMock = {
*[Symbol.iterator]() {
yield paramTreeSet.paramIterMock;
}
}
};
return IteratorVMock;
};
return IteratorMock;
this[Symbol.iterator] = function (...args) {
console.warn("TreeSet.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramTreeSet.paramAnyMock,
done: false
};
} else {
return {
done: true
};
}
}
};
return IteratorMock;
}
}
}
return TreeSetClass;
@@ -17,9 +17,9 @@ import { paramMock } from "../utils"
export function mockVector() {
const paramVector = {
paramAnyMock : '[PC Preview] unknow any',
paramVectorMock : '[PC Preview] unknow Vector',
paramIterMock : '[PC Preview] unknow IterableIterator'
paramAnyMock: '[PC Preview] unknow any',
paramVectorMock: '[PC Preview] unknow Vector',
paramIterMock: '[PC Preview] unknow IterableIterator'
}
const VectorClass = class Vector {
@@ -163,27 +163,27 @@ export function mockVector() {
console.warn("Vector.copyToArray interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
};
}
[Symbol.iterator]() {
console.warn("Vector.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramVector.paramAnyMock,
done: false
};
} else {
return {
done: true
};
this[Symbol.iterator] = function (...args) {
console.warn("Vector.[Symbol.iterator] interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
let index = 0;
const IteratorMock = {
next: () => {
if (index < 1) {
index++;
return {
value: paramVector.paramAnyMock,
done: false
};
} else {
return {
done: true
};
}
}
}
};
return IteratorMock;
};
return IteratorMock;
}
}
}
return VectorClass;