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

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

3
.idea/workspace.xml generated
View File

@@ -8,8 +8,7 @@
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforTasksResults_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforTasksResults_json.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/SapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTask/SapforTask.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforVersion_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforVersion_json.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />

View File

@@ -16,7 +16,7 @@ import java.util.Vector;
public class SapforTasksResults_json {
//---
public PackageSummary root = null;
public DefaultMutableTreeNode comparison_root = null;
public PackageSummary comparison_root = null;
//---
@Expose
public long StartDate = 0;
@@ -94,7 +94,7 @@ public class SapforTasksResults_json {
//--
stateSummary.count++;
matchesSummary.count++;
root.count++;
comparison_root.count++;
//--
if (configurationNode == null) {
configurationNode = new ConfigurationSummary(configuration_id, task);
@@ -113,7 +113,7 @@ public class SapforTasksResults_json {
}
//---
if (matchesSummary.count > 0) {
root.add(matchesSummary);
comparison_root.add(matchesSummary);
}
}
}

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) {

View File

@@ -78,12 +78,16 @@ public class SapforPackagesComparisonForm {
new SapforTasksPackageTree(object.results.root,
isMaster() ? Current.SapforEtalonVersion : Current.SapforVersion
)));
treePanel.repaint();
treePanel.revalidate();
}
public void showComparisonTree() {
treePanel.add(new JScrollPane(
new SapforTasksPackageTree(object.results.comparison_root,
isMaster() ? Current.SapforEtalonVersion : Current.SapforVersion
)));
treePanel.repaint();
treePanel.revalidate();
}
//---
public void showNoTree() {
@@ -209,11 +213,11 @@ public class SapforPackagesComparisonForm {
++i;
}
//--
// package1.results.SortTasksForComparison();
// package2.results.SortTasksForComparison();
package1.results.SortTasksForComparison();
package2.results.SortTasksForComparison();
//-
// package1.results.buildComparisonTree(package1);
// package2.results.buildTree(package2);
package1.results.buildComparisonTree(package1);
package2.results.buildComparisonTree(package2);
}
@Override
protected boolean validate() {
@@ -226,8 +230,8 @@ public class SapforPackagesComparisonForm {
}
@Override
protected void showDone() throws Exception {
// showComparisonTree();
// slave.showComparisonTree();
showComparisonTree();
slave.showComparisonTree();
}
};
pass.Do();