v++
Оптимизация актуальности задач.
This commit is contained in:
60
src/Visual_DVM_2021/Passes/All/ActualizeDVMPackages.java
Normal file
60
src/Visual_DVM_2021/Passes/All/ActualizeDVMPackages.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.DVM.Tasks.TestRunTask;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackage;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageState;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
import javafx.util.Pair;
|
||||
|
||||
import java.util.Vector;
|
||||
public class ActualizeDVMPackages extends TestingSystemPass<Vector<Pair<Long, TasksPackageState>>> {
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = new Vector<>();
|
||||
for (TasksPackage tasksPackage : Global.testingServer.account_db.packages.Data.values()) {
|
||||
if (tasksPackage.state.isActive())
|
||||
target.add(new Pair<>(tasksPackage.id, tasksPackage.state));
|
||||
}
|
||||
return !target.isEmpty();
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.ActualizeDVMPackages, Current.getAccount().email, target));
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
int i = 0;
|
||||
Vector<Pair<TasksPackage, Vector<TestRunTask>>> res = (Vector<Pair<TasksPackage, Vector<TestRunTask>>>) response.object;
|
||||
Global.testingServer.account_db.BeginTransaction();
|
||||
for (Pair<TasksPackage, Vector<TestRunTask>> pair : res) {
|
||||
TasksPackage tasksPackage = pair.getKey();
|
||||
Global.testingServer.account_db.UpdateWithCheck(tasksPackage);
|
||||
if (tasksPackage.state.equals(TasksPackageState.Done)) {
|
||||
++i;
|
||||
for (TestRunTask task : pair.getValue()) {
|
||||
Global.testingServer.account_db.UpdateWithCheck(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
Global.testingServer.account_db.Commit();
|
||||
/*
|
||||
if (i == target.size()) {
|
||||
UI.testingBar.autorefreshButton.doClick();
|
||||
System.out.println("All packages are not active");
|
||||
}
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
Global.testingServer.account_db.packages.RefreshUI();
|
||||
Global.testingServer.account_db.testRunTasks.ShowUI();
|
||||
}
|
||||
}
|
||||
14
src/Visual_DVM_2021/Passes/All/ActualizePackages.java
Normal file
14
src/Visual_DVM_2021/Passes/All/ActualizePackages.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class ActualizePackages extends Pass_2021 {
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
passes.get(PassCode_2021.ActualizeDVMPackages).Do();
|
||||
passes.get(PassCode_2021.ActualizeSAPFORPackages).Do();
|
||||
}
|
||||
}
|
||||
55
src/Visual_DVM_2021/Passes/All/ActualizeSAPFORPackages.java
Normal file
55
src/Visual_DVM_2021/Passes/All/ActualizeSAPFORPackages.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.DVM.Tasks.TestRunTask;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackage;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageState;
|
||||
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
import javafx.util.Pair;
|
||||
|
||||
import java.util.Vector;
|
||||
public class ActualizeSAPFORPackages extends TestingSystemPass<Vector<Pair<Long, TasksPackageState>>> {
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = new Vector<>();
|
||||
for (SapforTasksPackage tasksPackage : Global.testingServer.account_db.sapforTasksPackages.Data.values()) {
|
||||
if (tasksPackage.state.isActive())
|
||||
target.add(new Pair<>(tasksPackage.id, tasksPackage.state));
|
||||
}
|
||||
return !target.isEmpty();
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.ActualizeSAPFORPackages, Current.getAccount().email, target));
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
int i = 0;
|
||||
Vector<Pair<SapforTasksPackage, Vector<SapforTask>>> res = (Vector<Pair<SapforTasksPackage, Vector<SapforTask>>>) response.object;
|
||||
Global.testingServer.account_db.BeginTransaction();
|
||||
for (Pair<SapforTasksPackage, Vector<SapforTask>> pair : res) {
|
||||
SapforTasksPackage tasksPackage = pair.getKey();
|
||||
Global.testingServer.account_db.UpdateWithCheck(tasksPackage);
|
||||
if (tasksPackage.state.equals(TasksPackageState.Done)) {
|
||||
++i;
|
||||
for (SapforTask task : pair.getValue()) {
|
||||
Global.testingServer.account_db.UpdateWithCheck(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
Global.testingServer.account_db.Commit();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
Global.testingServer.account_db.sapforTasksPackages.RefreshUI();
|
||||
Global.testingServer.account_db.sapforTasks.ShowUI();
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Common.TSetting.TSetting;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
public class PauseTesting extends TestingSystemPass<TSetting> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return Current.getAccount().CheckRegistered(Log);
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Pause.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
target = new TSetting(SettingName.Pause, true);
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.EditAccountObject, Current.getAccount().email, target));
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
passes.get(PassCode_2021.SynchronizeTestsTasks).Do();
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Common.TSetting.TSetting;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
public class PlayTesting extends TestingSystemPass<TSetting> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return Current.getAccount().CheckRegistered(Log);
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Start.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
target = new TSetting(SettingName.Pause, false);
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.EditAccountObject, Current.getAccount().email, target));
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
passes.get(PassCode_2021.SynchronizeTestsTasks).Do();
|
||||
}
|
||||
}
|
||||
@@ -246,8 +246,6 @@ public enum PassCode_2021 {
|
||||
AddDVMParameterForTesting,
|
||||
//-
|
||||
RefreshDVMTests,
|
||||
PauseTesting,
|
||||
PlayTesting,
|
||||
//-
|
||||
SPF_GetMaxMinBlockDistribution,
|
||||
//-
|
||||
@@ -307,11 +305,21 @@ public enum PassCode_2021 {
|
||||
DeleteSubscriberWorkspace,
|
||||
ExportTasksPackageToExcel,
|
||||
//->
|
||||
ActualizeDVMPackages,
|
||||
ActualizeSAPFORPackages,
|
||||
ActualizePackages,
|
||||
//->
|
||||
TestPass;
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case Undefined:
|
||||
return "?";
|
||||
case ActualizePackages:
|
||||
return "Обновить пакеты задач";
|
||||
case ActualizeDVMPackages:
|
||||
return "Обновить пакеты тестирования DVM";
|
||||
case ActualizeSAPFORPackages:
|
||||
return "Обновить пакеты тестирования SAPFOR";
|
||||
case ExportTasksPackageToExcel:
|
||||
return "Экспорт пакета задач в Excel";
|
||||
case DeleteSubscriberWorkspace:
|
||||
@@ -464,10 +472,6 @@ public enum PassCode_2021 {
|
||||
return "Просмотр/Редактирование конфигурацию тестирования";
|
||||
case SPF_GetMaxMinBlockDistribution:
|
||||
return "Определить размерность теста по DVM директивам";
|
||||
case PauseTesting:
|
||||
return "Поставить тестирование на паузу";
|
||||
case PlayTesting:
|
||||
return "Возобновить тестирование";
|
||||
case RefreshDVMTests:
|
||||
return "Обновить DVM тесты";
|
||||
case AddDVMParameterForTesting:
|
||||
|
||||
@@ -3,6 +3,7 @@ import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.TextField.StyledTextField;
|
||||
import Common.UI.UI;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.UI.Interface.FormWithSplitters;
|
||||
import Visual_DVM_2021.UI.Interface.TestingWindow;
|
||||
|
||||
@@ -104,6 +105,8 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
Global.testingServer.db.sapforConfigurations.ShowUI();
|
||||
Global.testingServer.account_db.sapforTasksPackages.ShowUI();
|
||||
//---
|
||||
if (Global.properties.AutoCheckTesting)
|
||||
TestingServer.TimerOn();
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user