no message
This commit is contained in:
12
.idea/workspace.xml
generated
12
.idea/workspace.xml
generated
@@ -8,16 +8,10 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/GlobalData/GlobalDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/GlobalDatabase.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TaskKey/TaskKey_2022.java" beforeDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TaskKey/TaskKeysDBTable.java" beforeDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TasksDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TasksDatabase.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TasksDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TasksDatabase.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ActualizePackages.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ActualizePackages.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestingPlanner.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartTests.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestsDatabase.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SynchronizeTestsTasks.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SynchronizeTestsTasks.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Interface/TestingWindow.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Interface/TestingWindow.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/TestingForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/TestingForm.java" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -156,4 +156,34 @@ public class TasksDatabase extends SQLiteDatabase {
|
|||||||
res.add(p);
|
res.add(p);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
public SapforTasksPackage getFirstActiveSapforScenario() {
|
||||||
|
SapforTasksPackage first_active = null;
|
||||||
|
SapforTasksPackage first_queued = null;
|
||||||
|
if (!sapforTasksPackages.Data.isEmpty()) {
|
||||||
|
for (SapforTasksPackage p : sapforTasksPackages.Data.values()) {
|
||||||
|
switch (p.state) {
|
||||||
|
case Done:
|
||||||
|
case Aborted:
|
||||||
|
break;
|
||||||
|
case Queued:
|
||||||
|
if (first_queued == null) first_queued = p;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (first_active == null) first_active = p; //это и будет первый активный.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (first_active != null) return first_active;
|
||||||
|
if (first_queued != null) {
|
||||||
|
first_queued.state = TasksPackageState.TestsSynchronize;
|
||||||
|
try {
|
||||||
|
Update(first_queued);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return first_queued;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import GlobalData.User.User;
|
|||||||
import Repository.EmailMessage;
|
import Repository.EmailMessage;
|
||||||
import Repository.Server.ServerCode;
|
import Repository.Server.ServerCode;
|
||||||
import Repository.Server.ServerExchangeUnit_2021;
|
import Repository.Server.ServerExchangeUnit_2021;
|
||||||
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||||
import TestingSystem.MachineMaxKernels.MachineMaxKernels;
|
import TestingSystem.MachineMaxKernels.MachineMaxKernels;
|
||||||
import TestingSystem.Tasks.TestCompilationTask;
|
import TestingSystem.Tasks.TestCompilationTask;
|
||||||
import TestingSystem.Tasks.TestTask;
|
import TestingSystem.Tasks.TestTask;
|
||||||
@@ -36,6 +37,8 @@ public class TestingPlanner {
|
|||||||
public LinkedHashMap<Long, TestCompilationTask> packageTasks = new LinkedHashMap<>();
|
public LinkedHashMap<Long, TestCompilationTask> packageTasks = new LinkedHashMap<>();
|
||||||
public MachineMaxKernels maxKernels = null;
|
public MachineMaxKernels maxKernels = null;
|
||||||
//----------
|
//----------
|
||||||
|
SapforTasksPackage sapforTasksPackage = null;
|
||||||
|
//----------
|
||||||
public void UpdateTask(TestTask task_in) throws Exception {
|
public void UpdateTask(TestTask task_in) throws Exception {
|
||||||
task_in.ChangeDate = new Date().getTime();
|
task_in.ChangeDate = new Date().getTime();
|
||||||
ServerCommand(ServerCode.EditAccountObject, task_in);
|
ServerCommand(ServerCode.EditAccountObject, task_in);
|
||||||
@@ -145,12 +148,15 @@ public class TestingPlanner {
|
|||||||
void emailPass(String email_in) {
|
void emailPass(String email_in) {
|
||||||
email = email_in;
|
email = email_in;
|
||||||
try {
|
try {
|
||||||
|
System.out.println(email+" testing planner starts...");
|
||||||
Pair<TasksPackage, LinkedHashMap<Long, TestCompilationTask>> p = (Pair<TasksPackage, LinkedHashMap<Long, TestCompilationTask>>) ServerCommand(ServerCode.GetFirstActiveAccountPackage);
|
Pair<TasksPackage, LinkedHashMap<Long, TestCompilationTask>> p = (Pair<TasksPackage, LinkedHashMap<Long, TestCompilationTask>>) ServerCommand(ServerCode.GetFirstActiveAccountPackage);
|
||||||
|
sapforTasksPackage = (SapforTasksPackage) ServerCommand(ServerCode.GetFirstActiveSapforTasksPackage);
|
||||||
tasksPackage = null;
|
tasksPackage = null;
|
||||||
packageTasks = null;
|
packageTasks = null;
|
||||||
tasksPackage = p.getKey();
|
tasksPackage = p.getKey();
|
||||||
packageTasks = p.getValue();
|
packageTasks = p.getValue();
|
||||||
if (tasksPackage != null) {
|
if (tasksPackage != null) {
|
||||||
|
System.out.println("found dvm package: "+sapforTasksPackage.id);
|
||||||
String machine_url = tasksPackage.machine_address + ":" + tasksPackage.machine_port;
|
String machine_url = tasksPackage.machine_address + ":" + tasksPackage.machine_port;
|
||||||
if (!machines.containsKey(machine_url))
|
if (!machines.containsKey(machine_url))
|
||||||
machines.put(machine_url, new Machine(
|
machines.put(machine_url, new Machine(
|
||||||
@@ -179,6 +185,9 @@ public class TestingPlanner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else
|
||||||
|
if (sapforTasksPackage!=null){
|
||||||
|
System.out.println("found sapfor package: "+sapforTasksPackage.id);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Global.Log.PrintException(ex);
|
Global.Log.PrintException(ex);
|
||||||
|
|||||||
@@ -501,6 +501,13 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
LinkedHashMap<Long, TestCompilationTask> activeTasks = account_db.getPackageCompilationTasks(tasksPackage);
|
LinkedHashMap<Long, TestCompilationTask> activeTasks = account_db.getPackageCompilationTasks(tasksPackage);
|
||||||
response.object = new Pair<>(tasksPackage, activeTasks);
|
response.object = new Pair<>(tasksPackage, activeTasks);
|
||||||
break;
|
break;
|
||||||
|
case GetFirstActiveSapforTasksPackage:
|
||||||
|
Print("Получить первый активный сценарий задач SAPFOR" + request.arg);
|
||||||
|
SetCurrentAccountDB(request.arg);
|
||||||
|
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||||
|
response.object = account_db.getFirstActiveSapforScenario();
|
||||||
|
break;
|
||||||
|
|
||||||
case GetQueueSize:
|
case GetQueueSize:
|
||||||
Print("Получить размер глобальной очереди задач");
|
Print("Получить размер глобальной очереди задач");
|
||||||
long date = (long) request.object;
|
long date = (long) request.object;
|
||||||
@@ -538,12 +545,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||||
response.object = Utils.packFile(account_db.getFile());
|
response.object = Utils.packFile(account_db.getFile());
|
||||||
break;
|
break;
|
||||||
//-- Тестирование SAPFOR
|
|
||||||
case GetFirstActiveSapforTasksPackage:
|
|
||||||
Print("Получить первый активный сценарий задач SAPFOR");
|
|
||||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
|
||||||
response.object = db.getFirstActiveSapforScenario();
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
|
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import Common.Database.SQLITE.SQLiteDatabase;
|
|||||||
import GlobalData.Settings.SettingName;
|
import GlobalData.Settings.SettingName;
|
||||||
import SapforTestingSystem.SapforConfiguration.SapforConfigurationDBTable;
|
import SapforTestingSystem.SapforConfiguration.SapforConfigurationDBTable;
|
||||||
import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
|
import SapforTestingSystem.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
|
||||||
import SapforTestingSystem.ServerSapfor.ServerSapforsDBTable;
|
import SapforTestingSystem.ServerSapfor.ServerSapforsDBTable;
|
||||||
import TestingSystem.Configuration.UI.ConfigurationDBTable;
|
import TestingSystem.Configuration.UI.ConfigurationDBTable;
|
||||||
import TestingSystem.Group.GroupsDBTable;
|
import TestingSystem.Group.GroupsDBTable;
|
||||||
@@ -24,10 +23,6 @@ public class TestsDatabase extends SQLiteDatabase {
|
|||||||
public SapforConfigurationCommandsDBTable sapforConfigurationCommands;
|
public SapforConfigurationCommandsDBTable sapforConfigurationCommands;
|
||||||
//----
|
//----
|
||||||
public ServerSapforsDBTable serverSapfors;
|
public ServerSapforsDBTable serverSapfors;
|
||||||
//--
|
|
||||||
// public SapforTasksPackagesDBTable sapforTasksPackages;
|
|
||||||
// public SapforTasksPackagesDBTable sapforTasksPackages;
|
|
||||||
//--
|
|
||||||
public TestsDatabase() {
|
public TestsDatabase() {
|
||||||
super(Paths.get(System.getProperty("user.dir"), "Data", TasksDatabase.tests_db_name + ".sqlite").toFile());
|
super(Paths.get(System.getProperty("user.dir"), "Data", TasksDatabase.tests_db_name + ".sqlite").toFile());
|
||||||
}
|
}
|
||||||
@@ -42,8 +37,6 @@ public class TestsDatabase extends SQLiteDatabase {
|
|||||||
addTable(sapforConfigurations = new SapforConfigurationDBTable());
|
addTable(sapforConfigurations = new SapforConfigurationDBTable());
|
||||||
addTable(sapforConfigurationCommands = new SapforConfigurationCommandsDBTable());
|
addTable(sapforConfigurationCommands = new SapforConfigurationCommandsDBTable());
|
||||||
addTable(serverSapfors = new ServerSapforsDBTable());
|
addTable(serverSapfors = new ServerSapforsDBTable());
|
||||||
// addTable(sapforTasksPackages = new SapforTasksPackagesDBTable());
|
|
||||||
// addTable(sapforTasksPackages = new SapforTasksPackagesDBTable());
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void Init() throws Exception {
|
public void Init() throws Exception {
|
||||||
@@ -66,36 +59,4 @@ public class TestsDatabase extends SQLiteDatabase {
|
|||||||
Update(setting);
|
Update(setting);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
public SapforTasksPackage getFirstActiveSapforScenario() {
|
|
||||||
/*
|
|
||||||
SapforTasksPackage first_active = null;
|
|
||||||
SapforTasksPackage first_queued = null;
|
|
||||||
if (!sapforTasksPackages.Data.isEmpty()) {
|
|
||||||
for (SapforTasksPackage s : sapforTasksPackages.Data.values()) {
|
|
||||||
switch (s.state) {
|
|
||||||
case Done:
|
|
||||||
case Aborted:
|
|
||||||
break;
|
|
||||||
case Queued:
|
|
||||||
if (first_queued == null) first_queued = s;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (first_active == null) first_active = s; //это и будет первый активный.
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (first_active != null) return first_active;
|
|
||||||
if (first_queued != null) {
|
|
||||||
first_queued.state = TasksPackageState.PackageStart;
|
|
||||||
try {
|
|
||||||
Update(first_queued);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return first_queued;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user