Добавил анимацию распаковки пакета сапфор после его скачивания.
This commit is contained in:
5
.idea/workspace.xml
generated
5
.idea/workspace.xml
generated
@@ -8,7 +8,10 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Repository/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/RepositoryServer.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/UI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/UI.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/ProjectData/Messages/Message.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ProjectData/Messages/Message.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SapforPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SapforPass.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package ProjectData.Messages;
|
|||||||
import Common.Constants;
|
import Common.Constants;
|
||||||
import Common.Current;
|
import Common.Current;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
|
import Common.Utils.Utils;
|
||||||
import GlobalData.Settings.SettingName;
|
import GlobalData.Settings.SettingName;
|
||||||
import ProjectData.SapforData.FileObject;
|
import ProjectData.SapforData.FileObject;
|
||||||
import ProjectData.SapforData.FileObjectWithMessages;
|
import ProjectData.SapforData.FileObjectWithMessages;
|
||||||
@@ -388,8 +389,12 @@ public class Message extends FileObject {
|
|||||||
idx += 2;
|
idx += 2;
|
||||||
}
|
}
|
||||||
} while (idx != -1);
|
} while (idx != -1);
|
||||||
if (sum != splited.length && !message.equals(""))
|
if (sum != splited.length && !message.equals("")) {
|
||||||
throw new PassException("Ошибка при декодировании сообщений на русском языке");
|
System.out.println("message="+ Utils.Brackets(message));
|
||||||
|
Utils.CopyToClipboard(message);
|
||||||
|
throw new PassException("Ошибка при декодировании сообщений на русском языке\n" +
|
||||||
|
"message=" + Utils.Brackets(message));
|
||||||
|
}
|
||||||
idx = 0;
|
idx = 0;
|
||||||
String result = "";
|
String result = "";
|
||||||
for (int z = 0; z < sum; ++z) {
|
for (int z = 0; z < sum; ++z) {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class Visualiser extends Component {
|
|||||||
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
||||||
@Override
|
@Override
|
||||||
public void GetVersionInfo() {
|
public void GetVersionInfo() {
|
||||||
version = 1024;
|
version = 1025;
|
||||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||||
date_text = df.format(getClassBuildTime());
|
date_text = df.format(getClassBuildTime());
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
package Visual_DVM_2021.Passes.All;
|
||||||
import Common.Current;
|
import Common.Current;
|
||||||
import Common.Global;
|
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import Repository.Server.ServerCode;
|
import Repository.Server.ServerCode;
|
||||||
import Repository.Server.ServerExchangeUnit_2021;
|
import Repository.Server.ServerExchangeUnit_2021;
|
||||||
@@ -9,10 +8,8 @@ import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
|
|||||||
import TestingSystem.TasksPackage.TasksPackageState;
|
import TestingSystem.TasksPackage.TasksPackageState;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
import Visual_DVM_2021.Passes.TestingSystemPass;
|
import Visual_DVM_2021.Passes.TestingSystemPass;
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Date;
|
|
||||||
public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPackage> {
|
public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPackage> {
|
||||||
@Override
|
@Override
|
||||||
public String getIconPath() {
|
public String getIconPath() {
|
||||||
@@ -55,14 +52,7 @@ public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPac
|
|||||||
@Override
|
@Override
|
||||||
protected void performDone() throws Exception {
|
protected void performDone() throws Exception {
|
||||||
super.performDone();
|
super.performDone();
|
||||||
File packageWorkspace = SapforTasksPackageInterface.getLocalWorkspace(target);
|
passes.get(PassCode_2021.UnpackSapforTasksPackage).Do(tmpArchive, 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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
32
src/Visual_DVM_2021/Passes/All/UnpackSapforTasksPackage.java
Normal file
32
src/Visual_DVM_2021/Passes/All/UnpackSapforTasksPackage.java
Normal 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());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ public enum PassCode_2021 {
|
|||||||
ShowAllParallelVariants,
|
ShowAllParallelVariants,
|
||||||
ShowParallelVariantsCoverage,
|
ShowParallelVariantsCoverage,
|
||||||
AbortSapforTaskPackage,
|
AbortSapforTaskPackage,
|
||||||
|
UnpackSapforTasksPackage,
|
||||||
//-
|
//-
|
||||||
DeleteServerSapfor,
|
DeleteServerSapfor,
|
||||||
StartSapforTests,
|
StartSapforTests,
|
||||||
@@ -311,6 +312,8 @@ public enum PassCode_2021 {
|
|||||||
switch (this) {
|
switch (this) {
|
||||||
case Undefined:
|
case Undefined:
|
||||||
return "?";
|
return "?";
|
||||||
|
case UnpackSapforTasksPackage:
|
||||||
|
return "Распаковка пакета задач SAPFOR";
|
||||||
case ShowSapforTaskPackage:
|
case ShowSapforTaskPackage:
|
||||||
return "Отобразить пакет задач SAPFOR";
|
return "Отобразить пакет задач SAPFOR";
|
||||||
case DownloadSapforTasksPackage:
|
case DownloadSapforTasksPackage:
|
||||||
|
|||||||
@@ -10,7 +10,12 @@ public class SapforPass extends SilentSapforPass {
|
|||||||
@Override
|
@Override
|
||||||
protected void performFinish() throws Exception {
|
protected void performFinish() throws Exception {
|
||||||
target.db.BeginTransaction();
|
target.db.BeginTransaction();
|
||||||
|
try {
|
||||||
unpackMessages();
|
unpackMessages();
|
||||||
|
}
|
||||||
|
catch (PassException ex){
|
||||||
|
Log.Writeln_(ex.getMessage());
|
||||||
|
}
|
||||||
target.db.Commit();
|
target.db.Commit();
|
||||||
}
|
}
|
||||||
protected void unpackMessages() throws Exception {
|
protected void unpackMessages() throws Exception {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import Common.Utils.TextLog;
|
|||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageTree;
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageTree;
|
||||||
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
import Visual_DVM_2021.Passes.Pass_2021;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@@ -52,7 +53,9 @@ public class SapforPackagesComparisonForm {
|
|||||||
TextLog log = new TextLog();
|
TextLog log = new TextLog();
|
||||||
if (Current.Check(log, Current.SapforTasksPackage)) {
|
if (Current.Check(log, Current.SapforTasksPackage)) {
|
||||||
object = Current.getSapforTasksPackage();
|
object = Current.getSapforTasksPackage();
|
||||||
|
if (SapforTasksPackageInterface.isLoaded(object)||(Pass_2021.passes.get(PassCode_2021.DownloadSapforTasksPackage).Do(object)))
|
||||||
showObject();
|
showObject();
|
||||||
|
else UI.Info("Пакет не закружен");
|
||||||
} else
|
} else
|
||||||
UI.Info(log.toString());
|
UI.Info(log.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user