2023-09-17 22:13:42 +03:00
|
|
|
|
package Visual_DVM_2021.Passes.All;
|
|
|
|
|
|
import Common.Database.Database;
|
|
|
|
|
|
import Common.Global;
|
2023-10-01 23:22:07 +03:00
|
|
|
|
import Common.Utils.Utils;
|
2023-10-06 21:01:52 +03:00
|
|
|
|
import Repository.Server.ServerCode;
|
|
|
|
|
|
import Repository.Server.ServerExchangeUnit_2021;
|
2023-10-01 23:22:07 +03:00
|
|
|
|
import SapforTestingSystem.SapforScenario.SapforScenario;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
2023-10-06 21:01:52 +03:00
|
|
|
|
import Visual_DVM_2021.Passes.Pass_2021;
|
|
|
|
|
|
import Visual_DVM_2021.Passes.TestingSystemPass;
|
2023-10-01 23:22:07 +03:00
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
public class DeleteSapforScenario extends DeleteObjectPass<SapforScenario> {
|
|
|
|
|
|
public DeleteSapforScenario() {
|
|
|
|
|
|
super(SapforScenario.class);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected Database getDb() {
|
2023-10-06 21:01:52 +03:00
|
|
|
|
return Global.testingServer.db;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected void performPreparation() throws Exception {
|
2023-10-01 23:22:07 +03:00
|
|
|
|
/*
|
|
|
|
|
|
if (Current.hasUI()&&Current.HasSapforTasksPackage()) {
|
|
|
|
|
|
UI.getMainWindow().getTestingWindow().RemoveSapforPackageFromComparison();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
2023-10-01 23:22:07 +03:00
|
|
|
|
*/
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected void body() throws Exception {
|
|
|
|
|
|
super.body();
|
2023-10-01 23:22:07 +03:00
|
|
|
|
Utils.delete_with_check(new File(target.workspace));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
2023-10-06 21:01:52 +03:00
|
|
|
|
@Override
|
|
|
|
|
|
protected void performDone() throws Exception {
|
|
|
|
|
|
super.performDone();
|
|
|
|
|
|
Pass_2021 serverPass = new TestingSystemPass<SapforScenario>() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
|
return "Удаление сценария задач SAPFOR с сервера";
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
|
|
|
|
|
target = (SapforScenario) args[0];
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected void ServerAction() throws Exception {
|
|
|
|
|
|
Command(new ServerExchangeUnit_2021(ServerCode.DeleteObject, "", target));
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
serverPass.Do(target);
|
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|