рефакторинг. неудачные наименования классов, и остатки старых вариантов
This commit is contained in:
42
.idea/workspace.xml
generated
42
.idea/workspace.xml
generated
@@ -7,12 +7,48 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change afterPath="$PROJECT_DIR$/src/SapforTestingSystem/ServerSapforTestingPlanner/ServerSapforTestingPlanner.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Common/Current.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Current.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Common/Global.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Global.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/Global.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Global.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/PerformSapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/PerformSapforTask.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/RemoteSapforsMenuBar/RemoteSapforsMenuBar.java" beforeDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTestingPlaner/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforScenarioSupervisor/SapforScenarioSupervisor.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/SapforScenariosBar/SapforScenariosBar.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/SapforTasksMenuBar/SapforTasksMenuBar.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/SapforTasksPackagesBar/SapforTasksPackagesBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Menus_2023/SapforTasksPackagesBar/SapforTasksPackagesBar.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/UI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/UI.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Utils.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/GlobalDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/GlobalDatabase.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/Machine/MachinesDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/Machine/MachinesDBTable.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/RemoteSapfor/RemoteSapfor.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/RemoteSapfor/RemoteSapforsDBTable.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/RemoteSapfor/UI/RemoteSapforFields.form" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/RemoteSapfor/UI/RemoteSapforFields.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Repository/Server/ServerCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Server/ServerCode.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/Json/PackageModeScenario_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforTasksPackage_json.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforScenarioResults_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforTasksResults_json.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforScenario/SapforScenario.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforScenario/SapforScenariosDBTable.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforScenarioSupervisor/SapforScenarioSupervisor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackageSupervisor/SapforTasksPackageSupervisor.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/SapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/SapforTask.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/SapforTaskResult.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/SapforTasksDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/SapforTasksDBTable.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackage.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackagesDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackagesDBTable.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/ServerSapforTestingPlanner/ServerSapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/ServerSapforTestingPlanner/ServerSapforTestingPlanner.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestsDatabase.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddSapfor.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AnalyseSapforPackageResults.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CompareSapforPackages.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteSapfor.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteSapforScenario.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteSapforScenario.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/EditSapfor.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/OpenSapforTest.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SynchronizeTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SynchronizeTests.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Interface/TestingWindow.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Interface/TestingWindow.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/TestingForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/TestingForm.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import GlobalData.Machine.Machine;
|
|||||||
import GlobalData.Makefile.Makefile;
|
import GlobalData.Makefile.Makefile;
|
||||||
import GlobalData.Module.Module;
|
import GlobalData.Module.Module;
|
||||||
import GlobalData.RemoteFile.RemoteFile;
|
import GlobalData.RemoteFile.RemoteFile;
|
||||||
import GlobalData.RemoteSapfor.RemoteSapfor;
|
|
||||||
import GlobalData.RunConfiguration.RunConfiguration;
|
import GlobalData.RunConfiguration.RunConfiguration;
|
||||||
import GlobalData.Tasks.CompilationTask.CompilationTask;
|
import GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||||
import GlobalData.Tasks.RunTask.RunTask;
|
import GlobalData.Tasks.RunTask.RunTask;
|
||||||
@@ -102,9 +101,7 @@ public enum Current {
|
|||||||
//-
|
//-
|
||||||
DialogWindow,
|
DialogWindow,
|
||||||
//-
|
//-
|
||||||
SapforTasksPackage,
|
|
||||||
PackageVersion,
|
PackageVersion,
|
||||||
RemoteSapfor,
|
|
||||||
SapforConfiguration,
|
SapforConfiguration,
|
||||||
SapforConfigurationCommand,
|
SapforConfigurationCommand,
|
||||||
SapforTask,
|
SapforTask,
|
||||||
@@ -267,13 +264,6 @@ public enum Current {
|
|||||||
return get(Current.ComponentServerBackup) != null;
|
return get(Current.ComponentServerBackup) != null;
|
||||||
}
|
}
|
||||||
//-
|
//-
|
||||||
public static boolean HasSapforTasksPackage() {
|
|
||||||
return get(Current.SapforTasksPackage) != null;
|
|
||||||
}
|
|
||||||
public static SapforTestingSystem.SapforTasksPackage.SapforTasksPackage getSapforTasksPackage() {
|
|
||||||
return (SapforTestingSystem.SapforTasksPackage.SapforTasksPackage) get(Current.SapforTasksPackage);
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
public static DefaultMutableTreeNode getProjectNode() {
|
public static DefaultMutableTreeNode getProjectNode() {
|
||||||
return (DefaultMutableTreeNode) get(Current.ProjectNode);
|
return (DefaultMutableTreeNode) get(Current.ProjectNode);
|
||||||
}
|
}
|
||||||
@@ -334,12 +324,6 @@ public enum Current {
|
|||||||
public static boolean HasPackageVersion() {
|
public static boolean HasPackageVersion() {
|
||||||
return get(Current.PackageVersion) != null;
|
return get(Current.PackageVersion) != null;
|
||||||
}
|
}
|
||||||
public static GlobalData.RemoteSapfor.RemoteSapfor getRemoteSapfor() {
|
|
||||||
return (RemoteSapfor) get(RemoteSapfor);
|
|
||||||
}
|
|
||||||
public static boolean HasRemoteSapfor() {
|
|
||||||
return get(Current.RemoteSapfor) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasSapforConfiguration() {
|
public static boolean HasSapforConfiguration() {
|
||||||
return get(Current.SapforConfiguration) != null;
|
return get(Current.SapforConfiguration) != null;
|
||||||
}
|
}
|
||||||
@@ -383,12 +367,13 @@ public enum Current {
|
|||||||
public static GlobalData.SapforProfile.SapforProfile getSapforProfile() {
|
public static GlobalData.SapforProfile.SapforProfile getSapforProfile() {
|
||||||
return (GlobalData.SapforProfile.SapforProfile) get(Current.SapforProfile);
|
return (GlobalData.SapforProfile.SapforProfile) get(Current.SapforProfile);
|
||||||
}
|
}
|
||||||
public static boolean HasSapforScenario() {
|
public static boolean HasSapforTasksPackage() {
|
||||||
return get(Current.SapforScenario) != null;
|
return get(Current.SapforScenario) != null;
|
||||||
}
|
}
|
||||||
public static SapforTestingSystem.SapforScenario.SapforScenario getSapforScenario() {
|
public static SapforTestingSystem.SapforTasksPackage.SapforTasksPackage getSapforTasksPackage() {
|
||||||
return (SapforTestingSystem.SapforScenario.SapforScenario) get(Current.SapforScenario);
|
return (SapforTestingSystem.SapforTasksPackage.SapforTasksPackage) get(Current.SapforScenario);
|
||||||
}
|
}
|
||||||
|
//сапфоры установленные на тестовый сервер.
|
||||||
public static boolean HasServerSapfor() {
|
public static boolean HasServerSapfor() {
|
||||||
return get(Current.ServerSapfor) != null;
|
return get(Current.ServerSapfor) != null;
|
||||||
}
|
}
|
||||||
@@ -422,12 +407,8 @@ public enum Current {
|
|||||||
return "Команда конфигурации тестирования SAPFOR";
|
return "Команда конфигурации тестирования SAPFOR";
|
||||||
case SapforConfiguration:
|
case SapforConfiguration:
|
||||||
return "Конфигурация тестирования SAPFOR";
|
return "Конфигурация тестирования SAPFOR";
|
||||||
case RemoteSapfor:
|
|
||||||
return "SAPFOR";
|
|
||||||
case PackageVersion:
|
case PackageVersion:
|
||||||
return "Версия пакетного режима";
|
return "Версия пакетного режима";
|
||||||
case SapforTasksPackage:
|
|
||||||
return "Пакет задач SAPFOR";
|
|
||||||
case TasksPackage:
|
case TasksPackage:
|
||||||
return "Пакет задач";
|
return "Пакет задач";
|
||||||
case Credentials:
|
case Credentials:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import Repository.Component.Sapfor.MessagesServer;
|
|||||||
import Repository.Component.Sapfor.Sapfor_F;
|
import Repository.Component.Sapfor.Sapfor_F;
|
||||||
import Repository.Component.Sapfor.TransformationPermission;
|
import Repository.Component.Sapfor.TransformationPermission;
|
||||||
import Repository.Server.ComponentsServer;
|
import Repository.Server.ComponentsServer;
|
||||||
import SapforTestingSystem.SapforScenarioSupervisor.SapforScenarioSupervisor;
|
import SapforTestingSystem.SapforTasksPackageSupervisor.SapforTasksPackageSupervisor;
|
||||||
import TestingSystem.TestingServer;
|
import TestingSystem.TestingServer;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
import Visual_DVM_2021.Passes.Pass_2021;
|
||||||
@@ -360,7 +360,7 @@ public class Global {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
Log.ClearLog();
|
Log.ClearLog();
|
||||||
SapforScenarioSupervisor planner = new SapforScenarioSupervisor();
|
SapforTasksPackageSupervisor planner = new SapforTasksPackageSupervisor();
|
||||||
planner.Start();
|
planner.Start();
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.RemoteSapforsMenuBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class RemoteSapforsMenuBar extends DataMenuBar {
|
|
||||||
public RemoteSapforsMenuBar() {
|
|
||||||
super("SAPFOR",
|
|
||||||
PassCode_2021.AddSapfor,
|
|
||||||
PassCode_2021.EditSapfor,
|
|
||||||
PassCode_2021.DeleteSapfor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.SapforScenariosBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class SapforScenariosBar extends DataMenuBar {
|
|
||||||
public SapforScenariosBar() {
|
|
||||||
super("сценарии", PassCode_2021.DeleteSapforScenario);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.SapforTasksMenuBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class SapforTasksMenuBar extends DataMenuBar {
|
|
||||||
public SapforTasksMenuBar() {
|
|
||||||
super("задачи", PassCode_2021.OpenSapforTest);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
package Common.UI.Menus_2023.SapforTasksPackagesBar;
|
package Common.UI.Menus_2023.SapforTasksPackagesBar;
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
import Common.UI.Menus_2023.DataMenuBar;
|
||||||
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
public class SapforTasksPackagesBar extends DataMenuBar {
|
public class SapforTasksPackagesBar extends DataMenuBar {
|
||||||
public SapforTasksPackagesBar() {
|
public SapforTasksPackagesBar() {
|
||||||
super("пакеты задач");
|
super("сценарии", PassCode_2021.DeleteSapforScenario);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,9 @@ import Common.UI.Menus_2023.MainMenuBar.MainMenuBar;
|
|||||||
import Common.UI.Menus_2023.MainMenuBar.MainWindow;
|
import Common.UI.Menus_2023.MainMenuBar.MainWindow;
|
||||||
import Common.UI.Menus_2023.MakefilesMenuBar.MakefilesMenuBar;
|
import Common.UI.Menus_2023.MakefilesMenuBar.MakefilesMenuBar;
|
||||||
import Common.UI.Menus_2023.ModulesMenuBar.ModulesMenuBar;
|
import Common.UI.Menus_2023.ModulesMenuBar.ModulesMenuBar;
|
||||||
import Common.UI.Menus_2023.RemoteSapforsMenuBar.RemoteSapforsMenuBar;
|
|
||||||
import Common.UI.Menus_2023.RunConfigurationsMenuBar.RunConfigurationsMenuBar;
|
import Common.UI.Menus_2023.RunConfigurationsMenuBar.RunConfigurationsMenuBar;
|
||||||
import Common.UI.Menus_2023.SapforConfigurationCommandsMenuBar.SapforConfigurationCommandsMenuBar;
|
import Common.UI.Menus_2023.SapforConfigurationCommandsMenuBar.SapforConfigurationCommandsMenuBar;
|
||||||
import Common.UI.Menus_2023.SapforConfigurationsMenuBar.SapforConfigurationsMenuBar;
|
import Common.UI.Menus_2023.SapforConfigurationsMenuBar.SapforConfigurationsMenuBar;
|
||||||
import Common.UI.Menus_2023.SapforScenariosBar.SapforScenariosBar;
|
|
||||||
import Common.UI.Menus_2023.SapforTasksMenuBar.SapforTasksMenuBar;
|
|
||||||
import Common.UI.Menus_2023.SapforTasksPackagesBar.SapforTasksPackagesBar;
|
import Common.UI.Menus_2023.SapforTasksPackagesBar.SapforTasksPackagesBar;
|
||||||
import Common.UI.Menus_2023.ServerSapforsBar.ServerSapforsBar;
|
import Common.UI.Menus_2023.ServerSapforsBar.ServerSapforsBar;
|
||||||
import Common.UI.Menus_2023.SubscribersMenuBar.SubscribersMenuBar;
|
import Common.UI.Menus_2023.SubscribersMenuBar.SubscribersMenuBar;
|
||||||
@@ -50,7 +47,6 @@ import GlobalData.Makefile.MakefilesDBTable;
|
|||||||
import GlobalData.Module.ModulesDBTable;
|
import GlobalData.Module.ModulesDBTable;
|
||||||
import GlobalData.RemoteFile.UI.RemoteFileChooser;
|
import GlobalData.RemoteFile.UI.RemoteFileChooser;
|
||||||
import GlobalData.RemoteFile.UI.RemoteFileRenderer;
|
import GlobalData.RemoteFile.UI.RemoteFileRenderer;
|
||||||
import GlobalData.RemoteSapfor.RemoteSapforsDBTable;
|
|
||||||
import GlobalData.RunConfiguration.RunConfigurationsDBTable;
|
import GlobalData.RunConfiguration.RunConfigurationsDBTable;
|
||||||
import GlobalData.SapforProfile.SapforProfilesDBTable;
|
import GlobalData.SapforProfile.SapforProfilesDBTable;
|
||||||
import GlobalData.Settings.SettingName;
|
import GlobalData.Settings.SettingName;
|
||||||
@@ -71,14 +67,12 @@ import ProjectData.SapforData.Variants.VariantsSet;
|
|||||||
import Repository.BugReport.BugReportsDBTable;
|
import Repository.BugReport.BugReportsDBTable;
|
||||||
import Repository.Component.UI.ComponentsForm;
|
import Repository.Component.UI.ComponentsForm;
|
||||||
import Repository.Subscribes.SubsribersDBTable;
|
import Repository.Subscribes.SubsribersDBTable;
|
||||||
import SapforTestingSystem.SapforScenario.SapforScenariosDBTable;
|
import SapforTestingSystem.SapforConfiguration.SapforConfigurationDBTable;
|
||||||
|
import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
|
||||||
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackagesDBTable;
|
||||||
import SapforTestingSystem.ServerSapfor.ServerSapforsDBTable;
|
import SapforTestingSystem.ServerSapfor.ServerSapforsDBTable;
|
||||||
import TestingSystem.Configuration.UI.ConfigurationDBTable;
|
import TestingSystem.Configuration.UI.ConfigurationDBTable;
|
||||||
import TestingSystem.Group.GroupsDBTable;
|
import TestingSystem.Group.GroupsDBTable;
|
||||||
import SapforTestingSystem.SapforConfiguration.SapforConfigurationDBTable;
|
|
||||||
import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
|
|
||||||
import SapforTestingSystem.SapforTask.SapforTasksDBTable;
|
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackagesDBTable;
|
|
||||||
import TestingSystem.Tasks.TestRunTasksDBTable;
|
import TestingSystem.Tasks.TestRunTasksDBTable;
|
||||||
import TestingSystem.TasksPackage.TasksPackageDBTable;
|
import TestingSystem.TasksPackage.TasksPackageDBTable;
|
||||||
import TestingSystem.Test.TestDBTable;
|
import TestingSystem.Test.TestDBTable;
|
||||||
@@ -234,10 +228,7 @@ public class UI {
|
|||||||
//---->>
|
//---->>
|
||||||
menuBars.put(SapforConfigurationDBTable.class, new SapforConfigurationsMenuBar());
|
menuBars.put(SapforConfigurationDBTable.class, new SapforConfigurationsMenuBar());
|
||||||
menuBars.put(SapforConfigurationCommandsDBTable.class, new SapforConfigurationCommandsMenuBar());
|
menuBars.put(SapforConfigurationCommandsDBTable.class, new SapforConfigurationCommandsMenuBar());
|
||||||
menuBars.put(RemoteSapforsDBTable.class, new RemoteSapforsMenuBar());
|
|
||||||
menuBars.put(SapforScenariosDBTable.class, new SapforScenariosBar());
|
|
||||||
menuBars.put(SapforTasksPackagesDBTable.class, new SapforTasksPackagesBar());
|
menuBars.put(SapforTasksPackagesDBTable.class, new SapforTasksPackagesBar());
|
||||||
menuBars.put(SapforTasksDBTable.class, new SapforTasksMenuBar());
|
|
||||||
//---->>
|
//---->>
|
||||||
menuBars.put(RegionsSet.class, new DataMenuBar("области распараллеливания"));
|
menuBars.put(RegionsSet.class, new DataMenuBar("области распараллеливания"));
|
||||||
menuBars.put(ArraysSet.class, new DataMenuBar("массивы"));
|
menuBars.put(ArraysSet.class, new DataMenuBar("массивы"));
|
||||||
|
|||||||
@@ -712,7 +712,7 @@ public class Utils {
|
|||||||
public static Process startScript(File scriptDirectory, File targetDirectory, String name, String scriptText) throws Exception {
|
public static Process startScript(File scriptDirectory, File targetDirectory, String name, String scriptText) throws Exception {
|
||||||
return startScript(scriptDirectory, targetDirectory, name, scriptText, null);
|
return startScript(scriptDirectory, targetDirectory, name, scriptText, null);
|
||||||
}
|
}
|
||||||
public static Process startScript_(File scriptDirectory, File targetDirectory, String name, String scriptText) throws Exception {
|
public static Process createScript(File scriptDirectory, File targetDirectory, String name, String scriptText) throws Exception {
|
||||||
//->
|
//->
|
||||||
File scriptFile = Paths.get(scriptDirectory.getAbsolutePath(), name + (Global.isWindows ? ".bat" : "")).toFile();
|
File scriptFile = Paths.get(scriptDirectory.getAbsolutePath(), name + (Global.isWindows ? ".bat" : "")).toFile();
|
||||||
FileUtils.write(scriptFile, "cd " + Utils.DQuotes(targetDirectory.getAbsolutePath()) + "\n" + scriptText);
|
FileUtils.write(scriptFile, "cd " + Utils.DQuotes(targetDirectory.getAbsolutePath()) + "\n" + scriptText);
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package GlobalData;
|
package GlobalData;
|
||||||
import Common.Current;
|
import Common.Current;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.DBObject;
|
||||||
import Common.Database.DataSet;
|
|
||||||
import Common.Database.SQLITE.SQLiteDatabase;
|
import Common.Database.SQLITE.SQLiteDatabase;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
import Common.UI.DataSetControlForm;
|
|
||||||
import GlobalData.Account.Account;
|
import GlobalData.Account.Account;
|
||||||
import GlobalData.Account.AccountsDBTable;
|
import GlobalData.Account.AccountsDBTable;
|
||||||
import GlobalData.Compiler.CompilersDBTable;
|
import GlobalData.Compiler.CompilersDBTable;
|
||||||
@@ -19,7 +17,6 @@ import GlobalData.Grid.GridsDBTable;
|
|||||||
import GlobalData.Machine.MachinesDBTable;
|
import GlobalData.Machine.MachinesDBTable;
|
||||||
import GlobalData.Makefile.MakefilesDBTable;
|
import GlobalData.Makefile.MakefilesDBTable;
|
||||||
import GlobalData.Module.ModulesDBTable;
|
import GlobalData.Module.ModulesDBTable;
|
||||||
import GlobalData.RemoteSapfor.RemoteSapforsDBTable;
|
|
||||||
import GlobalData.RunConfiguration.RunConfigurationsDBTable;
|
import GlobalData.RunConfiguration.RunConfigurationsDBTable;
|
||||||
import GlobalData.SapforProfile.SapforProfile;
|
import GlobalData.SapforProfile.SapforProfile;
|
||||||
import GlobalData.SapforProfile.SapforProfilesDBTable;
|
import GlobalData.SapforProfile.SapforProfilesDBTable;
|
||||||
@@ -33,24 +30,17 @@ import GlobalData.Tasks.CompilationTask.CompilationTasksDBTable;
|
|||||||
import GlobalData.Tasks.RunTask.RunTasksDBTable;
|
import GlobalData.Tasks.RunTask.RunTasksDBTable;
|
||||||
import GlobalData.User.UsersDBTable;
|
import GlobalData.User.UsersDBTable;
|
||||||
import Repository.Component.ComponentType;
|
import Repository.Component.ComponentType;
|
||||||
import SapforTestingSystem.SapforTask.SapforTaskResult;
|
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
|
||||||
import TestingSystem.TaskKey.TaskKeysDBTable;
|
import TestingSystem.TaskKey.TaskKeysDBTable;
|
||||||
import Visual_DVM_2021.PassStats.PassStatsDBTable;
|
import Visual_DVM_2021.PassStats.PassStatsDBTable;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
|
||||||
import static Common.UI.Tables.TableRenderers.RendererStatusEnum;
|
|
||||||
public class GlobalDatabase extends SQLiteDatabase {
|
public class GlobalDatabase extends SQLiteDatabase {
|
||||||
//---------СЕАНС----------------------------------------------
|
//---------СЕАНС----------------------------------------------
|
||||||
public MachinesDBTable machines;
|
public MachinesDBTable machines;
|
||||||
public UsersDBTable users;
|
public UsersDBTable users;
|
||||||
public CompilersDBTable compilers;
|
public CompilersDBTable compilers;
|
||||||
public RemoteSapforsDBTable remoteSapfors;
|
|
||||||
public MakefilesDBTable makefiles;
|
public MakefilesDBTable makefiles;
|
||||||
public ModulesDBTable modules;
|
public ModulesDBTable modules;
|
||||||
public CompilationTasksDBTable compilationTasks;
|
public CompilationTasksDBTable compilationTasks;
|
||||||
@@ -70,10 +60,6 @@ public class GlobalDatabase extends SQLiteDatabase {
|
|||||||
public GridsDBTable grids;
|
public GridsDBTable grids;
|
||||||
//-
|
//-
|
||||||
public TaskKeysDBTable tasksKeys;
|
public TaskKeysDBTable tasksKeys;
|
||||||
//---------
|
|
||||||
// public SapforScenariosDBTable sapforScenarios;
|
|
||||||
// public SapforTasksPackagesDBTable sapforTasksPackages;
|
|
||||||
// public SapforTasksDBTable sapforTasks = null;
|
|
||||||
public SapforProfilesDBTable sapforProfiles = null;
|
public SapforProfilesDBTable sapforProfiles = null;
|
||||||
//---------
|
//---------
|
||||||
public SapforProfileSettingsDBTable sapforProfilesSettings = null;
|
public SapforProfileSettingsDBTable sapforProfilesSettings = null;
|
||||||
@@ -86,7 +72,6 @@ public class GlobalDatabase extends SQLiteDatabase {
|
|||||||
addTable(machines = new MachinesDBTable());
|
addTable(machines = new MachinesDBTable());
|
||||||
addTable(users = new UsersDBTable());
|
addTable(users = new UsersDBTable());
|
||||||
addTable(compilers = new CompilersDBTable());
|
addTable(compilers = new CompilersDBTable());
|
||||||
addTable(remoteSapfors = new RemoteSapforsDBTable());
|
|
||||||
addTable(makefiles = new MakefilesDBTable());
|
addTable(makefiles = new MakefilesDBTable());
|
||||||
addTable(modules = new ModulesDBTable());
|
addTable(modules = new ModulesDBTable());
|
||||||
addTable(compilationTasks = new CompilationTasksDBTable());
|
addTable(compilationTasks = new CompilationTasksDBTable());
|
||||||
@@ -104,11 +89,6 @@ public class GlobalDatabase extends SQLiteDatabase {
|
|||||||
addTable(dvmParameters = new DVMParameterDBTable());
|
addTable(dvmParameters = new DVMParameterDBTable());
|
||||||
addTable(grids = new GridsDBTable());
|
addTable(grids = new GridsDBTable());
|
||||||
addTable(tasksKeys = new TaskKeysDBTable());
|
addTable(tasksKeys = new TaskKeysDBTable());
|
||||||
//--
|
|
||||||
// addTable(sapforScenarios = new SapforScenariosDBTable());
|
|
||||||
// addTable(sapforTasksPackages = new SapforTasksPackagesDBTable());
|
|
||||||
// addTable(sapforTasks = new SapforTasksDBTable());
|
|
||||||
//--
|
|
||||||
addTable(sapforProfiles = new SapforProfilesDBTable());
|
addTable(sapforProfiles = new SapforProfilesDBTable());
|
||||||
addTable(sapforProfilesSettings = new SapforProfileSettingsDBTable());
|
addTable(sapforProfilesSettings = new SapforProfileSettingsDBTable());
|
||||||
}
|
}
|
||||||
@@ -138,8 +118,6 @@ public class GlobalDatabase extends SQLiteDatabase {
|
|||||||
credentials.makefile_id = Current.getMakefile().id;
|
credentials.makefile_id = Current.getMakefile().id;
|
||||||
if (Current.HasRunConfiguration())
|
if (Current.HasRunConfiguration())
|
||||||
credentials.runconfiguration_id = Current.getRunConfiguration().id;
|
credentials.runconfiguration_id = Current.getRunConfiguration().id;
|
||||||
if (Current.HasRemoteSapfor())
|
|
||||||
credentials.remotesapfor_id = Current.getRemoteSapfor().id;
|
|
||||||
Update(credentials);
|
Update(credentials);
|
||||||
}
|
}
|
||||||
public void UpdateCredentials() {
|
public void UpdateCredentials() {
|
||||||
@@ -156,17 +134,7 @@ public class GlobalDatabase extends SQLiteDatabase {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
public LinkedHashMap<Long, SapforTask> getSapforPackageTasks(int package_id) throws Exception {
|
public DataSet<String, SapforTaskResult> getSapforPackagesMasterDataSet(SapforConfigurationTasksSet package_in) throws Exception {
|
||||||
LinkedHashMap<Long, SapforTask> res = new LinkedHashMap<>();
|
|
||||||
for (SapforTask task : sapforTasks.Data.values()) {
|
|
||||||
if (task.sapfor_configuration_id == package_id) {
|
|
||||||
res.put(task.id, task);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
public DataSet<String, SapforTaskResult> getSapforPackagesMasterDataSet(SapforTasksPackage package_in) throws Exception {
|
|
||||||
DataSet<String, SapforTaskResult> res = new DataSet<String, SapforTaskResult>(String.class, SapforTaskResult.class) {
|
DataSet<String, SapforTaskResult> res = new DataSet<String, SapforTaskResult>(String.class, SapforTaskResult.class) {
|
||||||
@Override
|
@Override
|
||||||
protected DataSetControlForm createUI() {
|
protected DataSetControlForm createUI() {
|
||||||
@@ -209,11 +177,9 @@ public class GlobalDatabase extends SQLiteDatabase {
|
|||||||
for (SapforTask task : sapforTasks.Data.values())
|
for (SapforTask task : sapforTasks.Data.values())
|
||||||
if (task.sapfor_configuration_id == package_in.id)
|
if (task.sapfor_configuration_id == package_in.id)
|
||||||
res.put(task.test_description, new SapforTaskResult(package_in, task));
|
res.put(task.test_description, new SapforTaskResult(package_in, task));
|
||||||
*/
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
//--
|
public DataSet<String, SapforTaskResult> getSapforPackagesSlaveDataSet(SapforConfigurationTasksSet package_in) throws Exception {
|
||||||
public DataSet<String, SapforTaskResult> getSapforPackagesSlaveDataSet(SapforTasksPackage package_in) throws Exception {
|
|
||||||
DataSet<String, SapforTaskResult> res = new DataSet<String, SapforTaskResult>(String.class, SapforTaskResult.class) {
|
DataSet<String, SapforTaskResult> res = new DataSet<String, SapforTaskResult>(String.class, SapforTaskResult.class) {
|
||||||
@Override
|
@Override
|
||||||
protected DataSetControlForm createUI() {
|
protected DataSetControlForm createUI() {
|
||||||
@@ -256,13 +222,13 @@ public class GlobalDatabase extends SQLiteDatabase {
|
|||||||
return Current.SapforTaskResult;
|
return Current.SapforTaskResult;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/*
|
|
||||||
for (SapforTask task : sapforTasks.Data.values())
|
for (SapforTask task : sapforTasks.Data.values())
|
||||||
if (task.sapfor_configuration_id == package_in.id)
|
if (task.sapfor_configuration_id == package_in.id)
|
||||||
res.put(task.test_description, new SapforTaskResult(package_in, task));
|
res.put(task.test_description, new SapforTaskResult(package_in, task));
|
||||||
*/
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
//--
|
//--
|
||||||
public LinkedHashMap<SettingName, String> getSapforSettingsForProfile() {
|
public LinkedHashMap<SettingName, String> getSapforSettingsForProfile() {
|
||||||
LinkedHashMap<SettingName, String> res = new LinkedHashMap<>();
|
LinkedHashMap<SettingName, String> res = new LinkedHashMap<>();
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import GlobalData.EnvironmentValue.EnvironmentValue;
|
|||||||
import GlobalData.Machine.UI.MachineFields;
|
import GlobalData.Machine.UI.MachineFields;
|
||||||
import GlobalData.Makefile.Makefile;
|
import GlobalData.Makefile.Makefile;
|
||||||
import GlobalData.Module.Module;
|
import GlobalData.Module.Module;
|
||||||
import GlobalData.RemoteSapfor.RemoteSapfor;
|
|
||||||
import GlobalData.RunConfiguration.RunConfiguration;
|
import GlobalData.RunConfiguration.RunConfiguration;
|
||||||
import GlobalData.Tasks.CompilationTask.CompilationTask;
|
import GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||||
import GlobalData.Tasks.RunTask.RunTask;
|
import GlobalData.Tasks.RunTask.RunTask;
|
||||||
@@ -67,7 +66,6 @@ public class MachinesDBTable extends iDBTable<Machine> {
|
|||||||
//-
|
//-
|
||||||
res.put(User.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
res.put(User.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||||
res.put(Compiler.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
res.put(Compiler.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||||
res.put(RemoteSapfor.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
|
||||||
res.put(Makefile.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
res.put(Makefile.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||||
res.put(RunConfiguration.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
res.put(RunConfiguration.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||||
//-
|
//-
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
package GlobalData.RemoteSapfor;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Database.iDBObject;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
import GlobalData.Machine.Machine;
|
|
||||||
import ProjectData.LanguageName;
|
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
|
||||||
public class RemoteSapfor extends iDBObject {
|
|
||||||
//---------------------------------------------------------------------
|
|
||||||
@Description("IGNORE")
|
|
||||||
public static String version_command = "-ver";//команда запроса версии компилятора.
|
|
||||||
@Description("IGNORE")
|
|
||||||
public static String help_command = "-help";// команда запроса help
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
public int machine_id = -1;
|
|
||||||
public String description = "";
|
|
||||||
public LanguageName languageName = LanguageName.fortran;
|
|
||||||
public String home_path = ""; //домашняя папка.
|
|
||||||
public String call_command = ""; //полная команда вызова.
|
|
||||||
public String version = "?";
|
|
||||||
public RemoteSapfor() {
|
|
||||||
}
|
|
||||||
public RemoteSapfor(Machine machine,
|
|
||||||
String description_in,
|
|
||||||
LanguageName languageName_in,
|
|
||||||
String call_command_in
|
|
||||||
) {
|
|
||||||
machine_id = machine.id;
|
|
||||||
description = description_in;
|
|
||||||
languageName = languageName_in;
|
|
||||||
call_command = call_command_in;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean isVisible() {
|
|
||||||
return Current.HasMachine() && Current.getMachine().id == machine_id;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return call_command;
|
|
||||||
}
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
public String getVersionCommand() {
|
|
||||||
return Utils.DQuotes(call_command) + " " + version_command;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
package GlobalData.RemoteSapfor;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Database.iDBTable;
|
|
||||||
import Common.UI.DataSetControlForm;
|
|
||||||
import Common.UI.UI;
|
|
||||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
import Common.Utils.Validators.PathValidator;
|
|
||||||
import GlobalData.RemoteSapfor.UI.RemoteSapforFields;
|
|
||||||
import ProjectData.LanguageName;
|
|
||||||
public class RemoteSapforsDBTable extends iDBTable<RemoteSapfor> {
|
|
||||||
public RemoteSapforsDBTable() {
|
|
||||||
super(RemoteSapfor.class);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getSingleDescription() {
|
|
||||||
return "SAPFOR";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getPluralDescription() {
|
|
||||||
return "SAPFOR";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public Current CurrentName() {
|
|
||||||
return Current.RemoteSapfor;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String[] getUIColumnNames() {
|
|
||||||
return new String[]{"описание", "команда вызова", "версия"};
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public Object getFieldAt(RemoteSapfor object, int columnIndex) {
|
|
||||||
switch (columnIndex) {
|
|
||||||
case 1:
|
|
||||||
return object.description;
|
|
||||||
case 2:
|
|
||||||
return object.call_command;
|
|
||||||
case 3:
|
|
||||||
return object.version;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected DataSetControlForm createUI() {
|
|
||||||
return new DataSetControlForm(this) {
|
|
||||||
@Override
|
|
||||||
protected void AdditionalInitColumns() {
|
|
||||||
columns.get(0).setVisible(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
//---
|
|
||||||
@Override
|
|
||||||
public DBObjectDialog<RemoteSapfor, RemoteSapforFields> getDialog() {
|
|
||||||
return new DBObjectDialog<RemoteSapfor, RemoteSapforFields>(RemoteSapforFields.class) {
|
|
||||||
@Override
|
|
||||||
public void validateFields() {
|
|
||||||
//<editor-fold desc="расположение">
|
|
||||||
String home = fields.tfHome.getText();
|
|
||||||
if (!home.isEmpty()) {
|
|
||||||
if (home.startsWith("/")) {
|
|
||||||
if (Utils.ContainsCyrillic(home))
|
|
||||||
Log.Writeln("Расположение системы SAPFOR не может содержать кириллицу");
|
|
||||||
else {
|
|
||||||
new PathValidator(home, "Расположение системы SAPFOR", Log).Validate();
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
Log.Writeln("Расположение системы SAPFOR может быть либо пустой строкой, либо путём к файлу");
|
|
||||||
}
|
|
||||||
//</editor-fold>
|
|
||||||
//<editor-fold desc="команда вызова">
|
|
||||||
String call_command = fields.tfCallCommand.getText();
|
|
||||||
if (call_command.isEmpty()) Log.Writeln("Команда вызова системы SAPFOR не может быть пустой");
|
|
||||||
else if (Utils.ContainsCyrillic(call_command))
|
|
||||||
Log.Writeln("Команда вызова системы SAPFOR не может содержать кириллицу");
|
|
||||||
else {
|
|
||||||
switch (call_command.charAt(0)) {
|
|
||||||
case ' ':
|
|
||||||
Log.Writeln("Команда вызова системы SAPFOR не может начинаться с пробела.");
|
|
||||||
break;
|
|
||||||
case '/':
|
|
||||||
if (call_command.endsWith("/"))
|
|
||||||
Log.Writeln("Каталог не может быть указан в качестве команды.");
|
|
||||||
else new PathValidator(call_command, "Команда вызова системы SAPFOR", Log).Validate();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
//это команда.
|
|
||||||
//самое опасное место. теоретически тут можно ввести любую команду ОС, в том числе rm -rf
|
|
||||||
if (call_command.contains(" "))
|
|
||||||
Log.Writeln("Прямая команда вызова системы SAPFOR не может содержать пробелы");
|
|
||||||
if (!call_command.contains("+") && Utils.ContainsForbiddenName(call_command))
|
|
||||||
Log.Writeln("Прямая команда вызова системы SAPFOR содержит запрещённые символы");
|
|
||||||
else {
|
|
||||||
if (Utils.isLinuxSystemCommand(call_command))
|
|
||||||
Log.Writeln(Utils.DQuotes(call_command) + " является системной командой Linux");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//</editor-fold>
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void fillFields() {
|
|
||||||
fields.tfDescription.setText(Result.description);
|
|
||||||
fields.tfCallCommand.setText(Result.call_command);
|
|
||||||
fields.tfHome.setText(Result.home_path);
|
|
||||||
UI.TrySelect(fields.cbLanguageName, Result.languageName);
|
|
||||||
fields.tfVersion.setText(Result.version);
|
|
||||||
fields.events_on = true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void ProcessResult() {
|
|
||||||
Result.machine_id = Current.getMachine().id;
|
|
||||||
Result.description = fields.tfDescription.getText();
|
|
||||||
Result.call_command = fields.tfCallCommand.getText();
|
|
||||||
Result.home_path = fields.tfHome.getText();
|
|
||||||
Result.languageName = (LanguageName) fields.cbLanguageName.getSelectedItem();
|
|
||||||
Result.version = fields.tfVersion.getText();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public int getDefaultHeight() {
|
|
||||||
return 300;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="GlobalData.RemoteSapfor.UI.RemoteSapforFields">
|
|
||||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
|
||||||
<constraints>
|
|
||||||
<xy x="20" y="20" width="500" height="400"/>
|
|
||||||
</constraints>
|
|
||||||
<properties/>
|
|
||||||
<border type="none"/>
|
|
||||||
<children>
|
|
||||||
<component id="a4409" class="javax.swing.JLabel">
|
|
||||||
<constraints>
|
|
||||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
|
||||||
<text value="описание"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<vspacer id="ff938">
|
|
||||||
<constraints>
|
|
||||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
</vspacer>
|
|
||||||
<component id="d8b80" class="javax.swing.JTextField" binding="tfDescription" custom-create="true">
|
|
||||||
<constraints>
|
|
||||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
|
||||||
<preferred-size width="150" height="-1"/>
|
|
||||||
</grid>
|
|
||||||
</constraints>
|
|
||||||
<properties/>
|
|
||||||
</component>
|
|
||||||
<component id="38f55" class="javax.swing.JLabel">
|
|
||||||
<constraints>
|
|
||||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
|
||||||
<text value="расположение"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="4599c" class="javax.swing.JTextField" binding="tfHome" custom-create="true">
|
|
||||||
<constraints>
|
|
||||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
|
||||||
<preferred-size width="150" height="-1"/>
|
|
||||||
</grid>
|
|
||||||
</constraints>
|
|
||||||
<properties/>
|
|
||||||
</component>
|
|
||||||
<component id="92f09" class="javax.swing.JButton" binding="bBrowse">
|
|
||||||
<constraints>
|
|
||||||
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<enabled value="true"/>
|
|
||||||
<icon value="icons/LastOpened.png"/>
|
|
||||||
<text value=""/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="66fe1" class="javax.swing.JLabel">
|
|
||||||
<constraints>
|
|
||||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
|
||||||
<text value="команда вызова"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="bb2d7" class="javax.swing.JTextField" binding="tfCallCommand" custom-create="true">
|
|
||||||
<constraints>
|
|
||||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
|
||||||
<preferred-size width="150" height="-1"/>
|
|
||||||
</grid>
|
|
||||||
</constraints>
|
|
||||||
<properties/>
|
|
||||||
</component>
|
|
||||||
<component id="99516" class="javax.swing.JLabel">
|
|
||||||
<constraints>
|
|
||||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
|
||||||
<text value="язык"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="113b3" class="javax.swing.JComboBox" binding="cbLanguageName" custom-create="true">
|
|
||||||
<constraints>
|
|
||||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<toolTipText value="выберите тип компилятора"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="3f186" class="javax.swing.JLabel">
|
|
||||||
<constraints>
|
|
||||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
|
||||||
<text value="версия"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="acebb" class="javax.swing.JTextField" binding="tfVersion" custom-create="true">
|
|
||||||
<constraints>
|
|
||||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
|
||||||
<preferred-size width="150" height="-1"/>
|
|
||||||
</grid>
|
|
||||||
</constraints>
|
|
||||||
<properties/>
|
|
||||||
</component>
|
|
||||||
</children>
|
|
||||||
</grid>
|
|
||||||
</form>
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
package GlobalData.RemoteSapfor.UI;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.UI.TextField.StyledTextField;
|
|
||||||
import Common.UI.Windows.Dialog.DialogFields;
|
|
||||||
import ProjectData.LanguageName;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.event.DocumentEvent;
|
|
||||||
import javax.swing.event.DocumentListener;
|
|
||||||
import java.awt.*;
|
|
||||||
public class RemoteSapforFields implements DialogFields {
|
|
||||||
private JPanel content;
|
|
||||||
public JTextField tfDescription;
|
|
||||||
public JTextField tfHome;
|
|
||||||
private JButton bBrowse;
|
|
||||||
public JTextField tfCallCommand;
|
|
||||||
public JComboBox<LanguageName> cbLanguageName;
|
|
||||||
public JTextField tfVersion;
|
|
||||||
public boolean events_on = false;
|
|
||||||
@Override
|
|
||||||
public Component getContent() {
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
private void createUIComponents() {
|
|
||||||
// TODO: place custom component creation code here
|
|
||||||
tfDescription = new StyledTextField();
|
|
||||||
tfHome = new StyledTextField();
|
|
||||||
tfCallCommand = new StyledTextField();
|
|
||||||
cbLanguageName = new JComboBox<>();
|
|
||||||
cbLanguageName.addItem(LanguageName.fortran);
|
|
||||||
tfVersion = new StyledTextField();
|
|
||||||
}
|
|
||||||
public RemoteSapforFields() {
|
|
||||||
bBrowse.addActionListener(e -> {
|
|
||||||
// LanguageName languageName = (LanguageName) cbLanguageName.getSelectedItem();
|
|
||||||
String dst = null;
|
|
||||||
if (Pass_2021.passes.get(PassCode_2021.SelectRemoteFile).Do(true))
|
|
||||||
dst = Current.getRemoteFile().full_name;
|
|
||||||
if (dst != null)
|
|
||||||
tfHome.setText(dst);
|
|
||||||
});
|
|
||||||
tfHome.getDocument().addDocumentListener(new DocumentListener() {
|
|
||||||
@Override
|
|
||||||
public void insertUpdate(DocumentEvent e) {
|
|
||||||
TryRestoreCallCommand();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void removeUpdate(DocumentEvent e) {
|
|
||||||
TryRestoreCallCommand();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void changedUpdate(DocumentEvent e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
public void TryRestoreCallCommand() {
|
|
||||||
if (events_on && (cbLanguageName.getSelectedItem() != null))
|
|
||||||
tfCallCommand.setText(tfHome.getText() +
|
|
||||||
(tfHome.getText().endsWith("/") ? "" : "/") +
|
|
||||||
"Sapfor_F");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -68,5 +68,6 @@ public enum ServerCode {
|
|||||||
SetRole,
|
SetRole,
|
||||||
InstallSapforForTesting,
|
InstallSapforForTesting,
|
||||||
StartSapforTests,
|
StartSapforTests,
|
||||||
|
GetFirstActiveSapforTasksPackage,
|
||||||
OLD
|
OLD
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import com.google.gson.annotations.Expose;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class PackageModeScenario_json {
|
public class SapforTasksPackage_json {
|
||||||
@Expose
|
@Expose
|
||||||
public String sapfor_drv = ""; //файл с сапфором. Имя уникально для сценария.
|
public String sapfor_drv = ""; //файл с сапфором. Имя уникально для сценария.
|
||||||
@Expose
|
@Expose
|
||||||
@@ -4,7 +4,7 @@ import com.google.gson.annotations.Expose;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class SapforScenarioResults_json {
|
public class SapforTasksResults_json {
|
||||||
@Expose
|
@Expose
|
||||||
public long StartDate = 0;
|
public long StartDate = 0;
|
||||||
@Expose
|
@Expose
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package SapforTestingSystem.SapforScenario;
|
|
||||||
import Common.Database.iDBObject;
|
|
||||||
import TestingSystem.TasksPackage.TasksPackageState;
|
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
|
||||||
public class SapforScenario extends iDBObject {
|
|
||||||
@Description("DEFAULT ''")
|
|
||||||
public String testsNames = "";//имена тестов через ; для отображения
|
|
||||||
//---
|
|
||||||
public String sapfor_version = "?"; //тестируемая версия SAPFOR
|
|
||||||
public long sapfor_build_date = 0;
|
|
||||||
//---
|
|
||||||
public String workspace = ""; //домашняя папка
|
|
||||||
//---
|
|
||||||
public int tasksCount = 0; //Общее число задач
|
|
||||||
//---
|
|
||||||
public long StartDate = 0; //дата начала выполнения
|
|
||||||
public long ChangeDate = 0;//дата окончания выполнения
|
|
||||||
//-
|
|
||||||
public TasksPackageState state = TasksPackageState.Queued;
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
package SapforTestingSystem.SapforScenario;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Database.iDBTable;
|
|
||||||
import Common.UI.DataSetControlForm;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import static Common.UI.Tables.TableRenderers.RendererDate;
|
|
||||||
import static Common.UI.Tables.TableRenderers.RendererStatusEnum;
|
|
||||||
public class SapforScenariosDBTable extends iDBTable<SapforScenario> {
|
|
||||||
public SapforScenariosDBTable() {
|
|
||||||
super(SapforScenario.class);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public Current CurrentName() {
|
|
||||||
return Current.SapforScenario;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getSingleDescription() {
|
|
||||||
return "сценарий Sapfor";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getPluralDescription() {
|
|
||||||
return "сценарии Sapfor";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected DataSetControlForm createUI() {
|
|
||||||
return new DataSetControlForm(this) {
|
|
||||||
@Override
|
|
||||||
protected void AdditionalInitColumns() {
|
|
||||||
columns.get(4).setRenderer(RendererDate);
|
|
||||||
columns.get(5).setRenderer(RendererDate);
|
|
||||||
columns.get(6).setRenderer(RendererStatusEnum);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void ShowCurrentObject() throws Exception {
|
|
||||||
super.ShowCurrentObject();
|
|
||||||
// UI.getNewMainWindow().getTestingWindow().DropTestRunTasksComparison();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void ShowNoCurrentObject() throws Exception {
|
|
||||||
super.ShowNoCurrentObject();
|
|
||||||
// UI.getNewMainWindow().getTestingWindow().DropTestRunTasksComparison();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String[] getUIColumnNames() {
|
|
||||||
return new String[]{
|
|
||||||
"SAPFOR",
|
|
||||||
"Тесты",
|
|
||||||
"Задач",
|
|
||||||
"Начало",
|
|
||||||
"Изменено",
|
|
||||||
"Статус"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public Object getFieldAt(SapforScenario object, int columnIndex) {
|
|
||||||
switch (columnIndex) {
|
|
||||||
case 1:
|
|
||||||
return object.sapfor_version;
|
|
||||||
case 2:
|
|
||||||
return object.testsNames;
|
|
||||||
case 3:
|
|
||||||
return object.tasksCount;
|
|
||||||
case 4:
|
|
||||||
return new Date(object.StartDate);
|
|
||||||
case 5:
|
|
||||||
return new Date(object.ChangeDate);
|
|
||||||
case 6:
|
|
||||||
return object.state;
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
@Override
|
|
||||||
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
|
||||||
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
|
||||||
res.put(SapforTasksPackage.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
@@ -22,6 +22,9 @@ public class SapforTask extends DBObject {
|
|||||||
@Description("DEFAULT ''")
|
@Description("DEFAULT ''")
|
||||||
@Expose
|
@Expose
|
||||||
public String root = "";
|
public String root = "";
|
||||||
|
@Description("DEFAULT ''")
|
||||||
|
@Expose
|
||||||
|
public String last_version = "";
|
||||||
//-------------------------------------->>
|
//-------------------------------------->>
|
||||||
@Description("DEFAULT 'Inactive'")
|
@Description("DEFAULT 'Inactive'")
|
||||||
@Expose
|
@Expose
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
package SapforTestingSystem.SapforTask;
|
|
||||||
import Common.Database.DBObject;
|
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
|
||||||
public class SapforTaskResult extends DBObject {
|
|
||||||
public SapforTasksPackage sapforTasksPackage;
|
|
||||||
public SapforTask task;
|
|
||||||
public MatchState match_state = MatchState.Unknown;
|
|
||||||
@Override
|
|
||||||
public Object getPK() {
|
|
||||||
return task.test_description;
|
|
||||||
}
|
|
||||||
public SapforTaskResult(SapforTasksPackage package_in, SapforTask task_in) {
|
|
||||||
sapforTasksPackage = package_in;
|
|
||||||
task = task_in;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,8 +2,6 @@ package SapforTestingSystem.SapforTask;
|
|||||||
import Common.Current;
|
import Common.Current;
|
||||||
import Common.Database.DBTable;
|
import Common.Database.DBTable;
|
||||||
import Common.UI.DataSetControlForm;
|
import Common.UI.DataSetControlForm;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
|
|
||||||
import static Common.UI.Tables.TableRenderers.RendererStatusEnum;
|
import static Common.UI.Tables.TableRenderers.RendererStatusEnum;
|
||||||
public class SapforTasksDBTable extends DBTable<Long, SapforTask> {
|
public class SapforTasksDBTable extends DBTable<Long, SapforTask> {
|
||||||
@@ -31,7 +29,7 @@ public class SapforTasksDBTable extends DBTable<Long, SapforTask> {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void MouseAction2() throws Exception {
|
public void MouseAction2() throws Exception {
|
||||||
Pass_2021.passes.get(PassCode_2021.OpenSapforTest).Do();
|
// Pass_2021.passes.get(PassCode_2021.OpenSapforTest).Do();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,50 +1,26 @@
|
|||||||
package SapforTestingSystem.SapforTasksPackage;
|
package SapforTestingSystem.SapforTasksPackage;
|
||||||
import Common.Constants;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Database.DBObject;
|
|
||||||
import Common.Database.iDBObject;
|
import Common.Database.iDBObject;
|
||||||
import SapforTestingSystem.SapforConfiguration.SapforConfiguration;
|
import TestingSystem.TasksPackage.TasksPackageState;
|
||||||
import TestingSystem.Test.Test;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
|
|
||||||
import java.util.Vector;
|
|
||||||
public class SapforTasksPackage extends iDBObject {
|
public class SapforTasksPackage extends iDBObject {
|
||||||
public int sapforscenario_id = Constants.Nan;
|
|
||||||
@Description("DEFAULT ''")
|
@Description("DEFAULT ''")
|
||||||
public String sapforconfiguration_id = "";
|
public String testsNames = "";//имена тестов через ; для отображения
|
||||||
//--
|
//---
|
||||||
|
public String sapfor_version = "?"; //тестируемая версия SAPFOR
|
||||||
|
public long sapfor_build_date = 0;
|
||||||
|
//---
|
||||||
public String workspace = ""; //домашняя папка
|
public String workspace = ""; //домашняя папка
|
||||||
//---
|
//---
|
||||||
@Description("DEFAULT ''")
|
public int tasksCount = 0; //Общее число задач
|
||||||
public String flags = "";
|
//---
|
||||||
@Description("DEFAULT ''")
|
public long StartDate = 0; //дата начала выполнения
|
||||||
public String passesNames = "";
|
public long ChangeDate = 0;//дата окончания выполнения
|
||||||
@Description("DEFAULT 0")
|
//-
|
||||||
public int versions_tree_built = 0;
|
public TasksPackageState state = TasksPackageState.Queued;
|
||||||
//--
|
// допустимые состояния
|
||||||
@Description("IGNORE")
|
//Queued
|
||||||
public Vector<Test> tests = null;
|
//PackageStart
|
||||||
@Description("IGNORE")
|
//RunningExecution
|
||||||
public Vector<PassCode_2021> codes = null;
|
//Done
|
||||||
//--
|
//Aborted
|
||||||
@Override
|
|
||||||
public void SynchronizeFields(DBObject src) {
|
|
||||||
super.SynchronizeFields(src);
|
|
||||||
SapforTasksPackage tasksPackage = (SapforTasksPackage) src;
|
|
||||||
flags = tasksPackage.flags;
|
|
||||||
passesNames = tasksPackage.passesNames;
|
|
||||||
}
|
|
||||||
public SapforTasksPackage(SapforTasksPackage src) {
|
|
||||||
this.SynchronizeFields(src);
|
|
||||||
}
|
|
||||||
public SapforTasksPackage() {
|
|
||||||
}
|
|
||||||
public SapforTasksPackage(SapforConfiguration configuration_in, Vector<Test> tests_in) {
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean isVisible() {
|
|
||||||
return Current.HasSapforScenario() && Current.getSapforScenario().id == sapforscenario_id;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +1,37 @@
|
|||||||
package SapforTestingSystem.SapforTasksPackage;
|
package SapforTestingSystem.SapforTasksPackage;
|
||||||
import Common.Current;
|
import Common.Current;
|
||||||
import Common.Database.*;
|
import Common.Database.iDBTable;
|
||||||
import Common.UI.DataSetControlForm;
|
import Common.UI.DataSetControlForm;
|
||||||
import SapforTestingSystem.SapforTask.SapforTask;
|
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import static Common.UI.Tables.TableRenderers.RendererDate;
|
||||||
|
import static Common.UI.Tables.TableRenderers.RendererStatusEnum;
|
||||||
public class SapforTasksPackagesDBTable extends iDBTable<SapforTasksPackage> {
|
public class SapforTasksPackagesDBTable extends iDBTable<SapforTasksPackage> {
|
||||||
public SapforTasksPackagesDBTable() {
|
public SapforTasksPackagesDBTable() {
|
||||||
super(SapforTasksPackage.class);
|
super(SapforTasksPackage.class);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Current CurrentName() {
|
public Current CurrentName() {
|
||||||
return Current.SapforTasksPackage;
|
return Current.SapforScenario;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String getSingleDescription() {
|
public String getSingleDescription() {
|
||||||
return "пакеты задач Sapfor";
|
return "пакет задач Sapfor";
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String getPluralDescription() {
|
public String getPluralDescription() {
|
||||||
return "пакеты задач";
|
return "пакеты задач Sapfor";
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected DataSetControlForm createUI() {
|
protected DataSetControlForm createUI() {
|
||||||
return new DataSetControlForm(this) {
|
return new DataSetControlForm(this) {
|
||||||
|
@Override
|
||||||
|
protected void AdditionalInitColumns() {
|
||||||
|
columns.get(4).setRenderer(RendererDate);
|
||||||
|
columns.get(5).setRenderer(RendererDate);
|
||||||
|
columns.get(6).setRenderer(RendererStatusEnum);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void ShowCurrentObject() throws Exception {
|
public void ShowCurrentObject() throws Exception {
|
||||||
super.ShowCurrentObject();
|
super.ShowCurrentObject();
|
||||||
@@ -39,25 +47,39 @@ public class SapforTasksPackagesDBTable extends iDBTable<SapforTasksPackage> {
|
|||||||
@Override
|
@Override
|
||||||
public String[] getUIColumnNames() {
|
public String[] getUIColumnNames() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"Проходы",
|
"SAPFOR",
|
||||||
"Флаги"
|
"Тесты",
|
||||||
|
"Задач",
|
||||||
|
"Начало",
|
||||||
|
"Изменено",
|
||||||
|
"Статус"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Object getFieldAt(SapforTasksPackage object, int columnIndex) {
|
public Object getFieldAt(SapforTasksPackage object, int columnIndex) {
|
||||||
switch (columnIndex) {
|
switch (columnIndex) {
|
||||||
case 1:
|
case 1:
|
||||||
return object.passesNames;
|
return object.sapfor_version;
|
||||||
case 2:
|
case 2:
|
||||||
return object.flags;
|
return object.testsNames;
|
||||||
|
case 3:
|
||||||
|
return object.tasksCount;
|
||||||
|
case 4:
|
||||||
|
return new Date(object.StartDate);
|
||||||
|
case 5:
|
||||||
|
return new Date(object.ChangeDate);
|
||||||
|
case 6:
|
||||||
|
return object.state;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
||||||
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
||||||
res.put(SapforTask.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
res.put(SapforTasksPackage.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package SapforTestingSystem.SapforScenarioSupervisor;
|
package SapforTestingSystem.SapforTasksPackageSupervisor;
|
||||||
import Common.Constants;
|
import Common.Constants;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import SapforTestingSystem.Json.SapforConfiguration_json;
|
import SapforTestingSystem.Json.SapforConfiguration_json;
|
||||||
import SapforTestingSystem.Json.SapforScenarioResults_json;
|
import SapforTestingSystem.Json.SapforTasksResults_json;
|
||||||
import SapforTestingSystem.Json.PackageModeScenario_json;
|
import SapforTestingSystem.Json.SapforTasksPackage_json;
|
||||||
import SapforTestingSystem.PerformSapforTask;
|
import SapforTestingSystem.PerformSapforTask;
|
||||||
import SapforTestingSystem.SapforTask.SapforTask;
|
import SapforTestingSystem.SapforTask.SapforTask;
|
||||||
import SapforTestingSystem.ThreadsPlanner.ThreadsPlanner;
|
import SapforTestingSystem.ThreadsPlanner.ThreadsPlanner;
|
||||||
@@ -12,17 +12,17 @@ import org.apache.commons.io.FileUtils;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
public class SapforScenarioSupervisor extends ThreadsPlanner {
|
public class SapforTasksPackageSupervisor extends ThreadsPlanner {
|
||||||
PackageModeScenario_json scenario_json = null;
|
SapforTasksPackage_json package_json = null;
|
||||||
SapforScenarioResults_json results_json = new SapforScenarioResults_json();
|
SapforTasksResults_json results_json = new SapforTasksResults_json();
|
||||||
public SapforScenarioSupervisor() throws Exception {
|
public SapforTasksPackageSupervisor() throws Exception {
|
||||||
super(Global.properties.threadsTimeout, Global.properties.threadsNum);
|
super(Global.properties.threadsTimeout, Global.properties.threadsNum);
|
||||||
scenario_json = (PackageModeScenario_json) Utils.jsonFromFile(new File(Global.Home, "scenario"), PackageModeScenario_json.class);
|
package_json = (SapforTasksPackage_json) Utils.jsonFromFile(new File(Global.Home, "scenario"), SapforTasksPackage_json.class);
|
||||||
results_json.StartDate = new Date().getTime();
|
results_json.StartDate = new Date().getTime();
|
||||||
//формирование списка задач.
|
//формирование списка задач.
|
||||||
File sapfor_drv = new File(Global.Home, scenario_json.sapfor_drv);
|
File sapfor_drv = new File(Global.Home, package_json.sapfor_drv);
|
||||||
for (SapforConfiguration_json sapforConfiguration_json : scenario_json.packages) {
|
for (SapforConfiguration_json sapforConfiguration_json : package_json.packages) {
|
||||||
for (String testName : scenario_json.tests) {
|
for (String testName : package_json.tests) {
|
||||||
//--- чтобы было можно на нее сослаться после выполнения всех нитей.
|
//--- чтобы было можно на нее сослаться после выполнения всех нитей.
|
||||||
SapforTask task = new SapforTask();
|
SapforTask task = new SapforTask();
|
||||||
results_json.tasks.add(task);
|
results_json.tasks.add(task);
|
||||||
@@ -39,12 +39,14 @@ public class SapforScenarioSupervisor extends ThreadsPlanner {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void Interrupt() throws Exception {
|
public void Interrupt() throws Exception {
|
||||||
System.out.println("killing " + scenario_json.sapfor_drv + "...");
|
/*
|
||||||
String kill_command = Global.isWindows ? ("taskkill /FI \"IMAGENAME eq " + scenario_json.sapfor_drv + "\" /F /T") :
|
System.out.println("killing " + package_json.sapfor_drv + "...");
|
||||||
("killall -SIGKILL " + scenario_json.sapfor_drv);
|
String kill_command = Global.isWindows ? ("taskkill /FI \"IMAGENAME eq " + package_json.sapfor_drv + "\" /F /T") :
|
||||||
|
("killall -SIGKILL " + package_json.sapfor_drv);
|
||||||
Process killer = Runtime.getRuntime().exec(kill_command);
|
Process killer = Runtime.getRuntime().exec(kill_command);
|
||||||
killer.waitFor();
|
killer.waitFor();
|
||||||
System.out.println("done!");
|
System.out.println("done!");
|
||||||
|
*/
|
||||||
|
|
||||||
//todo для надежности сделать еще один kill с внешнего процесса.
|
//todo для надежности сделать еще один kill с внешнего процесса.
|
||||||
// может быть гонка, что нить успеет запустить процесс уже после интеррупта.
|
// может быть гонка, что нить успеет запустить процесс уже после интеррупта.
|
||||||
@@ -55,9 +57,7 @@ public class SapforScenarioSupervisor extends ThreadsPlanner {
|
|||||||
|
|
||||||
//записать результаты всех задач.
|
//записать результаты всех задач.
|
||||||
try {
|
try {
|
||||||
System.out.println("Запись результатов");
|
|
||||||
Utils.jsonToFile(results_json, new File(Global.Home, "results"));
|
Utils.jsonToFile(results_json, new File(Global.Home, "results"));
|
||||||
// System.out.println("Очистка служебных файлов");
|
|
||||||
//тут же и строить версии.
|
//тут же и строить версии.
|
||||||
Utils.deleteFilesByExtensions(new File(Global.Home),"proj","dep"); //Потом txt тоже добавить.
|
Utils.deleteFilesByExtensions(new File(Global.Home),"proj","dep"); //Потом txt тоже добавить.
|
||||||
FileUtils.writeStringToFile(new File(Constants.DONE), "");
|
FileUtils.writeStringToFile(new File(Constants.DONE), "");
|
||||||
@@ -1,6 +1,86 @@
|
|||||||
package SapforTestingSystem.ServerSapforTestingPlanner;
|
package SapforTestingSystem.ServerSapforTestingPlanner;
|
||||||
public class ServerSapforTestingPlanner {
|
import Common.Constants;
|
||||||
public void Perform(){
|
import Common.Utils.Utils;
|
||||||
|
import Repository.Server.ServerCode;
|
||||||
|
import Repository.Server.ServerExchangeUnit_2021;
|
||||||
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||||
|
import TestingSystem.TasksPackage.TasksPackageState;
|
||||||
|
import Visual_DVM_2021.Passes.PassException;
|
||||||
|
import Visual_DVM_2021.Passes.TestingSystemPass;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
public class ServerSapforTestingPlanner {
|
||||||
|
SapforTasksPackage sapforTasksPackage = null;
|
||||||
|
//---
|
||||||
|
int getSleepMillis() {
|
||||||
|
return 2000;
|
||||||
|
}
|
||||||
|
Object ServerCommand(ServerCode code_in, String arg, Serializable object_in) throws Exception {
|
||||||
|
TestingSystemPass<Object> pass = new TestingSystemPass<Object>() {
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void ServerAction() throws Exception {
|
||||||
|
Command(new ServerExchangeUnit_2021(code_in, arg, object_in));
|
||||||
|
target = response.object;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (!pass.Do()) throw new PassException("Ошибка взаимодействия с сервером " + code_in);
|
||||||
|
return pass.target;
|
||||||
|
}
|
||||||
|
//---
|
||||||
|
void UpdatePackage(SapforTasksPackage package_in) throws Exception {
|
||||||
|
package_in.ChangeDate = new Date().getTime();
|
||||||
|
ServerCommand(ServerCode.EditObject, "", package_in);
|
||||||
|
}
|
||||||
|
void PackageStart() throws Exception {
|
||||||
|
File workspace = new File(sapforTasksPackage.workspace);
|
||||||
|
File script = new File(sapforTasksPackage.workspace, "start");
|
||||||
|
ProcessBuilder procBuilder = new ProcessBuilder(script.getAbsolutePath());
|
||||||
|
procBuilder.directory(workspace);
|
||||||
|
procBuilder.start();
|
||||||
|
sapforTasksPackage.state = TasksPackageState.RunningExecution;
|
||||||
|
UpdatePackage(sapforTasksPackage);
|
||||||
|
}
|
||||||
|
void CheckPackageState() throws Exception {
|
||||||
|
File done = new File(sapforTasksPackage.workspace, Constants.DONE);
|
||||||
|
File aborted = new File(sapforTasksPackage.workspace, Constants.ABORTED);
|
||||||
|
if (done.exists()) {
|
||||||
|
sapforTasksPackage.state = TasksPackageState.Done;
|
||||||
|
UpdatePackage(sapforTasksPackage);
|
||||||
|
} else if (aborted.exists()) {
|
||||||
|
sapforTasksPackage.state = TasksPackageState.Aborted;
|
||||||
|
UpdatePackage(sapforTasksPackage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Perform() {
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
|
//-
|
||||||
|
sapforTasksPackage = (SapforTasksPackage) ServerCommand(ServerCode.GetFirstActiveSapforTasksPackage, "", null);
|
||||||
|
switch (sapforTasksPackage.state) {
|
||||||
|
case PackageStart:
|
||||||
|
PackageStart();
|
||||||
|
break;
|
||||||
|
case RunningExecution:
|
||||||
|
CheckPackageState();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//-
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
Utils.sleep(getSleepMillis());
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ import Repository.RepositoryRefuseException;
|
|||||||
import Repository.RepositoryServer;
|
import Repository.RepositoryServer;
|
||||||
import Repository.Server.ServerCode;
|
import Repository.Server.ServerCode;
|
||||||
import Repository.Server.ServerExchangeUnit_2021;
|
import Repository.Server.ServerExchangeUnit_2021;
|
||||||
import SapforTestingSystem.Json.PackageModeScenario_json;
|
import SapforTestingSystem.Json.SapforTasksPackage_json;
|
||||||
import SapforTestingSystem.Json.SapforConfiguration_json;
|
import SapforTestingSystem.Json.SapforConfiguration_json;
|
||||||
import SapforTestingSystem.SapforConfiguration.SapforConfiguration;
|
import SapforTestingSystem.SapforConfiguration.SapforConfiguration;
|
||||||
import SapforTestingSystem.SapforConfiguration.SapforConfigurationInterface;
|
import SapforTestingSystem.SapforConfiguration.SapforConfigurationInterface;
|
||||||
import SapforTestingSystem.SapforScenario.SapforScenario;
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||||
import SapforTestingSystem.SapforServerScenario_info;
|
import SapforTestingSystem.SapforServerScenario_info;
|
||||||
import SapforTestingSystem.ServerSapfor.ServerSapfor;
|
import SapforTestingSystem.ServerSapfor.ServerSapfor;
|
||||||
import SapforTestingSystem.ServerSapforTestingPlanner.ServerSapforTestingPlanner;
|
import SapforTestingSystem.ServerSapforTestingPlanner.ServerSapforTestingPlanner;
|
||||||
@@ -186,10 +186,10 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
((ServerSapfor) object).home_path
|
((ServerSapfor) object).home_path
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else if (object instanceof SapforScenario) {
|
} else if (object instanceof SapforTasksPackage) {
|
||||||
Utils.forceDeleteWithCheck(
|
Utils.forceDeleteWithCheck(
|
||||||
new File(
|
new File(
|
||||||
((SapforScenario) object).workspace
|
((SapforTasksPackage) object).workspace
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
protected TestingPlanner testingPlanner = new TestingPlanner();
|
protected TestingPlanner testingPlanner = new TestingPlanner();
|
||||||
protected Thread testingThread = new Thread(() -> testingPlanner.Perform());
|
protected Thread testingThread = new Thread(() -> testingPlanner.Perform());
|
||||||
protected ServerSapforTestingPlanner sapforTestingPlanner = new ServerSapforTestingPlanner();
|
protected ServerSapforTestingPlanner sapforTestingPlanner = new ServerSapforTestingPlanner();
|
||||||
protected Thread sapforTestingThread = new Thread(()-> sapforTestingPlanner.Perform());
|
protected Thread sapforTestingThread = new Thread(() -> sapforTestingPlanner.Perform());
|
||||||
//------>>>
|
//------>>>
|
||||||
public static boolean checkTasks = false;
|
public static boolean checkTasks = false;
|
||||||
//--
|
//--
|
||||||
@@ -317,16 +317,16 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
}
|
}
|
||||||
public void StartSapforTests(SapforServerScenario_info scenario_info) throws Exception {
|
public void StartSapforTests(SapforServerScenario_info scenario_info) throws Exception {
|
||||||
//--
|
//--
|
||||||
PackageModeScenario_json scenario_json = new PackageModeScenario_json();
|
SapforTasksPackage_json scenario_json = new SapforTasksPackage_json();
|
||||||
for (String test_id : scenario_info.testsIds)
|
for (String test_id : scenario_info.testsIds)
|
||||||
scenario_json.tests.add(db.tests.get(test_id).description);
|
scenario_json.tests.add(db.tests.get(test_id).description);
|
||||||
//создание объекта набора задач. для бд.
|
//создание объекта набора задач. для бд.
|
||||||
SapforScenario sapforScenario = new SapforScenario(); //?может быть все же поменять ключ на сгенерированный из даты.
|
SapforTasksPackage sapforTasksPackage = new SapforTasksPackage(); //?может быть все же поменять ключ на сгенерированный из даты.
|
||||||
db.Insert(sapforScenario);
|
db.Insert(sapforTasksPackage);
|
||||||
//создание рабочего пространства для пакетного режима
|
//создание рабочего пространства для пакетного режима
|
||||||
File scenarioWorkspace = new File(Global.ScenariosDirectory, String.valueOf(sapforScenario.id));
|
File scenarioWorkspace = new File(Global.ScenariosDirectory, String.valueOf(sapforTasksPackage.id));
|
||||||
Utils.CheckAndCleanDirectory(scenarioWorkspace);
|
Utils.CheckAndCleanDirectory(scenarioWorkspace);
|
||||||
sapforScenario.workspace = scenarioWorkspace.getAbsolutePath();
|
sapforTasksPackage.workspace = scenarioWorkspace.getAbsolutePath();
|
||||||
//копирование тестов по конфигурациям.
|
//копирование тестов по конфигурациям.
|
||||||
for (String configuration_id : scenario_info.configurationsIds) {
|
for (String configuration_id : scenario_info.configurationsIds) {
|
||||||
SapforConfiguration configuration = db.sapforConfigurations.get(configuration_id);
|
SapforConfiguration configuration = db.sapforConfigurations.get(configuration_id);
|
||||||
@@ -345,11 +345,11 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
File test_root = new File(configurationWorkspace, test.description);
|
File test_root = new File(configurationWorkspace, test.description);
|
||||||
Utils.CheckAndCleanDirectory(test_root);
|
Utils.CheckAndCleanDirectory(test_root);
|
||||||
FileUtils.copyDirectory(new File(Global.TestsDirectory, test.id), test_root);
|
FileUtils.copyDirectory(new File(Global.TestsDirectory, test.id), test_root);
|
||||||
sapforScenario.tasksCount++;
|
sapforTasksPackage.tasksCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//копирование SAPFOR
|
//копирование SAPFOR
|
||||||
File sapforFile = new File(sapforScenario.workspace, Utils.getDateName("SAPFOR_F"));
|
File sapforFile = new File(sapforTasksPackage.workspace, Utils.getDateName("SAPFOR_F"));
|
||||||
ServerSapfor sapfor = db.serverSapfors.get(scenario_info.sapforId);
|
ServerSapfor sapfor = db.serverSapfors.get(scenario_info.sapforId);
|
||||||
FileUtils.copyFile(new File(sapfor.call_command), sapforFile);
|
FileUtils.copyFile(new File(sapfor.call_command), sapforFile);
|
||||||
if (!sapforFile.setExecutable(true))
|
if (!sapforFile.setExecutable(true))
|
||||||
@@ -357,25 +357,25 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
scenario_json.sapfor_drv = sapforFile.getName();
|
scenario_json.sapfor_drv = sapforFile.getName();
|
||||||
//--->>
|
//--->>
|
||||||
//копирование визуализатора
|
//копирование визуализатора
|
||||||
File visualiser = new File(sapforScenario.workspace, "VisualSapfor.jar");
|
File visualiser = new File(sapforTasksPackage.workspace, "VisualSapfor.jar");
|
||||||
FileUtils.copyFile(new File(Global.Home, "TestingSystem.jar"), visualiser);
|
FileUtils.copyFile(new File(Global.Home, "TestingSystem.jar"), visualiser);
|
||||||
//создание настроек
|
//создание настроек
|
||||||
GlobalProperties properties = new GlobalProperties();
|
GlobalProperties properties = new GlobalProperties();
|
||||||
properties.Mode = Current.Mode.Scenario;
|
properties.Mode = Current.Mode.Scenario;
|
||||||
properties.threadsNum = Global.properties.threadsNum; //брать из настроек сервера же.
|
properties.threadsNum = Global.properties.threadsNum; //брать из настроек сервера же.
|
||||||
properties.threadsTimeout = Global.properties.threadsTimeout;
|
properties.threadsTimeout = Global.properties.threadsTimeout;
|
||||||
Utils.jsonToFile(properties, new File(sapforScenario.workspace, "properties"));
|
Utils.jsonToFile(properties, new File(sapforTasksPackage.workspace, "properties"));
|
||||||
//создание инструкции
|
//создание инструкции
|
||||||
File scenario_file = new File(sapforScenario.workspace, "scenario");
|
File scenario_file = new File(sapforTasksPackage.workspace, "scenario");
|
||||||
Utils.jsonToFile(scenario_json, scenario_file);
|
Utils.jsonToFile(scenario_json, scenario_file);
|
||||||
//подготовка пакетного режима. Запустит его уже очередь.
|
//подготовка пакетного режима. Запустит его уже очередь.
|
||||||
Utils.startScript_(scenarioWorkspace, scenarioWorkspace, "start", "java -jar VisualSapfor.jar");
|
Utils.createScript(scenarioWorkspace, scenarioWorkspace, "start", "java -jar VisualSapfor.jar");
|
||||||
//--
|
//--
|
||||||
sapforScenario.sapfor_version = sapfor.version;
|
sapforTasksPackage.sapfor_version = sapfor.version;
|
||||||
sapforScenario.sapfor_build_date = sapfor.buildDate;
|
sapforTasksPackage.sapfor_build_date = sapfor.buildDate;
|
||||||
sapforScenario.testsNames = String.join(";", scenario_json.tests);
|
sapforTasksPackage.testsNames = String.join(";", scenario_json.tests);
|
||||||
sapforScenario.StartDate = new Date().getTime();
|
sapforTasksPackage.StartDate = new Date().getTime();
|
||||||
db.Update(sapforScenario);
|
db.Update(sapforTasksPackage);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void Session() throws Exception {
|
protected void Session() throws Exception {
|
||||||
@@ -535,6 +535,12 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||||
response.object = Utils.packFile(account_db.getFile());
|
response.object = Utils.packFile(account_db.getFile());
|
||||||
break;
|
break;
|
||||||
|
//-- Тестирование SAPFOR
|
||||||
|
case GetFirstActiveSapforTasksPackage:
|
||||||
|
Print("Получить первый активный сценарий задач SAPFOR");
|
||||||
|
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||||
|
response.object = db.getFirstActiveSapforScenario();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
|
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import Common.Database.SQLITE.SQLiteDatabase;
|
|||||||
import GlobalData.Settings.SettingName;
|
import GlobalData.Settings.SettingName;
|
||||||
import SapforTestingSystem.SapforConfiguration.SapforConfigurationDBTable;
|
import SapforTestingSystem.SapforConfiguration.SapforConfigurationDBTable;
|
||||||
import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
|
import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
|
||||||
import SapforTestingSystem.SapforScenario.SapforScenariosDBTable;
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackagesDBTable;
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackagesDBTable;
|
||||||
import SapforTestingSystem.ServerSapfor.ServerSapforsDBTable;
|
import SapforTestingSystem.ServerSapfor.ServerSapforsDBTable;
|
||||||
import TestingSystem.Configuration.UI.ConfigurationDBTable;
|
import TestingSystem.Configuration.UI.ConfigurationDBTable;
|
||||||
@@ -11,6 +11,7 @@ import TestingSystem.Group.GroupsDBTable;
|
|||||||
import TestingSystem.MachineMaxKernels.MachineMaxKernelsDBTable;
|
import TestingSystem.MachineMaxKernels.MachineMaxKernelsDBTable;
|
||||||
import TestingSystem.TSetting.TSetting;
|
import TestingSystem.TSetting.TSetting;
|
||||||
import TestingSystem.TSetting.TSettingsDBTable;
|
import TestingSystem.TSetting.TSettingsDBTable;
|
||||||
|
import TestingSystem.TasksPackage.TasksPackageState;
|
||||||
import TestingSystem.Test.TestDBTable;
|
import TestingSystem.Test.TestDBTable;
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
@@ -26,8 +27,8 @@ public class TestsDatabase extends SQLiteDatabase {
|
|||||||
//----
|
//----
|
||||||
public ServerSapforsDBTable serverSapfors;
|
public ServerSapforsDBTable serverSapfors;
|
||||||
//--
|
//--
|
||||||
public SapforScenariosDBTable sapforScenarios;
|
|
||||||
public SapforTasksPackagesDBTable sapforTasksPackages;
|
public SapforTasksPackagesDBTable sapforTasksPackages;
|
||||||
|
// public SapforTasksPackagesDBTable sapforTasksPackages;
|
||||||
//--
|
//--
|
||||||
public TestsDatabase() {
|
public TestsDatabase() {
|
||||||
super(Paths.get(System.getProperty("user.dir"), "Data", TasksDatabase.tests_db_name + ".sqlite").toFile());
|
super(Paths.get(System.getProperty("user.dir"), "Data", TasksDatabase.tests_db_name + ".sqlite").toFile());
|
||||||
@@ -43,8 +44,8 @@ public class TestsDatabase extends SQLiteDatabase {
|
|||||||
addTable(sapforConfigurations = new SapforConfigurationDBTable());
|
addTable(sapforConfigurations = new SapforConfigurationDBTable());
|
||||||
addTable(sapforConfigurationCommands = new SapforConfigurationCommandsDBTable());
|
addTable(sapforConfigurationCommands = new SapforConfigurationCommandsDBTable());
|
||||||
addTable(serverSapfors = new ServerSapforsDBTable());
|
addTable(serverSapfors = new ServerSapforsDBTable());
|
||||||
addTable(sapforScenarios = new SapforScenariosDBTable());
|
|
||||||
addTable(sapforTasksPackages = new SapforTasksPackagesDBTable());
|
addTable(sapforTasksPackages = new SapforTasksPackagesDBTable());
|
||||||
|
// addTable(sapforTasksPackages = new SapforTasksPackagesDBTable());
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void Init() throws Exception {
|
public void Init() throws Exception {
|
||||||
@@ -67,4 +68,34 @@ public class TestsDatabase extends SQLiteDatabase {
|
|||||||
Update(setting);
|
Update(setting);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
public SapforTasksPackage getFirstActiveSapforScenario() {
|
||||||
|
SapforTasksPackage first_active = null;
|
||||||
|
SapforTasksPackage first_queued = null;
|
||||||
|
if (!sapforTasksPackages.Data.isEmpty()) {
|
||||||
|
for (SapforTasksPackage s : sapforTasksPackages.Data.values()) {
|
||||||
|
switch (s.state) {
|
||||||
|
case Done:
|
||||||
|
case Aborted:
|
||||||
|
break;
|
||||||
|
case Queued:
|
||||||
|
if (first_queued == null) first_queued = s;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (first_active == null) first_active = s; //это и будет первый активный.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (first_active != null) return first_active;
|
||||||
|
if (first_queued != null) {
|
||||||
|
first_queued.state = TasksPackageState.PackageStart;
|
||||||
|
try {
|
||||||
|
Update(first_queued);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return first_queued;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Database.Database;
|
|
||||||
import Common.Global;
|
|
||||||
import GlobalData.Machine.MachineType;
|
|
||||||
import GlobalData.RemoteSapfor.RemoteSapfor;
|
|
||||||
import Visual_DVM_2021.Passes.AddObjectPass;
|
|
||||||
public class AddSapfor extends AddObjectPass<RemoteSapfor> {
|
|
||||||
public AddSapfor() { super(RemoteSapfor.class); }
|
|
||||||
@Override
|
|
||||||
protected Database getDb() {
|
|
||||||
return Global.db;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
|
||||||
if (Current.Check(Log, Current.Machine)){
|
|
||||||
if (Current.getMachine().type.equals(MachineType.Server)){
|
|
||||||
target = d.newInstance();
|
|
||||||
return fillObjectFields();
|
|
||||||
}else Log.Writeln_("Тестирование SAPFOR поддерживается только на удаленном одиночном сервере.");
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
|
||||||
import Common.Global;
|
|
||||||
import SapforTestingSystem.Json.SapforScenarioResults_json;
|
|
||||||
import SapforTestingSystem.SapforTask.SapforTask;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
public class AnalyseSapforPackageResults extends Pass_2021<SapforScenarioResults_json> {
|
|
||||||
File packageWorkspace;
|
|
||||||
File scenarioFile;
|
|
||||||
//--
|
|
||||||
@Override
|
|
||||||
protected boolean needsAnimation() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
@Override
|
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
|
||||||
//--
|
|
||||||
packageWorkspace = new File((String) args[0]);
|
|
||||||
scenarioFile = new File(packageWorkspace, "results.txt");
|
|
||||||
//--
|
|
||||||
// String packed = FileUtils.readFileToString(scenarioFile, Charset.defaultCharset());
|
|
||||||
// target = Utils.gson.fromJson(packed, ScenarioResults_json.class);
|
|
||||||
//---
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void body() throws Exception {
|
|
||||||
for (SapforTask task: target.tasks) {
|
|
||||||
task.id=Global.db.IncSapforMaxTaskId();
|
|
||||||
Global.db.Insert(task);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
|
||||||
import Common.Database.DataSet;
|
|
||||||
import SapforTestingSystem.SapforTask.SapforTaskResult;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
public class CompareSapforPackages extends Pass_2021 {
|
|
||||||
DataSet<String, SapforTaskResult> masterTasks;
|
|
||||||
DataSet<String, SapforTaskResult> slaveTasks;
|
|
||||||
@Override
|
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
|
||||||
masterTasks = (DataSet<String, SapforTaskResult>) args[0];
|
|
||||||
slaveTasks = (DataSet<String, SapforTaskResult>) args[1];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
|
||||||
import Common.Database.Database;
|
|
||||||
import Common.Global;
|
|
||||||
import GlobalData.RemoteSapfor.RemoteSapfor;
|
|
||||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
|
||||||
public class DeleteSapfor extends DeleteObjectPass<RemoteSapfor>{
|
|
||||||
public DeleteSapfor() {
|
|
||||||
super(RemoteSapfor.class);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected Database getDb() {
|
|
||||||
return Global.db;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,15 +4,15 @@ import Common.Global;
|
|||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import Repository.Server.ServerCode;
|
import Repository.Server.ServerCode;
|
||||||
import Repository.Server.ServerExchangeUnit_2021;
|
import Repository.Server.ServerExchangeUnit_2021;
|
||||||
import SapforTestingSystem.SapforScenario.SapforScenario;
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
import Visual_DVM_2021.Passes.Pass_2021;
|
||||||
import Visual_DVM_2021.Passes.TestingSystemPass;
|
import Visual_DVM_2021.Passes.TestingSystemPass;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
public class DeleteSapforScenario extends DeleteObjectPass<SapforScenario> {
|
public class DeleteSapforScenario extends DeleteObjectPass<SapforTasksPackage> {
|
||||||
public DeleteSapforScenario() {
|
public DeleteSapforScenario() {
|
||||||
super(SapforScenario.class);
|
super(SapforTasksPackage.class);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected Database getDb() {
|
protected Database getDb() {
|
||||||
@@ -34,14 +34,14 @@ public class DeleteSapforScenario extends DeleteObjectPass<SapforScenario> {
|
|||||||
@Override
|
@Override
|
||||||
protected void performDone() throws Exception {
|
protected void performDone() throws Exception {
|
||||||
super.performDone();
|
super.performDone();
|
||||||
Pass_2021 serverPass = new TestingSystemPass<SapforScenario>() {
|
Pass_2021 serverPass = new TestingSystemPass<SapforTasksPackage>() {
|
||||||
@Override
|
@Override
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return "Удаление сценария задач SAPFOR с сервера";
|
return "Удаление сценария задач SAPFOR с сервера";
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
target = (SapforScenario) args[0];
|
target = (SapforTasksPackage) args[0];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
|
||||||
import Common.Database.Database;
|
|
||||||
import Common.Global;
|
|
||||||
import GlobalData.RemoteSapfor.RemoteSapfor;
|
|
||||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
|
||||||
public class EditSapfor extends EditObjectPass<RemoteSapfor> {
|
|
||||||
public EditSapfor() {
|
|
||||||
super(RemoteSapfor.class);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected Database getDb() {
|
|
||||||
return Global.db;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,234 +0,0 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
|
||||||
import Common.Constants;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
import ProjectData.Files.DBProjectFile;
|
|
||||||
import ProjectData.LanguageName;
|
|
||||||
import ProjectData.Messages.Errors.MessageError;
|
|
||||||
import ProjectData.Project.db_project_info;
|
|
||||||
import SapforTestingSystem.Json.SapforVersion_json;
|
|
||||||
import SapforTestingSystem.SapforTask.SapforTaskResult;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
import static java.lang.Character.isDigit;
|
|
||||||
public class OpenSapforTest extends Pass_2021<SapforTaskResult> {
|
|
||||||
String last_version = null;
|
|
||||||
@Override
|
|
||||||
protected boolean needsAnimation() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
|
||||||
last_version = null;
|
|
||||||
Current targetName = (Current) args[0];
|
|
||||||
if (Current.Check(Log, targetName)) {
|
|
||||||
target = (SapforTaskResult) Current.get(targetName);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getIconPath() {
|
|
||||||
return "/icons/OpenProject.png";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getButtonText() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
public MessageError unpackMessage(String line_in) throws Exception {
|
|
||||||
MessageError res = new MessageError();
|
|
||||||
res.file = "";
|
|
||||||
res.line = Constants.Nan;
|
|
||||||
res.value = "";
|
|
||||||
String line = line_in.substring(9);
|
|
||||||
System.out.println(line);
|
|
||||||
int i = 0;
|
|
||||||
int s = 0;
|
|
||||||
String lexeme = "";
|
|
||||||
//#1020: red43.fdv: line 988]: Active DVM directives are not supported (turn on DVM-directive support option)
|
|
||||||
for (char c : line.toCharArray()) {
|
|
||||||
// System.out.print("<s=" + s + ">");
|
|
||||||
// System.out.println(c);
|
|
||||||
switch (s) {
|
|
||||||
case 0:
|
|
||||||
//поиск groups_s
|
|
||||||
if (c == '#') {
|
|
||||||
s = 1;
|
|
||||||
lexeme = "";
|
|
||||||
} else return null;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
//group_s
|
|
||||||
if (isDigit(c)) {
|
|
||||||
res.group_s += c;
|
|
||||||
lexeme += c;
|
|
||||||
} else if (c == ':') {
|
|
||||||
s = 2;
|
|
||||||
res.group = Integer.parseInt(lexeme);
|
|
||||||
} else return null;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
//поиск filename
|
|
||||||
if (c == ' ') {
|
|
||||||
s = 3;
|
|
||||||
} else return null;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
//filename
|
|
||||||
if (c == ':') {
|
|
||||||
s = 4;
|
|
||||||
} else {
|
|
||||||
res.file += c;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
//поиск line
|
|
||||||
if (c == ' ') {
|
|
||||||
s = 5;
|
|
||||||
lexeme = "";
|
|
||||||
} else return null;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
//line
|
|
||||||
if (c == ' ') {
|
|
||||||
if (!lexeme.equals("line"))
|
|
||||||
return null;
|
|
||||||
else {
|
|
||||||
s = 6;
|
|
||||||
lexeme = "";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
lexeme += c;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
//line number
|
|
||||||
if (isDigit(c)) {
|
|
||||||
lexeme += c;
|
|
||||||
} else if (c == ']') {
|
|
||||||
res.line = Integer.parseInt(lexeme);
|
|
||||||
s = 7;
|
|
||||||
} else return null;
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
//Поиск value
|
|
||||||
if (c == ':') {
|
|
||||||
s = 8;
|
|
||||||
} else return null;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
if (c == ' ') {
|
|
||||||
s = 9;
|
|
||||||
} else return null;
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
//value
|
|
||||||
res.value += c;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
if (s != 9)
|
|
||||||
return null;
|
|
||||||
//--
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
public void readMessagesFromFileDump(File file, Vector<MessageError> messages) throws Exception {
|
|
||||||
Vector<String> lines = new Vector<>(FileUtils.readLines(file));
|
|
||||||
//ERROR - [#1020: red43.fdv: line 988]: Active DVM directives are not supported (turn on DVM-directive support option)
|
|
||||||
if (!lines.isEmpty()) {
|
|
||||||
for (int i = lines.size() - 1; i >= 0; --i) {
|
|
||||||
String line = lines.get(i);
|
|
||||||
if (line.startsWith("ERROR - ")) {
|
|
||||||
// System.out.println(i + ":" + Utils.Brackets(line));
|
|
||||||
MessageError message = unpackMessage(line);
|
|
||||||
if (message != null)
|
|
||||||
messages.add(message);
|
|
||||||
//--
|
|
||||||
} else break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
protected void checkVersion(SapforVersion_json version, boolean isTransformation) throws Exception {
|
|
||||||
ShowMessage2(version.description + " — " + version.version);
|
|
||||||
db_project_info project = new db_project_info();
|
|
||||||
project.Home = new File(version.version);
|
|
||||||
project.name = project.Home.getName();
|
|
||||||
project.description = version.description;
|
|
||||||
project.languageName = LanguageName.fortran;
|
|
||||||
project.creationDate = Utils.getDateNumber();
|
|
||||||
//--
|
|
||||||
Vector<MessageError> messages = new Vector<>();
|
|
||||||
//--
|
|
||||||
if (isTransformation) {
|
|
||||||
File p_out = Paths.get(project.Home.getAbsolutePath(), Constants.data, "parse_out.txt").toFile();
|
|
||||||
File out = Paths.get(project.Home.getAbsolutePath(), Constants.data, "out.txt").toFile();
|
|
||||||
//--
|
|
||||||
if (p_out.exists()) {
|
|
||||||
project.Log += (FileUtils.readFileToString(p_out));
|
|
||||||
readMessagesFromFileDump(p_out, messages);
|
|
||||||
}
|
|
||||||
if (out.exists()) {
|
|
||||||
project.Log += "\n" + FileUtils.readFileToString(out);
|
|
||||||
readMessagesFromFileDump(out, messages);
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
|
|
||||||
}
|
|
||||||
project.CreateVisualiserData();
|
|
||||||
//---
|
|
||||||
if (isTransformation && !messages.isEmpty()) {
|
|
||||||
project.Open();
|
|
||||||
project.db.BeginTransaction();
|
|
||||||
System.out.println("messages size=" + messages.size());
|
|
||||||
for (MessageError m : messages) {
|
|
||||||
if (project.db.files.containsKey(m.file)) {
|
|
||||||
DBProjectFile file = project.db.files.Data.get(m.file);
|
|
||||||
file.CreateAndAddNewMessage(1, m.value, m.line, m.group);
|
|
||||||
//update file
|
|
||||||
project.db.Update(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
project.db.Commit();
|
|
||||||
project.db.Disconnect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void body() throws Exception {
|
|
||||||
/*
|
|
||||||
File resultsFile = Paths.get(target.sapforTasksPackage.workspace, target.task.test_description, db_project_info.data, "results.txt").toFile();
|
|
||||||
String resultsText = FileUtils.readFileToString(resultsFile);
|
|
||||||
SapforTask savedTask = Utils.gson.fromJson(resultsText, SapforTask.class);
|
|
||||||
//--->>
|
|
||||||
if (target.task.versions_tree_built == 0) {
|
|
||||||
ShowMessage1("Построение дерева версий..");
|
|
||||||
for (SapforVersion_json version : savedTask.versions)
|
|
||||||
checkVersion(version, true);
|
|
||||||
for (SapforVersion_json version : savedTask.variants)
|
|
||||||
checkVersion(version, false);
|
|
||||||
target.task.versions_tree_built = 1;
|
|
||||||
Global.db.Update(target.task);
|
|
||||||
}
|
|
||||||
if (!savedTask.variants.isEmpty()) {
|
|
||||||
last_version = savedTask.variants.lastElement().version;
|
|
||||||
} else if (!savedTask.versions.isEmpty())
|
|
||||||
last_version = savedTask.versions.lastElement().version;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected boolean validate() {
|
|
||||||
return last_version != null;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void performDone() throws Exception {
|
|
||||||
passes.get(PassCode_2021.OpenCurrentProject).Do(new File(last_version));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,297 +0,0 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.GlobalProperties;
|
|
||||||
import Common.UI.UI;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
import ProjectData.LanguageName;
|
|
||||||
import Repository.Server.ServerCode;
|
|
||||||
import Repository.Server.ServerExchangeUnit_2021;
|
|
||||||
import SapforTestingSystem.Json.SapforConfiguration_json;
|
|
||||||
import SapforTestingSystem.Json.PackageModeScenario_json;
|
|
||||||
import SapforTestingSystem.SapforConfiguration.SapforConfiguration;
|
|
||||||
import SapforTestingSystem.SapforConfiguration.SapforConfigurationInterface;
|
|
||||||
import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommand;
|
|
||||||
import SapforTestingSystem.SapforScenario.SapforScenario;
|
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
|
||||||
import TestingSystem.Group.Group;
|
|
||||||
import TestingSystem.Test.Test;
|
|
||||||
import TestingSystem.Test.TestInterface;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.PassException;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
import Visual_DVM_2021.Passes.TestingSystemPass;
|
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Vector;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
//НЕАКТУАЛЬНО, ВСЕ НА СЕРВЕРЕ
|
|
||||||
public class StartSapforTests extends Pass_2021<SapforScenario> {
|
|
||||||
protected int allTasksCount = 0;
|
|
||||||
//--
|
|
||||||
protected LinkedHashMap<String, Vector<String>> groupsTests = null;
|
|
||||||
//--
|
|
||||||
protected LinkedHashMap<String, Test> allTests = null;
|
|
||||||
protected Vector<String> testsNames_lower = null; //все тесты что участвуют здесь
|
|
||||||
protected Vector<LanguageName> groupsLanguages = null;
|
|
||||||
protected File sapfor = null;
|
|
||||||
//---
|
|
||||||
@Override
|
|
||||||
public String getIconPath() {
|
|
||||||
return "/icons/Start.png";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getButtonText() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected boolean needsAnimation() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
protected boolean checkTestName(Test test) {
|
|
||||||
String name = test.description.toLowerCase();
|
|
||||||
if (testsNames_lower.contains(name)) {
|
|
||||||
Log.Writeln_("В пакет не могут входить тесты с одинаковыми именами (без учета регистра):" + test.description.toLowerCase());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
testsNames_lower.add(name);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
protected boolean getGroupTests(String groupId) {
|
|
||||||
Vector<String> groupTests = new Vector<>();
|
|
||||||
Vector<String> selectedGroupTests = new Vector<>();
|
|
||||||
//---
|
|
||||||
for (Test test : Global.testingServer.db.tests.Data.values()) {
|
|
||||||
if (test.group_id.equals(groupId)) {
|
|
||||||
groupTests.add(test.id);
|
|
||||||
if (test.isSelected())
|
|
||||||
selectedGroupTests.add(test.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!groupTests.isEmpty() && !selectedGroupTests.isEmpty())
|
|
||||||
groupTests = selectedGroupTests;
|
|
||||||
//---
|
|
||||||
if (groupTests.isEmpty()) {
|
|
||||||
Log.Writeln_("Пустая группа тестов: " + groupId);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
for (String testId : groupTests) {
|
|
||||||
Test test = Global.testingServer.db.tests.get(testId);
|
|
||||||
if (!checkTestName(test))
|
|
||||||
return false;
|
|
||||||
else
|
|
||||||
allTests.put(test.description, test);
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
groupsTests.put(groupId, groupTests);
|
|
||||||
//--
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public boolean getConfigurationCommands(SapforConfiguration sapforConfiguration) {
|
|
||||||
//1. получить список всех команд.
|
|
||||||
Vector<PassCode_2021> codes = new Vector<>();
|
|
||||||
int v = 0;
|
|
||||||
for (SapforConfigurationCommand command : Global.testingServer.db.sapforConfigurationCommands.Data.values()) {
|
|
||||||
if (command.sapforconfiguration_id.equals(sapforConfiguration.id)) {
|
|
||||||
codes.add(command.passCode);
|
|
||||||
if (command.passCode.equals(PassCode_2021.CreateParallelVariants))
|
|
||||||
v++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
if (codes.size() == 0) {
|
|
||||||
Log.Writeln_("Пустая конфигурация:" + sapforConfiguration.id);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
if (v > 2) {
|
|
||||||
Log.Writeln_("Неверная конфигурация:" + sapforConfiguration.id + ": построение параллельных вариантов возможно единожды.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
if ((v == 1) && codes.size() > 1) {
|
|
||||||
if (!codes.lastElement().equals(PassCode_2021.CreateParallelVariants)) {
|
|
||||||
Log.Writeln_("Неверная конфигурация:" + sapforConfiguration.id + ": построение параллельных вариантов может быть только завершающей командой!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
|
||||||
//--
|
|
||||||
allTasksCount = 0;
|
|
||||||
target = null;
|
|
||||||
//--
|
|
||||||
groupsTests = new LinkedHashMap<>();
|
|
||||||
//--->>
|
|
||||||
testsNames_lower = new Vector<>();
|
|
||||||
allTests = new LinkedHashMap<>();
|
|
||||||
groupsLanguages = new Vector<>();
|
|
||||||
//проверка стартовых условий.
|
|
||||||
//--->>
|
|
||||||
if (Global.testingServer.db.sapforConfigurations.getCheckedCount() == 0) {
|
|
||||||
Log.Writeln_("Не отмечено ни одной конфигурации SAPFOR.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
for (SapforConfiguration configuration : Global.testingServer.db.sapforConfigurations.getCheckedItems()) {
|
|
||||||
if (!getConfigurationCommands(configuration))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
if (Global.testingServer.db.groups.getCheckedCount() == 0) {
|
|
||||||
Log.Writeln_("Не отмечено ни одной группы тестов");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
|
|
||||||
//---
|
|
||||||
if (!groupsLanguages.contains(group.language))
|
|
||||||
groupsLanguages.add(group.language);
|
|
||||||
//-
|
|
||||||
if (groupsLanguages.get(0) != LanguageName.fortran) {
|
|
||||||
Log.Writeln_("Поддерживается пакетный режим только для языка Fortran!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (groupsLanguages.size() > 1) {
|
|
||||||
Log.Writeln_("Запуск тестов на разных языках в рамках одного пакета запрещен!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
//---
|
|
||||||
if (!getGroupTests(group.id))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
for (int i = 0; i < Global.testingServer.db.sapforConfigurations.getCheckedCount(); ++i) {
|
|
||||||
for (Vector<String> tests : groupsTests.values())
|
|
||||||
allTasksCount += tests.size();
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
return (UI.Question("Будет запущено:\n"
|
|
||||||
+ allTasksCount + " задач\n" +
|
|
||||||
"Продолжить")) && new TestingSystemPass() {
|
|
||||||
@Override
|
|
||||||
public String getDescription() {
|
|
||||||
return "Синхронизация тестов";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected boolean needsAnimation() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void ServerAction() throws Exception {
|
|
||||||
for (Test test : allTests.values()) {
|
|
||||||
ShowMessage1("загрузка " + test.description);
|
|
||||||
Command(new ServerExchangeUnit_2021(ServerCode.DownloadTest, test.id));
|
|
||||||
response.Unpack(TestInterface.getArchive(test));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.Do();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void body() throws Exception {
|
|
||||||
//---
|
|
||||||
ShowMessage1("Распаковка тестов...");
|
|
||||||
//сразу в задачи распаковывать нельзя, потому что копируются под ид,а не дескриптион.
|
|
||||||
for (Test test : allTests.values()) {
|
|
||||||
ShowMessage2(test.description);
|
|
||||||
File testDst = new File(Global.TestsDirectory, test.id);
|
|
||||||
Utils.delete_with_check(testDst);
|
|
||||||
passes.get(PassCode_2021.UnzipFolderPass).Do(
|
|
||||||
TestInterface.getArchive(test).getAbsolutePath(),
|
|
||||||
Global.TestsDirectory.getAbsolutePath(), false
|
|
||||||
);
|
|
||||||
}
|
|
||||||
target = new SapforScenario();
|
|
||||||
target.sapfor_version = String.valueOf(Current.getSapfor().version);
|
|
||||||
target.tasksCount = allTasksCount;
|
|
||||||
Global.db.Insert(target);
|
|
||||||
//--->>>
|
|
||||||
File scenarioWorkspace = new File(Global.visualiser.getWorkspace(), String.valueOf(target.id));
|
|
||||||
Utils.CheckAndCleanDirectory(scenarioWorkspace);
|
|
||||||
target.workspace = scenarioWorkspace.getAbsolutePath();
|
|
||||||
target.testsNames = String.join(";", testsNames_lower);
|
|
||||||
sapfor = new File(target.workspace, Utils.getDateName("SAPFOR_F") + (Global.isWindows ? ".exe" : "")); //развилка на линукс
|
|
||||||
ShowMessage2("Копирование SAPFOR");
|
|
||||||
FileUtils.copyFile(Current.getSapfor().getFile(), sapfor);
|
|
||||||
if (!sapfor.setExecutable(true))
|
|
||||||
throw new PassException("Не удалось сделать файл " + sapfor.getName() + " исполняемым!");
|
|
||||||
ShowMessage2("Копирование визуализатора");
|
|
||||||
File visualiser = new File(target.workspace, "VisualSapfor.jar");
|
|
||||||
FileUtils.copyFile(Global.visualiser.getFile(), visualiser);
|
|
||||||
ShowMessage2("Создание настроек");
|
|
||||||
GlobalProperties properties = new GlobalProperties();
|
|
||||||
properties.Mode = Current.Mode.Scenario;
|
|
||||||
properties.threadsNum = 4;
|
|
||||||
properties.threadsTimeout = 2000;
|
|
||||||
//----
|
|
||||||
Utils.jsonToFile(properties, new File(target.workspace, "properties"));
|
|
||||||
//----
|
|
||||||
File scenarioFile = new File(target.workspace, "scenario");
|
|
||||||
PackageModeScenario_json scenario_json = new PackageModeScenario_json();
|
|
||||||
scenario_json.sapfor_drv = sapfor.getName();
|
|
||||||
scenario_json.tests.addAll(allTests.keySet());
|
|
||||||
//----
|
|
||||||
Global.db.Update(target);
|
|
||||||
ShowMessage1("Создание рабочих пространств...");
|
|
||||||
for (SapforConfiguration configuration : Global.testingServer.db.sapforConfigurations.getCheckedItems()) {
|
|
||||||
SapforTasksPackage sapforTasksPackage = new SapforTasksPackage();
|
|
||||||
Vector<PassCode_2021> codes = SapforConfigurationInterface.getPassCodes(configuration);
|
|
||||||
Vector<String> passesNames = codes.stream().map(PassCode_2021::getDescription).collect(Collectors.toCollection(Vector::new));
|
|
||||||
//--
|
|
||||||
sapforTasksPackage.sapforscenario_id = target.id;
|
|
||||||
sapforTasksPackage.sapforconfiguration_id = configuration.id;
|
|
||||||
sapforTasksPackage.flags = SapforConfigurationInterface.getFlags(configuration);
|
|
||||||
sapforTasksPackage.passesNames = String.join(";", passesNames);
|
|
||||||
//--xcopy
|
|
||||||
Global.db.Insert(sapforTasksPackage);
|
|
||||||
sapforTasksPackage.workspace = Paths.get(
|
|
||||||
Global.visualiser.getWorkspace().getAbsolutePath(),
|
|
||||||
String.valueOf(target.id),
|
|
||||||
String.valueOf(sapforTasksPackage.id)
|
|
||||||
).toFile().getAbsolutePath();
|
|
||||||
//---
|
|
||||||
Utils.CheckAndCleanDirectory(new File(sapforTasksPackage.workspace));
|
|
||||||
//---
|
|
||||||
for (Vector<String> testIds : groupsTests.values()) {
|
|
||||||
for (String testId : testIds) {
|
|
||||||
Test test = Global.testingServer.db.tests.get(testId);
|
|
||||||
ShowMessage2(test.description);
|
|
||||||
//--
|
|
||||||
File taskWorkspace = new File(sapforTasksPackage.workspace, test.description);
|
|
||||||
Utils.CheckAndCleanDirectory(taskWorkspace);
|
|
||||||
//--
|
|
||||||
FileUtils.copyDirectory(new File(Global.TestsDirectory, test.id), taskWorkspace);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Global.db.Update(sapforTasksPackage);
|
|
||||||
//--->>
|
|
||||||
SapforConfiguration_json package_json = new SapforConfiguration_json();
|
|
||||||
package_json.id = String.valueOf(sapforTasksPackage.id);
|
|
||||||
package_json.flags = sapforTasksPackage.flags;
|
|
||||||
package_json.codes.addAll(codes);
|
|
||||||
//--->>
|
|
||||||
scenario_json.packages.add(package_json);
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
Utils.jsonToFile(scenario_json, scenarioFile);
|
|
||||||
//--
|
|
||||||
Utils.startScript_(scenarioWorkspace, scenarioWorkspace, "start", "java -jar VisualSapfor.jar");
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void showFinish() throws Exception {
|
|
||||||
Pass_2021.passes.get(PassCode_2021.SynchronizeTests).Do();
|
|
||||||
// Global.testingServer.db.sapforScenarios.ShowUI(target.getPK());
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void showDone() throws Exception {
|
|
||||||
// Global.db.sapforScenarios.ShowUI();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -52,7 +52,7 @@ public class SynchronizeTests extends TestingSystemPass<Object> {
|
|||||||
server.db.configurations.ShowUI();
|
server.db.configurations.ShowUI();
|
||||||
server.db.groups.ShowUI();
|
server.db.groups.ShowUI();
|
||||||
server.db.sapforConfigurations.ShowUI();
|
server.db.sapforConfigurations.ShowUI();
|
||||||
server.db.sapforScenarios.ShowUI();
|
server.db.sapforTasksPackages.ShowUI();
|
||||||
server.db.RestoreLastSelections();
|
server.db.RestoreLastSelections();
|
||||||
UI.getMainWindow().getTestingWindow().ShowCheckedTestsCount();
|
UI.getMainWindow().getTestingWindow().ShowCheckedTestsCount();
|
||||||
//для отображения числа ядер.
|
//для отображения числа ядер.
|
||||||
|
|||||||
@@ -12,11 +12,6 @@ public enum PassCode_2021 {
|
|||||||
ApplyProfile,
|
ApplyProfile,
|
||||||
EditProfile,
|
EditProfile,
|
||||||
DeleteProfile,
|
DeleteProfile,
|
||||||
CompareSapforPackages,
|
|
||||||
//-
|
|
||||||
StartSapforTests,
|
|
||||||
AnalyseSapforPackageResults,
|
|
||||||
OpenSapforTest,
|
|
||||||
//-
|
//-
|
||||||
DeleteSapforScenario,
|
DeleteSapforScenario,
|
||||||
//-
|
//-
|
||||||
@@ -297,9 +292,6 @@ public enum PassCode_2021 {
|
|||||||
CreateTestsGroupFromSelectedVersions,
|
CreateTestsGroupFromSelectedVersions,
|
||||||
ExcludeSelectedFiles,
|
ExcludeSelectedFiles,
|
||||||
IncludeSelectedFiles,
|
IncludeSelectedFiles,
|
||||||
AddSapfor,
|
|
||||||
EditSapfor,
|
|
||||||
DeleteSapfor,
|
|
||||||
//--
|
//--
|
||||||
PublishSapforConfiguration,
|
PublishSapforConfiguration,
|
||||||
EditSapforConfiguration,
|
EditSapforConfiguration,
|
||||||
@@ -328,8 +320,6 @@ public enum PassCode_2021 {
|
|||||||
return "Запустить тестирование на сервере";
|
return "Запустить тестирование на сервере";
|
||||||
case InstallServerSapfor:
|
case InstallServerSapfor:
|
||||||
return "Собрать актуальную версию SAPFOR";
|
return "Собрать актуальную версию SAPFOR";
|
||||||
case CompareSapforPackages:
|
|
||||||
return "Сравнение пакетов задач SAPFOR";
|
|
||||||
case EditProfile:
|
case EditProfile:
|
||||||
return "Редактировать профиль";
|
return "Редактировать профиль";
|
||||||
case DeleteProfile:
|
case DeleteProfile:
|
||||||
@@ -338,12 +328,6 @@ public enum PassCode_2021 {
|
|||||||
return "Применить профиль";
|
return "Применить профиль";
|
||||||
case SaveProfile:
|
case SaveProfile:
|
||||||
return "Сохранить текущие настройки SAPFOR как профиль";
|
return "Сохранить текущие настройки SAPFOR как профиль";
|
||||||
case OpenSapforTest:
|
|
||||||
return "Открыть результирующую версию теста.";
|
|
||||||
case AnalyseSapforPackageResults:
|
|
||||||
return "Анализ результатов пакета задач";
|
|
||||||
case StartSapforTests:
|
|
||||||
return "Создать задачи тестирования SAPFOR";
|
|
||||||
case SPF_SharedMemoryParallelization:
|
case SPF_SharedMemoryParallelization:
|
||||||
return "Распараллеливание на общую память";
|
return "Распараллеливание на общую память";
|
||||||
case ResurrectComponentFromServer:
|
case ResurrectComponentFromServer:
|
||||||
@@ -396,12 +380,6 @@ public enum PassCode_2021 {
|
|||||||
return "Редактировать конфигурацию тестирования SAPFOR на сервере";
|
return "Редактировать конфигурацию тестирования SAPFOR на сервере";
|
||||||
case DeleteSapforConfiguration:
|
case DeleteSapforConfiguration:
|
||||||
return "Удалить выбранные конфигурации тестирования SAPFOR на сервере";
|
return "Удалить выбранные конфигурации тестирования SAPFOR на сервере";
|
||||||
case AddSapfor:
|
|
||||||
return "Добавление SAPFOR";
|
|
||||||
case EditSapfor:
|
|
||||||
return "Редактирование SAPFOR";
|
|
||||||
case DeleteSapfor:
|
|
||||||
return "Удаление SAPFOR";
|
|
||||||
case ExcludeSelectedFiles:
|
case ExcludeSelectedFiles:
|
||||||
return "Исключить из рассмотрения отмеченные файлы";
|
return "Исключить из рассмотрения отмеченные файлы";
|
||||||
case IncludeSelectedFiles:
|
case IncludeSelectedFiles:
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
package Visual_DVM_2021.UI.Interface;
|
package Visual_DVM_2021.UI.Interface;
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
|
||||||
public interface TestingWindow extends VisualizerForm {
|
public interface TestingWindow extends VisualizerForm {
|
||||||
void ShowAll();
|
void ShowAll();
|
||||||
void RestoreLastCredentials();
|
void RestoreLastCredentials();
|
||||||
@@ -51,6 +50,4 @@ public interface TestingWindow extends VisualizerForm {
|
|||||||
void ShowLastCompilationTask();
|
void ShowLastCompilationTask();
|
||||||
void ShowLastRunTask();
|
void ShowLastRunTask();
|
||||||
//-
|
//-
|
||||||
|
|
||||||
void RemoveSapforPackageFromComparison(SapforTasksPackage package_2023);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,9 @@
|
|||||||
package Visual_DVM_2021.UI.Main;
|
package Visual_DVM_2021.UI.Main;
|
||||||
import Common.Current;
|
|
||||||
import Common.Database.DataSet;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.DataSetControlForm;
|
import Common.UI.DataSetControlForm;
|
||||||
import Common.UI.Label.ShortLabel;
|
import Common.UI.Label.ShortLabel;
|
||||||
import Common.UI.Menus_2023.VisualiserMenuBar;
|
import Common.UI.Menus_2023.VisualiserMenuBar;
|
||||||
import Common.UI.UI;
|
import Common.UI.UI;
|
||||||
import Common.Utils.TextLog;
|
import Common.Utils.TextLog;
|
||||||
import SapforTestingSystem.SapforTask.SapforTaskResult;
|
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
|
||||||
import TestingSystem.Test.ProjectFiles_json;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
import Visual_DVM_2021.Passes.Pass_2021;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@@ -33,9 +27,9 @@ public class SapforPackagesComparisonForm {
|
|||||||
SapforPackagesComparisonForm slave = null;
|
SapforPackagesComparisonForm slave = null;
|
||||||
SapforPackagesComparisonForm master = null;
|
SapforPackagesComparisonForm master = null;
|
||||||
//-->>
|
//-->>
|
||||||
protected SapforTasksPackage object = null;
|
// protected SapforConfigurationTasksSet object = null;
|
||||||
//-->>
|
//-->>
|
||||||
protected DataSet<String, SapforTaskResult> packageTasks;
|
// protected DataSet<String, SapforTaskResult> packageTasks;
|
||||||
protected DataSetControlForm Body;
|
protected DataSetControlForm Body;
|
||||||
//--->>
|
//--->>
|
||||||
public boolean isMaster() {
|
public boolean isMaster() {
|
||||||
@@ -47,12 +41,13 @@ public class SapforPackagesComparisonForm {
|
|||||||
//--->>
|
//--->>
|
||||||
//неперегружаемые методы
|
//неперегружаемые методы
|
||||||
protected void RemoveObject() {
|
protected void RemoveObject() {
|
||||||
object = null;
|
// object = null;
|
||||||
showNoObject();
|
showNoObject();
|
||||||
}
|
}
|
||||||
public void ApplyObject() {
|
public void ApplyObject() {
|
||||||
RemoveObject();
|
RemoveObject();
|
||||||
TextLog log = new TextLog();
|
TextLog log = new TextLog();
|
||||||
|
/*
|
||||||
if (Current.Check(log, getCurrentObjectName())) {
|
if (Current.Check(log, getCurrentObjectName())) {
|
||||||
object = Current.getSapforTasksPackage();
|
object = Current.getSapforTasksPackage();
|
||||||
try {
|
try {
|
||||||
@@ -64,9 +59,11 @@ public class SapforPackagesComparisonForm {
|
|||||||
showObject();
|
showObject();
|
||||||
} else
|
} else
|
||||||
UI.Info(log.toString());
|
UI.Info(log.toString());
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
//предполагаем что оба объекта есть и мы можем получить с них текст.
|
//предполагаем что оба объекта есть и мы можем получить с них текст.
|
||||||
protected void Compare() throws Exception {
|
protected void Compare() throws Exception {
|
||||||
|
/*
|
||||||
//это всегда форма мастер
|
//это всегда форма мастер
|
||||||
//1. Получить файл теста.Для сапфора ограничение что файл может быть только один.Возможно и для других тоже.
|
//1. Получить файл теста.Для сапфора ограничение что файл может быть только один.Возможно и для других тоже.
|
||||||
// File project_db = new File(object.Home, "project.json");
|
// File project_db = new File(object.Home, "project.json");
|
||||||
@@ -77,49 +74,15 @@ public class SapforPackagesComparisonForm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
protected void compareTasks(SapforTaskResult masterTask, SapforTaskResult slaveTask) throws Exception {
|
|
||||||
/*
|
|
||||||
//надо сравнить все сраниваемых проектов.
|
|
||||||
ProjectFiles_json masterFiles = getTaskFiles(masterTask);
|
|
||||||
ProjectFiles_json slaveFiles = getTaskFiles(slaveTask);
|
|
||||||
if (masterFiles.files.size() != slaveFiles.files.size()) {
|
|
||||||
slaveTask.match_state = MatchState.NotMatch;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (DBProjectFile masterDBFile : masterFiles.files) {
|
|
||||||
boolean hasSameFile = false;
|
|
||||||
for (DBProjectFile slaveDBFile : slaveFiles.files) {
|
|
||||||
if (masterDBFile.name.equals(slaveDBFile.name)) {
|
|
||||||
hasSameFile = true;
|
|
||||||
File masterFile = new File(masterTask.last_version, masterDBFile.name);
|
|
||||||
File slaveFile = new File(slaveTask.last_version, slaveDBFile.name);
|
|
||||||
String masterFileText = FileUtils.readFileToString(masterFile);
|
|
||||||
String slaveFileText = FileUtils.readFileToString(slaveFile);
|
|
||||||
slaveTask.match_state = masterFileText.equals(slaveFileText) ? MatchState.Match : MatchState.NotMatch;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!hasSameFile) {
|
|
||||||
slaveTask.match_state = MatchState.NotMatch;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
ProjectFiles_json getTaskFiles(SapforTaskResult task) throws Exception {
|
|
||||||
// File project = new File(task.last_version);
|
|
||||||
// File file_json = new File(project, "project.json");
|
|
||||||
// return Utils.gson.fromJson(FileUtils.readFileToString(file_json), ProjectFiles_json.class);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public void Show() throws Exception {
|
public void Show() throws Exception {
|
||||||
}
|
}
|
||||||
//Перегружаемые методы.
|
//Перегружаемые методы.
|
||||||
//--->>
|
//--->>
|
||||||
protected Current getCurrentObjectName() {
|
// protected Current getCurrentObjectName() {
|
||||||
return Current.SapforTasksPackage;
|
// return Current.SapforTasksPackage;
|
||||||
}
|
// }
|
||||||
protected void showNoObject() {
|
protected void showNoObject() {
|
||||||
lObjectName.setText("?");
|
lObjectName.setText("?");
|
||||||
lObjectName.setToolTipText("Объект не назначен.");
|
lObjectName.setToolTipText("Объект не назначен.");
|
||||||
@@ -127,12 +90,14 @@ public class SapforPackagesComparisonForm {
|
|||||||
UI.Clear(tasksPanel);
|
UI.Clear(tasksPanel);
|
||||||
}
|
}
|
||||||
protected void showObject() {
|
protected void showObject() {
|
||||||
|
/*
|
||||||
lObjectName.setText(object.getPK().toString() + (isMaster() ? "(эталон)" : ""));
|
lObjectName.setText(object.getPK().toString() + (isMaster() ? "(эталон)" : ""));
|
||||||
lObjectName.setToolTipText(object.getPK().toString());
|
lObjectName.setToolTipText(object.getPK().toString());
|
||||||
flagsLabel.setText(object.flags);
|
flagsLabel.setText(object.flags);
|
||||||
//-
|
//-
|
||||||
packageTasks.mountUI(tasksPanel);
|
packageTasks.mountUI(tasksPanel);
|
||||||
packageTasks.ShowUI();
|
packageTasks.ShowUI();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
protected String getText() {
|
protected String getText() {
|
||||||
return "";
|
return "";
|
||||||
@@ -173,7 +138,7 @@ public class SapforPackagesComparisonForm {
|
|||||||
}
|
}
|
||||||
//для сравнения по кнопке.
|
//для сравнения по кнопке.
|
||||||
public boolean isReady() {
|
public boolean isReady() {
|
||||||
return object != null;
|
return false; // object != null;
|
||||||
}
|
}
|
||||||
public void onClose() {
|
public void onClose() {
|
||||||
RemoveObject();
|
RemoveObject();
|
||||||
@@ -228,9 +193,4 @@ public class SapforPackagesComparisonForm {
|
|||||||
};
|
};
|
||||||
pass.Do();
|
pass.Do();
|
||||||
}
|
}
|
||||||
public void CheckObject(SapforTasksPackage object_in) {
|
|
||||||
if ((object != null) && object_in.id == (object.id)) {
|
|
||||||
RemoveObject();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import Common.UI.TextField.StyledTextField;
|
|||||||
import Common.UI.UI;
|
import Common.UI.UI;
|
||||||
import GlobalData.Compiler.CompilerType;
|
import GlobalData.Compiler.CompilerType;
|
||||||
import GlobalData.Credentials.Credentials;
|
import GlobalData.Credentials.Credentials;
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
|
||||||
import TestingSystem.Configuration.UI.ConfigurationDBTable;
|
import TestingSystem.Configuration.UI.ConfigurationDBTable;
|
||||||
import TestingSystem.Group.Group;
|
import TestingSystem.Group.Group;
|
||||||
import TestingSystem.MachineMaxKernels.MachineMaxKernels;
|
import TestingSystem.MachineMaxKernels.MachineMaxKernels;
|
||||||
@@ -121,7 +120,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
|||||||
Global.db.machines.mountUI(machinesPanel);
|
Global.db.machines.mountUI(machinesPanel);
|
||||||
Global.db.users.mountUI(usersPanel);
|
Global.db.users.mountUI(usersPanel);
|
||||||
Global.db.compilers.mountUI(compilersPanel);
|
Global.db.compilers.mountUI(compilersPanel);
|
||||||
Global.db.remoteSapfors.mountUI(sapforsPanel);
|
|
||||||
Global.db.makefiles.mountUI(makefilesPanel);
|
Global.db.makefiles.mountUI(makefilesPanel);
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
Global.db.modules.mountUI(modulesPanel);
|
Global.db.modules.mountUI(modulesPanel);
|
||||||
@@ -153,8 +151,8 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
|||||||
Global.testingServer.db.sapforConfigurations.mountUI(sapforConfigurationsPanel);
|
Global.testingServer.db.sapforConfigurations.mountUI(sapforConfigurationsPanel);
|
||||||
Global.testingServer.db.sapforConfigurationCommands.mountUI(sapforConfigurationCommandsPanel);
|
Global.testingServer.db.sapforConfigurationCommands.mountUI(sapforConfigurationCommandsPanel);
|
||||||
Global.testingServer.db.serverSapfors.mountUI(serverSapforsPanel);
|
Global.testingServer.db.serverSapfors.mountUI(serverSapforsPanel);
|
||||||
Global.testingServer.db.sapforScenarios.mountUI(sapforScenariosPanel);
|
Global.testingServer.db.sapforTasksPackages.mountUI(sapforScenariosPanel);
|
||||||
Global.testingServer.db.sapforTasksPackages.mountUI(sapforPackagesPanel);
|
// Global.testingServer.db.sapforTasksPackages.mountUI(sapforPackagesPanel);
|
||||||
|
|
||||||
//Global.db.sapforTasks.mountUI(sapforTasksPanel);
|
//Global.db.sapforTasks.mountUI(sapforTasksPanel);
|
||||||
// Global.testingServer.account_db.sapforTasksPackages.mountUI(sapforPackagesPanel);
|
// Global.testingServer.account_db.sapforTasksPackages.mountUI(sapforPackagesPanel);
|
||||||
@@ -191,7 +189,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
|||||||
Global.testingServer.account_db.packages.ShowUI();
|
Global.testingServer.account_db.packages.ShowUI();
|
||||||
Global.testingServer.db.serverSapfors.ShowUI();
|
Global.testingServer.db.serverSapfors.ShowUI();
|
||||||
Global.testingServer.db.sapforConfigurations.ShowUI();
|
Global.testingServer.db.sapforConfigurations.ShowUI();
|
||||||
Global.testingServer.db.sapforScenarios.ShowUI();
|
Global.testingServer.db.sapforTasksPackages.ShowUI();
|
||||||
}
|
}
|
||||||
//-
|
//-
|
||||||
@Override
|
@Override
|
||||||
@@ -388,12 +386,14 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
|||||||
credentials.runconfiguration_id = Constants.Nan;
|
credentials.runconfiguration_id = Constants.Nan;
|
||||||
Global.db.UpdateCredentials();
|
Global.db.UpdateCredentials();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if (Global.db.remoteSapfors.containsKey(credentials.remotesapfor_id)) {
|
if (Global.db.remoteSapfors.containsKey(credentials.remotesapfor_id)) {
|
||||||
Global.db.remoteSapfors.ShowUI(credentials.remotesapfor_id);
|
Global.db.remoteSapfors.ShowUI(credentials.remotesapfor_id);
|
||||||
} else {
|
} else {
|
||||||
credentials.remotesapfor_id = Constants.Nan;
|
credentials.remotesapfor_id = Constants.Nan;
|
||||||
Global.db.UpdateCredentials();
|
Global.db.UpdateCredentials();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
} else {
|
} else {
|
||||||
credentials.machine_id = Constants.Nan;
|
credentials.machine_id = Constants.Nan;
|
||||||
credentials.user_id = Constants.Nan;
|
credentials.user_id = Constants.Nan;
|
||||||
@@ -429,15 +429,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void ShowCurrentSapforTasksPackage() {
|
public void ShowCurrentSapforTasksPackage() {
|
||||||
/*
|
|
||||||
UI.Clear(packageVersionsPanel);
|
|
||||||
if (Current.getSapforTasksPackage().root != null) {
|
|
||||||
PackageVersionsTree tree = new PackageVersionsTree();
|
|
||||||
packageVersionsPanel.add(new JScrollPane(tree));
|
|
||||||
packageVersionsPanel.revalidate();
|
|
||||||
packageVersionsPanel.repaint();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void ShowNoSapforTasksPackage() {
|
public void ShowNoSapforTasksPackage() {
|
||||||
@@ -476,11 +467,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
|||||||
singleRunTaskMaster.ApplyObject();
|
singleRunTaskMaster.ApplyObject();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void RemoveSapforPackageFromComparison(SapforTasksPackage package_2023) {
|
|
||||||
sapforTestingMaster.CheckObject(package_2023);
|
|
||||||
sapforTestingSlave.CheckObject(package_2023);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void DropSapforTasksComparison() {
|
public void DropSapforTasksComparison() {
|
||||||
sapforTestingMaster.RemoveObject();
|
sapforTestingMaster.RemoveObject();
|
||||||
sapforTestingSlave.RemoveObject();
|
sapforTestingSlave.RemoveObject();
|
||||||
|
|||||||
Reference in New Issue
Block a user