уничтожение процесса тестирования.

This commit is contained in:
2023-09-30 18:19:31 +03:00
parent 3373d2e704
commit 2a69143550
8 changed files with 52 additions and 24 deletions

View File

@@ -1,22 +1,6 @@
package Common.Constants;
import java.util.regex.Pattern;
public class Constants {
public static final int Nan = -1;
public static char toStrike = (char) 822;
public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
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[] regular_metasymbols = new char[]{
'<', '>', '(', ')', '[', ']', '{', '}', '^', '-', '=', '$', '!', '|', '?', '*', '+', '.'
};
//все запретные символы через пробел.
public static String all_forbidden_characters_string = "";
//https://losst.ru/komandy-terminala-linux
public static String[] linux_system_commands = new String[]{
//<editor-fold desc="все линуксовые команды. их МНОГО">
@@ -355,4 +339,21 @@ public class Constants {
"zypper"
//</editor-fold>
};
public static final int Nan = -1;
public static char toStrike = (char) 822;
public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
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[] regular_metasymbols = new char[]{
'<', '>', '(', ')', '[', ']', '{', '}', '^', '-', '=', '$', '!', '|', '?', '*', '+', '.'
};
//все запретные символы через пробел.
public static String all_forbidden_characters_string = "";
public static String aborted = "ABORTED";
}

View File

@@ -345,6 +345,7 @@ public class Global {
System.exit(0);
}
public static void ScenarioMode() throws Exception {
isWindows = System.getProperty("os.name").startsWith("Windows");
Log = new Loggable() {
@Override
public String getLogHomePath() {

View File

@@ -6,7 +6,6 @@ import java.io.File;
import java.util.concurrent.Callable;
public class InterruptThread extends Thread{
//------------
public static final String Eliminated = "Eliminated";
public InterruptThread(int sleep_ms, Callable action){
super(() -> {
File interruptFile = new File(db_project_info.interrupt);
@@ -14,7 +13,7 @@ public class InterruptThread extends Thread{
while (true) {
Thread.sleep(sleep_ms);
if (interruptFile.exists()) {
FileUtils.writeStringToFile(new File(Eliminated + " by INTERRUPT file"), "");
FileUtils.writeStringToFile(new File("ABORTED"), "");
FileUtils.forceDelete(interruptFile);
action.call();
}