no message

This commit is contained in:
2024-09-18 22:58:38 +03:00
parent a767fc265a
commit 00136fa9d9
17 changed files with 188 additions and 112 deletions

15
.idea/workspace.xml generated
View File

@@ -7,12 +7,23 @@
</component> </component>
<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 afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SaveCurrentSAPFORConfiguration.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ShowCurrentSAPFORConfigurationTests.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SaveCurrentConfiguration.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/ShowCurrentConfigurationTests.java" afterDir="false" />
<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/Common/UI/Tables/HiddenListRenderer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Tables/HiddenListRenderer.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common/UI/VisualCache/ConfigurationCache.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/VisualCache/ConfigurationCache.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/UI/VisualCache/VisualCaches.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/VisualCache/VisualCaches.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common/UI/VisualCache/VisualCaches.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/VisualCache/VisualCaches.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/Group/Json/GroupJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/Group/Json/GroupJson.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/DVMConfigurationDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/DVMConfigurationDBTable.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/DVMConfigurationDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/DVMConfigurationDBTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/DVMConfigurationsMenuBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/DVMConfigurationsMenuBar.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfigurationDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfigurationDBTable.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfigurationDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfigurationDBTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfigurationsMenuBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfigurationsMenuBar.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SaveCurrentDVMConfiguration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SaveCurrentDVMConfiguration.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ShowCurrentDVMConfigurationTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ShowCurrentDVMConfigurationTests.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/DeleteServerObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/DeleteServerObject.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/DeleteServerObjects.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/DeleteServerObjects.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/EditServerObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/EditServerObject.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" />

View File

