2024-09-19 17:37:34 +03:00
|
|
|
|
package Visual_DVM_2021.Passes.All;
|
2024-10-07 00:58:29 +03:00
|
|
|
|
import Common_old.Current;
|
|
|
|
|
|
import _VisualDVM.Global;
|
|
|
|
|
|
import Common_old.UI.UI;
|
2024-09-19 17:37:34 +03:00
|
|
|
|
import TestingSystem.Common.TestingServer;
|
|
|
|
|
|
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
|
|
|
|
|
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
|
|
|
|
|
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
|
|
|
|
|
|
import Visual_DVM_2021.Passes.Server.PublishServerObject;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
|
public class StartSelectedSAPFORConfigurations extends PublishServerObject<TestingServer, SapforPackage> {
|
|
|
|
|
|
Vector<SapforConfiguration> configurations;
|
|
|
|
|
|
protected File sapfor = null;
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getIconPath() {
|
|
|
|
|
|
return "/icons/Start.png";
|
|
|
|
|
|
}
|
|
|
|
|
|
//--
|
|
|
|
|
|
public StartSelectedSAPFORConfigurations() {
|
|
|
|
|
|
super(Global.testingServer, SapforPackage.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
|
|
|
|
|
//--
|
|
|
|
|
|
if (!Current.getAccount().CheckRegistered(Log)) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!Current.Check(Log, Current.ServerSapfor)) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!Current.getServerSapfor().state.equals(ServerSapforState.Done)) {
|
|
|
|
|
|
Log.Writeln_("Выбранная версия SAPFOR не собрана!");
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
//--
|
|
|
|
|
|
configurations = Global.testingServer.db.sapforConfigurations.getCheckedOrCurrent();
|
|
|
|
|
|
if (configurations.isEmpty()) {
|
|
|
|
|
|
Log.Writeln_("Не отмечено ни одной конфигурации, или отсутствует текущая конфигурация.");
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2024-09-24 20:22:41 +03:00
|
|
|
|
target = new SapforPackage(Current.getAccount(),
|
|
|
|
|
|
Current.getServerSapfor(),
|
|
|
|
|
|
configurations,
|
|
|
|
|
|
Global.properties.EmailOnTestingProgress ? 1 : 0,
|
|
|
|
|
|
Log);
|
|
|
|
|
|
if (target.tasksCount == 0) {
|
2024-09-24 00:24:28 +03:00
|
|
|
|
Log.Writeln_("Не сформировано ни одной новой задачи.");
|
2024-09-19 17:37:34 +03:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2024-09-24 00:24:28 +03:00
|
|
|
|
return (UI.Question("Будет запущено " + target.tasksCount + " задач. Продолжить"));
|
2024-09-19 17:37:34 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|