подсветка версий с ошибками в журнале
This commit is contained in:
11
.idea/workspace.xml
generated
11
.idea/workspace.xml
generated
@@ -9,10 +9,13 @@
|
|||||||
<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$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/CredentialsBar/CredentialsBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Menus_2023/CredentialsBar/CredentialsBar.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/VisualiserSettingsMenu/CompactnessSettingsMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/VisualiserSettingsMenu/CompactnessSettingsMenu.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/Group/GroupsDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/Group/GroupsDBTable.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/GlobalData/Machine/MachinesMenuBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/Machine/MachinesMenuBar.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/Test/TestDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/Test/TestDBTable.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SapforAnalysis.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SapforAnalysis.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestsDatabase.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" />
|
||||||
</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" />
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
"SMTPPort": 465,
|
"SMTPPort": 465,
|
||||||
"MailSocketPort": 465,
|
"MailSocketPort": 465,
|
||||||
"collapseCredentials": true,
|
"collapseCredentials": true,
|
||||||
"collapseFileGraphs": true,
|
"collapseFileGraphs": false,
|
||||||
"collapseFileMessages": true,
|
"collapseFileMessages": false,
|
||||||
"collapseProjectTrees": false,
|
"collapseProjectTrees": false,
|
||||||
"BackupWorkspace": "_sapfor_x64_backups",
|
"BackupWorkspace": "_sapfor_x64_backups",
|
||||||
"BackupHour": 5,
|
"BackupHour": 5,
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class Visualiser extends Component {
|
|||||||
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
||||||
@Override
|
@Override
|
||||||
public void GetVersionInfo() {
|
public void GetVersionInfo() {
|
||||||
version = 1089;
|
version = 1090;
|
||||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||||
date_text = df.format(getClassBuildTime());
|
date_text = df.format(getClassBuildTime());
|
||||||
|
|||||||
@@ -132,9 +132,9 @@ public class GroupsDBTable extends iDBTable<Group> {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public Group getGroupByDescription(String description_in) {
|
public Group getGroupByDescription(LanguageName language_in,String description_in) {
|
||||||
for (Group group : Data.values()) {
|
for (Group group : Data.values()) {
|
||||||
if (group.description.equalsIgnoreCase(description_in))
|
if (group.language.equals(language_in)&&group.description.equalsIgnoreCase(description_in))
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -100,9 +100,9 @@ public class TestDBTable extends iDBTable<Test> {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public Test getTestByDescription(String description_in) {
|
public Test getTestByDescription(int group_id_in, String description_in) {
|
||||||
for (Test test : Data.values()) {
|
for (Test test : Data.values()) {
|
||||||
if (test.description.equalsIgnoreCase(description_in))
|
if ((test.group_id==group_id_in)&&(test.description.equalsIgnoreCase(description_in)))
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import Common.Global;
|
|||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import GlobalData.Account.Account;
|
import GlobalData.Account.Account;
|
||||||
import ProjectData.LanguageName;
|
import ProjectData.LanguageName;
|
||||||
import Repository.Component.Sapfor.Sapfor;
|
|
||||||
import Repository.EmailMessage;
|
import Repository.EmailMessage;
|
||||||
import Repository.RepositoryRefuseException;
|
import Repository.RepositoryRefuseException;
|
||||||
import Repository.RepositoryServer;
|
import Repository.RepositoryServer;
|
||||||
@@ -299,7 +298,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
throw new RepositoryRefuseException("Не удалось обновить репозиторий");
|
throw new RepositoryRefuseException("Не удалось обновить репозиторий");
|
||||||
//-->>
|
//-->>
|
||||||
Vector<Pair<Group, Vector<File>>> groups = new Vector<>();
|
Vector<Pair<Group, Vector<File>>> groups = new Vector<>();
|
||||||
LinkedHashMap<Group, Vector<Test>> res = new LinkedHashMap<>();
|
|
||||||
File testsSrc = Paths.get(
|
File testsSrc = Paths.get(
|
||||||
Global.RepoDirectory.getAbsolutePath(),
|
Global.RepoDirectory.getAbsolutePath(),
|
||||||
"dvm", "tools", "tester", "trunk", "test-suite").toFile();
|
"dvm", "tools", "tester", "trunk", "test-suite").toFile();
|
||||||
@@ -338,58 +336,8 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
//-теперь создать тесты.
|
//-теперь создать тесты.
|
||||||
System.out.println("найдено " + groups.size() + " групп");
|
System.out.println("найдено " + groups.size() + " групп");
|
||||||
//--
|
//--
|
||||||
for (Pair<Group, Vector<File>> p : groups) {
|
for (Pair<Group, Vector<File>> p : groups)
|
||||||
Group group = p.getKey();
|
db.RefreshGroup(account, sapfor, p);
|
||||||
//-
|
|
||||||
db.Insert(group);
|
|
||||||
Vector<Test> testsIds = new Vector<>();
|
|
||||||
res.put(group, testsIds);
|
|
||||||
//-
|
|
||||||
Vector<File> files = p.getValue();
|
|
||||||
if (!files.isEmpty()) {
|
|
||||||
//->>
|
|
||||||
for (File file : files) {
|
|
||||||
System.out.println("Создание теста " + file.getName());
|
|
||||||
Test test = new Test();
|
|
||||||
test.description = Utils.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
|
|
||||||
test.sender_name = account.name;
|
|
||||||
test.sender_address = account.email;
|
|
||||||
test.group_id = group.id;
|
|
||||||
test.files = file.getName();
|
|
||||||
db.Insert(test);
|
|
||||||
testsIds.add(test);
|
|
||||||
//->>
|
|
||||||
File testDirectory = new File(Global.TestsDirectory, String.valueOf(test.id));
|
|
||||||
Utils.CheckAndCleanDirectory(testDirectory);
|
|
||||||
File testFile = Paths.get(testDirectory.getAbsolutePath(), file.getName()).toFile();
|
|
||||||
FileUtils.copyFile(file, testFile);
|
|
||||||
//----
|
|
||||||
//архивация.
|
|
||||||
File archive = test.getArchive();
|
|
||||||
ZipFolderPass zip = new ZipFolderPass();
|
|
||||||
zip.Do(testDirectory.getAbsolutePath(), archive.getAbsolutePath());
|
|
||||||
//---
|
|
||||||
//Определение размерности
|
|
||||||
switch (group.language) {
|
|
||||||
case fortran:
|
|
||||||
// временная папка для анализа. чтобы не засорять нормальную.
|
|
||||||
File tempProject = Utils.getTempFileName("test");
|
|
||||||
FileUtils.forceMkdir(tempProject);
|
|
||||||
FileUtils.copyDirectory(testDirectory, tempProject);
|
|
||||||
//--
|
|
||||||
if (Sapfor.getMinMaxDim(Sapfor.getTempCopy(new File(sapfor.call_command)), tempProject, test)) {
|
|
||||||
db.Update(test);
|
|
||||||
} else
|
|
||||||
throw new RepositoryRefuseException("Не удалось определить размерность теста " + Utils.Brackets(test.description));
|
|
||||||
break;
|
|
||||||
case c:
|
|
||||||
test.max_dim = Utils.getCTestMaxDim(testFile);
|
|
||||||
db.Update(test);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void GetFirstActiveDVMPackagesByMachines() {
|
private void GetFirstActiveDVMPackagesByMachines() {
|
||||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
package TestingSystem.Common;
|
package TestingSystem.Common;
|
||||||
import Common.Constants;
|
import Common.Constants;
|
||||||
import Common.Database.SQLITE.SQLiteDatabase;
|
import Common.Database.SQLITE.SQLiteDatabase;
|
||||||
|
import Common.Global;
|
||||||
|
import Common.Utils.Utils;
|
||||||
|
import GlobalData.Account.Account;
|
||||||
|
import Repository.Component.Sapfor.Sapfor;
|
||||||
|
import Repository.RepositoryRefuseException;
|
||||||
|
import TestingSystem.Common.Group.Group;
|
||||||
import TestingSystem.Common.Group.GroupsDBTable;
|
import TestingSystem.Common.Group.GroupsDBTable;
|
||||||
|
import TestingSystem.Common.Test.Test;
|
||||||
import TestingSystem.Common.Test.TestDBTable;
|
import TestingSystem.Common.Test.TestDBTable;
|
||||||
import TestingSystem.Common.TestingPackageToKill.TestingPackagesToKillDBTable;
|
import TestingSystem.Common.TestingPackageToKill.TestingPackagesToKillDBTable;
|
||||||
import TestingSystem.DVM.Configuration.ConfigurationDBTable;
|
import TestingSystem.DVM.Configuration.ConfigurationDBTable;
|
||||||
@@ -12,9 +19,14 @@ import TestingSystem.SAPFOR.SapforConfiguration.SapforConfigurationDBTable;
|
|||||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
|
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommandsDBTable;
|
||||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackageDBTable;
|
import TestingSystem.SAPFOR.SapforPackage.SapforPackageDBTable;
|
||||||
|
import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
|
||||||
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforsDBTable;
|
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforsDBTable;
|
||||||
|
import Visual_DVM_2021.Passes.All.ZipFolderPass;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
|
import javafx.util.Pair;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
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.LinkedHashMap;
|
||||||
@@ -144,4 +156,78 @@ public class TestsDatabase extends SQLiteDatabase {
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
//--
|
||||||
|
public void SaveTestFromSingleFile(ServerSapfor sapfor, Group group, Test test, File file) throws Exception {
|
||||||
|
File testDirectory = new File(Global.TestsDirectory, String.valueOf(test.id));
|
||||||
|
Utils.CheckAndCleanDirectory(testDirectory);
|
||||||
|
File testFile = Paths.get(testDirectory.getAbsolutePath(), file.getName()).toFile();
|
||||||
|
FileUtils.copyFile(file, testFile);
|
||||||
|
//----
|
||||||
|
//архивация.
|
||||||
|
File archive = test.getArchive();
|
||||||
|
if (archive.exists())
|
||||||
|
FileUtils.forceDelete(archive);
|
||||||
|
//----------->>
|
||||||
|
ZipFolderPass zip = new ZipFolderPass();
|
||||||
|
zip.Do(testDirectory.getAbsolutePath(), archive.getAbsolutePath());
|
||||||
|
//---
|
||||||
|
//Определение размерности
|
||||||
|
switch (group.language) {
|
||||||
|
case fortran:
|
||||||
|
// временная папка для анализа. чтобы не засорять нормальную.
|
||||||
|
File tempProject = Utils.getTempFileName("test");
|
||||||
|
FileUtils.forceMkdir(tempProject);
|
||||||
|
FileUtils.copyDirectory(testDirectory, tempProject);
|
||||||
|
//--
|
||||||
|
if (Sapfor.getMinMaxDim(Sapfor.getTempCopy(new File(sapfor.call_command)), tempProject, test)) {
|
||||||
|
Update(test);
|
||||||
|
} else
|
||||||
|
throw new RepositoryRefuseException("Не удалось определить размерность теста " + Utils.Brackets(test.description));
|
||||||
|
break;
|
||||||
|
case c:
|
||||||
|
test.max_dim = Utils.getCTestMaxDim(testFile);
|
||||||
|
Update(test);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//---
|
||||||
|
public void CreateTestFromSingleFile(Account account, ServerSapfor sapfor, Group group, File file, String testDescription) throws Exception {
|
||||||
|
System.out.println("Создание теста " + file.getName());
|
||||||
|
Test test = new Test();
|
||||||
|
test.description = testDescription;
|
||||||
|
test.sender_name = account.name;
|
||||||
|
test.sender_address = account.email;
|
||||||
|
test.group_id = group.id;
|
||||||
|
test.files = file.getName();
|
||||||
|
Insert(test);
|
||||||
|
//->>
|
||||||
|
SaveTestFromSingleFile(sapfor, group, test, file);
|
||||||
|
}
|
||||||
|
public void RefreshGroup(Account account, ServerSapfor sapfor, Pair<Group, Vector<File>> groupData) throws Exception {
|
||||||
|
Group group = groupData.getKey();
|
||||||
|
Vector<File> files = groupData.getValue();
|
||||||
|
//--
|
||||||
|
Group oldGroup = groups.getGroupByDescription(group.language,group.description);
|
||||||
|
if (oldGroup == null) {
|
||||||
|
System.out.println("group "+Utils.Brackets(group.description)+" not found. create.");
|
||||||
|
Insert(group);
|
||||||
|
for (File file : files) {
|
||||||
|
String testDescription = Utils.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
|
||||||
|
System.out.println("test "+Utils.Brackets(testDescription) + " create"); //добавить тест.
|
||||||
|
CreateTestFromSingleFile(account, sapfor, group, file, testDescription);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (File file : files) {
|
||||||
|
String testDescription = Utils.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
|
||||||
|
Test oldTest = tests.getTestByDescription(oldGroup.id, testDescription);
|
||||||
|
if (oldTest == null) {
|
||||||
|
System.out.println("test "+Utils.Brackets(testDescription) + " not found. create"); //добавить тест.
|
||||||
|
CreateTestFromSingleFile(account, sapfor, oldGroup, file, testDescription);
|
||||||
|
} else {
|
||||||
|
System.out.println(Utils.Brackets(testDescription) + " found. rewrite"); //добавить тест.
|
||||||
|
SaveTestFromSingleFile(sapfor, group, oldTest, file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ 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 //версия построена, но в журналах есть ошибка.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import ProjectData.Files.ProjectFile;
|
|||||||
import ProjectData.LanguageName;
|
import ProjectData.LanguageName;
|
||||||
import ProjectData.Messages.Errors.MessageError;
|
import ProjectData.Messages.Errors.MessageError;
|
||||||
import ProjectData.Project.db_project_info;
|
import ProjectData.Project.db_project_info;
|
||||||
|
import Repository.Component.Sapfor.Sapfor;
|
||||||
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
@@ -76,6 +77,26 @@ 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());
|
||||||
|
//--
|
||||||
|
Vector<File> files = new Vector<>();
|
||||||
|
files.add(parse_out.file);
|
||||||
|
files.add(parse_err.file);
|
||||||
|
files.add(out.file);
|
||||||
|
files.add(err.file);
|
||||||
|
for (File file: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) {
|
public boolean isMatch(SapforVersion_json version_json) {
|
||||||
if (!description.equals(version_json.description)) {
|
if (!description.equals(version_json.description)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user