отображение совпадений и различий.

This commit is contained in:
2023-11-09 19:20:51 +03:00
parent 93808bfa7b
commit 93278dc925
4 changed files with 48 additions and 28 deletions

View File

@@ -2,7 +2,6 @@ package SapforTestingSystem.Json;
import Common.Constants;
import Common.Global;
import Common.Utils.Utils;
import ProjectData.Files.FileState;
import ProjectData.Files.FileType;
import ProjectData.Files.ProjectFile;
import com.google.gson.annotations.Expose;
@@ -13,7 +12,6 @@ import java.io.Serializable;
import java.nio.charset.Charset;
import java.nio.file.Paths;
import java.util.LinkedHashMap;
import java.util.Vector;
public class SapforVersion_json implements Serializable {
@Expose
public String version = "";
@@ -23,7 +21,12 @@ public class SapforVersion_json implements Serializable {
//поля для отображения деревьев.
public File Home = null;
public LinkedHashMap<String, ProjectFile> files = new LinkedHashMap<>();
//-
//--
public String parse_out = "";
public String parse_err = "";
public String out = "";
public String err = "";
//--
public SapforVersion_json(String version_in, String description_in) {
version = version_in;
description = description_in;
@@ -46,27 +49,41 @@ public class SapforVersion_json implements Serializable {
for (File file : files_) {
if (file.isFile()) {
ProjectFile projectFile = new ProjectFile(file);
if (!projectFile.fileType.equals(FileType.forbidden) &&
!projectFile.state.equals(FileState.Excluded)
if (!projectFile.fileType.equals(FileType.forbidden)
) {
files.put(projectFile.file.getName(), projectFile);
}
}
}
}
//теперь файлы вывода.
Vector<File> out_files = new Vector<>();
out_files.add(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.parse_out_file).toFile());
out_files.add(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.parse_err_file).toFile());
out_files.add(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.out_file).toFile());
out_files.add(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.err_file).toFile());
File parse_out_file = Paths.get(Home.getAbsolutePath(), Constants.data, Constants.parse_out_file).toFile();
File parse_err_file = Paths.get(Home.getAbsolutePath(), Constants.data, Constants.parse_err_file).toFile();
File out_file = Paths.get(Home.getAbsolutePath(), Constants.data, Constants.out_file).toFile();
File err_file = Paths.get(Home.getAbsolutePath(), Constants.data, Constants.err_file).toFile();
//--
for (File file : out_files) {
if (file.exists()) {
// System.out.println(file.getAbsolutePath());
ProjectFile projectFile = new ProjectFile(file);
files.put(projectFile.file.getName(), projectFile);
}
try {
if (parse_out_file.exists())
parse_out = FileUtils.readFileToString(parse_out_file);
} catch (Exception ex) {
ex.printStackTrace();
}
try {
if (parse_err_file.exists())
parse_err = FileUtils.readFileToString(parse_err_file);
} catch (Exception ex) {
ex.printStackTrace();
}
try {
if (out_file.exists())
out = FileUtils.readFileToString(out_file);
} catch (Exception ex) {
ex.printStackTrace();
}
try {
if (err_file.exists())
err = FileUtils.readFileToString(err_file);
} catch (Exception ex) {
ex.printStackTrace();
}
}
public boolean isMatch(SapforVersion_json version_json) {