промежуточный. немного изменил отображение задач сапфора. сравнение в процессе
This commit is contained in:
11
.idea/workspace.xml
generated
11
.idea/workspace.xml
generated
@@ -7,10 +7,15 @@
|
|||||||
</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/TestingSystem/SAPFOR/Json/SapforVersionMatchState.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$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Repository/Server/ServerCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Server/ServerCode.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/PackageSummary.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/PackageSummary.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/SapforPackageTreeNode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/SapforPackageTreeNode.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/InstallServerSapfor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/InstallServerSapfor.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/InstallServerSapfor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/InstallServerSapfor.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
@@ -33,8 +38,8 @@
|
|||||||
<list>
|
<list>
|
||||||
<option value="FxmlFile" />
|
<option value="FxmlFile" />
|
||||||
<option value="Interface" />
|
<option value="Interface" />
|
||||||
<option value="Enum" />
|
|
||||||
<option value="Class" />
|
<option value="Class" />
|
||||||
|
<option value="Enum" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class Visualiser extends Component {
|
|||||||
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
||||||
@Override
|
@Override
|
||||||
public void GetVersionInfo() {
|
public void GetVersionInfo() {
|
||||||
version = 1067;
|
version = 1068;
|
||||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||||
date_text = df.format(getClassBuildTime());
|
date_text = df.format(getClassBuildTime());
|
||||||
|
|||||||
@@ -29,13 +29,10 @@ import Visual_DVM_2021.Passes.Pass_2021;
|
|||||||
import javafx.util.Pair;
|
import javafx.util.Pair;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.Timer;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Vector;
|
|
||||||
public class TestingServer extends RepositoryServer<TestsDatabase> {
|
public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||||
/*
|
/*
|
||||||
@Override
|
@Override
|
||||||
@@ -495,24 +492,56 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
File repoSapforHome = Paths.get(repo.getAbsolutePath(), Constants.SAPFOR_REPOSITORY_BIN ).toFile();
|
File repoSapforHome = Paths.get(repo.getAbsolutePath(), Constants.SAPFOR_REPOSITORY_BIN ).toFile();
|
||||||
File repo_bin = new File(repoSapforHome, "Sapfor_F");
|
File repo_bin = new File(repoSapforHome, "Sapfor_F");
|
||||||
//--
|
//--
|
||||||
|
System.out.println("Синхронизация ветви DVM...");
|
||||||
Utils.startScript(repo, repo, "dvm_checkout",
|
Utils.startScript(repo, repo, "dvm_checkout",
|
||||||
"svn checkout " +
|
"svn checkout " +
|
||||||
Constants.REPOSITORY_AUTHENTICATION +
|
Constants.REPOSITORY_AUTHENTICATION +
|
||||||
" " + Constants.DVM_REPOSITORY + " 1>dvm_out.txt 2>dvm_err.txt\n").waitFor();
|
" " + Constants.DVM_REPOSITORY + " 1>dvm_out.txt 2>dvm_err.txt\n").waitFor();
|
||||||
|
System.out.println("Синхронизация ветви SAPFOR...");
|
||||||
Utils.startScript(repo, repo, "spf_checkout",
|
Utils.startScript(repo, repo, "spf_checkout",
|
||||||
"svn checkout " +
|
"svn checkout " +
|
||||||
Constants.REPOSITORY_AUTHENTICATION +
|
Constants.REPOSITORY_AUTHENTICATION +
|
||||||
" " + Constants.SAPFOR_REPOSITORY + " 1>spf_out.txt 2>spf_err.txt\n").waitFor();
|
" " + Constants.SAPFOR_REPOSITORY + " 1>spf_out.txt 2>spf_err.txt\n").waitFor();
|
||||||
//--
|
//--
|
||||||
|
|
||||||
if (repo_bin.exists()){
|
if (repo_bin.exists())
|
||||||
FileUtils.forceDelete(repo_bin);
|
FileUtils.forceDelete(repo_bin);
|
||||||
}
|
|
||||||
//--
|
//--
|
||||||
|
System.out.println("Сборка SAPFOR...");
|
||||||
Utils.startScript(repoSapforHome, repoSapforHome, "build_sapfor",
|
Utils.startScript(repoSapforHome, repoSapforHome, "build_sapfor",
|
||||||
"cmake ../ 1>out.txt 2>err.txt\nmake -j 14 1>>out.txt 2>>err.txt\n").waitFor();
|
"cmake ../ 1>out.txt 2>err.txt\nmake -j 14 1>>out.txt 2>>err.txt\n").waitFor();
|
||||||
//--
|
//--
|
||||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
System.out.println("DONE");
|
||||||
|
File repoSapfor = new File(repoSapforHome, "Sapfor_F");
|
||||||
|
System.out.println("Result file is "+Utils.Brackets(repoSapfor.getAbsolutePath()));
|
||||||
|
if (repoSapfor.exists()) {
|
||||||
|
System.out.println("assembly found!");
|
||||||
|
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||||
|
File sapforsDirectory = new File(testingSystemHome, "Sapfors");
|
||||||
|
//создать папку. Для того чтобы скопировать из репозитория.
|
||||||
|
File sapforHome = new File(sapforsDirectory, Utils.getDateName("sapfor"));
|
||||||
|
sapforHome.mkdir();
|
||||||
|
File sapforBin = new File(sapforHome, "Sapfor_F");
|
||||||
|
FileUtils.copyFile(repo_bin, sapforBin);
|
||||||
|
sapforBin.setExecutable(true, false);
|
||||||
|
// //-->>>
|
||||||
|
ServerSapfor serverSapfor = new ServerSapfor();
|
||||||
|
serverSapfor.home_path = sapforHome.getAbsolutePath();
|
||||||
|
serverSapfor.call_command = sapforBin.getAbsolutePath();
|
||||||
|
serverSapfor.languageName = LanguageName.fortran;
|
||||||
|
serverSapfor.buildDate = new Date().getTime();
|
||||||
|
response.object = serverSapfor;
|
||||||
|
File version =new File(sapforHome, "version.txt");
|
||||||
|
System.out.println("Запрос версии..");
|
||||||
|
Utils.startScript(sapforHome, sapforHome, "get_version",
|
||||||
|
serverSapfor.getVersionCommand()+" 1>"+Utils.DQuotes(version.getAbsolutePath())).waitFor();
|
||||||
|
if (version.exists()){
|
||||||
|
System.out.println("version.txt found");
|
||||||
|
String raw = FileUtils.readFileToString(version);
|
||||||
|
System.out.println(Utils.Brackets(raw));
|
||||||
|
String[] data = raw.split(" ");
|
||||||
|
if (data.length >= 4) serverSapfor.version = data[3].replace(",", "");
|
||||||
|
}
|
||||||
|
}else throw new RepositoryRefuseException("Не удалось собрать SAPFOR");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
package TestingSystem.SAPFOR.Json;
|
package TestingSystem.SAPFOR.Json;
|
||||||
import Common.UI.UI;
|
|
||||||
import GlobalData.Tasks.TaskState;
|
import GlobalData.Tasks.TaskState;
|
||||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||||
import TestingSystem.SAPFOR.SapforTask.MatchState;
|
import TestingSystem.SAPFOR.SapforTask.MatchState;
|
||||||
@@ -34,14 +33,16 @@ public class SapforPackage_json implements Serializable {
|
|||||||
//-
|
//-
|
||||||
public PackageSummary root = null;
|
public PackageSummary root = null;
|
||||||
public PackageSummary comparison_root = null;
|
public PackageSummary comparison_root = null;
|
||||||
|
//--
|
||||||
public LinkedHashMap<String, SapforTask> allTasks = new LinkedHashMap<>();
|
public LinkedHashMap<String, SapforTask> allTasks = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<TaskState, LinkedHashMap<Integer, LinkedHashMap<String, Vector<SapforTask>>>> sortedTasks = new LinkedHashMap<>();
|
public LinkedHashMap<TaskState, Vector<SapforTask>> sortedTasks = new LinkedHashMap<>();
|
||||||
|
// public LinkedHashMap<TaskState, LinkedHashMap<Integer, LinkedHashMap<String, Vector<SapforTask>>>> sortedTasks = new LinkedHashMap<>();
|
||||||
//-- задачи, отсортированные для сравнения.
|
//-- задачи, отсортированные для сравнения.
|
||||||
public LinkedHashMap<MatchState, LinkedHashMap<TaskState, LinkedHashMap<Integer, LinkedHashMap<String, Vector<SapforTask>>>>> comparisonSortedTasks = new LinkedHashMap<>();
|
public LinkedHashMap<MatchState, LinkedHashMap<TaskState, LinkedHashMap<Integer, LinkedHashMap<String, Vector<SapforTask>>>>> comparisonSortedTasks = new LinkedHashMap<>();
|
||||||
//----
|
//----
|
||||||
//---------
|
//---------
|
||||||
public void DropComparison() {
|
public void DropComparison() {
|
||||||
// UI.Info("DROP COMPARISON");
|
// UI.Info("DROP COMPARISON");
|
||||||
comparison_root = null;
|
comparison_root = null;
|
||||||
comparisonSortedTasks.clear();
|
comparisonSortedTasks.clear();
|
||||||
for (SapforTask task : allTasks.values())
|
for (SapforTask task : allTasks.values())
|
||||||
@@ -49,49 +50,22 @@ public class SapforPackage_json implements Serializable {
|
|||||||
}
|
}
|
||||||
public void SortTasks() {
|
public void SortTasks() {
|
||||||
sortedTasks.clear();
|
sortedTasks.clear();
|
||||||
//--
|
|
||||||
for (TaskState state : TaskState.values()) {
|
for (TaskState state : TaskState.values()) {
|
||||||
LinkedHashMap<Integer, LinkedHashMap<String, Vector<SapforTask>>> configuration_tasks = new LinkedHashMap<>();
|
Vector<SapforTask> stateTasks = new Vector<>();
|
||||||
sortedTasks.put(state, configuration_tasks);
|
|
||||||
//--
|
|
||||||
for (SapforTask task : tasks) {
|
for (SapforTask task : tasks) {
|
||||||
if (task.state.equals(state)) {
|
if (task.state.equals(state))
|
||||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = null;
|
stateTasks.add(task);
|
||||||
if (configuration_tasks.containsKey(task.sapfor_configuration_id)) {
|
|
||||||
groups_tasks = configuration_tasks.get(task.sapfor_configuration_id);
|
|
||||||
} else {
|
|
||||||
groups_tasks = new LinkedHashMap<>();
|
|
||||||
configuration_tasks.put(task.sapfor_configuration_id, groups_tasks);
|
|
||||||
}
|
|
||||||
Vector<SapforTask> tasks_ = null;
|
|
||||||
if (groups_tasks.containsKey(task.group_description)) {
|
|
||||||
tasks_ = groups_tasks.get(task.group_description);
|
|
||||||
} else {
|
|
||||||
tasks_ = new Vector<>();
|
|
||||||
groups_tasks.put(task.group_description, tasks_);
|
|
||||||
}
|
|
||||||
tasks_.add(task);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
for (TaskState state : TaskState.values()) {
|
|
||||||
LinkedHashMap<Integer, LinkedHashMap<String, Vector<SapforTask>>> configuration_tasks = sortedTasks.get(state);
|
|
||||||
for (int configuration_id : configuration_tasks.keySet()) {
|
|
||||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = configuration_tasks.get(configuration_id);
|
|
||||||
for (String group : groups_tasks.keySet()) {
|
|
||||||
Vector<SapforTask> tasks_ = groups_tasks.get(group);
|
|
||||||
tasks_.sort(Comparator.comparing(SapforTask::getUniqueKey));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (!stateTasks.isEmpty())
|
||||||
|
sortedTasks.put(state, stateTasks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SortTasksForComparison() {
|
public void SortTasksForComparison() {
|
||||||
comparisonSortedTasks.clear();
|
comparisonSortedTasks.clear();
|
||||||
//раскидать задачи по состояниям, конфигам, группам
|
//раскидать задачи по состояниям, конфигам, группам
|
||||||
for (MatchState matchState : MatchState.values()) {
|
for (MatchState matchState : MatchState.values()) {
|
||||||
System.out.println("match_state="+matchState.toString());
|
System.out.println("match_state=" + matchState.toString());
|
||||||
LinkedHashMap<TaskState, LinkedHashMap<Integer, LinkedHashMap<String, Vector<SapforTask>>>> state_tasks = new LinkedHashMap<>();
|
LinkedHashMap<TaskState, LinkedHashMap<Integer, LinkedHashMap<String, Vector<SapforTask>>>> state_tasks = new LinkedHashMap<>();
|
||||||
comparisonSortedTasks.put(matchState, state_tasks);
|
comparisonSortedTasks.put(matchState, state_tasks);
|
||||||
//--
|
//--
|
||||||
@@ -100,25 +74,25 @@ public class SapforPackage_json implements Serializable {
|
|||||||
state_tasks.put(state, configuration_tasks);
|
state_tasks.put(state, configuration_tasks);
|
||||||
//--
|
//--
|
||||||
for (SapforTask task : tasks) {
|
for (SapforTask task : tasks) {
|
||||||
// if (matchState.equals(MatchState.Unknown)) {
|
// if (matchState.equals(MatchState.Unknown)) {
|
||||||
if (task.match.equals(matchState) && task.state.equals(state)) {
|
if (task.match.equals(matchState) && task.state.equals(state)) {
|
||||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = null;
|
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = null;
|
||||||
if (configuration_tasks.containsKey(task.sapfor_configuration_id)) {
|
if (configuration_tasks.containsKey(task.sapfor_configuration_id)) {
|
||||||
groups_tasks = configuration_tasks.get(task.sapfor_configuration_id);
|
groups_tasks = configuration_tasks.get(task.sapfor_configuration_id);
|
||||||
} else {
|
} else {
|
||||||
groups_tasks = new LinkedHashMap<>();
|
groups_tasks = new LinkedHashMap<>();
|
||||||
configuration_tasks.put(task.sapfor_configuration_id, groups_tasks);
|
configuration_tasks.put(task.sapfor_configuration_id, groups_tasks);
|
||||||
}
|
|
||||||
Vector<SapforTask> tasks = null;
|
|
||||||
if (groups_tasks.containsKey(task.group_description)) {
|
|
||||||
tasks = groups_tasks.get(task.group_description);
|
|
||||||
} else {
|
|
||||||
tasks = new Vector<>();
|
|
||||||
groups_tasks.put(task.group_description, tasks);
|
|
||||||
}
|
|
||||||
tasks.add(task);
|
|
||||||
}
|
}
|
||||||
// }
|
Vector<SapforTask> tasks = null;
|
||||||
|
if (groups_tasks.containsKey(task.group_description)) {
|
||||||
|
tasks = groups_tasks.get(task.group_description);
|
||||||
|
} else {
|
||||||
|
tasks = new Vector<>();
|
||||||
|
groups_tasks.put(task.group_description, tasks);
|
||||||
|
}
|
||||||
|
tasks.add(task);
|
||||||
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
@@ -138,49 +112,6 @@ public class SapforPackage_json implements Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//---------------------------------------------------->>
|
|
||||||
public void buildTree(SapforPackage package_in) {
|
|
||||||
root = new PackageSummary();
|
|
||||||
//---
|
|
||||||
for (TaskState state : sortedTasks.keySet()) {
|
|
||||||
//--
|
|
||||||
StateSummary stateSummary = new StateSummary(state);
|
|
||||||
//--
|
|
||||||
LinkedHashMap<Integer, LinkedHashMap<String, Vector<SapforTask>>> tasksByConfigurations = sortedTasks.get(state);
|
|
||||||
for (int 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(
|
|
||||||
Paths.get(package_in.getLocalWorkspace().getAbsolutePath(),
|
|
||||||
String.valueOf(task.set_id),
|
|
||||||
String.valueOf(configuration_id)).toFile())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (configurationNode != null)
|
|
||||||
configurationNode.add(groupSummary);
|
|
||||||
}
|
|
||||||
stateSummary.add(configurationNode);
|
|
||||||
}
|
|
||||||
if (stateSummary.count > 0) {
|
|
||||||
root.add(stateSummary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void buildComparisonTree(SapforPackage package_in) {
|
public void buildComparisonTree(SapforPackage package_in) {
|
||||||
comparison_root = new PackageSummary();
|
comparison_root = new PackageSummary();
|
||||||
for (MatchState match_state : comparisonSortedTasks.keySet()) {
|
for (MatchState match_state : comparisonSortedTasks.keySet()) {
|
||||||
@@ -234,4 +165,29 @@ public class SapforPackage_json implements Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//--
|
||||||
|
// public
|
||||||
|
public void buildTree(SapforPackage package_in) {
|
||||||
|
root = new PackageSummary();
|
||||||
|
root.count = package_in.package_json.allTasks.size();
|
||||||
|
//--
|
||||||
|
for (TaskState state : sortedTasks.keySet()) {
|
||||||
|
StateSummary stateSummary = new StateSummary(state);
|
||||||
|
Vector<SapforTask> tasks = sortedTasks.get(state);
|
||||||
|
//-
|
||||||
|
if (state.equals(TaskState.DoneWithErrors))
|
||||||
|
root.errors_count += tasks.size();
|
||||||
|
//-
|
||||||
|
for (SapforTask task : tasks) {
|
||||||
|
DefaultMutableTreeNode taskNode = task.getNode(Paths.get(
|
||||||
|
package_in.getLocalWorkspace().getAbsolutePath(),
|
||||||
|
String.valueOf(task.set_id),
|
||||||
|
String.valueOf(task.sapfor_configuration_id)
|
||||||
|
).toFile());
|
||||||
|
stateSummary.add(taskNode);
|
||||||
|
stateSummary.count++;
|
||||||
|
}
|
||||||
|
root.add(stateSummary);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package TestingSystem.SAPFOR.Json;
|
||||||
|
public enum SapforVersionMatchState {
|
||||||
|
Unknown,
|
||||||
|
Match, //версия совпадает
|
||||||
|
FilesQuantityMissmatch, //количество выходных файлов в версии не совпадает
|
||||||
|
CodeMissmatch //код файлов не совпадает.
|
||||||
|
}
|
||||||
@@ -36,6 +36,7 @@ public class SapforVersion_json implements Serializable {
|
|||||||
//--
|
//--
|
||||||
public SapforTask task = null; //родная задача. Нужна для построения дерева версий.
|
public SapforTask task = null; //родная задача. Нужна для построения дерева версий.
|
||||||
public db_project_info project = null;
|
public db_project_info project = null;
|
||||||
|
public SapforVersionMatchState matchState = SapforVersionMatchState.Unknown;
|
||||||
//--
|
//--
|
||||||
public SapforVersion_json(String version_in, String description_in) {
|
public SapforVersion_json(String version_in, String description_in) {
|
||||||
version = version_in;
|
version = version_in;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package TestingSystem.SAPFOR.SapforTask;
|
package TestingSystem.SAPFOR.SapforTask;
|
||||||
import Common.Constants;
|
import Common.Constants;
|
||||||
import Common.Current;
|
|
||||||
import Common.Database.DBObject;
|
import Common.Database.DBObject;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import GlobalData.Tasks.TaskState;
|
import GlobalData.Tasks.TaskState;
|
||||||
@@ -58,7 +57,7 @@ public class SapforTask extends DBObject {
|
|||||||
// MatchState.Unknown;
|
// MatchState.Unknown;
|
||||||
//-----------
|
//-----------
|
||||||
public String getUniqueKey() {
|
public String getUniqueKey() {
|
||||||
return sapfor_configuration_id + "_" + group_description + "_" + test_description;
|
return group_description + "_" + test_description + "_" +sapfor_configuration_id;
|
||||||
}
|
}
|
||||||
public String getSummary() {
|
public String getSummary() {
|
||||||
Vector<String> lines = new Vector<>();
|
Vector<String> lines = new Vector<>();
|
||||||
@@ -85,19 +84,19 @@ public class SapforTask extends DBObject {
|
|||||||
root = child;
|
root = child;
|
||||||
parent = child;
|
parent = child;
|
||||||
} else {
|
} else {
|
||||||
if (!child.state.equals(SapforVersionState.Empty)) {
|
// if (!child.state.equals(SapforVersionState.Empty)) {
|
||||||
parent.add(child);
|
parent.add(child);
|
||||||
parent = child;
|
parent = child;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
//-
|
//-
|
||||||
}
|
}
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
for (SapforVersion_json version_json : variants) {
|
for (SapforVersion_json version_json : variants) {
|
||||||
version_json.task = this;
|
version_json.task = this;
|
||||||
if (!child.state.equals(SapforVersionState.Empty)) {
|
// if (!child.state.equals(SapforVersionState.Empty)) {
|
||||||
parent.add(new VersionSummary(version_json, version_json.init(configurationRoot)));
|
parent.add(new VersionSummary(version_json, version_json.init(configurationRoot)));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
@@ -196,4 +195,35 @@ public class SapforTask extends DBObject {
|
|||||||
public Date getChangeDate() {
|
public Date getChangeDate() {
|
||||||
return new Date(ChangeDate);
|
return new Date(ChangeDate);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return
|
||||||
|
"группа "+Utils.Brackets(group_description)+" тест "+Utils.Brackets(test_description)+" конфигурация "+Utils.Brackets(sapfor_configuration_id);
|
||||||
|
// getUniqueKey();
|
||||||
|
}
|
||||||
|
public String getPassesInfo(){
|
||||||
|
String res = "";
|
||||||
|
String [] data = codes.split(" ");
|
||||||
|
Vector<String> strings = new Vector<>();
|
||||||
|
for (String code_s: data){
|
||||||
|
PassCode_2021 code = PassCode_2021.valueOf(code_s);
|
||||||
|
strings.add(Utils.Brackets(code.getDescription()));
|
||||||
|
}
|
||||||
|
return String.join("→", strings);
|
||||||
|
}
|
||||||
|
//---
|
||||||
|
public DefaultMutableTreeNode getNode(File configurationRoot) {
|
||||||
|
DefaultMutableTreeNode res = new DefaultMutableTreeNode(this);
|
||||||
|
DefaultMutableTreeNode flags_info = new DefaultMutableTreeNode("флаги: "+this.flags);
|
||||||
|
DefaultMutableTreeNode passes_info = new DefaultMutableTreeNode("проходы: "+getPassesInfo());
|
||||||
|
//-
|
||||||
|
int total_versions_count = versions.size()+variants.size();
|
||||||
|
DefaultMutableTreeNode versions_info = new DefaultMutableTreeNode("версии: "+total_versions_count);
|
||||||
|
versions_info.add(getVersionsTree(configurationRoot));
|
||||||
|
//--
|
||||||
|
res.add(flags_info);
|
||||||
|
res.add(passes_info);
|
||||||
|
res.add(versions_info);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,16 +2,15 @@ package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
|||||||
import Common.UI.UI;
|
import Common.UI.UI;
|
||||||
public class PackageSummary extends SapforPackageTreeNode {
|
public class PackageSummary extends SapforPackageTreeNode {
|
||||||
public int count = 0;
|
public int count = 0;
|
||||||
|
public int errors_count=0;
|
||||||
@Override
|
@Override
|
||||||
public String getImageKey() {
|
public String getImageKey() {
|
||||||
// System.out.println("PACKAGE_SUMMARY "+ this.count);
|
|
||||||
return "UnknownStateSummary";
|
return "UnknownStateSummary";
|
||||||
// return null;
|
|
||||||
}
|
}
|
||||||
public PackageSummary() {
|
public PackageSummary() {
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "всего задач : " + count;
|
return "всего задач : " + count+", с ошибками : "+errors_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,8 @@ import javax.swing.tree.DefaultMutableTreeNode;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
public abstract class SapforPackageTreeNode extends DefaultMutableTreeNode {
|
public abstract class SapforPackageTreeNode extends DefaultMutableTreeNode {
|
||||||
public ImageIcon getIcon() {
|
public ImageIcon getIcon() {
|
||||||
// System.out.println(getImageKey());
|
|
||||||
ImageIcon res = new ImageIcon(Objects.requireNonNull(getClass().getResource("/icons/versions/" + getImageKey() + ".png")));
|
ImageIcon res = new ImageIcon(Objects.requireNonNull(getClass().getResource("/icons/versions/" + getImageKey() + ".png")));
|
||||||
// System.out.println(res);
|
|
||||||
return (getImageKey() != null) ? res : null;
|
return (getImageKey() != null) ? res : null;
|
||||||
}
|
}
|
||||||
public abstract String getImageKey();
|
public abstract String getImageKey();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,9 +95,51 @@ public class InstallServerSapfor extends ConnectionPass<Object> {
|
|||||||
//---
|
//---
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
public class InstallServerSapfor extends TestingSystemPass{
|
||||||
|
boolean result;
|
||||||
|
ServerSapfor serverSapfor;
|
||||||
|
String version_text;
|
||||||
|
//--
|
||||||
|
@Override
|
||||||
|
protected boolean canStart(Object... args) {
|
||||||
|
result = false;
|
||||||
|
version_text = "";
|
||||||
|
serverSapfor = null;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//--
|
||||||
|
@Override
|
||||||
|
public String getIconPath() {
|
||||||
|
return "/icons/DownloadAll.png";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getButtonText() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected boolean needsAnimation() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected int getTimeout() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void ServerAction() throws Exception {
|
||||||
|
Command(new ServerExchangeUnit_2021(ServerCode.InstallServerSapfor));
|
||||||
|
if (response.object!=null){
|
||||||
|
result = true;
|
||||||
|
serverSapfor = (ServerSapfor) response.object;
|
||||||
|
}
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void performFinish() throws Exception {
|
protected void performFinish() throws Exception {
|
||||||
super.performFinish();
|
super.performFinish();
|
||||||
|
|
||||||
new TestingSystemPass() {
|
new TestingSystemPass() {
|
||||||
@Override
|
@Override
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
@@ -128,28 +170,3 @@ public class InstallServerSapfor extends ConnectionPass<Object> {
|
|||||||
passes.get(PassCode_2021.PublishServerSapfor).Do(serverSapfor);
|
passes.get(PassCode_2021.PublishServerSapfor).Do(serverSapfor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
|
||||||
public class InstallServerSapfor extends TestingSystemPass{
|
|
||||||
@Override
|
|
||||||
public String getIconPath() {
|
|
||||||
return "/icons/DownloadAll.png";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getButtonText() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected boolean needsAnimation() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected int getTimeout() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void ServerAction() throws Exception {
|
|
||||||
Command(new ServerExchangeUnit_2021(ServerCode.InstallServerSapfor));
|
|
||||||
System.out.println(response.object);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user