no message

This commit is contained in:
2024-10-07 14:22:52 +03:00
parent 6b1576461d
commit 61fc37b574
173 changed files with 960 additions and 1526 deletions

View File

@@ -1,4 +1,5 @@
package TestingSystem.Common;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common_old.Constants;
import Common.Database.Objects.DBObject;
@@ -127,7 +128,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
public TestingServer() {
super(TestsDatabase.class);
name = Utils.getDateName("testingServer");
System.out.println("ServerName=" + Utils.Brackets(name));
System.out.println("ServerName=" + CommonUtils.Brackets(name));
}
//основа
@Override
@@ -178,7 +179,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
EmailMessage message = Log.isEmpty() ?
new EmailMessage(
"Запущено автоматическое тестирование версии " + request.arg + " системы SAPFOR",
"Пакет "+ Utils.Brackets(autoPackage.id), new Vector<>()) :
"Пакет "+ CommonUtils.Brackets(autoPackage.id), new Vector<>()) :
new EmailMessage(
"Не удалось запустить автоматическое тестирование версии " + request.arg + " системы SAPFOR",
Log.toString(),
@@ -295,7 +296,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
pathname.isFile()
&& !pathname.getName().equals("settings")
&& !pathname.getName().equals("test-analyzer.sh")
&& Utils.getExtension(pathname).startsWith(languageName.getDVMCompile()));
&& CommonUtils.getExtension(pathname).startsWith(languageName.getDVMCompile()));
;
if (files != null) {
groupFiles = new Vector<>(Arrays.asList(files));
@@ -392,7 +393,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
}
private void DVMPackageNeedsKill() {
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Constants.Nan;
response.object = CommonConstants.Nan;
int packageId = (int) request.object;
for (TestingPackageToKill packageToKill : db.testingPackagesToKill.Data.values()) {
if ((packageToKill.packageId == packageId) && (packageToKill.type == 0)) {
@@ -403,7 +404,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
}
private void SapforPackageNeedsKill() throws Exception {
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Constants.Nan;
response.object = CommonConstants.Nan;
int packageId = (int) request.object;
for (TestingPackageToKill packageToKill : db.testingPackagesToKill.Data.values()) {
if ((packageToKill.packageId == packageId) && (packageToKill.type == 1)) {
@@ -483,11 +484,11 @@ 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 " + Utils.Brackets(package_id) + " не существует.");
throw new RepositoryRefuseException("Пакета задач DVM " + CommonUtils.Brackets(package_id) + " не существует.");
DVMPackage dvmPackage = db.dvmPackages.get(package_id);
File json = dvmPackage.getJsonFile();
if (!json.exists())
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач DVM " + Utils.Brackets(package_id));
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач DVM " + CommonUtils.Brackets(package_id));
jsons.add((DVMPackage_json) CommonUtils.jsonFromFile(json, DVMPackage_json.class));
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
@@ -498,11 +499,11 @@ 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 " + Utils.Brackets(package_id) + " не существует.");
throw new RepositoryRefuseException("Пакета задач SAPFOR " + CommonUtils.Brackets(package_id) + " не существует.");
SapforPackage sapforPackage = db.sapforPackages.get(package_id);
File json = sapforPackage.getJsonFile();
if (!json.exists())
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач SAPFOR " + Utils.Brackets(package_id));
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач SAPFOR " + CommonUtils.Brackets(package_id));
jsons.add((SapforPackage_json) CommonUtils.jsonFromFile(json, SapforPackage_json.class));
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
@@ -562,7 +563,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Global.TempDirectory,
"get_version",
"wget --user dvmhuser --password dvmh2013 -P " +
Utils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
CommonUtils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
" http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h"
).waitFor();
if (!versionFile.exists())
@@ -582,7 +583,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Global.TempDirectory,
"get_version",
"wget --user dvmhuser --password dvmh2013 -P " +
Utils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
CommonUtils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
" http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h"
).waitFor();
if (!versionFile.exists())