Исправление клонирования пакетов ДВМ

This commit is contained in:
2024-03-22 23:08:51 +03:00
parent b6b6e2e642
commit 9f1777431c
13 changed files with 250 additions and 169 deletions

View File

@@ -16,6 +16,7 @@ import TestingSystem.Common.Test.Test;
import TestingSystem.Common.Test.TestType;
import TestingSystem.Common.TestingPackageToKill.TestingPackageToKill;
import TestingSystem.DVM.DVMPackage.DVMPackage;
import TestingSystem.DVM.DVMPackage.DVMPackage_json;
import TestingSystem.DVM.DVMTestingPlanner;
import TestingSystem.SAPFOR.Json.SapforPackage_json;
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
@@ -250,6 +251,10 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Print("Получить информацию о задачах пакетов SAPFOR");
GetSapforPackagesJson();
break;
case GetDVMPackagesJson:
Print("Получить информацию о задачах пакетов DVM");
GetDVMPackagesJson();
break;
case GetFirstsActiveDVMPackages:
Print("Получить первые активные пакеты задач DVM на машинах");
GetFirstActiveDVMPackagesByMachines();
@@ -258,6 +263,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
}
}
//->>
Pair<Group, Vector<File>> ConvertDirectoryToGroup(File src, LanguageName languageName, TestType
testType, Account account) throws Exception {
@@ -617,6 +623,21 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
//-
Email(message, out, err);
}
private void GetDVMPackagesJson() throws Exception{
Vector<Integer> packages_ids = (Vector<Integer>) request.object;
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) + " не существует.");
DVMPackage dvmPackage = db.dvmPackages.get(package_id);
File json = dvmPackage.getJsonFile();
if (!json.exists())
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;
}
private void GetSapforPackagesJson() throws Exception {
Vector<Integer> packages_ids = (Vector<Integer>) request.object;
Vector<SapforPackage_json> jsons = new Vector<>();