@@ -12,14 +12,20 @@ import TestingSystem.Common.Test.Test;
import java.util.Vector; import java.util.Vector;
public class ConfigurationCache extends VisualCache{ public class ConfigurationCache extends VisualCache{
public GroupsJson groupsJson = null; public GroupsJson groupsJson = null;
public Vector<String> groupsDescriptions = null; public String groupsDescriptions = null;
public TestsJson testsJson = null; public TestsJson testsJson = null;
//-- //--
public ConfigurationCache(Configuration configuration) { public ConfigurationCache(Configuration configuration) {
if (configuration.packedGroupsJson.isEmpty()) // System.out.println("configuration cache new instance for "+configuration.id);
// System.out.println("packageGroupsJson="+Utils.Brackets(configuration.packedGroupsJson));
if (configuration.packedGroupsJson.isEmpty()) {
// System.out.println("empty");
groupsJson = new GroupsJson(); //просто пустой groupsJson = new GroupsJson(); //просто пустой
else }
else {
// System.out.println("not empty");
groupsJson = Utils.gson.fromJson(configuration.packedGroupsJson, GroupsJson.class); groupsJson = Utils.gson.fromJson(configuration.packedGroupsJson, GroupsJson.class);
}
//-- //--
if (testsJson == null) { if (testsJson == null) {
if (configuration.packedTestsJson.isEmpty()) if (configuration.packedTestsJson.isEmpty())
@@ -28,14 +34,15 @@ public class ConfigurationCache extends VisualCache{
testsJson = Utils.gson.fromJson(configuration.packedTestsJson, TestsJson.class); testsJson = Utils.gson.fromJson(configuration.packedTestsJson, TestsJson.class);
} }
//- //-
groupsDescriptions = new Vector<>(); Vector<String> groupsDescriptionsVector = new Vector<>();
for (GroupJson groupJson : groupsJson.array) for (GroupJson groupJson : groupsJson.array)
groupsDescriptions.add(groupJson.description); groupsDescriptionsVector.add(groupJson.description);
groupsDescriptions= String.join(";", groupsDescriptionsVector);
} }
public int getTestsCount() { public int getTestsCount() {
return testsJson.array.size(); return testsJson.array.size();
} }
public Vector<String> getGroupsDescriptions() { public String getGroupsDescriptions() {
return groupsDescriptions; return groupsDescriptions;
} }
public Vector<Group> getGroups(){ public Vector<Group> getGroups(){

View File

@@ -26,22 +26,23 @@ public class VisualCaches {
return new VisualCache(); return new VisualCache();
} }
public static VisualCache GetCache(DBObject object) { public static VisualCache GetCache(DBObject object) {
// System.out.println("get visual cache for " + object.getPK()+" "+object.getClass()); // System.out.println("get visual cache for " + object.getPK()+" "+object.getClass());
VisualCache res = null; VisualCache res = null;
LinkedHashMap<Object, VisualCache> data = getDataForClass(object.getClass()); LinkedHashMap<Object, VisualCache> data = getDataForClass(object.getClass());
if (!data.containsKey(object.getPK())) { if (!data.containsKey(object.getPK())) {
// System.out.println("cache not found, creating..."); // System.out.println("cache not found, creating...");
data.put(object.getPK(), res = createCache(object)); data.put(object.getPK(), res = createCache(object));
} else { } else {
// System.out.println("cache found"); // System.out.println("cache found");
res = data.get(object.getPK()); res = data.get(object.getPK());
} }
return res; return res;
} }
public static void DeleteCahce(DBObject object){ public static void DeleteCache(DBObject object){
DeleteCahce(object.getClass(), object.getPK()); DeleteCache(object.getClass(), object.getPK());
} }
public static void DeleteCahce(Class class_, Object pk){ public static void DeleteCache(Class class_, Object pk){
// System.out.println("Delete for " + pk+" "+class_);
LinkedHashMap<Object, VisualCache> data = getDataForClass(class_); LinkedHashMap<Object, VisualCache> data = getDataForClass(class_);
if (data.containsKey(pk)) if (data.containsKey(pk))
data.remove(pk); data.remove(pk);

View File

@@ -38,7 +38,7 @@ public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
@Override @Override
protected void AdditionalInitColumns() { protected void AdditionalInitColumns() {
columns.get(5).setMaxWidth(300); columns.get(5).setMaxWidth(300);
columns.get(5).setRenderer(TableRenderers.RendererHiddenList); // columns.get(5).setRenderer(TableRenderers.RendererHiddenList);
columns.get(7).setRenderer(TableRenderers.RendererMultiline); columns.get(7).setRenderer(TableRenderers.RendererMultiline);
columns.get(8).setRenderer(TableRenderers.RendererMultiline); columns.get(8).setRenderer(TableRenderers.RendererMultiline);
columns.get(15).setRenderer(TableRenderers.RendererMultiline); columns.get(15).setRenderer(TableRenderers.RendererMultiline);

View File

@@ -5,7 +5,6 @@ public class DVMConfigurationsMenuBar extends DataMenuBar {
public DVMConfigurationsMenuBar() { public DVMConfigurationsMenuBar() {
super("конфигурации"); super("конфигурации");
addPasses( addPasses(
// PassCode_2021.StartTests,
PassCode_2021.PublishConfiguration, PassCode_2021.PublishConfiguration,
PassCode_2021.EditConfiguration, PassCode_2021.EditConfiguration,

View File

@@ -37,7 +37,7 @@ public class SapforConfigurationDBTable extends iDBTable<SapforConfiguration> {
@Override @Override
protected void AdditionalInitColumns() { protected void AdditionalInitColumns() {
columns.get(5).setMaxWidth(300); columns.get(5).setMaxWidth(300);
columns.get(5).setRenderer(TableRenderers.RendererHiddenList); // columns.get(5).setRenderer(TableRenderers.RendererHiddenList);
} }
}; };
} }

View File

@@ -5,7 +5,10 @@ public class SapforConfigurationsMenuBar extends DataMenuBar {
public SapforConfigurationsMenuBar() { public SapforConfigurationsMenuBar() {
super("конфигурации", super("конфигурации",
PassCode_2021.PublishSapforConfiguration, PassCode_2021.PublishSapforConfiguration,
PassCode_2021.EditSapforConfiguration, PassCode_2021.EditSapforConfiguration,
PassCode_2021.ShowCurrentSAPFORConfigurationTests,
PassCode_2021.SaveCurrentSAPFORConfiguration,
PassCode_2021.DeleteSapforConfiguration PassCode_2021.DeleteSapforConfiguration
); );
} }

View File

@@ -5,49 +5,16 @@ import TestingSystem.Common.Group.Group;
import TestingSystem.Common.Test.Test; import TestingSystem.Common.Test.Test;
import TestingSystem.Common.TestingServer; import TestingSystem.Common.TestingServer;
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration; import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
import Visual_DVM_2021.Passes.SaveCurrentConfiguration;
import Visual_DVM_2021.Passes.Server.EditServerObject; import Visual_DVM_2021.Passes.Server.EditServerObject;
import java.util.Vector; import java.util.Vector;
public class SaveCurrentDVMConfiguration extends EditServerObject<TestingServer, DVMConfiguration> { public class SaveCurrentDVMConfiguration extends SaveCurrentConfiguration<DVMConfiguration> {
Vector<Group> groups;
Vector<Test> tests;
//--
Vector<String> groupsNames;
//--
public SaveCurrentDVMConfiguration() { public SaveCurrentDVMConfiguration() {
super(Global.testingServer, DVMConfiguration.class); super(DVMConfiguration.class);
} }
@Override @Override
public String getIconPath() { public Current currentName() {
return "/icons/Save.png"; return Current.DVMConfiguration;
}
@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();
} }
} }

View File

@@ -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;
}
}

View File

@@ -1,56 +1,9 @@
package Visual_DVM_2021.Passes.All; package Visual_DVM_2021.Passes.All;
import Common.Current; import Common.Current;
import Common.Global; import Visual_DVM_2021.Passes.ShowCurrentConfigurationTests;
import Common.UI.VisualCache.ConfigurationCache; public class ShowCurrentDVMConfigurationTests extends ShowCurrentConfigurationTests {
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> {
@Override @Override
public String getIconPath() { public Current currentName() {
return "/icons/ShowPassword.png"; return Current.DVMConfiguration;
}
@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);
}
} }
} }

View File

@@ -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;
}
}

View File

@@ -340,21 +340,29 @@ public enum PassCode_2021 {
ShowSapforCompilationOut, ShowSapforCompilationOut,
ShowSapforCompilationErr, ShowSapforCompilationErr,
GetOldBugReports, GetOldBugReports,
//--
ShowCurrentDVMConfigurationTests, ShowCurrentDVMConfigurationTests,
SaveCurrentDVMConfiguration, SaveCurrentDVMConfiguration,
StartSelectedDVMConfigurations, StartSelectedDVMConfigurations,
//--
ShowCurrentSAPFORConfigurationTests,
SaveCurrentSAPFORConfiguration
; ;
//-- //--
public String getDescription() { public String getDescription() {
switch (this) { switch (this) {
case Undefined: case Undefined:
return "?"; return "?";
case SaveCurrentSAPFORConfiguration:
return "Сохранить тесты текущей конфигурации системы SAPFOR";
case ShowCurrentSAPFORConfigurationTests:
return "Отметить группы и тесты, участвующие в текущей конфигурации системы SAPFOR";
case StartSelectedDVMConfigurations: case StartSelectedDVMConfigurations:
return "Запустить отмеченные конфигурации тестирования DVM системы"; return "Запустить отмеченные конфигурации тестирования DVM системы";
case ShowCurrentDVMConfigurationTests: case ShowCurrentDVMConfigurationTests:
return "Отметить группы и тесты, участвующие в текущей конфигурации DVM системы"; return "Отметить группы и тесты, участвующие в текущей конфигурации DVM системы";
case SaveCurrentDVMConfiguration: case SaveCurrentDVMConfiguration:
return "Сохранить информацию о тестах текущей конфигурации DVM системы"; return "Сохранить тесты текущей конфигурации DVM системы";
case GetOldBugReports: case GetOldBugReports:
return "Получить неиспользуемые баг репорты"; return "Получить неиспользуемые баг репорты";
case SPF_RenameIncludes: case SPF_RenameIncludes:

View 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));
}
}

View File

@@ -1,6 +1,5 @@
package Visual_DVM_2021.Passes.Server; package Visual_DVM_2021.Passes.Server;
import Common.Database.DBObject; import Common.Database.DBObject;
import Common.UI.VisualCache.VisualCache;
import Common.UI.VisualCache.VisualCaches; import Common.UI.VisualCache.VisualCaches;
import Repository.RepositoryServer; import Repository.RepositoryServer;
public class DeleteServerObject<S extends RepositoryServer, D extends DBObject> extends ServerObjectPass<S, D> { 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 @Override
protected void performPreparation() throws Exception { protected void performPreparation() throws Exception {
super.performPreparation(); super.performPreparation();
VisualCaches.DeleteCahce(target); VisualCaches.DeleteCache(target);
} }
//Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта. //Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта.
@Override @Override

View File

@@ -8,7 +8,6 @@ import Common.UI.VisualCache.VisualCaches;
import Repository.RepositoryServer; import Repository.RepositoryServer;
import Repository.Server.ServerCode; import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021; import Repository.Server.ServerExchangeUnit_2021;
import Visual_DVM_2021.Passes.Server.RepositoryPass;
import javafx.util.Pair; import javafx.util.Pair;
import java.util.Vector; import java.util.Vector;
@@ -53,7 +52,7 @@ public class DeleteServerObjects <S extends RepositoryServer, D extends DBObject
protected void performPreparation() throws Exception { protected void performPreparation() throws Exception {
super.performPreparation(); super.performPreparation();
for (Object key: target){ for (Object key: target){
VisualCaches.DeleteCahce(d, key); VisualCaches.DeleteCache(d, key);
} }
} }
//Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта. //Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта.

View File

@@ -18,7 +18,7 @@ public class EditServerObject<S extends RepositoryServer, D extends DBObject> ex
protected void performPreparation() throws Exception { protected void performPreparation() throws Exception {
super.performPreparation(); super.performPreparation();
//очистить кэш. //очистить кэш.
VisualCaches.DeleteCahce(target); VisualCaches.DeleteCache(target);
} }
//-- //--
public EditServerObject(S server_in, Class<D> d_in) { public EditServerObject(S server_in, Class<D> d_in) {

View File

@@ -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);
}
}
}