• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import {paramMock} from "../utils"
17
18export const DataType = {
19  TYPE_NULL: 0,
20  TYPE_LONG: 1,
21  TYPE_DOUBLE: 2,
22  TYPE_STRING: 3,
23  TYPE_BLOB: 4
24};
25export const DataShareResultSetMock = {
26  columnNames: "[PC Preview] unknow columnNames",
27  columnCount: "[PC Preview] unknow columnCount",
28  rowCount: "[PC Preview] unknow rowCount",
29  rowIndex: "[PC Preview] unknow rowIndex",
30  isEnded: "[PC Preview] unknow isEnded",
31  isStarted: "[PC Preview] unknow isStarted",
32  isClosed: "[PC Preview] unknow isClosed",
33  getColumnIndex: function (...args) {
34    console.warn("ResultSet.getColumnIndex interface mocked in the Previewer. How this interface works on the Previewer" +
35      " may be different from that on a real device.")
36    return paramMock.paramNumberMock;
37  },
38  getColumnName: function (...args) {
39    console.warn("ResultSet.getColumnName interface mocked in the Previewer. How this interface works on the Previewer" +
40      " may be different from that on a real device.")
41    return paramMock.paramStringMock;
42  },
43  goTo: function (...args) {
44    console.warn("ResultSet.goTo interface mocked in the Previewer. How this interface works on the Previewer" +
45      " may be different from that on a real device.")
46    return paramMock.paramBooleanMock;
47  },
48  goToRow: function (...args) {
49    console.warn("ResultSet.goToRow interface mocked in the Previewer. How this interface works on the Previewer" +
50      " may be different from that on a real device.")
51    return paramMock.paramBooleanMock;
52  },
53  goToLastRow: function (...args) {
54    console.warn("ResultSet.goToLastRow interface mocked in the Previewer. How this interface works on the Previewer" +
55      " may be different from that on a real device.")
56    return paramMock.paramBooleanMock;
57  },
58  goToFirstRow: function (...args) {
59    console.warn("ResultSet.goToFirstRow interface mocked in the Previewer. How this interface works on the Previewer" +
60      " may be different from that on a real device.")
61    return paramMock.paramBooleanMock;
62  },
63  goToNextRow: function (...args) {
64    console.warn("ResultSet.goToNextRow interface mocked in the Previewer. How this interface works on the Previewer" +
65      " may be different from that on a real device.")
66    return paramMock.paramBooleanMock;
67  },
68  goToPreviousRow: function (...args) {
69    console.warn("ResultSet.goToPreviousRow interface mocked in the Previewer. How this interface works on the Previewer" +
70      " may be different from that on a real device.")
71    return paramMock.paramBooleanMock;
72  },
73  getBlob: function (...args) {
74    console.warn("ResultSet.getBlob interface mocked in the Previewer. How this interface works on the Previewer" +
75      " may be different from that on a real device.")
76    return paramMock.paramArrayMock;
77  },
78  getString: function (...args) {
79    console.warn("ResultSet.getString interface mocked in the Previewer. How this interface works on the Previewer" +
80      " may be different from that on a real device.")
81    return paramMock.paramStringMock;
82  },
83  getLong: function (...args) {
84    console.warn("ResultSet.getLong interface mocked in the Previewer. How this interface works on the Previewer" +
85      " may be different from that on a real device.")
86    return paramMock.paramNumberMock;
87  },
88  getDouble: function (...args) {
89    console.warn("ResultSet.getDouble interface mocked in the Previewer. How this interface works on the Previewer" +
90      " may be different from that on a real device.")
91    return paramMock.paramNumberMock;
92  },
93  isColumnNull: function (...args) {
94    console.warn("ResultSet.isColumnNull interface mocked in the Previewer. How this interface works on the Previewer" +
95      " may be different from that on a real device.")
96    return paramMock.paramBooleanMock;
97  },
98  getDataType: function (...args) {
99    console.warn("ResultSet.getDataType interface mocked in the Previewer. How this interface works on the Previewer" +
100      " may be different from that on a real device.")
101    return paramMock.paramNumberMock;
102  },
103  close: function () {
104    console.warn("ResultSet.close interface mocked in the Previewer. How this interface works on the Previewer" +
105      " may be different from that on a real device.")
106  }
107}
108export function DataShareResultSet() {
109      return DataShareResultSetMock
110}