2024-10-14 12:14:01 +03:00
|
|
|
package _VisualDVM.Passes.Testing;
|
2024-10-10 23:57:36 +03:00
|
|
|
import Common.Passes.Pass;
|
2024-10-07 00:58:29 +03:00
|
|
|
import _VisualDVM.Global;
|
2024-10-08 23:45:06 +03:00
|
|
|
import _VisualDVM.ServerObjectsCache.ConfigurationCache;
|
|
|
|
|
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.TestingSystem.Common.Configuration.Configuration;
|
|
|
|
|
import _VisualDVM.TestingSystem.Common.Group.Group;
|
|
|
|
|
import _VisualDVM.TestingSystem.Common.Test.Test;
|
2024-09-18 22:58:38 +03:00
|
|
|
|
|
|
|
|
import java.util.Vector;
|
2024-10-09 23:37:58 +03:00
|
|
|
public abstract class ShowCurrentConfigurationTests<C extends Configuration> extends Pass<C> {
|
2024-09-18 22:58:38 +03:00
|
|
|
@Override
|
|
|
|
|
public String getIconPath() {
|
|
|
|
|
return "/icons/ShowPassword.png";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getButtonText() {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
2024-10-24 23:40:24 +03:00
|
|
|
public abstract Class currentClass();
|
2024-09-18 22:58:38 +03:00
|
|
|
@Override
|
|
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
|
|
|
|
target = null;
|
2024-10-24 23:40:24 +03:00
|
|
|
if (Global.testingServer.db.getTable(currentClass()).getUI().Check(Log)) {
|
|
|
|
|
target = (C) (Global.testingServer.db.getTable(currentClass()).getUI().getCurrent());
|
2024-09-18 22:58:38 +03:00
|
|
|
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);
|
2024-10-14 15:19:13 +03:00
|
|
|
Vector<Group> groups = cache.getGroups();
|
2024-09-18 22:58:38 +03:00
|
|
|
Vector<Test> tests = cache.getTests();
|
|
|
|
|
//-----
|
|
|
|
|
//--
|
2024-10-14 15:19:13 +03:00
|
|
|
for (Group group : groups)
|
2024-09-18 22:58:38 +03:00
|
|
|
group.Select(true);
|
2024-10-14 15:19:13 +03:00
|
|
|
for (Test test : tests)
|
2024-09-18 22:58:38 +03:00
|
|
|
test.Select(true);
|
|
|
|
|
//--
|
2024-10-14 15:19:13 +03:00
|
|
|
if (!groups.isEmpty()) {
|
2024-09-18 22:58:38 +03:00
|
|
|
Global.testingServer.db.groups.ShowUI(groups.lastElement().id);
|
|
|
|
|
}
|
2024-10-14 15:19:13 +03:00
|
|
|
if (!tests.isEmpty()) {
|
2024-09-18 22:58:38 +03:00
|
|
|
Global.testingServer.db.tests.ShowUI(tests.lastElement().id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|