упорядочил папки с кодом.
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedHashMap;
|
||||
public class SapforPackageData implements Serializable {
|
||||
//--->
|
||||
public LinkedHashMap<Integer, Group> groups =new LinkedHashMap<Integer, Group>();
|
||||
public LinkedHashMap<Integer, Test> tests = new LinkedHashMap<>();
|
||||
public LinkedHashMap<Integer, SapforConfiguration> sapforConfigurations = new LinkedHashMap<>();
|
||||
public ServerSapfor sapfor = null;
|
||||
//-->>
|
||||
public String notFound = "";
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage;
|
||||
import Common.Constants;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.riDBObject;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageState;
|
||||
import TestingSystem.SAPFOR.Json.SapforTasksResults_json;
|
||||
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Comparator;
|
||||
public class SapforTasksPackage extends riDBObject {
|
||||
@Description("DEFAULT ''")
|
||||
public String testsNames = "";//имена тестов через ; для отображения
|
||||
//---
|
||||
public int sapforId = Constants.Nan;
|
||||
public String sapfor_version = "?"; //тестируемая версия SAPFOR для таблицы
|
||||
public String sapfor_process_name = "";
|
||||
//---
|
||||
public String workspace = ""; //домашняя папка
|
||||
//---
|
||||
public int tasksCount = 0; //Общее число задач
|
||||
//---
|
||||
public int needsEmail = 0;
|
||||
public long StartDate = 0; //дата начала выполнения
|
||||
public long ChangeDate = 0;//дата окончания выполнения
|
||||
//-
|
||||
public int kernels = 1; //количество потоков.
|
||||
@Description("DEFAULT 'TestsSynchronize'")
|
||||
public TasksPackageState state = TasksPackageState.TestsSynchronize;
|
||||
@Description("DEFAULT ''")
|
||||
public String testsIds = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String configurationsIds = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String summary = "";
|
||||
@Description("IGNORE")
|
||||
public SapforTasksResults_json results = null;
|
||||
///---
|
||||
public File getArchive() {
|
||||
return new File(Global.SapforPackagesDirectory, id + ".zip");
|
||||
}
|
||||
public File getLocalWorkspace() {
|
||||
return new File(Global.SapforPackagesDirectory, String.valueOf(id));
|
||||
}
|
||||
public File getLoadedSign() {
|
||||
return Paths.get(Global.SapforPackagesDirectory.getAbsolutePath(), String.valueOf(id), Constants.LOADED).toFile();
|
||||
}
|
||||
public boolean isLoaded() {
|
||||
return getLoadedSign().exists();
|
||||
}
|
||||
public void readResults() {
|
||||
File json_file = new File(getLocalWorkspace(), Constants.results_json);
|
||||
results = null;
|
||||
try {
|
||||
results = (SapforTasksResults_json) Utils.jsonFromFile(json_file,
|
||||
SapforTasksResults_json.class);
|
||||
//----
|
||||
results.tasks.sort(Comparator.comparing(SapforTask::getUniqueKey));
|
||||
for (SapforTask task : results.tasks)
|
||||
results.allTasks.put(task.getUniqueKey(), task);
|
||||
//---
|
||||
results.SortTasks(); //по состояниям конфигурациям и группам
|
||||
//---
|
||||
results.buildTree(this);
|
||||
//---
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
SapforTasksPackage p = (SapforTasksPackage) src;
|
||||
sapforId = p.sapforId;
|
||||
testsNames = p.testsNames;
|
||||
sapfor_version = p.sapfor_version;
|
||||
workspace = p.workspace;
|
||||
tasksCount = p.tasksCount;
|
||||
StartDate = p.StartDate;
|
||||
ChangeDate = p.ChangeDate;
|
||||
kernels = p.kernels;
|
||||
sapfor_process_name = p.sapfor_process_name;
|
||||
state = p.state;
|
||||
needsEmail = p.needsEmail;
|
||||
summary = p.summary;
|
||||
}
|
||||
//---
|
||||
public SapforTasksPackage() {
|
||||
}
|
||||
//--
|
||||
public SapforTasksPackage(SapforTasksPackage sapforTasksPackage) {
|
||||
this.SynchronizeFields(sapforTasksPackage);
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage;
|
||||
import Common.Current;
|
||||
import Common.Database.*;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import static Common.UI.Tables.TableRenderers.RendererDate;
|
||||
import static Common.UI.Tables.TableRenderers.RendererStatusEnum;
|
||||
public class SapforTasksPackagesDBTable extends iDBTable<SapforTasksPackage> {
|
||||
public SapforTasksPackagesDBTable() {
|
||||
super(SapforTasksPackage.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.SapforTasksPackage;
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "пакет задач Sapfor";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "пакеты задач Sapfor";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this) {
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
// columns.get(0).setVisible(false);
|
||||
columns.get(5).setRenderer(RendererDate);
|
||||
columns.get(6).setRenderer(RendererDate);
|
||||
columns.get(7).setRenderer(RendererStatusEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"SAPFOR",
|
||||
"Тесты",
|
||||
"Задач",
|
||||
"Ядер",
|
||||
"Начало",
|
||||
"Изменено",
|
||||
"Статус"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(SapforTasksPackage object, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 1:
|
||||
return object.sapfor_version;
|
||||
case 2:
|
||||
return object.testsNames;
|
||||
case 3:
|
||||
return object.tasksCount;
|
||||
case 4:
|
||||
return object.kernels;
|
||||
case 5:
|
||||
return new Date(object.StartDate);
|
||||
case 6:
|
||||
return new Date(object.ChangeDate);
|
||||
case 7:
|
||||
return object.state;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
||||
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
||||
res.put(SapforTask.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.Constants;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Vector;
|
||||
public class ConfigurationSummary extends SapforPackageTreeNode {
|
||||
public int configuration_id = Constants.Nan;
|
||||
public String flags = "";
|
||||
public Vector<String> codes_descriptions = new Vector<>();
|
||||
public ConfigurationSummary(int configuration_id_in, SapforTask task) {
|
||||
configuration_id = configuration_id_in;
|
||||
flags = task.flags;
|
||||
Vector<String> codes_s = new Vector<>(Arrays.asList(task.codes.split(" ")));
|
||||
for (int i = 1; i < codes_s.size(); ++i) {
|
||||
codes_descriptions.add(Utils.Brackets(PassCode_2021.valueOf(codes_s.get(i)).getDescription()));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return flags + " " + String.join("→", codes_descriptions);
|
||||
}
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
return "Configuration";
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
public class GroupSummary extends SapforPackageTreeNode {
|
||||
public String group_name = "";
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
return "Group";
|
||||
}
|
||||
public GroupSummary(String group_name_in) {
|
||||
group_name = group_name_in;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return group_name;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import TestingSystem.SAPFOR.SapforTask.MatchState;
|
||||
public class MatchesSummary extends SapforPackageTreeNode {
|
||||
public MatchState state;
|
||||
public int count = 0;
|
||||
public MatchesSummary(MatchState state_in) {
|
||||
state = state_in;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return state.getDescription() + " : " + count;
|
||||
}
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
switch (state) {
|
||||
case Match:
|
||||
return "Match";
|
||||
case NotMatch:
|
||||
return "NotMatch";
|
||||
default:
|
||||
return "TestVersion";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
public class PackageSummary extends SapforPackageTreeNode {
|
||||
public int count = 0;
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
return null;
|
||||
}
|
||||
public PackageSummary() {
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "всего задач : " + count;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.util.Objects;
|
||||
public abstract class SapforPackageTreeNode extends DefaultMutableTreeNode {
|
||||
public ImageIcon getIcon() {
|
||||
return (getImageKey() != null) ?
|
||||
new ImageIcon(Objects.requireNonNull(getClass().getResource("/icons/versions/" + getImageKey() + ".png")))
|
||||
: null;
|
||||
}
|
||||
public abstract String getImageKey();
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.Current;
|
||||
import Common.UI.Trees.DataTree;
|
||||
import Common.UI.Trees.TreeRenderers;
|
||||
import Common.UI.UI;
|
||||
import TestingSystem.SAPFOR.Json.SapforVersion_json;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.TreePath;
|
||||
import java.util.Vector;
|
||||
public class SapforTasksPackageTree extends DataTree {
|
||||
Current current;
|
||||
SapforTasksPackageTree slave_tree = null;
|
||||
public void setSlaveTree(SapforTasksPackageTree slave_tree_in) {
|
||||
slave_tree = slave_tree_in;
|
||||
}
|
||||
public SapforTasksPackageTree(DefaultMutableTreeNode root_in, Current current_in) {
|
||||
super(root_in);
|
||||
current = current_in;
|
||||
}
|
||||
@Override
|
||||
protected int getStartLine() {
|
||||
return 1;
|
||||
}
|
||||
@Override
|
||||
public TreeRenderers getRenderer() {
|
||||
return TreeRenderers.RendererSapforVersion;
|
||||
}
|
||||
@Override
|
||||
public Current getCurrent() {
|
||||
return current;
|
||||
}
|
||||
public void selectSamePath_r(TreePath example, int index, DefaultMutableTreeNode node, Vector<DefaultMutableTreeNode> res) {
|
||||
if (index < example.getPathCount()) {
|
||||
DefaultMutableTreeNode exampleNode = (DefaultMutableTreeNode) example.getPathComponent(index);
|
||||
if (exampleNode.toString().equals(node.toString())) {
|
||||
res.add(node);
|
||||
for (int i = 0; i < node.getChildCount(); ++i)
|
||||
selectSamePath_r(example, index + 1, (DefaultMutableTreeNode) node.getChildAt(i), res);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void selectSamePath(TreePath path_in) {
|
||||
Vector<DefaultMutableTreeNode> pathNodes = new Vector<>();
|
||||
selectSamePath_r(path_in, 0, root, pathNodes);
|
||||
if (!pathNodes.isEmpty()) {
|
||||
TreePath path = new TreePath(pathNodes.toArray());
|
||||
setSelectionPath(path);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void SelectionAction(TreePath e) {
|
||||
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.getLastPathComponent();
|
||||
Object o = node.getUserObject();
|
||||
//---
|
||||
if (slave_tree != null) {
|
||||
slave_tree.selectSamePath(e);
|
||||
}
|
||||
//---
|
||||
if (o instanceof SapforVersion_json) {
|
||||
SapforVersion_json version = (SapforVersion_json) o;
|
||||
Current.set(current, version);
|
||||
if (current.equals(Current.SapforEtalonVersion))
|
||||
UI.getMainWindow().getTestingWindow().ShowCurrentSapforPackageVersionEtalon();
|
||||
else
|
||||
UI.getMainWindow().getTestingWindow().ShowCurrentSapforPackageVersion();
|
||||
//--
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.UI.Trees.StyledTreeCellRenderer;
|
||||
|
||||
import javax.swing.*;
|
||||
public class SapforVersionsTreeCellRenderer extends StyledTreeCellRenderer {
|
||||
public java.awt.Component getTreeCellRendererComponent(
|
||||
JTree tree, Object value,
|
||||
boolean selected, boolean expanded,
|
||||
boolean leaf, int row, boolean hasFocus) {
|
||||
super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
|
||||
if (value instanceof SapforPackageTreeNode) {
|
||||
SapforPackageTreeNode node = (SapforPackageTreeNode) value;
|
||||
setForeground(tree.getForeground());
|
||||
setFont(getFont().deriveFont((float) 14.0));
|
||||
setIcon(node.getIcon());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
public class StateSummary extends SapforPackageTreeNode {
|
||||
public TaskState state;
|
||||
public int count = 0;
|
||||
public StateSummary(TaskState state_in) {
|
||||
state = state_in;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return state.getDescription() + " : " + count;
|
||||
}
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
switch (state) {
|
||||
case Done:
|
||||
return "DoneStateSummary";
|
||||
case DoneWithErrors:
|
||||
return "ErrorsStateSummary";
|
||||
default:
|
||||
return "UnknownStateSummary";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import javax.swing.*;
|
||||
import java.util.Objects;
|
||||
public abstract class TreeSummary {
|
||||
public String text = "";
|
||||
public abstract void refreshText();
|
||||
@Override
|
||||
public String toString() {
|
||||
return text;
|
||||
}
|
||||
public ImageIcon getIcon() {
|
||||
return new ImageIcon(Objects.requireNonNull(getClass().getResource("/icons/versions/" + getImageKey() + ".png")));
|
||||
}
|
||||
public abstract String getImageKey();
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import TestingSystem.SAPFOR.Json.SapforVersion_json;
|
||||
public class VersionSummary extends SapforPackageTreeNode{
|
||||
|
||||
public String version_name = "";
|
||||
public String version_description = "";
|
||||
public VersionSummary(SapforVersion_json version_json) {
|
||||
setUserObject(version_json);
|
||||
version_name = version_json.Home.getName();
|
||||
version_description = version_json.description;
|
||||
}
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
return "TestVersion";
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return version_name+ " : " +version_description;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user