no message
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMPackage;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
@@ -29,7 +29,7 @@ public class DVMPackagesBar extends DataMenuBar {
|
||||
});
|
||||
}
|
||||
public void Mark() {
|
||||
setIcon(CommonUtils.getIcon(DVMPackageDBTable.filterMyOnly ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
setIcon(Utils_.getIcon(DVMPackageDBTable.filterMyOnly ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
}
|
||||
});
|
||||
add(new MenuBarButton() {
|
||||
@@ -44,7 +44,7 @@ public class DVMPackagesBar extends DataMenuBar {
|
||||
});
|
||||
}
|
||||
public void Mark() {
|
||||
setIcon(CommonUtils.getIcon(DVMPackageDBTable.filterActive ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
setIcon(Utils_.getIcon(DVMPackageDBTable.filterActive ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMTasks;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
@@ -36,9 +36,9 @@ public class DVMCompilationTask extends DVMTask {
|
||||
public static String checkEnvironments(String environmentsSet_in) {
|
||||
if (!environmentsSet_in.contains("DVMH_NO_DIRECT_COPY")) {
|
||||
if (environmentsSet_in.isEmpty())
|
||||
return "DVMH_NO_DIRECT_COPY=" + CommonUtils.DQuotes("1");
|
||||
return "DVMH_NO_DIRECT_COPY=" + Utils_.DQuotes("1");
|
||||
else
|
||||
return environmentsSet_in + " " + "DVMH_NO_DIRECT_COPY=" + CommonUtils.DQuotes("1");
|
||||
return environmentsSet_in + " " + "DVMH_NO_DIRECT_COPY=" + Utils_.DQuotes("1");
|
||||
} else
|
||||
return environmentsSet_in;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.TestingSystem.DVM;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
@@ -62,12 +62,12 @@ public abstract class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
int i = 1;
|
||||
for (ProjectFile program : language_programs) {
|
||||
//--
|
||||
String object = CommonUtils.DQuotes(language + "_" + i + ".o");
|
||||
String object = Utils_.DQuotes(language + "_" + i + ".o");
|
||||
module_objects.add(object);
|
||||
module_body += object + ":\n" + "\t" + String.join(" ", Utils.MFVar(LANG_ + "COMMAND"), Utils.MFVar(LANG_ + "FLAGS"), program.getStyleOptions(), "-c", program.getQSourceName(), "-o", object + "\n\n");
|
||||
++i;
|
||||
}
|
||||
titles.add(String.join("\n", LANG_ + "COMMAND=" + CommonUtils.DQuotes(dvm_drv) + " " + language.getDVMCompile(), LANG_ + "FLAGS=" + flags, LANG_ + "OBJECTS=" + String.join(" ", module_objects), ""));
|
||||
titles.add(String.join("\n", LANG_ + "COMMAND=" + Utils_.DQuotes(dvm_drv) + " " + language.getDVMCompile(), LANG_ + "FLAGS=" + flags, LANG_ + "OBJECTS=" + String.join(" ", module_objects), ""));
|
||||
objects.add(Utils.MFVar(LANG_ + "OBJECTS"));
|
||||
bodies.add(module_body);
|
||||
}
|
||||
@@ -78,13 +78,13 @@ public abstract class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
Vector<String> titles = new Vector<>();
|
||||
Vector<String> objects = new Vector<>();
|
||||
Vector<String> bodies = new Vector<>();
|
||||
String binary = CommonUtils.DQuotes("0");
|
||||
String binary = Utils_.DQuotes("0");
|
||||
//----->>
|
||||
for (LanguageName languageName : programs.keySet()) {
|
||||
generateForLanguage(dvm_drv, languageName, programs.get(languageName), titles, objects, bodies, flags);
|
||||
}
|
||||
//----->>
|
||||
return String.join("\n", "LINK_COMMAND=" + CommonUtils.DQuotes(dvm_drv) + " " + test_language.getDVMLink(), "LINK_FLAGS=" + flags + "\n", String.join("\n", titles), "all: " + binary, binary + " : " + String.join(" ", objects), "\t" + Utils.MFVar("LINK_COMMAND") + " " + Utils.MFVar("LINK_FLAGS") + " " + String.join(" ", objects) + " -o " + binary, String.join(" ", bodies));
|
||||
return String.join("\n", "LINK_COMMAND=" + Utils_.DQuotes(dvm_drv) + " " + test_language.getDVMLink(), "LINK_FLAGS=" + flags + "\n", String.join("\n", titles), "all: " + binary, binary + " : " + String.join(" ", objects), "\t" + Utils.MFVar("LINK_COMMAND") + " " + Utils.MFVar("LINK_FLAGS") + " " + String.join(" ", objects) + " -o " + binary, String.join(" ", bodies));
|
||||
}
|
||||
public void getTasksInfo(List<? extends DVMTask> tasks, String file_name) throws Exception {
|
||||
LinkedHashMap<Integer, DVMTask> sorted_tasks = new LinkedHashMap<>();
|
||||
@@ -111,7 +111,7 @@ public abstract class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
try {
|
||||
if (isPrintOn()) {
|
||||
System.out.println(message);
|
||||
CommonUtils.MainLog.Print(message);
|
||||
Utils_.MainLog.Print(message);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
@@ -138,16 +138,16 @@ public abstract class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
public void perform() throws Exception {
|
||||
Print("Проверка сервера...");
|
||||
String currentServerName = (String) ServerCommand(ServerCode.GetServerName);
|
||||
Print("имя текущего сервера " + CommonUtils.Brackets(currentServerName));
|
||||
Print("имя сервера, создавшего нить " + CommonUtils.Brackets(serverName));
|
||||
Print("имя текущего сервера " + Utils_.Brackets(currentServerName));
|
||||
Print("имя сервера, создавшего нить " + Utils_.Brackets(serverName));
|
||||
if (!serverName.equals(currentServerName)) {
|
||||
Finalize("Несоответствующий сервер");
|
||||
}
|
||||
Print("Запрос активных пакетов для машины " + CommonUtils.Brackets(machine.getURL()));
|
||||
Print("Запрос активных пакетов для машины " + Utils_.Brackets(machine.getURL()));
|
||||
testingPackage = null;
|
||||
Vector<DVMPackage> activePackages = (Vector<DVMPackage>) ServerCommand(getActivePackagesCode(), machine.getURL(), null);
|
||||
if (activePackages.isEmpty())
|
||||
Finalize("Не найдено активных пакетов для машины " + CommonUtils.Brackets(machine.getURL()));
|
||||
Finalize("Не найдено активных пакетов для машины " + Utils_.Brackets(machine.getURL()));
|
||||
for (DVMPackage activePackage : activePackages)
|
||||
PerformPackage(activePackage);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package _VisualDVM.TestingSystem.DVM;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
@@ -172,26 +172,26 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
||||
@Override
|
||||
protected void PackageStart() throws Exception {
|
||||
String plannerStartCommand = String.join(" ",
|
||||
CommonUtils.DQuotes(getPlanner()),
|
||||
CommonUtils.DQuotes(user.workspace),
|
||||
CommonUtils.DQuotes(packageRemoteWorkspace.full_name),
|
||||
CommonUtils.DQuotes(testingPackage.kernels),
|
||||
CommonUtils.DQuotes(testingPackage.drv));
|
||||
Utils_.DQuotes(getPlanner()),
|
||||
Utils_.DQuotes(user.workspace),
|
||||
Utils_.DQuotes(packageRemoteWorkspace.full_name),
|
||||
Utils_.DQuotes(testingPackage.kernels),
|
||||
Utils_.DQuotes(testingPackage.drv));
|
||||
user.connection.startShellProcess(packageRemoteWorkspace, "planner_output",
|
||||
"ulimit -s unlimited", plannerStartCommand);
|
||||
//---
|
||||
RemoteFile PID = new RemoteFile(packageRemoteWorkspace, "PID");
|
||||
while (!user.connection.Exists(PID)) {
|
||||
Print("PID not found");
|
||||
CommonUtils.sleep(1000);
|
||||
Utils_.sleep(1000);
|
||||
}
|
||||
testingPackage.PID = user.connection.readFromFile(PID).replace("\n", "").replace("\r", "");
|
||||
//---
|
||||
System.out.println("PID=" + CommonUtils.Brackets(testingPackage.PID));
|
||||
System.out.println("PID=" + Utils_.Brackets(testingPackage.PID));
|
||||
RemoteFile STARTED = new RemoteFile(packageRemoteWorkspace, "STARTED");
|
||||
while (!user.connection.Exists(STARTED)) {
|
||||
Print("waiting for package start...");
|
||||
CommonUtils.sleep(1000);
|
||||
Utils_.sleep(1000);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@@ -234,7 +234,7 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
||||
Utils.CheckDirectory(packageLocalWorkspace);
|
||||
RemoteFile remote_results_archive = new RemoteFile(packageRemoteWorkspace, "results.zip");
|
||||
File results_archive = new File(packageLocalWorkspace, "results.zip");
|
||||
user.connection.performScript(packageRemoteWorkspace, "zip -r " + CommonUtils.DQuotes("results.zip") + " " + CommonUtils.DQuotes("results"));
|
||||
user.connection.performScript(packageRemoteWorkspace, "zip -r " + Utils_.DQuotes("results.zip") + " " + Utils_.DQuotes("results"));
|
||||
//---
|
||||
if (user.connection.Exists(remote_results_archive)) {
|
||||
user.connection.getSingleFile(remote_results_archive.full_name, results_archive.getAbsolutePath());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.DVM;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
@@ -56,35 +56,35 @@ public class UserConnection {
|
||||
try {
|
||||
in.close();
|
||||
} catch (Exception exception) {
|
||||
CommonUtils.MainLog.PrintException(exception);
|
||||
Utils_.MainLog.PrintException(exception);
|
||||
}
|
||||
}
|
||||
if (out != null) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (Exception exception) {
|
||||
CommonUtils.MainLog.PrintException(exception);
|
||||
Utils_.MainLog.PrintException(exception);
|
||||
}
|
||||
}
|
||||
if (pin != null) {
|
||||
try {
|
||||
pin.close();
|
||||
} catch (Exception exception) {
|
||||
CommonUtils.MainLog.PrintException(exception);
|
||||
Utils_.MainLog.PrintException(exception);
|
||||
}
|
||||
}
|
||||
if (pout != null) {
|
||||
try {
|
||||
pout.close();
|
||||
} catch (Exception exception) {
|
||||
CommonUtils.MainLog.PrintException(exception);
|
||||
Utils_.MainLog.PrintException(exception);
|
||||
}
|
||||
}
|
||||
if (fromServer != null) {
|
||||
try {
|
||||
fromServer.close();
|
||||
} catch (Exception exception) {
|
||||
CommonUtils.MainLog.PrintException(exception);
|
||||
Utils_.MainLog.PrintException(exception);
|
||||
}
|
||||
}
|
||||
if (sftpChannel != null) sftpChannel.disconnect();
|
||||
@@ -119,7 +119,7 @@ public class UserConnection {
|
||||
if ((maxSize == 0) || getFileKBSize(src.full_name) <= maxSize) {
|
||||
getSingleFile(src.full_name, dst.getAbsolutePath());
|
||||
} else {
|
||||
Utils.WriteToFile(dst, "Размер файла превышает " + maxSize + " KB.\n" + "Файл не загружен. Его можно просмотреть на машине по адресу\n" + CommonUtils.Brackets(src.full_name));
|
||||
Utils.WriteToFile(dst, "Размер файла превышает " + maxSize + " KB.\n" + "Файл не загружен. Его можно просмотреть на машине по адресу\n" + Utils_.Brackets(src.full_name));
|
||||
}
|
||||
}
|
||||
public void putSingleFile(File src, RemoteFile dst) throws Exception {
|
||||
@@ -132,8 +132,8 @@ public class UserConnection {
|
||||
//-
|
||||
public void RMDIR(String dir) throws Exception {
|
||||
if (!dir.isEmpty() && !dir.equals("/") && !dir.equals("\\") && !dir.equals("*")) {
|
||||
Command("rm -rf " + CommonUtils.DQuotes(dir));
|
||||
} else throw new PassException("Недопустимый путь для удаления папки " + CommonUtils.DQuotes(dir));
|
||||
Command("rm -rf " + Utils_.DQuotes(dir));
|
||||
} else throw new PassException("Недопустимый путь для удаления папки " + Utils_.DQuotes(dir));
|
||||
}
|
||||
//-
|
||||
public void SynchronizeSubDirsR(File local_dir, RemoteFile remote_dir) throws Exception {
|
||||
@@ -240,9 +240,9 @@ public class UserConnection {
|
||||
sftpChannel.rm(file.full_name);
|
||||
}
|
||||
//--
|
||||
writeToFile("cd " + CommonUtils.DQuotes(directory.full_name) + "\n" + String.join("\n", commands), script_file);
|
||||
writeToFile("cd " + Utils_.DQuotes(directory.full_name) + "\n" + String.join("\n", commands), script_file);
|
||||
//--
|
||||
Command(CommonUtils.DQuotes(script_file.full_name) + " 1>" + CommonUtils.DQuotes(out.full_name) + " 2>" + CommonUtils.DQuotes(err.full_name));
|
||||
Command(Utils_.DQuotes(script_file.full_name) + " 1>" + Utils_.DQuotes(out.full_name) + " 2>" + Utils_.DQuotes(err.full_name));
|
||||
return new Pair<>(out, err);
|
||||
}
|
||||
public void putResource(RemoteFile dstDirectory, String resource_name) throws Exception {
|
||||
@@ -252,7 +252,7 @@ public class UserConnection {
|
||||
}
|
||||
boolean compileModule(RemoteFile modulesDirectory, String module_name) throws Exception {
|
||||
String flags = module_name.equals("planner") ? getAvailibleCPPStandard(modulesDirectory) : "";
|
||||
String command = "g++ -O3 " + flags + " " + CommonUtils.DQuotes(module_name + ".cpp") + " -o " + CommonUtils.DQuotes(module_name);
|
||||
String command = "g++ -O3 " + flags + " " + Utils_.DQuotes(module_name + ".cpp") + " -o " + Utils_.DQuotes(module_name);
|
||||
RemoteFile binary = new RemoteFile(modulesDirectory, module_name);
|
||||
//--
|
||||
if (Exists(binary))
|
||||
@@ -322,7 +322,7 @@ public class UserConnection {
|
||||
getSingleFile(src.full_name, dst.getAbsolutePath());
|
||||
return true;
|
||||
} else {
|
||||
Utils.WriteToFile(dst, "Размер файла превышает " + maxSize + " KB.\n" + "Файл не загружен. Его можно просмотреть на машине по адресу\n" + CommonUtils.Brackets(src.full_name));
|
||||
Utils.WriteToFile(dst, "Размер файла превышает " + maxSize + " KB.\n" + "Файл не загружен. Его можно просмотреть на машине по адресу\n" + Utils_.Brackets(src.full_name));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -399,7 +399,7 @@ public class UserConnection {
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(execChannel.getInputStream()));
|
||||
String line = null;
|
||||
while ((line = in.readLine()) != null) {
|
||||
System.out.println(CommonUtils.Brackets(line));
|
||||
System.out.println(Utils_.Brackets(line));
|
||||
}
|
||||
}
|
||||
execChannel.disconnect();
|
||||
@@ -437,35 +437,35 @@ public class UserConnection {
|
||||
try {
|
||||
in.close();
|
||||
} catch (Exception exception) {
|
||||
CommonUtils.MainLog.PrintException(exception);
|
||||
Utils_.MainLog.PrintException(exception);
|
||||
}
|
||||
}
|
||||
if (out != null) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (Exception exception) {
|
||||
CommonUtils.MainLog.PrintException(exception);
|
||||
Utils_.MainLog.PrintException(exception);
|
||||
}
|
||||
}
|
||||
if (pin != null) {
|
||||
try {
|
||||
pin.close();
|
||||
} catch (Exception exception) {
|
||||
CommonUtils.MainLog.PrintException(exception);
|
||||
Utils_.MainLog.PrintException(exception);
|
||||
}
|
||||
}
|
||||
if (pout != null) {
|
||||
try {
|
||||
pout.close();
|
||||
} catch (Exception exception) {
|
||||
CommonUtils.MainLog.PrintException(exception);
|
||||
Utils_.MainLog.PrintException(exception);
|
||||
}
|
||||
}
|
||||
if (fromServer != null) {
|
||||
try {
|
||||
fromServer.close();
|
||||
} catch (Exception exception) {
|
||||
CommonUtils.MainLog.PrintException(exception);
|
||||
Utils_.MainLog.PrintException(exception);
|
||||
}
|
||||
}
|
||||
if (shellChannel != null) shellChannel.disconnect();
|
||||
@@ -481,21 +481,21 @@ public class UserConnection {
|
||||
public void waitForFileCreation(RemoteFile file) throws Exception {
|
||||
while (!Exists(file)) {
|
||||
System.out.println(file.full_name + " NOT FOUND");
|
||||
CommonUtils.sleep(1000);
|
||||
Utils_.sleep(1000);
|
||||
}
|
||||
}
|
||||
public void waitForFileFree(RemoteFile file) throws Exception {
|
||||
while (!Busy(file)) {
|
||||
System.out.println(file.full_name + " PERMISSION DENIED");
|
||||
CommonUtils.sleep(1000);
|
||||
Utils_.sleep(1000);
|
||||
}
|
||||
}
|
||||
public String startShellProcess(RemoteFile directory, String outFileName, String... commands) throws Exception {
|
||||
Vector<String> commands_ = new Vector<>();
|
||||
commands_.add("cd " + CommonUtils.DQuotes(directory.full_name));
|
||||
commands_.add("cd " + Utils_.DQuotes(directory.full_name));
|
||||
for (int i = 0; i < commands.length; ++i) {
|
||||
if (i == commands.length - 1) {
|
||||
commands_.add(commands[i] + " 1>" + CommonUtils.DQuotes(outFileName));
|
||||
commands_.add(commands[i] + " 1>" + Utils_.DQuotes(outFileName));
|
||||
} else {
|
||||
commands_.add(commands[i]);
|
||||
}
|
||||
@@ -504,7 +504,7 @@ public class UserConnection {
|
||||
if (Exists(script_file))
|
||||
sftpChannel.rm(script_file.full_name);
|
||||
writeToFile(String.join("\n", commands_), script_file);
|
||||
String start_command = CommonUtils.DQuotes(script_file.full_name);
|
||||
String start_command = Utils_.DQuotes(script_file.full_name);
|
||||
//--
|
||||
RemoteFile outFile = new RemoteFile(directory, outFileName);
|
||||
if (Exists(outFile))
|
||||
|
||||
Reference in New Issue
Block a user