подсветка версий с ошибками в журнале

This commit is contained in:
2024-04-07 21:30:11 +03:00
parent 002867274f
commit 8b9400fb95
9 changed files with 125 additions and 66 deletions

View File

@@ -2,5 +2,6 @@ package TestingSystem.SAPFOR.Json;
import java.io.Serializable;
public enum SapforVersionState implements Serializable {
Empty, //версия оказалась пуста.
Normal //версия построена
Normal, //версия построена
HasErrors //версия построена, но в журналах есть ошибка.
}

View File

@@ -8,6 +8,7 @@ import ProjectData.Files.ProjectFile;
import ProjectData.LanguageName;
import ProjectData.Messages.Errors.MessageError;
import ProjectData.Project.db_project_info;
import Repository.Component.Sapfor.Sapfor;
import TestingSystem.SAPFOR.SapforTask.SapforTask;
import com.google.gson.annotations.Expose;
import org.apache.commons.io.FileUtils;
@@ -76,6 +77,26 @@ public class SapforVersion_json implements Serializable {
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());
//--
Vector<File> files = new Vector<>();
files.add(parse_out.file);
files.add(parse_err.file);
files.add(out.file);
files.add(err.file);
for (File file:files){
try {
if (file.exists()) {
Vector<String> lines = new Vector<>(FileUtils.readLines(file));
if (!Sapfor.checkLines(lines)) {
state = SapforVersionState.HasErrors;
return;
}
}
}
catch (Exception ex){
ex.printStackTrace();
}
}
}
public boolean isMatch(SapforVersion_json version_json) {
if (!description.equals(version_json.description)) {