no message

This commit is contained in:
2024-10-11 00:00:30 +03:00
parent a11b7711f7
commit f317ab1aa1
341 changed files with 1866 additions and 1688 deletions

View File

@@ -1,6 +1,6 @@
package _VisualDVM.TestingSystem.Common;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import Common.Database.Objects.DBObject;
import _VisualDVM.Global;
@@ -127,8 +127,8 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
}
public TestingServer() {
super(TestsDatabase.class);
name = CommonUtils.getDateName("testingServer");
System.out.println("ServerName=" + CommonUtils.Brackets(name));
name = Utils_.getDateName("testingServer");
System.out.println("ServerName=" + Utils_.Brackets(name));
}
//основа
@Override
@@ -147,7 +147,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
while (true) {
dvmTestingChecker.Perform();
sapforTestingPlanner.Perform();
CommonUtils.sleep(5000);
Utils_.sleep(5000);
}
});
//------>>>
@@ -179,7 +179,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
EmailMessage message = Log.isEmpty() ?
new EmailMessage(
"Запущено автоматическое тестирование версии " + request.arg + " системы SAPFOR",
"Пакет "+ CommonUtils.Brackets(autoPackage.id), new Vector<>()) :
"Пакет "+ Utils_.Brackets(autoPackage.id), new Vector<>()) :
new EmailMessage(
"Не удалось запустить автоматическое тестирование версии " + request.arg + " системы SAPFOR",
Log.toString(),
@@ -192,14 +192,14 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
test_id = Integer.parseInt(request.arg);
if (db.tests.containsKey(test_id)) {
test = db.tests.get(test_id);
response = new ServerExchangeUnit_2021(ServerCode.OK, "", CommonUtils.fileToBytes(test.getArchive()));
response = new ServerExchangeUnit_2021(ServerCode.OK, "", Utils_.fileToBytes(test.getArchive()));
} else
throw new RepositoryRefuseException("Теста с именем " + request.arg + " не существует");
break;
case ReceiveTestsDatabase:
Print("Получить базу данных тестов");
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = CommonUtils.fileToBytes(db.getFile());
response.object = Utils_.fileToBytes(db.getFile());
break;
//---
case RefreshDVMTests:
@@ -296,7 +296,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
pathname.isFile()
&& !pathname.getName().equals("settings")
&& !pathname.getName().equals("test-analyzer.sh")
&& CommonUtils.getExtension(pathname).startsWith(languageName.getDVMCompile()));
&& Utils_.getExtension(pathname).startsWith(languageName.getDVMCompile()));
;
if (files != null) {
groupFiles = new Vector<>(Arrays.asList(files));
@@ -422,7 +422,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
File workspace = dvmPackage.getLocalWorkspace();
File results_zip = new File(workspace, "results.zip");
File package_json = dvmPackage.getJsonFile();
response.object = new Pair(CommonUtils.fileToBytes(results_zip), CommonUtils.fileToBytes(package_json));
response.object = new Pair(Utils_.fileToBytes(results_zip), Utils_.fileToBytes(package_json));
}
private void DownloadDVMPackages() throws Exception {
Vector<Integer> ids = (Vector<Integer>) request.object;
@@ -434,7 +434,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
File workspace = dvmPackage.getLocalWorkspace();
File results_zip = new File(workspace, "results.zip");
File package_json = dvmPackage.getJsonFile();
res.add(new Pair<>(dvmPackage_id, new Pair(CommonUtils.fileToBytes(results_zip), CommonUtils.fileToBytes(package_json))));
res.add(new Pair<>(dvmPackage_id, new Pair(Utils_.fileToBytes(results_zip), Utils_.fileToBytes(package_json))));
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = res;
@@ -450,7 +450,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
ZipFolderPass zipFolderPass = new ZipFolderPass();
zipFolderPass.Do(workspace.getAbsolutePath(), results_zip.getAbsolutePath());
if (results_zip.exists())
response.object = CommonUtils.fileToBytes(results_zip);
response.object = Utils_.fileToBytes(results_zip);
else
throw new RepositoryRefuseException("Не удалось заархивировать пакет тестирования SAPFOR с ключом " + sapforPackage_id);
}
@@ -484,12 +484,12 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Vector<DVMPackage_json> jsons = new Vector<>();
for (int package_id : packages_ids) {
if (!db.dvmPackages.containsKey(package_id))
throw new RepositoryRefuseException("Пакета задач DVM " + CommonUtils.Brackets(package_id) + " не существует.");
throw new RepositoryRefuseException("Пакета задач DVM " + Utils_.Brackets(package_id) + " не существует.");
DVMPackage dvmPackage = db.dvmPackages.get(package_id);
File json = dvmPackage.getJsonFile();
if (!json.exists())
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач DVM " + CommonUtils.Brackets(package_id));
jsons.add((DVMPackage_json) CommonUtils.jsonFromFile(json, DVMPackage_json.class));
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач DVM " + Utils_.Brackets(package_id));
jsons.add((DVMPackage_json) Utils_.jsonFromFile(json, DVMPackage_json.class));
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = jsons;
@@ -499,12 +499,12 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Vector<SapforPackage_json> jsons = new Vector<>();
for (int package_id : packages_ids) {
if (!db.sapforPackages.containsKey(package_id))
throw new RepositoryRefuseException("Пакета задач SAPFOR " + CommonUtils.Brackets(package_id) + " не существует.");
throw new RepositoryRefuseException("Пакета задач SAPFOR " + Utils_.Brackets(package_id) + " не существует.");
SapforPackage sapforPackage = db.sapforPackages.get(package_id);
File json = sapforPackage.getJsonFile();
if (!json.exists())
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач SAPFOR " + CommonUtils.Brackets(package_id));
jsons.add((SapforPackage_json) CommonUtils.jsonFromFile(json, SapforPackage_json.class));
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач SAPFOR " + Utils_.Brackets(package_id));
jsons.add((SapforPackage_json) Utils_.jsonFromFile(json, SapforPackage_json.class));
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = jsons;
@@ -563,7 +563,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Global.TempDirectory,
"get_version",
"wget --user dvmhuser --password dvmh2013 -P " +
CommonUtils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
Utils_.DQuotes(Global.TempDirectory.getAbsolutePath()) +
" http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h"
).waitFor();
if (!versionFile.exists())
@@ -583,7 +583,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Global.TempDirectory,
"get_version",
"wget --user dvmhuser --password dvmh2013 -P " +
CommonUtils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
Utils_.DQuotes(Global.TempDirectory.getAbsolutePath()) +
" http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h"
).waitFor();
if (!versionFile.exists())