сравнение с эталоном начальная версия
v++
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import Common.CommonConstants;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
@@ -150,7 +151,7 @@ public class SapforPackage_json implements Serializable {
|
||||
root.errors_count++;
|
||||
}
|
||||
}
|
||||
public void buildComparisonTree(SapforPackage package_in) {
|
||||
public int buildComparisonTree(SapforPackage package_in) {
|
||||
comparison_root = new PackageComparisonSummary();
|
||||
comparison_root.count = tasks.size();
|
||||
comparison_root.mismatches_count = 0;
|
||||
@@ -167,6 +168,7 @@ public class SapforPackage_json implements Serializable {
|
||||
if (task.comparisonState.equals(ComparisonState.NotMatch))
|
||||
comparison_root.mismatches_count++;
|
||||
}
|
||||
return comparison_root.mismatches_count;
|
||||
}
|
||||
public void getVersionsFiles(SapforPackage package_in) {
|
||||
for (SapforTask task : tasks) {
|
||||
@@ -185,6 +187,8 @@ public class SapforPackage_json implements Serializable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Vector<String> getConfigurationsNames() {
|
||||
Vector<String> names = new Vector<>();
|
||||
for (SapforTestingSet_json set : testingSets) {
|
||||
@@ -201,4 +205,13 @@ public class SapforPackage_json implements Serializable {
|
||||
});
|
||||
return names;
|
||||
}
|
||||
public int getConfigurationId() {
|
||||
if (testingSets.size() == 1) {
|
||||
SapforTestingSet_json testingSet_json = testingSets.get(0);
|
||||
if (testingSet_json.configurations.size() == 1) {
|
||||
return testingSet_json.configurations.get(0).id;
|
||||
}
|
||||
}
|
||||
return CommonConstants.Nan;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +131,42 @@ public class SapforVersion_json implements Serializable {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public boolean isMatchServer(SapforVersion_json version_json) {
|
||||
if (!description.equals(version_json.description)) {
|
||||
return false;
|
||||
}
|
||||
if (files.size() != version_json.files.size()) {
|
||||
return false;
|
||||
}
|
||||
for (String name1 : files.keySet()) {
|
||||
if (!version_json.files.containsKey(name1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (String name1 : files.keySet()) {
|
||||
ProjectFile file1 = files.get(name1);
|
||||
ProjectFile file2 = version_json.files.get(name1);
|
||||
//---
|
||||
String text1 = "";
|
||||
String text2 = "";
|
||||
try {
|
||||
text1 = FileUtils.readFileToString(file1.file, Charset.defaultCharset());
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
try {
|
||||
text2 = FileUtils.readFileToString(file2.file, Charset.defaultCharset());
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return text1.equalsIgnoreCase(text2);
|
||||
// if (!Utils.compareFortranTexts(text1, text2)) {
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public MessageError unpackMessage(String line_in) throws Exception {
|
||||
MessageError res = new MessageError();
|
||||
res.file = "";
|
||||
|
||||
Reference in New Issue
Block a user