Оптимизация анализа состояния версий пакетов сапфор
This commit is contained in:
2025-04-03 19:08:17 +03:00
parent 98ec37233a
commit 419af0766e
14 changed files with 142 additions and 68 deletions

View File

@@ -0,0 +1,47 @@
package _VisualDVM.Passes.All;
import Common.CommonConstants;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Server.TestingServerPass;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
import javafx.util.Pair;
import java.io.File;
public class RefreshSapforPackageResults extends TestingServerPass<SapforPackage> {
@Override
public String getIconPath() {
return "/icons/Menu/Undo.png";
}
@Override
protected boolean needsAnimation() {
return true;
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Global.testingServer.db.sapforPackages.getUI().CheckCurrent(Log))
return false;
target = Global.testingServer.db.sapforPackages.getUI().getCurrent();
if (!new File(target.getLocalWorkspace(), CommonConstants.LOADED).exists()) {
Log.Writeln_("Пакет не загружен!");
return false;
}
return true;
}
@Override
protected void body() throws Exception {
target.checkFinishState();
}
@Override
protected void performDone() throws Exception {
SendRequest(ServerCode.ReplaceSapforPackageResults, "",
new Pair<>(
target,
Utils_.fileToBytes(target.getJsonFile())
)
);
Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
}
}