промежуточный. исследую нити для запуска тестов.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package Common;
|
||||
import Common.Database.DataSet;
|
||||
import Common.ModesSupervisors.PackageModeSupervisor;
|
||||
import Common.UI.Menus_2023.ComponentsMenuBar.ComponentsMenuBar;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
@@ -14,7 +15,6 @@ import Repository.Component.Sapfor.Sapfor_F;
|
||||
import Repository.Component.Sapfor.TransformationPermission;
|
||||
import Repository.Server.ComponentsServer;
|
||||
import TestingSystem.TestingServer;
|
||||
import Visual_DVM_2021.Passes.All.PerformSapforTasksPackage;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import Visual_DVM_2021.UI.Interface.Loggable;
|
||||
@@ -350,23 +350,6 @@ public class Global {
|
||||
testingServer.Start();
|
||||
System.exit(0);
|
||||
}
|
||||
public static void PackageMode() throws Exception {
|
||||
Log = new Loggable() {
|
||||
@Override
|
||||
public String getLogHomePath() {
|
||||
return Home;
|
||||
}
|
||||
@Override
|
||||
public String getLogName() {
|
||||
return "PackageMode";
|
||||
}
|
||||
};
|
||||
Log.ClearLog();
|
||||
//--
|
||||
Pass_2021 pass = new PerformSapforTasksPackage();
|
||||
pass.Do(Home);
|
||||
//--
|
||||
}
|
||||
//---
|
||||
public static void Init(String... args) {
|
||||
System.out.println("VisualSapfor.jar started..");
|
||||
@@ -388,7 +371,18 @@ public class Global {
|
||||
TestingSystemMode();
|
||||
break;
|
||||
case Package:
|
||||
PackageMode();
|
||||
Log = new Loggable() {
|
||||
@Override
|
||||
public String getLogHomePath() {
|
||||
return Home;
|
||||
}
|
||||
@Override
|
||||
public String getLogName() {
|
||||
return "PackageMode";
|
||||
}
|
||||
};
|
||||
Log.ClearLog();
|
||||
new PackageModeSupervisor().Start();
|
||||
break;
|
||||
case Undefined:
|
||||
break;
|
||||
|
||||
21
src/Common/ModesSupervisors/PackageModeSupervisor.java
Normal file
21
src/Common/ModesSupervisors/PackageModeSupervisor.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package Common.ModesSupervisors;
|
||||
import Common.Global;
|
||||
import Common.Utils.InterruptThread;
|
||||
public class PackageModeSupervisor {
|
||||
protected Thread interruptThread = new InterruptThread(5000, () -> {System.exit(0);return null;});
|
||||
public void Start() {
|
||||
try {
|
||||
interruptThread.start();
|
||||
for (int i=1; i<=3; ++i){
|
||||
Thread thread = new TestThread(i);
|
||||
thread.start();
|
||||
}
|
||||
interruptThread.wait();
|
||||
Global.Log.Print("INTERRUPT THREAD DONE");
|
||||
// Pass_2021 pass = new PerformSapforTasksPackage();
|
||||
// pass.Do(Global.Home);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/Common/ModesSupervisors/TestThread.java
Normal file
16
src/Common/ModesSupervisors/TestThread.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package Common.ModesSupervisors;
|
||||
import Common.Global;
|
||||
public class TestThread extends Thread{
|
||||
public TestThread(int num){
|
||||
super(() -> {
|
||||
try {
|
||||
while (true) {
|
||||
Global.Log.Print("Test thread " +num+ "action");
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user