Добавил анимацию распаковки пакета сапфор после его скачивания.

This commit is contained in:
2023-11-01 19:06:07 +03:00
parent b4635ae8a0
commit 7972fe5dc2
9 changed files with 59 additions and 18 deletions

View File

@@ -1,6 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Current;
import Common.Global;
import Common.Utils.Utils;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
@@ -9,10 +8,8 @@ import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
import TestingSystem.TasksPackage.TasksPackageState;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.TestingSystemPass;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.Date;
public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPackage> {
@Override
public String getIconPath() {
@@ -55,14 +52,7 @@ public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPac
@Override
protected void performDone() throws Exception {
super.performDone();
File packageWorkspace = SapforTasksPackageInterface.getLocalWorkspace(target);
Utils.forceDeleteWithCheck(packageWorkspace);
if (passes.get(PassCode_2021.UnzipFolderPass).Do(
tmpArchive.getAbsolutePath(),
Global.SapforPackagesDirectory.getAbsolutePath(), false
)) {
FileUtils.writeStringToFile(SapforTasksPackageInterface.getLoadedSign(target), new Date().toString());
}
passes.get(PassCode_2021.UnpackSapforTasksPackage).Do(tmpArchive, target);
}
}

View File

@@ -0,0 +1,32 @@
package Visual_DVM_2021.Passes.All;
import Common.Global;
import Common.Utils.Utils;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.Date;
public class UnpackSapforTasksPackage extends UnzipFolderPass<SapforTasksPackage> {
@Override
protected boolean needsAnimation() {
return true;
}
@Override
protected boolean canStart(Object... args) {
File tmpArchive = (File) args[0];
target = (SapforTasksPackage) args[1];
return super.canStart(tmpArchive.getAbsolutePath(),Global.SapforPackagesDirectory.getAbsolutePath(), false);
}
@Override
protected void performPreparation() throws Exception {
super.performPreparation();
File packageWorkspace = SapforTasksPackageInterface.getLocalWorkspace(target);
Utils.forceDeleteWithCheck(packageWorkspace);
}
@Override
protected void body() throws Exception {
super.body();
FileUtils.writeStringToFile(SapforTasksPackageInterface.getLoadedSign(target), new Date().toString());
}
}

View File

@@ -5,6 +5,7 @@ public enum PassCode_2021 {
ShowAllParallelVariants,
ShowParallelVariantsCoverage,
AbortSapforTaskPackage,
UnpackSapforTasksPackage,
//-
DeleteServerSapfor,
StartSapforTests,
@@ -311,6 +312,8 @@ public enum PassCode_2021 {
switch (this) {
case Undefined:
return "?";
case UnpackSapforTasksPackage:
return "Распаковка пакета задач SAPFOR";
case ShowSapforTaskPackage:
return "Отобразить пакет задач SAPFOR";
case DownloadSapforTasksPackage:

View File

@@ -10,7 +10,12 @@ public class SapforPass extends SilentSapforPass {
@Override
protected void performFinish() throws Exception {
target.db.BeginTransaction();
unpackMessages();
try {
unpackMessages();
}
catch (PassException ex){
Log.Writeln_(ex.getMessage());
}
target.db.Commit();
}
protected void unpackMessages() throws Exception {