рефакторинг. ввел оберточные методы работы с json объектами
This commit is contained in:
14
.idea/workspace.xml
generated
14
.idea/workspace.xml
generated
@@ -7,13 +7,15 @@
|
|||||||
</component>
|
</component>
|
||||||
<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 afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforPackage_json.java" afterDir="false" />
|
|
||||||
<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/ModesSupervisors/PackageModeSupervisor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/ModesSupervisors/PackageModeSupervisor.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/Constants/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Constants/Constants.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/Json/Scenario_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforScenario_json.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/Current.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Current.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforConfiguration/SapforConfigurationInterface.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforConfiguration/SapforConfigurationInterface.java" 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/Visual_DVM_2021/Passes/All/PerformSapforTasksPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/PerformSapforTasksPackage.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/PackageModeSupervisor.java" beforeDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/PerformScenario.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/PerformScenario.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.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/SPF_CreateParallelVariant.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SPF_CreateParallelVariant.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" />
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
"ProjectDBName": "new_project_base.sqlite",
|
"ProjectDBName": "new_project_base.sqlite",
|
||||||
"BugReportsDBName": "bug_reports.sqlite",
|
"BugReportsDBName": "bug_reports.sqlite",
|
||||||
"TestsDBName": "tests.sqlite",
|
"TestsDBName": "tests.sqlite",
|
||||||
"ComponentsWindowWidth": 866,
|
"ComponentsWindowWidth": 843,
|
||||||
"ComponentsWindowHeight": 300,
|
"ComponentsWindowHeight": 250,
|
||||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||||
"Sapfor_FPath": "E:\\",
|
"Sapfor_FPath": "E:\\",
|
||||||
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
|
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package Common.Constants;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
public class Constants {
|
public class Constants {
|
||||||
public static final int Nan = -1;
|
public static final int Nan = -1;
|
||||||
|
public static char toStrike = (char) 822;
|
||||||
public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
|
public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
|
||||||
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
|
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
|
||||||
public static char[] forbidden_file_name_characters = new char[]{
|
public static char[] forbidden_file_name_characters = new char[]{
|
||||||
|
|||||||
@@ -497,6 +497,6 @@ public enum Current {
|
|||||||
Normal,
|
Normal,
|
||||||
Server,
|
Server,
|
||||||
Testing,
|
Testing,
|
||||||
Package
|
Scenario
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package Common;
|
package Common;
|
||||||
import Common.Database.DataSet;
|
import Common.Database.DataSet;
|
||||||
import Common.ModesSupervisors.PackageModeSupervisor;
|
|
||||||
import Common.UI.Menus_2023.ComponentsMenuBar.ComponentsMenuBar;
|
import Common.UI.Menus_2023.ComponentsMenuBar.ComponentsMenuBar;
|
||||||
import Common.UI.UI;
|
import Common.UI.UI;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
@@ -14,16 +13,15 @@ import Repository.Component.Sapfor.MessagesServer;
|
|||||||
import Repository.Component.Sapfor.Sapfor_F;
|
import Repository.Component.Sapfor.Sapfor_F;
|
||||||
import Repository.Component.Sapfor.TransformationPermission;
|
import Repository.Component.Sapfor.TransformationPermission;
|
||||||
import Repository.Server.ComponentsServer;
|
import Repository.Server.ComponentsServer;
|
||||||
|
import SapforTestingSystem.SapforTestingPlaner.SapforTestingPlanner;
|
||||||
import TestingSystem.TestingServer;
|
import TestingSystem.TestingServer;
|
||||||
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;
|
||||||
import Visual_DVM_2021.UI.Interface.Loggable;
|
import Visual_DVM_2021.UI.Interface.Loggable;
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
|
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
|
||||||
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class Global {
|
public class Global {
|
||||||
@@ -106,15 +104,11 @@ public class Global {
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
public static Loggable Log;
|
public static Loggable Log;
|
||||||
public static void SynschronizeProperties() {
|
public static void SynschronizeProperties() {
|
||||||
//---- NEW -----
|
|
||||||
try {
|
try {
|
||||||
File new_propertiesFile = Paths.get(Home, "properties").toFile();
|
File new_propertiesFile = Paths.get(Home, "properties").toFile();
|
||||||
if (new_propertiesFile.exists()) {
|
if (new_propertiesFile.exists())
|
||||||
String packed = FileUtils.readFileToString(new_propertiesFile, Charset.defaultCharset());
|
properties = (GlobalProperties) Utils.jsonFromFile(new_propertiesFile, GlobalProperties.class);
|
||||||
properties = Utils.gson.fromJson(packed, GlobalProperties.class);
|
Utils.jsonToFile(properties, new_propertiesFile);
|
||||||
}
|
|
||||||
//пусть всегда в него пишет. с учетом того, что новые настройки могут появиться.
|
|
||||||
FileUtils.writeStringToFile(new_propertiesFile, Utils.jsonToPrettyFormat(Utils.gson.toJson(properties)));
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -350,6 +344,21 @@ public class Global {
|
|||||||
testingServer.Start();
|
testingServer.Start();
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
public static void ScenarioMode() throws Exception {
|
||||||
|
Log = new Loggable() {
|
||||||
|
@Override
|
||||||
|
public String getLogHomePath() {
|
||||||
|
return Home;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getLogName() {
|
||||||
|
return "Scenario";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Log.ClearLog();
|
||||||
|
SapforTestingPlanner planner = new SapforTestingPlanner();
|
||||||
|
//planner.Start();
|
||||||
|
}
|
||||||
//---
|
//---
|
||||||
public static void Init(String... args) {
|
public static void Init(String... args) {
|
||||||
System.out.println("VisualSapfor.jar started..");
|
System.out.println("VisualSapfor.jar started..");
|
||||||
@@ -370,19 +379,8 @@ public class Global {
|
|||||||
case Testing:
|
case Testing:
|
||||||
TestingSystemMode();
|
TestingSystemMode();
|
||||||
break;
|
break;
|
||||||
case Package:
|
case Scenario:
|
||||||
Log = new Loggable() {
|
ScenarioMode();
|
||||||
@Override
|
|
||||||
public String getLogHomePath() {
|
|
||||||
return Home;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getLogName() {
|
|
||||||
return "PackageMode";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Log.ClearLog();
|
|
||||||
new PackageModeSupervisor().Do();
|
|
||||||
break;
|
break;
|
||||||
case Undefined:
|
case Undefined:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
package Common;
|
|
||||||
public class PackageModeSupervisor {
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package Common;
|
package Common;
|
||||||
import Common.UI.Menus_2023.StableMenuItem;
|
import Common.UI.Menus_2023.StableMenuItem;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -39,7 +38,7 @@ public abstract class Properties {
|
|||||||
}
|
}
|
||||||
public void Update() {
|
public void Update() {
|
||||||
try {
|
try {
|
||||||
FileUtils.write(getFile(), Utils.jsonToPrettyFormat(Utils.gson.toJson(this)));
|
Utils.jsonToFile(this, getFile());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class MainMenuBar extends VisualiserMenuBar {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
/*
|
||||||
add(new MenuBarButton() {
|
add(new MenuBarButton() {
|
||||||
{
|
{
|
||||||
setIcon("/icons/Comparsion.png");
|
setIcon("/icons/Comparsion.png");
|
||||||
@@ -47,6 +48,7 @@ public class MainMenuBar extends VisualiserMenuBar {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
addPasses(PassCode_2021.ShowInstruction);
|
addPasses(PassCode_2021.ShowInstruction);
|
||||||
//-
|
//-
|
||||||
setPreferredSize(new Dimension(0, 30));
|
setPreferredSize(new Dimension(0, 30));
|
||||||
|
|||||||
@@ -34,7 +34,15 @@ import java.util.regex.Pattern;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
public class Utils {
|
public class Utils {
|
||||||
public static Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
public static final Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
||||||
|
public static Object jsonFromFile(File file, Class json_class) throws Exception {
|
||||||
|
String packed = FileUtils.readFileToString(file, Charset.defaultCharset());
|
||||||
|
return Utils.gson.fromJson(packed, json_class);
|
||||||
|
}
|
||||||
|
public static void jsonToFile(Object json_object, File file) throws Exception {
|
||||||
|
FileUtils.writeStringToFile(file, Utils.jsonToPrettyFormat(Utils.gson.toJson(json_object)));
|
||||||
|
}
|
||||||
|
//--->>
|
||||||
public static String hideRegularMetasymbols(String word) {
|
public static String hideRegularMetasymbols(String word) {
|
||||||
String res = word.replace("\\", "\\\\");
|
String res = word.replace("\\", "\\\\");
|
||||||
for (char c : Constants.regular_metasymbols)
|
for (char c : Constants.regular_metasymbols)
|
||||||
@@ -896,72 +904,23 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
public static char toStrike = (char) 822;
|
|
||||||
public static String strikeThrough(String s) {
|
public static String strikeThrough(String s) {
|
||||||
StringBuilder res = new StringBuilder();
|
StringBuilder res = new StringBuilder();
|
||||||
for (char c : s.toCharArray()) {
|
for (char c : s.toCharArray()) {
|
||||||
res.append(c);
|
res.append(c);
|
||||||
if (c != toStrike)
|
if (c != Constants.toStrike)
|
||||||
res.append(toStrike);
|
res.append(Constants.toStrike);
|
||||||
}
|
}
|
||||||
return res.toString();
|
return res.toString();
|
||||||
}
|
}
|
||||||
public static String noStrikeThrough(String s) {
|
public static String noStrikeThrough(String s) {
|
||||||
StringBuilder res = new StringBuilder();
|
StringBuilder res = new StringBuilder();
|
||||||
for (char c : s.toCharArray()) {
|
for (char c : s.toCharArray()) {
|
||||||
if (c != (toStrike))
|
if (c != (Constants.toStrike))
|
||||||
res.append(c);
|
res.append(c);
|
||||||
}
|
}
|
||||||
return res.toString();
|
return res.toString();
|
||||||
}
|
}
|
||||||
public static String splitToolTip(String tip, int length) {
|
|
||||||
int DIALOG_TOOLTIP_MAX_SIZE = 75;
|
|
||||||
int SPACE_BUFFER = 10;
|
|
||||||
if (tip.length() <= length + SPACE_BUFFER) {
|
|
||||||
return tip;
|
|
||||||
}
|
|
||||||
Vector<String> parts = new Vector<>();
|
|
||||||
int maxLength = 0;
|
|
||||||
String overLong = tip.substring(0, length + SPACE_BUFFER);
|
|
||||||
int lastSpace = overLong.lastIndexOf(' ');
|
|
||||||
if (lastSpace >= length) {
|
|
||||||
parts.add(tip.substring(0, lastSpace));
|
|
||||||
maxLength = lastSpace;
|
|
||||||
} else {
|
|
||||||
parts.add(tip.substring(0, length));
|
|
||||||
maxLength = length;
|
|
||||||
}
|
|
||||||
while (maxLength < tip.length()) {
|
|
||||||
if (maxLength + length < tip.length()) {
|
|
||||||
parts.add(tip.substring(maxLength, maxLength + length));
|
|
||||||
maxLength += maxLength + length;
|
|
||||||
} else {
|
|
||||||
parts.add(tip.substring(maxLength));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
StringBuilder sb = new StringBuilder("<html>");
|
|
||||||
for (int i = 0; i < parts.size() - 1; i++) {
|
|
||||||
sb.append(parts.get(i) + "<br>");
|
|
||||||
}
|
|
||||||
sb.append(parts.get(parts.size() - 1));
|
|
||||||
sb.append(("</html>"));
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
public static String appendString(String s, int sizeTo, char symbol) {
|
|
||||||
int delta = sizeTo - s.length();
|
|
||||||
StringBuilder res = new StringBuilder(s);
|
|
||||||
if (delta <= 0) {
|
|
||||||
for (int i = 0; i < sizeTo; ++i)
|
|
||||||
res.append(symbol);
|
|
||||||
}
|
|
||||||
for (int i = 0; i < delta; ++i) {
|
|
||||||
res.append(symbol);
|
|
||||||
}
|
|
||||||
return res.toString();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
public static void addEmptyLines(Vector<String> lines, int num) {
|
public static void addEmptyLines(Vector<String> lines, int num) {
|
||||||
IntStream.range(0, num).mapToObj(i -> "").forEach(lines::add);
|
IntStream.range(0, num).mapToObj(i -> "").forEach(lines::add);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
package SapforTestingSystem.SapforTestingPlaner;
|
package SapforTestingSystem.SapforTestingPlaner;
|
||||||
import Common.Global;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
import SapforTestingSystem.ThreadsPlanner.ThreadsPlanner;
|
import SapforTestingSystem.ThreadsPlanner.ThreadsPlanner;
|
||||||
public class SapforTestingPlanner extends ThreadsPlanner {
|
public class SapforTestingPlanner extends ThreadsPlanner {
|
||||||
public SapforTestingPlanner() {
|
public SapforTestingPlanner() {
|
||||||
super(2000, 4);
|
super(2000, 4);
|
||||||
//--
|
//--
|
||||||
|
/*
|
||||||
for (int i = 1; i <= 20; ++i) {
|
for (int i = 1; i <= 20; ++i) {
|
||||||
int thread_number = i;
|
int thread_number = i;
|
||||||
addThread(() -> {
|
addThread(() -> {
|
||||||
@@ -15,5 +14,6 @@ public class SapforTestingPlanner extends ThreadsPlanner {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
package Visual_DVM_2021.Passes.All;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
import Common.Utils.Utils;
|
|
||||||
import SapforTestingSystem.SapforTask.SapforTask;
|
|
||||||
import SapforTestingSystem.Json.ScenarioResults_json;
|
import SapforTestingSystem.Json.ScenarioResults_json;
|
||||||
|
import SapforTestingSystem.SapforTask.SapforTask;
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
import Visual_DVM_2021.Passes.Pass_2021;
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.charset.Charset;
|
|
||||||
public class AnalyseSapforPackageResults extends Pass_2021<ScenarioResults_json> {
|
public class AnalyseSapforPackageResults extends Pass_2021<ScenarioResults_json> {
|
||||||
File packageWorkspace;
|
File packageWorkspace;
|
||||||
File scenarioFile;
|
File scenarioFile;
|
||||||
@@ -23,8 +20,8 @@ public class AnalyseSapforPackageResults extends Pass_2021<ScenarioResults_json>
|
|||||||
packageWorkspace = new File((String) args[0]);
|
packageWorkspace = new File((String) args[0]);
|
||||||
scenarioFile = new File(packageWorkspace, "results.txt");
|
scenarioFile = new File(packageWorkspace, "results.txt");
|
||||||
//--
|
//--
|
||||||
String packed = FileUtils.readFileToString(scenarioFile, Charset.defaultCharset());
|
// String packed = FileUtils.readFileToString(scenarioFile, Charset.defaultCharset());
|
||||||
target = Utils.gson.fromJson(packed, ScenarioResults_json.class);
|
// target = Utils.gson.fromJson(packed, ScenarioResults_json.class);
|
||||||
//---
|
//---
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class SPF_CreateParallelVariant extends SapforTransformation {
|
|||||||
@Override
|
@Override
|
||||||
protected void performFinish() throws Exception {
|
protected void performFinish() throws Exception {
|
||||||
//в пакетном режиме вариант всегда один. поэтому, сообщения надо распаковать сразу.
|
//в пакетном режиме вариант всегда один. поэтому, сообщения надо распаковать сразу.
|
||||||
if (Current.mode.equals(Current.Mode.Package))
|
if (Current.mode.equals(Current.Mode.Scenario))
|
||||||
super.performFinish();
|
super.performFinish();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -224,9 +224,9 @@ public class StartSapforTests extends Pass_2021<SapforScenario> {
|
|||||||
FileUtils.copyFile(Global.visualiser.getFile(), visualiser);
|
FileUtils.copyFile(Global.visualiser.getFile(), visualiser);
|
||||||
ShowMessage2("Создание настроек");
|
ShowMessage2("Создание настроек");
|
||||||
GlobalProperties properties = new GlobalProperties();
|
GlobalProperties properties = new GlobalProperties();
|
||||||
properties.Mode = Current.Mode.Package;
|
properties.Mode = Current.Mode.Scenario;
|
||||||
File propertiesFile = new File(target.workspace, "properties");
|
//----
|
||||||
FileUtils.write(propertiesFile, Utils.jsonToPrettyFormat(Utils.gson.toJson(properties)));
|
Utils.jsonToFile(properties, new File(target.workspace, "properties"));
|
||||||
//----
|
//----
|
||||||
File scenarioFile = new File(target.workspace, "scenario.txt");
|
File scenarioFile = new File(target.workspace, "scenario.txt");
|
||||||
SapforScenario_json scenario_json = new SapforScenario_json();
|
SapforScenario_json scenario_json = new SapforScenario_json();
|
||||||
@@ -275,7 +275,7 @@ public class StartSapforTests extends Pass_2021<SapforScenario> {
|
|||||||
scenario_json.packages.add(package_json);
|
scenario_json.packages.add(package_json);
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
FileUtils.write(scenarioFile, Utils.jsonToPrettyFormat(Utils.gson.toJson(scenario_json)));
|
Utils.jsonToFile(scenario_json, scenarioFile);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void showFinish() throws Exception {
|
protected void showFinish() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user