2024-09-15 01:36:19 +03:00
|
|
|
|
package Visual_DVM_2021.Passes.All;
|
|
|
|
|
|
import Common.Current;
|
|
|
|
|
|
import Common.Global;
|
|
|
|
|
|
import TestingSystem.Common.Group.Group;
|
|
|
|
|
|
import TestingSystem.Common.Test.Test;
|
|
|
|
|
|
import TestingSystem.Common.TestingServer;
|
2024-09-16 15:41:43 +03:00
|
|
|
|
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
2024-09-15 01:36:19 +03:00
|
|
|
|
import Visual_DVM_2021.Passes.Server.EditServerObject;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
|
public class SaveCurrentDVMConfiguration extends EditServerObject<TestingServer, DVMConfiguration> {
|
|
|
|
|
|
Vector<Group> groups;
|
|
|
|
|
|
Vector<Test> tests;
|
|
|
|
|
|
//--
|
|
|
|
|
|
Vector<String> groupsNames;
|
|
|
|
|
|
//--
|
|
|
|
|
|
public SaveCurrentDVMConfiguration() {
|
|
|
|
|
|
super(Global.testingServer, DVMConfiguration.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getIconPath() {
|
|
|
|
|
|
return "/icons/Save.png";
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getButtonText() {
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
|
|
|
|
|
if (!Current.Check(Log, Current.DVMConfiguration)) return false;
|
|
|
|
|
|
target = Current.getDVMConfiguration();
|
|
|
|
|
|
//--
|
|
|
|
|
|
groups = new Vector<>();
|
|
|
|
|
|
tests = new Vector<>();
|
|
|
|
|
|
//---
|
|
|
|
|
|
groupsNames = new Vector<>();
|
|
|
|
|
|
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
|
|
|
|
|
|
groups.add(group);
|
|
|
|
|
|
groupsNames.add(group.description);
|
|
|
|
|
|
Vector<Test> groupTests = Global.testingServer.db.tests.getSelectedGroupTests(group);
|
|
|
|
|
|
tests.addAll(groupTests);
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected void ServerAction() throws Exception {
|
|
|
|
|
|
//занесение информации об участвующих группах конфигурациях и тестах
|
2024-09-17 02:53:17 +03:00
|
|
|
|
target.saveGroupsAsJson(groups);
|
|
|
|
|
|
target.saveTestsAsJson(tests);
|
2024-09-15 01:36:19 +03:00
|
|
|
|
//--
|
|
|
|
|
|
super.ServerAction();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|