Перенос кнопки синхронизации на панель тестирования. Исправление бага с формированием пакета.

This commit is contained in:
2023-12-18 15:44:48 +03:00
parent ed2222c163
commit ef65bb2439
24 changed files with 315 additions and 79 deletions

View File

@@ -9,7 +9,8 @@ import Visual_DVM_2021.Passes.PassCode_2021;
import javax.swing.*;
public class GroupsMenuBar extends DataMenuBar {
public GroupsMenuBar() {
super("группы", PassCode_2021.SynchronizeTests, PassCode_2021.ConvertCorrectnessTests,
super("группы",
PassCode_2021.ConvertCorrectnessTests,
PassCode_2021.PublishGroup,
PassCode_2021.CreateGroupFromDirectory,
PassCode_2021.CreateGroupFromFiles,

View File

@@ -1,4 +1,5 @@
package TestingSystem.Common;
import Common.Constants;
import Common.Utils.Utils;
import Repository.EmailMessage;
import Repository.Server.ServerCode;
@@ -135,14 +136,15 @@ public abstract class TestingPlanner<P extends TestingPackage> {
} else {
try {
if (Connect()) {
if ((boolean) ServerCommand(getCheckIfNeedsKillCode(), testingPackage.id)) {
int ptk_id = (int) ServerCommand(getCheckIfNeedsKillCode(), testingPackage.id);
if (ptk_id!= Constants.Nan) {
Print("package " + testingPackage.id + " NEEDS TO KILL");
Kill();
UpdatePackageState(TasksPackageState.Aborted);
EmailPackage();
ServerCommand(ServerCode.DeleteObjectByPK, ptk_id);
} else {
Session();
}
}
} catch (Exception ex) {

View File

@@ -408,27 +408,25 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
}
private void DVMPackageNeedsKill() {
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Constants.Nan;
int packageId = (int) request.object;
boolean res_ = false;
for (TestingPackageToKill packageToKill : db.testingPackagesToKill.Data.values()) {
if ((packageToKill.packageId == packageId) && (packageToKill.type == 0)) {
res_ = true;
response.object = packageToKill.id;
break;
}
}
response.object = res_;
}
private void SapforPackageNeedsKill() throws Exception {
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Constants.Nan;
int packageId = (int) request.object;
boolean res_ = false;
for (TestingPackageToKill packageToKill : db.testingPackagesToKill.Data.values()) {
if ((packageToKill.packageId == packageId) && (packageToKill.type == 1)) {
res_ = true;
response.object = packageToKill.id;
break;
}
}
response.object = res_;
}
private void DownloadDVMPackage() throws Exception {
int dvmPackage_id = (int) request.object;
@@ -468,6 +466,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
zipFolderPass.Do(workspace.getAbsolutePath(), results_zip.getAbsolutePath());
if (results_zip.exists())
response.object = Utils.packFile(results_zip);
else throw new RepositoryRefuseException("Не удалось заархивировать пакет тестирования SAPFOR с ключом "+ sapforPackage_id);
else
throw new RepositoryRefuseException("Не удалось заархивировать пакет тестирования SAPFOR с ключом " + sapforPackage_id);
}
}