From 06c29598cd4ace28b8939ef207cd95cd2b947f2f Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Tue, 19 Sep 2023 16:57:36 +0100 Subject: [PATCH] add test files for the folders --- src/utils/executionConsole.ts | 4 + test/suite/commands.test.ts | 38 +++++ test/suite/ipc.test.ts | 258 ++++++++++++++++++++++++++++++++++ test/suite/panels.test.ts | 27 ++++ test/suite/services.test.ts | 41 ++++++ test/suite/validators.test.ts | 108 ++++++++++++++ 6 files changed, 476 insertions(+) create mode 100644 test/suite/commands.test.ts create mode 100644 test/suite/ipc.test.ts create mode 100644 test/suite/panels.test.ts create mode 100644 test/suite/services.test.ts create mode 100644 test/suite/validators.test.ts diff --git a/src/utils/executionConsole.ts b/src/utils/executionConsole.ts index 7c4da1df..211faa91 100644 --- a/src/utils/executionConsole.ts +++ b/src/utils/executionConsole.ts @@ -132,3 +132,7 @@ export class ExecutionConsole { commands.executeCommand("kdb.resultsPanel.update", query, dataSourceType); } } + +export function appendQuery(query: string) { + throw new Error("Function not implemented."); +} diff --git a/test/suite/commands.test.ts b/test/suite/commands.test.ts new file mode 100644 index 00000000..7dbadd98 --- /dev/null +++ b/test/suite/commands.test.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1998-2023 Kx Systems Inc. + * + * 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 * as dataSourceCommand from "../../src/commands/dataSourceCommand"; +import * as installTools from "../../src/commands/installTools"; +import * as serverCommand from "../../src/commands/serverCommand"; +import * as walkthroughCommand from "../../src/commands/walkthroughCommand"; + +describe("dataSourceCommand", () => { + //write tests for src/commands/dataSourceCommand.ts + //function to be deleted after write the tests + dataSourceCommand.renameDataSource("test", "test2"); +}); +describe("installTools", () => { + //write tests for src/commands/installTools.ts + //function to be deleted after write the tests + installTools.installTools(); +}); +describe("serverCommand", () => { + //write tests for src/commands/serverCommand.ts + //function to be deleted after write the tests + serverCommand.addNewConnection(); +}); +describe("walkthroughCommand", () => { + //write tests for src/commands/walkthroughCommand.ts + //function to be deleted after write the tests + walkthroughCommand.showInstallationDetails(); +}); diff --git a/test/suite/ipc.test.ts b/test/suite/ipc.test.ts new file mode 100644 index 00000000..fc53d91f --- /dev/null +++ b/test/suite/ipc.test.ts @@ -0,0 +1,258 @@ +/* + * Copyright (c) 1998-2023 Kx Systems Inc. + * + * 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 * as ipcF64 from "../../src/ipc/F64"; +import * as ipcI32 from "../../src/ipc/I32"; +import * as ipcI64 from "../../src/ipc/I64"; +import * as ipcOp from "../../src/ipc/Op"; +import * as ipcQBoolean from "../../src/ipc/QBoolean"; +import * as ipcQByte from "../../src/ipc/QByte"; +import * as ipcQChar from "../../src/ipc/QChar"; +import * as ipcQDate from "../../src/ipc/QDate"; +import * as ipcQDateTime from "../../src/ipc/QDateTime"; +import * as ipcQDict from "../../src/ipc/QDict"; +import * as ipcQDouble from "../../src/ipc/QDouble"; +import * as ipcQFloat from "../../src/ipc/QFloat"; +import * as ipcQGuid from "../../src/ipc/QGuid"; +import * as ipcQInt from "../../src/ipc/QInt"; +import * as ipcQLong from "../../src/ipc/QLong"; +import * as ipcQMinute from "../../src/ipc/QMinute"; +import * as ipcQMonth from "../../src/ipc/QMonth"; +import * as ipcQSecond from "../../src/ipc/QSecond"; +import * as ipcQShort from "../../src/ipc/QShort"; +import * as ipcQString from "../../src/ipc/QString"; +import * as ipcQSymbol from "../../src/ipc/QSymbol"; +import * as ipcQTable from "../../src/ipc/QTable"; +import * as ipcQTime from "../../src/ipc/QTime"; +import * as ipcQTimespan from "../../src/ipc/QTimespan"; +import * as ipcQTimestamp from "../../src/ipc/QTimestamp"; +import * as ipcQUnary from "../../src/ipc/QUnary"; +import * as ipcSparkMD5 from "../../src/ipc/SparkMD5"; +import * as ipcU8 from "../../src/ipc/U8"; +import * as ipcC from "../../src/ipc/c"; +import * as ipcCClasses from "../../src/ipc/cClasses"; +import * as ipcParseQlist from "../../src/ipc/parse.qlist"; +import * as ipcTools from "../../src/ipc/tools"; +import * as ipcTypeBase from "../../src/ipc/typeBase"; +import * as ipcUtils from "../../src/ipc/util"; +import * as ipcVector from "../../src/ipc/vector"; + +describe("c", () => { + //write tests for src/ipc/c.ts + //the line bellow should be deleted after write the tests + ipcC; +}); + +describe("cClasses", () => { + //write tests for src/ipc/cClasses.ts + //the line bellow should be deleted after write the tests + ipcCClasses; +}); + +describe("F64", () => { + //write tests for src/ipc/F64.ts + //the line bellow should be deleted after write the tests + ipcF64; +}); + +describe("I32", () => { + //write tests for src/ipc/I32.ts + //the line bellow should be deleted after write the tests + ipcI32; +}); + +describe("I64", () => { + //write tests for src/ipc/I64.ts + //the line bellow should be deleted after write the tests + ipcI64; +}); + +describe("Op", () => { + //write tests for src/ipc/Op.ts + //the line bellow should be deleted after write the tests + ipcOp; +}); + +describe("parse qlist", () => { + //write tests for src/ipc/parse.qlist.ts + //the line bellow should be deleted after write the tests + ipcParseQlist; +}); + +describe("QBoolean", () => { + //write tests for src/ipc/QBoolean.ts + //the line bellow should be deleted after write the tests + ipcQBoolean; +}); + +describe("QByte", () => { + //write tests for src/ipc/QByte.ts + //the line bellow should be deleted after write the tests + ipcQByte; +}); + +describe("QChar", () => { + //write tests for src/ipc/QChar.ts + //the line bellow should be deleted after write the tests + ipcQChar; +}); + +describe("QDate", () => { + //write tests for src/ipc/QDate.ts + //the line bellow should be deleted after write the tests + ipcQDate; +}); + +describe("QDateTime", () => { + //write tests for src/ipc/QDateTime.ts + //the line bellow should be deleted after write the tests + ipcQDateTime; +}); + +describe("QDict", () => { + //write tests for src/ipc/QDict.ts + //the line bellow should be deleted after write the tests + ipcQDict; +}); + +describe("QDouble", () => { + //write tests for src/ipc/QDouble.ts + //the line bellow should be deleted after write the tests + ipcQDouble; +}); + +describe("QFloat", () => { + //write tests for src/ipc/QFloat.ts + //the line bellow should be deleted after write the tests + ipcQFloat; +}); + +describe("QGuid", () => { + //write tests for src/ipc/QGuid.ts + //the line bellow should be deleted after write the tests + ipcQGuid; +}); + +describe("QInt", () => { + //write tests for src/ipc/QInt.ts + //the line bellow should be deleted after write the tests + ipcQInt; +}); + +describe("QLong", () => { + //write tests for src/ipc/QLong.ts + //the line bellow should be deleted after write the tests + ipcQLong; +}); + +describe("QMinute", () => { + //write tests for src/ipc/QMinute.ts + //the line bellow should be deleted after write the tests + ipcQMinute; +}); + +describe("QMonth", () => { + //write tests for src/ipc/QMonth.ts + //the line bellow should be deleted after write the tests + ipcQMonth; +}); + +describe("QSecond", () => { + //write tests for src/ipc/QSecond.ts + //the line bellow should be deleted after write the tests + ipcQSecond; +}); + +describe("QShort", () => { + //write tests for src/ipc/QShort.ts + //the line bellow should be deleted after write the tests + ipcQShort; +}); + +describe("QString", () => { + //write tests for src/ipc/QString.ts + //the line bellow should be deleted after write the tests + ipcQString; +}); + +describe("QSymbol", () => { + //write tests for src/ipc/QSymbol.ts + //the line bellow should be deleted after write the tests + ipcQSymbol; +}); + +describe("QTable", () => { + //write tests for src/ipc/QTable.ts + //the line bellow should be deleted after write the tests + ipcQTable; +}); + +describe("QTime", () => { + //write tests for src/ipc/QTime.ts + //the line bellow should be deleted after write the tests + ipcQTime; +}); + +describe("QTimestamp", () => { + //write tests for src/ipc/QTimestamp.ts + //the line bellow should be deleted after write the tests + ipcQTimestamp; +}); + +describe("QTimespan", () => { + //write tests for src/ipc/QTimespan.ts + //the line bellow should be deleted after write the tests + ipcQTimespan; +}); + +describe("QUnary", () => { + //write tests for src/ipc/QUnary.ts + //the line bellow should be deleted after write the tests + ipcQUnary; +}); + +describe("SparkMD5", () => { + //write tests for src/ipc/SparkMD5.ts + //the line bellow should be deleted after write the tests + ipcSparkMD5; +}); + +describe("tools", () => { + //write tests for src/ipc/tools.ts + //the line bellow should be deleted after write the tests + ipcTools; +}); + +describe("typeBase", () => { + //write tests for src/ipc/typeBase.ts + //the line bellow should be deleted after write the tests + ipcTypeBase; +}); + +describe("U8", () => { + //write tests for src/ipc/U8.ts + //the line bellow should be deleted after write the tests + ipcU8; +}); + +describe("utils", () => { + //write tests for src/ipc/utils.ts + //the line bellow should be deleted after write the tests + ipcUtils; +}); + +describe("Vector", () => { + //write tests for src/ipc/Vector.ts + //the line bellow should be deleted after write the tests + ipcVector; +}); diff --git a/test/suite/panels.test.ts b/test/suite/panels.test.ts new file mode 100644 index 00000000..4c817b34 --- /dev/null +++ b/test/suite/panels.test.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) 1998-2023 Kx Systems Inc. + * + * 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 * as datasourcePanel from "../../src/panels/datasource"; +import * as resultsPanel from "../../src/services/resultsPanelProvider"; + +describe("datasource", () => { + //write tests for src/panels/datasource.ts + //function to be deleted after write the tests + datasourcePanel; +}); + +describe("results panel", () => { + //write tests for src/services/resultsPanelProvider.ts + //function to be deleted after write the tests + resultsPanel; +}); diff --git a/test/suite/services.test.ts b/test/suite/services.test.ts new file mode 100644 index 00000000..7e8350cb --- /dev/null +++ b/test/suite/services.test.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1998-2023 Kx Systems Inc. + * + * 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 * as dataSourceTreeProvider from "../../src/services/dataSourceTreeProvider"; +import * as codeFlowLogin from "../../src/services/kdbInsights/codeFlowLogin"; +import * as kdbTreeProvider from "../../src/services/kdbTreeProvider"; +import * as terminalProvider from "../../src/services/terminalProvider"; + +describe("dataSourceTreeProvider", () => { + //write tests for src/services/dataSourceTreeProvider.ts + //function to be deleted after write the tests + dataSourceTreeProvider; +}); + +describe("kdbTreeProvider", () => { + //write tests for src/services/kdbTreeProvider.ts + //function to be deleted after write the tests + kdbTreeProvider; +}); + +describe("terminalProvider", () => { + //write tests for src/services/terminalProvider.ts + //function to be deleted after write the tests + terminalProvider; +}); + +describe("codeFlowLogin", () => { + //write tests for src/services/kdbInsights/codeFlowLogin.ts + //function to be deleted after write the tests + codeFlowLogin; +}); diff --git a/test/suite/validators.test.ts b/test/suite/validators.test.ts new file mode 100644 index 00000000..15750339 --- /dev/null +++ b/test/suite/validators.test.ts @@ -0,0 +1,108 @@ +/* + * Copyright (c) 1998-2023 Kx Systems Inc. + * + * 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 * as azureValidator from "../../src/validators/azureValidator"; +import * as index from "../../src/validators/debounceValidation/index"; +import * as interfaceValidator from "../../src/validators/interfaceValidator"; +import * as kdbValidator from "../../src/validators/kdbValidator"; +import * as rule from "../../src/validators/rule"; +import * as hasLowerCase from "../../src/validators/validationFunctions/hasLowerCase"; +import * as hasNoForbiddenChar from "../../src/validators/validationFunctions/hasNoForbiddenChar"; +import * as hasSpecialChar from "../../src/validators/validationFunctions/hasSpecialChar"; +import * as hasUpperCase from "../../src/validators/validationFunctions/hasUpperCase"; +import * as isAvailable from "../../src/validators/validationFunctions/isAvailable"; +import * as isNotEmpty from "../../src/validators/validationFunctions/isNotEmpty"; +import * as lengthRange from "../../src/validators/validationFunctions/lengthRange"; +import * as validator from "../../src/validators/validator"; + +describe("azureValidator", () => { + //write tests for src/validators/azureValidator.ts + //function to be deleted after write the tests + azureValidator; +}); + +describe("interfaceValidator", () => { + //write tests for src/validators/interfaceValidator.ts + //function to be deleted after write the tests + interfaceValidator; +}); + +describe("kdbValidator", () => { + //write tests for src/validators/kdbValidator.ts + //function to be deleted after write the tests + kdbValidator; +}); + +describe("rule", () => { + //write tests for src/validators/rule.ts + //function to be deleted after write the tests + rule; +}); + +describe("validator", () => { + //write tests for src/validators/validator.ts + //function to be deleted after write the tests + validator; +}); + +describe("debounceValidation", () => { + describe("index", () => { + //write tests for src/validators/debounceValidation/index.ts + //function to be deleted after write the tests + index; + }); +}); + +describe("validationFunctions", () => { + describe("hasLowerCase", () => { + //write tests for src/validators/validationFunctions/hasLowerCase.ts + //function to be deleted after write the tests + hasLowerCase; + }); + + describe("hasNoForbiddenChar", () => { + //write tests for src/validators/validationFunctions/hasNoForbiddenChar.ts + //function to be deleted after write the tests + hasNoForbiddenChar; + }); + + describe("hasSpecialChar", () => { + //write tests for src/validators/validationFunctions/hasSpecialChar.ts + //function to be deleted after write the tests + hasSpecialChar; + }); + + describe("hasUpperCase", () => { + //write tests for src/validators/validationFunctions/hasUpperCase.ts + //function to be deleted after write the tests + hasUpperCase; + }); + + describe("isAvailable", () => { + //write tests for src/validators/validationFunctions/isAvailable.ts + //function to be deleted after write the tests + isAvailable; + }); + + describe("isNotEmpty", () => { + //write tests for src/validators/validationFunctions/isNotEmpty.ts + //function to be deleted after write the tests + isNotEmpty; + }); + + describe("lengthRange", () => { + //write tests for src/validators/validationFunctions/lengthRange.ts + //function to be deleted after write the tests + lengthRange; + }); +});