no message
This commit is contained in:
@@ -6,14 +6,15 @@ import Common.Global;
|
||||
import GlobalData.Compiler.CompilerType;
|
||||
import GlobalData.Machine.MachineType;
|
||||
import GlobalData.User.UserState;
|
||||
import TestingSystem.Common.TasksPackageState;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage_json;
|
||||
import TestingSystem.Common.TasksPackageState;
|
||||
import Visual_DVM_2021.Passes.AddObjectPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class AddDVMPackage extends AddObjectPass<DVMPackage> {
|
||||
import Visual_DVM_2021.Passes.Server.PublishServerObject;
|
||||
public class AddDVMPackage extends PublishServerObject<TestingServer, DVMPackage> {
|
||||
public AddDVMPackage() {
|
||||
super(DVMPackage.class);
|
||||
super(Global.testingServer, DVMPackage.class);
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
@@ -44,17 +45,19 @@ public class AddDVMPackage extends AddObjectPass<DVMPackage> {
|
||||
if (!Current.getCompiler().versionLoaded)
|
||||
passes.get(PassCode_2021.ShowCompilerVersion).Do(Current.getCompiler(), false);
|
||||
//-
|
||||
/*
|
||||
for (DVMPackage dvmPackage: Global.testingServer.db.dvmPackages.Data.values()){
|
||||
if (dvmPackage.state.equals(TasksPackageState.Draft)){
|
||||
Log.Writeln_("Может существовать только один пакет, готовящийся к публикации.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
//--
|
||||
target = new DVMPackage();
|
||||
target.id = Constants.Nan;
|
||||
//-
|
||||
target.sender_name=Current.getAccount().name;
|
||||
target.sender_name = Current.getAccount().name;
|
||||
target.sender_address = Current.getAccount().email;
|
||||
//-
|
||||
target.machine_name = Current.getMachine().name;
|
||||
@@ -70,16 +73,17 @@ public class AddDVMPackage extends AddObjectPass<DVMPackage> {
|
||||
target.needsEmail = Global.properties.EmailOnTestingProgress ? 1 : 0;
|
||||
//--
|
||||
target.package_json = new DVMPackage_json();
|
||||
target.state= TasksPackageState.Inactive;
|
||||
target.state = TasksPackageState.Inactive;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
//черновик не вставляется в бд. идет только как элемент списка.
|
||||
Global.testingServer.db.dvmPackages.Data.put(target.id, target);
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
super.showDone();
|
||||
|
||||
@@ -3,10 +3,11 @@ import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.Configuration;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.TasksPackageState;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import TestingSystem.DVM.Configuration.DVMConfiguration;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage_json;
|
||||
import TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||
@@ -48,12 +49,12 @@ public class AddTasksToDVMPackage extends Pass_2021<DVMPackage> {
|
||||
}
|
||||
//--
|
||||
public Vector<DVMCompilationTask> createTasksCGT(
|
||||
Configuration configuration,
|
||||
DVMConfiguration configuration,
|
||||
Group group,
|
||||
Test test
|
||||
) {
|
||||
Vector<DVMCompilationTask> compilationTasks = new Vector<>();
|
||||
for (String flags : configuration.getFlags()) {
|
||||
for (String flags : configuration.getFlagsArray()) {
|
||||
String checked_flags = checkFlags(flags);
|
||||
DVMCompilationTask dvmCompilationTask = new DVMCompilationTask(
|
||||
configuration,
|
||||
@@ -111,13 +112,13 @@ public class AddTasksToDVMPackage extends Pass_2021<DVMPackage> {
|
||||
tasks_count = 0;
|
||||
//-----------
|
||||
//1, Проверяем выбраны ли конфиги.
|
||||
if (Global.testingServer.db.configurations.getCheckedCount() == 0) {
|
||||
if (Global.testingServer.db.dvm_configurations.getCheckedCount() == 0) {
|
||||
Log.Writeln_("Не отмечена ни одна конфигурация тестирования.");
|
||||
return false;
|
||||
}
|
||||
if (Global.testingServer.db.groups.getCheckedCount() > 0) {
|
||||
//2 Проверяем выбраны ли группы.
|
||||
for (TestingSystem.DVM.Configuration.Configuration configuration : Global.testingServer.db.configurations.getCheckedItems()) {
|
||||
for (DVMConfiguration configuration : Global.testingServer.db.dvm_configurations.getCheckedItems()) {
|
||||
configurations.add(configuration);
|
||||
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
|
||||
Vector<Test> groupTests = new Vector<>();
|
||||
@@ -175,9 +176,9 @@ public class AddTasksToDVMPackage extends Pass_2021<DVMPackage> {
|
||||
}
|
||||
json.compilationTasks.addAll(tasks);
|
||||
//--
|
||||
target.addConfigurations(configurations);
|
||||
target.addGroups(groups);
|
||||
target.addTests(tests);
|
||||
target.saveConfigurations(configurations);
|
||||
target.saveGroups(groups);
|
||||
target.saveTests(tests);
|
||||
//--
|
||||
target.tasksCount += tasks_count;
|
||||
target.state= TasksPackageState.Inactive;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import TestingSystem.DVM.Configuration.DVMConfiguration;
|
||||
import Visual_DVM_2021.Passes.DeleteServerObjects;
|
||||
public class DeleteConfiguration extends DeleteServerObjects<TestingServer, Configuration> {
|
||||
public class DeleteConfiguration extends DeleteServerObjects<TestingServer, DVMConfiguration> {
|
||||
public DeleteConfiguration() {
|
||||
super(Global.testingServer, Configuration.class);
|
||||
super(Global.testingServer, DVMConfiguration.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import TestingSystem.DVM.Configuration.DVMConfiguration;
|
||||
import Visual_DVM_2021.Passes.Server.EditServerObject;
|
||||
public class EditConfiguration extends EditServerObject<TestingServer, Configuration> {
|
||||
public class EditConfiguration extends EditServerObject<TestingServer, DVMConfiguration> {
|
||||
public EditConfiguration() {
|
||||
super(Global.testingServer, Configuration.class);
|
||||
super(Global.testingServer, DVMConfiguration.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import TestingSystem.DVM.Configuration.DVMConfiguration;
|
||||
import Visual_DVM_2021.Passes.Server.PublishServerObject;
|
||||
public class PublishConfiguration extends PublishServerObject<TestingServer, Configuration> {
|
||||
public class PublishConfiguration extends PublishServerObject<TestingServer, DVMConfiguration> {
|
||||
public PublishConfiguration() {
|
||||
super(Global.testingServer, Configuration.class);
|
||||
super(Global.testingServer, DVMConfiguration.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.Configuration;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.DVM.Configuration.DVMConfiguration;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage_json;
|
||||
import TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||
import TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import Visual_DVM_2021.Passes.Server.EditServerObject;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class SaveCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
public class SaveCurrentDVMPackage extends EditServerObject<TestingServer, DVMPackage> {
|
||||
//--
|
||||
Vector<Configuration> configurations;
|
||||
Vector<DVMConfiguration> configurations;
|
||||
Vector<Group> groups;
|
||||
Vector<Test> tests;
|
||||
//--
|
||||
@@ -27,6 +27,9 @@ public class SaveCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
LinkedHashMap<Integer, Vector<Test>> testsByGroups;
|
||||
int tasks_count;
|
||||
Vector<DVMCompilationTask> tasks;
|
||||
public SaveCurrentDVMPackage() {
|
||||
super(Global.testingServer,DVMPackage.class);
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
@@ -55,12 +58,12 @@ public class SaveCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
}
|
||||
//--
|
||||
public Vector<DVMCompilationTask> createTasksCGT(
|
||||
Configuration configuration,
|
||||
DVMConfiguration configuration,
|
||||
Group group,
|
||||
Test test
|
||||
) {
|
||||
Vector<DVMCompilationTask> compilationTasks = new Vector<>();
|
||||
for (String flags : configuration.getFlags()) {
|
||||
for (String flags : configuration.getFlagsArray()) {
|
||||
String checked_flags = checkFlags(flags);
|
||||
DVMCompilationTask dvmCompilationTask = new DVMCompilationTask(
|
||||
configuration,
|
||||
@@ -124,7 +127,7 @@ public class SaveCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
Log.Writeln_("Возможно редактировать только неактивный пакет!");
|
||||
return false;
|
||||
}
|
||||
for (Configuration configuration : Global.testingServer.db.configurations.getCheckedItems()) {
|
||||
for (DVMConfiguration configuration : Global.testingServer.db.dvm_configurations.getCheckedItems()) {
|
||||
configurations.add(configuration);
|
||||
configurationsNames.add(configuration.description);
|
||||
}
|
||||
@@ -137,55 +140,34 @@ public class SaveCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
}
|
||||
//---
|
||||
//создание задач
|
||||
for (Configuration configuration : configurations) {
|
||||
configurations.add(configuration);
|
||||
for (DVMConfiguration configuration : configurations) {
|
||||
for (Group group : groups) {
|
||||
Vector<Test> groupTests = testsByGroups.get(group.id);
|
||||
for (Test test: groupTests){
|
||||
for (Test test: groupTests)
|
||||
tasks.addAll(createTasksCGT(configuration, group, test));
|
||||
}
|
||||
}
|
||||
}
|
||||
//---
|
||||
/*
|
||||
if (tasks.isEmpty()) {
|
||||
Log.Writeln_("Не удалось добавить задачи.\n" +
|
||||
"Для создания задач отметьте требуемые конфигурации,\n" +
|
||||
"Отметьте группы, или отдельные тесты в отмеченной текущей группе");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
//---
|
||||
return UI.Question("Будет создано " + tasks_count + " задач. Продолжить");
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
protected void ServerAction() throws Exception {
|
||||
//занесение информации об участвующих группах конфигурациях и тестах
|
||||
target.addConfigurations(configurations);
|
||||
target.addGroups(groups);
|
||||
target.addTests(tests);
|
||||
target.saveConfigurations(configurations);
|
||||
target.saveGroups(groups);
|
||||
target.saveTests(tests);
|
||||
//--
|
||||
target.configurationsCount = configurations.size();
|
||||
target.groupsCount = groups.size();
|
||||
target.testsCount = tests.size();
|
||||
//--
|
||||
target.configurationsNames = String.join(";", configurationsNames);
|
||||
target.groupsNames = String.join(";", groupsNames);
|
||||
//---
|
||||
target.tasksCount=tasks_count;
|
||||
DVMPackage_json json = target.package_json;
|
||||
//инициализируем идентификаторы задач.
|
||||
for (DVMCompilationTask compilationTask : tasks) {
|
||||
//--
|
||||
compilationTask.id = json.getMaxTaskId();
|
||||
//-
|
||||
for (DVMRunTask runTask : compilationTask.runTasks) {
|
||||
runTask.id = json.getMaxTaskId();
|
||||
runTask.dvmcompilationtask_id = compilationTask.id;
|
||||
}
|
||||
}
|
||||
json.compilationTasks.addAll(tasks);
|
||||
//--
|
||||
if (target.id != Constants.Nan)
|
||||
Global.testingServer.db.Update(target);
|
||||
target.saveTasks(tasks, tasks_count);
|
||||
super.ServerAction();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
|
||||
@@ -3,8 +3,7 @@ import Common.Current;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingPackage.TestingPackage;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import TestingSystem.DVM.Configuration.DVMConfiguration;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
@@ -12,7 +11,7 @@ import java.util.Vector;
|
||||
public class ShowCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/LastOpened.png";
|
||||
return "/icons/Edit.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
@@ -35,13 +34,13 @@ public class ShowCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
System.out.println("package="+target.id);
|
||||
Vector<Configuration> configurations = target.getConfigurations();
|
||||
Vector<DVMConfiguration> configurations = target.getConfigurations();
|
||||
Vector<Group> groups = target.getGroups();
|
||||
Vector<Test> tests = target.getTests();
|
||||
//-----
|
||||
Vector<String> res = new Vector<>();
|
||||
res.add("конфигурации: " + configurations.size());
|
||||
for (Configuration configuration : configurations)
|
||||
for (DVMConfiguration configuration : configurations)
|
||||
res.add(configuration.description);
|
||||
//--
|
||||
res.add("группы: " + groups.size());
|
||||
@@ -53,7 +52,7 @@ public class ShowCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
res.add(test.description);
|
||||
System.out.println(String.join("\n", res));
|
||||
//--
|
||||
for (Configuration configuration: configurations)
|
||||
for (DVMConfiguration configuration: configurations)
|
||||
configuration.Select(true);
|
||||
for (Group group: groups)
|
||||
group.Select(true);
|
||||
@@ -68,7 +67,7 @@ public class ShowCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
Global.testingServer.db.tests.ShowUI(tests.lastElement().id);
|
||||
}
|
||||
if (!configurations.isEmpty()){
|
||||
Global.testingServer.db.configurations.ShowUI(configurations.lastElement().id);
|
||||
Global.testingServer.db.dvm_configurations.ShowUI(configurations.lastElement().id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,43 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import TestingSystem.Common.TasksPackageState;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import Visual_DVM_2021.Passes.StartTestingPackage;
|
||||
public class StartDVMPackage extends StartTestingPackage<DVMPackage> {
|
||||
import Visual_DVM_2021.Passes.Server.EditServerObject;
|
||||
public class StartDVMPackage extends EditServerObject<TestingServer, DVMPackage> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Start.png";
|
||||
}
|
||||
public StartDVMPackage() {
|
||||
super(DVMPackage.class);
|
||||
super(Global.testingServer,DVMPackage.class);
|
||||
}
|
||||
@Override
|
||||
protected Current getCurrentName() {
|
||||
return Current.DVMPackage;
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (!Current.getAccount().CheckRegistered(Log)) {
|
||||
return false;
|
||||
}
|
||||
if (Current.Check(Log,Current.DVMPackage)) {
|
||||
target = Current.getDVMPackage();
|
||||
//-
|
||||
if (target.state.isActive()) {
|
||||
Log.Writeln_("Пакет уже запущен.");
|
||||
return false;
|
||||
}
|
||||
if (target.tasksCount == 0) {
|
||||
Log.Writeln_("В пакете отсутствуют задачи.");
|
||||
return false;
|
||||
}
|
||||
if (UI.Question("Будет запущено:\n"
|
||||
+ target.tasksCount + " задач.\n" +
|
||||
"Продолжить")) {
|
||||
target.connectionErrosCount=0;
|
||||
target.state = TasksPackageState.Queued;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SynchronizeTests extends TestingSystemPass<Object> {
|
||||
//--
|
||||
// server.db.machines _testing_system
|
||||
//--
|
||||
server.db.configurations.ClearUI();
|
||||
server.db.dvm_configurations.ClearUI();
|
||||
server.db.groups.ClearUI();
|
||||
server.db.sapforConfigurations.ClearUI();
|
||||
server.db.serverSapfors.ClearUI();
|
||||
@@ -60,7 +60,7 @@ public class SynchronizeTests extends TestingSystemPass<Object> {
|
||||
protected void showDone() throws Exception {
|
||||
if (UI.HasMainWindow()) {
|
||||
//server.db.machines
|
||||
server.db.configurations.ShowUI();
|
||||
server.db.dvm_configurations.ShowUI();
|
||||
server.db.groups.ShowUI();
|
||||
server.db.sapforConfigurations.ShowUI();
|
||||
server.db.serverSapfors.ShowUI();
|
||||
|
||||
@@ -353,7 +353,7 @@ public enum PassCode_2021 {
|
||||
case SaveCurrentDVMPackage:
|
||||
return "Сохранить текущий пакет тестирования DVM";
|
||||
case ShowCurrentDVMPackage:
|
||||
return "Показать состав пакета тестирования DVM";
|
||||
return "Редактировать пакет тестирования DVM";
|
||||
case GetOldBugReports:
|
||||
return "Получить неиспользуемые баг репорты";
|
||||
case SPF_RenameIncludes:
|
||||
|
||||
@@ -126,7 +126,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
Global.db.users.mountUI(usersPanel);
|
||||
Global.db.compilers.mountUI(compilersPanel);
|
||||
//-
|
||||
Global.testingServer.db.configurations.mountUI(configurationsPanel);
|
||||
Global.testingServer.db.dvm_configurations.mountUI(configurationsPanel);
|
||||
Global.testingServer.db.dvmPackages.mountUI(dvmPackagesPanel);
|
||||
Global.testingServer.db.dvmRunTasks.mountUI(dvmRunTasksPanel);
|
||||
Global.testingServer.db.sapforConfigurations.mountUI(sapforConfigurationsPanel);
|
||||
@@ -141,7 +141,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
@Override
|
||||
public void ShowAll() {
|
||||
Global.db.machines.ShowUI();
|
||||
Global.testingServer.db.configurations.ShowUI();
|
||||
Global.testingServer.db.dvm_configurations.ShowUI();
|
||||
Global.testingServer.db.dvmPackages.ShowUI();
|
||||
Global.testingServer.db.sapforPackages.ShowUI();
|
||||
//--
|
||||
|
||||
Reference in New Issue
Block a user