no message
This commit is contained in:
79
src/Visual_DVM_2021/Passes/All/SaveCurrentDVMPackage.java
Normal file
79
src/Visual_DVM_2021/Passes/All/SaveCurrentDVMPackage.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class SaveCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
//--
|
||||
Vector<Configuration> configurations;
|
||||
Vector<Group> groups;
|
||||
Vector<Test> tests;
|
||||
//--
|
||||
Vector<String> configurationsNames;
|
||||
Vector<String> groupsNames;
|
||||
//--
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Save.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = null;
|
||||
configurations = new Vector<>();
|
||||
//---
|
||||
groups = new Vector<>();
|
||||
tests = new Vector<>();
|
||||
//---
|
||||
configurationsNames = new Vector<>();
|
||||
groupsNames = new Vector<>();
|
||||
//---
|
||||
if (!Current.Check(Log, Current.DVMPackage)) return false;
|
||||
//--
|
||||
target = Current.getDVMPackage();
|
||||
for (Configuration configuration : Global.testingServer.db.configurations.getCheckedItems()) {
|
||||
configurations.add(configuration);
|
||||
configurationsNames.add(configuration.description);
|
||||
}
|
||||
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
|
||||
groups.add(group);
|
||||
groupsNames.add(group.description);
|
||||
tests.addAll(Global.testingServer.db.tests.getSelectedGroupTests(group));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//проход не создает задачи. Проход просто фиксирует конфигурации группы и тесты.
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target.addConfigurations(configurations);
|
||||
target.addGroups(groups);
|
||||
target.addTests(tests);
|
||||
//--
|
||||
target.configurationsCount = configurations.size();
|
||||
target.groupsCount = groups.size();
|
||||
target.testsCount = tests.size();
|
||||
//--
|
||||
target.configurationsNames = String.join(";", configurationsNames);
|
||||
target.groupsNames = String.join(";", groupsNames);
|
||||
//--
|
||||
if (target.id != Constants.Nan)
|
||||
Global.testingServer.db.Update(target);
|
||||
//--
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
Global.testingServer.db.dvmPackages.ShowUI(target.id);
|
||||
Global.testingServer.db.dvmRunTasks.ShowDVMPackage(target);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,75 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
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.DVMPackage.DVMPackage;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import Visual_DVM_2021.Passes.ShowTestingPackage;
|
||||
public class ShowCurrentDVMPackage extends ShowTestingPackage {
|
||||
|
||||
import java.util.Vector;
|
||||
public class ShowCurrentDVMPackage extends Pass_2021<DVMPackage> {
|
||||
@Override
|
||||
public Current currentName() {
|
||||
return Current.DVMPackage;
|
||||
public String getIconPath() {
|
||||
return "/icons/LastOpened.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
public Current currentName(){return Current.DVMPackage;};
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = null;
|
||||
if (Current.Check(Log, Current.DVMPackage)) {
|
||||
target = Current.getDVMPackage();
|
||||
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);
|
||||
Vector<Configuration> 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)
|
||||
res.add(configuration.description);
|
||||
//--
|
||||
res.add("группы: " + groups.size());
|
||||
for (Group group : groups)
|
||||
res.add(group.description);
|
||||
//--
|
||||
res.add("тесты: " + tests.size());
|
||||
for (Test test : tests)
|
||||
res.add(test.description);
|
||||
System.out.println(String.join("\n", res));
|
||||
//--
|
||||
for (Configuration configuration: configurations)
|
||||
configuration.Select(true);
|
||||
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);
|
||||
}
|
||||
if (!configurations.isEmpty()){
|
||||
Global.testingServer.db.configurations.ShowUI(configurations.lastElement().id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -342,14 +342,16 @@ public enum PassCode_2021 {
|
||||
ShowSapforCompilationOut,
|
||||
ShowSapforCompilationErr,
|
||||
GetOldBugReports,
|
||||
ShowCurrentDVMPackage
|
||||
|
||||
ShowCurrentDVMPackage,
|
||||
SaveCurrentDVMPackage
|
||||
;
|
||||
//--
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case Undefined:
|
||||
return "?";
|
||||
case SaveCurrentDVMPackage:
|
||||
return "Сохранить текущий пакет тестирования DVM";
|
||||
case ShowCurrentDVMPackage:
|
||||
return "Показать состав пакета тестирования DVM";
|
||||
case GetOldBugReports:
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
package Visual_DVM_2021.Passes;
|
||||
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 java.util.Vector;
|
||||
public abstract class ShowTestingPackage extends Pass_2021<TestingPackage> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/LastOpened.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 = (TestingPackage) Current.get(currentName());
|
||||
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);
|
||||
Vector<Configuration> 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)
|
||||
res.add(configuration.description);
|
||||
//--
|
||||
res.add("группы: " + groups.size());
|
||||
for (Group group : groups)
|
||||
res.add(group.description);
|
||||
//--
|
||||
res.add("тесты: " + tests.size());
|
||||
for (Test test : tests)
|
||||
res.add(test.description);
|
||||
System.out.println(String.join("\n", res));
|
||||
//--
|
||||
for (Configuration configuration: configurations)
|
||||
configuration.Select(true);
|
||||
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);
|
||||
}
|
||||
if (!configurations.isEmpty()){
|
||||
Global.testingServer.db.configurations.ShowUI(configurations.lastElement().id);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user