промежуточный. изменен механизм формирования задач для тестирования SAPFOR. Теперь они создаются на стадии черновика, при публикации только обновляются ссылки на родительский пакет. При добавлении задач в пакет идет проверка по ключам на их существование.
This commit is contained in:
13
.idea/workspace.xml
generated
13
.idea/workspace.xml
generated
@@ -8,8 +8,17 @@
|
|||||||
<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/GlobalData/Account/Account.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/Account/Account.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteServerSapfor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteServerSapfor.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TaskThread.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TaskThread.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforTestingSet_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforTestingSet_json.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/PackageModeSupervisor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/PackageModeSupervisor.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/PerformSapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/PerformSapforTask.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforPackage/SapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforPackage/SapforPackage.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddTasksToSapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddTasksToSapforPackage.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CompareDVMRunTasks.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CompareDVMRunTasks.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CompareSapforPackages.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CompareSapforPackages.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" />
|
||||||
|
|||||||
@@ -7,18 +7,11 @@ import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
public class TaskThread extends Thread {
|
public class TaskThread extends Thread {
|
||||||
public SapforTask task = null;
|
public SapforTask task = null;
|
||||||
public TaskThread(SapforTask task_, File sapfor_drv,
|
public TaskThread(SapforTask task_, File sapfor_drv) {
|
||||||
SapforTestingSet_json set_json,
|
|
||||||
SapforConfiguration_json configuration_json) {
|
|
||||||
super(() -> {
|
super(() -> {
|
||||||
while (!task_.state.isComplete()) {
|
while (!task_.state.isComplete()) {
|
||||||
task_.Reset();
|
task_.Reset();
|
||||||
new PerformSapforTask().Do(
|
new PerformSapforTask().Do(task_,sapfor_drv);
|
||||||
sapfor_drv,
|
|
||||||
set_json,
|
|
||||||
configuration_json,
|
|
||||||
task_
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
task = task_;
|
task = task_;
|
||||||
|
|||||||
@@ -69,12 +69,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
dvmPackage.saveJson();
|
dvmPackage.saveJson();
|
||||||
dvmPackage.package_json = null; // объект больше не нужен.
|
dvmPackage.package_json = null; // объект больше не нужен.
|
||||||
} else if (object instanceof SapforPackage) {
|
} else if (object instanceof SapforPackage) {
|
||||||
SapforPackage sapforPackage = (SapforPackage) object;
|
((SapforPackage) object).init();
|
||||||
//--
|
|
||||||
Utils.CheckAndCleanDirectory(sapforPackage.getLocalWorkspace());
|
|
||||||
//--
|
|
||||||
sapforPackage.saveJson();
|
|
||||||
sapforPackage.package_json = null; // объект больше не нужен.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@@ -603,7 +598,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
private void ReplaceTestsCodes() throws Exception {
|
private void ReplaceTestsCodes() throws Exception {
|
||||||
Vector<Test> tests = (Vector<Test>) request.object;
|
Vector<Test> tests = (Vector<Test>) request.object;
|
||||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||||
for (Test test: tests){
|
for (Test test : tests) {
|
||||||
if (!test.unpackProjectOnServer()) {
|
if (!test.unpackProjectOnServer()) {
|
||||||
db.Delete(test);
|
db.Delete(test);
|
||||||
throw new RepositoryRefuseException(
|
throw new RepositoryRefuseException(
|
||||||
|
|||||||
@@ -25,9 +25,41 @@ public class SapforPackage_json implements Serializable {
|
|||||||
public int getMaxSetId() {
|
public int getMaxSetId() {
|
||||||
return max_set_id++;
|
return max_set_id++;
|
||||||
}
|
}
|
||||||
|
@Expose
|
||||||
|
public int max_task_id = 0;
|
||||||
|
public int getMaxTaskId() {
|
||||||
|
return max_task_id++;
|
||||||
|
}
|
||||||
//--
|
//--
|
||||||
@Expose
|
@Expose
|
||||||
public List<SapforTestingSet_json> testingSets = new Vector<>(); //сет = конфигурации + тесты.
|
public List<SapforTestingSet_json> testingSets = new Vector<>(); //сет = конфигурации + тесты.
|
||||||
|
@Expose
|
||||||
|
public List<SapforTask> tasks = new Vector<>();
|
||||||
|
//--
|
||||||
|
public Vector<String> getTasksKeys() {
|
||||||
|
Vector<String> keys = new Vector<>();
|
||||||
|
for (SapforTask task : tasks) {
|
||||||
|
String key = task.getUniqueKey();
|
||||||
|
if (!keys.contains(key))
|
||||||
|
keys.add(key);
|
||||||
|
}
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
public Vector<String> getTestsNames() {
|
||||||
|
Vector<String> names = new Vector<>();
|
||||||
|
for (SapforTask task : tasks) {
|
||||||
|
if (!names.contains(task.test_description))
|
||||||
|
names.add(task.test_description);
|
||||||
|
}
|
||||||
|
names.sort(new Comparator<String>() {
|
||||||
|
@Override
|
||||||
|
public int compare(String o1, String o2) {
|
||||||
|
return o1.compareTo(o2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return names;
|
||||||
|
}
|
||||||
|
//--
|
||||||
public boolean hasConfiguration(int configuration_id) {
|
public boolean hasConfiguration(int configuration_id) {
|
||||||
for (SapforTestingSet_json set : testingSets) {
|
for (SapforTestingSet_json set : testingSets) {
|
||||||
for (SapforConfiguration_json configuration : set.configurations) {
|
for (SapforConfiguration_json configuration : set.configurations) {
|
||||||
@@ -38,9 +70,6 @@ public class SapforPackage_json implements Serializable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
@Expose
|
|
||||||
public List<SapforTask> tasks = new Vector<>();
|
|
||||||
//---
|
|
||||||
public void sortTasks() {
|
public void sortTasks() {
|
||||||
tasks.sort(new Comparator<SapforTask>() {
|
tasks.sort(new Comparator<SapforTask>() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package TestingSystem.SAPFOR.Json;
|
package TestingSystem.SAPFOR.Json;
|
||||||
import Common.Constants;
|
import Common.Constants;
|
||||||
|
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||||
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -12,4 +14,30 @@ public class SapforTestingSet_json implements Serializable {
|
|||||||
public List<SapforTest_json> tests = new Vector<>();
|
public List<SapforTest_json> tests = new Vector<>();
|
||||||
@Expose
|
@Expose
|
||||||
public List<SapforConfiguration_json> configurations = new Vector<>();
|
public List<SapforConfiguration_json> configurations = new Vector<>();
|
||||||
|
public Vector<SapforTask> createTasks() {
|
||||||
|
Vector<SapforTask> tasks = new Vector<>();
|
||||||
|
//-
|
||||||
|
for (SapforConfiguration_json sapforConfiguration_json : configurations) {
|
||||||
|
for (SapforTest_json test : tests) {
|
||||||
|
SapforTask task = new SapforTask();
|
||||||
|
//--
|
||||||
|
task.id = Constants.Nan;
|
||||||
|
task.sapfortaskspackage_id = Constants.Nan;
|
||||||
|
//-- unique key--
|
||||||
|
task.group_description = test.group_description;
|
||||||
|
task.test_description = test.description;
|
||||||
|
task.sapfor_configuration_id = sapforConfiguration_json.id;
|
||||||
|
//---------------
|
||||||
|
task.flags = sapforConfiguration_json.flags;
|
||||||
|
task.set_id = id;
|
||||||
|
tasks.add(task);
|
||||||
|
Vector<String> codes_s = new Vector<>();
|
||||||
|
for (PassCode_2021 code : sapforConfiguration_json.codes)
|
||||||
|
codes_s.add(code.toString());
|
||||||
|
task.codes = String.join(" ", codes_s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//-
|
||||||
|
return tasks;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,34 +36,8 @@ public class PackageModeSupervisor extends ThreadsPlanner {
|
|||||||
FileUtils.writeStringToFile(started, String.valueOf(startDate));
|
FileUtils.writeStringToFile(started, String.valueOf(startDate));
|
||||||
//формирование списка задач.
|
//формирование списка задач.
|
||||||
setMaxKernels(package_json.kernels);
|
setMaxKernels(package_json.kernels);
|
||||||
int max_rask_id = 0;
|
for (SapforTask task: package_json.tasks)
|
||||||
for (SapforTestingSet_json set_json : package_json.testingSets) {
|
addThread(new TaskThread(task,sapfor_drv));
|
||||||
for (SapforConfiguration_json sapforConfiguration_json : set_json.configurations) {
|
|
||||||
for (SapforTest_json test : set_json.tests) {
|
|
||||||
//--- чтобы было можно на нее сослаться после выполнения всех нитей.
|
|
||||||
SapforTask task = new SapforTask();
|
|
||||||
task.id = max_rask_id++;
|
|
||||||
task.group_description = test.group_description;
|
|
||||||
task.test_description = test.description;
|
|
||||||
task.flags = sapforConfiguration_json.flags;
|
|
||||||
task.set_id = set_json.id;
|
|
||||||
task.sapfor_configuration_id = sapforConfiguration_json.id;
|
|
||||||
task.sapfortaskspackage_id = Integer.parseInt(new File(Global.Home).getName());
|
|
||||||
package_json.tasks.add(task);
|
|
||||||
Vector<String> codes_s = new Vector<>();
|
|
||||||
for (PassCode_2021 code : sapforConfiguration_json.codes) {
|
|
||||||
codes_s.add(code.toString());
|
|
||||||
}
|
|
||||||
task.codes = String.join(" ", codes_s);
|
|
||||||
//---
|
|
||||||
addThread(new TaskThread(task,
|
|
||||||
sapfor_drv,
|
|
||||||
set_json,
|
|
||||||
sapforConfiguration_json)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
interruptThread.start();
|
interruptThread.start();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
|
|||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
File sapfor_drv;
|
File sapfor_drv;
|
||||||
SapforTestingSet_json set_json;
|
|
||||||
SapforConfiguration_json configuration_json;
|
|
||||||
SapforVersion_json version_json;
|
SapforVersion_json version_json;
|
||||||
//-----
|
//-----
|
||||||
File root;
|
File root;
|
||||||
@@ -39,17 +37,17 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
|
|||||||
//-----
|
//-----
|
||||||
@Override
|
@Override
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
sapfor_drv = (File) args[0];
|
//--
|
||||||
set_json = (SapforTestingSet_json) args[1];
|
target = (SapforTask) args[0];
|
||||||
configuration_json = (SapforConfiguration_json) args[2];
|
sapfor_drv = (File) args[1];
|
||||||
target = (SapforTask) args[3];
|
//--
|
||||||
version_json = null;
|
version_json = null;
|
||||||
//--->>
|
//--->>
|
||||||
parentTask = Paths.get(Global.Home,
|
parentTask = Paths.get(Global.Home,
|
||||||
String.valueOf(set_json.id),
|
String.valueOf(target.set_id),
|
||||||
String.valueOf(configuration_json.id),
|
String.valueOf(target.sapfor_configuration_id),
|
||||||
target.test_description).toFile();
|
target.test_description).toFile();
|
||||||
root = Paths.get(Global.Home, String.valueOf(set_json.id), String.valueOf(configuration_json.id)).toFile();
|
root = Paths.get(Global.Home, String.valueOf(target.set_id), String.valueOf(target.sapfor_configuration_id)).toFile();
|
||||||
task = null;
|
task = null;
|
||||||
//--->>
|
//--->>
|
||||||
return true;
|
return true;
|
||||||
@@ -115,7 +113,10 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
|
|||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
target.StartDate = new Date().getTime();
|
target.StartDate = new Date().getTime();
|
||||||
target.versions.add(version_json = new SapforVersion_json(target.test_description, "исходная"));
|
target.versions.add(version_json = new SapforVersion_json(target.test_description, "исходная"));
|
||||||
for (PassCode_2021 code : configuration_json.codes) {
|
String [] data = target.codes.split(" ");
|
||||||
|
for (String code_s: data){
|
||||||
|
PassCode_2021 code = PassCode_2021.valueOf(code_s);
|
||||||
|
//--
|
||||||
if (parse()) {
|
if (parse()) {
|
||||||
if (code.equals(PassCode_2021.CreateParallelVariants))
|
if (code.equals(PassCode_2021.CreateParallelVariants))
|
||||||
variants();
|
variants();
|
||||||
@@ -123,6 +124,7 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
|
|||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
|
//--
|
||||||
}
|
}
|
||||||
target.ChangeDate = new Date().getTime();
|
target.ChangeDate = new Date().getTime();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ package TestingSystem.SAPFOR.SapforPackage;
|
|||||||
import Common.Constants;
|
import Common.Constants;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.DBObject;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
|
import Common.Utils.Utils;
|
||||||
import TestingSystem.Common.TestingPackage.TestingPackage;
|
import TestingSystem.Common.TestingPackage.TestingPackage;
|
||||||
import TestingSystem.SAPFOR.Json.SapforPackage_json;
|
import TestingSystem.SAPFOR.Json.SapforPackage_json;
|
||||||
|
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -12,8 +14,7 @@ public class SapforPackage extends TestingPackage<SapforPackage_json> {
|
|||||||
public String testsNames = "";//имена тестов через ; для отображения
|
public String testsNames = "";//имена тестов через ; для отображения
|
||||||
//---
|
//---
|
||||||
public int sapforId = Constants.Nan; // так как сапфор на машине.
|
public int sapforId = Constants.Nan; // так как сапфор на машине.
|
||||||
public SapforPackage(){
|
public SapforPackage() {
|
||||||
|
|
||||||
}
|
}
|
||||||
public SapforPackage(SapforPackage sapforPackage) {
|
public SapforPackage(SapforPackage sapforPackage) {
|
||||||
SynchronizeFields(sapforPackage);
|
SynchronizeFields(sapforPackage);
|
||||||
@@ -33,4 +34,12 @@ public class SapforPackage extends TestingPackage<SapforPackage_json> {
|
|||||||
public File getHomeDirectory() {
|
public File getHomeDirectory() {
|
||||||
return Global.SapforPackagesDirectory;
|
return Global.SapforPackagesDirectory;
|
||||||
}
|
}
|
||||||
|
//--
|
||||||
|
public void init() throws Exception {
|
||||||
|
for (SapforTask task : package_json.tasks)
|
||||||
|
task.sapfortaskspackage_id = id;
|
||||||
|
Utils.CheckAndCleanDirectory(getLocalWorkspace());
|
||||||
|
saveJson();
|
||||||
|
package_json = null; // объект больше не нужен.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import TestingSystem.SAPFOR.Json.SapforTestingSet_json;
|
|||||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
||||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||||
|
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||||
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;
|
||||||
|
|
||||||
@@ -24,13 +25,14 @@ import java.util.Vector;
|
|||||||
public class AddTasksToSapforPackage extends Pass_2021<SapforPackage> {
|
public class AddTasksToSapforPackage extends Pass_2021<SapforPackage> {
|
||||||
SapforTestingSet_json testing_set; //то, что добавляем.
|
SapforTestingSet_json testing_set; //то, что добавляем.
|
||||||
//--
|
//--
|
||||||
protected int setTasksCount = 0;
|
|
||||||
protected LinkedHashMap<Integer, Vector<Integer>> groupsTests = null;
|
protected LinkedHashMap<Integer, Vector<Integer>> groupsTests = null;
|
||||||
protected LinkedHashMap<String, Test> testsByDescriptions = null;
|
protected LinkedHashMap<String, Test> testsByDescriptions = null;
|
||||||
protected Vector<String> testsNames_lower = 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;
|
||||||
//--
|
//--
|
||||||
|
protected Vector<SapforTask> new_tasks = null;
|
||||||
|
//--
|
||||||
@Override
|
@Override
|
||||||
public String getIconPath() {
|
public String getIconPath() {
|
||||||
return "/icons/AddTasks.png";
|
return "/icons/AddTasks.png";
|
||||||
@@ -79,10 +81,6 @@ public class AddTasksToSapforPackage extends Pass_2021<SapforPackage> {
|
|||||||
//--
|
//--
|
||||||
//--
|
//--
|
||||||
public boolean checkConfigurationCommands(SapforConfiguration sapforConfiguration) {
|
public boolean checkConfigurationCommands(SapforConfiguration sapforConfiguration) {
|
||||||
if (target.package_json.hasConfiguration(sapforConfiguration.id)){
|
|
||||||
Log.Writeln_("Конфигурация "+sapforConfiguration.id+" уже присутствует в пакете. Повторение конфигураций запрещено!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
//1. получить список всех команд.
|
//1. получить список всех команд.
|
||||||
Vector<PassCode_2021> codes = new Vector<>();
|
Vector<PassCode_2021> codes = new Vector<>();
|
||||||
//-- счетчик завершающих команд.
|
//-- счетчик завершающих команд.
|
||||||
@@ -180,7 +178,6 @@ public class AddTasksToSapforPackage extends Pass_2021<SapforPackage> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
setTasksCount = 0;
|
|
||||||
groupsTests = new LinkedHashMap<>();
|
groupsTests = new LinkedHashMap<>();
|
||||||
testsNames_lower = new Vector<>();
|
testsNames_lower = new Vector<>();
|
||||||
testsByDescriptions = new LinkedHashMap<>();
|
testsByDescriptions = new LinkedHashMap<>();
|
||||||
@@ -218,28 +215,14 @@ public class AddTasksToSapforPackage extends Pass_2021<SapforPackage> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
for (int i = 0; i < Global.testingServer.db.sapforConfigurations.getCheckedCount(); ++i) {
|
|
||||||
for (Vector<Integer> tests : groupsTests.values())
|
|
||||||
setTasksCount += tests.size();
|
|
||||||
}
|
|
||||||
return UI.Question("Будет добавлено " + setTasksCount + " задач. Продолжить");
|
|
||||||
}
|
|
||||||
//
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void body() throws Exception {
|
|
||||||
testing_set = new SapforTestingSet_json();
|
testing_set = new SapforTestingSet_json();
|
||||||
testing_set.id = target.package_json.getMaxSetId();
|
testing_set.id = target.package_json.getMaxSetId();
|
||||||
Vector<String> testsNames = new Vector<>();
|
|
||||||
for (Test test : testsByDescriptions.values()) {
|
for (Test test : testsByDescriptions.values()) {
|
||||||
SapforTest_json test_json = new SapforTest_json();
|
SapforTest_json test_json = new SapforTest_json();
|
||||||
test_json.id = test.id;
|
test_json.id = test.id;
|
||||||
test_json.description = test.description;
|
test_json.description = test.description;
|
||||||
test_json.group_description = Global.testingServer.db.groups.get(test.group_id).description;
|
test_json.group_description = Global.testingServer.db.groups.get(test.group_id).description;
|
||||||
testing_set.tests.add(test_json);
|
testing_set.tests.add(test_json);
|
||||||
//-
|
|
||||||
testsNames.add(test.description);
|
|
||||||
}
|
}
|
||||||
for (SapforConfiguration configuration : Global.testingServer.db.sapforConfigurations.getCheckedItems()) {
|
for (SapforConfiguration configuration : Global.testingServer.db.sapforConfigurations.getCheckedItems()) {
|
||||||
//--
|
//--
|
||||||
@@ -256,14 +239,44 @@ public class AddTasksToSapforPackage extends Pass_2021<SapforPackage> {
|
|||||||
testing_set.configurations.add(configuration_json);
|
testing_set.configurations.add(configuration_json);
|
||||||
//-->>
|
//-->>
|
||||||
}
|
}
|
||||||
|
Vector<SapforTask> possible_tasks = testing_set.createTasks();
|
||||||
|
Vector<String> keys = target.package_json.getTasksKeys();
|
||||||
|
new_tasks = new Vector<>();
|
||||||
|
for (SapforTask task : possible_tasks) {
|
||||||
|
String key = task.getUniqueKey();
|
||||||
|
if (!keys.contains(key)) {
|
||||||
|
keys.add(key);
|
||||||
|
new_tasks.add(task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (new_tasks.size()==0){
|
||||||
|
Log.Writeln_("Не сформировано ни одной новой задачи.\n" +
|
||||||
|
"Задачи уже присутствуют в пакете, или не отмечено ни одного теста.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return UI.Question("Будет добавлено " + new_tasks.size() + " задач. Продолжить");
|
||||||
|
}
|
||||||
|
//
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void body() throws Exception {
|
||||||
//-->>
|
//-->>
|
||||||
target.package_json.testingSets.add(testing_set);
|
target.package_json.testingSets.add(testing_set);
|
||||||
target.tasksCount += setTasksCount;
|
for (SapforTask task: new_tasks){
|
||||||
target.testsNames += String.join(";", testsNames) + ";";
|
task.id = target.package_json.getMaxTaskId();
|
||||||
|
target.package_json.tasks.add(task);
|
||||||
|
}
|
||||||
|
target.tasksCount += new_tasks.size();
|
||||||
|
target.testsNames = String.join(";", target.package_json.getTestsNames());
|
||||||
Global.testingServer.db.Update(target);
|
Global.testingServer.db.Update(target);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void showDone() throws Exception {
|
protected void showDone() throws Exception {
|
||||||
Global.testingServer.db.sapforPackages.ShowUI(target.id);
|
Global.testingServer.db.sapforPackages.ShowUI(target.id);
|
||||||
|
//----
|
||||||
|
Utils.CheckAndCleanDirectory(target.getLocalWorkspace());
|
||||||
|
target.saveJson();
|
||||||
|
//---
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
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;
|
||||||
@@ -36,12 +37,15 @@ public class CompareDVMRunTasks extends Pass_2021<Vector<DVMRunTask>> {
|
|||||||
} else if (target.size() == 1) {
|
} else if (target.size() == 1) {
|
||||||
master = target.get(0);
|
master = target.get(0);
|
||||||
slave = null;
|
slave = null;
|
||||||
return UI.Question("Отобразить задачу " + Utils.Brackets(target.get(0).getPK()));
|
return UI.Question("Отобразить задачу " + Utils.Brackets(master.getPK()));
|
||||||
} else if (target.size() != 2) {
|
} else if ((target.size() == 0) && (Current.HasDVMRunTask())) {
|
||||||
Log.Writeln_("Для сравнения требуется отметить две задачи.\nДля отображения требуется отметить одну задачу");
|
master = Current.getDVMRunTask();
|
||||||
|
slave = null;
|
||||||
|
return UI.Question("Отобразить задачу " + Utils.Brackets(master.getPK()));
|
||||||
|
} else {
|
||||||
|
Log.Writeln_("Для сравнения требуется отметить две задачи.\nДля отображения требуется отметить одну задачу,или выделить её.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
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;
|
||||||
@@ -36,12 +37,15 @@ public class CompareSapforPackages extends Pass_2021<Vector<SapforPackage>> {
|
|||||||
} else if (target.size() == 1) {
|
} else if (target.size() == 1) {
|
||||||
master = target.get(0);
|
master = target.get(0);
|
||||||
slave = null;
|
slave = null;
|
||||||
return UI.Question("Отобразить пакет " + Utils.Brackets(target.get(0).getPK()));
|
return UI.Question("Отобразить пакет " + Utils.Brackets(master.getPK()));
|
||||||
} else if (target.size() != 2) {
|
} else if ((target.size() == 0) && (Current.HasSapforPackage())) {
|
||||||
Log.Writeln_("Для сравнения требуется отметить два пакета.\nДля отображения требуется отметить один пакет");
|
master = Current.getSapforPackage();
|
||||||
|
slave = null;
|
||||||
|
return UI.Question("Отобразить пакет " + Utils.Brackets(master.getPK()));
|
||||||
|
} else {
|
||||||
|
Log.Writeln_("Для сравнения требуется отметить два пакета.\nДля отображения требуется отметить один пакет,или выделить его");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user