Баг. в нескольких местах неправильно определялось рабочее пространство визуализатора по умолчанию.

This commit is contained in:
2023-10-02 17:58:55 +03:00
parent 6271d6272a
commit 8df00d4969
5 changed files with 17 additions and 14 deletions

3
.idea/workspace.xml generated
View File

@@ -8,8 +8,9 @@
<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/Common/Global.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Global.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Utils.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common/Utils/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Utils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTestingPlaner/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTestingPlaner/SapforTestingPlanner.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteDownloadedBugReports.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteDownloadedBugReports.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />

View File

@@ -88,7 +88,6 @@ public class Global {
public static File PerformanceAnalyzerDirectory; public static File PerformanceAnalyzerDirectory;
public static File DataBackUpsDirectory; public static File DataBackUpsDirectory;
public static File PackagesDirectory; public static File PackagesDirectory;
public static File SapforPackagesDirectory;
//------------------------------------------------------------------ //------------------------------------------------------------------
public static Visualiser visualiser = null; public static Visualiser visualiser = null;
public static Visualizer_2 visualizer_2 = null; public static Visualizer_2 visualizer_2 = null;
@@ -127,7 +126,6 @@ public class Global {
Utils.CheckDirectory(StsDirectory = Paths.get(Home, Sts).toFile()); Utils.CheckDirectory(StsDirectory = Paths.get(Home, Sts).toFile());
Utils.CheckDirectory(TestsDirectory = Paths.get(Home, Tests).toFile()); Utils.CheckDirectory(TestsDirectory = Paths.get(Home, Tests).toFile());
Utils.CheckDirectory(PerformanceAnalyzerDirectory = Paths.get(Home, PerformanceAnalyzer).toFile()); Utils.CheckDirectory(PerformanceAnalyzerDirectory = Paths.get(Home, PerformanceAnalyzer).toFile());
Utils.CheckDirectory(SapforPackagesDirectory = Paths.get(Home, "SapforTasksPackages").toFile());
} }
public static void CheckServerDirectories() { public static void CheckServerDirectories() {
Utils.CheckDirectory(ComponentsDirectory = Paths.get(Home, components).toFile()); Utils.CheckDirectory(ComponentsDirectory = Paths.get(Home, components).toFile());

View File

@@ -1038,9 +1038,15 @@ public class Utils {
} }
public static void copyDirectory(File src, File dst) throws Exception { public static void copyDirectory(File src, File dst) throws Exception {
int code = Constants.Nan; int code = Constants.Nan;
String command = "xcopy " + String command =
Global.isWindows ?
("xcopy " +
Utils.DQuotes(src.getAbsolutePath()) + " " + Utils.DQuotes(src.getAbsolutePath()) + " " +
Utils.DQuotes(dst.getAbsolutePath()) + " /e"; Utils.DQuotes(dst.getAbsolutePath()) + " /e")
:
("cp -r " + Utils.DQuotes(src.getAbsolutePath()) + " " +
Utils.DQuotes(dst.getAbsolutePath())
);
try { try {
code = Runtime.getRuntime().exec(command).waitFor(); code = Runtime.getRuntime().exec(command).waitFor();
} catch (Exception ex) { } catch (Exception ex) {

View File

@@ -3,7 +3,6 @@ import Common.Current;
import Common.Global; import Common.Global;
import Common.UI.UI; import Common.UI.UI;
import Common.Utils.Utils; import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import Visual_DVM_2021.Passes.PassCode_2021; import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021; import Visual_DVM_2021.Passes.Pass_2021;
@@ -22,7 +21,7 @@ public class DeleteDownloadedBugReports extends Pass_2021<Vector<File>> {
@Override @Override
protected boolean canStart(Object... args) throws Exception { protected boolean canStart(Object... args) throws Exception {
target = null; target = null;
File workspace = new File(Global.db.settings.get(SettingName.Workspace).toString()); File workspace = Global.visualiser.getWorkspace();
File[] files = workspace.listFiles(pathname -> pathname.isDirectory() && pathname.getName().toLowerCase().startsWith("bugreport_")); File[] files = workspace.listFiles(pathname -> pathname.isDirectory() && pathname.getName().toLowerCase().startsWith("bugreport_"));
if (files != null) { if (files != null) {
target = new Vector<>(Arrays.asList(files)); target = new Vector<>(Arrays.asList(files));

View File

@@ -4,7 +4,6 @@ import Common.Global;
import Common.GlobalProperties; import Common.GlobalProperties;
import Common.UI.UI; import Common.UI.UI;
import Common.Utils.Utils; import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.LanguageName; import ProjectData.LanguageName;
import Repository.Server.ServerCode; import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021; import Repository.Server.ServerExchangeUnit_2021;
@@ -213,7 +212,7 @@ public class StartSapforTests extends Pass_2021<SapforScenario> {
target.tasksCount = allTasksCount; target.tasksCount = allTasksCount;
Global.db.Insert(target); Global.db.Insert(target);
//--->>> //--->>>
File scenarioWorkspace = Paths.get(Global.db.settings.get(SettingName.Workspace).Value, String.valueOf(target.id)).toFile(); File scenarioWorkspace = new File(Global.visualiser.getWorkspace(), String.valueOf(target.id));
Utils.CheckAndCleanDirectory(scenarioWorkspace); Utils.CheckAndCleanDirectory(scenarioWorkspace);
target.workspace = scenarioWorkspace.getAbsolutePath(); target.workspace = scenarioWorkspace.getAbsolutePath();
target.testsNames = String.join(";", testsNames_lower); target.testsNames = String.join(";", testsNames_lower);
@@ -249,10 +248,10 @@ public class StartSapforTests extends Pass_2021<SapforScenario> {
sapforTasksPackage.sapforconfiguration_id = configuration.id; sapforTasksPackage.sapforconfiguration_id = configuration.id;
sapforTasksPackage.flags = SapforConfigurationInterface.getFlags(configuration); sapforTasksPackage.flags = SapforConfigurationInterface.getFlags(configuration);
sapforTasksPackage.passesNames = String.join(";", passesNames); sapforTasksPackage.passesNames = String.join(";", passesNames);
//-- //--xcopy
Global.db.Insert(sapforTasksPackage); Global.db.Insert(sapforTasksPackage);
sapforTasksPackage.workspace = Paths.get( sapforTasksPackage.workspace = Paths.get(
Global.db.settings.get(SettingName.Workspace).Value, Global.visualiser.getWorkspace().getAbsolutePath(),
String.valueOf(target.id), String.valueOf(target.id),
String.valueOf(sapforTasksPackage.id) String.valueOf(sapforTasksPackage.id)
).toFile().getAbsolutePath(); ).toFile().getAbsolutePath();