2023-11-19 02:12:44 +03:00
|
|
|
package Visual_DVM_2021.UI.Main;
|
2024-03-15 12:32:49 +03:00
|
|
|
import Common.Constants;
|
2023-11-01 23:14:49 +03:00
|
|
|
import Common.Current;
|
2023-09-17 22:13:42 +03:00
|
|
|
import Common.Global;
|
|
|
|
|
import Common.UI.TextField.StyledTextField;
|
|
|
|
|
import Common.UI.UI;
|
2023-12-11 18:52:23 +03:00
|
|
|
import GlobalData.Compiler.CompilerType;
|
2024-03-15 12:32:49 +03:00
|
|
|
import GlobalData.Credentials.Credentials;
|
2023-12-10 02:26:28 +03:00
|
|
|
import TestingSystem.Common.TestingServer;
|
2024-03-13 19:19:32 +03:00
|
|
|
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
2024-03-04 20:29:05 +03:00
|
|
|
import TestingSystem.DVM.DVMTasks.DVMRunTask;
|
2024-03-04 20:51:52 +03:00
|
|
|
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
2023-11-19 02:12:44 +03:00
|
|
|
import Visual_DVM_2021.UI.Interface.FormWithSplitters;
|
|
|
|
|
import Visual_DVM_2021.UI.Interface.TestingWindow;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
|
|
|
|
import javax.swing.*;
|
2023-10-12 00:31:58 +03:00
|
|
|
import java.awt.*;
|
2023-09-17 22:13:42 +03:00
|
|
|
public class TestingForm implements FormWithSplitters, TestingWindow {
|
|
|
|
|
private JPanel content;
|
|
|
|
|
@Override
|
|
|
|
|
public JPanel getContent() {
|
|
|
|
|
return content;
|
|
|
|
|
}
|
|
|
|
|
public JSplitPane SC50;
|
2023-12-22 18:12:21 +03:00
|
|
|
public JSplitPane SC65;
|
|
|
|
|
public JSplitPane SC66;
|
2024-03-01 21:01:35 +03:00
|
|
|
public JSplitPane SC64;
|
|
|
|
|
public JSplitPane SC70;
|
|
|
|
|
public JSplitPane SC63;
|
|
|
|
|
public JSplitPane SC59;
|
|
|
|
|
public JSplitPane SC71;
|
|
|
|
|
public JSplitPane SC72;
|
2024-03-13 19:19:32 +03:00
|
|
|
public JSplitPane SC74;
|
|
|
|
|
public JSplitPane SC18;
|
|
|
|
|
public JSplitPane SC19;
|
2023-09-17 22:13:42 +03:00
|
|
|
//---
|
|
|
|
|
private JTabbedPane testingTabs;
|
2024-03-01 21:01:35 +03:00
|
|
|
private JPanel dvmPackagesTab;
|
|
|
|
|
private JPanel dvmComparisonTab;
|
|
|
|
|
private JPanel sapforPackagesTab;
|
|
|
|
|
private JPanel sapforComparisonTab;
|
2023-12-16 15:34:29 +03:00
|
|
|
private JPanel dvmRunTasksPanel;
|
2023-09-17 22:13:42 +03:00
|
|
|
private JToolBar testsResultsTools;
|
|
|
|
|
private JButton bChangeKernels;
|
|
|
|
|
private JTextField filterName;
|
|
|
|
|
private JPanel configurationsPanel;
|
2023-12-11 18:29:15 +03:00
|
|
|
private JPanel dvmPackagesPanel;
|
2023-09-17 22:13:42 +03:00
|
|
|
private JButton bCompilationFilter;
|
|
|
|
|
private JPanel packageVersionsPanel;
|
|
|
|
|
private JPanel sapforConfigurationsPanel;
|
|
|
|
|
private JLabel sapforConfigurationsLabel;
|
|
|
|
|
private JLabel sapforConfigurationsCommandsLabel;
|
|
|
|
|
private JPanel sapforConfigurationCommandsPanel;
|
2023-09-27 00:43:23 +03:00
|
|
|
private JPanel sapforScenariosPanel;
|
2023-10-03 15:07:17 +03:00
|
|
|
private JPanel serverSapforsPanel;
|
2023-12-15 18:38:05 +03:00
|
|
|
private JPanel sapforPackagesPanel;
|
2024-03-13 19:19:32 +03:00
|
|
|
private JPanel compilersPanel;
|
|
|
|
|
private JPanel machinesPanel;
|
|
|
|
|
private JPanel usersPanel;
|
2024-03-15 12:32:49 +03:00
|
|
|
private JPanel credentialsPanel;
|
2023-09-17 22:13:42 +03:00
|
|
|
private JPanel testsRunTasksBackground;
|
|
|
|
|
private JCheckBox filterFinished;
|
|
|
|
|
private JButton bTest;
|
|
|
|
|
private JButton bDownloadTestProject;
|
|
|
|
|
//-
|
2023-12-16 16:52:17 +03:00
|
|
|
private final DVMRunTasksComparisonForm dvmTestingRunMaster; //сравнение тестов двм системы.
|
|
|
|
|
private final DVMRunTasksComparisonForm dvmTestingRunSlave;
|
2023-09-17 22:13:42 +03:00
|
|
|
//-
|
2023-11-02 00:01:34 +03:00
|
|
|
private final SapforPackagesComparisonForm sapforPackageTreeMaster; //сравнение деревьев пакетов SAPFOR.
|
|
|
|
|
private final SapforPackagesComparisonForm sapforPackageTreeSlave;
|
|
|
|
|
//--
|
2023-11-30 01:25:26 +03:00
|
|
|
private final SapforVersionsComparisonForm sapforVersionMaster; //сравнение версий тестов SAPFOR.
|
|
|
|
|
private final SapforVersionsComparisonForm sapforVersionSlave;
|
2023-11-02 00:01:34 +03:00
|
|
|
//--
|
2023-09-17 22:13:42 +03:00
|
|
|
public TestingForm() {
|
2023-10-12 00:31:58 +03:00
|
|
|
content.add(UI.testingBar, BorderLayout.NORTH);
|
2023-09-17 22:13:42 +03:00
|
|
|
LoadSplitters();
|
|
|
|
|
//-
|
2023-12-16 16:52:17 +03:00
|
|
|
dvmTestingRunMaster = new DVMRunTasksComparisonForm(dvmTestingRunSlave = new DVMRunTasksComparisonForm(null));
|
2023-11-02 00:01:34 +03:00
|
|
|
sapforPackageTreeMaster = new SapforPackagesComparisonForm(sapforPackageTreeSlave = new SapforPackagesComparisonForm(null));
|
|
|
|
|
sapforVersionMaster = new SapforVersionsComparisonForm(
|
|
|
|
|
sapforVersionSlave = new SapforVersionsComparisonForm(null, Current.SapforVersion),
|
|
|
|
|
Current.SapforEtalonVersion
|
|
|
|
|
);
|
2023-09-17 22:13:42 +03:00
|
|
|
//--->>>
|
|
|
|
|
RefreshTabsNames();
|
2024-03-15 12:32:49 +03:00
|
|
|
if (Global.properties.collapseCredentials) {
|
|
|
|
|
CollapseCredentials();
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
//-
|
|
|
|
|
SC50.setLeftComponent(dvmTestingRunMaster.getContent());
|
|
|
|
|
SC50.setRightComponent(dvmTestingRunSlave.getContent());
|
|
|
|
|
//-
|
2023-11-02 00:01:34 +03:00
|
|
|
SC65.setLeftComponent(sapforPackageTreeMaster.getContent());
|
|
|
|
|
SC66.setLeftComponent(sapforPackageTreeSlave.getContent());
|
|
|
|
|
//-
|
|
|
|
|
SC65.setRightComponent(sapforVersionMaster.getContent());
|
|
|
|
|
SC66.setRightComponent(sapforVersionSlave.getContent());
|
2023-10-30 18:28:01 +03:00
|
|
|
//-
|
2024-03-13 19:19:32 +03:00
|
|
|
Global.db.machines.mountUI(machinesPanel);
|
|
|
|
|
Global.db.users.mountUI(usersPanel);
|
|
|
|
|
Global.db.compilers.mountUI(compilersPanel);
|
|
|
|
|
//-
|
2023-09-17 22:13:42 +03:00
|
|
|
Global.testingServer.db.configurations.mountUI(configurationsPanel);
|
2023-12-11 18:29:15 +03:00
|
|
|
Global.testingServer.db.dvmPackages.mountUI(dvmPackagesPanel);
|
2023-12-16 15:34:29 +03:00
|
|
|
Global.testingServer.db.dvmRunTasks.mountUI(dvmRunTasksPanel);
|
2023-09-17 22:13:42 +03:00
|
|
|
Global.testingServer.db.sapforConfigurations.mountUI(sapforConfigurationsPanel);
|
|
|
|
|
Global.testingServer.db.sapforConfigurationCommands.mountUI(sapforConfigurationCommandsPanel);
|
2023-10-03 15:07:17 +03:00
|
|
|
Global.testingServer.db.serverSapfors.mountUI(serverSapforsPanel);
|
2023-12-15 18:38:05 +03:00
|
|
|
Global.testingServer.db.sapforPackages.mountUI(sapforPackagesPanel);
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
//-
|
|
|
|
|
@Override
|
|
|
|
|
public void ShowAll() {
|
2024-03-13 19:19:32 +03:00
|
|
|
Global.db.machines.ShowUI();
|
2023-09-17 22:13:42 +03:00
|
|
|
Global.testingServer.db.configurations.ShowUI();
|
2023-12-11 18:29:15 +03:00
|
|
|
Global.testingServer.db.dvmPackages.ShowUI();
|
2023-12-15 18:38:05 +03:00
|
|
|
Global.testingServer.db.sapforPackages.ShowUI();
|
2023-10-11 18:44:16 +03:00
|
|
|
//--
|
2023-10-03 15:07:17 +03:00
|
|
|
Global.testingServer.db.serverSapfors.ShowUI();
|
2023-09-17 22:13:42 +03:00
|
|
|
Global.testingServer.db.sapforConfigurations.ShowUI();
|
2023-12-16 15:34:29 +03:00
|
|
|
Global.testingServer.db.dvmRunTasks.ShowUI();
|
2023-11-13 21:07:44 +03:00
|
|
|
//---
|
2024-03-15 12:32:49 +03:00
|
|
|
RestoreLastCredentials();
|
|
|
|
|
//---
|
2023-12-10 02:26:28 +03:00
|
|
|
if (Global.properties.AutoCheckTesting)
|
|
|
|
|
TestingServer.TimerOn();
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
//-
|
|
|
|
|
@Override
|
|
|
|
|
public void ShowCurrentTestsPackage() {
|
|
|
|
|
ShowCurrentTestRunTask();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void DropTestRunTasksComparison() {
|
|
|
|
|
dvmTestingRunMaster.RemoveObject();
|
|
|
|
|
dvmTestingRunSlave.RemoveObject();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2023-10-30 18:28:01 +03:00
|
|
|
public void DropSapforComparison() {
|
2023-11-02 00:01:34 +03:00
|
|
|
sapforPackageTreeMaster.RemoveObject();
|
|
|
|
|
sapforPackageTreeSlave.RemoveObject();
|
|
|
|
|
sapforVersionMaster.RemoveObject();
|
|
|
|
|
sapforVersionSlave.RemoveObject();
|
2023-10-30 18:28:01 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
2023-09-17 22:13:42 +03:00
|
|
|
public void ShowCurrentTestRunTask() {
|
|
|
|
|
// if (dvmTestingRunMaster.isActive()) dvmTestingRunMaster.ShowTask();
|
|
|
|
|
// else dvmTestingRunSlave.ShowTask();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void ShowNoTestRunTask() {
|
|
|
|
|
// dvmTestingRunMaster.Clear();
|
|
|
|
|
// dvmTestingRunSlave.Clear();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void RefreshTabsNames() {
|
|
|
|
|
}
|
|
|
|
|
private void createUIComponents() {
|
|
|
|
|
// TODO: place custom component creation code here
|
|
|
|
|
filterName = new StyledTextField();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void FocusTestingTasks() {
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2023-11-01 23:14:49 +03:00
|
|
|
public void ShowCurrentSapforPackageVersionEtalon() {
|
2023-11-02 00:01:34 +03:00
|
|
|
sapforVersionMaster.ApplyObject();
|
2023-11-01 23:14:49 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void ShowCurrentSapforPackageVersion() {
|
2023-11-13 21:07:44 +03:00
|
|
|
sapforVersionSlave.ApplyObject();
|
2023-11-02 00:01:34 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void ShowNoSapforPackageVersionEtalon() {
|
|
|
|
|
sapforVersionMaster.RemoveObject();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void ShowNoSapforPackageVersion() {
|
|
|
|
|
sapforVersionSlave.RemoveObject();
|
2023-11-01 23:14:49 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
2023-11-14 00:56:05 +03:00
|
|
|
public void FocusSapforTesting() {
|
|
|
|
|
testingTabs.setSelectedIndex(1);
|
|
|
|
|
}
|
2023-12-11 18:52:23 +03:00
|
|
|
@Override
|
|
|
|
|
public void ShowCurrentCompiler() {
|
2024-03-04 20:29:05 +03:00
|
|
|
String title = (Current.HasCompiler() && Current.getCompiler().type.equals(CompilerType.dvm)) ?
|
|
|
|
|
"DVM система: " + Current.getCompiler().description : "DVM система: ?";
|
2023-12-11 18:52:23 +03:00
|
|
|
testingTabs.setTitleAt(0, title);
|
|
|
|
|
}
|
2023-12-12 01:01:36 +03:00
|
|
|
@Override
|
|
|
|
|
public void ShowCurrentServerSapfor() {
|
2024-03-04 20:29:05 +03:00
|
|
|
testingTabs.setTitleAt(2, "SAPFOR: " + Current.getServerSapfor().version);
|
2023-12-12 01:01:36 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void ShowNoServerSapfor() {
|
2024-03-04 20:29:05 +03:00
|
|
|
testingTabs.setTitleAt(2, "SAPFOR: ?");
|
2023-12-12 01:01:36 +03:00
|
|
|
}
|
2023-12-16 15:34:29 +03:00
|
|
|
@Override
|
|
|
|
|
public void ShowCurrentDVMPackage() {
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void ShowNoCurrentDVMPackage() {
|
|
|
|
|
}
|
2024-03-04 20:29:05 +03:00
|
|
|
@Override
|
2024-03-04 22:27:49 +03:00
|
|
|
public void ShowDVMRunTask(DVMRunTask master) {
|
|
|
|
|
dvmTestingRunMaster.ApplyObject(master);
|
|
|
|
|
testingTabs.setSelectedIndex(1);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void ShowSapforPackage(SapforPackage master) {
|
|
|
|
|
sapforPackageTreeMaster.ApplyObject(master);
|
|
|
|
|
testingTabs.setSelectedIndex(3);
|
|
|
|
|
}
|
2024-03-13 19:19:32 +03:00
|
|
|
public void ShowDVMPackage(DVMPackage master) {
|
|
|
|
|
testingTabs.setSelectedIndex(1);
|
|
|
|
|
}
|
2024-03-04 22:27:49 +03:00
|
|
|
@Override
|
2024-03-04 20:29:05 +03:00
|
|
|
public void CompareDVMRunTasks(DVMRunTask master, DVMRunTask slave) {
|
|
|
|
|
dvmTestingRunMaster.ApplyObject(master);
|
|
|
|
|
dvmTestingRunSlave.ApplyObject(slave);
|
2024-03-04 22:27:49 +03:00
|
|
|
dvmTestingRunMaster.DoComparePass(true);
|
2024-03-15 12:32:49 +03:00
|
|
|
// testingTabs.setSelectedIndex(1);
|
2024-03-04 20:29:05 +03:00
|
|
|
}
|
2024-03-04 20:51:52 +03:00
|
|
|
@Override
|
|
|
|
|
public void CompareSapforPackages(SapforPackage master, SapforPackage slave) {
|
|
|
|
|
sapforPackageTreeMaster.ApplyObject(master);
|
|
|
|
|
sapforPackageTreeSlave.ApplyObject(slave);
|
2024-03-04 22:27:49 +03:00
|
|
|
sapforPackageTreeMaster.DoComparePass();
|
2024-03-04 20:51:52 +03:00
|
|
|
testingTabs.setSelectedIndex(3);
|
|
|
|
|
}
|
2024-03-15 12:32:49 +03:00
|
|
|
@Override
|
|
|
|
|
public void CollapseCredentials() {
|
|
|
|
|
UI.Clear(credentialsPanel);
|
|
|
|
|
credentialsPanel.add(UI.credentialsBar);
|
|
|
|
|
SC71.setDividerLocation(30);
|
|
|
|
|
SC71.setDividerSize(0);
|
|
|
|
|
//SC71.setEnabled(false);
|
|
|
|
|
credentialsPanel.revalidate();
|
|
|
|
|
credentialsPanel.repaint();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void ExpandCredentials() {
|
|
|
|
|
UI.Clear(credentialsPanel);
|
|
|
|
|
credentialsPanel.add(SC18);
|
|
|
|
|
SC71.setDividerLocation(200);
|
|
|
|
|
//SC71.setEnabled(true);
|
|
|
|
|
SC71.setDividerSize(3);
|
|
|
|
|
credentialsPanel.revalidate();
|
|
|
|
|
credentialsPanel.repaint();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void SwitchCredentials(boolean flag) {
|
|
|
|
|
if (flag) {
|
|
|
|
|
ExpandCredentials();
|
|
|
|
|
} else {
|
|
|
|
|
CollapseCredentials();
|
|
|
|
|
}
|
|
|
|
|
Global.properties.collapseCredentials = !flag;
|
|
|
|
|
Global.properties.Update();
|
|
|
|
|
}
|
2024-03-13 19:19:32 +03:00
|
|
|
|
|
|
|
|
public void RestoreLastCredentials() {
|
|
|
|
|
Credentials credentials = (Credentials) Current.get(Current.Credentials);
|
|
|
|
|
if (credentials.machine_id != Constants.Nan) {
|
|
|
|
|
if (Global.db.machines.containsKey(credentials.machine_id)) {
|
|
|
|
|
Global.db.machines.ShowUI(credentials.machine_id);
|
|
|
|
|
if (Global.db.users.containsKey(credentials.user_id)) {
|
|
|
|
|
Global.db.users.ShowUI(credentials.user_id);
|
|
|
|
|
} else {
|
|
|
|
|
credentials.user_id = Constants.Nan;
|
|
|
|
|
Global.db.UpdateCredentials();
|
|
|
|
|
}
|
|
|
|
|
if (Global.db.compilers.containsKey(credentials.compiler_id)) {
|
|
|
|
|
Global.db.compilers.ShowUI(credentials.compiler_id);
|
|
|
|
|
} else {
|
|
|
|
|
credentials.compiler_id = Constants.Nan;
|
|
|
|
|
Global.db.UpdateCredentials();
|
|
|
|
|
}
|
|
|
|
|
//-
|
|
|
|
|
if (Global.db.makefiles.containsKey(credentials.makefile_id)) {
|
|
|
|
|
Global.db.makefiles.ShowUI(credentials.makefile_id);
|
|
|
|
|
} else {
|
|
|
|
|
credentials.makefile_id = Constants.Nan;
|
|
|
|
|
Global.db.UpdateCredentials();
|
|
|
|
|
}
|
|
|
|
|
//-
|
|
|
|
|
if (Global.db.runConfigurations.containsKey(credentials.runconfiguration_id)) {
|
|
|
|
|
Global.db.runConfigurations.ShowUI(credentials.runconfiguration_id);
|
|
|
|
|
} else {
|
|
|
|
|
credentials.runconfiguration_id = Constants.Nan;
|
|
|
|
|
Global.db.UpdateCredentials();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
credentials.machine_id = Constants.Nan;
|
|
|
|
|
credentials.user_id = Constants.Nan;
|
|
|
|
|
credentials.compiler_id = Constants.Nan;
|
|
|
|
|
credentials.remotesapfor_id = Constants.Nan;
|
|
|
|
|
credentials.makefile_id = Constants.Nan;
|
|
|
|
|
credentials.runconfiguration_id = Constants.Nan;
|
|
|
|
|
Global.db.UpdateCredentials();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|