mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-06-20 09:19:27 +02:00
Main build (Jenkins)
This commit is contained in:
@@ -1 +1 @@
|
||||
D8D47C184A2060D4594E0776ABC385FAAA61D7A37F5EA03C348DEF1311E79864
|
||||
ACA600906C29AB89D94EF3DF6EFD8E28DAA76E974DCA6473C6CCA31D1030FCD4
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function add(a, b) return a + b end");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(1);
|
||||
Parameters.Add(2);
|
||||
|
||||
Result = OPI_Lua.CallFunction(VM, "add", Parameters);
|
||||
@@ -0,0 +1,6 @@
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 3").Write(ScriptFile);
|
||||
|
||||
Result = OPI_Lua.CompileCodeFromFile("Lua54", ScriptFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
@@ -0,0 +1 @@
|
||||
Result = OPI_Lua.CompileCodeFromString("Lua54", "return 1");
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
Result = OPI_Lua.CreateVM("Lua54");
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Bytecode = OPI_Lua.CompileCodeFromString("Lua54", "return 11");
|
||||
Result = OPI_Lua.ExecuteBytecode("Lua54", Bytecode);
|
||||
@@ -0,0 +1,11 @@
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 13").Write(ScriptFile);
|
||||
|
||||
BytecodeFile = GetTempFileName("bin");
|
||||
Bytecode = OPI_Lua.CompileCodeFromFile("Lua54", ScriptFile);
|
||||
Bytecode.Write(BytecodeFile);
|
||||
|
||||
Result = OPI_Lua.ExecuteBytecodeFromFile("Lua54", BytecodeFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile , "Failed to delete the temporary file after the test!!");
|
||||
OPI_Tools.RemoveFileWithTry(BytecodeFile, "Failed to delete the temporary file after the test!!");
|
||||
@@ -0,0 +1,6 @@
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 7").Write(ScriptFile);
|
||||
|
||||
Result = OPI_Lua.ExecuteCodeFromFile("Lua54", ScriptFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
@@ -0,0 +1 @@
|
||||
Result = OPI_Lua.ExecuteCodeFromString("Lua54", "return 42");
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
VM54 = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
Result = OPI_Lua.IsVM(VM54);
|
||||
|
||||
Result = OPI_Lua.IsVM("not a vm");
|
||||
@@ -50,7 +50,14 @@ An error during code compilation will throw an exception
|
||||
<br/>
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 3").Write(ScriptFile);
|
||||
|
||||
Result = OPI_Lua.CompileCodeFromFile("Lua54", ScriptFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ An error during code compilation will throw an exception
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Result = OPI_Lua.CompileCodeFromString("Lua54", "return 1");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,19 @@ import Admonition from '@theme/Admonition';
|
||||
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 13").Write(ScriptFile);
|
||||
|
||||
BytecodeFile = GetTempFileName("bin");
|
||||
Bytecode = OPI_Lua.CompileCodeFromFile("Lua54", ScriptFile);
|
||||
Bytecode.Write(BytecodeFile);
|
||||
|
||||
Result = OPI_Lua.ExecuteBytecodeFromFile("Lua54", BytecodeFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile , "Failed to delete the temporary file after the test!!");
|
||||
OPI_Tools.RemoveFileWithTry(BytecodeFile, "Failed to delete the temporary file after the test!!");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
+4
-1
@@ -54,7 +54,10 @@ Parameters with Binary data type can also accept file paths on disk and URLs
|
||||
</Admonition>
|
||||
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Bytecode = OPI_Lua.CompileCodeFromString("Lua54", "return 11");
|
||||
Result = OPI_Lua.ExecuteBytecode("Lua54", Bytecode);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Vendored
+3
-1
@@ -54,7 +54,9 @@ An error during VM creation will throw an exception
|
||||
</Admonition>
|
||||
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Result = OPI_Lua.CreateVM("Lua54");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Vendored
+6
@@ -48,7 +48,13 @@ import Admonition from '@theme/Admonition';
|
||||
</Admonition>
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
VM54 = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
Result = OPI_Lua.IsVM(VM54);
|
||||
|
||||
Result = OPI_Lua.IsVM("not a vm");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,17 @@ The function must be pre-defined in the context using one of the code execution
|
||||
<br/>
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function add(a, b) return a + b end");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(1);
|
||||
Parameters.Add(2);
|
||||
|
||||
Result = OPI_Lua.CallFunction(VM, "add", Parameters);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,14 @@ An error during Lua code execution will throw an exception
|
||||
<br/>
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 7").Write(ScriptFile);
|
||||
|
||||
Result = OPI_Lua.ExecuteCodeFromFile("Lua54", ScriptFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ An error during Lua code execution will throw an exception
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Result = OPI_Lua.ExecuteCodeFromString("Lua54", "return 42");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
VM = OPI_Lua.СоздатьVM("Lua54");
|
||||
|
||||
OPI_Lua.ВыполнитьКодИзСтроки(VM, "function add(a, b) return a + b end");
|
||||
|
||||
Параметры = Новый Массив;
|
||||
Параметры.Добавить(1);
|
||||
Параметры.Добавить(2);
|
||||
|
||||
Результат = OPI_Lua.ВызватьФункцию(VM, "add", Параметры);
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
БайтКод = OPI_Lua.СкомпилироватьКодИзСтроки("Lua54", "return 11");
|
||||
Результат = OPI_Lua.ВыполнитьБайтКод("Lua54", БайтКод);
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
ФайлСкрипта = ПолучитьИмяВременногоФайла("lua");
|
||||
ПолучитьДвоичныеДанныеИзСтроки("return 13").Записать(ФайлСкрипта);
|
||||
|
||||
ФайлБайтКода = ПолучитьИмяВременногоФайла("bin");
|
||||
БайтКод = OPI_Lua.СкомпилироватьКодИзФайла("Lua54", ФайлСкрипта);
|
||||
БайтКод.Записать(ФайлБайтКода);
|
||||
|
||||
Результат = OPI_Lua.ВыполнитьБайтКодФайла("Lua54", ФайлБайтКода);
|
||||
|
||||
OPI_Инструменты.УдалитьФайлВПопытке(ФайлСкрипта , "Не удалось удалить временный файл после теста!");
|
||||
OPI_Инструменты.УдалитьФайлВПопытке(ФайлБайтКода, "Не удалось удалить временный файл после теста!");
|
||||
@@ -0,0 +1 @@
|
||||
Результат = OPI_Lua.ВыполнитьКодИзСтроки("Lua54", "return 42");
|
||||
@@ -0,0 +1,6 @@
|
||||
ФайлСкрипта = ПолучитьИмяВременногоФайла("lua");
|
||||
ПолучитьДвоичныеДанныеИзСтроки("return 7").Записать(ФайлСкрипта);
|
||||
|
||||
Результат = OPI_Lua.ВыполнитьКодИзФайла("Lua54", ФайлСкрипта);
|
||||
|
||||
OPI_Инструменты.УдалитьФайлВПопытке(ФайлСкрипта, "Не удалось удалить временный файл после теста!");
|
||||
@@ -0,0 +1 @@
|
||||
Результат = OPI_Lua.СкомпилироватьКодИзСтроки("Lua54", "return 1");
|
||||
@@ -0,0 +1,6 @@
|
||||
ФайлСкрипта = ПолучитьИмяВременногоФайла("lua");
|
||||
ПолучитьДвоичныеДанныеИзСтроки("return 3").Записать(ФайлСкрипта);
|
||||
|
||||
Результат = OPI_Lua.СкомпилироватьКодИзФайла("Lua54", ФайлСкрипта);
|
||||
|
||||
OPI_Инструменты.УдалитьФайлВПопытке(ФайлСкрипта, "Не удалось удалить временный файл после теста!");
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
Результат = OPI_Lua.СоздатьVM("Lua54");
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
VM54 = OPI_Lua.СоздатьVM("Lua54");
|
||||
|
||||
Результат = OPI_Lua.ЭтоVM(VM54);
|
||||
|
||||
Результат = OPI_Lua.ЭтоVM("not a vm");
|
||||
@@ -50,7 +50,14 @@ import Admonition from '@theme/Admonition';
|
||||
<br/>
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
ФайлСкрипта = ПолучитьИмяВременногоФайла("lua");
|
||||
ПолучитьДвоичныеДанныеИзСтроки("return 3").Записать(ФайлСкрипта);
|
||||
|
||||
Результат = OPI_Lua.СкомпилироватьКодИзФайла("Lua54", ФайлСкрипта);
|
||||
|
||||
OPI_Инструменты.УдалитьФайлВПопытке(ФайлСкрипта, "Не удалось удалить временный файл после теста!");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ import Admonition from '@theme/Admonition';
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Результат = OPI_Lua.СкомпилироватьКодИзСтроки("Lua54", "return 1");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,19 @@ import Admonition from '@theme/Admonition';
|
||||
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
ФайлСкрипта = ПолучитьИмяВременногоФайла("lua");
|
||||
ПолучитьДвоичныеДанныеИзСтроки("return 13").Записать(ФайлСкрипта);
|
||||
|
||||
ФайлБайтКода = ПолучитьИмяВременногоФайла("bin");
|
||||
БайтКод = OPI_Lua.СкомпилироватьКодИзФайла("Lua54", ФайлСкрипта);
|
||||
БайтКод.Записать(ФайлБайтКода);
|
||||
|
||||
Результат = OPI_Lua.ВыполнитьБайтКодФайла("Lua54", ФайлБайтКода);
|
||||
|
||||
OPI_Инструменты.УдалитьФайлВПопытке(ФайлСкрипта , "Не удалось удалить временный файл после теста!");
|
||||
OPI_Инструменты.УдалитьФайлВПопытке(ФайлБайтКода, "Не удалось удалить временный файл после теста!");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
+4
-1
@@ -54,7 +54,10 @@ import Admonition from '@theme/Admonition';
|
||||
</Admonition>
|
||||
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
БайтКод = OPI_Lua.СкомпилироватьКодИзСтроки("Lua54", "return 11");
|
||||
Результат = OPI_Lua.ВыполнитьБайтКод("Lua54", БайтКод);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Vendored
+3
-1
@@ -54,7 +54,9 @@ import Admonition from '@theme/Admonition';
|
||||
</Admonition>
|
||||
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Результат = OPI_Lua.СоздатьVM("Lua54");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Vendored
+6
@@ -48,7 +48,13 @@ import Admonition from '@theme/Admonition';
|
||||
</Admonition>
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
VM54 = OPI_Lua.СоздатьVM("Lua54");
|
||||
|
||||
Результат = OPI_Lua.ЭтоVM(VM54);
|
||||
|
||||
Результат = OPI_Lua.ЭтоVM("not a vm");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,17 @@ import Admonition from '@theme/Admonition';
|
||||
<br/>
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
VM = OPI_Lua.СоздатьVM("Lua54");
|
||||
|
||||
OPI_Lua.ВыполнитьКодИзСтроки(VM, "function add(a, b) return a + b end");
|
||||
|
||||
Параметры = Новый Массив;
|
||||
Параметры.Добавить(1);
|
||||
Параметры.Добавить(2);
|
||||
|
||||
Результат = OPI_Lua.ВызватьФункцию(VM, "add", Параметры);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,14 @@ import Admonition from '@theme/Admonition';
|
||||
<br/>
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
ФайлСкрипта = ПолучитьИмяВременногоФайла("lua");
|
||||
ПолучитьДвоичныеДанныеИзСтроки("return 7").Записать(ФайлСкрипта);
|
||||
|
||||
Результат = OPI_Lua.ВыполнитьКодИзФайла("Lua54", ФайлСкрипта);
|
||||
|
||||
OPI_Инструменты.УдалитьФайлВПопытке(ФайлСкрипта, "Не удалось удалить временный файл после теста!");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ import Admonition from '@theme/Admonition';
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Результат = OPI_Lua.ВыполнитьКодИзСтроки("Lua54", "return 42");
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
+11466
-11466
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
||||
D8D47C184A2060D4594E0776ABC385FAAA61D7A37F5EA03C348DEF1311E79864
|
||||
ACA600906C29AB89D94EF3DF6EFD8E28DAA76E974DCA6473C6CCA31D1030FCD4
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
Function GetHashSum() Export
|
||||
|
||||
LastBuildHash = "D8D47C184A2060D4594E0776ABC385FAAA61D7A37F5EA03C348DEF1311E79864";
|
||||
LastBuildHash = "ACA600906C29AB89D94EF3DF6EFD8E28DAA76E974DCA6473C6CCA31D1030FCD4";
|
||||
|
||||
Return LastBuildHash;
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ Function ExecuteCodeFromString(Val Lua, Val Code) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -170,7 +170,7 @@ Function ExecuteCodeFromFile(Val Lua, Val Path) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -206,7 +206,7 @@ Function CallFunction(Val Lua, Val FunctionName, Val Parameters = Undefined) Exp
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -245,7 +245,7 @@ Function CompileCodeFromString(Val Lua, Val Code) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -277,7 +277,7 @@ Function CompileCodeFromFile(Val Lua, Val Path) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -312,7 +312,7 @@ Function ExecuteBytecode(Val Lua, Val Bytecode) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -335,7 +335,7 @@ Function ExecuteBytecodeFromFile(Val Lua, Val Path) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -154,6 +154,24 @@ Procedure FT_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FT_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetFTPParameterOptions()[0];
|
||||
|
||||
FTP_Extended_GetGreetingWithoutConnection(TestParameters);
|
||||
FTP_Extended_ConnectionWithoutAddress(TestParameters);
|
||||
FTP_Extended_Reconnection(TestParameters);
|
||||
FTP_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // FTP
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -1539,6 +1557,85 @@ Procedure FTP_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure FTP_Extended_GetGreetingWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("FTP");
|
||||
Result = OPI_FTP.GetWelcomeMessage(Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "FTP", "Extended_GetGreetingWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_ConnectionWithoutAddress(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("FTP");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "FTP", "Extended_ConnectionWithoutAddress");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Host = FunctionParameters["FTP_IP"];
|
||||
Port = FunctionParameters["FTP_Port"];
|
||||
Login = FunctionParameters["FTP_User"];
|
||||
Password = FunctionParameters["FTP_Password"];
|
||||
|
||||
FTPSettings = OPI_FTP.GetConnectionSettings(Host, Port, Login, Password);
|
||||
|
||||
Connection = OPI_FTP.CreateConnection(FTPSettings);
|
||||
|
||||
If Not OPI_FTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "FTP", "Extended_Reconnection");
|
||||
OPI_FTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_FTP.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Host = FunctionParameters["FTP_IP"];
|
||||
Port = FunctionParameters["FTP_Port"];
|
||||
Login = FunctionParameters["FTP_User"];
|
||||
Password = FunctionParameters["FTP_Password"];
|
||||
|
||||
FTPSettings = OPI_FTP.GetConnectionSettings(Host, Port, Login, Password);
|
||||
|
||||
Connection = OPI_FTP.CreateConnection(FTPSettings, , , LoggingSettings);
|
||||
|
||||
If Not OPI_FTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_FTP.GetWelcomeMessage(Connection);
|
||||
|
||||
Result = OPI_FTP.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "FTP", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_FTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // FTP
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
+146
-1
@@ -117,6 +117,30 @@ Procedure GR_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_Address" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_AddressNoTls", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_Proto" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_ProtoTS" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_ProtoImport" , TestParameters);
|
||||
|
||||
GRPC_Extended_CallMethodWithoutConnection(TestParameters);
|
||||
GRPC_Extended_ConnectionWithoutAddress(TestParameters);
|
||||
GRPC_Extended_Reconnection(TestParameters);
|
||||
GRPC_Extended_GetLogOnConnection(TestParameters);
|
||||
GRPC_Extended_CallMethodMultipleBinaryFields(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_Introspection() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -388,7 +412,7 @@ Procedure GRPC_ExecuteMethod(FunctionParameters)
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "ExecuteMethod");
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "ExecuteMethod", , Data);
|
||||
|
||||
Result = OPI_GRPC.ExecuteMethod(Parameters, Service, Method, Undefined, , Tls);
|
||||
|
||||
@@ -461,6 +485,127 @@ Procedure GRPC_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure GRPC_Extended_CallMethodWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("GRPC");
|
||||
Request = OPI_AddIns.SerializeJanx(New Structure);
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Call(Request));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "Extended_CallMethodWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_ConnectionWithoutAddress(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("GRPC");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "Extended_ConnectionWithoutAddress");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Parameters = OPI_GRPC.GetConnectionParameters(Address, Scheme);
|
||||
Tls = OPI_GRPC.GetTlsSettings(True);
|
||||
|
||||
Connection = OPI_GRPC.CreateConnection(Parameters, Tls);
|
||||
|
||||
If Not OPI_GRPC.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "Extended_Reconnection");
|
||||
OPI_GRPC.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_GRPC.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Parameters = OPI_GRPC.GetConnectionParameters(Address, Scheme);
|
||||
Tls = OPI_GRPC.GetTlsSettings(True);
|
||||
|
||||
Connection = OPI_GRPC.CreateConnection(Parameters, Tls, LoggingSettings);
|
||||
|
||||
If Not OPI_GRPC.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_GRPC.ExecuteMethod(Connection, "grpcbin.GRPCBin", "DummyUnary");
|
||||
|
||||
Result = OPI_GRPC.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_GRPC.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_CallMethodMultipleBinaryFields(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Parameters = OPI_GRPC.GetConnectionParameters(Address, Scheme);
|
||||
Tls = OPI_GRPC.GetTlsSettings(True);
|
||||
|
||||
BinData = OPI_TestDataRetrieval.GetJanxTestCollection("BinariesArray");
|
||||
|
||||
Data = New Map;
|
||||
Data.Insert("f_string", "janx multi-bin");
|
||||
Data.Insert("f_int32" , 7);
|
||||
Data.Insert("f_bool" , True);
|
||||
Data.Insert("f_bytes" , BinData["chunks"][0]);
|
||||
Data.Insert("f_bytess", BinData["chunks"]);
|
||||
|
||||
Result = OPI_GRPC.ExecuteMethod(Parameters, "grpcbin.GRPCBin", "DummyUnary", Data, , Tls);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "Extended_CallMethodMultipleBinaryFields", , Data);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure GRPC_GetServiceList(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
@@ -106,6 +106,23 @@ Procedure Jnx_Benchmark() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Jnx_ExtendedDataCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Janx_Extended_RoundRobinMultipleBinaryFields();
|
||||
Janx_Extended_RoundRobinBinariesArray();
|
||||
Janx_Extended_RoundRobinMixedArray();
|
||||
Janx_Extended_RoundRobinDeepNesting();
|
||||
Janx_Extended_RoundRobinEmptyAndSpecial();
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // Janx
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -303,6 +320,70 @@ Procedure Janx_Benchmark()
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedDataCheck
|
||||
|
||||
Procedure Janx_Extended_RoundRobinMultipleBinaryFields()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
Result = OPI_Janx.SerializeData(Original);
|
||||
Restored = OPI_Janx.DeserializeData(Result);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Janx", "Extended_RoundRobin", "MultipleBinaries", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinBinariesArray()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("BinariesArray");
|
||||
Result = OPI_Janx.SerializeData(Original);
|
||||
Restored = OPI_Janx.DeserializeData(Result);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Janx", "Extended_RoundRobin", "BinariesArray", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinMixedArray()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MixedArray");
|
||||
Result = OPI_Janx.SerializeData(Original);
|
||||
Restored = OPI_Janx.DeserializeData(Result);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Janx", "Extended_RoundRobin", "MixedArray", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinDeepNesting()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("DeepNesting");
|
||||
Result = OPI_Janx.SerializeData(Original);
|
||||
Restored = OPI_Janx.DeserializeData(Result);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Janx", "Extended_RoundRobin", "DeepNesting", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinEmptyAndSpecial()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("EmptyAndSpecial");
|
||||
Result = OPI_Janx.SerializeData(Original);
|
||||
Restored = OPI_Janx.DeserializeData(Result);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Janx", "Extended_RoundRobin", "EmptyAndSpecial", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedDataCheck
|
||||
|
||||
#EndRegion // Janx
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
@@ -0,0 +1,365 @@
|
||||
// OneScript: ./OInt/tests/Modules/OPIt_Lua.os
|
||||
|
||||
// MIT License
|
||||
|
||||
// Copyright (c) 2023-2026 Anton Tsitavets
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
// https://github.com/Bayselonarrend/OpenIntegrations
|
||||
|
||||
// Test suite for YAxUnit
|
||||
|
||||
// BSLLS:Typo-off
|
||||
// BSLLS:LatinAndCyrillicSymbolInWord-off
|
||||
// BSLLS:IncorrectLineBreak-off
|
||||
// BSLLS:UsingServiceTag-off
|
||||
// BSLLS:UnusedParameters-off
|
||||
// BSLLS:DuplicateStringLiteral-off
|
||||
// BSLLS:UsingHardcodePath-off
|
||||
// BSLLS:UnusedLocalVariable-off
|
||||
// BSLLS:DeprecatedMessage-off
|
||||
// BSLLS:LineLength-off
|
||||
// BSLLS:MagicNumber-off
|
||||
// BSLLS:CommentedCode-off
|
||||
// BSLLS:AssignAliasFieldsInQuery-off
|
||||
// BSLLS:UsingHardcodeNetworkAddress-off
|
||||
// BSLLS:UnreachableCode-off
|
||||
// BSLLS:UnusedLocalMethod-off
|
||||
// BSLLS:NestedFunctionInParameters-off
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
// BSLLS:UsingSynchronousCalls-off
|
||||
// BSLLS:MagicDate-off
|
||||
// BSLLS:MissingParameterDescription-off
|
||||
// BSLLS:NumberOfOptionalParams-off
|
||||
// BSLLS:MethodSize-off
|
||||
// BSLLS:NestedConstructorsInStructureDeclaration-off
|
||||
// BSLLS:NumberOfValuesInStructureConstructor-off
|
||||
// BSLLS:UsingHardcodeSecretInformation-off
|
||||
// BSLLS:SpaceAtStartComment-off
|
||||
|
||||
//@skip-check undefined-variable
|
||||
//@skip-check wrong-string-literal-content
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
//@skip-check undefined-function-or-procedure
|
||||
//@skip-check module-unused-local-variable
|
||||
//@skip-check bsl-legacy-check-string-literal
|
||||
//@skip-check bsl-legacy-check-method-for-statements-after-return
|
||||
//@skip-check missing-temporary-file-deletion
|
||||
//@skip-check module-unused-method
|
||||
|
||||
// #Use oint
|
||||
// #Use asserts
|
||||
// #Use "internal"
|
||||
|
||||
#If Not WebClient Then // !OPI
|
||||
|
||||
// For YAxUnit
|
||||
|
||||
Procedure ИсполняемыеСценарии() Export
|
||||
|
||||
OPI_TestDataRetrieval.FormYAXTests("Lua");
|
||||
|
||||
EndProcedure
|
||||
|
||||
// For Asserts
|
||||
|
||||
Function ПолучитьСписокТестов(UnitTesting) Export
|
||||
|
||||
Return OPI_TestDataRetrieval.FormAssertsTests("Lua");
|
||||
|
||||
EndFunction
|
||||
|
||||
#Region Internal
|
||||
|
||||
#Region RunnableTests
|
||||
|
||||
#Region Lua
|
||||
|
||||
Procedure Lua_CommonMethods() Export
|
||||
|
||||
Lua_CreateVM();
|
||||
Lua_IsVM();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_WorkingWithScripts() Export
|
||||
|
||||
Lua_ExecuteCodeFromString();
|
||||
Lua_ExecuteCodeFromFile();
|
||||
Lua_CallFunction();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_BytecodeManagement() Export
|
||||
|
||||
Lua_CompileCodeFromString();
|
||||
Lua_CompileCodeFromFile();
|
||||
Lua_ExecuteBytecode();
|
||||
Lua_ExecuteBytecodeFromFile();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Lua_Extended_CodeExecutionError();
|
||||
Lua_Extended_GetLogWithoutInitialization();
|
||||
Lua_Extended_GetLogOnExecution();
|
||||
Lua_Extended_PassComplexData();
|
||||
Lua_Extended_PassArrayOfMixedTypes();
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // Lua
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
|
||||
#EndRegion // Internal
|
||||
|
||||
#Region Private
|
||||
|
||||
#Region AtomicTests
|
||||
|
||||
#Region Lua
|
||||
|
||||
Procedure Lua_CreateVM()
|
||||
|
||||
Result = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "CreateVM", "Lua54");
|
||||
|
||||
Result = OPI_Lua.CreateVM("LuaJIT");
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "CreateVM", "LuaJIT");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_IsVM()
|
||||
|
||||
VM54 = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
Result = OPI_Lua.IsVM(VM54);
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "IsVM", "Lua54"); // SKIP
|
||||
|
||||
Result = OPI_Lua.IsVM("not a vm");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "IsVM", "False");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteCodeFromString()
|
||||
|
||||
Result = OPI_Lua.ExecuteCodeFromString("Lua54", "return 42");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "ExecuteCodeFromString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteCodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 7").Write(ScriptFile);
|
||||
|
||||
Result = OPI_Lua.ExecuteCodeFromFile("Lua54", ScriptFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "ExecuteCodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CallFunction()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function add(a, b) return a + b end");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(1);
|
||||
Parameters.Add(2);
|
||||
|
||||
Result = OPI_Lua.CallFunction(VM, "add", Parameters);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "CallFunction");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CompileCodeFromString()
|
||||
|
||||
Result = OPI_Lua.CompileCodeFromString("Lua54", "return 1");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "CompileCodeFromString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CompileCodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 3").Write(ScriptFile);
|
||||
|
||||
Result = OPI_Lua.CompileCodeFromFile("Lua54", ScriptFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "CompileCodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteBytecode()
|
||||
|
||||
Bytecode = OPI_Lua.CompileCodeFromString("Lua54", "return 11");
|
||||
Result = OPI_Lua.ExecuteBytecode("Lua54", Bytecode);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "ExecuteBytecode");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteBytecodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 13").Write(ScriptFile);
|
||||
|
||||
BytecodeFile = GetTempFileName("bin");
|
||||
Bytecode = OPI_Lua.CompileCodeFromFile("Lua54", ScriptFile);
|
||||
Bytecode.Write(BytecodeFile);
|
||||
|
||||
Result = OPI_Lua.ExecuteBytecodeFromFile("Lua54", BytecodeFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile , "Failed to delete the temporary file after the test!!");
|
||||
OPI_Tools.RemoveFileWithTry(BytecodeFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "ExecuteBytecodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure Lua_Extended_CodeExecutionError()
|
||||
|
||||
AddIn = OPI_AddIns.GetAddIn("Lua54");
|
||||
Result = OPI_AddIns.DesrializeJanx(AddIn.ExecuteString("syntax error !!!"));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "Extended_CodeExecutionError");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_GetLogWithoutInitialization()
|
||||
|
||||
AddIn = OPI_Lua.CreateVM("Lua54");
|
||||
Result = OPI_AddIns.DesrializeJanx(AddIn.GetLogs(10));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "Extended_GetLogWithoutInitialization");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_GetLogOnExecution()
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_AddIns.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54", LoggingSettings);
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "return 1");
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(VM.GetLogs(10));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "Extended_GetLogOnExecution", , LogFile);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_PassComplexData()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function echo(v) return v end");
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("LuaComplexData");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(Original);
|
||||
|
||||
Result = OPI_Lua.CallFunction(VM, "echo", Parameters);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "Extended_PassComplexData", , Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_PassArrayOfMixedTypes()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function echo(v) return v end");
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("LuaMixedArray");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(Original);
|
||||
|
||||
Result = OPI_Lua.CallFunction(VM, "echo", Parameters);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "Extended_PassArrayOfMixedTypes", , Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // Lua
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
#EndRegion // Private
|
||||
|
||||
#EndIf // !OPI
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="a8f3c2e1-4b5d-4a9e-8c7f-1d2e3f4a5b6c">
|
||||
<name>OPIt_Lua</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Lua</value>
|
||||
</synonym>
|
||||
<clientManagedApplication>true</clientManagedApplication>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
@@ -114,6 +114,26 @@ Procedure MSS_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("PG_IP" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("PG_Password", TestParameters);
|
||||
|
||||
MSSQL_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
MSSQL_Extended_ConnectionWithoutString(TestParameters);
|
||||
MSSQL_Extended_Reconnection(TestParameters);
|
||||
MSSQL_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_ORM() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -378,6 +398,93 @@ Procedure MSSQL_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure MSSQL_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
Result = OPI_MSSQL.ExecuteSQLQuery("SELECT 1", , , Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MSSQL", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MSSQL", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "SA";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
|
||||
ConnectionString = OPI_MSSQL.GenerateConnectionString(Address, , Login, Password);
|
||||
TLSSettings = OPI_MSSQL.GetTLSSettings(True);
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
|
||||
TLSSetup = OPI_AddIns.SetTls(Connector, TLSSettings);
|
||||
If Not OPI_Tools.GetOr(TLSSetup, "result", False) Then
|
||||
Raise OPI_Tools.JSONString(TLSSetup);
|
||||
EndIf;
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MSSQL", "Extended_Reconnection");
|
||||
OPI_MSSQL.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_MSSQL.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "SA";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
|
||||
ConnectionString = OPI_MSSQL.GenerateConnectionString(Address, , Login, Password);
|
||||
TLSSettings = OPI_MSSQL.GetTLSSettings(True);
|
||||
|
||||
Connection = OPI_MSSQL.CreateConnection(ConnectionString, TLSSettings, LoggingSettings);
|
||||
|
||||
If Not OPI_MSSQL.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_MSSQL.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_MSSQL.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MSSQL", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_MSSQL.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure MSSQL_CreateDatabase(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
|
||||
@@ -224,7 +224,8 @@ Procedure MessagePack_SerializeData()
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MessagePack", "SerializeData", "False");
|
||||
|
||||
Result = OPI_MessagePack.SerializeData(GetBinaryDataFromHexString(""));
|
||||
Data = GetBinaryDataFromHexString("");
|
||||
Result = OPI_MessagePack.SerializeData(Data);
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MessagePack", "SerializeData", "EmptyBinary");
|
||||
|
||||
|
||||
@@ -114,6 +114,28 @@ Procedure Mongo_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Mongo_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_Port" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_User" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_Password", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_DB" , TestParameters);
|
||||
|
||||
MongoDB_Extended_ExecuteCommandWithoutConnection(TestParameters);
|
||||
MongoDB_Extended_ConnectionWithoutString(TestParameters);
|
||||
MongoDB_Extended_Reconnection(TestParameters);
|
||||
MongoDB_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Mong_DatabaseManagement() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -376,6 +398,93 @@ Procedure MongoDB_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure MongoDB_Extended_ExecuteCommandWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MongoDB");
|
||||
Result = OPI_MongoDB.ExecuteCommand(Connector, "listDatabases");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MongoDB", "Extended_ExecuteCommandWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MongoDB_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MongoDB");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MongoDB", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MongoDB_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = "127.0.0.1:1234";
|
||||
Login = FunctionParameters["MongoDB_User"];
|
||||
Password = FunctionParameters["MongoDB_Password"];
|
||||
Base = FunctionParameters["MongoDB_DB"];
|
||||
|
||||
Address = OPI_TestDataRetrieval.GetLocalhost() + ":" + FunctionParameters["MongoDB_Port"];
|
||||
|
||||
ConnectionParams = New Structure("authSource", "admin");
|
||||
ConnectionString = OPI_MongoDB.GenerateConnectionString(Address, Base, Login, Password, ConnectionParams);
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MongoDB");
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MongoDB", "Extended_Reconnection");
|
||||
OPI_MongoDB.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MongoDB_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_MongoDB.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = "127.0.0.1:1234";
|
||||
Login = FunctionParameters["MongoDB_User"];
|
||||
Password = FunctionParameters["MongoDB_Password"];
|
||||
|
||||
Address = OPI_TestDataRetrieval.GetLocalhost() + ":" + FunctionParameters["MongoDB_Port"];
|
||||
|
||||
ConnectionParams = New Structure("authSource", "admin");
|
||||
ConnectionString = OPI_MongoDB.GenerateConnectionString(Address, , Login, Password, ConnectionParams);
|
||||
|
||||
Connection = OPI_MongoDB.CreateConnection(ConnectionString, LoggingSettings);
|
||||
|
||||
If Not OPI_MongoDB.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_MongoDB.ExecuteCommand(Connection, "listDatabases", , , New Structure("nameOnly", True));
|
||||
|
||||
Result = OPI_MongoDB.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MongoDB", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_MongoDB.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure MongoDB_GetDatabase(FunctionParameters)
|
||||
|
||||
Address = "127.0.0.1:1234";
|
||||
|
||||
@@ -114,6 +114,24 @@ Procedure MYS_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MYS_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetMySQLParameterOptions()[0];
|
||||
|
||||
MySQL_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
MySQL_Extended_ConnectionWithoutString(TestParameters);
|
||||
MySQL_Extended_Reconnection(TestParameters);
|
||||
MySQL_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MYS_ORM() Export
|
||||
|
||||
OptionArray = OPI_TestDataRetrieval.GetMySQLParameterOptions();
|
||||
@@ -1057,6 +1075,113 @@ Procedure MySQL_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure MySQL_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MySQL");
|
||||
Result = OPI_MySQL.ExecuteSQLQuery("SELECT 1", , , Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MySQL", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MySQL_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MySQL");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MySQL", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MySQL_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
ConnectionString = OPI_MySQL.GenerateConnectionString(Address, Base, Login, Password, Port);
|
||||
|
||||
If TLS Then
|
||||
TLSSettings = OPI_MySQL.GetTLSSettings(True);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MySQL");
|
||||
|
||||
If TLS Then
|
||||
TLSSetup = OPI_AddIns.SetTls(Connector, TLSSettings);
|
||||
If Not OPI_Tools.GetOr(TLSSetup, "result", False) Then
|
||||
Raise OPI_Tools.JSONString(TLSSetup);
|
||||
EndIf;
|
||||
EndIf;
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MySQL", "Extended_Reconnection");
|
||||
OPI_MySQL.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MySQL_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_MySQL.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
ConnectionString = OPI_MySQL.GenerateConnectionString(Address, Base, Login, Password, Port);
|
||||
|
||||
If TLS Then
|
||||
TLSSettings = OPI_MySQL.GetTLSSettings(True);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connection = OPI_MySQL.CreateConnection(ConnectionString, TLSSettings, LoggingSettings);
|
||||
|
||||
If Not OPI_MySQL.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_MySQL.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_MySQL.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MySQL", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_MySQL.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure MySQL_GetTableInformation(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
|
||||
@@ -114,6 +114,24 @@ Procedure Postgres_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Postgres_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetPostgresParameterOptions()[0];
|
||||
|
||||
PostgreSQL_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
PostgreSQL_Extended_ConnectionWithoutString(TestParameters);
|
||||
PostgreSQL_Extended_Reconnection(TestParameters);
|
||||
PostgreSQL_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Postgres_ORM() Export
|
||||
|
||||
OptionArray = OPI_TestDataRetrieval.GetPostgresParameterOptions();
|
||||
@@ -1176,6 +1194,113 @@ Procedure PostgreSQL_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure PostgreSQL_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("PostgreSQL");
|
||||
Result = OPI_PostgreSQL.ExecuteSQLQuery("SELECT 1", , , Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "PostgreSQL", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure PostgreSQL_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("PostgreSQL");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "PostgreSQL", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure PostgreSQL_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "postgres";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
ConnectionString = OPI_PostgreSQL.GenerateConnectionString(Address, Base, Login, Password, Port);
|
||||
|
||||
If TLS Then
|
||||
TLSSettings = OPI_PostgreSQL.GetTLSSettings(True);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("PostgreSQL");
|
||||
|
||||
If TLS Then
|
||||
TLSSetup = OPI_AddIns.SetTls(Connector, TLSSettings);
|
||||
If Not OPI_Tools.GetOr(TLSSetup, "result", False) Then
|
||||
Raise OPI_Tools.JSONString(TLSSetup);
|
||||
EndIf;
|
||||
EndIf;
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "PostgreSQL", "Extended_Reconnection");
|
||||
OPI_PostgreSQL.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure PostgreSQL_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_PostgreSQL.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "postgres";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
ConnectionString = OPI_PostgreSQL.GenerateConnectionString(Address, Base, Login, Password, Port);
|
||||
|
||||
If TLS Then
|
||||
TLSSettings = OPI_PostgreSQL.GetTLSSettings(True);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connection = OPI_PostgreSQL.CreateConnection(ConnectionString, TLSSettings, LoggingSettings);
|
||||
|
||||
If Not OPI_PostgreSQL.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_PostgreSQL.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_PostgreSQL.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "PostgreSQL", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_PostgreSQL.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure PostgreSQL_AddTableColumn(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
|
||||
@@ -110,6 +110,25 @@ Procedure RC_CommandsExecution() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure RC_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("RCON_URL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("RCON_Password", TestParameters);
|
||||
|
||||
RCON_Extended_ExecuteCommandWithoutConnection(TestParameters);
|
||||
RCON_Extended_Reconnection(TestParameters);
|
||||
RCON_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // RCON
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -246,6 +265,70 @@ Procedure RCON_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure RCON_Extended_ExecuteCommandWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("RCON");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Command("list"));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "RCON", "Extended_ExecuteCommandWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure RCON_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
URL = FunctionParameters["RCON_URL"];
|
||||
Password = FunctionParameters["RCON_Password"];
|
||||
WriteTimeout = 20;
|
||||
ReadTimeout = 20;
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("RCON");
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect(URL, Password, ReadTimeout, WriteTimeout));
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect(URL, Password, ReadTimeout, WriteTimeout));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "RCON", "Extended_Reconnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure RCON_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_RCON.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
URL = FunctionParameters["RCON_URL"];
|
||||
Password = FunctionParameters["RCON_Password"];
|
||||
WriteTimeout = 20;
|
||||
ReadTimeout = 20;
|
||||
|
||||
ConnectionParams = OPI_RCON.FormConnectionParameters(URL, Password, ReadTimeout, WriteTimeout);
|
||||
Connection = OPI_RCON.CreateConnection(ConnectionParams, LoggingSettings);
|
||||
|
||||
If Not OPI_RCON.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_RCON.ExecuteCommand("list", Connection);
|
||||
|
||||
Result = OPI_RCON.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "RCON", "Extended_GetLogOnConnection", , LogFile);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // RCON
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
@@ -153,6 +153,26 @@ Procedure SF_FileManagement() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SF_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetSSHParameterOptions()[0];
|
||||
|
||||
SFTP_Extended_GetListWithoutConnection(TestParameters);
|
||||
SFTP_Extended_ConnectionWithoutSettings(TestParameters);
|
||||
SFTP_Extended_Reconnection(TestParameters);
|
||||
SFTP_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(TestParameters["SSH_Key"], "Error deleting file after test");
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // SFTP
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -1459,6 +1479,85 @@ Procedure SFTP_GetFileInformation(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure SFTP_Extended_GetListWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Result = OPI_SFTP.ListObjects(Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SFTP", "Extended_GetListWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SFTP_Extended_ConnectionWithoutSettings(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SFTP", "Extended_ConnectionWithoutSettings");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SFTP_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Host = FunctionParameters["SSH_Host"];
|
||||
Port = FunctionParameters["SSH_Port"];
|
||||
Login = FunctionParameters["SSH_User"];
|
||||
Password = FunctionParameters["SSH_Password"];
|
||||
|
||||
SFTPSettings = OPI_SFTP.GetSettingsLoginPassword(Host, Port, Login, Password);
|
||||
|
||||
Connection = OPI_SFTP.CreateConnection(SFTPSettings);
|
||||
|
||||
If Not OPI_SFTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SFTP", "Extended_Reconnection");
|
||||
OPI_SFTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SFTP_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_SSH.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Host = FunctionParameters["SSH_Host"];
|
||||
Port = FunctionParameters["SSH_Port"];
|
||||
Login = FunctionParameters["SSH_User"];
|
||||
Password = FunctionParameters["SSH_Password"];
|
||||
|
||||
SFTPSettings = OPI_SFTP.GetSettingsLoginPassword(Host, Port, Login, Password);
|
||||
|
||||
Connection = OPI_SSH.CreateConnection(SFTPSettings, , LoggingSettings);
|
||||
|
||||
If Not OPI_SFTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SFTP.ListObjects(Connection, "");
|
||||
|
||||
Result = OPI_SSH.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SFTP", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_SFTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // SFTP
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
@@ -119,6 +119,24 @@ Procedure SQLL_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLL_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
SQLite_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
SQLite_Extended_Reconnection(TestParameters);
|
||||
SQLite_Extended_GetLogOnConnection(TestParameters);
|
||||
SQLite_Extended_RequestWithTwoBlobs(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLL_ORM() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -835,6 +853,101 @@ Procedure SQLite_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure SQLite_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SQLite");
|
||||
Result = OPI_SQLite.ExecuteSQLQuery("SELECT 1", , , Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SQLite", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLite_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
TFN = GetTempFileName("sqlite");
|
||||
Connector = OPI_AddIns.GetAddIn("SQLite");
|
||||
|
||||
Connector.Database = TFN;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SQLite", "Extended_Reconnection");
|
||||
OPI_SQLite.CloseConnection(Connector);
|
||||
OPI_Tools.RemoveFileWithTry(TFN, "Database file deletion error");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLite_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_SQLite.GetLoggingSettings(True, 100, LogFile);
|
||||
TFN = GetTempFileName("sqlite");
|
||||
|
||||
Connection = OPI_SQLite.CreateConnection(TFN, LoggingSettings);
|
||||
|
||||
If Not OPI_SQLite.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SQLite.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_SQLite.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SQLite", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_SQLite.CloseConnection(Connection);
|
||||
OPI_Tools.RemoveFileWithTry(TFN, "Database file deletion error");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLite_Extended_RequestWithTwoBlobs(FunctionParameters)
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
TFN = GetTempFileName("sqlite");
|
||||
|
||||
Connection = OPI_SQLite.CreateConnection(TFN);
|
||||
|
||||
If Not OPI_SQLite.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SQLite.ExecuteSQLQuery("DROP TABLE IF EXISTS janx_blob_test", , , Connection);
|
||||
OPI_SQLite.ExecuteSQLQuery("CREATE TABLE janx_blob_test (
|
||||
|alpha BLOB,
|
||||
|beta BLOB,
|
||||
|inner_blob BLOB)", , , Connection);
|
||||
|
||||
ParameterArray = New Array;
|
||||
ParameterArray.Add(New Structure("blob", Original["alpha"]));
|
||||
ParameterArray.Add(New Structure("blob", Original["beta"]));
|
||||
ParameterArray.Add(New Structure("blob", Original["nested"]["inner"]));
|
||||
|
||||
OPI_SQLite.ExecuteSQLQuery("INSERT INTO janx_blob_test (alpha, beta, inner_blob) VALUES (?, ?, ?)", ParameterArray, , Connection);
|
||||
|
||||
Result = OPI_SQLite.ExecuteSQLQuery("SELECT alpha, beta, inner_blob FROM janx_blob_test", , , Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SQLite", "Extended_RequestWithTwoBlobs", , Original);
|
||||
OPI_SQLite.CloseConnection(Connection);
|
||||
OPI_Tools.RemoveFileWithTry(TFN, "Database file deletion error");
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // SQLite
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
@@ -120,6 +120,23 @@ Procedure SShell_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SShell_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetSSHParameterOptions()[0];
|
||||
|
||||
SSH_Extended_ExecuteCommandWithoutConnection(TestParameters);
|
||||
SSH_Extended_ConnectionWithoutSettings(TestParameters);
|
||||
SSH_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // SSH
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -710,6 +727,60 @@ Procedure SSH_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure SSH_Extended_ExecuteCommandWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Result = OPI_SSH.ExecuteCommand(Connector, "whoami");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SSH", "Extended_ExecuteCommandWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SSH_Extended_ConnectionWithoutSettings(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SSH", "Extended_ConnectionWithoutSettings");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SSH_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_SSH.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Host = FunctionParameters["SSH_Host"];
|
||||
Port = FunctionParameters["SSH_Port"];
|
||||
Login = FunctionParameters["SSH_User"];
|
||||
Password = FunctionParameters["SSH_Password"];
|
||||
|
||||
SSHSettings = OPI_SSH.GetSettingsLoginPassword(Host, Port, Login, Password);
|
||||
Connection = OPI_SSH.CreateConnection(SSHSettings, , LoggingSettings);
|
||||
|
||||
If Not OPI_SSH.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SSH.ExecuteCommand(Connection, "whoami");
|
||||
|
||||
Result = OPI_SSH.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SSH", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_SSH.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // SSH
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
@@ -146,6 +146,27 @@ Procedure TC_Server() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TC_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
TCP_Extended_GetDataOfNextTimeout(TestParameters);
|
||||
TCP_Extended_OperationWithoutStart(TestParameters);
|
||||
TCP_Extended_GetLogOnServerStart(TestParameters);
|
||||
TCP_Extended_ReadTimeout(TestParameters);
|
||||
TCP_Extended_OperationWithoutConnection(TestParameters);
|
||||
TCP_Extended_GetLogOnConnectionOpening(TestParameters);
|
||||
TCP_Extended_JanxCollectionExchange(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // TCP
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -812,6 +833,180 @@ Procedure TCP_GetLoggingSettings(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure TCP_Extended_GetDataOfNextTimeout(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
ServerObject = OPI_TCP.StartServer(Port);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_TCP.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_GetDataOfNextTimeout");
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_OperationWithoutStart(FunctionParameters)
|
||||
|
||||
ServerObject = OPI_AddIns.GetAddIn(OPI_TCP.AddInName());
|
||||
|
||||
Result = OPI_TCP.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_OperationWithoutStart");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_GetLogOnServerStart(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_TCP.GetLoggingSettings(True, 100, LogFile);
|
||||
ServerObject = OPI_TCP.StartServer(Port, , LoggingSettings);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ConnectionAddress = "127.0.0.1:9876";
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("TCP_LOG_SRV_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
OPI_TCP.SendLine(ClientObject, Message + Chars.LF);
|
||||
OPI_TCP.GetNextConnectionData(ServerObject, 5000);
|
||||
|
||||
Result = OPI_TCP.GetLog(ServerObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_GetLogOnServerStart", , LogFile);
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_ReadTimeout(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
ConnectionAddress = "127.0.0.1:9876";
|
||||
ServerObject = OPI_TCP.StartServer(Port);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Data = OPI_TCP.ReadBinaryData(ClientObject, , , 300);
|
||||
|
||||
Result = New Map;
|
||||
Result.Insert("result", Data.Size() = 0);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_ReadTimeout");
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_OperationWithoutConnection(FunctionParameters)
|
||||
|
||||
ClientObject = OPI_AddIns.GetAddIn("TCPClient");
|
||||
Data = GetBinaryDataFromString("x");
|
||||
|
||||
OPI_TCP.SendBinaryData(ClientObject, Data, 300);
|
||||
Result = OPI_TCP.GetLastError(ClientObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_OperationWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_GetLogOnConnectionOpening(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
ConnectionAddress = "127.0.0.1:9876";
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_TCP.GetLoggingSettings(True, 100, LogFile);
|
||||
ServerObject = OPI_TCP.StartServer(Port);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress, , , LoggingSettings);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("TCP_LOG_CLI_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
OPI_TCP.SendLine(ClientObject, Message + Chars.LF);
|
||||
OPI_TCP.GetNextConnectionData(ServerObject, 5000);
|
||||
|
||||
Result = OPI_TCP.GetLog(ClientObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_GetLogOnConnectionOpening", , LogFile);
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_JanxCollectionExchange(FunctionParameters)
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
JanxData = OPI_Janx.SerializeData(Original);
|
||||
|
||||
LaunchPort = 9879;
|
||||
ServerObject = OPI_TCP.StartServer(LaunchPort);
|
||||
|
||||
ConnectionAddress = "127.0.0.1:9879";
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
OPI_TCP.SendBinaryData(ClientObject, JanxData);
|
||||
|
||||
NextMessage = OPI_TCP.GetNextConnectionData(ServerObject, 5000);
|
||||
ConnectionID = NextMessage["connectionId"];
|
||||
|
||||
OPI_TCP.SendData(ServerObject, ConnectionID, NextMessage["message"]);
|
||||
|
||||
ClientResponse = OPI_TCP.ReadBinaryData(ClientObject, , , 5000);
|
||||
Restored = OPI_Janx.DeserializeData(ClientResponse);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(ClientResponse, "TCP", "Extended_JanxCollectionExchange", , Restored, Original);
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // TCP
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
@@ -147,6 +147,23 @@ Procedure WS_Server() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WS_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
WebSocket_Extended_GetDataOfNextTimeout(TestParameters);
|
||||
WebSocket_Extended_OperationWithoutStart(TestParameters);
|
||||
WebSocket_Extended_GetLogOnServerStart(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // WebSocket
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -1097,6 +1114,72 @@ Procedure WebSocket_GetLoggingSettings(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure WebSocket_Extended_GetDataOfNextTimeout(FunctionParameters)
|
||||
|
||||
Port = 9893;
|
||||
ServerObject = OPI_WebSocket.StartServer(Port);
|
||||
|
||||
If Not OPI_WebSocket.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_WebSocket.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "WebSocket", "Extended_GetDataOfNextTimeout");
|
||||
OPI_WebSocket.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WebSocket_Extended_OperationWithoutStart(FunctionParameters)
|
||||
|
||||
ServerObject = OPI_AddIns.GetAddIn(OPI_WebSocket.AddInName());
|
||||
|
||||
Result = OPI_WebSocket.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "WebSocket", "Extended_OperationWithoutStart");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WebSocket_Extended_GetLogOnServerStart(FunctionParameters)
|
||||
|
||||
Port = 9893;
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_WebSocket.GetLoggingSettings(True, 100, LogFile);
|
||||
ServerObject = OPI_WebSocket.StartServer(Port, , LoggingSettings);
|
||||
|
||||
If Not OPI_WebSocket.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ConnectionAddress = "ws://127.0.0.1:9893";
|
||||
ClientObject = OPI_WebSocket.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_WebSocket.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("WS_LOG_SRV_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
OPI_WebSocket.SendTextMessage(ClientObject, Message);
|
||||
OPI_WebSocket.GetNextConnectionData(ServerObject, 5000);
|
||||
|
||||
Result = OPI_WebSocket.GetLog(ServerObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "WebSocket", "Extended_GetLogOnServerStart", , LogFile);
|
||||
OPI_WebSocket.CloseConnection(ClientObject);
|
||||
OPI_WebSocket.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // WebSocket
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
@@ -138,6 +138,17 @@ Procedure ZMQ_InteractionMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZMQ_ExtendedCheck() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
ZeroMQ_Extended_GetTimeoutData(TestParameters);
|
||||
ZeroMQ_Extended_HandleTimeoutRequest(TestParameters);
|
||||
ZeroMQ_Extended_GetLogOnPortOpening(TestParameters);
|
||||
ZeroMQ_Extended_JanxCollectionExchange(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ZeroMQ
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -674,6 +685,124 @@ Procedure ZeroMQ_GetLoggingSettings(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure ZeroMQ_Extended_GetTimeoutData(FunctionParameters)
|
||||
|
||||
Port = 5555;
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_ZeroMQ.ReceiveData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "ZeroMQ", "Extended_GetTimeoutData");
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZeroMQ_Extended_HandleTimeoutRequest(FunctionParameters)
|
||||
|
||||
Port = 5555;
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Address = "tcp://127.0.0.1:5555";
|
||||
ClientObject = OPI_ZeroMQ.CreateConnectionReq(Address);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Request = StrTemplate("ZMQ_REQ_TO_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
ReqData = GetBinaryDataFromString(Request);
|
||||
Result = OPI_ZeroMQ.ProcessRequest(ClientObject, ReqData, 3000, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "ZeroMQ", "Extended_HandleTimeoutRequest");
|
||||
OPI_ZeroMQ.CloseConnection(ClientObject);
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZeroMQ_Extended_GetLogOnPortOpening(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_ZeroMQ.GetLoggingSettings(True, 100, LogFile);
|
||||
Port = 5555;
|
||||
Address = "tcp://127.0.0.1:5555";
|
||||
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port, LoggingSettings);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ClientObject = OPI_ZeroMQ.CreateConnectionReq(Address);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("ZMQ_LOG_BIND_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
Data = GetBinaryDataFromString(Message);
|
||||
|
||||
OPI_ZeroMQ.SendData(ClientObject, Data, 3000);
|
||||
OPI_ZeroMQ.ReceiveData(ServerObject, 3000);
|
||||
|
||||
Result = OPI_ZeroMQ.GetLog(ServerObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "ZeroMQ", "Extended_GetLogOnPortOpening", , LogFile);
|
||||
OPI_ZeroMQ.CloseConnection(ClientObject);
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZeroMQ_Extended_JanxCollectionExchange(FunctionParameters)
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
JanxData = OPI_Janx.SerializeData(Original);
|
||||
|
||||
Port = 5560;
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Address = "tcp://127.0.0.1:5560";
|
||||
ClientObject = OPI_ZeroMQ.CreateConnectionReq(Address);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
OPI_ZeroMQ.SendData(ClientObject, JanxData , 3000);
|
||||
ServerRequest = OPI_ZeroMQ.ReceiveData(ServerObject, 3000);
|
||||
OPI_ZeroMQ.SendData(ServerObject, ServerRequest["data"], 3000);
|
||||
ClientResponse = OPI_ZeroMQ.ReceiveData(ClientObject, 3000);
|
||||
Restored = OPI_Janx.DeserializeData(ClientResponse["data"]);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(ClientResponse, "ZeroMQ", "Extended_JanxCollectionExchange", , Restored, Original, JanxData);
|
||||
OPI_ZeroMQ.CloseConnection(ClientObject);
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // ZeroMQ
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
@@ -155,6 +155,24 @@ Procedure FT_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FT_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetFTPParameterOptions()[0];
|
||||
|
||||
FTP_Extended_GetGreetingWithoutConnection(TestParameters);
|
||||
FTP_Extended_ConnectionWithoutAddress(TestParameters);
|
||||
FTP_Extended_Reconnection(TestParameters);
|
||||
FTP_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // FTP
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -2082,6 +2100,100 @@ Procedure FTP_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure FTP_Extended_GetGreetingWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("FTP");
|
||||
Options = New Structure;
|
||||
Options.Insert("conn", Connector);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("ftp", "GetWelcomeMessage", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "FTP", "Extended_GetGreetingWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_ConnectionWithoutAddress(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("FTP");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "FTP", "Extended_ConnectionWithoutAddress");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Host = FunctionParameters["FTP_IP"];
|
||||
Port = FunctionParameters["FTP_Port"];
|
||||
Login = FunctionParameters["FTP_User"];
|
||||
Password = FunctionParameters["FTP_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("host", Host);
|
||||
Options.Insert("port", Port);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
FTPSettings = OPI_TestDataRetrieval.ExecuteTestCLI("ftp", "GetConnectionSettings", Options);
|
||||
|
||||
Connection = OPI_FTP.CreateConnection(FTPSettings);
|
||||
|
||||
If Not OPI_FTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "FTP", "Extended_Reconnection");
|
||||
OPI_FTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_FTP.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Host = FunctionParameters["FTP_IP"];
|
||||
Port = FunctionParameters["FTP_Port"];
|
||||
Login = FunctionParameters["FTP_User"];
|
||||
Password = FunctionParameters["FTP_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("host", Host);
|
||||
Options.Insert("port", Port);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
FTPSettings = OPI_TestDataRetrieval.ExecuteTestCLI("ftp", "GetConnectionSettings", Options);
|
||||
|
||||
Connection = OPI_FTP.CreateConnection(FTPSettings, , , LoggingSettings);
|
||||
|
||||
If Not OPI_FTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_FTP.GetWelcomeMessage(Connection);
|
||||
|
||||
Result = OPI_FTP.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "FTP", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_FTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // FTP
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -2103,4 +2215,8 @@ Procedure FT_ОсновныеМетоды() Export
|
||||
FT_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure FT_РасширеннаяПроверка() Export
|
||||
FT_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
+178
-1
@@ -118,6 +118,30 @@ Procedure GR_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_Address" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_AddressNoTls", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_Proto" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_ProtoTS" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_ProtoImport" , TestParameters);
|
||||
|
||||
GRPC_Extended_CallMethodWithoutConnection(TestParameters);
|
||||
GRPC_Extended_ConnectionWithoutAddress(TestParameters);
|
||||
GRPC_Extended_Reconnection(TestParameters);
|
||||
GRPC_Extended_GetLogOnConnection(TestParameters);
|
||||
GRPC_Extended_CallMethodMultipleBinaryFields(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_Introspection() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -458,7 +482,7 @@ Procedure GRPC_ExecuteMethod(FunctionParameters)
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "ExecuteMethod");
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "ExecuteMethod", , Data);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("conn", Parameters);
|
||||
@@ -557,6 +581,155 @@ Procedure GRPC_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure GRPC_Extended_CallMethodWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("GRPC");
|
||||
Request = OPI_AddIns.SerializeJanx(New Structure);
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Call(Request));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "Extended_CallMethodWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_ConnectionWithoutAddress(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("GRPC");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "Extended_ConnectionWithoutAddress");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("proto", Scheme);
|
||||
|
||||
Parameters = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetConnectionParameters", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
Tls = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetTlsSettings", Options);
|
||||
|
||||
Connection = OPI_GRPC.CreateConnection(Parameters, Tls);
|
||||
|
||||
If Not OPI_GRPC.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "Extended_Reconnection");
|
||||
OPI_GRPC.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_GRPC.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("proto", Scheme);
|
||||
|
||||
Parameters = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetConnectionParameters", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
Tls = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetTlsSettings", Options);
|
||||
|
||||
Connection = OPI_GRPC.CreateConnection(Parameters, Tls, LoggingSettings);
|
||||
|
||||
If Not OPI_GRPC.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_GRPC.ExecuteMethod(Connection, "grpcbin.GRPCBin", "DummyUnary");
|
||||
|
||||
Result = OPI_GRPC.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_GRPC.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_CallMethodMultipleBinaryFields(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("proto", Scheme);
|
||||
|
||||
Parameters = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetConnectionParameters", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
Tls = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetTlsSettings", Options);
|
||||
|
||||
BinData = OPI_TestDataRetrieval.GetJanxTestCollection("BinariesArray");
|
||||
|
||||
Data = New Map;
|
||||
Data.Insert("f_string", "janx multi-bin");
|
||||
Data.Insert("f_int32" , 7);
|
||||
Data.Insert("f_bool" , True);
|
||||
Data.Insert("f_bytes" , BinData["chunks"][0]);
|
||||
Data.Insert("f_bytess", BinData["chunks"]);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("conn", Parameters);
|
||||
Options.Insert("service", "grpcbin.GRPCBin");
|
||||
Options.Insert("method", "DummyUnary");
|
||||
Options.Insert("data", Data);
|
||||
Options.Insert("tls", Tls);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "ExecuteMethod", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "Extended_CallMethodMultipleBinaryFields", , Data);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure GRPC_GetServiceList(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
@@ -1346,6 +1519,10 @@ Procedure GR_ОсновныеМетоды() Export
|
||||
GR_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_РасширеннаяПроверка() Export
|
||||
GR_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_Интроспекция() Export
|
||||
GR_Introspection();
|
||||
EndProcedure
|
||||
|
||||
@@ -107,6 +107,23 @@ Procedure Jnx_Benchmark() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Jnx_ExtendedDataCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Janx_Extended_RoundRobinMultipleBinaryFields();
|
||||
Janx_Extended_RoundRobinBinariesArray();
|
||||
Janx_Extended_RoundRobinMixedArray();
|
||||
Janx_Extended_RoundRobinDeepNesting();
|
||||
Janx_Extended_RoundRobinEmptyAndSpecial();
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // Janx
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -376,6 +393,100 @@ Procedure Janx_Benchmark()
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedDataCheck
|
||||
|
||||
Procedure Janx_Extended_RoundRobinMultipleBinaryFields()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", Result);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Janx", "Extended_RoundRobin", "MultipleBinaries", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinBinariesArray()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("BinariesArray");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", Result);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Janx", "Extended_RoundRobin", "BinariesArray", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinMixedArray()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MixedArray");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", Result);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Janx", "Extended_RoundRobin", "MixedArray", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinDeepNesting()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("DeepNesting");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", Result);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Janx", "Extended_RoundRobin", "DeepNesting", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinEmptyAndSpecial()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("EmptyAndSpecial");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", Result);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Janx", "Extended_RoundRobin", "EmptyAndSpecial", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedDataCheck
|
||||
|
||||
#EndRegion // Janx
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -393,4 +504,8 @@ Procedure Jnx_Бенчмарк() Export
|
||||
Jnx_Benchmark();
|
||||
EndProcedure
|
||||
|
||||
Procedure Jnx_РасширеннаяПроверкаДанные() Export
|
||||
Jnx_ExtendedDataCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -0,0 +1,428 @@
|
||||
// OneScript: ./OInt/tests/Modules/OPItc_Lua.os
|
||||
|
||||
// MIT License
|
||||
|
||||
// Copyright (c) 2023-2026 Anton Tsitavets
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
// https://github.com/Bayselonarrend/OpenIntegrations
|
||||
|
||||
// Test suite for YAxUnit
|
||||
|
||||
// BSLLS:Typo-off
|
||||
// BSLLS:LatinAndCyrillicSymbolInWord-off
|
||||
// BSLLS:IncorrectLineBreak-off
|
||||
// BSLLS:UsingServiceTag-off
|
||||
// BSLLS:UnusedParameters-off
|
||||
// BSLLS:DuplicateStringLiteral-off
|
||||
// BSLLS:UsingHardcodePath-off
|
||||
// BSLLS:UnusedLocalVariable-off
|
||||
// BSLLS:DeprecatedMessage-off
|
||||
// BSLLS:LineLength-off
|
||||
// BSLLS:MagicNumber-off
|
||||
// BSLLS:CommentedCode-off
|
||||
// BSLLS:AssignAliasFieldsInQuery-off
|
||||
// BSLLS:UsingHardcodeNetworkAddress-off
|
||||
// BSLLS:UnreachableCode-off
|
||||
// BSLLS:UnusedLocalMethod-off
|
||||
// BSLLS:NestedFunctionInParameters-off
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
// BSLLS:UsingSynchronousCalls-off
|
||||
// BSLLS:MagicDate-off
|
||||
// BSLLS:MissingParameterDescription-off
|
||||
// BSLLS:NumberOfOptionalParams-off
|
||||
// BSLLS:MethodSize-off
|
||||
// BSLLS:NestedConstructorsInStructureDeclaration-off
|
||||
// BSLLS:NumberOfValuesInStructureConstructor-off
|
||||
// BSLLS:UsingHardcodeSecretInformation-off
|
||||
// BSLLS:SpaceAtStartComment-off
|
||||
|
||||
//@skip-check undefined-variable
|
||||
//@skip-check wrong-string-literal-content
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
//@skip-check undefined-function-or-procedure
|
||||
//@skip-check module-unused-local-variable
|
||||
//@skip-check bsl-legacy-check-string-literal
|
||||
//@skip-check bsl-legacy-check-method-for-statements-after-return
|
||||
//@skip-check missing-temporary-file-deletion
|
||||
//@skip-check module-unused-method
|
||||
|
||||
//#Use "../../tools/main"
|
||||
//#Use "../../tools/http"
|
||||
//#Use "../../api"
|
||||
//#Use asserts
|
||||
//#Use "internal"
|
||||
|
||||
|
||||
// For YAxUnit
|
||||
|
||||
Procedure ИсполняемыеСценарии() Export
|
||||
|
||||
OPI_TestDataRetrieval.FormYAXTestsCLI("Lua");
|
||||
|
||||
EndProcedure
|
||||
|
||||
// For Asserts
|
||||
|
||||
Function ПолучитьСписокТестов(UnitTesting) Export
|
||||
|
||||
Return OPI_TestDataRetrieval.FormAssertsTestsCLI("Lua");
|
||||
|
||||
EndFunction
|
||||
|
||||
#Region Internal
|
||||
|
||||
#Region RunnableTests
|
||||
|
||||
#Region Lua
|
||||
|
||||
Procedure Lua_CommonMethods() Export
|
||||
|
||||
Lua_CreateVM();
|
||||
Lua_IsVM();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_WorkingWithScripts() Export
|
||||
|
||||
Lua_ExecuteCodeFromString();
|
||||
Lua_ExecuteCodeFromFile();
|
||||
Lua_CallFunction();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_BytecodeManagement() Export
|
||||
|
||||
Lua_CompileCodeFromString();
|
||||
Lua_CompileCodeFromFile();
|
||||
Lua_ExecuteBytecode();
|
||||
Lua_ExecuteBytecodeFromFile();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Lua_Extended_CodeExecutionError();
|
||||
Lua_Extended_GetLogWithoutInitialization();
|
||||
Lua_Extended_GetLogOnExecution();
|
||||
Lua_Extended_PassComplexData();
|
||||
Lua_Extended_PassArrayOfMixedTypes();
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // Lua
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
|
||||
#EndRegion // Internal
|
||||
|
||||
#Region Private
|
||||
|
||||
#Region AtomicTests
|
||||
|
||||
#Region Lua
|
||||
|
||||
Procedure Lua_CreateVM()
|
||||
|
||||
Result = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "CreateVM", "Lua54");
|
||||
|
||||
Result = OPI_Lua.CreateVM("LuaJIT");
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "CreateVM", "LuaJIT");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_IsVM()
|
||||
|
||||
VM54 = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
Result = OPI_Lua.IsVM(VM54);
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "IsVM", "Lua54"); // SKIP
|
||||
|
||||
Result = OPI_Lua.IsVM("not a vm");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "IsVM", "False");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteCodeFromString()
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("code", "return 42");
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "ExecuteCodeFromString", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "ExecuteCodeFromString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteCodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 7").Write(ScriptFile);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("path", ScriptFile);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "ExecuteCodeFromFile", Options);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "ExecuteCodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CallFunction()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function add(a, b) return a + b end");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(1);
|
||||
Parameters.Add(2);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", VM);
|
||||
Options.Insert("func", "add");
|
||||
Options.Insert("params", Parameters);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CallFunction", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "CallFunction");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CompileCodeFromString()
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("code", "return 1");
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CompileCodeFromString", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "CompileCodeFromString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CompileCodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 3").Write(ScriptFile);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("path", ScriptFile);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CompileCodeFromFile", Options);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "CompileCodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteBytecode()
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("code", "return 11");
|
||||
|
||||
Bytecode = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CompileCodeFromString", Options);
|
||||
Result = OPI_Lua.ExecuteBytecode("Lua54", Bytecode);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "ExecuteBytecode");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteBytecodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 13").Write(ScriptFile);
|
||||
|
||||
BytecodeFile = GetTempFileName("bin");
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("path", ScriptFile);
|
||||
|
||||
Bytecode = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CompileCodeFromFile", Options);
|
||||
Bytecode.Write(BytecodeFile);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("path", BytecodeFile);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "ExecuteBytecodeFromFile", Options);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile , "Failed to delete the temporary file after the test!!");
|
||||
OPI_Tools.RemoveFileWithTry(BytecodeFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "ExecuteBytecodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure Lua_Extended_CodeExecutionError()
|
||||
|
||||
AddIn = OPI_AddIns.GetAddIn("Lua54");
|
||||
Result = OPI_AddIns.DesrializeJanx(AddIn.ExecuteString("syntax error !!!"));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "Extended_CodeExecutionError");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_GetLogWithoutInitialization()
|
||||
|
||||
AddIn = OPI_Lua.CreateVM("Lua54");
|
||||
Result = OPI_AddIns.DesrializeJanx(AddIn.GetLogs(10));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "Extended_GetLogWithoutInitialization");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_GetLogOnExecution()
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_AddIns.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54", LoggingSettings);
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "return 1");
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(VM.GetLogs(10));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "Extended_GetLogOnExecution", , LogFile);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_PassComplexData()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function echo(v) return v end");
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("LuaComplexData");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(Original);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", VM);
|
||||
Options.Insert("func", "echo");
|
||||
Options.Insert("params", Parameters);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CallFunction", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "Extended_PassComplexData", , Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_PassArrayOfMixedTypes()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function echo(v) return v end");
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("LuaMixedArray");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(Original);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", VM);
|
||||
Options.Insert("func", "echo");
|
||||
Options.Insert("params", Parameters);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CallFunction", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "Extended_PassArrayOfMixedTypes", , Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // Lua
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
#EndRegion // Private
|
||||
|
||||
|
||||
#Region Alternate
|
||||
|
||||
Procedure Lua_ОсновныеМетоды() Export
|
||||
Lua_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_РаботаСоСкриптами() Export
|
||||
Lua_WorkingWithScripts();
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_РаботаСБайткодом() Export
|
||||
Lua_BytecodeManagement();
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_РасширеннаяПроверка() Export
|
||||
Lua_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="302ee892-dbf6-4eee-b19e-1ccf7e22bea6">
|
||||
<name>OPItc_Lua</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Lua</value>
|
||||
</synonym>
|
||||
<clientManagedApplication>true</clientManagedApplication>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
@@ -115,6 +115,26 @@ Procedure MSS_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("PG_IP" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("PG_Password", TestParameters);
|
||||
|
||||
MSSQL_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
MSSQL_Extended_ConnectionWithoutString(TestParameters);
|
||||
MSSQL_Extended_Reconnection(TestParameters);
|
||||
MSSQL_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_ORM() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -449,6 +469,113 @@ Procedure MSSQL_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure MSSQL_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
Options = New Structure;
|
||||
Options.Insert("sql", "SELECT 1");
|
||||
Options.Insert("dbc", Connector);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("mssql", "ExecuteSQLQuery", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MSSQL", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MSSQL", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "SA";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("mssql", "GenerateConnectionString", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
TLSSettings = OPI_TestDataRetrieval.ExecuteTestCLI("mssql", "GetTLSSettings", Options);
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
|
||||
TLSSetup = OPI_AddIns.SetTls(Connector, TLSSettings);
|
||||
If Not OPI_Tools.GetOr(TLSSetup, "result", False) Then
|
||||
Raise OPI_Tools.JSONString(TLSSetup);
|
||||
EndIf;
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MSSQL", "Extended_Reconnection");
|
||||
OPI_MSSQL.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_MSSQL.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "SA";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("mssql", "GenerateConnectionString", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
TLSSettings = OPI_TestDataRetrieval.ExecuteTestCLI("mssql", "GetTLSSettings", Options);
|
||||
|
||||
Connection = OPI_MSSQL.CreateConnection(ConnectionString, TLSSettings, LoggingSettings);
|
||||
|
||||
If Not OPI_MSSQL.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_MSSQL.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_MSSQL.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MSSQL", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_MSSQL.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure MSSQL_CreateDatabase(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
@@ -1447,4 +1574,8 @@ Procedure MSS_ОсновныеМетоды() Export
|
||||
MSS_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_РасширеннаяПроверка() Export
|
||||
MSS_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -267,8 +267,9 @@ Procedure MessagePack_SerializeData()
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MessagePack", "SerializeData", "False");
|
||||
|
||||
Data = GetBinaryDataFromHexString("");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", GetBinaryDataFromHexString);
|
||||
Options.Insert("value", Data);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("msgpack", "SerializeData", Options);
|
||||
|
||||
|
||||
@@ -115,6 +115,28 @@ Procedure Mongo_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Mongo_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_Port" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_User" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_Password", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_DB" , TestParameters);
|
||||
|
||||
MongoDB_Extended_ExecuteCommandWithoutConnection(TestParameters);
|
||||
MongoDB_Extended_ConnectionWithoutString(TestParameters);
|
||||
MongoDB_Extended_Reconnection(TestParameters);
|
||||
MongoDB_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Mong_DatabaseManagement() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -427,6 +449,110 @@ Procedure MongoDB_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure MongoDB_Extended_ExecuteCommandWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MongoDB");
|
||||
Options = New Structure;
|
||||
Options.Insert("dbc", Connector);
|
||||
Options.Insert("comm", "listDatabases");
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("mongodb", "ExecuteCommand", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MongoDB", "Extended_ExecuteCommandWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MongoDB_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MongoDB");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MongoDB", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MongoDB_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = "127.0.0.1:1234";
|
||||
Login = FunctionParameters["MongoDB_User"];
|
||||
Password = FunctionParameters["MongoDB_Password"];
|
||||
Base = FunctionParameters["MongoDB_DB"];
|
||||
|
||||
Address = OPI_TestDataRetrieval.GetLocalhost() + ":" + FunctionParameters["MongoDB_Port"];
|
||||
|
||||
ConnectionParams = New Structure("authSource", "admin");
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("db", Base);
|
||||
Options.Insert("usr", Login);
|
||||
Options.Insert("pwd", Password);
|
||||
Options.Insert("params", ConnectionParams);
|
||||
|
||||
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("mongodb", "GenerateConnectionString", Options);
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MongoDB");
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MongoDB", "Extended_Reconnection");
|
||||
OPI_MongoDB.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MongoDB_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_MongoDB.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = "127.0.0.1:1234";
|
||||
Login = FunctionParameters["MongoDB_User"];
|
||||
Password = FunctionParameters["MongoDB_Password"];
|
||||
|
||||
Address = OPI_TestDataRetrieval.GetLocalhost() + ":" + FunctionParameters["MongoDB_Port"];
|
||||
|
||||
ConnectionParams = New Structure("authSource", "admin");
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("usr", Login);
|
||||
Options.Insert("pwd", Password);
|
||||
Options.Insert("params", ConnectionParams);
|
||||
|
||||
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("mongodb", "GenerateConnectionString", Options);
|
||||
|
||||
Connection = OPI_MongoDB.CreateConnection(ConnectionString, LoggingSettings);
|
||||
|
||||
If Not OPI_MongoDB.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_MongoDB.ExecuteCommand(Connection, "listDatabases", , , New Structure("nameOnly", True));
|
||||
|
||||
Result = OPI_MongoDB.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MongoDB", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_MongoDB.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure MongoDB_GetDatabase(FunctionParameters)
|
||||
|
||||
Address = "127.0.0.1:1234";
|
||||
@@ -2071,6 +2197,10 @@ Procedure Mongo_ОсновныеМетоды() Export
|
||||
Mongo_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure Mongo_РасширеннаяПроверка() Export
|
||||
Mongo_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
Procedure Mongo_РаботаСБазами() Export
|
||||
Mong_DatabaseManagement();
|
||||
EndProcedure
|
||||
|
||||
@@ -115,6 +115,24 @@ Procedure MYS_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MYS_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetMySQLParameterOptions()[0];
|
||||
|
||||
MySQL_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
MySQL_Extended_ConnectionWithoutString(TestParameters);
|
||||
MySQL_Extended_Reconnection(TestParameters);
|
||||
MySQL_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MYS_ORM() Export
|
||||
|
||||
OptionArray = OPI_TestDataRetrieval.GetMySQLParameterOptions();
|
||||
@@ -1397,6 +1415,137 @@ Procedure MySQL_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure MySQL_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MySQL");
|
||||
Options = New Structure;
|
||||
Options.Insert("sql", "SELECT 1");
|
||||
Options.Insert("dbc", Connector);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("mysql", "ExecuteSQLQuery", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MySQL", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MySQL_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MySQL");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MySQL", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MySQL_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("db", Base);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
Options.Insert("port", Port);
|
||||
|
||||
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("mysql", "GenerateConnectionString", Options);
|
||||
|
||||
If TLS Then
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
TLSSettings = OPI_TestDataRetrieval.ExecuteTestCLI("mysql", "GetTLSSettings", Options);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MySQL");
|
||||
|
||||
If TLS Then
|
||||
TLSSetup = OPI_AddIns.SetTls(Connector, TLSSettings);
|
||||
If Not OPI_Tools.GetOr(TLSSetup, "result", False) Then
|
||||
Raise OPI_Tools.JSONString(TLSSetup);
|
||||
EndIf;
|
||||
EndIf;
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MySQL", "Extended_Reconnection");
|
||||
OPI_MySQL.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MySQL_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_MySQL.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("db", Base);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
Options.Insert("port", Port);
|
||||
|
||||
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("mysql", "GenerateConnectionString", Options);
|
||||
|
||||
If TLS Then
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
TLSSettings = OPI_TestDataRetrieval.ExecuteTestCLI("mysql", "GetTLSSettings", Options);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connection = OPI_MySQL.CreateConnection(ConnectionString, TLSSettings, LoggingSettings);
|
||||
|
||||
If Not OPI_MySQL.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_MySQL.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_MySQL.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MySQL", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_MySQL.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure MySQL_GetTableInformation(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
@@ -1682,4 +1831,8 @@ Procedure MYS_ОсновныеМетоды() Export
|
||||
MYS_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure MYS_РасширеннаяПроверка() Export
|
||||
MYS_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -115,6 +115,24 @@ Procedure Postgres_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Postgres_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetPostgresParameterOptions()[0];
|
||||
|
||||
PostgreSQL_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
PostgreSQL_Extended_ConnectionWithoutString(TestParameters);
|
||||
PostgreSQL_Extended_Reconnection(TestParameters);
|
||||
PostgreSQL_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Postgres_ORM() Export
|
||||
|
||||
OptionArray = OPI_TestDataRetrieval.GetPostgresParameterOptions();
|
||||
@@ -1539,6 +1557,137 @@ Procedure PostgreSQL_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure PostgreSQL_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("PostgreSQL");
|
||||
Options = New Structure;
|
||||
Options.Insert("sql", "SELECT 1");
|
||||
Options.Insert("dbc", Connector);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("postgres", "ExecuteSQLQuery", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "PostgreSQL", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure PostgreSQL_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("PostgreSQL");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "PostgreSQL", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure PostgreSQL_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "postgres";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("db", Base);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
Options.Insert("port", Port);
|
||||
|
||||
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("postgres", "GenerateConnectionString", Options);
|
||||
|
||||
If TLS Then
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
TLSSettings = OPI_TestDataRetrieval.ExecuteTestCLI("postgres", "GetTLSSettings", Options);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("PostgreSQL");
|
||||
|
||||
If TLS Then
|
||||
TLSSetup = OPI_AddIns.SetTls(Connector, TLSSettings);
|
||||
If Not OPI_Tools.GetOr(TLSSetup, "result", False) Then
|
||||
Raise OPI_Tools.JSONString(TLSSetup);
|
||||
EndIf;
|
||||
EndIf;
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "PostgreSQL", "Extended_Reconnection");
|
||||
OPI_PostgreSQL.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure PostgreSQL_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_PostgreSQL.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "postgres";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("db", Base);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
Options.Insert("port", Port);
|
||||
|
||||
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("postgres", "GenerateConnectionString", Options);
|
||||
|
||||
If TLS Then
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
TLSSettings = OPI_TestDataRetrieval.ExecuteTestCLI("postgres", "GetTLSSettings", Options);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connection = OPI_PostgreSQL.CreateConnection(ConnectionString, TLSSettings, LoggingSettings);
|
||||
|
||||
If Not OPI_PostgreSQL.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_PostgreSQL.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_PostgreSQL.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "PostgreSQL", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_PostgreSQL.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure PostgreSQL_AddTableColumn(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
@@ -1751,4 +1900,8 @@ Procedure Postgres_ОсновныеМетоды() Export
|
||||
Postgres_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure Postgres_РасширеннаяПроверка() Export
|
||||
Postgres_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -111,6 +111,25 @@ Procedure RC_CommandsExecution() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure RC_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("RCON_URL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("RCON_Password", TestParameters);
|
||||
|
||||
RCON_Extended_ExecuteCommandWithoutConnection(TestParameters);
|
||||
RCON_Extended_Reconnection(TestParameters);
|
||||
RCON_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // RCON
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -289,6 +308,76 @@ Procedure RCON_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure RCON_Extended_ExecuteCommandWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("RCON");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Command("list"));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "RCON", "Extended_ExecuteCommandWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure RCON_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
URL = FunctionParameters["RCON_URL"];
|
||||
Password = FunctionParameters["RCON_Password"];
|
||||
WriteTimeout = 20;
|
||||
ReadTimeout = 20;
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("RCON");
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect(URL, Password, ReadTimeout, WriteTimeout));
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect(URL, Password, ReadTimeout, WriteTimeout));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "RCON", "Extended_Reconnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure RCON_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_RCON.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
URL = FunctionParameters["RCON_URL"];
|
||||
Password = FunctionParameters["RCON_Password"];
|
||||
WriteTimeout = 20;
|
||||
ReadTimeout = 20;
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("url", URL);
|
||||
Options.Insert("pass", Password);
|
||||
Options.Insert("rtout", ReadTimeout);
|
||||
Options.Insert("wtout", WriteTimeout);
|
||||
|
||||
ConnectionParams = OPI_TestDataRetrieval.ExecuteTestCLI("rcon", "FormConnectionParameters", Options);
|
||||
Connection = OPI_RCON.CreateConnection(ConnectionParams, LoggingSettings);
|
||||
|
||||
If Not OPI_RCON.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_RCON.ExecuteCommand("list", Connection);
|
||||
|
||||
Result = OPI_RCON.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "RCON", "Extended_GetLogOnConnection", , LogFile);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // RCON
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -302,4 +391,8 @@ Procedure RC_ВыполнениеКоманд() Export
|
||||
RC_CommandsExecution();
|
||||
EndProcedure
|
||||
|
||||
Procedure RC_РасширеннаяПроверка() Export
|
||||
RC_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -154,6 +154,26 @@ Procedure SF_FileManagement() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SF_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetSSHParameterOptions()[0];
|
||||
|
||||
SFTP_Extended_GetListWithoutConnection(TestParameters);
|
||||
SFTP_Extended_ConnectionWithoutSettings(TestParameters);
|
||||
SFTP_Extended_Reconnection(TestParameters);
|
||||
SFTP_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(TestParameters["SSH_Key"], "Error deleting file after test");
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // SFTP
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -1759,6 +1779,100 @@ Procedure SFTP_GetFileInformation(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure SFTP_Extended_GetListWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Options = New Structure;
|
||||
Options.Insert("conn", Connector);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("sftp", "ListObjects", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SFTP", "Extended_GetListWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SFTP_Extended_ConnectionWithoutSettings(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SFTP", "Extended_ConnectionWithoutSettings");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SFTP_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Host = FunctionParameters["SSH_Host"];
|
||||
Port = FunctionParameters["SSH_Port"];
|
||||
Login = FunctionParameters["SSH_User"];
|
||||
Password = FunctionParameters["SSH_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("host", Host);
|
||||
Options.Insert("port", Port);
|
||||
Options.Insert("user", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
SFTPSettings = OPI_TestDataRetrieval.ExecuteTestCLI("sftp", "GetSettingsLoginPassword", Options);
|
||||
|
||||
Connection = OPI_SFTP.CreateConnection(SFTPSettings);
|
||||
|
||||
If Not OPI_SFTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SFTP", "Extended_Reconnection");
|
||||
OPI_SFTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SFTP_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_SSH.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Host = FunctionParameters["SSH_Host"];
|
||||
Port = FunctionParameters["SSH_Port"];
|
||||
Login = FunctionParameters["SSH_User"];
|
||||
Password = FunctionParameters["SSH_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("host", Host);
|
||||
Options.Insert("port", Port);
|
||||
Options.Insert("user", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
SFTPSettings = OPI_TestDataRetrieval.ExecuteTestCLI("sftp", "GetSettingsLoginPassword", Options);
|
||||
|
||||
Connection = OPI_SSH.CreateConnection(SFTPSettings, , LoggingSettings);
|
||||
|
||||
If Not OPI_SFTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SFTP.ListObjects(Connection, "");
|
||||
|
||||
Result = OPI_SSH.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SFTP", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_SFTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // SFTP
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -1780,4 +1894,8 @@ Procedure SF_РаботаСФайлами() Export
|
||||
SF_FileManagement();
|
||||
EndProcedure
|
||||
|
||||
Procedure SF_РасширеннаяПроверка() Export
|
||||
SF_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -120,6 +120,24 @@ Procedure SQLL_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLL_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
SQLite_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
SQLite_Extended_Reconnection(TestParameters);
|
||||
SQLite_Extended_GetLogOnConnection(TestParameters);
|
||||
SQLite_Extended_RequestWithTwoBlobs(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLL_ORM() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -1033,6 +1051,109 @@ Procedure SQLite_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure SQLite_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SQLite");
|
||||
Options = New Structure;
|
||||
Options.Insert("sql", "SELECT 1");
|
||||
Options.Insert("db", Connector);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("sqlite", "ExecuteSQLQuery", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SQLite", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLite_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
TFN = GetTempFileName("sqlite");
|
||||
Connector = OPI_AddIns.GetAddIn("SQLite");
|
||||
|
||||
Connector.Database = TFN;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SQLite", "Extended_Reconnection");
|
||||
OPI_SQLite.CloseConnection(Connector);
|
||||
OPI_Tools.RemoveFileWithTry(TFN, "Database file deletion error");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLite_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_SQLite.GetLoggingSettings(True, 100, LogFile);
|
||||
TFN = GetTempFileName("sqlite");
|
||||
|
||||
Connection = OPI_SQLite.CreateConnection(TFN, LoggingSettings);
|
||||
|
||||
If Not OPI_SQLite.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SQLite.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_SQLite.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SQLite", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_SQLite.CloseConnection(Connection);
|
||||
OPI_Tools.RemoveFileWithTry(TFN, "Database file deletion error");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLite_Extended_RequestWithTwoBlobs(FunctionParameters)
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
TFN = GetTempFileName("sqlite");
|
||||
|
||||
Connection = OPI_SQLite.CreateConnection(TFN);
|
||||
|
||||
If Not OPI_SQLite.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SQLite.ExecuteSQLQuery("DROP TABLE IF EXISTS janx_blob_test", , , Connection);
|
||||
OPI_SQLite.ExecuteSQLQuery("CREATE TABLE janx_blob_test (
|
||||
|alpha BLOB,
|
||||
|beta BLOB,
|
||||
|inner_blob BLOB)", , , Connection);
|
||||
|
||||
ParameterArray = New Array;
|
||||
ParameterArray.Add(New Structure("blob", Original["alpha"]));
|
||||
ParameterArray.Add(New Structure("blob", Original["beta"]));
|
||||
ParameterArray.Add(New Structure("blob", Original["nested"]["inner"]));
|
||||
|
||||
OPI_SQLite.ExecuteSQLQuery("INSERT INTO janx_blob_test (alpha, beta, inner_blob) VALUES (?, ?, ?)", ParameterArray, , Connection);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("sql", "SELECT alpha, beta, inner_blob FROM janx_blob_test");
|
||||
Options.Insert("db", Connection);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("sqlite", "ExecuteSQLQuery", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SQLite", "Extended_RequestWithTwoBlobs", , Original);
|
||||
OPI_SQLite.CloseConnection(Connection);
|
||||
OPI_Tools.RemoveFileWithTry(TFN, "Database file deletion error");
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // SQLite
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -1046,4 +1167,8 @@ Procedure SQLL_ОсновныеМетоды() Export
|
||||
SQLL_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLL_РасширеннаяПроверка() Export
|
||||
SQLL_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -121,6 +121,23 @@ Procedure SShell_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SShell_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetSSHParameterOptions()[0];
|
||||
|
||||
SSH_Extended_ExecuteCommandWithoutConnection(TestParameters);
|
||||
SSH_Extended_ConnectionWithoutSettings(TestParameters);
|
||||
SSH_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // SSH
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -836,6 +853,70 @@ Procedure SSH_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure SSH_Extended_ExecuteCommandWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Options = New Structure;
|
||||
Options.Insert("conn", Connector);
|
||||
Options.Insert("comm", "whoami");
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("ssh", "ExecuteCommand", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SSH", "Extended_ExecuteCommandWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SSH_Extended_ConnectionWithoutSettings(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SSH", "Extended_ConnectionWithoutSettings");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SSH_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_SSH.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Host = FunctionParameters["SSH_Host"];
|
||||
Port = FunctionParameters["SSH_Port"];
|
||||
Login = FunctionParameters["SSH_User"];
|
||||
Password = FunctionParameters["SSH_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("host", Host);
|
||||
Options.Insert("port", Port);
|
||||
Options.Insert("user", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
SSHSettings = OPI_TestDataRetrieval.ExecuteTestCLI("ssh", "GetSettingsLoginPassword", Options);
|
||||
Connection = OPI_SSH.CreateConnection(SSHSettings, , LoggingSettings);
|
||||
|
||||
If Not OPI_SSH.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SSH.ExecuteCommand(Connection, "whoami");
|
||||
|
||||
Result = OPI_SSH.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "SSH", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_SSH.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // SSH
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -849,4 +930,8 @@ Procedure SShell_ОсновныеМетоды() Export
|
||||
SShell_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure SShell_РасширеннаяПроверка() Export
|
||||
SShell_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -147,6 +147,27 @@ Procedure TC_Server() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TC_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
TCP_Extended_GetDataOfNextTimeout(TestParameters);
|
||||
TCP_Extended_OperationWithoutStart(TestParameters);
|
||||
TCP_Extended_GetLogOnServerStart(TestParameters);
|
||||
TCP_Extended_ReadTimeout(TestParameters);
|
||||
TCP_Extended_OperationWithoutConnection(TestParameters);
|
||||
TCP_Extended_GetLogOnConnectionOpening(TestParameters);
|
||||
TCP_Extended_JanxCollectionExchange(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // TCP
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -856,6 +877,186 @@ Procedure TCP_GetLoggingSettings(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure TCP_Extended_GetDataOfNextTimeout(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
ServerObject = OPI_TCP.StartServer(Port);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_TCP.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "TCP", "Extended_GetDataOfNextTimeout");
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_OperationWithoutStart(FunctionParameters)
|
||||
|
||||
ServerObject = OPI_AddIns.GetAddIn(OPI_TCP.AddInName());
|
||||
|
||||
Result = OPI_TCP.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "TCP", "Extended_OperationWithoutStart");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_GetLogOnServerStart(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_TCP.GetLoggingSettings(True, 100, LogFile);
|
||||
ServerObject = OPI_TCP.StartServer(Port, , LoggingSettings);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ConnectionAddress = "127.0.0.1:9876";
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("TCP_LOG_SRV_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
OPI_TCP.SendLine(ClientObject, Message + Chars.LF);
|
||||
OPI_TCP.GetNextConnectionData(ServerObject, 5000);
|
||||
|
||||
Result = OPI_TCP.GetLog(ServerObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "TCP", "Extended_GetLogOnServerStart", , LogFile);
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_ReadTimeout(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
ConnectionAddress = "127.0.0.1:9876";
|
||||
ServerObject = OPI_TCP.StartServer(Port);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Data = OPI_TCP.ReadBinaryData(ClientObject, , , 300);
|
||||
|
||||
Result = New Map;
|
||||
Result.Insert("result", Data.Size() = 0);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "TCP", "Extended_ReadTimeout");
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_OperationWithoutConnection(FunctionParameters)
|
||||
|
||||
ClientObject = OPI_AddIns.GetAddIn("TCPClient");
|
||||
Data = GetBinaryDataFromString("x");
|
||||
|
||||
OPI_TCP.SendBinaryData(ClientObject, Data, 300);
|
||||
Result = OPI_TCP.GetLastError(ClientObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "TCP", "Extended_OperationWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_GetLogOnConnectionOpening(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
ConnectionAddress = "127.0.0.1:9876";
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_TCP.GetLoggingSettings(True, 100, LogFile);
|
||||
ServerObject = OPI_TCP.StartServer(Port);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress, , , LoggingSettings);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("TCP_LOG_CLI_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
OPI_TCP.SendLine(ClientObject, Message + Chars.LF);
|
||||
OPI_TCP.GetNextConnectionData(ServerObject, 5000);
|
||||
|
||||
Result = OPI_TCP.GetLog(ClientObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "TCP", "Extended_GetLogOnConnectionOpening", , LogFile);
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_JanxCollectionExchange(FunctionParameters)
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
JanxData = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
|
||||
LaunchPort = 9879;
|
||||
ServerObject = OPI_TCP.StartServer(LaunchPort);
|
||||
|
||||
ConnectionAddress = "127.0.0.1:9879";
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
OPI_TCP.SendBinaryData(ClientObject, JanxData);
|
||||
|
||||
NextMessage = OPI_TCP.GetNextConnectionData(ServerObject, 5000);
|
||||
ConnectionID = NextMessage["connectionId"];
|
||||
|
||||
OPI_TCP.SendData(ServerObject, ConnectionID, NextMessage["message"]);
|
||||
|
||||
ClientResponse = OPI_TCP.ReadBinaryData(ClientObject, , , 5000);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", ClientResponse);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(ClientResponse, "TCP", "Extended_JanxCollectionExchange", , Restored, Original);
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // TCP
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -873,4 +1074,8 @@ Procedure TC_Сервер() Export
|
||||
TC_Server();
|
||||
EndProcedure
|
||||
|
||||
Procedure TC_РасширеннаяПроверка() Export
|
||||
TC_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -148,6 +148,23 @@ Procedure WS_Server() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WS_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
WebSocket_Extended_GetDataOfNextTimeout(TestParameters);
|
||||
WebSocket_Extended_OperationWithoutStart(TestParameters);
|
||||
WebSocket_Extended_GetLogOnServerStart(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // WebSocket
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -1098,6 +1115,72 @@ Procedure WebSocket_GetLoggingSettings(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure WebSocket_Extended_GetDataOfNextTimeout(FunctionParameters)
|
||||
|
||||
Port = 9893;
|
||||
ServerObject = OPI_WebSocket.StartServer(Port);
|
||||
|
||||
If Not OPI_WebSocket.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_WebSocket.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "WebSocket", "Extended_GetDataOfNextTimeout");
|
||||
OPI_WebSocket.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WebSocket_Extended_OperationWithoutStart(FunctionParameters)
|
||||
|
||||
ServerObject = OPI_AddIns.GetAddIn(OPI_WebSocket.AddInName());
|
||||
|
||||
Result = OPI_WebSocket.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "WebSocket", "Extended_OperationWithoutStart");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WebSocket_Extended_GetLogOnServerStart(FunctionParameters)
|
||||
|
||||
Port = 9893;
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_WebSocket.GetLoggingSettings(True, 100, LogFile);
|
||||
ServerObject = OPI_WebSocket.StartServer(Port, , LoggingSettings);
|
||||
|
||||
If Not OPI_WebSocket.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ConnectionAddress = "ws://127.0.0.1:9893";
|
||||
ClientObject = OPI_WebSocket.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_WebSocket.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("WS_LOG_SRV_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
OPI_WebSocket.SendTextMessage(ClientObject, Message);
|
||||
OPI_WebSocket.GetNextConnectionData(ServerObject, 5000);
|
||||
|
||||
Result = OPI_WebSocket.GetLog(ServerObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "WebSocket", "Extended_GetLogOnServerStart", , LogFile);
|
||||
OPI_WebSocket.CloseConnection(ClientObject);
|
||||
OPI_WebSocket.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // WebSocket
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -1131,4 +1214,8 @@ Procedure WS_Сервер() Export
|
||||
WS_Server();
|
||||
EndProcedure
|
||||
|
||||
Procedure WS_РасширеннаяПроверка() Export
|
||||
WS_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -139,6 +139,17 @@ Procedure ZMQ_InteractionMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZMQ_ExtendedCheck() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
ZeroMQ_Extended_GetTimeoutData(TestParameters);
|
||||
ZeroMQ_Extended_HandleTimeoutRequest(TestParameters);
|
||||
ZeroMQ_Extended_GetLogOnPortOpening(TestParameters);
|
||||
ZeroMQ_Extended_JanxCollectionExchange(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ZeroMQ
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -675,6 +686,130 @@ Procedure ZeroMQ_GetLoggingSettings(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure ZeroMQ_Extended_GetTimeoutData(FunctionParameters)
|
||||
|
||||
Port = 5555;
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_ZeroMQ.ReceiveData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "ZeroMQ", "Extended_GetTimeoutData");
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZeroMQ_Extended_HandleTimeoutRequest(FunctionParameters)
|
||||
|
||||
Port = 5555;
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Address = "tcp://127.0.0.1:5555";
|
||||
ClientObject = OPI_ZeroMQ.CreateConnectionReq(Address);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Request = StrTemplate("ZMQ_REQ_TO_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
ReqData = GetBinaryDataFromString(Request);
|
||||
Result = OPI_ZeroMQ.ProcessRequest(ClientObject, ReqData, 3000, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "ZeroMQ", "Extended_HandleTimeoutRequest");
|
||||
OPI_ZeroMQ.CloseConnection(ClientObject);
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZeroMQ_Extended_GetLogOnPortOpening(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_ZeroMQ.GetLoggingSettings(True, 100, LogFile);
|
||||
Port = 5555;
|
||||
Address = "tcp://127.0.0.1:5555";
|
||||
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port, LoggingSettings);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ClientObject = OPI_ZeroMQ.CreateConnectionReq(Address);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("ZMQ_LOG_BIND_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
Data = GetBinaryDataFromString(Message);
|
||||
|
||||
OPI_ZeroMQ.SendData(ClientObject, Data, 3000);
|
||||
OPI_ZeroMQ.ReceiveData(ServerObject, 3000);
|
||||
|
||||
Result = OPI_ZeroMQ.GetLog(ServerObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "ZeroMQ", "Extended_GetLogOnPortOpening", , LogFile);
|
||||
OPI_ZeroMQ.CloseConnection(ClientObject);
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZeroMQ_Extended_JanxCollectionExchange(FunctionParameters)
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
JanxData = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
|
||||
Port = 5560;
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Address = "tcp://127.0.0.1:5560";
|
||||
ClientObject = OPI_ZeroMQ.CreateConnectionReq(Address);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
OPI_ZeroMQ.SendData(ClientObject, JanxData , 3000);
|
||||
ServerRequest = OPI_ZeroMQ.ReceiveData(ServerObject, 3000);
|
||||
OPI_ZeroMQ.SendData(ServerObject, ServerRequest["data"], 3000);
|
||||
ClientResponse = OPI_ZeroMQ.ReceiveData(ClientObject, 3000);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", ClientResponse);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(ClientResponse, "ZeroMQ", "Extended_JanxCollectionExchange", , Restored, Original, JanxData);
|
||||
OPI_ZeroMQ.CloseConnection(ClientObject);
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // ZeroMQ
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -700,4 +835,8 @@ Procedure ZMQ_МетодыВзаимодействия() Export
|
||||
ZMQ_InteractionMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure ZMQ_РасширеннаяПроверка() Export
|
||||
ZMQ_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<commonModules>CommonModule.OPIt_GRPC</commonModules>
|
||||
<commonModules>CommonModule.OPIt_HTTP</commonModules>
|
||||
<commonModules>CommonModule.OPIt_Janx</commonModules>
|
||||
<commonModules>CommonModule.OPIt_Lua</commonModules>
|
||||
<commonModules>CommonModule.OPIt_MessagePack</commonModules>
|
||||
<commonModules>CommonModule.OPIt_MongoDB</commonModules>
|
||||
<commonModules>CommonModule.OPIt_MSSQL</commonModules>
|
||||
@@ -80,6 +81,7 @@
|
||||
<commonModules>CommonModule.OPItc_GRPC</commonModules>
|
||||
<commonModules>CommonModule.OPItc_HTTP</commonModules>
|
||||
<commonModules>CommonModule.OPItc_Janx</commonModules>
|
||||
<commonModules>CommonModule.OPItc_Lua</commonModules>
|
||||
<commonModules>CommonModule.OPItc_MessagePack</commonModules>
|
||||
<commonModules>CommonModule.OPItc_MongoDB</commonModules>
|
||||
<commonModules>CommonModule.OPItc_MSSQL</commonModules>
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
D8D47C184A2060D4594E0776ABC385FAAA61D7A37F5EA03C348DEF1311E79864
|
||||
ACA600906C29AB89D94EF3DF6EFD8E28DAA76E974DCA6473C6CCA31D1030FCD4
|
||||
+7
-7
@@ -141,7 +141,7 @@ Function ExecuteCodeFromString(Val Lua, Val Code) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -169,7 +169,7 @@ Function ExecuteCodeFromFile(Val Lua, Val Path) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -205,7 +205,7 @@ Function CallFunction(Val Lua, Val FunctionName, Val Parameters = Undefined) Exp
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -244,7 +244,7 @@ Function CompileCodeFromString(Val Lua, Val Code) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -276,7 +276,7 @@ Function CompileCodeFromFile(Val Lua, Val Path) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -311,7 +311,7 @@ Function ExecuteBytecode(Val Lua, Val Bytecode) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
@@ -334,7 +334,7 @@ Function ExecuteBytecodeFromFile(Val Lua, Val Path) Export
|
||||
|
||||
AddIn = CreateVM(Lua);
|
||||
|
||||
If IsVM(AddIn) Then
|
||||
If Not IsVM(AddIn) Then
|
||||
Return AddIn;
|
||||
EndIf;
|
||||
|
||||
|
||||
+101
@@ -153,6 +153,24 @@ Procedure FT_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FT_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetFTPParameterOptions()[0];
|
||||
|
||||
FTP_Extended_GetGreetingWithoutConnection(TestParameters);
|
||||
FTP_Extended_ConnectionWithoutAddress(TestParameters);
|
||||
FTP_Extended_Reconnection(TestParameters);
|
||||
FTP_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // FTP
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -1538,6 +1556,85 @@ Procedure FTP_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure FTP_Extended_GetGreetingWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("FTP");
|
||||
Result = OPI_FTP.GetWelcomeMessage(Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "FTP", "Extended_GetGreetingWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_ConnectionWithoutAddress(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("FTP");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "FTP", "Extended_ConnectionWithoutAddress");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Host = FunctionParameters["FTP_IP"];
|
||||
Port = FunctionParameters["FTP_Port"];
|
||||
Login = FunctionParameters["FTP_User"];
|
||||
Password = FunctionParameters["FTP_Password"];
|
||||
|
||||
FTPSettings = OPI_FTP.GetConnectionSettings(Host, Port, Login, Password);
|
||||
|
||||
Connection = OPI_FTP.CreateConnection(FTPSettings);
|
||||
|
||||
If Not OPI_FTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "FTP", "Extended_Reconnection");
|
||||
OPI_FTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_FTP.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Host = FunctionParameters["FTP_IP"];
|
||||
Port = FunctionParameters["FTP_Port"];
|
||||
Login = FunctionParameters["FTP_User"];
|
||||
Password = FunctionParameters["FTP_Password"];
|
||||
|
||||
FTPSettings = OPI_FTP.GetConnectionSettings(Host, Port, Login, Password);
|
||||
|
||||
Connection = OPI_FTP.CreateConnection(FTPSettings, , , LoggingSettings);
|
||||
|
||||
If Not OPI_FTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_FTP.GetWelcomeMessage(Connection);
|
||||
|
||||
Result = OPI_FTP.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "FTP", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_FTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // FTP
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -1559,4 +1656,8 @@ Procedure FT_ОсновныеМетоды() Export
|
||||
FT_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure FT_РасширеннаяПроверка() Export
|
||||
FT_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+150
-1
@@ -116,6 +116,30 @@ Procedure GR_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_Address" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_AddressNoTls", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_Proto" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_ProtoTS" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_ProtoImport" , TestParameters);
|
||||
|
||||
GRPC_Extended_CallMethodWithoutConnection(TestParameters);
|
||||
GRPC_Extended_ConnectionWithoutAddress(TestParameters);
|
||||
GRPC_Extended_Reconnection(TestParameters);
|
||||
GRPC_Extended_GetLogOnConnection(TestParameters);
|
||||
GRPC_Extended_CallMethodMultipleBinaryFields(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_Introspection() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -387,7 +411,7 @@ Procedure GRPC_ExecuteMethod(FunctionParameters)
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "ExecuteMethod");
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "ExecuteMethod", , Data);
|
||||
|
||||
Result = OPI_GRPC.ExecuteMethod(Parameters, Service, Method, Undefined, , Tls);
|
||||
|
||||
@@ -460,6 +484,127 @@ Procedure GRPC_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure GRPC_Extended_CallMethodWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("GRPC");
|
||||
Request = OPI_AddIns.SerializeJanx(New Structure);
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Call(Request));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "Extended_CallMethodWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_ConnectionWithoutAddress(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("GRPC");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "Extended_ConnectionWithoutAddress");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Parameters = OPI_GRPC.GetConnectionParameters(Address, Scheme);
|
||||
Tls = OPI_GRPC.GetTlsSettings(True);
|
||||
|
||||
Connection = OPI_GRPC.CreateConnection(Parameters, Tls);
|
||||
|
||||
If Not OPI_GRPC.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "Extended_Reconnection");
|
||||
OPI_GRPC.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_GRPC.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Parameters = OPI_GRPC.GetConnectionParameters(Address, Scheme);
|
||||
Tls = OPI_GRPC.GetTlsSettings(True);
|
||||
|
||||
Connection = OPI_GRPC.CreateConnection(Parameters, Tls, LoggingSettings);
|
||||
|
||||
If Not OPI_GRPC.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_GRPC.ExecuteMethod(Connection, "grpcbin.GRPCBin", "DummyUnary");
|
||||
|
||||
Result = OPI_GRPC.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_GRPC.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_CallMethodMultipleBinaryFields(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Parameters = OPI_GRPC.GetConnectionParameters(Address, Scheme);
|
||||
Tls = OPI_GRPC.GetTlsSettings(True);
|
||||
|
||||
BinData = OPI_TestDataRetrieval.GetJanxTestCollection("BinariesArray");
|
||||
|
||||
Data = New Map;
|
||||
Data.Insert("f_string", "janx multi-bin");
|
||||
Data.Insert("f_int32" , 7);
|
||||
Data.Insert("f_bool" , True);
|
||||
Data.Insert("f_bytes" , BinData["chunks"][0]);
|
||||
Data.Insert("f_bytess", BinData["chunks"]);
|
||||
|
||||
Result = OPI_GRPC.ExecuteMethod(Parameters, "grpcbin.GRPCBin", "DummyUnary", Data, , Tls);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "GRPC", "Extended_CallMethodMultipleBinaryFields", , Data);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure GRPC_GetServiceList(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
@@ -1117,6 +1262,10 @@ Procedure GR_ОсновныеМетоды() Export
|
||||
GR_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_РасширеннаяПроверка() Export
|
||||
GR_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_Интроспекция() Export
|
||||
GR_Introspection();
|
||||
EndProcedure
|
||||
|
||||
+85
@@ -105,6 +105,23 @@ Procedure Jnx_Benchmark() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Jnx_ExtendedDataCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Janx_Extended_RoundRobinMultipleBinaryFields();
|
||||
Janx_Extended_RoundRobinBinariesArray();
|
||||
Janx_Extended_RoundRobinMixedArray();
|
||||
Janx_Extended_RoundRobinDeepNesting();
|
||||
Janx_Extended_RoundRobinEmptyAndSpecial();
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // Janx
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -302,6 +319,70 @@ Procedure Janx_Benchmark()
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedDataCheck
|
||||
|
||||
Procedure Janx_Extended_RoundRobinMultipleBinaryFields()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
Result = OPI_Janx.SerializeData(Original);
|
||||
Restored = OPI_Janx.DeserializeData(Result);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Janx", "Extended_RoundRobin", "MultipleBinaries", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinBinariesArray()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("BinariesArray");
|
||||
Result = OPI_Janx.SerializeData(Original);
|
||||
Restored = OPI_Janx.DeserializeData(Result);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Janx", "Extended_RoundRobin", "BinariesArray", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinMixedArray()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MixedArray");
|
||||
Result = OPI_Janx.SerializeData(Original);
|
||||
Restored = OPI_Janx.DeserializeData(Result);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Janx", "Extended_RoundRobin", "MixedArray", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinDeepNesting()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("DeepNesting");
|
||||
Result = OPI_Janx.SerializeData(Original);
|
||||
Restored = OPI_Janx.DeserializeData(Result);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Janx", "Extended_RoundRobin", "DeepNesting", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinEmptyAndSpecial()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("EmptyAndSpecial");
|
||||
Result = OPI_Janx.SerializeData(Original);
|
||||
Restored = OPI_Janx.DeserializeData(Result);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Janx", "Extended_RoundRobin", "EmptyAndSpecial", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedDataCheck
|
||||
|
||||
#EndRegion // Janx
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -319,4 +400,8 @@ Procedure Jnx_Бенчмарк() Export
|
||||
Jnx_Benchmark();
|
||||
EndProcedure
|
||||
|
||||
Procedure Jnx_РасширеннаяПроверкаДанные() Export
|
||||
Jnx_ExtendedDataCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+383
@@ -0,0 +1,383 @@
|
||||
// OneScript: ./OInt/tests/Modules/OPIt_Lua.os
|
||||
|
||||
// MIT License
|
||||
|
||||
// Copyright (c) 2023-2026 Anton Tsitavets
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
// https://github.com/Bayselonarrend/OpenIntegrations
|
||||
|
||||
// Test suite for YAxUnit
|
||||
|
||||
// BSLLS:Typo-off
|
||||
// BSLLS:LatinAndCyrillicSymbolInWord-off
|
||||
// BSLLS:IncorrectLineBreak-off
|
||||
// BSLLS:UsingServiceTag-off
|
||||
// BSLLS:UnusedParameters-off
|
||||
// BSLLS:DuplicateStringLiteral-off
|
||||
// BSLLS:UsingHardcodePath-off
|
||||
// BSLLS:UnusedLocalVariable-off
|
||||
// BSLLS:DeprecatedMessage-off
|
||||
// BSLLS:LineLength-off
|
||||
// BSLLS:MagicNumber-off
|
||||
// BSLLS:CommentedCode-off
|
||||
// BSLLS:AssignAliasFieldsInQuery-off
|
||||
// BSLLS:UsingHardcodeNetworkAddress-off
|
||||
// BSLLS:UnreachableCode-off
|
||||
// BSLLS:UnusedLocalMethod-off
|
||||
// BSLLS:NestedFunctionInParameters-off
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
// BSLLS:UsingSynchronousCalls-off
|
||||
// BSLLS:MagicDate-off
|
||||
// BSLLS:MissingParameterDescription-off
|
||||
// BSLLS:NumberOfOptionalParams-off
|
||||
// BSLLS:MethodSize-off
|
||||
// BSLLS:NestedConstructorsInStructureDeclaration-off
|
||||
// BSLLS:NumberOfValuesInStructureConstructor-off
|
||||
// BSLLS:UsingHardcodeSecretInformation-off
|
||||
// BSLLS:SpaceAtStartComment-off
|
||||
|
||||
//@skip-check undefined-variable
|
||||
//@skip-check wrong-string-literal-content
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
//@skip-check undefined-function-or-procedure
|
||||
//@skip-check module-unused-local-variable
|
||||
//@skip-check bsl-legacy-check-string-literal
|
||||
//@skip-check bsl-legacy-check-method-for-statements-after-return
|
||||
//@skip-check missing-temporary-file-deletion
|
||||
//@skip-check module-unused-method
|
||||
|
||||
#Use oint
|
||||
#Use asserts
|
||||
#Use "internal"
|
||||
|
||||
|
||||
// For YAxUnit
|
||||
|
||||
Procedure ИсполняемыеСценарии() Export
|
||||
|
||||
OPI_TestDataRetrieval.FormYAXTests("Lua");
|
||||
|
||||
EndProcedure
|
||||
|
||||
// For Asserts
|
||||
|
||||
Function ПолучитьСписокТестов(UnitTesting) Export
|
||||
|
||||
Return OPI_TestDataRetrieval.FormAssertsTests("Lua");
|
||||
|
||||
EndFunction
|
||||
|
||||
#Region Internal
|
||||
|
||||
#Region RunnableTests
|
||||
|
||||
#Region Lua
|
||||
|
||||
Procedure Lua_CommonMethods() Export
|
||||
|
||||
Lua_CreateVM();
|
||||
Lua_IsVM();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_WorkingWithScripts() Export
|
||||
|
||||
Lua_ExecuteCodeFromString();
|
||||
Lua_ExecuteCodeFromFile();
|
||||
Lua_CallFunction();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_BytecodeManagement() Export
|
||||
|
||||
Lua_CompileCodeFromString();
|
||||
Lua_CompileCodeFromFile();
|
||||
Lua_ExecuteBytecode();
|
||||
Lua_ExecuteBytecodeFromFile();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Lua_Extended_CodeExecutionError();
|
||||
Lua_Extended_GetLogWithoutInitialization();
|
||||
Lua_Extended_GetLogOnExecution();
|
||||
Lua_Extended_PassComplexData();
|
||||
Lua_Extended_PassArrayOfMixedTypes();
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // Lua
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
|
||||
#EndRegion // Internal
|
||||
|
||||
#Region Private
|
||||
|
||||
#Region AtomicTests
|
||||
|
||||
#Region Lua
|
||||
|
||||
Procedure Lua_CreateVM()
|
||||
|
||||
Result = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "CreateVM", "Lua54");
|
||||
|
||||
Result = OPI_Lua.CreateVM("LuaJIT");
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "CreateVM", "LuaJIT");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_IsVM()
|
||||
|
||||
VM54 = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
Result = OPI_Lua.IsVM(VM54);
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "IsVM", "Lua54"); // SKIP
|
||||
|
||||
Result = OPI_Lua.IsVM("not a vm");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "IsVM", "False");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteCodeFromString()
|
||||
|
||||
Result = OPI_Lua.ExecuteCodeFromString("Lua54", "return 42");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "ExecuteCodeFromString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteCodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 7").Write(ScriptFile);
|
||||
|
||||
Result = OPI_Lua.ExecuteCodeFromFile("Lua54", ScriptFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "ExecuteCodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CallFunction()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function add(a, b) return a + b end");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(1);
|
||||
Parameters.Add(2);
|
||||
|
||||
Result = OPI_Lua.CallFunction(VM, "add", Parameters);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "CallFunction");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CompileCodeFromString()
|
||||
|
||||
Result = OPI_Lua.CompileCodeFromString("Lua54", "return 1");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "CompileCodeFromString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CompileCodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 3").Write(ScriptFile);
|
||||
|
||||
Result = OPI_Lua.CompileCodeFromFile("Lua54", ScriptFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "CompileCodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteBytecode()
|
||||
|
||||
Bytecode = OPI_Lua.CompileCodeFromString("Lua54", "return 11");
|
||||
Result = OPI_Lua.ExecuteBytecode("Lua54", Bytecode);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "ExecuteBytecode");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteBytecodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 13").Write(ScriptFile);
|
||||
|
||||
BytecodeFile = GetTempFileName("bin");
|
||||
Bytecode = OPI_Lua.CompileCodeFromFile("Lua54", ScriptFile);
|
||||
Bytecode.Write(BytecodeFile);
|
||||
|
||||
Result = OPI_Lua.ExecuteBytecodeFromFile("Lua54", BytecodeFile);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile , "Failed to delete the temporary file after the test!!");
|
||||
OPI_Tools.RemoveFileWithTry(BytecodeFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "ExecuteBytecodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure Lua_Extended_CodeExecutionError()
|
||||
|
||||
AddIn = OPI_AddIns.GetAddIn("Lua54");
|
||||
Result = OPI_AddIns.DesrializeJanx(AddIn.ExecuteString("syntax error !!!"));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "Extended_CodeExecutionError");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_GetLogWithoutInitialization()
|
||||
|
||||
AddIn = OPI_Lua.CreateVM("Lua54");
|
||||
Result = OPI_AddIns.DesrializeJanx(AddIn.GetLogs(10));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "Extended_GetLogWithoutInitialization");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_GetLogOnExecution()
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_AddIns.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54", LoggingSettings);
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "return 1");
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(VM.GetLogs(10));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "Extended_GetLogOnExecution", , LogFile);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_PassComplexData()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function echo(v) return v end");
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("LuaComplexData");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(Original);
|
||||
|
||||
Result = OPI_Lua.CallFunction(VM, "echo", Parameters);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "Extended_PassComplexData", , Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_PassArrayOfMixedTypes()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function echo(v) return v end");
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("LuaMixedArray");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(Original);
|
||||
|
||||
Result = OPI_Lua.CallFunction(VM, "echo", Parameters);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "Lua", "Extended_PassArrayOfMixedTypes", , Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // Lua
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
#EndRegion // Private
|
||||
|
||||
|
||||
#Region Alternate
|
||||
|
||||
Procedure Lua_ОсновныеМетоды() Export
|
||||
Lua_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_РаботаСоСкриптами() Export
|
||||
Lua_WorkingWithScripts();
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_РаботаСБайткодом() Export
|
||||
Lua_BytecodeManagement();
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_РасширеннаяПроверка() Export
|
||||
Lua_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+111
@@ -113,6 +113,26 @@ Procedure MSS_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("PG_IP" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("PG_Password", TestParameters);
|
||||
|
||||
MSSQL_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
MSSQL_Extended_ConnectionWithoutString(TestParameters);
|
||||
MSSQL_Extended_Reconnection(TestParameters);
|
||||
MSSQL_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_ORM() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -377,6 +397,93 @@ Procedure MSSQL_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure MSSQL_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
Result = OPI_MSSQL.ExecuteSQLQuery("SELECT 1", , , Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MSSQL", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MSSQL", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "SA";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
|
||||
ConnectionString = OPI_MSSQL.GenerateConnectionString(Address, , Login, Password);
|
||||
TLSSettings = OPI_MSSQL.GetTLSSettings(True);
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
|
||||
TLSSetup = OPI_AddIns.SetTls(Connector, TLSSettings);
|
||||
If Not OPI_Tools.GetOr(TLSSetup, "result", False) Then
|
||||
Raise OPI_Tools.JSONString(TLSSetup);
|
||||
EndIf;
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MSSQL", "Extended_Reconnection");
|
||||
OPI_MSSQL.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_MSSQL.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "SA";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
|
||||
ConnectionString = OPI_MSSQL.GenerateConnectionString(Address, , Login, Password);
|
||||
TLSSettings = OPI_MSSQL.GetTLSSettings(True);
|
||||
|
||||
Connection = OPI_MSSQL.CreateConnection(ConnectionString, TLSSettings, LoggingSettings);
|
||||
|
||||
If Not OPI_MSSQL.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_MSSQL.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_MSSQL.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MSSQL", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_MSSQL.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure MSSQL_CreateDatabase(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
@@ -1039,4 +1146,8 @@ Procedure MSS_ОсновныеМетоды() Export
|
||||
MSS_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_РасширеннаяПроверка() Export
|
||||
MSS_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+2
-1
@@ -223,7 +223,8 @@ Procedure MessagePack_SerializeData()
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MessagePack", "SerializeData", "False");
|
||||
|
||||
Result = OPI_MessagePack.SerializeData(GetBinaryDataFromHexString(""));
|
||||
Data = GetBinaryDataFromHexString("");
|
||||
Result = OPI_MessagePack.SerializeData(Data);
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MessagePack", "SerializeData", "EmptyBinary");
|
||||
|
||||
|
||||
+113
@@ -113,6 +113,28 @@ Procedure Mongo_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Mongo_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_Port" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_User" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_Password", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("MongoDB_DB" , TestParameters);
|
||||
|
||||
MongoDB_Extended_ExecuteCommandWithoutConnection(TestParameters);
|
||||
MongoDB_Extended_ConnectionWithoutString(TestParameters);
|
||||
MongoDB_Extended_Reconnection(TestParameters);
|
||||
MongoDB_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Mong_DatabaseManagement() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -375,6 +397,93 @@ Procedure MongoDB_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure MongoDB_Extended_ExecuteCommandWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MongoDB");
|
||||
Result = OPI_MongoDB.ExecuteCommand(Connector, "listDatabases");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MongoDB", "Extended_ExecuteCommandWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MongoDB_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MongoDB");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MongoDB", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MongoDB_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = "127.0.0.1:1234";
|
||||
Login = FunctionParameters["MongoDB_User"];
|
||||
Password = FunctionParameters["MongoDB_Password"];
|
||||
Base = FunctionParameters["MongoDB_DB"];
|
||||
|
||||
Address = OPI_TestDataRetrieval.GetLocalhost() + ":" + FunctionParameters["MongoDB_Port"];
|
||||
|
||||
ConnectionParams = New Structure("authSource", "admin");
|
||||
ConnectionString = OPI_MongoDB.GenerateConnectionString(Address, Base, Login, Password, ConnectionParams);
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MongoDB");
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MongoDB", "Extended_Reconnection");
|
||||
OPI_MongoDB.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MongoDB_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_MongoDB.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = "127.0.0.1:1234";
|
||||
Login = FunctionParameters["MongoDB_User"];
|
||||
Password = FunctionParameters["MongoDB_Password"];
|
||||
|
||||
Address = OPI_TestDataRetrieval.GetLocalhost() + ":" + FunctionParameters["MongoDB_Port"];
|
||||
|
||||
ConnectionParams = New Structure("authSource", "admin");
|
||||
ConnectionString = OPI_MongoDB.GenerateConnectionString(Address, , Login, Password, ConnectionParams);
|
||||
|
||||
Connection = OPI_MongoDB.CreateConnection(ConnectionString, LoggingSettings);
|
||||
|
||||
If Not OPI_MongoDB.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_MongoDB.ExecuteCommand(Connection, "listDatabases", , , New Structure("nameOnly", True));
|
||||
|
||||
Result = OPI_MongoDB.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MongoDB", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_MongoDB.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure MongoDB_GetDatabase(FunctionParameters)
|
||||
|
||||
Address = "127.0.0.1:1234";
|
||||
@@ -1462,6 +1571,10 @@ Procedure Mongo_ОсновныеМетоды() Export
|
||||
Mongo_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure Mongo_РасширеннаяПроверка() Export
|
||||
Mongo_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
Procedure Mongo_РаботаСБазами() Export
|
||||
Mong_DatabaseManagement();
|
||||
EndProcedure
|
||||
|
||||
+129
@@ -113,6 +113,24 @@ Procedure MYS_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MYS_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetMySQLParameterOptions()[0];
|
||||
|
||||
MySQL_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
MySQL_Extended_ConnectionWithoutString(TestParameters);
|
||||
MySQL_Extended_Reconnection(TestParameters);
|
||||
MySQL_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MYS_ORM() Export
|
||||
|
||||
OptionArray = OPI_TestDataRetrieval.GetMySQLParameterOptions();
|
||||
@@ -1056,6 +1074,113 @@ Procedure MySQL_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure MySQL_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MySQL");
|
||||
Result = OPI_MySQL.ExecuteSQLQuery("SELECT 1", , , Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MySQL", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MySQL_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MySQL");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MySQL", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MySQL_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
ConnectionString = OPI_MySQL.GenerateConnectionString(Address, Base, Login, Password, Port);
|
||||
|
||||
If TLS Then
|
||||
TLSSettings = OPI_MySQL.GetTLSSettings(True);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MySQL");
|
||||
|
||||
If TLS Then
|
||||
TLSSetup = OPI_AddIns.SetTls(Connector, TLSSettings);
|
||||
If Not OPI_Tools.GetOr(TLSSetup, "result", False) Then
|
||||
Raise OPI_Tools.JSONString(TLSSetup);
|
||||
EndIf;
|
||||
EndIf;
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MySQL", "Extended_Reconnection");
|
||||
OPI_MySQL.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MySQL_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_MySQL.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
ConnectionString = OPI_MySQL.GenerateConnectionString(Address, Base, Login, Password, Port);
|
||||
|
||||
If TLS Then
|
||||
TLSSettings = OPI_MySQL.GetTLSSettings(True);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connection = OPI_MySQL.CreateConnection(ConnectionString, TLSSettings, LoggingSettings);
|
||||
|
||||
If Not OPI_MySQL.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_MySQL.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_MySQL.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "MySQL", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_MySQL.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure MySQL_GetTableInformation(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
@@ -1246,4 +1371,8 @@ Procedure MYS_ОсновныеМетоды() Export
|
||||
MYS_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure MYS_РасширеннаяПроверка() Export
|
||||
MYS_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+129
@@ -113,6 +113,24 @@ Procedure Postgres_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Postgres_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetPostgresParameterOptions()[0];
|
||||
|
||||
PostgreSQL_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
PostgreSQL_Extended_ConnectionWithoutString(TestParameters);
|
||||
PostgreSQL_Extended_Reconnection(TestParameters);
|
||||
PostgreSQL_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Postgres_ORM() Export
|
||||
|
||||
OptionArray = OPI_TestDataRetrieval.GetPostgresParameterOptions();
|
||||
@@ -1175,6 +1193,113 @@ Procedure PostgreSQL_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure PostgreSQL_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("PostgreSQL");
|
||||
Result = OPI_PostgreSQL.ExecuteSQLQuery("SELECT 1", , , Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "PostgreSQL", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure PostgreSQL_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("PostgreSQL");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "PostgreSQL", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure PostgreSQL_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "postgres";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
ConnectionString = OPI_PostgreSQL.GenerateConnectionString(Address, Base, Login, Password, Port);
|
||||
|
||||
If TLS Then
|
||||
TLSSettings = OPI_PostgreSQL.GetTLSSettings(True);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("PostgreSQL");
|
||||
|
||||
If TLS Then
|
||||
TLSSetup = OPI_AddIns.SetTls(Connector, TLSSettings);
|
||||
If Not OPI_Tools.GetOr(TLSSetup, "result", False) Then
|
||||
Raise OPI_Tools.JSONString(TLSSetup);
|
||||
EndIf;
|
||||
EndIf;
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "PostgreSQL", "Extended_Reconnection");
|
||||
OPI_PostgreSQL.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure PostgreSQL_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_PostgreSQL.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "bayselonarrend";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
Base = "postgres";
|
||||
|
||||
TLS = FunctionParameters["TLS"];
|
||||
Port = FunctionParameters["Port"];
|
||||
|
||||
ConnectionString = OPI_PostgreSQL.GenerateConnectionString(Address, Base, Login, Password, Port);
|
||||
|
||||
If TLS Then
|
||||
TLSSettings = OPI_PostgreSQL.GetTLSSettings(True);
|
||||
Else
|
||||
TLSSettings = Undefined;
|
||||
EndIf;
|
||||
|
||||
Connection = OPI_PostgreSQL.CreateConnection(ConnectionString, TLSSettings, LoggingSettings);
|
||||
|
||||
If Not OPI_PostgreSQL.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_PostgreSQL.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_PostgreSQL.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "PostgreSQL", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_PostgreSQL.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure PostgreSQL_AddTableColumn(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
@@ -1312,4 +1437,8 @@ Procedure Postgres_ОсновныеМетоды() Export
|
||||
Postgres_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure Postgres_РасширеннаяПроверка() Export
|
||||
Postgres_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+87
@@ -109,6 +109,25 @@ Procedure RC_CommandsExecution() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure RC_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("RCON_URL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("RCON_Password", TestParameters);
|
||||
|
||||
RCON_Extended_ExecuteCommandWithoutConnection(TestParameters);
|
||||
RCON_Extended_Reconnection(TestParameters);
|
||||
RCON_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // RCON
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -245,6 +264,70 @@ Procedure RCON_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure RCON_Extended_ExecuteCommandWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("RCON");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Command("list"));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "RCON", "Extended_ExecuteCommandWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure RCON_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
URL = FunctionParameters["RCON_URL"];
|
||||
Password = FunctionParameters["RCON_Password"];
|
||||
WriteTimeout = 20;
|
||||
ReadTimeout = 20;
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("RCON");
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect(URL, Password, ReadTimeout, WriteTimeout));
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect(URL, Password, ReadTimeout, WriteTimeout));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "RCON", "Extended_Reconnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure RCON_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_RCON.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
URL = FunctionParameters["RCON_URL"];
|
||||
Password = FunctionParameters["RCON_Password"];
|
||||
WriteTimeout = 20;
|
||||
ReadTimeout = 20;
|
||||
|
||||
ConnectionParams = OPI_RCON.FormConnectionParameters(URL, Password, ReadTimeout, WriteTimeout);
|
||||
Connection = OPI_RCON.CreateConnection(ConnectionParams, LoggingSettings);
|
||||
|
||||
If Not OPI_RCON.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_RCON.ExecuteCommand("list", Connection);
|
||||
|
||||
Result = OPI_RCON.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "RCON", "Extended_GetLogOnConnection", , LogFile);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // RCON
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -258,4 +341,8 @@ Procedure RC_ВыполнениеКоманд() Export
|
||||
RC_CommandsExecution();
|
||||
EndProcedure
|
||||
|
||||
Procedure RC_РасширеннаяПроверка() Export
|
||||
RC_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+103
@@ -152,6 +152,26 @@ Procedure SF_FileManagement() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SF_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetSSHParameterOptions()[0];
|
||||
|
||||
SFTP_Extended_GetListWithoutConnection(TestParameters);
|
||||
SFTP_Extended_ConnectionWithoutSettings(TestParameters);
|
||||
SFTP_Extended_Reconnection(TestParameters);
|
||||
SFTP_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(TestParameters["SSH_Key"], "Error deleting file after test");
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // SFTP
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -1458,6 +1478,85 @@ Procedure SFTP_GetFileInformation(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure SFTP_Extended_GetListWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Result = OPI_SFTP.ListObjects(Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SFTP", "Extended_GetListWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SFTP_Extended_ConnectionWithoutSettings(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SFTP", "Extended_ConnectionWithoutSettings");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SFTP_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Host = FunctionParameters["SSH_Host"];
|
||||
Port = FunctionParameters["SSH_Port"];
|
||||
Login = FunctionParameters["SSH_User"];
|
||||
Password = FunctionParameters["SSH_Password"];
|
||||
|
||||
SFTPSettings = OPI_SFTP.GetSettingsLoginPassword(Host, Port, Login, Password);
|
||||
|
||||
Connection = OPI_SFTP.CreateConnection(SFTPSettings);
|
||||
|
||||
If Not OPI_SFTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SFTP", "Extended_Reconnection");
|
||||
OPI_SFTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SFTP_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_SSH.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Host = FunctionParameters["SSH_Host"];
|
||||
Port = FunctionParameters["SSH_Port"];
|
||||
Login = FunctionParameters["SSH_User"];
|
||||
Password = FunctionParameters["SSH_Password"];
|
||||
|
||||
SFTPSettings = OPI_SFTP.GetSettingsLoginPassword(Host, Port, Login, Password);
|
||||
|
||||
Connection = OPI_SSH.CreateConnection(SFTPSettings, , LoggingSettings);
|
||||
|
||||
If Not OPI_SFTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SFTP.ListObjects(Connection, "");
|
||||
|
||||
Result = OPI_SSH.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SFTP", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_SFTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // SFTP
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -1479,4 +1578,8 @@ Procedure SF_РаботаСФайлами() Export
|
||||
SF_FileManagement();
|
||||
EndProcedure
|
||||
|
||||
Procedure SF_РасширеннаяПроверка() Export
|
||||
SF_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+117
@@ -118,6 +118,24 @@ Procedure SQLL_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLL_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
SQLite_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
SQLite_Extended_Reconnection(TestParameters);
|
||||
SQLite_Extended_GetLogOnConnection(TestParameters);
|
||||
SQLite_Extended_RequestWithTwoBlobs(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLL_ORM() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -834,6 +852,101 @@ Procedure SQLite_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure SQLite_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SQLite");
|
||||
Result = OPI_SQLite.ExecuteSQLQuery("SELECT 1", , , Connector);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SQLite", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLite_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
TFN = GetTempFileName("sqlite");
|
||||
Connector = OPI_AddIns.GetAddIn("SQLite");
|
||||
|
||||
Connector.Database = TFN;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SQLite", "Extended_Reconnection");
|
||||
OPI_SQLite.CloseConnection(Connector);
|
||||
OPI_Tools.RemoveFileWithTry(TFN, "Database file deletion error");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLite_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_SQLite.GetLoggingSettings(True, 100, LogFile);
|
||||
TFN = GetTempFileName("sqlite");
|
||||
|
||||
Connection = OPI_SQLite.CreateConnection(TFN, LoggingSettings);
|
||||
|
||||
If Not OPI_SQLite.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SQLite.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_SQLite.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SQLite", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_SQLite.CloseConnection(Connection);
|
||||
OPI_Tools.RemoveFileWithTry(TFN, "Database file deletion error");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLite_Extended_RequestWithTwoBlobs(FunctionParameters)
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
TFN = GetTempFileName("sqlite");
|
||||
|
||||
Connection = OPI_SQLite.CreateConnection(TFN);
|
||||
|
||||
If Not OPI_SQLite.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SQLite.ExecuteSQLQuery("DROP TABLE IF EXISTS janx_blob_test", , , Connection);
|
||||
OPI_SQLite.ExecuteSQLQuery("CREATE TABLE janx_blob_test (
|
||||
|alpha BLOB,
|
||||
|beta BLOB,
|
||||
|inner_blob BLOB)", , , Connection);
|
||||
|
||||
ParameterArray = New Array;
|
||||
ParameterArray.Add(New Structure("blob", Original["alpha"]));
|
||||
ParameterArray.Add(New Structure("blob", Original["beta"]));
|
||||
ParameterArray.Add(New Structure("blob", Original["nested"]["inner"]));
|
||||
|
||||
OPI_SQLite.ExecuteSQLQuery("INSERT INTO janx_blob_test (alpha, beta, inner_blob) VALUES (?, ?, ?)", ParameterArray, , Connection);
|
||||
|
||||
Result = OPI_SQLite.ExecuteSQLQuery("SELECT alpha, beta, inner_blob FROM janx_blob_test", , , Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SQLite", "Extended_RequestWithTwoBlobs", , Original);
|
||||
OPI_SQLite.CloseConnection(Connection);
|
||||
OPI_Tools.RemoveFileWithTry(TFN, "Database file deletion error");
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // SQLite
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -847,4 +960,8 @@ Procedure SQLL_ОсновныеМетоды() Export
|
||||
SQLL_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure SQLL_РасширеннаяПроверка() Export
|
||||
SQLL_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+75
@@ -119,6 +119,23 @@ Procedure SShell_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SShell_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetSSHParameterOptions()[0];
|
||||
|
||||
SSH_Extended_ExecuteCommandWithoutConnection(TestParameters);
|
||||
SSH_Extended_ConnectionWithoutSettings(TestParameters);
|
||||
SSH_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // SSH
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -709,6 +726,60 @@ Procedure SSH_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure SSH_Extended_ExecuteCommandWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Result = OPI_SSH.ExecuteCommand(Connector, "whoami");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SSH", "Extended_ExecuteCommandWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SSH_Extended_ConnectionWithoutSettings(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("SSH");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SSH", "Extended_ConnectionWithoutSettings");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure SSH_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_SSH.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Host = FunctionParameters["SSH_Host"];
|
||||
Port = FunctionParameters["SSH_Port"];
|
||||
Login = FunctionParameters["SSH_User"];
|
||||
Password = FunctionParameters["SSH_Password"];
|
||||
|
||||
SSHSettings = OPI_SSH.GetSettingsLoginPassword(Host, Port, Login, Password);
|
||||
Connection = OPI_SSH.CreateConnection(SSHSettings, , LoggingSettings);
|
||||
|
||||
If Not OPI_SSH.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_SSH.ExecuteCommand(Connection, "whoami");
|
||||
|
||||
Result = OPI_SSH.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "SSH", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_SSH.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // SSH
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -722,4 +793,8 @@ Procedure SShell_ОсновныеМетоды() Export
|
||||
SShell_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure SShell_РасширеннаяПроверка() Export
|
||||
SShell_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+199
@@ -145,6 +145,27 @@ Procedure TC_Server() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TC_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
TCP_Extended_GetDataOfNextTimeout(TestParameters);
|
||||
TCP_Extended_OperationWithoutStart(TestParameters);
|
||||
TCP_Extended_GetLogOnServerStart(TestParameters);
|
||||
TCP_Extended_ReadTimeout(TestParameters);
|
||||
TCP_Extended_OperationWithoutConnection(TestParameters);
|
||||
TCP_Extended_GetLogOnConnectionOpening(TestParameters);
|
||||
TCP_Extended_JanxCollectionExchange(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // TCP
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -811,6 +832,180 @@ Procedure TCP_GetLoggingSettings(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure TCP_Extended_GetDataOfNextTimeout(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
ServerObject = OPI_TCP.StartServer(Port);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_TCP.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_GetDataOfNextTimeout");
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_OperationWithoutStart(FunctionParameters)
|
||||
|
||||
ServerObject = OPI_AddIns.GetAddIn(OPI_TCP.AddInName());
|
||||
|
||||
Result = OPI_TCP.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_OperationWithoutStart");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_GetLogOnServerStart(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_TCP.GetLoggingSettings(True, 100, LogFile);
|
||||
ServerObject = OPI_TCP.StartServer(Port, , LoggingSettings);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ConnectionAddress = "127.0.0.1:9876";
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("TCP_LOG_SRV_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
OPI_TCP.SendLine(ClientObject, Message + Chars.LF);
|
||||
OPI_TCP.GetNextConnectionData(ServerObject, 5000);
|
||||
|
||||
Result = OPI_TCP.GetLog(ServerObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_GetLogOnServerStart", , LogFile);
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_ReadTimeout(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
ConnectionAddress = "127.0.0.1:9876";
|
||||
ServerObject = OPI_TCP.StartServer(Port);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Data = OPI_TCP.ReadBinaryData(ClientObject, , , 300);
|
||||
|
||||
Result = New Map;
|
||||
Result.Insert("result", Data.Size() = 0);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_ReadTimeout");
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_OperationWithoutConnection(FunctionParameters)
|
||||
|
||||
ClientObject = OPI_AddIns.GetAddIn("TCPClient");
|
||||
Data = GetBinaryDataFromString("x");
|
||||
|
||||
OPI_TCP.SendBinaryData(ClientObject, Data, 300);
|
||||
Result = OPI_TCP.GetLastError(ClientObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_OperationWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_GetLogOnConnectionOpening(FunctionParameters)
|
||||
|
||||
Port = 9876;
|
||||
ConnectionAddress = "127.0.0.1:9876";
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_TCP.GetLoggingSettings(True, 100, LogFile);
|
||||
ServerObject = OPI_TCP.StartServer(Port);
|
||||
|
||||
If Not OPI_TCP.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress, , , LoggingSettings);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("TCP_LOG_CLI_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
OPI_TCP.SendLine(ClientObject, Message + Chars.LF);
|
||||
OPI_TCP.GetNextConnectionData(ServerObject, 5000);
|
||||
|
||||
Result = OPI_TCP.GetLog(ClientObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "TCP", "Extended_GetLogOnConnectionOpening", , LogFile);
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure TCP_Extended_JanxCollectionExchange(FunctionParameters)
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
JanxData = OPI_Janx.SerializeData(Original);
|
||||
|
||||
LaunchPort = 9879;
|
||||
ServerObject = OPI_TCP.StartServer(LaunchPort);
|
||||
|
||||
ConnectionAddress = "127.0.0.1:9879";
|
||||
ClientObject = OPI_TCP.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_TCP.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
OPI_TCP.SendBinaryData(ClientObject, JanxData);
|
||||
|
||||
NextMessage = OPI_TCP.GetNextConnectionData(ServerObject, 5000);
|
||||
ConnectionID = NextMessage["connectionId"];
|
||||
|
||||
OPI_TCP.SendData(ServerObject, ConnectionID, NextMessage["message"]);
|
||||
|
||||
ClientResponse = OPI_TCP.ReadBinaryData(ClientObject, , , 5000);
|
||||
Restored = OPI_Janx.DeserializeData(ClientResponse);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(ClientResponse, "TCP", "Extended_JanxCollectionExchange", , Restored, Original);
|
||||
OPI_TCP.CloseConnection(ClientObject);
|
||||
OPI_TCP.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // TCP
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -828,4 +1023,8 @@ Procedure TC_Сервер() Export
|
||||
TC_Server();
|
||||
EndProcedure
|
||||
|
||||
Procedure TC_РасширеннаяПроверка() Export
|
||||
TC_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+87
@@ -146,6 +146,23 @@ Procedure WS_Server() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WS_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(False);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
WebSocket_Extended_GetDataOfNextTimeout(TestParameters);
|
||||
WebSocket_Extended_OperationWithoutStart(TestParameters);
|
||||
WebSocket_Extended_GetLogOnServerStart(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // WebSocket
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -1096,6 +1113,72 @@ Procedure WebSocket_GetLoggingSettings(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure WebSocket_Extended_GetDataOfNextTimeout(FunctionParameters)
|
||||
|
||||
Port = 9893;
|
||||
ServerObject = OPI_WebSocket.StartServer(Port);
|
||||
|
||||
If Not OPI_WebSocket.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_WebSocket.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "WebSocket", "Extended_GetDataOfNextTimeout");
|
||||
OPI_WebSocket.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WebSocket_Extended_OperationWithoutStart(FunctionParameters)
|
||||
|
||||
ServerObject = OPI_AddIns.GetAddIn(OPI_WebSocket.AddInName());
|
||||
|
||||
Result = OPI_WebSocket.GetNextConnectionData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "WebSocket", "Extended_OperationWithoutStart");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WebSocket_Extended_GetLogOnServerStart(FunctionParameters)
|
||||
|
||||
Port = 9893;
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_WebSocket.GetLoggingSettings(True, 100, LogFile);
|
||||
ServerObject = OPI_WebSocket.StartServer(Port, , LoggingSettings);
|
||||
|
||||
If Not OPI_WebSocket.IsServerObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ConnectionAddress = "ws://127.0.0.1:9893";
|
||||
ClientObject = OPI_WebSocket.CreateConnection(ConnectionAddress);
|
||||
|
||||
If Not OPI_WebSocket.IsClientObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("WS_LOG_SRV_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
OPI_WebSocket.SendTextMessage(ClientObject, Message);
|
||||
OPI_WebSocket.GetNextConnectionData(ServerObject, 5000);
|
||||
|
||||
Result = OPI_WebSocket.GetLog(ServerObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "WebSocket", "Extended_GetLogOnServerStart", , LogFile);
|
||||
OPI_WebSocket.CloseConnection(ClientObject);
|
||||
OPI_WebSocket.StopServer(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // WebSocket
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -1129,4 +1212,8 @@ Procedure WS_Сервер() Export
|
||||
WS_Server();
|
||||
EndProcedure
|
||||
|
||||
Procedure WS_РасширеннаяПроверка() Export
|
||||
WS_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+133
@@ -137,6 +137,17 @@ Procedure ZMQ_InteractionMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZMQ_ExtendedCheck() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
|
||||
ZeroMQ_Extended_GetTimeoutData(TestParameters);
|
||||
ZeroMQ_Extended_HandleTimeoutRequest(TestParameters);
|
||||
ZeroMQ_Extended_GetLogOnPortOpening(TestParameters);
|
||||
ZeroMQ_Extended_JanxCollectionExchange(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ZeroMQ
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -673,6 +684,124 @@ Procedure ZeroMQ_GetLoggingSettings(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure ZeroMQ_Extended_GetTimeoutData(FunctionParameters)
|
||||
|
||||
Port = 5555;
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_ZeroMQ.ReceiveData(ServerObject, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "ZeroMQ", "Extended_GetTimeoutData");
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZeroMQ_Extended_HandleTimeoutRequest(FunctionParameters)
|
||||
|
||||
Port = 5555;
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Address = "tcp://127.0.0.1:5555";
|
||||
ClientObject = OPI_ZeroMQ.CreateConnectionReq(Address);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Request = StrTemplate("ZMQ_REQ_TO_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
ReqData = GetBinaryDataFromString(Request);
|
||||
Result = OPI_ZeroMQ.ProcessRequest(ClientObject, ReqData, 3000, 300);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "ZeroMQ", "Extended_HandleTimeoutRequest");
|
||||
OPI_ZeroMQ.CloseConnection(ClientObject);
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZeroMQ_Extended_GetLogOnPortOpening(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_ZeroMQ.GetLoggingSettings(True, 100, LogFile);
|
||||
Port = 5555;
|
||||
Address = "tcp://127.0.0.1:5555";
|
||||
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port, LoggingSettings);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
ClientObject = OPI_ZeroMQ.CreateConnectionReq(Address);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
Message = StrTemplate("ZMQ_LOG_BIND_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
|
||||
Data = GetBinaryDataFromString(Message);
|
||||
|
||||
OPI_ZeroMQ.SendData(ClientObject, Data, 3000);
|
||||
OPI_ZeroMQ.ReceiveData(ServerObject, 3000);
|
||||
|
||||
Result = OPI_ZeroMQ.GetLog(ServerObject);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(Result, "ZeroMQ", "Extended_GetLogOnPortOpening", , LogFile);
|
||||
OPI_ZeroMQ.CloseConnection(ClientObject);
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure ZeroMQ_Extended_JanxCollectionExchange(FunctionParameters)
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
JanxData = OPI_Janx.SerializeData(Original);
|
||||
|
||||
Port = 5560;
|
||||
ServerObject = OPI_ZeroMQ.BindPortRep(Port);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
|
||||
Raise OPI_Tools.JSONString(ServerObject);
|
||||
EndIf;
|
||||
|
||||
Address = "tcp://127.0.0.1:5560";
|
||||
ClientObject = OPI_ZeroMQ.CreateConnectionReq(Address);
|
||||
|
||||
If Not OPI_ZeroMQ.IsConnectorObject(ClientObject) Then
|
||||
Raise OPI_Tools.JSONString(ClientObject);
|
||||
EndIf;
|
||||
|
||||
OPI_ZeroMQ.SendData(ClientObject, JanxData , 3000);
|
||||
ServerRequest = OPI_ZeroMQ.ReceiveData(ServerObject, 3000);
|
||||
OPI_ZeroMQ.SendData(ServerObject, ServerRequest["data"], 3000);
|
||||
ClientResponse = OPI_ZeroMQ.ReceiveData(ClientObject, 3000);
|
||||
Restored = OPI_Janx.DeserializeData(ClientResponse["data"]);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.Process(ClientResponse, "ZeroMQ", "Extended_JanxCollectionExchange", , Restored, Original, JanxData);
|
||||
OPI_ZeroMQ.CloseConnection(ClientObject);
|
||||
OPI_ZeroMQ.CloseConnection(ServerObject);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // ZeroMQ
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -698,4 +827,8 @@ Procedure ZMQ_МетодыВзаимодействия() Export
|
||||
ZMQ_InteractionMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure ZMQ_РасширеннаяПроверка() Export
|
||||
ZMQ_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+116
@@ -155,6 +155,24 @@ Procedure FT_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FT_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = OPI_TestDataRetrieval.GetFTPParameterOptions()[0];
|
||||
|
||||
FTP_Extended_GetGreetingWithoutConnection(TestParameters);
|
||||
FTP_Extended_ConnectionWithoutAddress(TestParameters);
|
||||
FTP_Extended_Reconnection(TestParameters);
|
||||
FTP_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // FTP
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -2082,6 +2100,100 @@ Procedure FTP_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure FTP_Extended_GetGreetingWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("FTP");
|
||||
Options = New Structure;
|
||||
Options.Insert("conn", Connector);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("ftp", "GetWelcomeMessage", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "FTP", "Extended_GetGreetingWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_ConnectionWithoutAddress(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("FTP");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "FTP", "Extended_ConnectionWithoutAddress");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Host = FunctionParameters["FTP_IP"];
|
||||
Port = FunctionParameters["FTP_Port"];
|
||||
Login = FunctionParameters["FTP_User"];
|
||||
Password = FunctionParameters["FTP_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("host", Host);
|
||||
Options.Insert("port", Port);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
FTPSettings = OPI_TestDataRetrieval.ExecuteTestCLI("ftp", "GetConnectionSettings", Options);
|
||||
|
||||
Connection = OPI_FTP.CreateConnection(FTPSettings);
|
||||
|
||||
If Not OPI_FTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "FTP", "Extended_Reconnection");
|
||||
OPI_FTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure FTP_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_FTP.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Host = FunctionParameters["FTP_IP"];
|
||||
Port = FunctionParameters["FTP_Port"];
|
||||
Login = FunctionParameters["FTP_User"];
|
||||
Password = FunctionParameters["FTP_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("host", Host);
|
||||
Options.Insert("port", Port);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
FTPSettings = OPI_TestDataRetrieval.ExecuteTestCLI("ftp", "GetConnectionSettings", Options);
|
||||
|
||||
Connection = OPI_FTP.CreateConnection(FTPSettings, , , LoggingSettings);
|
||||
|
||||
If Not OPI_FTP.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_FTP.GetWelcomeMessage(Connection);
|
||||
|
||||
Result = OPI_FTP.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "FTP", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_FTP.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // FTP
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -2103,4 +2215,8 @@ Procedure FT_ОсновныеМетоды() Export
|
||||
FT_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure FT_РасширеннаяПроверка() Export
|
||||
FT_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
+178
-1
@@ -118,6 +118,30 @@ Procedure GR_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_Address" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_AddressNoTls", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_Proto" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_ProtoTS" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GRPC_ProtoImport" , TestParameters);
|
||||
|
||||
GRPC_Extended_CallMethodWithoutConnection(TestParameters);
|
||||
GRPC_Extended_ConnectionWithoutAddress(TestParameters);
|
||||
GRPC_Extended_Reconnection(TestParameters);
|
||||
GRPC_Extended_GetLogOnConnection(TestParameters);
|
||||
GRPC_Extended_CallMethodMultipleBinaryFields(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_Introspection() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -458,7 +482,7 @@ Procedure GRPC_ExecuteMethod(FunctionParameters)
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "ExecuteMethod");
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "ExecuteMethod", , Data);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("conn", Parameters);
|
||||
@@ -557,6 +581,155 @@ Procedure GRPC_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure GRPC_Extended_CallMethodWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("GRPC");
|
||||
Request = OPI_AddIns.SerializeJanx(New Structure);
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Call(Request));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "Extended_CallMethodWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_ConnectionWithoutAddress(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("GRPC");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "Extended_ConnectionWithoutAddress");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("proto", Scheme);
|
||||
|
||||
Parameters = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetConnectionParameters", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
Tls = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetTlsSettings", Options);
|
||||
|
||||
Connection = OPI_GRPC.CreateConnection(Parameters, Tls);
|
||||
|
||||
If Not OPI_GRPC.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connection.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "Extended_Reconnection");
|
||||
OPI_GRPC.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_GRPC.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("proto", Scheme);
|
||||
|
||||
Parameters = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetConnectionParameters", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
Tls = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetTlsSettings", Options);
|
||||
|
||||
Connection = OPI_GRPC.CreateConnection(Parameters, Tls, LoggingSettings);
|
||||
|
||||
If Not OPI_GRPC.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_GRPC.ExecuteMethod(Connection, "grpcbin.GRPCBin", "DummyUnary");
|
||||
|
||||
Result = OPI_GRPC.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_GRPC.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GRPC_Extended_CallMethodMultipleBinaryFields(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
|
||||
Proto1 = FunctionParameters["GRPC_ProtoImport"];
|
||||
Proto2 = FunctionParameters["GRPC_ProtoTS"];
|
||||
|
||||
Scheme = New Map;
|
||||
Scheme.Insert("main.proto" , Proto1);
|
||||
Scheme.Insert("my_types.proto", Proto2);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("proto", Scheme);
|
||||
|
||||
Parameters = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetConnectionParameters", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
Tls = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "GetTlsSettings", Options);
|
||||
|
||||
BinData = OPI_TestDataRetrieval.GetJanxTestCollection("BinariesArray");
|
||||
|
||||
Data = New Map;
|
||||
Data.Insert("f_string", "janx multi-bin");
|
||||
Data.Insert("f_int32" , 7);
|
||||
Data.Insert("f_bool" , True);
|
||||
Data.Insert("f_bytes" , BinData["chunks"][0]);
|
||||
Data.Insert("f_bytess", BinData["chunks"]);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("conn", Parameters);
|
||||
Options.Insert("service", "grpcbin.GRPCBin");
|
||||
Options.Insert("method", "DummyUnary");
|
||||
Options.Insert("data", Data);
|
||||
Options.Insert("tls", Tls);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("grpc", "ExecuteMethod", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "GRPC", "Extended_CallMethodMultipleBinaryFields", , Data);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure GRPC_GetServiceList(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["GRPC_Address"];
|
||||
@@ -1346,6 +1519,10 @@ Procedure GR_ОсновныеМетоды() Export
|
||||
GR_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_РасширеннаяПроверка() Export
|
||||
GR_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
Procedure GR_Интроспекция() Export
|
||||
GR_Introspection();
|
||||
EndProcedure
|
||||
|
||||
+115
@@ -107,6 +107,23 @@ Procedure Jnx_Benchmark() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Jnx_ExtendedDataCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Janx_Extended_RoundRobinMultipleBinaryFields();
|
||||
Janx_Extended_RoundRobinBinariesArray();
|
||||
Janx_Extended_RoundRobinMixedArray();
|
||||
Janx_Extended_RoundRobinDeepNesting();
|
||||
Janx_Extended_RoundRobinEmptyAndSpecial();
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // Janx
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
@@ -376,6 +393,100 @@ Procedure Janx_Benchmark()
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedDataCheck
|
||||
|
||||
Procedure Janx_Extended_RoundRobinMultipleBinaryFields()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MultipleBinaries");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", Result);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Janx", "Extended_RoundRobin", "MultipleBinaries", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinBinariesArray()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("BinariesArray");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", Result);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Janx", "Extended_RoundRobin", "BinariesArray", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinMixedArray()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("MixedArray");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", Result);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Janx", "Extended_RoundRobin", "MixedArray", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinDeepNesting()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("DeepNesting");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", Result);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Janx", "Extended_RoundRobin", "DeepNesting", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Janx_Extended_RoundRobinEmptyAndSpecial()
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("EmptyAndSpecial");
|
||||
Options = New Structure;
|
||||
Options.Insert("value", Original);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "SerializeData", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("data", Result);
|
||||
|
||||
Restored = OPI_TestDataRetrieval.ExecuteTestCLI("janx", "DeserializeData", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Janx", "Extended_RoundRobin", "EmptyAndSpecial", Restored, Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedDataCheck
|
||||
|
||||
#EndRegion // Janx
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
@@ -393,4 +504,8 @@ Procedure Jnx_Бенчмарк() Export
|
||||
Jnx_Benchmark();
|
||||
EndProcedure
|
||||
|
||||
Procedure Jnx_РасширеннаяПроверкаДанные() Export
|
||||
Jnx_ExtendedDataCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
+428
@@ -0,0 +1,428 @@
|
||||
// OneScript: ./OInt/tests/Modules/OPItc_Lua.os
|
||||
|
||||
// MIT License
|
||||
|
||||
// Copyright (c) 2023-2026 Anton Tsitavets
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
// https://github.com/Bayselonarrend/OpenIntegrations
|
||||
|
||||
// Test suite for YAxUnit
|
||||
|
||||
// BSLLS:Typo-off
|
||||
// BSLLS:LatinAndCyrillicSymbolInWord-off
|
||||
// BSLLS:IncorrectLineBreak-off
|
||||
// BSLLS:UsingServiceTag-off
|
||||
// BSLLS:UnusedParameters-off
|
||||
// BSLLS:DuplicateStringLiteral-off
|
||||
// BSLLS:UsingHardcodePath-off
|
||||
// BSLLS:UnusedLocalVariable-off
|
||||
// BSLLS:DeprecatedMessage-off
|
||||
// BSLLS:LineLength-off
|
||||
// BSLLS:MagicNumber-off
|
||||
// BSLLS:CommentedCode-off
|
||||
// BSLLS:AssignAliasFieldsInQuery-off
|
||||
// BSLLS:UsingHardcodeNetworkAddress-off
|
||||
// BSLLS:UnreachableCode-off
|
||||
// BSLLS:UnusedLocalMethod-off
|
||||
// BSLLS:NestedFunctionInParameters-off
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
// BSLLS:UsingSynchronousCalls-off
|
||||
// BSLLS:MagicDate-off
|
||||
// BSLLS:MissingParameterDescription-off
|
||||
// BSLLS:NumberOfOptionalParams-off
|
||||
// BSLLS:MethodSize-off
|
||||
// BSLLS:NestedConstructorsInStructureDeclaration-off
|
||||
// BSLLS:NumberOfValuesInStructureConstructor-off
|
||||
// BSLLS:UsingHardcodeSecretInformation-off
|
||||
// BSLLS:SpaceAtStartComment-off
|
||||
|
||||
//@skip-check undefined-variable
|
||||
//@skip-check wrong-string-literal-content
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
//@skip-check undefined-function-or-procedure
|
||||
//@skip-check module-unused-local-variable
|
||||
//@skip-check bsl-legacy-check-string-literal
|
||||
//@skip-check bsl-legacy-check-method-for-statements-after-return
|
||||
//@skip-check missing-temporary-file-deletion
|
||||
//@skip-check module-unused-method
|
||||
|
||||
#Use "../../tools/main"
|
||||
#Use "../../tools/http"
|
||||
#Use "../../api"
|
||||
#Use asserts
|
||||
#Use "internal"
|
||||
|
||||
|
||||
// For YAxUnit
|
||||
|
||||
Procedure ИсполняемыеСценарии() Export
|
||||
|
||||
OPI_TestDataRetrieval.FormYAXTestsCLI("Lua");
|
||||
|
||||
EndProcedure
|
||||
|
||||
// For Asserts
|
||||
|
||||
Function ПолучитьСписокТестов(UnitTesting) Export
|
||||
|
||||
Return OPI_TestDataRetrieval.FormAssertsTestsCLI("Lua");
|
||||
|
||||
EndFunction
|
||||
|
||||
#Region Internal
|
||||
|
||||
#Region RunnableTests
|
||||
|
||||
#Region Lua
|
||||
|
||||
Procedure Lua_CommonMethods() Export
|
||||
|
||||
Lua_CreateVM();
|
||||
Lua_IsVM();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_WorkingWithScripts() Export
|
||||
|
||||
Lua_ExecuteCodeFromString();
|
||||
Lua_ExecuteCodeFromFile();
|
||||
Lua_CallFunction();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_BytecodeManagement() Export
|
||||
|
||||
Lua_CompileCodeFromString();
|
||||
Lua_CompileCodeFromFile();
|
||||
Lua_ExecuteBytecode();
|
||||
Lua_ExecuteBytecodeFromFile();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Lua_Extended_CodeExecutionError();
|
||||
Lua_Extended_GetLogWithoutInitialization();
|
||||
Lua_Extended_GetLogOnExecution();
|
||||
Lua_Extended_PassComplexData();
|
||||
Lua_Extended_PassArrayOfMixedTypes();
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // Lua
|
||||
|
||||
#EndRegion // RunnableTests
|
||||
|
||||
#EndRegion // Internal
|
||||
|
||||
#Region Private
|
||||
|
||||
#Region AtomicTests
|
||||
|
||||
#Region Lua
|
||||
|
||||
Procedure Lua_CreateVM()
|
||||
|
||||
Result = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "CreateVM", "Lua54");
|
||||
|
||||
Result = OPI_Lua.CreateVM("LuaJIT");
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "CreateVM", "LuaJIT");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_IsVM()
|
||||
|
||||
VM54 = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
Result = OPI_Lua.IsVM(VM54);
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "IsVM", "Lua54"); // SKIP
|
||||
|
||||
Result = OPI_Lua.IsVM("not a vm");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "IsVM", "False");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteCodeFromString()
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("code", "return 42");
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "ExecuteCodeFromString", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "ExecuteCodeFromString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteCodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 7").Write(ScriptFile);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("path", ScriptFile);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "ExecuteCodeFromFile", Options);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "ExecuteCodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CallFunction()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function add(a, b) return a + b end");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(1);
|
||||
Parameters.Add(2);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", VM);
|
||||
Options.Insert("func", "add");
|
||||
Options.Insert("params", Parameters);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CallFunction", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "CallFunction");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CompileCodeFromString()
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("code", "return 1");
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CompileCodeFromString", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "CompileCodeFromString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_CompileCodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 3").Write(ScriptFile);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("path", ScriptFile);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CompileCodeFromFile", Options);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "CompileCodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteBytecode()
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("code", "return 11");
|
||||
|
||||
Bytecode = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CompileCodeFromString", Options);
|
||||
Result = OPI_Lua.ExecuteBytecode("Lua54", Bytecode);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "ExecuteBytecode");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_ExecuteBytecodeFromFile()
|
||||
|
||||
ScriptFile = GetTempFileName("lua");
|
||||
GetBinaryDataFromString("return 13").Write(ScriptFile);
|
||||
|
||||
BytecodeFile = GetTempFileName("bin");
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("path", ScriptFile);
|
||||
|
||||
Bytecode = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CompileCodeFromFile", Options);
|
||||
Bytecode.Write(BytecodeFile);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", "Lua54");
|
||||
Options.Insert("path", BytecodeFile);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "ExecuteBytecodeFromFile", Options);
|
||||
|
||||
OPI_Tools.RemoveFileWithTry(ScriptFile , "Failed to delete the temporary file after the test!!");
|
||||
OPI_Tools.RemoveFileWithTry(BytecodeFile, "Failed to delete the temporary file after the test!!");
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "ExecuteBytecodeFromFile");
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure Lua_Extended_CodeExecutionError()
|
||||
|
||||
AddIn = OPI_AddIns.GetAddIn("Lua54");
|
||||
Result = OPI_AddIns.DesrializeJanx(AddIn.ExecuteString("syntax error !!!"));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "Extended_CodeExecutionError");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_GetLogWithoutInitialization()
|
||||
|
||||
AddIn = OPI_Lua.CreateVM("Lua54");
|
||||
Result = OPI_AddIns.DesrializeJanx(AddIn.GetLogs(10));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "Extended_GetLogWithoutInitialization");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_GetLogOnExecution()
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_AddIns.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54", LoggingSettings);
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "return 1");
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(VM.GetLogs(10));
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "Extended_GetLogOnExecution", , LogFile);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_PassComplexData()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function echo(v) return v end");
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("LuaComplexData");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(Original);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", VM);
|
||||
Options.Insert("func", "echo");
|
||||
Options.Insert("params", Parameters);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CallFunction", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "Extended_PassComplexData", , Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_Extended_PassArrayOfMixedTypes()
|
||||
|
||||
VM = OPI_Lua.CreateVM("Lua54");
|
||||
|
||||
OPI_Lua.ExecuteCodeFromString(VM, "function echo(v) return v end");
|
||||
|
||||
Original = OPI_TestDataRetrieval.GetJanxTestCollection("LuaMixedArray");
|
||||
|
||||
Parameters = New Array;
|
||||
Parameters.Add(Original);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("lua", VM);
|
||||
Options.Insert("func", "echo");
|
||||
Options.Insert("params", Parameters);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("lua", "CallFunction", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "Lua", "Extended_PassArrayOfMixedTypes", , Original);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
#EndRegion // Lua
|
||||
|
||||
#EndRegion // AtomicTests
|
||||
|
||||
#EndRegion // Private
|
||||
|
||||
|
||||
#Region Alternate
|
||||
|
||||
Procedure Lua_ОсновныеМетоды() Export
|
||||
Lua_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_РаботаСоСкриптами() Export
|
||||
Lua_WorkingWithScripts();
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_РаботаСБайткодом() Export
|
||||
Lua_BytecodeManagement();
|
||||
EndProcedure
|
||||
|
||||
Procedure Lua_РасширеннаяПроверка() Export
|
||||
Lua_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
+131
@@ -115,6 +115,26 @@ Procedure MSS_CommonMethods() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_ExtendedCheck() Export
|
||||
|
||||
OPI_TestDataRetrieval.SetCLITestFlag(True);
|
||||
|
||||
If OPI_TestDataRetrieval.IsCLITest() Then
|
||||
Message("CLI SKIP");
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("PG_IP" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("PG_Password", TestParameters);
|
||||
|
||||
MSSQL_Extended_ExecuteQueryWithoutConnection(TestParameters);
|
||||
MSSQL_Extended_ConnectionWithoutString(TestParameters);
|
||||
MSSQL_Extended_Reconnection(TestParameters);
|
||||
MSSQL_Extended_GetLogOnConnection(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_ORM() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
@@ -449,6 +469,113 @@ Procedure MSSQL_GetLog(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
#Region ExtendedCheck
|
||||
|
||||
Procedure MSSQL_Extended_ExecuteQueryWithoutConnection(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
Options = New Structure;
|
||||
Options.Insert("sql", "SELECT 1");
|
||||
Options.Insert("dbc", Connector);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("mssql", "ExecuteSQLQuery", Options);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MSSQL", "Extended_ExecuteQueryWithoutConnection");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_ConnectionWithoutString(FunctionParameters)
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MSSQL", "Extended_ConnectionWithoutString");
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_Reconnection(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "SA";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("mssql", "GenerateConnectionString", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
TLSSettings = OPI_TestDataRetrieval.ExecuteTestCLI("mssql", "GetTLSSettings", Options);
|
||||
|
||||
Connector = OPI_AddIns.GetAddIn("MSSQL");
|
||||
|
||||
TLSSetup = OPI_AddIns.SetTls(Connector, TLSSettings);
|
||||
If Not OPI_Tools.GetOr(TLSSetup, "result", False) Then
|
||||
Raise OPI_Tools.JSONString(TLSSetup);
|
||||
EndIf;
|
||||
|
||||
Connector.ConnectionString = ConnectionString;
|
||||
FirstConnection = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
If Not FirstConnection["result"] Then
|
||||
Raise OPI_Tools.JSONString(FirstConnection);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_AddIns.DesrializeJanx(Connector.Connect());
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MSSQL", "Extended_Reconnection");
|
||||
OPI_MSSQL.CloseConnection(Connector);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure MSSQL_Extended_GetLogOnConnection(FunctionParameters)
|
||||
|
||||
LogFile = GetTempFileName("txt");
|
||||
LoggingSettings = OPI_MSSQL.GetLoggingSettings(True, 100, LogFile);
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
Login = "SA";
|
||||
Password = FunctionParameters["PG_Password"];
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("addr", Address);
|
||||
Options.Insert("login", Login);
|
||||
Options.Insert("pass", Password);
|
||||
|
||||
ConnectionString = OPI_TestDataRetrieval.ExecuteTestCLI("mssql", "GenerateConnectionString", Options);
|
||||
Options = New Structure;
|
||||
Options.Insert("trust", Истина);
|
||||
|
||||
TLSSettings = OPI_TestDataRetrieval.ExecuteTestCLI("mssql", "GetTLSSettings", Options);
|
||||
|
||||
Connection = OPI_MSSQL.CreateConnection(ConnectionString, TLSSettings, LoggingSettings);
|
||||
|
||||
If Not OPI_MSSQL.IsConnector(Connection) Then
|
||||
Raise OPI_Tools.JSONString(Connection);
|
||||
EndIf;
|
||||
|
||||
OPI_MSSQL.ExecuteSQLQuery("SELECT 1 AS n", , , Connection);
|
||||
|
||||
Result = OPI_MSSQL.GetLog(Connection);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.ProcessCLI(Result, "MSSQL", "Extended_GetLogOnConnection", , LogFile);
|
||||
OPI_MSSQL.CloseConnection(Connection);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion // ExtendedCheck
|
||||
|
||||
Procedure MSSQL_CreateDatabase(FunctionParameters)
|
||||
|
||||
Address = FunctionParameters["PG_IP"];
|
||||
@@ -1447,4 +1574,8 @@ Procedure MSS_ОсновныеМетоды() Export
|
||||
MSS_CommonMethods();
|
||||
EndProcedure
|
||||
|
||||
Procedure MSS_РасширеннаяПроверка() Export
|
||||
MSS_ExtendedCheck();
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user