no message
This commit is contained in:
4
.idea/workspace.xml
generated
4
.idea/workspace.xml
generated
@@ -7,8 +7,12 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<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$/src/Repository/RepositoryClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/RepositoryClient.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Repository/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/RepositoryServer.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/UserConnection.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/UserConnection.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SSH/RepositoryServerSSHPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SSH/RepositoryServerSSHPass.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -33,7 +33,6 @@ public abstract class RepositoryClient {
|
||||
}
|
||||
//--
|
||||
protected Object ServerCommand(ServerCode code_in, String arg, Serializable object_in) throws Exception {
|
||||
System.out.println("Команда серверу " + code_in.toString() + "arg=" + arg + " object=" + object_in);
|
||||
TestingSystemPass<Object> pass = new TestingSystemPass<Object>() {
|
||||
@Override
|
||||
public String getDescription() {
|
||||
|
||||
@@ -177,7 +177,7 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
public void StartAction() throws Exception {
|
||||
}
|
||||
public void Start() throws Exception {
|
||||
Utils.createEmptyFile("kek");//Constants.STARTED);
|
||||
Utils.createEmptyFile(Constants.STARTED);
|
||||
DiagnosticSignalHandler.install("TERM", signalHandler);
|
||||
DiagnosticSignalHandler.install("INT", signalHandler);
|
||||
DiagnosticSignalHandler.install("ABRT", signalHandler);
|
||||
|
||||
@@ -18,6 +18,7 @@ import TestingSystem.Common.Test.TestType;
|
||||
import TestingSystem.Common.TestingPackageToKill.TestingPackageToKill;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage_json;
|
||||
import TestingSystem.DVM.DVMTestingChecker;
|
||||
import TestingSystem.SAPFOR.Json.SapforPackage_json;
|
||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
||||
@@ -159,14 +160,13 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
testingThread.start();
|
||||
}
|
||||
|
||||
// DVMTestingChecker dvmTestingChecker = new DVMTestingChecker();
|
||||
DVMTestingChecker dvmTestingChecker = new DVMTestingChecker();
|
||||
SapforTestingPlanner sapforTestingPlanner = new SapforTestingPlanner();
|
||||
//--
|
||||
protected Thread testingThread = new Thread(() -> {
|
||||
while (true) {
|
||||
// dvmTestingChecker.Perform();
|
||||
dvmTestingChecker.Perform();
|
||||
sapforTestingPlanner.Perform();
|
||||
System.out.println("sleep...");
|
||||
Utils.sleep(5000);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -466,6 +466,12 @@ public class UserConnection {
|
||||
shellChannel = null;
|
||||
System.gc();
|
||||
}
|
||||
public void waitForFileCreation(RemoteFile file) throws Exception {
|
||||
while (!Exists(file)){
|
||||
System.out.println(file.name +" NOT FOUND");
|
||||
Utils.sleep(1000);
|
||||
}
|
||||
}
|
||||
//возможно в дальнейшем обобщить чтобы вместо PID был файл вывода с задаваемым именем?
|
||||
public String startShellProcess(RemoteFile directory, String outFileName, String... commands) throws Exception {
|
||||
Vector<String> commands_ = new Vector<>();
|
||||
@@ -486,10 +492,7 @@ public class UserConnection {
|
||||
RemoteFile outFile = new RemoteFile(directory, outFileName);
|
||||
ShellConnect();
|
||||
pin.write(("nohup " + start_command + " &\r\n").getBytes());
|
||||
while (!Exists(outFile)){
|
||||
System.out.println(outFileName +" NOT FOUND");
|
||||
Utils.sleep(1000);
|
||||
}
|
||||
waitForFileCreation(outFile);
|
||||
ShellDisconnect();
|
||||
return readFromFile(outFile).replace("\n","").replace("\r","");
|
||||
}
|
||||
|
||||
@@ -41,9 +41,11 @@ public abstract class RepositoryServerSSHPass extends ConnectionPass {
|
||||
}
|
||||
//--
|
||||
protected void StartServer() throws Exception {
|
||||
user.connection.startShellProcess(serverHome,Constants.STARTED, "java -jar " + getServerFileName());
|
||||
user.connection.startShellProcess(serverHome,"server_out.txt", "java -jar " + getServerFileName());
|
||||
//--
|
||||
RemoteFile STARTED = new RemoteFile(serverHome, Constants.STARTED);
|
||||
user.connection.waitForFileCreation(STARTED);
|
||||
//---
|
||||
RemoteFile StartLog = new RemoteFile(serverHome, Constants.STARTED +
|
||||
"_by_" +
|
||||
Current.getAccount().email +
|
||||
|
||||
Reference in New Issue
Block a user