no message
This commit is contained in:
@@ -5,49 +5,16 @@ import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import Visual_DVM_2021.Passes.SaveCurrentConfiguration;
|
||||
import Visual_DVM_2021.Passes.Server.EditServerObject;
|
||||
|
||||
import java.util.Vector;
|
||||
public class SaveCurrentDVMConfiguration extends EditServerObject<TestingServer, DVMConfiguration> {
|
||||
Vector<Group> groups;
|
||||
Vector<Test> tests;
|
||||
//--
|
||||
Vector<String> groupsNames;
|
||||
//--
|
||||
public class SaveCurrentDVMConfiguration extends SaveCurrentConfiguration<DVMConfiguration> {
|
||||
public SaveCurrentDVMConfiguration() {
|
||||
super(Global.testingServer, DVMConfiguration.class);
|
||||
super(DVMConfiguration.class);
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Save.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (!Current.Check(Log, Current.DVMConfiguration)) return false;
|
||||
target = Current.getDVMConfiguration();
|
||||
//--
|
||||
groups = new Vector<>();
|
||||
tests = new Vector<>();
|
||||
//---
|
||||
groupsNames = new Vector<>();
|
||||
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
|
||||
groups.add(group);
|
||||
groupsNames.add(group.description);
|
||||
Vector<Test> groupTests = Global.testingServer.db.tests.getSelectedGroupTests(group);
|
||||
tests.addAll(groupTests);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
//занесение информации об участвующих группах конфигурациях и тестах
|
||||
target.saveGroupsAsJson(groups);
|
||||
target.saveTestsAsJson(tests);
|
||||
//--
|
||||
super.ServerAction();
|
||||
public Current currentName() {
|
||||
return Current.DVMConfiguration;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import Visual_DVM_2021.Passes.SaveCurrentConfiguration;
|
||||
public class SaveCurrentSAPFORConfiguration extends SaveCurrentConfiguration<DVMConfiguration> {
|
||||
public SaveCurrentSAPFORConfiguration() {
|
||||
super(DVMConfiguration.class);
|
||||
}
|
||||
@Override
|
||||
public Current currentName() {
|
||||
return Current.SapforConfiguration;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +1,9 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.VisualCache.ConfigurationCache;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class ShowCurrentDVMConfigurationTests extends Pass_2021<DVMConfiguration> {
|
||||
import Visual_DVM_2021.Passes.ShowCurrentConfigurationTests;
|
||||
public class ShowCurrentDVMConfigurationTests extends ShowCurrentConfigurationTests {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/ShowPassword.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = null;
|
||||
if (Current.Check(Log, Current.DVMConfiguration)) {
|
||||
target = Current.getDVMConfiguration();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
Global.testingServer.db.UnselectAllGTC();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
System.out.println("package="+target.id);
|
||||
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(target);
|
||||
Vector<Group> groups = cache.getGroups();
|
||||
Vector<Test> tests = cache.getTests();
|
||||
//-----
|
||||
//--
|
||||
for (Group group: groups)
|
||||
group.Select(true);
|
||||
for (Test test: tests)
|
||||
test.Select(true);
|
||||
//--
|
||||
|
||||
if (!groups.isEmpty()){
|
||||
Global.testingServer.db.groups.ShowUI(groups.lastElement().id);
|
||||
}
|
||||
if (!tests.isEmpty()){
|
||||
Global.testingServer.db.tests.ShowUI(tests.lastElement().id);
|
||||
}
|
||||
|
||||
public Current currentName() {
|
||||
return Current.DVMConfiguration;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Visual_DVM_2021.Passes.ShowCurrentConfigurationTests;
|
||||
public class ShowCurrentSAPFORConfigurationTests extends ShowCurrentConfigurationTests {
|
||||
@Override
|
||||
public Current currentName() {
|
||||
return Current.SapforConfiguration;
|
||||
}
|
||||
}
|
||||
@@ -340,21 +340,29 @@ public enum PassCode_2021 {
|
||||
ShowSapforCompilationOut,
|
||||
ShowSapforCompilationErr,
|
||||
GetOldBugReports,
|
||||
//--
|
||||
ShowCurrentDVMConfigurationTests,
|
||||
SaveCurrentDVMConfiguration,
|
||||
StartSelectedDVMConfigurations,
|
||||
//--
|
||||
ShowCurrentSAPFORConfigurationTests,
|
||||
SaveCurrentSAPFORConfiguration
|
||||
;
|
||||
//--
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case Undefined:
|
||||
return "?";
|
||||
case SaveCurrentSAPFORConfiguration:
|
||||
return "Сохранить тесты текущей конфигурации системы SAPFOR";
|
||||
case ShowCurrentSAPFORConfigurationTests:
|
||||
return "Отметить группы и тесты, участвующие в текущей конфигурации системы SAPFOR";
|
||||
case StartSelectedDVMConfigurations:
|
||||
return "Запустить отмеченные конфигурации тестирования DVM системы";
|
||||
case ShowCurrentDVMConfigurationTests:
|
||||
return "Отметить группы и тесты, участвующие в текущей конфигурации DVM системы";
|
||||
case SaveCurrentDVMConfiguration:
|
||||
return "Сохранить информацию о тестах текущей конфигурации DVM системы";
|
||||
return "Сохранить тесты текущей конфигурации DVM системы";
|
||||
case GetOldBugReports:
|
||||
return "Получить неиспользуемые баг репорты";
|
||||
case SPF_RenameIncludes:
|
||||
|
||||
52
src/Visual_DVM_2021/Passes/SaveCurrentConfiguration.java
Normal file
52
src/Visual_DVM_2021/Passes/SaveCurrentConfiguration.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package Visual_DVM_2021.Passes;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.VisualCache.ConfigurationCache;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.Configuration.Configuration;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.Passes.Server.EditServerObject;
|
||||
|
||||
import java.util.Vector;
|
||||
public abstract class SaveCurrentConfiguration<C extends Configuration> extends EditServerObject<TestingServer, C> {
|
||||
Vector<Group> groups;
|
||||
Vector<Test> tests;
|
||||
//--
|
||||
public SaveCurrentConfiguration(Class<C> d_in) {
|
||||
super(Global.testingServer, d_in);
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Save.png";
|
||||
}
|
||||
public abstract Current currentName();
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (!Current.Check(Log, currentName())) return false;
|
||||
target = (C) Current.get(currentName());
|
||||
//--
|
||||
groups = new Vector<>();
|
||||
tests = new Vector<>();
|
||||
//---
|
||||
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
|
||||
groups.add(group);
|
||||
Vector<Test> groupTests = Global.testingServer.db.tests.getSelectedGroupTests(group);
|
||||
tests.addAll(groupTests);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
//занесение информации об участвующих группах конфигурациях и тестах
|
||||
target.saveGroupsAsJson(groups);
|
||||
target.saveTestsAsJson(tests);
|
||||
//--
|
||||
super.ServerAction();
|
||||
//--
|
||||
// ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(target);
|
||||
// System.out.println(Utils.Brackets(cache.groupsDescriptions));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.Server;
|
||||
import Common.Database.DBObject;
|
||||
import Common.UI.VisualCache.VisualCache;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import Repository.RepositoryServer;
|
||||
public class DeleteServerObject<S extends RepositoryServer, D extends DBObject> extends ServerObjectPass<S, D> {
|
||||
@@ -16,7 +15,7 @@ public class DeleteServerObject<S extends RepositoryServer, D extends DBObject>
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
super.performPreparation();
|
||||
VisualCaches.DeleteCahce(target);
|
||||
VisualCaches.DeleteCache(target);
|
||||
}
|
||||
//Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта.
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,6 @@ import Common.UI.VisualCache.VisualCaches;
|
||||
import Repository.RepositoryServer;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Visual_DVM_2021.Passes.Server.RepositoryPass;
|
||||
import javafx.util.Pair;
|
||||
|
||||
import java.util.Vector;
|
||||
@@ -53,7 +52,7 @@ public class DeleteServerObjects <S extends RepositoryServer, D extends DBObject
|
||||
protected void performPreparation() throws Exception {
|
||||
super.performPreparation();
|
||||
for (Object key: target){
|
||||
VisualCaches.DeleteCahce(d, key);
|
||||
VisualCaches.DeleteCache(d, key);
|
||||
}
|
||||
}
|
||||
//Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта.
|
||||
|
||||
@@ -18,7 +18,7 @@ public class EditServerObject<S extends RepositoryServer, D extends DBObject> ex
|
||||
protected void performPreparation() throws Exception {
|
||||
super.performPreparation();
|
||||
//очистить кэш.
|
||||
VisualCaches.DeleteCahce(target);
|
||||
VisualCaches.DeleteCache(target);
|
||||
}
|
||||
//--
|
||||
public EditServerObject(S server_in, Class<D> d_in) {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package Visual_DVM_2021.Passes;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.VisualCache.ConfigurationCache;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import TestingSystem.Common.Configuration.Configuration;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
|
||||
import java.util.Vector;
|
||||
public abstract class ShowCurrentConfigurationTests extends Pass_2021<Configuration> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/ShowPassword.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
public abstract Current currentName();
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = null;
|
||||
if (Current.Check(Log, currentName())) {
|
||||
target = (Configuration) Current.get(currentName());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
Global.testingServer.db.UnselectAllGTC();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(target);
|
||||
Vector<Group> groups = cache.getGroups();
|
||||
Vector<Test> tests = cache.getTests();
|
||||
//-----
|
||||
//--
|
||||
for (Group group: groups)
|
||||
group.Select(true);
|
||||
for (Test test: tests)
|
||||
test.Select(true);
|
||||
//--
|
||||
if (!groups.isEmpty()){
|
||||
Global.testingServer.db.groups.ShowUI(groups.lastElement().id);
|
||||
}
|
||||
if (!tests.isEmpty()){
|
||||
Global.testingServer.db.tests.ShowUI(tests.lastElement().id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user