промежуточный. изменен механизм формирования задач для тестирования SAPFOR. Теперь они создаются на стадии черновика, при публикации только обновляются ссылки на родительский пакет. При добавлении задач в пакет идет проверка по ключам на их существование.
This commit is contained in:
@@ -25,9 +25,41 @@ public class SapforPackage_json implements Serializable {
|
||||
public int getMaxSetId() {
|
||||
return max_set_id++;
|
||||
}
|
||||
@Expose
|
||||
public int max_task_id = 0;
|
||||
public int getMaxTaskId() {
|
||||
return max_task_id++;
|
||||
}
|
||||
//--
|
||||
@Expose
|
||||
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) {
|
||||
for (SapforTestingSet_json set : testingSets) {
|
||||
for (SapforConfiguration_json configuration : set.configurations) {
|
||||
@@ -38,9 +70,6 @@ public class SapforPackage_json implements Serializable {
|
||||
return false;
|
||||
}
|
||||
//--
|
||||
@Expose
|
||||
public List<SapforTask> tasks = new Vector<>();
|
||||
//---
|
||||
public void sortTasks() {
|
||||
tasks.sort(new Comparator<SapforTask>() {
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package TestingSystem.SAPFOR.Json;
|
||||
import Common.Constants;
|
||||
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -12,4 +14,30 @@ public class SapforTestingSet_json implements Serializable {
|
||||
public List<SapforTest_json> tests = new Vector<>();
|
||||
@Expose
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user