Промежуточный. Убрал рудимент связанный с хранением ключей задач. Настроил синхронизацию сапфоровских пакетов.
This commit is contained in:
@@ -3,6 +3,7 @@ import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||
import TestingSystem.TasksPackage.TasksPackage;
|
||||
import TestingSystem.TasksPackage.TasksPackageState;
|
||||
import TestingSystem.TestingServer;
|
||||
@@ -11,20 +12,31 @@ import Visual_DVM_2021.Passes.TestingSystemPass;
|
||||
import javafx.util.Pair;
|
||||
|
||||
import java.util.Vector;
|
||||
public class ActualizePackages extends TestingSystemPass<Vector<TasksPackage>> {
|
||||
public class ActualizePackages extends TestingSystemPass<Object> {
|
||||
boolean needsSynchronize;
|
||||
Vector<TasksPackage> dvmPackages;
|
||||
Vector<SapforTasksPackage> spfPackages;
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Vector<TasksPackage> actual_packages = new Vector<>();
|
||||
for (TasksPackage p : target) {
|
||||
for (TasksPackage p : dvmPackages) {
|
||||
TasksPackageState oldState = p.state;
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.GetAccountObjectCopyByPK, Current.getAccount().email, new Pair<>(TasksPackage.class, p.id)));
|
||||
TasksPackage actual_package = (TasksPackage) response.object;
|
||||
actual_packages.add(actual_package);
|
||||
//-
|
||||
p.SynchronizeFields(actual_package);
|
||||
if (!oldState.equals(p.state) && p.state.equals(TasksPackageState.Done))
|
||||
needsSynchronize=true; //состояние изменилось, и на Done значит нужно скачивать задачи.
|
||||
needsSynchronize = true; //состояние изменилось, и на Done значит нужно скачивать задачи.
|
||||
server.account_db.Update(p);
|
||||
}
|
||||
//---
|
||||
for (SapforTasksPackage p : spfPackages) {
|
||||
TasksPackageState oldState = p.state;
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.GetAccountObjectCopyByPK, Current.getAccount().email, new Pair<>(SapforTasksPackage.class, p.id)));
|
||||
SapforTasksPackage actual_package = (SapforTasksPackage) response.object;
|
||||
//-
|
||||
p.SynchronizeFields(actual_package);
|
||||
if (!oldState.equals(p.state) && p.state.equals(TasksPackageState.Done))
|
||||
needsSynchronize = true; //состояние изменилось, и на Done значит нужно скачивать задачи.
|
||||
server.account_db.Update(p);
|
||||
}
|
||||
}
|
||||
@@ -34,9 +46,10 @@ public class ActualizePackages extends TestingSystemPass<Vector<TasksPackage>> {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
needsSynchronize=false;
|
||||
target = server.account_db.getActivePackages();
|
||||
return !target.isEmpty();
|
||||
needsSynchronize = false;
|
||||
dvmPackages = server.account_db.getActivePackages();
|
||||
spfPackages = server.account_db.getActiveSapforPackages();
|
||||
return !dvmPackages.isEmpty() || !spfPackages.isEmpty();
|
||||
}
|
||||
@Override
|
||||
protected void performCanNotStart() throws Exception {
|
||||
@@ -53,18 +66,20 @@ public class ActualizePackages extends TestingSystemPass<Vector<TasksPackage>> {
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
server.account_db.packages.ClearUI();
|
||||
server.account_db.sapforTasksPackages.ClearUI();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
server.account_db.packages.ShowUI();
|
||||
server.account_db.sapforTasksPackages.ShowUI();
|
||||
//--->>
|
||||
if (!TestingServer.checkTasks) UI.getMainWindow().getTestingWindow().ShowAutoActualizeTestsState();
|
||||
server.account_db.RestoreLastSelections();
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
if (needsSynchronize) {
|
||||
if (needsSynchronize)
|
||||
passes.get(PassCode_2021.SynchronizeTestsTasks).Do();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommand
|
||||
import SapforTestingSystem.SapforTasksPackage_info;
|
||||
import TestingSystem.Group.Group;
|
||||
import TestingSystem.Test.Test;
|
||||
import TestingSystem.TestingServer;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.TestingSystemPass;
|
||||
|
||||
@@ -188,14 +189,7 @@ public class StartSapforTests extends TestingSystemPass<SapforTasksPackage_info>
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
passes.get(PassCode_2021.SynchronizeTestsTasks).Do();
|
||||
/*
|
||||
if (!TestingServer.checkTasks)
|
||||
TestingServer.TimerOn();
|
||||
Global.db.BeginTransaction();
|
||||
for (TestRunTask testRunTask : server.account_db.testRunTasks.Data.values())
|
||||
if (testRunTask.taskspackage_id.equals(target.id))
|
||||
Global.db.Insert(new TaskKey_2022(testRunTask.id, target.id));
|
||||
Global.db.Commit();
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import GlobalData.Compiler.CompilerType;
|
||||
import GlobalData.Machine.MachineType;
|
||||
@@ -8,9 +7,9 @@ import GlobalData.User.UserState;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Configuration.ConfigurationInterface;
|
||||
import TestingSystem.Configuration.UI.ConfigurationDBTable;
|
||||
import TestingSystem.Group.Group;
|
||||
import TestingSystem.Group.GroupInterface;
|
||||
import TestingSystem.TaskKey.TaskKey_2022;
|
||||
import TestingSystem.Tasks.TestCompilationTask;
|
||||
import TestingSystem.Tasks.TestRunTask;
|
||||
import TestingSystem.TasksPackage.TasksPackage;
|
||||
@@ -199,10 +198,10 @@ public class StartTests extends TestingSystemPass<TasksPackage> {
|
||||
summary_lines.addAll(configurations_lines);
|
||||
summary_lines.addAll(groups_lines);
|
||||
target.summary =
|
||||
"Задач на компиляцию: " + target.compilationTasksCount + "\n" +
|
||||
"Задач на компиляцию: " + target.compilationTasksCount + "\n" +
|
||||
"Задач на запуск: " + target.runTasksCount + "\n" +
|
||||
String.join("\n", summary_lines);
|
||||
target.needsEmail = UI.getMainWindow().getTestingWindow().isEmailTestingOn()?1:0;
|
||||
target.needsEmail = ConfigurationDBTable.email ? 1 : 0;
|
||||
return !tasks.isEmpty();
|
||||
}
|
||||
@Override
|
||||
@@ -220,11 +219,6 @@ public class StartTests extends TestingSystemPass<TasksPackage> {
|
||||
passes.get(PassCode_2021.SynchronizeTestsTasks).Do();
|
||||
if (!TestingServer.checkTasks)
|
||||
TestingServer.TimerOn();
|
||||
Global.db.BeginTransaction();
|
||||
for (TestRunTask testRunTask : server.account_db.testRunTasks.Data.values())
|
||||
if (testRunTask.taskspackage_id.equals(target.id))
|
||||
Global.db.Insert(new TaskKey_2022(testRunTask.id, target.id));
|
||||
Global.db.Commit();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
|
||||
@@ -53,10 +53,6 @@ public class SynchronizeTestsTasks extends TestingSystemPass<Vector<Integer>> {
|
||||
UI.getMainWindow().getTestingWindow().RemountTestTable();
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
server.account_db.CheckKeysActuality();
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return (response.object != null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user