2023-09-26 22:57:18 +03:00
|
|
|
package SapforTestingSystem.SapforTestingPlaner;
|
2023-09-30 00:18:44 +03:00
|
|
|
import Common.Global;
|
|
|
|
|
import Common.Utils.Utils;
|
|
|
|
|
import SapforTestingSystem.Json.SapforPackage_json;
|
|
|
|
|
import SapforTestingSystem.Json.SapforScenario_json;
|
|
|
|
|
import SapforTestingSystem.SapforTest.SapforTest;
|
2023-09-26 22:57:18 +03:00
|
|
|
import SapforTestingSystem.ThreadsPlanner.ThreadsPlanner;
|
2023-09-30 00:18:44 +03:00
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.nio.file.Paths;
|
2023-09-26 22:57:18 +03:00
|
|
|
public class SapforTestingPlanner extends ThreadsPlanner {
|
2023-09-30 00:18:44 +03:00
|
|
|
public SapforTestingPlanner() throws Exception {
|
2023-09-30 01:58:18 +03:00
|
|
|
super(Global.properties.threadsTimeout, Global.properties.threadsNum);
|
2023-09-30 00:18:44 +03:00
|
|
|
SapforScenario_json scenario_json = (SapforScenario_json) Utils.jsonFromFile(new File(Global.Home, "scenario.txt"), SapforScenario_json.class);
|
|
|
|
|
//формирование списка задач.
|
|
|
|
|
for (SapforPackage_json sapforPackage_json : scenario_json.packages) {
|
|
|
|
|
for (String testName : scenario_json.tests) {
|
|
|
|
|
addThread(() -> {
|
|
|
|
|
try {
|
|
|
|
|
new SapforTest(
|
|
|
|
|
new File(Global.Home, "SAPFOR_F.exe"),
|
|
|
|
|
Paths.get(Global.Home, sapforPackage_json.id, testName).toFile(),
|
|
|
|
|
sapforPackage_json.flags,
|
|
|
|
|
sapforPackage_json.codes).Do();
|
|
|
|
|
} catch (Exception exception) {
|
|
|
|
|
Global.Log.PrintException(exception);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2023-09-26 22:57:18 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|