рефакторинг сравнения
This commit is contained in:
11
.idea/workspace.xml
generated
11
.idea/workspace.xml
generated
@@ -7,9 +7,20 @@
|
|||||||
</component>
|
</component>
|
||||||
<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 afterPath="$PROJECT_DIR$/src/icons/versions/MatchNormal.png" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/src/icons/versions/NotMatchNormal.png" afterDir="false" />
|
||||||
<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/TestingSystem/SAPFOR/Json/SapforPackage_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforPackage_json.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersionMatchState.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/VersionComparisonState.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersionState.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersionState.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/MatchState.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/ComparisonState.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/SapforTaskNode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/SapforTaskNode.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/SapforVersionsTreeCellRenderer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/SapforVersionsTreeCellRenderer.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/VersionSummary.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/VersionNode.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" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforVersionsComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforVersionsComparisonForm.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
package TestingSystem.SAPFOR.Json;
|
package TestingSystem.SAPFOR.Json;
|
||||||
import GlobalData.Tasks.TaskState;
|
import GlobalData.Tasks.TaskState;
|
||||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||||
import TestingSystem.SAPFOR.SapforTask.MatchState;
|
import TestingSystem.SAPFOR.SapforTask.ComparisonState;
|
||||||
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||||
import TestingSystem.SAPFOR.SapforTasksPackage.UI.PackageComparisonSummary;
|
import TestingSystem.SAPFOR.SapforTasksPackage.UI.PackageComparisonSummary;
|
||||||
import TestingSystem.SAPFOR.SapforTasksPackage.UI.PackageSummary;
|
import TestingSystem.SAPFOR.SapforTasksPackage.UI.PackageSummary;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import javax.swing.tree.DefaultMutableTreeNode;
|
import javax.swing.tree.DefaultMutableTreeNode;
|
||||||
|
import java.io.File;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class SapforPackage_json implements Serializable {
|
public class SapforPackage_json implements Serializable {
|
||||||
@@ -77,14 +77,16 @@ public class SapforPackage_json implements Serializable {
|
|||||||
//---------
|
//---------
|
||||||
public void DropComparison() {
|
public void DropComparison() {
|
||||||
comparison_root = null;
|
comparison_root = null;
|
||||||
for (SapforTask task : tasks)
|
for (SapforTask task : tasks) {
|
||||||
task.comparisonState = MatchState.Unknown;
|
task.comparisonState = ComparisonState.Unknown;
|
||||||
|
for (SapforVersion_json version : task.versions)
|
||||||
|
version.comparisonState = VersionComparisonState.Unknown;
|
||||||
|
for (SapforVersion_json version : task.variants)
|
||||||
|
version.comparisonState = VersionComparisonState.Unknown;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void buildTree(SapforPackage package_in) {
|
public void buildTree(SapforPackage package_in) {
|
||||||
//--
|
//--
|
||||||
for (SapforTask task : tasks)
|
|
||||||
task.comparisonState = MatchState.Unknown;
|
|
||||||
//---
|
|
||||||
root = new PackageSummary();
|
root = new PackageSummary();
|
||||||
root.count = tasks.size();
|
root.count = tasks.size();
|
||||||
root.errors_count = 0;
|
root.errors_count = 0;
|
||||||
@@ -116,8 +118,25 @@ public class SapforPackage_json implements Serializable {
|
|||||||
String.valueOf(task.sapfor_configuration_id)
|
String.valueOf(task.sapfor_configuration_id)
|
||||||
).toFile());
|
).toFile());
|
||||||
comparison_root.add(taskNode);
|
comparison_root.add(taskNode);
|
||||||
if (task.comparisonState.equals(MatchState.NotMatch))
|
if (task.comparisonState.equals(ComparisonState.NotMatch))
|
||||||
comparison_root.mismatches_count++;
|
comparison_root.mismatches_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void getVersionsFiles(SapforPackage package_in) {
|
||||||
|
for (SapforTask task : tasks) {
|
||||||
|
File configurationRoot = Paths.get(
|
||||||
|
package_in.getLocalWorkspace().getAbsolutePath(),
|
||||||
|
String.valueOf(task.set_id),
|
||||||
|
String.valueOf(task.sapfor_configuration_id)
|
||||||
|
).toFile();
|
||||||
|
for (SapforVersion_json version_json : task.versions) {
|
||||||
|
version_json.task = task;
|
||||||
|
version_json.getFiles(configurationRoot);
|
||||||
|
}
|
||||||
|
for (SapforVersion_json version_json : task.variants) {
|
||||||
|
version_json.task = task;
|
||||||
|
version_json.getFiles(configurationRoot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
package TestingSystem.SAPFOR.Json;
|
|
||||||
public enum SapforVersionMatchState {
|
|
||||||
Unknown,
|
|
||||||
Match, //версия совпадает
|
|
||||||
FilesQuantityMissmatch, //количество выходных файлов в версии не совпадает
|
|
||||||
CodeMissmatch //код файлов не совпадает.
|
|
||||||
}
|
|
||||||
@@ -2,6 +2,5 @@ package TestingSystem.SAPFOR.Json;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
public enum SapforVersionState implements Serializable {
|
public enum SapforVersionState implements Serializable {
|
||||||
Empty, //версия оказалась пуста.
|
Empty, //версия оказалась пуста.
|
||||||
Normal, //версия построена
|
Normal //версия построена
|
||||||
HasErrors //в журнале версии есть ошибки. то есть, не удалось построить следующую версию.
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ public class SapforVersion_json implements Serializable {
|
|||||||
public SapforTask task = null; //родная задача. Нужна для построения дерева версий.
|
public SapforTask task = null; //родная задача. Нужна для построения дерева версий.
|
||||||
public db_project_info project = null;
|
public db_project_info project = null;
|
||||||
//--
|
//--
|
||||||
public SapforVersionState state = SapforVersionState.Empty;
|
public SapforVersionState state = null;
|
||||||
public SapforVersionMatchState matchState = SapforVersionMatchState.Unknown;
|
public VersionComparisonState comparisonState = null;
|
||||||
//--
|
//--
|
||||||
public SapforVersion_json(String version_in, String description_in) {
|
public SapforVersion_json(String version_in, String description_in) {
|
||||||
version = version_in;
|
version = version_in;
|
||||||
@@ -49,10 +49,10 @@ public class SapforVersion_json implements Serializable {
|
|||||||
description = description_in;
|
description = description_in;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SapforVersionState init(File configurationRoot) {
|
public void getFiles(File configurationRoot) {
|
||||||
//--
|
//--
|
||||||
state = SapforVersionState.Empty;
|
state = SapforVersionState.Empty;
|
||||||
matchState = SapforVersionMatchState.Unknown;
|
comparisonState = VersionComparisonState.Unknown;
|
||||||
//--
|
//--
|
||||||
String relativePath = Global.isWindows ? Utils.toW(version) : version;
|
String relativePath = Global.isWindows ? Utils.toW(version) : version;
|
||||||
Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile();
|
Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile();
|
||||||
@@ -76,7 +76,6 @@ public class SapforVersion_json implements Serializable {
|
|||||||
parse_err = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.parse_err_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());
|
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());
|
err = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.err_file).toFile());
|
||||||
return state;
|
|
||||||
}
|
}
|
||||||
public boolean isMatch(SapforVersion_json version_json) {
|
public boolean isMatch(SapforVersion_json version_json) {
|
||||||
if (!description.equals(version_json.description)) {
|
if (!description.equals(version_json.description)) {
|
||||||
@@ -292,6 +291,6 @@ public class SapforVersion_json implements Serializable {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return Home.getName() + " : " + Utils.Brackets(description);
|
return Home.getName() + " : " + Utils.Brackets(description)+" файлы: " +files.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package TestingSystem.SAPFOR.Json;
|
||||||
|
public enum VersionComparisonState {
|
||||||
|
Unknown,
|
||||||
|
Match, //версия совпадает
|
||||||
|
NotMatch
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ import Common.UI.StatusEnum;
|
|||||||
import Common.UI.Themes.VisualiserFonts;
|
import Common.UI.Themes.VisualiserFonts;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
public enum MatchState implements StatusEnum {
|
public enum ComparisonState implements StatusEnum {
|
||||||
Unknown,
|
Unknown,
|
||||||
NotMatch,
|
NotMatch,
|
||||||
Match;
|
Match;
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package TestingSystem.SAPFOR.SapforTask;
|
package TestingSystem.SAPFOR.SapforTask;
|
||||||
import Common.Constants;
|
import Common.Constants;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.DBObject;
|
||||||
import Common.UI.UI;
|
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import GlobalData.Tasks.TaskState;
|
import GlobalData.Tasks.TaskState;
|
||||||
import TestingSystem.SAPFOR.Json.SapforVersion_json;
|
import TestingSystem.SAPFOR.Json.SapforVersion_json;
|
||||||
|
import TestingSystem.SAPFOR.Json.VersionComparisonState;
|
||||||
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforPackageTreeNode;
|
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforPackageTreeNode;
|
||||||
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforTaskNode;
|
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforTaskNode;
|
||||||
import TestingSystem.SAPFOR.SapforTasksPackage.UI.VersionSummary;
|
import TestingSystem.SAPFOR.SapforTasksPackage.UI.VersionNode;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
@@ -55,7 +55,7 @@ public class SapforTask extends DBObject {
|
|||||||
@Expose
|
@Expose
|
||||||
public TaskState state = TaskState.Inactive;
|
public TaskState state = TaskState.Inactive;
|
||||||
@Description("IGNORE")
|
@Description("IGNORE")
|
||||||
public MatchState comparisonState = MatchState.Unknown; //для сравнения. в обычном режиме всегда Unknown!
|
public ComparisonState comparisonState = ComparisonState.Unknown; //для сравнения. в обычном режиме всегда Unknown!
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public String getUniqueKey() {
|
public String getUniqueKey() {
|
||||||
return group_description + "_" + test_description + "_" + sapfor_configuration_id;
|
return group_description + "_" + test_description + "_" + sapfor_configuration_id;
|
||||||
@@ -71,36 +71,6 @@ public class SapforTask extends DBObject {
|
|||||||
//-----------
|
//-----------
|
||||||
public SapforTask() {
|
public SapforTask() {
|
||||||
}
|
}
|
||||||
public DefaultMutableTreeNode getVersionsTree(File configurationRoot) {
|
|
||||||
VersionSummary root = null;
|
|
||||||
VersionSummary child = null;
|
|
||||||
VersionSummary parent = null;
|
|
||||||
//--
|
|
||||||
for (SapforVersion_json version_json : versions) {
|
|
||||||
version_json.task = this;
|
|
||||||
// System.out.println(version_json.version);
|
|
||||||
//-
|
|
||||||
version_json.init(configurationRoot);
|
|
||||||
child = new VersionSummary(version_json);
|
|
||||||
if (parent == null) {
|
|
||||||
root = child;
|
|
||||||
parent = child;
|
|
||||||
} else {
|
|
||||||
parent.add(child);
|
|
||||||
parent = child;
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
}
|
|
||||||
if (parent != null) {
|
|
||||||
for (SapforVersion_json version_json : variants) {
|
|
||||||
version_json.task = this;
|
|
||||||
version_json.init(configurationRoot);
|
|
||||||
parent.add(new VersionSummary(version_json));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
return root;
|
|
||||||
}
|
|
||||||
public void Reset() {
|
public void Reset() {
|
||||||
state = TaskState.Inactive;
|
state = TaskState.Inactive;
|
||||||
versions.clear();
|
versions.clear();
|
||||||
@@ -150,59 +120,46 @@ public class SapforTask extends DBObject {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
public void checkMatch(SapforTask task2) {
|
public void checkMatch(SapforTask task2) {
|
||||||
//todo Для каждого случая подобрать иконку (?)
|
|
||||||
|
|
||||||
if (!state.equals(task2.state)) {
|
if (!state.equals(task2.state)) {
|
||||||
System.out.println("Не совпадение состояний задачи " + getUniqueKey());
|
comparisonState = ComparisonState.NotMatch;
|
||||||
//--
|
task2.comparisonState = ComparisonState.NotMatch;
|
||||||
comparisonState = MatchState.NotMatch;
|
|
||||||
task2.comparisonState = MatchState.NotMatch;
|
|
||||||
return;
|
|
||||||
//--
|
|
||||||
}
|
}
|
||||||
if ((versions.size() != task2.versions.size()) || (variants.size() != task2.variants.size())) {
|
if ((versions.size() != task2.versions.size()) || (variants.size() != task2.variants.size())) {
|
||||||
System.out.println("Не совпадение количества версий в задаче " + getUniqueKey());
|
comparisonState = ComparisonState.NotMatch;
|
||||||
//--
|
task2.comparisonState = ComparisonState.NotMatch;
|
||||||
comparisonState = MatchState.NotMatch;
|
|
||||||
task2.comparisonState = MatchState.NotMatch;
|
|
||||||
return;
|
|
||||||
//--
|
|
||||||
}
|
}
|
||||||
LinkedHashMap<String, SapforVersion_json> versions1 = getSortedVersions();
|
LinkedHashMap<String, SapforVersion_json> versions1 = getSortedVersions();
|
||||||
LinkedHashMap<String, SapforVersion_json> versions2 = task2.getSortedVersions();
|
LinkedHashMap<String, SapforVersion_json> versions2 = task2.getSortedVersions();
|
||||||
//---
|
//---
|
||||||
for (String name1 : versions1.keySet()) {
|
for (String name1 : versions1.keySet()) {
|
||||||
if (!versions2.containsKey(name1)) {
|
System.out.println("current version="+Utils.Brackets(name1));
|
||||||
System.out.println("Не совпадение имен версий в задаче " + getUniqueKey());
|
if (versions2.containsKey(name1)) {
|
||||||
//--
|
|
||||||
comparisonState = MatchState.NotMatch;
|
|
||||||
task2.comparisonState = MatchState.NotMatch;
|
|
||||||
//--
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
System.out.println("сравнение версий.");
|
|
||||||
//--
|
|
||||||
for (String name1 : versions1.keySet()) {
|
|
||||||
System.out.println("version name=" + name1);
|
|
||||||
SapforVersion_json version1 = versions1.get(name1);
|
SapforVersion_json version1 = versions1.get(name1);
|
||||||
SapforVersion_json version2 = versions2.get(name1);
|
SapforVersion_json version2 = versions2.get(name1);
|
||||||
//---
|
//---
|
||||||
if (!version1.isMatch(version2)) {
|
if (!version1.isMatch(version2)) {
|
||||||
System.out.println("Не совпадение кода версий в задаче " + getUniqueKey());
|
comparisonState = ComparisonState.NotMatch;
|
||||||
|
task2.comparisonState = ComparisonState.NotMatch;
|
||||||
|
version1.comparisonState = VersionComparisonState.NotMatch;
|
||||||
|
version2.comparisonState = VersionComparisonState.NotMatch;
|
||||||
//-
|
//-
|
||||||
comparisonState = MatchState.NotMatch;
|
// System.out.println(version1.comparisonState);
|
||||||
task2.comparisonState = MatchState.NotMatch;
|
}else {
|
||||||
|
version1.comparisonState = VersionComparisonState.Match;
|
||||||
|
version2.comparisonState = VersionComparisonState.Match;
|
||||||
//-
|
//-
|
||||||
return;
|
// System.out.println(version1.comparisonState);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
comparisonState = ComparisonState.NotMatch;
|
||||||
|
task2.comparisonState = ComparisonState.NotMatch;
|
||||||
|
//--
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
comparisonState = MatchState.Match;
|
//--
|
||||||
task2.comparisonState = MatchState.Match;
|
if (comparisonState.equals(ComparisonState.Unknown)) {
|
||||||
if (this.id==161){
|
comparisonState = ComparisonState.Match;
|
||||||
UI.Info("!");
|
task2.comparisonState = ComparisonState.Match;
|
||||||
System.out.println(comparisonState+"/"+task2.comparisonState);
|
|
||||||
UI.Info("!!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public Date getStartDate() {
|
public Date getStartDate() {
|
||||||
@@ -228,6 +185,33 @@ public class SapforTask extends DBObject {
|
|||||||
return String.join("→", strings);
|
return String.join("→", strings);
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
|
public DefaultMutableTreeNode getVersionsTree() {
|
||||||
|
VersionNode root = null;
|
||||||
|
VersionNode child = null;
|
||||||
|
VersionNode parent = null;
|
||||||
|
//--
|
||||||
|
for (SapforVersion_json version_json : versions) {
|
||||||
|
version_json.task = this;
|
||||||
|
child = new VersionNode(version_json);
|
||||||
|
if (parent == null) {
|
||||||
|
root = child;
|
||||||
|
parent = child;
|
||||||
|
} else {
|
||||||
|
parent.add(child);
|
||||||
|
parent = child;
|
||||||
|
}
|
||||||
|
//-
|
||||||
|
}
|
||||||
|
if (parent != null) {
|
||||||
|
for (SapforVersion_json version_json : variants) {
|
||||||
|
version_json.task = this;
|
||||||
|
parent.add(new VersionNode(version_json));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//--
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
//---
|
||||||
public DefaultMutableTreeNode getNode(File configurationRoot) {
|
public DefaultMutableTreeNode getNode(File configurationRoot) {
|
||||||
SapforPackageTreeNode res = new SapforTaskNode(this);
|
SapforPackageTreeNode res = new SapforTaskNode(this);
|
||||||
//-
|
//-
|
||||||
@@ -236,8 +220,7 @@ public class SapforTask extends DBObject {
|
|||||||
//-
|
//-
|
||||||
int total_versions_count = versions.size() + variants.size();
|
int total_versions_count = versions.size() + variants.size();
|
||||||
DefaultMutableTreeNode versions_info = new DefaultMutableTreeNode("версии: " + total_versions_count);
|
DefaultMutableTreeNode versions_info = new DefaultMutableTreeNode("версии: " + total_versions_count);
|
||||||
versions_info.add(getVersionsTree(configurationRoot));
|
versions_info.add(getVersionsTree());
|
||||||
//--
|
|
||||||
res.add(flags_info);
|
res.add(flags_info);
|
||||||
res.add(passes_info);
|
res.add(passes_info);
|
||||||
res.add(versions_info);
|
res.add(versions_info);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||||
import TestingSystem.SAPFOR.SapforTask.MatchState;
|
import TestingSystem.SAPFOR.SapforTask.ComparisonState;
|
||||||
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||||
public class SapforTaskNode extends SapforPackageTreeNode {
|
public class SapforTaskNode extends SapforPackageTreeNode {
|
||||||
public SapforTaskNode(SapforTask task_in) {
|
public SapforTaskNode(SapforTask task_in) {
|
||||||
@@ -9,7 +9,7 @@ public class SapforTaskNode extends SapforPackageTreeNode {
|
|||||||
public String getImageKey() {
|
public String getImageKey() {
|
||||||
SapforTask task = (SapforTask) getUserObject();
|
SapforTask task = (SapforTask) getUserObject();
|
||||||
//обычный режим
|
//обычный режим
|
||||||
if (task.comparisonState == MatchState.Unknown) {
|
if (task.comparisonState == ComparisonState.Unknown) {
|
||||||
return task.state.toString();
|
return task.state.toString();
|
||||||
}
|
}
|
||||||
//режим сравнения.
|
//режим сравнения.
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public class SapforVersionsTreeCellRenderer extends StyledTreeCellRenderer {
|
|||||||
SapforPackageTreeNode node = (SapforPackageTreeNode) value;
|
SapforPackageTreeNode node = (SapforPackageTreeNode) value;
|
||||||
setForeground(tree.getForeground());
|
setForeground(tree.getForeground());
|
||||||
setFont(getFont().deriveFont((float) 14.0));
|
setFont(getFont().deriveFont((float) 14.0));
|
||||||
|
if (node.getIcon() != null)
|
||||||
setIcon(node.getIcon());
|
setIcon(node.getIcon());
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||||
|
import Common.UI.UI;
|
||||||
|
import Common.Utils.Utils;
|
||||||
|
import TestingSystem.SAPFOR.Json.SapforVersionState;
|
||||||
|
import TestingSystem.SAPFOR.Json.SapforVersion_json;
|
||||||
|
import TestingSystem.SAPFOR.Json.VersionComparisonState;
|
||||||
|
public class VersionNode extends SapforPackageTreeNode {
|
||||||
|
public VersionNode(SapforVersion_json version_json) {
|
||||||
|
setUserObject(version_json);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getImageKey() {
|
||||||
|
SapforVersion_json version = (SapforVersion_json) getUserObject();
|
||||||
|
String res = "";
|
||||||
|
if (version.comparisonState.equals(VersionComparisonState.Unknown)||version.state.equals(SapforVersionState.Empty)){
|
||||||
|
res = version.state.toString();
|
||||||
|
}else {
|
||||||
|
res = version.comparisonState.toString()+version.state.toString();
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
|
||||||
import TestingSystem.SAPFOR.Json.SapforVersionState;
|
|
||||||
import TestingSystem.SAPFOR.Json.SapforVersion_json;
|
|
||||||
public class VersionSummary extends SapforPackageTreeNode {
|
|
||||||
public VersionSummary(SapforVersion_json version_json) {
|
|
||||||
setUserObject(version_json);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getImageKey() {
|
|
||||||
return ((SapforVersion_json)getUserObject()).state.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,6 +4,7 @@ import Common.UI.Label.ShortLabel;
|
|||||||
import Common.UI.Menus_2023.VisualiserMenuBar;
|
import Common.UI.Menus_2023.VisualiserMenuBar;
|
||||||
import Common.UI.UI;
|
import Common.UI.UI;
|
||||||
import Common.Utils.TextLog;
|
import Common.Utils.TextLog;
|
||||||
|
import TestingSystem.SAPFOR.Json.SapforVersion_json;
|
||||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||||
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||||
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforTasksPackageTree;
|
import TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforTasksPackageTree;
|
||||||
@@ -115,14 +116,14 @@ public class SapforPackagesComparisonForm {
|
|||||||
if (object.package_json == null) {
|
if (object.package_json == null) {
|
||||||
try {
|
try {
|
||||||
object.readJson();
|
object.readJson();
|
||||||
|
object.package_json.getVersionsFiles(object);
|
||||||
object.package_json.buildTree(object);
|
object.package_json.buildTree(object);
|
||||||
//---
|
//---
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
object.package_json.DropComparison();
|
|
||||||
}
|
}
|
||||||
|
object.package_json.DropComparison();
|
||||||
//--
|
//--
|
||||||
showCommonTree();
|
showCommonTree();
|
||||||
}
|
}
|
||||||
@@ -235,8 +236,16 @@ public class SapforPackagesComparisonForm {
|
|||||||
task1.checkMatch(task2);
|
task1.checkMatch(task2);
|
||||||
//--
|
//--
|
||||||
++i;
|
++i;
|
||||||
//---
|
|
||||||
}
|
}
|
||||||
|
//--
|
||||||
|
for (SapforTask task1 : package1.package_json.tasks) {
|
||||||
|
SapforTask task2 = package2.package_json.getTaskByKey(task1.getUniqueKey());
|
||||||
|
//---
|
||||||
|
for (SapforVersion_json version: task1.versions){
|
||||||
|
System.out.println(version+":"+version.comparisonState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//---
|
||||||
package1.package_json.buildComparisonTree(package1);
|
package1.package_json.buildComparisonTree(package1);
|
||||||
package2.package_json.buildComparisonTree(package2);
|
package2.package_json.buildComparisonTree(package2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public class SapforVersionsComparisonForm extends ComparisonForm<SapforVersion_j
|
|||||||
@Override
|
@Override
|
||||||
protected void showObject() {
|
protected void showObject() {
|
||||||
lObjectName.setText(object.toString());
|
lObjectName.setText(object.toString());
|
||||||
lObjectName.setToolTipText(object.toString());
|
lObjectName.setToolTipText(object.Home.getName() + " : " + Utils.Brackets(object.description));
|
||||||
cbFile.removeAllItems();
|
cbFile.removeAllItems();
|
||||||
for (ProjectFile file : object.files.values())
|
for (ProjectFile file : object.files.values())
|
||||||
cbFile.addItem(file);
|
cbFile.addItem(file);
|
||||||
|
|||||||
BIN
src/icons/versions/MatchNormal.png
Normal file
BIN
src/icons/versions/MatchNormal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/icons/versions/NotMatchNormal.png
Normal file
BIN
src/icons/versions/NotMatchNormal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in New Issue
Block a user