no message
This commit is contained in:
@@ -2,11 +2,23 @@ package SapforTestingSystem.SapforTasksPackage;
|
||||
import Common.Constants;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.nDBObject;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import SapforTestingSystem.Json.SapforTasksResults_json;
|
||||
import SapforTestingSystem.SapforTask.SapforTask;
|
||||
import SapforTestingSystem.SapforTasksPackage.UI.ConfigurationSummary;
|
||||
import SapforTestingSystem.SapforTasksPackage.UI.GroupSummary;
|
||||
import SapforTestingSystem.SapforTasksPackage.UI.PackageSummary;
|
||||
import SapforTestingSystem.SapforTasksPackage.UI.StateSummary;
|
||||
import TestingSystem.TasksPackage.TasksPackageState;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class SapforTasksPackage extends nDBObject {
|
||||
@Description("DEFAULT ''")
|
||||
public String testsNames = "";//имена тестов через ; для отображения
|
||||
@@ -53,10 +65,136 @@ public class SapforTasksPackage extends nDBObject {
|
||||
}
|
||||
//---
|
||||
@Description("IGNORE")
|
||||
public DefaultMutableTreeNode root = null;
|
||||
public PackageSummary root = null;
|
||||
@Description("IGNORE")
|
||||
public DefaultMutableTreeNode comparison_root = null;
|
||||
//---
|
||||
@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, id);
|
||||
}
|
||||
public File getLoadedSign() {
|
||||
return Paths.get(Global.SapforPackagesDirectory.getAbsolutePath(), id, Constants.LOADED).toFile();
|
||||
}
|
||||
public boolean isLoaded() {
|
||||
return getLoadedSign().exists();
|
||||
}
|
||||
public void getLocalResults() {
|
||||
File json_file = new File(getLocalWorkspace(), Constants.results_json);
|
||||
results = null;
|
||||
try {
|
||||
results = (SapforTasksResults_json) Utils.jsonFromFile(json_file,
|
||||
SapforTasksResults_json.class);
|
||||
results.SortTasks();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
public void buildTree() {
|
||||
//--
|
||||
if (results == null) {
|
||||
getLocalResults();
|
||||
}
|
||||
//--
|
||||
root = new PackageSummary();
|
||||
LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> task_states =
|
||||
results.sortTasksForTree();
|
||||
//---
|
||||
for (TaskState state : task_states.keySet()) {
|
||||
//--
|
||||
StateSummary stateSummary = new StateSummary(state);
|
||||
//--
|
||||
LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>> tasksByConfigurations = task_states.get(state);
|
||||
for (String configuration_id : tasksByConfigurations.keySet()) {
|
||||
//--
|
||||
DefaultMutableTreeNode configurationNode = null;
|
||||
//--
|
||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = tasksByConfigurations.get(configuration_id);
|
||||
for (String group : groups_tasks.keySet()) {
|
||||
//--
|
||||
GroupSummary groupSummary = new GroupSummary(group);
|
||||
//--
|
||||
for (SapforTask task : groups_tasks.get(group)) {
|
||||
//--
|
||||
stateSummary.count++;
|
||||
root.count++;
|
||||
//--
|
||||
if (configurationNode == null) {
|
||||
configurationNode = new ConfigurationSummary(configuration_id, task);
|
||||
}
|
||||
//--
|
||||
groupSummary.add(task.getVersionsTree(new File(getLocalWorkspace(), configuration_id)));
|
||||
}
|
||||
if (configurationNode != null)
|
||||
configurationNode.add(groupSummary);
|
||||
}
|
||||
stateSummary.add(configurationNode);
|
||||
}
|
||||
if (stateSummary.count > 0) {
|
||||
root.add(stateSummary);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
public static DefaultMutableTreeNode buildTree_old(SapforTasksPackage package_in) {
|
||||
PackageSummary root = new PackageSummary();
|
||||
|
||||
SapforTasksResults_json results_json = getLocalResults(package_in);
|
||||
LinkedHashMap<MatchState, LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>>> sortedTasks =
|
||||
results_json.sortTasksForComparisonTree();
|
||||
//--
|
||||
for (MatchState match_state : sortedTasks.keySet()) {
|
||||
//--
|
||||
MatchesSummary matchesSummary = new MatchesSummary(match_state);
|
||||
//---
|
||||
LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> task_states = sortedTasks.get(match_state);
|
||||
//---
|
||||
for (TaskState state : task_states.keySet()) {
|
||||
//--
|
||||
StateSummary stateSummary = new StateSummary(state);
|
||||
//--
|
||||
LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>> tasksByConfigurations = task_states.get(state);
|
||||
for (String configuration_id : tasksByConfigurations.keySet()) {
|
||||
//--
|
||||
DefaultMutableTreeNode configurationNode = null;
|
||||
//--
|
||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = tasksByConfigurations.get(configuration_id);
|
||||
for (String group : groups_tasks.keySet()) {
|
||||
//--
|
||||
GroupSummary groupSummary = new GroupSummary(group);
|
||||
//--
|
||||
for (SapforTask task : groups_tasks.get(group)) {
|
||||
//--
|
||||
stateSummary.count++;
|
||||
matchesSummary.count++;
|
||||
root.count++;
|
||||
//--
|
||||
if (configurationNode == null) {
|
||||
configurationNode = new ConfigurationSummary(configuration_id, task);
|
||||
}
|
||||
//--
|
||||
groupSummary.add(task.getVersionsTree(new File(getLocalWorkspace(package_in), configuration_id)));
|
||||
}
|
||||
if (configurationNode != null)
|
||||
configurationNode.add(groupSummary);
|
||||
}
|
||||
stateSummary.add(configurationNode);
|
||||
}
|
||||
if (stateSummary.count > 0) {
|
||||
matchesSummary.add(stateSummary);
|
||||
}
|
||||
}
|
||||
//---
|
||||
if (matchesSummary.count > 0) {
|
||||
root.add(matchesSummary);
|
||||
}
|
||||
}
|
||||
return root;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
package SapforTestingSystem.SapforTasksPackage;
|
||||
import Common.Constants;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import SapforTestingSystem.Json.SapforTasksResults_json;
|
||||
import SapforTestingSystem.SapforTask.SapforTask;
|
||||
import SapforTestingSystem.SapforTasksPackage.UI.ConfigurationSummary;
|
||||
import SapforTestingSystem.SapforTasksPackage.UI.GroupSummary;
|
||||
import SapforTestingSystem.SapforTasksPackage.UI.PackageSummary;
|
||||
import SapforTestingSystem.SapforTasksPackage.UI.StateSummary;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class SapforTasksPackageInterface {
|
||||
public static File getPackageArchive(SapforTasksPackage package_in) {
|
||||
return new File(Global.SapforPackagesDirectory, package_in.id + ".zip");
|
||||
}
|
||||
public static SapforTasksResults_json getLocalResults(SapforTasksPackage package_in) {
|
||||
File json_file = new File(getLocalWorkspace(package_in), Constants.results_json);
|
||||
SapforTasksResults_json res = null;
|
||||
try {
|
||||
res = (SapforTasksResults_json) Utils.jsonFromFile(json_file,
|
||||
SapforTasksResults_json.class);
|
||||
res.SortTasks();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static File getLocalWorkspace(SapforTasksPackage package_in) {
|
||||
return new File(Global.SapforPackagesDirectory, package_in.id);
|
||||
}
|
||||
public static File getLoadedSign(SapforTasksPackage package_in) {
|
||||
return Paths.get(Global.SapforPackagesDirectory.getAbsolutePath(), package_in.id, Constants.LOADED).toFile();
|
||||
}
|
||||
public static boolean isLoaded(SapforTasksPackage package_in) {
|
||||
return getLoadedSign(package_in).exists();
|
||||
}
|
||||
//--
|
||||
public static DefaultMutableTreeNode buildTree_old(SapforTasksPackage package_in) {
|
||||
PackageSummary root = new PackageSummary();
|
||||
/*
|
||||
SapforTasksResults_json results_json = getLocalResults(package_in);
|
||||
LinkedHashMap<MatchState, LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>>> sortedTasks =
|
||||
results_json.sortTasksForComparisonTree();
|
||||
//--
|
||||
for (MatchState match_state : sortedTasks.keySet()) {
|
||||
//--
|
||||
MatchesSummary matchesSummary = new MatchesSummary(match_state);
|
||||
//---
|
||||
LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> task_states = sortedTasks.get(match_state);
|
||||
//---
|
||||
for (TaskState state : task_states.keySet()) {
|
||||
//--
|
||||
StateSummary stateSummary = new StateSummary(state);
|
||||
//--
|
||||
LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>> tasksByConfigurations = task_states.get(state);
|
||||
for (String configuration_id : tasksByConfigurations.keySet()) {
|
||||
//--
|
||||
DefaultMutableTreeNode configurationNode = null;
|
||||
//--
|
||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = tasksByConfigurations.get(configuration_id);
|
||||
for (String group : groups_tasks.keySet()) {
|
||||
//--
|
||||
GroupSummary groupSummary = new GroupSummary(group);
|
||||
//--
|
||||
for (SapforTask task : groups_tasks.get(group)) {
|
||||
//--
|
||||
stateSummary.count++;
|
||||
matchesSummary.count++;
|
||||
root.count++;
|
||||
//--
|
||||
if (configurationNode == null) {
|
||||
configurationNode = new ConfigurationSummary(configuration_id, task);
|
||||
}
|
||||
//--
|
||||
groupSummary.add(task.getVersionsTree(new File(getLocalWorkspace(package_in), configuration_id)));
|
||||
}
|
||||
if (configurationNode != null)
|
||||
configurationNode.add(groupSummary);
|
||||
}
|
||||
stateSummary.add(configurationNode);
|
||||
}
|
||||
if (stateSummary.count > 0) {
|
||||
matchesSummary.add(stateSummary);
|
||||
}
|
||||
}
|
||||
//---
|
||||
if (matchesSummary.count > 0) {
|
||||
root.add(matchesSummary);
|
||||
}
|
||||
}
|
||||
*/
|
||||
return root;
|
||||
}
|
||||
//--
|
||||
public static DefaultMutableTreeNode buildTree(SapforTasksPackage package_in) {
|
||||
//--
|
||||
if (package_in.results == null) {
|
||||
package_in.results = getLocalResults(package_in);
|
||||
}
|
||||
//--
|
||||
PackageSummary root = new PackageSummary();
|
||||
LinkedHashMap<TaskState, LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>>> task_states =
|
||||
package_in.results.sortTasksForTree();
|
||||
//---
|
||||
for (TaskState state : task_states.keySet()) {
|
||||
//--
|
||||
StateSummary stateSummary = new StateSummary(state);
|
||||
//--
|
||||
LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>> tasksByConfigurations = task_states.get(state);
|
||||
for (String configuration_id : tasksByConfigurations.keySet()) {
|
||||
//--
|
||||
DefaultMutableTreeNode configurationNode = null;
|
||||
//--
|
||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = tasksByConfigurations.get(configuration_id);
|
||||
for (String group : groups_tasks.keySet()) {
|
||||
//--
|
||||
GroupSummary groupSummary = new GroupSummary(group);
|
||||
//--
|
||||
for (SapforTask task : groups_tasks.get(group)) {
|
||||
//--
|
||||
stateSummary.count++;
|
||||
root.count++;
|
||||
//--
|
||||
if (configurationNode == null) {
|
||||
configurationNode = new ConfigurationSummary(configuration_id, task);
|
||||
}
|
||||
//--
|
||||
groupSummary.add(task.getVersionsTree(new File(getLocalWorkspace(package_in), configuration_id)));
|
||||
}
|
||||
if (configurationNode != null)
|
||||
configurationNode.add(groupSummary);
|
||||
}
|
||||
stateSummary.add(configurationNode);
|
||||
}
|
||||
if (stateSummary.count > 0) {
|
||||
root.add(stateSummary);
|
||||
}
|
||||
}
|
||||
return root;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user