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

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"> <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 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$/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/Json/SapforVersion_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforVersion_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/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.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> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />

View File

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

View File

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