no message

This commit is contained in:
2024-10-07 22:04:09 +03:00
parent 7fac84740d
commit 17c0bf7eb3
103 changed files with 560 additions and 491 deletions

View File

@@ -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, "", Utils.packFile(test.getArchive()));
response = new ServerExchangeUnit_2021(ServerCode.OK, "", CommonUtils.fileToBytes(test.getArchive()));
} else
throw new RepositoryRefuseException("Теста с именем " + request.arg + " не существует");
break;
case ReceiveTestsDatabase:
Print("Получить базу данных тестов");
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Utils.packFile(db.getFile());
response.object = CommonUtils.fileToBytes(db.getFile());
break;
//---
case RefreshDVMTests:
@@ -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(Utils.packFile(results_zip), Utils.packFile(package_json));
response.object = new Pair(CommonUtils.fileToBytes(results_zip), CommonUtils.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(Utils.packFile(results_zip), Utils.packFile(package_json))));
res.add(new Pair<>(dvmPackage_id, new Pair(CommonUtils.fileToBytes(results_zip), CommonUtils.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 = Utils.packFile(results_zip);
response.object = CommonUtils.fileToBytes(results_zip);
else
throw new RepositoryRefuseException("Не удалось заархивировать пакет тестирования SAPFOR с ключом " + sapforPackage_id);
}