no message

This commit is contained in:
2023-09-27 15:29:25 +03:00
parent bd7778414a
commit 9148023b2f
6 changed files with 57 additions and 56 deletions

4
.idea/workspace.xml generated
View File

@@ -8,10 +8,10 @@
<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 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/SapforTestingSystem/Json/Scenario_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/Scenario_json.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforScenario/SapforScenario.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforScenario/SapforScenario.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforScenario/SapforScenario.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforScenario/SapforScenario.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforScenario/SapforScenariosDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforScenario/SapforScenariosDBTable.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/SapforTasksPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/PerformSapforTasksPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/PerformSapforTasksPackage.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/Visual_DVM_2021/Passes/All/StartSapforTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />

View File

@@ -3,8 +3,6 @@ import Common.Database.iDBObject;
import TestingSystem.TasksPackage.TasksPackageState; import TestingSystem.TasksPackage.TasksPackageState;
import com.sun.org.glassfish.gmbal.Description; import com.sun.org.glassfish.gmbal.Description;
public class SapforScenario extends iDBObject { public class SapforScenario extends iDBObject {
@Description("DEFAULT ''")
public String passesNames = ""; //переведенные имена преобразований через ; для отображения
@Description("DEFAULT ''") @Description("DEFAULT ''")
public String testsNames = "";//имена тестов через ; для отображения public String testsNames = "";//имена тестов через ; для отображения
//--- //---

View File

@@ -30,9 +30,9 @@ public class SapforScenariosDBTable extends iDBTable<SapforScenario> {
return new DataSetControlForm(this) { return new DataSetControlForm(this) {
@Override @Override
protected void AdditionalInitColumns() { protected void AdditionalInitColumns() {
columns.get(4).setRenderer(RendererDate);
columns.get(5).setRenderer(RendererDate); columns.get(5).setRenderer(RendererDate);
columns.get(6).setRenderer(RendererDate); columns.get(6).setRenderer(RendererStatusEnum);
columns.get(7).setRenderer(RendererStatusEnum);
} }
@Override @Override
public void ShowCurrentObject() throws Exception { public void ShowCurrentObject() throws Exception {
@@ -50,7 +50,6 @@ public class SapforScenariosDBTable extends iDBTable<SapforScenario> {
public String[] getUIColumnNames() { public String[] getUIColumnNames() {
return new String[]{ return new String[]{
"SAPFOR", "SAPFOR",
"Проходы",
"Тесты", "Тесты",
"Задач", "Задач",
"Начало", "Начало",
@@ -64,22 +63,19 @@ public class SapforScenariosDBTable extends iDBTable<SapforScenario> {
case 1: case 1:
return object.sapfor_version; return object.sapfor_version;
case 2: case 2:
return object.passesNames;
case 3:
return object.testsNames; return object.testsNames;
case 4: case 3:
return object.tasksCount; return object.tasksCount;
case 5: case 4:
return new Date(object.StartDate); return new Date(object.StartDate);
case 6: case 5:
return new Date(object.ChangeDate); return new Date(object.ChangeDate);
case 7: case 6:
return object.state; 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<>();

View File

@@ -16,6 +16,8 @@ public class SapforTasksPackage extends iDBObject {
//--- //---
@Description("DEFAULT ''") @Description("DEFAULT ''")
public String flags = ""; public String flags = "";
@Description("DEFAULT ''")
public String passesNames = "";
@Description("DEFAULT 0") @Description("DEFAULT 0")
public int versions_tree_built = 0; public int versions_tree_built = 0;
//-- //--
@@ -29,6 +31,7 @@ public class SapforTasksPackage extends iDBObject {
super.SynchronizeFields(src); super.SynchronizeFields(src);
SapforTasksPackage tasksPackage = (SapforTasksPackage) src; SapforTasksPackage tasksPackage = (SapforTasksPackage) src;
flags = tasksPackage.flags; flags = tasksPackage.flags;
passesNames = tasksPackage.passesNames;
} }
public SapforTasksPackage(SapforTasksPackage src) { public SapforTasksPackage(SapforTasksPackage src) {
this.SynchronizeFields(src); this.SynchronizeFields(src);

View File

@@ -34,22 +34,21 @@ public class SapforTasksPackagesDBTable extends iDBTable<SapforTasksPackage> {
super.ShowNoCurrentObject(); super.ShowNoCurrentObject();
// UI.getNewMainWindow().getTestingWindow().DropTestRunTasksComparison(); // UI.getNewMainWindow().getTestingWindow().DropTestRunTasksComparison();
} }
@Override
public boolean hasCheckBox() {
return true;
}
}; };
} }
@Override @Override
public String[] getUIColumnNames() { public String[] getUIColumnNames() {
return new String[]{ return new String[]{
"Флаги", "Проходы",
"Флаги"
}; };
} }
@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;
case 2:
return object.flags; return object.flags;
default: default:
return null; return null;

View File

@@ -1,14 +1,15 @@
package Visual_DVM_2021.Passes.All; package Visual_DVM_2021.Passes.All;
import Common.Current;
import Common.Global; import Common.Global;
import Common.UI.UI; import Common.UI.UI;
import Common.Utils.Utils; import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.LanguageName; import ProjectData.LanguageName;
import Repository.Server.ServerCode; import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021; import Repository.Server.ServerExchangeUnit_2021;
import SapforTestingSystem.SapforConfiguration.SapforConfiguration; import SapforTestingSystem.SapforConfiguration.SapforConfiguration;
import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommand; import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommand;
import SapforTestingSystem.SapforScenario.SapforScenario; import SapforTestingSystem.SapforScenario.SapforScenario;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
import TestingSystem.Group.Group; import TestingSystem.Group.Group;
import TestingSystem.Test.Test; import TestingSystem.Test.Test;
import TestingSystem.Test.TestInterface; import TestingSystem.Test.TestInterface;
@@ -17,14 +18,16 @@ 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;
import java.nio.file.Paths;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Vector; import java.util.Vector;
public class StartSapforTests extends Pass_2021<Vector<SapforTasksPackage>> { public class StartSapforTests extends Pass_2021<SapforScenario> {
protected int allTasksCount = 0; protected int allTasksCount = 0;
//-- //--
protected LinkedHashMap<String, Vector<String>> groupsTests = null; protected LinkedHashMap<String, Vector<String>> groupsTests = null;
//-- //--
protected Vector<String> testsNames = null; //все тесты что участвуют здесь. protected LinkedHashMap<String, Test> allTests = null;
protected Vector<String> testsNames_lower = null; //все тесты что участвуют здесь
protected Vector<LanguageName> groupsLanguages = null; protected Vector<LanguageName> groupsLanguages = null;
protected File sapfor = null; protected File sapfor = null;
//--- //---
@@ -41,15 +44,13 @@ public class StartSapforTests extends Pass_2021<Vector<SapforTasksPackage>> {
return true; return true;
} }
//-- //--
protected boolean checkTestName(String testId) { protected boolean checkTestName(Test test) {
Test test = Global.testingServer.db.tests.get(testId);
//-
String name = test.description.toLowerCase(); String name = test.description.toLowerCase();
if (testsNames.contains(name)) { if (testsNames_lower.contains(name)) {
Log.Writeln_("В пакет не могут входить тесты с одинаковыми именами :" + test.description.toLowerCase()); Log.Writeln_("В пакет не могут входить тесты с одинаковыми именами (без учета регистра):" + test.description.toLowerCase());
return false; return false;
} }
testsNames.add(name); testsNames_lower.add(name);
return true; return true;
} }
protected boolean getGroupTests(String groupId) { protected boolean getGroupTests(String groupId) {
@@ -72,8 +73,11 @@ public class StartSapforTests extends Pass_2021<Vector<SapforTasksPackage>> {
} }
//-- //--
for (String testId : groupTests) { for (String testId : groupTests) {
if (!checkTestName(testId)) Test test = Global.testingServer.db.tests.get(testId);
if (!checkTestName(test))
return false; return false;
else
allTests.put(test.description, test);
} }
//-- //--
groupsTests.put(groupId, groupTests); groupsTests.put(groupId, groupTests);
@@ -112,13 +116,14 @@ public class StartSapforTests extends Pass_2021<Vector<SapforTasksPackage>> {
} }
@Override @Override
protected boolean canStart(Object... args) throws Exception { protected boolean canStart(Object... args) throws Exception {
target = new Vector<>();
//-- //--
allTasksCount = 0; allTasksCount = 0;
target = null;
//-- //--
groupsTests = new LinkedHashMap<>(); groupsTests = new LinkedHashMap<>();
//--->> //--->>
testsNames = new Vector<>(); testsNames_lower = new Vector<>();
allTests = new LinkedHashMap<>();
groupsLanguages = new Vector<>(); groupsLanguages = new Vector<>();
//проверка стартовых условий. //проверка стартовых условий.
//--->> //--->>
@@ -173,13 +178,10 @@ public class StartSapforTests extends Pass_2021<Vector<SapforTasksPackage>> {
} }
@Override @Override
protected void ServerAction() throws Exception { protected void ServerAction() throws Exception {
for (String groupId : groupsTests.keySet()) { for (Test test : allTests.values()) {
for (String testId : groupsTests.get(groupId)) { ShowMessage1("загрузка " + test.description);
Test test = Global.testingServer.db.tests.get(testId); Command(new ServerExchangeUnit_2021(ServerCode.DownloadTest, test.id));
ShowMessage1("загрузка " + test.description); response.Unpack(TestInterface.getArchive(test));
Command(new ServerExchangeUnit_2021(ServerCode.DownloadTest, test.id));
response.Unpack(TestInterface.getArchive(test));
}
} }
} }
}.Do(); }.Do();
@@ -189,28 +191,31 @@ public class StartSapforTests extends Pass_2021<Vector<SapforTasksPackage>> {
//--- //---
ShowMessage1("Распаковка тестов..."); ShowMessage1("Распаковка тестов...");
//сразу в задачи распаковывать нельзя, потому что копируются под ид,а не дескриптион. //сразу в задачи распаковывать нельзя, потому что копируются под ид,а не дескриптион.
for (String groupId : groupsTests.keySet()) { for (Test test : allTests.values()) {
for (String testId : groupsTests.get(groupId)) { ShowMessage2(test.description);
Test test = Global.testingServer.db.tests.get(testId); File testDst = new File(Global.TestsDirectory, test.id);
ShowMessage2(test.description); Utils.delete_with_check(testDst);
File testDst = new File(Global.TestsDirectory, test.id); passes.get(PassCode_2021.UnzipFolderPass).Do(
Utils.delete_with_check(testDst); TestInterface.getArchive(test).getAbsolutePath(),
passes.get(PassCode_2021.UnzipFolderPass).Do( Global.TestsDirectory.getAbsolutePath(), false
TestInterface.getArchive(test).getAbsolutePath(), );
Global.TestsDirectory.getAbsolutePath(), false
);
}
} }
SapforScenario scenario = new SapforScenario(); target = new SapforScenario();
target.sapfor_version = String.valueOf(Current.getSapfor().version);
target.tasksCount = allTasksCount;
Global.db.Insert(target);
//--->>>
File scenarioWorkspace = Paths.get(Global.db.settings.get(SettingName.Workspace).Value, String.valueOf(target.id)).toFile();
Utils.CheckAndCleanDirectory(scenarioWorkspace);
target.workspace = scenarioWorkspace.getAbsolutePath();
target.testsNames = String.join(";", testsNames_lower);
//----
Global.db.Update(target);
/* /*
ShowMessage1("Создание рабочих пространств..."); ShowMessage1("Создание рабочих пространств...");
for (SapforConfiguration configuration : Global.testingServer.db.sapforConfigurations.getCheckedItems()) { for (SapforConfiguration configuration : Global.testingServer.db.sapforConfigurations.getCheckedItems()) {
SapforTasksPackage sapforTasksPackage_ = new SapforTasksPackage(); SapforTasksPackage sapforTasksPackage_ = new SapforTasksPackage();
//-- //--
sapforTasksPackage_.sapfor_version = String.valueOf(Current.getSapfor().version);
sapforTasksPackage_.tasksCount = allTasksCount;
sapforTasksPackage_.sapforconfiguration_id = configuration.id; sapforTasksPackage_.sapforconfiguration_id = configuration.id;
sapforTasksPackage_.flags = SapforConfigurationInterface.getFlags(configuration); sapforTasksPackage_.flags = SapforConfigurationInterface.getFlags(configuration);
sapforTasksPackage_.passesNames = SapforConfigurationInterface.getTransformationsNames(configuration); sapforTasksPackage_.passesNames = SapforConfigurationInterface.getTransformationsNames(configuration);
@@ -274,7 +279,7 @@ public class StartSapforTests extends Pass_2021<Vector<SapforTasksPackage>> {
} }
@Override @Override
protected void showFinish() throws Exception { protected void showFinish() throws Exception {
Global.db.sapforTasksPackages.ShowUI(target.lastElement()); Global.db.sapforScenarios.ShowUI(target.getPK());
} }
@Override @Override
protected void performDone() throws Exception { protected void performDone() throws Exception {
@@ -289,6 +294,6 @@ public class StartSapforTests extends Pass_2021<Vector<SapforTasksPackage>> {
} }
@Override @Override
protected void showDone() throws Exception { protected void showDone() throws Exception {
Global.db.sapforTasksPackages.ShowUI(); Global.db.sapforScenarios.ShowUI();
} }
} }