Исправление недочета с spf директивами. Пустые версии пакета отображаются серым. v++

This commit is contained in:
2023-11-29 14:25:10 +03:00
parent ac3024a2d4
commit bc9c19b14c
13 changed files with 56 additions and 33 deletions

View File

@@ -0,0 +1,6 @@
package TestingSystem.SAPFOR.Json;
public enum SapforVersionState {
Empty, //версия оказалась пуста.
Normal, //версия построена
HasErrors //в журнале версии есть ошибки. то есть, не удалось построить следующую версию.
}

View File

@@ -25,7 +25,6 @@ public class SapforVersion_json implements Serializable {
public String version = "";
@Expose
public String description = "";
public boolean success = true;
//поля для отображения деревьев.
public File Home = null;
public LinkedHashMap<String, ProjectFile> files = new LinkedHashMap<>();
@@ -50,7 +49,8 @@ public class SapforVersion_json implements Serializable {
public String toString() {
return Home.getName() + " : " + Utils.Brackets(description);
}
public void init(File configurationRoot) {
public SapforVersionState init(File configurationRoot) {
SapforVersionState state = SapforVersionState.Empty;
String relativePath = Global.isWindows ? Utils.toW(version) : version;
Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile();
files = new LinkedHashMap<>();
@@ -66,11 +66,14 @@ public class SapforVersion_json implements Serializable {
}
}
}
if (!files.isEmpty())
state = SapforVersionState.Normal;
}
parse_out = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.parse_out_file).toFile());
parse_err = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.parse_err_file).toFile());
out = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.out_file).toFile());
err = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.err_file).toFile());
return state;
}
public boolean isMatch(SapforVersion_json version_json) {
if (!description.equals(version_json.description)) {

View File

@@ -20,7 +20,7 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
@Override
public String getDescription() {
return "";
// "Запуск задачи SAPFOR"; Оставляем пустое описание чтобы не засорять журнал.
// "Запуск задачи SAPFOR"; Оставляем пустое описание чтобы не засорять журнал.
}
@Override
protected boolean needsAnimation() {
@@ -29,6 +29,7 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
//--
File sapfor_drv;
SapforConfiguration_json sapforConfiguration_json;
SapforVersion_json version_json;
//-----
File root;
File parentTask;
@@ -39,6 +40,7 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
sapfor_drv = (File) args[0];
sapforConfiguration_json = (SapforConfiguration_json) args[1];
target = (SapforTask) args[2];
version_json = null;
//--->>
parentTask = Paths.get(Global.Home, String.valueOf(sapforConfiguration_json.id), target.test_description).toFile();
root = new File(Global.Home, String.valueOf(sapforConfiguration_json.id));
@@ -47,9 +49,9 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
return true;
}
protected boolean parse() throws Exception {
if (Sapfor.parse(sapfor_drv, parentTask, target.flags)){
if (Sapfor.parse(sapfor_drv, parentTask, target.flags)) {
return true;
}else {
} else {
target.state = TaskState.DoneWithErrors;
return false;
}
@@ -59,7 +61,7 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
task = new File(parentTask, "v1");
Utils.CheckAndCleanDirectory(task); //папка для преобразования.
//если версия пустая, это тоже результат тестирования. Поэтому должна учитываться в древе.
target.versions.add(new SapforVersion_json(
target.versions.add(version_json =new SapforVersion_json(
root.getAbsolutePath(),
task.getAbsolutePath(), code.getDescription()));
//---
@@ -97,7 +99,6 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
files.sort(Comparator.comparingInt(o -> Integer.parseInt(o.getName().substring(1))));
for (File file : files)
target.variants.add(
new SapforVersion_json(
root.getAbsolutePath(),
file.getAbsolutePath(), PassCode_2021.SPF_CreateParallelVariant.getDescription()));
@@ -107,7 +108,7 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
@Override
protected void body() throws Exception {
target.StartDate = new Date().getTime();
target.versions.add(new SapforVersion_json(target.test_description, ""));
target.versions.add(version_json = new SapforVersion_json(target.test_description, ""));
for (PassCode_2021 code : sapforConfiguration_json.codes) {
if (parse()) {
if (code.equals(PassCode_2021.CreateParallelVariants))

View File

@@ -4,6 +4,7 @@ import Common.Current;
import Common.Database.DBObject;
import Common.Utils.Utils;
import GlobalData.Tasks.TaskState;
import TestingSystem.SAPFOR.Json.SapforVersionState;
import TestingSystem.SAPFOR.Json.SapforVersion_json;
import TestingSystem.SAPFOR.SapforTasksPackage.UI.VersionSummary;
import Visual_DVM_2021.Passes.PassCode_2021;
@@ -75,29 +76,31 @@ public class SapforTask extends DBObject {
public SapforTask() {
}
public DefaultMutableTreeNode getVersionsTree(File configurationRoot) {
DefaultMutableTreeNode root = null;
DefaultMutableTreeNode child = null;
DefaultMutableTreeNode parent = null;
VersionSummary root = null;
VersionSummary child = null;
VersionSummary parent = null;
//--
for (SapforVersion_json version_json : versions) {
version_json.init(configurationRoot);
version_json.task = this;
//-
child = new VersionSummary(version_json);
child = new VersionSummary(version_json, version_json.init(configurationRoot));
if (parent == null) {
root = child;
parent = child;
} else {
parent.add(child);
parent = child;
if (!child.state.equals(SapforVersionState.Empty)) {
parent.add(child);
parent = child;
}
}
//-
}
if (parent != null) {
for (SapforVersion_json version_json : variants) {
version_json.init(configurationRoot);
version_json.task = this;
parent.add(new VersionSummary(version_json));
if (!child.state.equals(SapforVersionState.Empty)) {
parent.add(new VersionSummary(version_json, version_json.init(configurationRoot)));
}
}
}
//--

View File

@@ -1,20 +1,22 @@
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
import TestingSystem.SAPFOR.Json.SapforVersionState;
import TestingSystem.SAPFOR.Json.SapforVersion_json;
public class VersionSummary extends SapforPackageTreeNode{
public class VersionSummary extends SapforPackageTreeNode {
public String version_name = "";
public String version_description = "";
public VersionSummary(SapforVersion_json version_json) {
public SapforVersionState state = SapforVersionState.Empty;
public VersionSummary(SapforVersion_json version_json, SapforVersionState state_in) {
setUserObject(version_json);
version_name = version_json.Home.getName();
version_description = version_json.description;
state = state_in;
}
@Override
public String getImageKey() {
return "TestVersion";
return state.toString();
}
@Override
public String toString() {
return version_name+ " : " +version_description;
return version_name + " : " + version_description;
}
}

View File

@@ -169,7 +169,9 @@ public class SapforTasksPackageSupervisor {
//Очистка
//очистка служебных файлов.
Utils.deleteFilesByExtensions(new File(sapforTasksPackage.workspace),
"proj", "dep", "jar", "sh", "exe", "bat");
"proj", "dep", "jar"
// ,"sh", "exe", "bat"
);
}
public void Perform() throws Exception {
if (packageNeedsKill()) {