no message
This commit is contained in:
1
.idea/workspace.xml
generated
1
.idea/workspace.xml
generated
@@ -10,7 +10,6 @@
|
|||||||
<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/SapforTask/SapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.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/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" />
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import com.google.gson.annotations.Expose;
|
|||||||
import javax.swing.tree.DefaultMutableTreeNode;
|
import javax.swing.tree.DefaultMutableTreeNode;
|
||||||
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.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 {
|
||||||
@@ -30,6 +29,20 @@ public class SapforPackage_json implements Serializable {
|
|||||||
//--
|
//--
|
||||||
@Expose
|
@Expose
|
||||||
public List<SapforTask> tasks = new Vector<>();
|
public List<SapforTask> tasks = new Vector<>();
|
||||||
|
public boolean containsKey(String key) {
|
||||||
|
for (SapforTask task : tasks) {
|
||||||
|
if (task.getUniqueKey().equals(key))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public SapforTask getTaskByKey(String key) {
|
||||||
|
for (SapforTask task : tasks) {
|
||||||
|
if (task.getUniqueKey().equals(key))
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
//-
|
//-
|
||||||
public PackageSummary root = null;
|
public PackageSummary root = null;
|
||||||
public PackageComparisonSummary comparison_root = null;
|
public PackageComparisonSummary comparison_root = null;
|
||||||
@@ -49,33 +62,13 @@ public class SapforPackage_json implements Serializable {
|
|||||||
for (SapforTask task : tasks)
|
for (SapforTask task : tasks)
|
||||||
task.comparisonState = MatchState.Unknown;
|
task.comparisonState = MatchState.Unknown;
|
||||||
}
|
}
|
||||||
public void SortTasksForComparison() {
|
|
||||||
/*
|
|
||||||
comparisonSortedTasks.clear();
|
|
||||||
for (MatchState matchState : MatchState.values()) {
|
|
||||||
LinkedHashMap<TaskState, Vector<SapforTask>> match_state_tasks = new LinkedHashMap<>();
|
|
||||||
//-
|
|
||||||
for (TaskState state : TaskState.values()) {
|
|
||||||
Vector<SapforTask> stateTasks = new Vector<>();
|
|
||||||
for (SapforTask task : tasks) {
|
|
||||||
if (task.state.equals(state) && task.matchState.equals(matchState))
|
|
||||||
stateTasks.add(task);
|
|
||||||
}
|
|
||||||
if (!stateTasks.isEmpty()) {
|
|
||||||
match_state_tasks.put(state, stateTasks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
comparisonSortedTasks.put(matchState, match_state_tasks);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
public void buildTree(SapforPackage package_in) {
|
public void buildTree(SapforPackage package_in) {
|
||||||
// tasks.sort(Comparator.comparing(SapforTask::getPK));
|
//--
|
||||||
for (SapforTask task : tasks)
|
for (SapforTask task : tasks)
|
||||||
task.comparisonState = MatchState.Unknown;
|
task.comparisonState = MatchState.Unknown;
|
||||||
//---
|
//---
|
||||||
root = new PackageSummary();
|
root = new PackageSummary();
|
||||||
root.count = package_in.package_json.tasks.size();
|
root.count = tasks.size();
|
||||||
root.errors_count = 0;
|
root.errors_count = 0;
|
||||||
//--
|
//--
|
||||||
for (SapforTask task : tasks) {
|
for (SapforTask task : tasks) {
|
||||||
@@ -90,30 +83,22 @@ public class SapforPackage_json implements Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void buildComparisonTree(SapforPackage package_in) {
|
public void buildComparisonTree(SapforPackage package_in) {
|
||||||
/*
|
System.out.println(package_in.id);
|
||||||
comparison_root = new PackageComparisonSummary();
|
comparison_root = new PackageComparisonSummary();
|
||||||
comparison_root.count = package_in.package_json.allTasks.size();
|
comparison_root.count = tasks.size();
|
||||||
|
comparison_root.mismatches_count = 0;
|
||||||
//--
|
//--
|
||||||
for (MatchState match_state : comparisonSortedTasks.keySet()) {
|
|
||||||
int count = 0;
|
|
||||||
LinkedHashMap<TaskState, Vector<SapforTask>> task_states = comparisonSortedTasks.get(match_state);
|
|
||||||
//---
|
|
||||||
for (TaskState state : task_states.keySet()) {
|
|
||||||
Vector<SapforTask> tasks = task_states.get(state);
|
|
||||||
//-
|
|
||||||
for (SapforTask task : tasks) {
|
for (SapforTask task : tasks) {
|
||||||
|
System.out.println(task.getUniqueKey()+":"+task.comparisonState);
|
||||||
DefaultMutableTreeNode taskNode = task.getNode(Paths.get(
|
DefaultMutableTreeNode taskNode = task.getNode(Paths.get(
|
||||||
package_in.getLocalWorkspace().getAbsolutePath(),
|
package_in.getLocalWorkspace().getAbsolutePath(),
|
||||||
String.valueOf(task.set_id),
|
String.valueOf(task.set_id),
|
||||||
String.valueOf(task.sapfor_configuration_id)
|
String.valueOf(task.sapfor_configuration_id)
|
||||||
).toFile());
|
).toFile());
|
||||||
comparison_root.add(taskNode);
|
comparison_root.add(taskNode);
|
||||||
count++;
|
if (task.comparisonState.equals(MatchState.NotMatch))
|
||||||
}
|
comparison_root.mismatches_count++;
|
||||||
}
|
}
|
||||||
if (match_state.equals(MatchState.NotMatch))
|
System.out.println("====");
|
||||||
comparison_root.mismatches_count+=count;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,12 +152,16 @@ public class SapforTask extends DBObject {
|
|||||||
//todo Для каждого случая подобрать иконку (?)
|
//todo Для каждого случая подобрать иконку (?)
|
||||||
if (!state.equals(task2.state)) {
|
if (!state.equals(task2.state)) {
|
||||||
System.out.println("Не совпадение состояний задачи " + getUniqueKey());
|
System.out.println("Не совпадение состояний задачи " + getUniqueKey());
|
||||||
|
//--
|
||||||
comparisonState = MatchState.NotMatch;
|
comparisonState = MatchState.NotMatch;
|
||||||
task2.comparisonState = MatchState.NotMatch;
|
task2.comparisonState = MatchState.NotMatch;
|
||||||
|
//--
|
||||||
} else if ((versions.size() != task2.versions.size())|| (variants.size() != task2.variants.size())) {
|
} else if ((versions.size() != task2.versions.size())|| (variants.size() != task2.variants.size())) {
|
||||||
System.out.println("Не совпадение количества версий в задаче " + getUniqueKey());
|
System.out.println("Не совпадение количества версий в задаче " + getUniqueKey());
|
||||||
|
//--
|
||||||
comparisonState = MatchState.NotMatch;
|
comparisonState = MatchState.NotMatch;
|
||||||
task2.comparisonState = MatchState.NotMatch;
|
task2.comparisonState = MatchState.NotMatch;
|
||||||
|
//--
|
||||||
} else {
|
} else {
|
||||||
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();
|
||||||
@@ -165,8 +169,10 @@ public class SapforTask extends DBObject {
|
|||||||
for (String name1 : versions1.keySet()) {
|
for (String name1 : versions1.keySet()) {
|
||||||
if (!versions2.containsKey(name1)) {
|
if (!versions2.containsKey(name1)) {
|
||||||
System.out.println("Не совпадение имен версий в задаче " + getUniqueKey());
|
System.out.println("Не совпадение имен версий в задаче " + getUniqueKey());
|
||||||
|
//--
|
||||||
comparisonState = MatchState.NotMatch;
|
comparisonState = MatchState.NotMatch;
|
||||||
task2.comparisonState = MatchState.NotMatch;
|
task2.comparisonState = MatchState.NotMatch;
|
||||||
|
//--
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,9 +184,11 @@ public class SapforTask extends DBObject {
|
|||||||
SapforVersion_json version2 = versions2.get(name1);
|
SapforVersion_json version2 = versions2.get(name1);
|
||||||
//---
|
//---
|
||||||
if (!version1.isMatch(version2)) {
|
if (!version1.isMatch(version2)) {
|
||||||
System.out.println("Не совпадение версий в задаче " + getUniqueKey());
|
System.out.println("Не совпадение кода версий в задаче " + getUniqueKey());
|
||||||
|
//-
|
||||||
comparisonState = MatchState.NotMatch;
|
comparisonState = MatchState.NotMatch;
|
||||||
task2.comparisonState = MatchState.NotMatch;
|
task2.comparisonState = MatchState.NotMatch;
|
||||||
|
//-
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import Visual_DVM_2021.Passes.PassCode_2021;
|
|||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
import Visual_DVM_2021.Passes.Pass_2021;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.util.Comparator;
|
|
||||||
public class SapforPackagesComparisonForm {
|
public class SapforPackagesComparisonForm {
|
||||||
public boolean comparisonMode = false;
|
public boolean comparisonMode = false;
|
||||||
//-->>
|
//-->>
|
||||||
@@ -121,6 +120,8 @@ public class SapforPackagesComparisonForm {
|
|||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
object.package_json.DropComparison();
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
showCommonTree();
|
showCommonTree();
|
||||||
@@ -197,13 +198,11 @@ public class SapforPackagesComparisonForm {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
/*
|
//todo в дереве отображать пустые задачи заместо тех кого не хватает.
|
||||||
for (String key1 : package1.package_json.tasks) {
|
for (SapforTask task1 : package1.package_json.tasks) {
|
||||||
if (!package2.package_json.allTasks.containsKey(key1)) {
|
if (!package2.package_json.containsKey(task1.getUniqueKey()))
|
||||||
Log.Writeln_("Задача эталона " + key1 + "не найдена в сравниваемом пакете!");
|
Log.Writeln_("Задача эталона " + task1.getUniqueKey() + "не найдена в сравниваемом пакете!");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
*/
|
|
||||||
return Log.isEmpty();
|
return Log.isEmpty();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -229,29 +228,20 @@ public class SapforPackagesComparisonForm {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
/*
|
System.out.println(package1.package_json.tasks.size());
|
||||||
System.out.println(package1.package_json.allTasks.size());
|
System.out.println(package2.package_json.tasks.size());
|
||||||
System.out.println(package2.package_json.allTasks.size());
|
|
||||||
|
|
||||||
|
|
||||||
//теперь сравниваем задачи
|
//теперь сравниваем задачи
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (String key1 : package1.package_json.allTasks.keySet()) {
|
for (SapforTask task1 : package1.package_json.tasks) {
|
||||||
System.out.println(i + "=" + key1);
|
System.out.println(i + "=" + task1.getUniqueKey());
|
||||||
SapforTask task1 = package1.package_json.allTasks.get(key1);
|
SapforTask task2 = package2.package_json.getTaskByKey(task1.getUniqueKey());
|
||||||
SapforTask task2 = package2.package_json.allTasks.get(key1);
|
|
||||||
//--
|
|
||||||
task1.checkMatch(task2);
|
task1.checkMatch(task2);
|
||||||
//--
|
//--
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
package1.package_json.SortTasksForComparison();
|
|
||||||
package2.package_json.SortTasksForComparison();
|
|
||||||
//-
|
|
||||||
package1.package_json.buildComparisonTree(package1);
|
package1.package_json.buildComparisonTree(package1);
|
||||||
package2.package_json.buildComparisonTree(package2);
|
package2.package_json.buildComparisonTree(package2);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected boolean validate() {
|
protected boolean validate() {
|
||||||
|
|||||||
Reference in New Issue
Block a user