no message
This commit is contained in:
79
src/Visual_DVM_2021/Passes/All/SaveCurrentDVMPackage.java
Normal file
79
src/Visual_DVM_2021/Passes/All/SaveCurrentDVMPackage.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class SaveCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
//--
|
||||
Vector<Configuration> configurations;
|
||||
Vector<Group> groups;
|
||||
Vector<Test> tests;
|
||||
//--
|
||||
Vector<String> configurationsNames;
|
||||
Vector<String> groupsNames;
|
||||
//--
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Save.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = null;
|
||||
configurations = new Vector<>();
|
||||
//---
|
||||
groups = new Vector<>();
|
||||
tests = new Vector<>();
|
||||
//---
|
||||
configurationsNames = new Vector<>();
|
||||
groupsNames = new Vector<>();
|
||||
//---
|
||||
if (!Current.Check(Log, Current.DVMPackage)) return false;
|
||||
//--
|
||||
target = Current.getDVMPackage();
|
||||
for (Configuration configuration : Global.testingServer.db.configurations.getCheckedItems()) {
|
||||
configurations.add(configuration);
|
||||
configurationsNames.add(configuration.description);
|
||||
}
|
||||
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
|
||||
groups.add(group);
|
||||
groupsNames.add(group.description);
|
||||
tests.addAll(Global.testingServer.db.tests.getSelectedGroupTests(group));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//проход не создает задачи. Проход просто фиксирует конфигурации группы и тесты.
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target.addConfigurations(configurations);
|
||||
target.addGroups(groups);
|
||||
target.addTests(tests);
|
||||
//--
|
||||
target.configurationsCount = configurations.size();
|
||||
target.groupsCount = groups.size();
|
||||
target.testsCount = tests.size();
|
||||
//--
|
||||
target.configurationsNames = String.join(";", configurationsNames);
|
||||
target.groupsNames = String.join(";", groupsNames);
|
||||
//--
|
||||
if (target.id != Constants.Nan)
|
||||
Global.testingServer.db.Update(target);
|
||||
//--
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
Global.testingServer.db.dvmPackages.ShowUI(target.id);
|
||||
Global.testingServer.db.dvmRunTasks.ShowDVMPackage(target);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user