no message
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import Common.CommonConstants;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
//на самом деле уже settings. конфиграция = группы + параметры
|
||||
public class SapforConfiguration_json implements Serializable {
|
||||
@Expose
|
||||
public int id = CommonConstants.Nan;
|
||||
@Expose
|
||||
public String name = "";
|
||||
@Expose
|
||||
public String flags = "";
|
||||
@Expose
|
||||
public List<PassCode_2021> codes = new Vector<>();
|
||||
//--
|
||||
public SapforConfiguration_json() {
|
||||
}
|
||||
public SapforConfiguration_json(SapforSettings sapforSettings) {
|
||||
id = sapforSettings.id;
|
||||
name = sapforSettings.description;
|
||||
flags = sapforSettings.flags;
|
||||
codes = sapforSettings.getCheckedCodes();
|
||||
}
|
||||
}
|
||||
204
src/_VisualDVM/TestingSystem/SAPFOR/Json/SapforPackage_json.java
Normal file
204
src/_VisualDVM/TestingSystem/SAPFOR/Json/SapforPackage_json.java
Normal file
@@ -0,0 +1,204 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.ComparisonState;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI.PackageComparisonSummary;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI.PackageSummary;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class SapforPackage_json implements Serializable {
|
||||
@Expose
|
||||
public int kernels = 1;
|
||||
@Expose
|
||||
public String sapfor_drv = ""; //файл с сапфором. Имя уникально для сценария.
|
||||
//--
|
||||
@Expose
|
||||
public int max_set_id = 0;
|
||||
public int getMaxSetId() {
|
||||
return max_set_id++;
|
||||
}
|
||||
@Expose
|
||||
public int max_task_id = 0;
|
||||
public int getMaxTaskId() {
|
||||
return max_task_id++;
|
||||
}
|
||||
//--в отличие от пакета двм,где достаточно инфы о задачах, тут есть инфа о тестах и конфигурациях
|
||||
@Expose
|
||||
public List<SapforTestingSet_json> testingSets = new Vector<>(); //по факту, сет один. Наследие формирования пакетов.
|
||||
@Expose
|
||||
public List<SapforTask> tasks = new Vector<>();
|
||||
//--
|
||||
public Vector<String> getTasksKeys() {
|
||||
Vector<String> keys = new Vector<>();
|
||||
for (SapforTask task : tasks) {
|
||||
String key = task.getUniqueKey();
|
||||
if (!keys.contains(key))
|
||||
keys.add(key);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
public Vector<String> getTestsNames() {
|
||||
Vector<String> names = new Vector<>();
|
||||
for (SapforTask task : tasks) {
|
||||
if (!names.contains(task.test_description))
|
||||
names.add(task.test_description);
|
||||
}
|
||||
names.sort(new Comparator<String>() {
|
||||
@Override
|
||||
public int compare(String o1, String o2) {
|
||||
return o1.compareTo(o2);
|
||||
}
|
||||
});
|
||||
return names;
|
||||
}
|
||||
//--
|
||||
public void sortTasks() {
|
||||
tasks.sort(new Comparator<SapforTask>() {
|
||||
@Override
|
||||
public int compare(SapforTask o1, SapforTask o2) {
|
||||
return Integer.compare(o1.state.ordinal(), o2.state.ordinal());
|
||||
}
|
||||
});
|
||||
}
|
||||
public void sortTasksForComparison() {
|
||||
tasks.sort(new Comparator<SapforTask>() {
|
||||
@Override
|
||||
public int compare(SapforTask o1, SapforTask o2) {
|
||||
return Integer.compare(o1.comparisonState.ordinal(), o2.comparisonState.ordinal());
|
||||
}
|
||||
});
|
||||
}
|
||||
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 PackageComparisonSummary comparison_root = null;
|
||||
//---------
|
||||
public void DropComparison() {
|
||||
comparison_root = null;
|
||||
for (SapforTask task : tasks) {
|
||||
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) {
|
||||
//--
|
||||
root = new PackageSummary();
|
||||
root.count = tasks.size();
|
||||
root.errors_count = 0;
|
||||
//--
|
||||
sortTasks();
|
||||
//--
|
||||
for (SapforTask task : tasks) {
|
||||
DefaultMutableTreeNode taskNode = task.getNode(Paths.get(
|
||||
package_in.getLocalWorkspace().getAbsolutePath(),
|
||||
String.valueOf(task.set_id),
|
||||
String.valueOf(task.sapfor_configuration_id)
|
||||
).toFile());
|
||||
root.add(taskNode);
|
||||
if (task.state.equals(TaskState.DoneWithErrors))
|
||||
root.errors_count++;
|
||||
}
|
||||
}
|
||||
public void buildComparisonTree(SapforPackage package_in) {
|
||||
comparison_root = new PackageComparisonSummary();
|
||||
comparison_root.count = tasks.size();
|
||||
comparison_root.mismatches_count = 0;
|
||||
//--
|
||||
sortTasksForComparison();
|
||||
//--
|
||||
for (SapforTask task : tasks) {
|
||||
DefaultMutableTreeNode taskNode = task.getNode(Paths.get(
|
||||
package_in.getLocalWorkspace().getAbsolutePath(),
|
||||
String.valueOf(task.set_id),
|
||||
String.valueOf(task.sapfor_configuration_id)
|
||||
).toFile());
|
||||
comparison_root.add(taskNode);
|
||||
if (task.comparisonState.equals(ComparisonState.NotMatch))
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
public Vector<String> getConfigurationsNames() {
|
||||
Vector<String> names = new Vector<>();
|
||||
for (SapforTestingSet_json set : testingSets) {
|
||||
for (SapforConfiguration_json configurationJson : set.configurations) {
|
||||
if (!names.contains(configurationJson.name))
|
||||
names.add(configurationJson.name);
|
||||
}
|
||||
}
|
||||
names.sort(new Comparator<String>() {
|
||||
@Override
|
||||
public int compare(String o1, String o2) {
|
||||
return o1.compareTo(o2);
|
||||
}
|
||||
});
|
||||
return names;
|
||||
}
|
||||
//---
|
||||
public SapforPackage_json() {
|
||||
}
|
||||
public SapforPackage_json(ServerSapfor serverSapfor, LinkedHashMap<String, Test> testsByDescriptions, Vector<SapforConfiguration> configurations, int kernels_in) {
|
||||
sapfor_drv=serverSapfor.call_command;
|
||||
kernels = kernels_in;
|
||||
//рудимент от формирования пакетов. возможно, объединить с текущим классом.
|
||||
SapforTestingSet_json testingSet = new SapforTestingSet_json(testsByDescriptions, configurations);
|
||||
testingSet.id = getMaxSetId();
|
||||
testingSets.add(testingSet);
|
||||
//формирование задач
|
||||
LinkedHashMap<String, SapforTask> sortedTasks = new LinkedHashMap<>();
|
||||
for (SapforConfiguration_json sapforConfiguration_json : testingSet.configurations) {
|
||||
for (SapforTest_json test : testingSet.tests) {
|
||||
SapforTask task = new SapforTask(testingSet, test, sapforConfiguration_json);
|
||||
if (!sortedTasks.containsKey(task.getUniqueKey())) {
|
||||
task.id = getMaxTaskId();
|
||||
sortedTasks.put(task.getUniqueKey(), task);
|
||||
}
|
||||
}
|
||||
}
|
||||
tasks.addAll(sortedTasks.values());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.Serializable;
|
||||
public class SapforTest_json implements Serializable {
|
||||
@Expose
|
||||
public int id;
|
||||
@Expose
|
||||
public String description = "";
|
||||
@Expose
|
||||
public String group_description = "";
|
||||
public SapforTest_json(){}
|
||||
public SapforTest_json(Test test){
|
||||
id = test.id;
|
||||
description = test.description;
|
||||
group_description = Global.testingServer.db.groups.get(test.group_id).description;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import Common.CommonConstants;
|
||||
import _VisualDVM.ServerObjectsCache.SapforConfigurationCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class SapforTestingSet_json implements Serializable {
|
||||
@Expose
|
||||
public int id = CommonConstants.Nan;
|
||||
@Expose
|
||||
public List<SapforTest_json> tests = new Vector<>();
|
||||
@Expose
|
||||
public List<SapforConfiguration_json> configurations = new Vector<>();
|
||||
public SapforTestingSet_json(){}
|
||||
public SapforTestingSet_json(LinkedHashMap<String, Test> testsByDescriptions, Vector<SapforConfiguration> sapforConfigurations) {
|
||||
for (Test test : testsByDescriptions.values())
|
||||
tests.add(new SapforTest_json(test));
|
||||
for (SapforConfiguration configuration : sapforConfigurations) {
|
||||
for (SapforSettings sapforSettings : ((SapforConfigurationCache) VisualCaches.GetCache(configuration)).getSettings())
|
||||
configurations.add(new SapforConfiguration_json(sapforSettings));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import java.io.Serializable;
|
||||
public enum SapforVersionState implements Serializable {
|
||||
Empty, //версия оказалась пуста.
|
||||
Normal, //версия построена
|
||||
HasErrors //версия построена, но в журналах есть ошибка.
|
||||
}
|
||||
309
src/_VisualDVM/TestingSystem/SAPFOR/Json/SapforVersion_json.java
Normal file
309
src/_VisualDVM/TestingSystem/SAPFOR/Json/SapforVersion_json.java
Normal file
@@ -0,0 +1,309 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.Files.FileType;
|
||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.ProjectData.Messages.Errors.MessageError;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import static java.lang.Character.isDigit;
|
||||
public class SapforVersion_json implements Serializable {
|
||||
@Expose
|
||||
public String version = "";
|
||||
@Expose
|
||||
public String description = "";
|
||||
//поля для отображения деревьев.
|
||||
public File Home = null;
|
||||
public LinkedHashMap<String, ProjectFile> files = new LinkedHashMap<>();
|
||||
//--
|
||||
public ProjectFile parse_out = null;
|
||||
public ProjectFile parse_err = null;
|
||||
public ProjectFile out = null;
|
||||
public ProjectFile err = null;
|
||||
//--
|
||||
public SapforTask task = null; //родная задача. Нужна для построения дерева версий.
|
||||
public db_project_info project = null;
|
||||
//--
|
||||
public SapforVersionState state = null;
|
||||
public VersionComparisonState comparisonState = null;
|
||||
//--
|
||||
public SapforVersion_json(String version_in, String description_in) {
|
||||
version = version_in;
|
||||
description = description_in;
|
||||
}
|
||||
public SapforVersion_json(String root_in, String version_in, String description_in) {
|
||||
version = version_in.substring(root_in.length() + 1);
|
||||
description = description_in;
|
||||
}
|
||||
public void getFiles(File configurationRoot) {
|
||||
//--
|
||||
state = SapforVersionState.Empty;
|
||||
comparisonState = VersionComparisonState.Unknown;
|
||||
//--
|
||||
String relativePath = CommonUtils.isWindows() ? CommonUtils.toW(version) : version;
|
||||
Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile();
|
||||
files = new LinkedHashMap<>();
|
||||
//--
|
||||
File[] files_ = Home.listFiles();
|
||||
if (files_ != null) {
|
||||
for (File file : files_) {
|
||||
if (file.isFile()) {
|
||||
ProjectFile projectFile = new ProjectFile(file);
|
||||
if (!projectFile.fileType.equals(FileType.forbidden)
|
||||
) {
|
||||
files.put(projectFile.file.getName(), projectFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!files.isEmpty())
|
||||
state = SapforVersionState.Normal;
|
||||
}
|
||||
parse_out = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.parse_out_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());
|
||||
err = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.err_file).toFile());
|
||||
//--
|
||||
Vector<File> out_files = new Vector<>();
|
||||
out_files.add(parse_out.file);
|
||||
out_files.add(parse_err.file);
|
||||
out_files.add(out.file);
|
||||
out_files.add(err.file);
|
||||
for (File file : out_files) {
|
||||
try {
|
||||
if (file.exists()) {
|
||||
Vector<String> lines = new Vector<>(FileUtils.readLines(file));
|
||||
if (!Sapfor.checkLines(lines)) {
|
||||
state = SapforVersionState.HasErrors;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
public boolean isMatch(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();
|
||||
}
|
||||
if (!Utils.compareFortranTexts(text1, text2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public MessageError unpackMessage(String line_in) throws Exception {
|
||||
MessageError res = new MessageError();
|
||||
res.file = "";
|
||||
res.line = CommonConstants.Nan;
|
||||
res.value = "";
|
||||
String line = line_in.substring(9);
|
||||
int i = 0;
|
||||
int s = 0;
|
||||
String lexeme = "";
|
||||
//#1020: red43.fdv: line 988]: Active DVM directives are not supported (turn on DVM-directive support option)
|
||||
for (char c : line.toCharArray()) {
|
||||
switch (s) {
|
||||
case 0:
|
||||
//поиск groups_s
|
||||
if (c == '#') {
|
||||
s = 1;
|
||||
lexeme = "";
|
||||
} else return null;
|
||||
break;
|
||||
case 1:
|
||||
//group_s
|
||||
if (isDigit(c)) {
|
||||
res.group_s += c;
|
||||
lexeme += c;
|
||||
} else if (c == ':') {
|
||||
s = 2;
|
||||
res.group = Integer.parseInt(lexeme);
|
||||
} else return null;
|
||||
break;
|
||||
case 2:
|
||||
//поиск filename
|
||||
if (c == ' ') {
|
||||
s = 3;
|
||||
} else return null;
|
||||
break;
|
||||
case 3:
|
||||
//filename
|
||||
if (c == ':') {
|
||||
s = 4;
|
||||
} else {
|
||||
res.file += c;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
//поиск line
|
||||
if (c == ' ') {
|
||||
s = 5;
|
||||
lexeme = "";
|
||||
} else return null;
|
||||
break;
|
||||
case 5:
|
||||
//line
|
||||
if (c == ' ') {
|
||||
if (!lexeme.equals("line"))
|
||||
return null;
|
||||
else {
|
||||
s = 6;
|
||||
lexeme = "";
|
||||
}
|
||||
} else {
|
||||
lexeme += c;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
//line number
|
||||
if (isDigit(c)) {
|
||||
lexeme += c;
|
||||
} else if (c == ']') {
|
||||
res.line = Integer.parseInt(lexeme);
|
||||
s = 7;
|
||||
} else return null;
|
||||
break;
|
||||
case 7:
|
||||
//Поиск value
|
||||
if (c == ':') {
|
||||
s = 8;
|
||||
} else return null;
|
||||
break;
|
||||
case 8:
|
||||
if (c == ' ') {
|
||||
s = 9;
|
||||
} else return null;
|
||||
break;
|
||||
case 9:
|
||||
//value
|
||||
res.value += c;
|
||||
break;
|
||||
}
|
||||
;
|
||||
++i;
|
||||
}
|
||||
//--
|
||||
if (s != 9)
|
||||
return null;
|
||||
//--
|
||||
return res;
|
||||
}
|
||||
public void readMessagesFromFileDump(File file, Vector<MessageError> messages) {
|
||||
try {
|
||||
//Образец запакованного сообщения
|
||||
//ERROR - [#1020: red43.fdv: line 988]: Active DVM directives are not supported (turn on DVM-directive support option)
|
||||
Vector<String> lines = new Vector<>(FileUtils.readLines(file));
|
||||
if (!lines.isEmpty()) {
|
||||
for (int i = lines.size() - 1; i >= 0; --i) {
|
||||
String line = lines.get(i);
|
||||
if (line.startsWith("ERROR - ")) {
|
||||
MessageError message = unpackMessage(line);
|
||||
if (message != null)
|
||||
messages.add(message);
|
||||
//--
|
||||
} else break;
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
//--
|
||||
public void createProject(File rootHome) throws Exception {
|
||||
project = null;
|
||||
String version_ = CommonUtils.isWindows() ? CommonUtils.toW(version) : CommonUtils.toU(version);
|
||||
project = new db_project_info();
|
||||
project.Home = Paths.get(rootHome.getAbsolutePath(), version_).toFile();
|
||||
project.name = project.Home.getName();
|
||||
project.description = description;
|
||||
project.languageName = LanguageName.fortran;
|
||||
project.creationDate = CommonUtils.getDateNumber();
|
||||
//---
|
||||
FileUtils.copyDirectory(Home, project.Home);
|
||||
///--------------------------------------
|
||||
project.CreateVisualiserData();
|
||||
}
|
||||
public void ReadMessages() throws Exception {
|
||||
if (project != null) {
|
||||
Vector<MessageError> messages = new Vector<>();
|
||||
//--
|
||||
File p_out = Paths.get(project.Home.getAbsolutePath(), Constants.data, Constants.parse_out_file).toFile();
|
||||
File p_err = Paths.get(project.Home.getAbsolutePath(), Constants.data, Constants.parse_err_file).toFile();
|
||||
File out = Paths.get(project.Home.getAbsolutePath(), Constants.data, Constants.out_file).toFile();
|
||||
File err = Paths.get(project.Home.getAbsolutePath(), Constants.data, Constants.err_file).toFile();
|
||||
//--
|
||||
if (p_out.exists()) {
|
||||
project.Log += (FileUtils.readFileToString(p_out));
|
||||
readMessagesFromFileDump(p_out, messages);
|
||||
}
|
||||
if (out.exists()) {
|
||||
project.Log += "\n" + FileUtils.readFileToString(out);
|
||||
readMessagesFromFileDump(out, messages);
|
||||
}
|
||||
//в потоки ошибок идет информация от операционной системы. сообщений там быть не должно.
|
||||
if (p_err.exists())
|
||||
project.Log += (FileUtils.readFileToString(p_err));
|
||||
if (err.exists())
|
||||
project.Log += "\n" + FileUtils.readFileToString(err);
|
||||
//--
|
||||
project.Open();
|
||||
project.Update(); //Журнал
|
||||
//а так же, убрать dep и txt
|
||||
project.db.BeginTransaction();
|
||||
for (MessageError m : messages) {
|
||||
if (project.db.files.containsKey(m.file)) {
|
||||
DBProjectFile file = project.db.files.Data.get(m.file);
|
||||
file.CreateAndAddNewMessage(1, m.value, m.line, m.group);
|
||||
//update file
|
||||
project.db.Update(file);
|
||||
}
|
||||
}
|
||||
project.db.Commit();
|
||||
project.db.Disconnect();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return Home.getName() + " : " + CommonUtils.Brackets(description) + " файлы: " + files.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
public enum VersionComparisonState {
|
||||
Unknown,
|
||||
Match, //версия совпадает
|
||||
NotMatch
|
||||
}
|
||||
Reference in New Issue
Block a user