no message

This commit is contained in:
2024-10-11 00:00:30 +03:00
parent a11b7711f7
commit f317ab1aa1
341 changed files with 1866 additions and 1688 deletions

View File

@@ -1,7 +1,7 @@
package _VisualDVM.TestingSystem.Common.Configuration;
import Common.Database.Objects.DBObject;
import Common.Database.Objects.riDBObject;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import Common.Utils.TextLog;
import _VisualDVM.TestingSystem.Common.Group.Group;
import _VisualDVM.TestingSystem.Common.Group.Json.GroupsJson;
@@ -33,7 +33,7 @@ public class Configuration extends riDBObject {
autoTesting = (autoTesting == 0) ? 1 : 0;
}
public ImageIcon GetAutoIcon() {
return CommonUtils.getIcon("/Common/icons/" + (autoTesting == 1 ? "RedPick" : "NotPick") + ".png");
return Utils_.getIcon("/Common/icons/" + (autoTesting == 1 ? "RedPick" : "NotPick") + ".png");
}
//--
@Description("DEFAULT ''")
@@ -44,13 +44,13 @@ public class Configuration extends riDBObject {
public String packedSettingsJson = "";
//--
public void saveGroupsAsJson(Vector<Group> groups) {
packedGroupsJson = CommonUtils.gson.toJson(new GroupsJson(groups));
packedGroupsJson = Utils_.gson.toJson(new GroupsJson(groups));
}
public void saveTestsAsJson(Vector<Test> tests) {
packedTestsJson = CommonUtils.gson.toJson(new TestsJson(tests));
packedTestsJson = Utils_.gson.toJson(new TestsJson(tests));
}
public void saveSettingsAsJson(Vector<Settings> settings) {
packedSettingsJson = CommonUtils.gson.toJson(new SettingsArrayJson(settings));
packedSettingsJson = Utils_.gson.toJson(new SettingsArrayJson(settings));
}
//--
@Override

View File

@@ -1,6 +1,6 @@
package _VisualDVM.TestingSystem.Common.Group;
import Common.Utils.CommonUtils;
import Common.Visual.CommonUI;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Database.Objects.DBObject;
import Common.Database.Objects.riDBObject;
@@ -46,7 +46,7 @@ public class Group extends riDBObject {
@Override
public void select(boolean flag) {
super.select(flag);
if (CommonUI.isActive())
if (UI_.isActive())
UI.getMainWindow().ShowCheckedTestsCount();
}
//--
@@ -67,7 +67,7 @@ public class Group extends riDBObject {
int i = 1;
for (ProjectFile program : programs.get(language)) {
//--
String object = CommonUtils.DQuotes(language + "_" + i + ".o");
String object = Utils_.DQuotes(language + "_" + i + ".o");
module_objects.add(object);
module_body +=
object + ":\n" +
@@ -84,7 +84,7 @@ public class Group extends riDBObject {
++i;
}
titles.add(String.join("\n",
LANG_ + "COMMAND=" + CommonUtils.DQuotes(dvm_drv) + " " +
LANG_ + "COMMAND=" + Utils_.DQuotes(dvm_drv) + " " +
language.getDVMCompile(),
LANG_ + "FLAGS=" + flags_in,
LANG_ + "OBJECTS=" + String.join(" ", module_objects),
@@ -100,12 +100,12 @@ public class Group extends riDBObject {
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");
//----->>
generateForLanguage(dvm_drv, programs, language, titles, objects, bodies, flags_in);
//----->>
return String.join("\n",
"LINK_COMMAND=" + CommonUtils.DQuotes(dvm_drv) + " " +
"LINK_COMMAND=" + Utils_.DQuotes(dvm_drv) + " " +
language.getDVMLink(),
"LINK_FLAGS=" + flags_in + "\n",
String.join("\n", titles),

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.Common.Group;
import Common.Visual.CommonUI;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Visual.DataSetControlForm;
import Common.Visual.Windows.Dialog.DBObjectDialog;
@@ -120,8 +120,8 @@ public class GroupsDBTable extends iDBTable<Group> {
@Override
public void fillFields() {
fields.tfName.setText(Result.description);
CommonUI.TrySelect(fields.cbType, Result.type);
CommonUI.TrySelect(fields.cbLanguage, Result.language);
UI_.TrySelect(fields.cbType, Result.type);
UI_.TrySelect(fields.cbLanguage, Result.language);
}
@Override
public void ProcessResult() {

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.Common.Group;
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 GroupsMenuBar extends DataMenuBar {
});
}
public void Mark() {
setIcon(CommonUtils.getIcon(GroupsDBTable.filterMyOnly ? "/icons/Pick.png" : "/icons/NotPick.png"));
setIcon(Utils_.getIcon(GroupsDBTable.filterMyOnly ? "/icons/Pick.png" : "/icons/NotPick.png"));
}
});
}

View File

@@ -2,7 +2,7 @@ package _VisualDVM.TestingSystem.Common.MachineProcess;
import Common.CommonConstants;
import Common.Database.Objects.DBObject;
import Common.Mode;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.GlobalProperties;
import _VisualDVM.Utils;
@@ -33,9 +33,9 @@ public class MachineProcess extends DBObject {
userName = p.user_name;
userPassword = p.user_password;
userWorkspace = p.user_workspace;
testingSystemRoot =CommonUtils.getHomePath();
testingSystemRoot = Utils_.getHomePath();
serverName = Global.testingServer.name;
id = CommonUtils.getDateName(machineAddress + "_" + machinePort + "_" + userName);
id = Utils_.getDateName(machineAddress + "_" + machinePort + "_" + userName);
}
@Override
public Object getPK() {
@@ -86,7 +86,7 @@ public class MachineProcess extends DBObject {
InetAddress localAddress = InetAddress.getByName(Global.properties.ServerAddress);
local = localAddress.getHostAddress().equals(address.getHostAddress());
} catch (Exception ex) {
CommonUtils.MainLog.PrintException(ex);
Utils_.MainLog.PrintException(ex);
}
return local;
}
@@ -96,21 +96,21 @@ public class MachineProcess extends DBObject {
File workspace = getWorkspace();
Utils.CheckAndCleanDirectory(workspace);
//копирование визуализатора
File src = new File(CommonUtils.getHomeDirectory(), "TestingSystem.jar");
File src = new File(Utils_.getHomeDirectory(), "TestingSystem.jar");
File supervisor = new File(workspace, "VisualSapfor.jar");
FileUtils.copyFile(src, supervisor);
//создание настроек
GlobalProperties properties = new GlobalProperties(Global.properties);
properties.Mode = Mode.MachineQueue;
CommonUtils.jsonToFile(properties, new File(workspace, "properties"));
Utils_.jsonToFile(properties, new File(workspace, "properties"));
Vector<String> args = new Vector<>();
args.add(CommonUtils.DQuotes(machineAddress));
args.add(CommonUtils.DQuotes(machinePort));
args.add(CommonUtils.DQuotes(userName));
args.add(CommonUtils.DQuotes(userPassword));
args.add(CommonUtils.DQuotes(userWorkspace));
args.add(CommonUtils.DQuotes(testingSystemRoot));
args.add(CommonUtils.DQuotes(Global.testingServer.name));
args.add(Utils_.DQuotes(machineAddress));
args.add(Utils_.DQuotes(machinePort));
args.add(Utils_.DQuotes(userName));
args.add(Utils_.DQuotes(userPassword));
args.add(Utils_.DQuotes(userWorkspace));
args.add(Utils_.DQuotes(testingSystemRoot));
args.add(Utils_.DQuotes(Global.testingServer.name));
//--
Utils.startScript(workspace, workspace,
"start",

View File

@@ -1,7 +1,7 @@
package _VisualDVM.TestingSystem.Common.Test;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common.Visual.CommonUI;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Database.Objects.DBObject;
import Common.Database.Objects.riDBObject;
@@ -54,7 +54,7 @@ public class Test extends riDBObject {
@Override
public void select(boolean flag) {
super.select(flag);
if (CommonUI.isActive())
if (UI_.isActive())
UI.getMainWindow().ShowCheckedTestsCount();
}
//---
@@ -95,7 +95,7 @@ public class Test extends riDBObject {
if (testArchive.exists())
FileUtils.forceDelete(testArchive);
//--
CommonUtils.bytesToFile(project_archive_bytes, tmpArchive); // распаковка байтов.
Utils_.bytesToFile(project_archive_bytes, tmpArchive); // распаковка байтов.
//--
UnzipFolderPass unzipFolderPass = new UnzipFolderPass();
if (!unzipFolderPass.Do(

View File

@@ -1,6 +1,6 @@
package _VisualDVM.TestingSystem.Common;
import Common.Utils.CommonUtils;
import Common.Visual.CommonUI;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import _VisualDVM.Global;
import Common.Visual.Controls.MenuBarButton;
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
@@ -45,7 +45,7 @@ public class TestingBar extends VisualiserMenuBar {
});
}
public void Mark() {
setIcon(CommonUtils.getIcon(Global.properties.EmailOnTestingProgress ? "/icons/Pick.png" : "/icons/NotPick.png"));
setIcon(Utils_.getIcon(Global.properties.EmailOnTestingProgress ? "/icons/Pick.png" : "/icons/NotPick.png"));
}
});
//--
@@ -66,7 +66,7 @@ public class TestingBar extends VisualiserMenuBar {
});
}
public void Mark() {
setIcon(CommonUtils.getIcon(Global.properties.AutoCheckTesting ? "/icons/Pick.png" : "/icons/NotPick.png"));
setIcon(Utils_.getIcon(Global.properties.AutoCheckTesting ? "/icons/Pick.png" : "/icons/NotPick.png"));
}
});
//--
@@ -75,13 +75,13 @@ public class TestingBar extends VisualiserMenuBar {
sCheckTime.setMaximumSize(new Dimension(60, 26));
sCheckTime.setModel(new SpinnerNumberModel(Global.properties.CheckTestingIntervalSeconds, 10, 3600, 1));
sCheckTime.setValue(Global.properties.CheckTestingIntervalSeconds);
CommonUI.MakeSpinnerRapid(sCheckTime, e -> {
UI_.MakeSpinnerRapid(sCheckTime, e -> {
Global.properties.updateField("CheckTestingIntervalSeconds", sCheckTime.getValue());
if (Global.properties.AutoCheckTesting) TestingServer.ResetTimer();
});
add(new JLabel(" сек ") {
{
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
}
});
addSeparator();
@@ -89,7 +89,7 @@ public class TestingBar extends VisualiserMenuBar {
addPasses(PassCode.StartTestingServer, PassCode.ShutdownTestingServer, PassCode.PublishTestingServer);
}
public void ShowAutoCheckTesting() {
autorefreshButton.setIcon(CommonUtils.getIcon(Global.properties.AutoCheckTesting ? "/icons/Pick.png" : "/icons/NotPick.png"));
autorefreshButton.setIcon(Utils_.getIcon(Global.properties.AutoCheckTesting ? "/icons/Pick.png" : "/icons/NotPick.png"));
}
public void showServerAdminLabel(boolean flag) {
serverAdminLabel.setVisible(flag);

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.Common.TestingPackage;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import Common.Database.Objects.DBObject;
import Common.Database.Objects.riDBObject;
@@ -71,17 +71,17 @@ public abstract class TestingPackage<J> extends riDBObject {
return new File(getLocalWorkspace(), Constants.LOADED);
}
public void saveJson() throws Exception {
CommonUtils.jsonToFile(package_json, getJsonFile());
Utils_.jsonToFile(package_json, getJsonFile());
}
public void readJson() throws Exception {
package_json = (J) CommonUtils.jsonFromFile(getJsonFile(), getJsonClass());
package_json = (J) Utils_.jsonFromFile(getJsonFile(), getJsonClass());
}
public void destructor() {
package_json = null;
}
//----------------------------------------------------------
public void saveConfigurationsAsJson(Vector<? extends Configuration> configurations) {
packedConfigurationsJson = CommonUtils.gson.toJson(new ConfigurationsJson(configurations));
packedConfigurationsJson = Utils_.gson.toJson(new ConfigurationsJson(configurations));
}
//определить завершен пакет с ошибками или нет.
public void checkFinishState() throws Exception{

View File

@@ -1,6 +1,6 @@
package _VisualDVM.TestingSystem.Common;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import _VisualDVM.Utils;
@@ -63,7 +63,7 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
if (testingPackage.needsEmail == 1) {
EmailMessage message = new EmailMessage();
message.subject = "Состояние пакета тестирования "+packageDescription()+ " "+
CommonUtils.Brackets(testingPackage.id) + " изменилось на " + CommonUtils.Brackets(testingPackage.state.getDescription());
Utils_.Brackets(testingPackage.id) + " изменилось на " + Utils_.Brackets(testingPackage.state.getDescription());
message.text = testingPackage.description;
message.targets.add(testingPackage.sender_address);
ServerCommand(ServerCode.Email, message);
@@ -195,9 +195,9 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
String userWorkspace = args[4];
String testingSystemRoot = args[5];
serverName = args[6];
supervisorHome = CommonUtils.getHomeDirectory(); //при инициализации это текущая папка.
supervisorHome = Utils_.getHomeDirectory(); //при инициализации это текущая папка.
//---
CommonUtils.MainLog = new Loggable() {
Utils_.MainLog = new Loggable() {
@Override
public String getLogHomePath() {
return supervisorHome.getAbsolutePath();
@@ -207,20 +207,20 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
return Global.mode.toString();
}
};
CommonUtils.MainLog.ClearLog();
Utils_.MainLog.ClearLog();
//--
CommonUtils.setHomePath(testingSystemRoot);
Utils_.setHomePath(testingSystemRoot);
Global.CheckTestingSystemDirectories();
//---
machine = new Machine(machineAddress, machineAddress, machinePort, MachineType.Server);
user = new User(userName, userPassword, userWorkspace);
//---
Print("machineAddress=" + CommonUtils.Brackets(machineAddress));
Print("machinePort=" + CommonUtils.Brackets(String.valueOf(machinePort)));
Print("userName=" + CommonUtils.Brackets(userName));
Print("userPassword=" + CommonUtils.Brackets(userPassword));
Print("userWorkspace=" + CommonUtils.Brackets(userWorkspace));
Print("root=" + CommonUtils.Brackets(CommonUtils.getHomePath()));
Print("machineAddress=" + Utils_.Brackets(machineAddress));
Print("machinePort=" + Utils_.Brackets(String.valueOf(machinePort)));
Print("userName=" + Utils_.Brackets(userName));
Print("userPassword=" + Utils_.Brackets(userPassword));
Print("userWorkspace=" + Utils_.Brackets(userWorkspace));
Print("root=" + Utils_.Brackets(Utils_.getHomePath()));
Print("serverName=" + serverName);
Print("=====");
//----

View File

@@ -1,6 +1,6 @@
package _VisualDVM.TestingSystem.Common;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import Common.Database.Objects.DBObject;
import _VisualDVM.Global;
@@ -127,8 +127,8 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
}
public TestingServer() {
super(TestsDatabase.class);
name = CommonUtils.getDateName("testingServer");
System.out.println("ServerName=" + CommonUtils.Brackets(name));
name = Utils_.getDateName("testingServer");
System.out.println("ServerName=" + Utils_.Brackets(name));
}
//основа
@Override
@@ -147,7 +147,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
while (true) {
dvmTestingChecker.Perform();
sapforTestingPlanner.Perform();
CommonUtils.sleep(5000);
Utils_.sleep(5000);
}
});
//------>>>
@@ -179,7 +179,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
EmailMessage message = Log.isEmpty() ?
new EmailMessage(
"Запущено автоматическое тестирование версии " + request.arg + " системы SAPFOR",
"Пакет "+ CommonUtils.Brackets(autoPackage.id), new Vector<>()) :
"Пакет "+ Utils_.Brackets(autoPackage.id), new Vector<>()) :
new EmailMessage(
"Не удалось запустить автоматическое тестирование версии " + request.arg + " системы SAPFOR",
Log.toString(),
@@ -192,14 +192,14 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
test_id = Integer.parseInt(request.arg);
if (db.tests.containsKey(test_id)) {
test = db.tests.get(test_id);
response = new ServerExchangeUnit_2021(ServerCode.OK, "", CommonUtils.fileToBytes(test.getArchive()));
response = new ServerExchangeUnit_2021(ServerCode.OK, "", Utils_.fileToBytes(test.getArchive()));
} else
throw new RepositoryRefuseException("Теста с именем " + request.arg + " не существует");
break;
case ReceiveTestsDatabase:
Print("Получить базу данных тестов");
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = CommonUtils.fileToBytes(db.getFile());
response.object = Utils_.fileToBytes(db.getFile());
break;
//---
case RefreshDVMTests:
@@ -296,7 +296,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
pathname.isFile()
&& !pathname.getName().equals("settings")
&& !pathname.getName().equals("test-analyzer.sh")
&& CommonUtils.getExtension(pathname).startsWith(languageName.getDVMCompile()));
&& Utils_.getExtension(pathname).startsWith(languageName.getDVMCompile()));
;
if (files != null) {
groupFiles = new Vector<>(Arrays.asList(files));
@@ -422,7 +422,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
File workspace = dvmPackage.getLocalWorkspace();
File results_zip = new File(workspace, "results.zip");
File package_json = dvmPackage.getJsonFile();
response.object = new Pair(CommonUtils.fileToBytes(results_zip), CommonUtils.fileToBytes(package_json));
response.object = new Pair(Utils_.fileToBytes(results_zip), Utils_.fileToBytes(package_json));
}
private void DownloadDVMPackages() throws Exception {
Vector<Integer> ids = (Vector<Integer>) request.object;
@@ -434,7 +434,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
File workspace = dvmPackage.getLocalWorkspace();
File results_zip = new File(workspace, "results.zip");
File package_json = dvmPackage.getJsonFile();
res.add(new Pair<>(dvmPackage_id, new Pair(CommonUtils.fileToBytes(results_zip), CommonUtils.fileToBytes(package_json))));
res.add(new Pair<>(dvmPackage_id, new Pair(Utils_.fileToBytes(results_zip), Utils_.fileToBytes(package_json))));
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = res;
@@ -450,7 +450,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
ZipFolderPass zipFolderPass = new ZipFolderPass();
zipFolderPass.Do(workspace.getAbsolutePath(), results_zip.getAbsolutePath());
if (results_zip.exists())
response.object = CommonUtils.fileToBytes(results_zip);
response.object = Utils_.fileToBytes(results_zip);
else
throw new RepositoryRefuseException("Не удалось заархивировать пакет тестирования SAPFOR с ключом " + sapforPackage_id);
}
@@ -484,12 +484,12 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Vector<DVMPackage_json> jsons = new Vector<>();
for (int package_id : packages_ids) {
if (!db.dvmPackages.containsKey(package_id))
throw new RepositoryRefuseException("Пакета задач DVM " + CommonUtils.Brackets(package_id) + " не существует.");
throw new RepositoryRefuseException("Пакета задач DVM " + Utils_.Brackets(package_id) + " не существует.");
DVMPackage dvmPackage = db.dvmPackages.get(package_id);
File json = dvmPackage.getJsonFile();
if (!json.exists())
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач DVM " + CommonUtils.Brackets(package_id));
jsons.add((DVMPackage_json) CommonUtils.jsonFromFile(json, DVMPackage_json.class));
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач DVM " + Utils_.Brackets(package_id));
jsons.add((DVMPackage_json) Utils_.jsonFromFile(json, DVMPackage_json.class));
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = jsons;
@@ -499,12 +499,12 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Vector<SapforPackage_json> jsons = new Vector<>();
for (int package_id : packages_ids) {
if (!db.sapforPackages.containsKey(package_id))
throw new RepositoryRefuseException("Пакета задач SAPFOR " + CommonUtils.Brackets(package_id) + " не существует.");
throw new RepositoryRefuseException("Пакета задач SAPFOR " + Utils_.Brackets(package_id) + " не существует.");
SapforPackage sapforPackage = db.sapforPackages.get(package_id);
File json = sapforPackage.getJsonFile();
if (!json.exists())
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач SAPFOR " + CommonUtils.Brackets(package_id));
jsons.add((SapforPackage_json) CommonUtils.jsonFromFile(json, SapforPackage_json.class));
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач SAPFOR " + Utils_.Brackets(package_id));
jsons.add((SapforPackage_json) Utils_.jsonFromFile(json, SapforPackage_json.class));
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = jsons;
@@ -563,7 +563,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Global.TempDirectory,
"get_version",
"wget --user dvmhuser --password dvmh2013 -P " +
CommonUtils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
Utils_.DQuotes(Global.TempDirectory.getAbsolutePath()) +
" http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h"
).waitFor();
if (!versionFile.exists())
@@ -583,7 +583,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Global.TempDirectory,
"get_version",
"wget --user dvmhuser --password dvmh2013 -P " +
CommonUtils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
Utils_.DQuotes(Global.TempDirectory.getAbsolutePath()) +
" http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h"
).waitFor();
if (!versionFile.exists())

View File

@@ -1,6 +1,6 @@
package _VisualDVM.TestingSystem.Common;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import Common.Database.SQLITE.SQLiteDatabase;
import _VisualDVM.Global;
@@ -196,7 +196,7 @@ public class TestsDatabase extends SQLiteDatabase {
if (Sapfor.getMinMaxDim(Sapfor.getTempCopy(new File(sapfor.call_command)), tempProject, test)) {
Update(test);
} else
throw new RepositoryRefuseException("Не удалось определить размерность теста " + CommonUtils.Brackets(test.description));
throw new RepositoryRefuseException("Не удалось определить размерность теста " + Utils_.Brackets(test.description));
break;
case c:
test.max_dim = Utils.getCTestMaxDim(testFile);
@@ -224,12 +224,12 @@ public class TestsDatabase extends SQLiteDatabase {
if (oldGroup == null) {
Insert(group);
for (File file : files) {
String testDescription = CommonUtils.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
String testDescription = Utils_.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
CreateTestFromSingleFile(account, sapfor, group, file, testDescription);
}
} else {
for (File file : files) {
String testDescription = CommonUtils.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
String testDescription = Utils_.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
Test oldTest = tests.getTestByDescription(oldGroup.id, testDescription);
if (oldTest == null) {
CreateTestFromSingleFile(account, sapfor, oldGroup, file, testDescription);

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.Common.ThreadsPlanner;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import Common.Utils.InterruptThread;
import org.apache.commons.io.FileUtils;
@@ -12,7 +12,7 @@ public abstract class ThreadsPlanner {
try {
Interrupt();
} catch (Exception exception) {
CommonUtils.MainLog.PrintException(exception);
Utils_.MainLog.PrintException(exception);
}
System.exit(0);
return null;
@@ -51,20 +51,20 @@ public abstract class ThreadsPlanner {
}
//--
public void Start() {
CommonUtils.MainLog.Print("Planner started");
Utils_.MainLog.Print("Planner started");
try {
//--
while (!waitingThreads.isEmpty() || !activeThreads.isEmpty()) {
CommonUtils.MainLog.Print(getThreadsSummary());
Utils_.MainLog.Print(getThreadsSummary());
checkActiveThreads();
tryStartThreads();
Thread.sleep(wait_ms);
}
//--
} catch (Exception exception) {
CommonUtils.MainLog.PrintException(exception);
Utils_.MainLog.PrintException(exception);
} finally {
CommonUtils.MainLog.Print("Planner finished");
Utils_.MainLog.Print("Planner finished");
finalize();
}
}
@@ -84,7 +84,7 @@ public abstract class ThreadsPlanner {
activeThreads.removeAll(toExclude);
//--
double progress = ((double)done_threads/threads.size())*100.0;
CommonUtils.MainLog.Print("done_threads="+done_threads+";all_threads="+threads.size()+";progress="+progress);
Utils_.MainLog.Print("done_threads="+done_threads+";all_threads="+threads.size()+";progress="+progress);
File progress_file = new File("progress");
try {
FileUtils.writeStringToFile(progress_file, String.valueOf(((int)progress)));

View File

@@ -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"));
}
});
}

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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());

View File

@@ -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))

View File

@@ -1,6 +1,6 @@
package _VisualDVM.TestingSystem.SAPFOR.Json;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.Utils;
import _VisualDVM.ProjectData.Files.DBProjectFile;
@@ -55,7 +55,7 @@ public class SapforVersion_json implements Serializable {
state = SapforVersionState.Empty;
comparisonState = VersionComparisonState.Unknown;
//--
String relativePath = CommonUtils.isWindows() ? CommonUtils.toW(version) : version;
String relativePath = Utils_.isWindows() ? Utils_.toW(version) : version;
Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile();
files = new LinkedHashMap<>();
//--
@@ -251,13 +251,13 @@ public class SapforVersion_json implements Serializable {
//--
public void createProject(File rootHome) throws Exception {
project = null;
String version_ = CommonUtils.isWindows() ? CommonUtils.toW(version) : CommonUtils.toU(version);
String version_ = Utils_.isWindows() ? Utils_.toW(version) : Utils_.toU(version);
project = new db_project_info();
project.Home = Paths.get(rootHome.getAbsolutePath(), version_).toFile();
project.name = project.Home.getName();
project.description = description;
project.languageName = LanguageName.fortran;
project.creationDate = CommonUtils.getDateNumber();
project.creationDate = Utils_.getDateNumber();
//---
FileUtils.copyDirectory(Home, project.Home);
///--------------------------------------
@@ -304,6 +304,6 @@ public class SapforVersion_json implements Serializable {
}
@Override
public String toString() {
return Home.getName() + " : " + CommonUtils.Brackets(description) + " файлы: " + files.size();
return Home.getName() + " : " + Utils_.Brackets(description) + " файлы: " + files.size();
}
}

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.SAPFOR;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.Utils;
import _VisualDVM.TestingSystem.Common.TaskThread;
@@ -16,10 +16,10 @@ public class PackageModeSupervisor extends ThreadsPlanner {
File sapfor_drv = null;
public PackageModeSupervisor() throws Exception {
super(2000);
package_json = (SapforPackage_json) CommonUtils.jsonFromFile(new File(Constants.package_json), SapforPackage_json.class);
package_json = (SapforPackage_json) Utils_.jsonFromFile(new File(Constants.package_json), SapforPackage_json.class);
//--
File sapfor_src = new File(package_json.sapfor_drv);
sapfor_drv = new File(CommonUtils.getHomeDirectory(), CommonUtils.getDateName("SAPFOR_F"));
sapfor_drv = new File(Utils_.getHomeDirectory(), Utils_.getDateName("SAPFOR_F"));
FileUtils.copyFile(sapfor_src, sapfor_drv);
if (!sapfor_drv.setExecutable(true))
throw new Exception("Не удалось сделать файл " + sapfor_drv.getName() + " исполняемым!");
@@ -44,12 +44,12 @@ public class PackageModeSupervisor extends ThreadsPlanner {
protected void finalize() {
//записать результаты всех задач.
try {
CommonUtils.jsonToFile(package_json, new File(Constants.package_json));
Utils_.jsonToFile(package_json, new File(Constants.package_json));
FileUtils.writeStringToFile(new File(Constants.DONE), "");
//--
//Очистка
//очистка служебных файлов.
Utils.deleteFilesByExtensions(CommonUtils.getHomeDirectory(),
Utils.deleteFilesByExtensions(Utils_.getHomeDirectory(),
"proj", "dep", "jar"
// ,"sh", "exe", "bat"
);
@@ -57,7 +57,7 @@ public class PackageModeSupervisor extends ThreadsPlanner {
if (sapfor_drv.exists())
FileUtils.forceDelete(sapfor_drv);
} catch (Exception e) {
CommonUtils.MainLog.PrintException(e);
Utils_.MainLog.PrintException(e);
}
System.exit(0);
}

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.SAPFOR;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.Tasks.TaskState;
@@ -41,11 +41,11 @@ public class PerformSapforTask extends Pass<SapforTask> {
//--
version_json = null;
//--->>
parentTask = Paths.get(CommonUtils.getHomePath(),
parentTask = Paths.get(Utils_.getHomePath(),
String.valueOf(target.set_id),
String.valueOf(target.sapfor_configuration_id),
target.test_description).toFile();
root = Paths.get(CommonUtils.getHomePath(), String.valueOf(target.set_id), String.valueOf(target.sapfor_configuration_id)).toFile();
root = Paths.get(Utils_.getHomePath(), String.valueOf(target.set_id), String.valueOf(target.sapfor_configuration_id)).toFile();
task = null;
//--->>
return true;
@@ -71,7 +71,7 @@ public class PerformSapforTask extends Pass<SapforTask> {
"transformation",
sapfor_drv,
parentTask,
code.getTestingCommand() + " -F " + CommonUtils.DQuotes(task.getAbsolutePath()),
code.getTestingCommand() + " -F " + Utils_.DQuotes(task.getAbsolutePath()),
target.flags,
Constants.out_file,
Constants.err_file

View File

@@ -1,6 +1,4 @@
package _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration;
import Common.Visual.CommonUI;
import _VisualDVM.ServerObjectsCache.ConfigurationCache;
import _VisualDVM.ServerObjectsCache.SapforConfigurationCache;
import _VisualDVM.ServerObjectsCache.VisualCaches;
import Common.Utils.TextLog;

View File

@@ -1,7 +1,6 @@
package _VisualDVM.TestingSystem.SAPFOR.SapforSettings;
import Common.Database.Objects.DBObject;
import Common.Utils.CommonUtils;
import Common.Visual.CommonUI;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import Common.Utils.TextLog;
import _VisualDVM.TestingSystem.Common.Settings.Settings;
@@ -80,7 +79,7 @@ public class SapforSettings extends Settings {
if (code.isSapforStart()) {
if (i > first) {
Log.Writeln_("Неверные настройки:" + id + ": проход" +
CommonUtils.Brackets(code.getDescription()) +
Utils_.Brackets(code.getDescription()) +
" может быть только первым!");
res=false;
}
@@ -88,14 +87,14 @@ public class SapforSettings extends Settings {
if (code.isSapforTerminal()) {
if (i < last) {
Log.Writeln_("Неверные настройки:" + id + ": проход " +
CommonUtils.Brackets(code.getDescription()) +
Utils_.Brackets(code.getDescription()) +
" может быть только последним!");
res= false;
}
}
if (matches.contains(code)) {
Log.Writeln_("Неверные настройки:" + id + ": проход " +
CommonUtils.Brackets(code.getDescription()) +
Utils_.Brackets(code.getDescription()) +
" запрещено применять более одного раза!");
res=false;
} else matches.add(code);

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.SAPFOR.SapforSettings;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import Common.Visual.DataSetControlForm;
import Common.Visual.Windows.Dialog.DBObjectDialog;
@@ -96,10 +96,10 @@ public class SapforSettingsDBTable extends iDBTable<SapforSettings> {
@Override
public void ProcessResult() {
Result.description = fields.tfName.getText();
Result.FREE_FORM = CommonUtils.fromBoolean(fields.cbFREE_FORM.isSelected());
Result.KEEP_DVM_DIRECTIVES = CommonUtils.fromBoolean(fields.cbKEEP_DVM_DIRECTIVES.isSelected());
Result.KEEP_SPF_DIRECTIVES = CommonUtils.fromBoolean(fields.cbKEEP_SPF_DIRECTIVES.isSelected());
Result.STATIC_SHADOW_ANALYSIS = CommonUtils.fromBoolean(fields.cbSTATIC_SHADOW_ANALYSIS.isSelected());
Result.FREE_FORM = Utils_.fromBoolean(fields.cbFREE_FORM.isSelected());
Result.KEEP_DVM_DIRECTIVES = Utils_.fromBoolean(fields.cbKEEP_DVM_DIRECTIVES.isSelected());
Result.KEEP_SPF_DIRECTIVES = Utils_.fromBoolean(fields.cbKEEP_SPF_DIRECTIVES.isSelected());
Result.STATIC_SHADOW_ANALYSIS = Utils_.fromBoolean(fields.cbSTATIC_SHADOW_ANALYSIS.isSelected());
Result.MAX_SHADOW_WIDTH = fields.sMAX_SHADOW_WIDTH.getValue();
Result.packFlags();
}

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.SAPFOR.SapforSettings.UI;
import Common.Visual.CommonUI;
import Common.Visual.UI_;
import Common.Visual.Tables.StyledCellLabel;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
@@ -21,7 +21,7 @@ public class SapforSettingsCommandFields implements DialogFields {
JLabel res = new StyledCellLabel();
res.setText(value.getDescription());
res.setBackground(isSelected ?
CommonUI.getTheme().selection_background : CommonUI.getTheme().background
UI_.getTheme().selection_background : UI_.getTheme().background
);
return res;
});

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.SAPFOR.SapforSettingsCommand;
import Common.Visual.CommonUI;
import Common.Visual.UI_;
import _VisualDVM.Current;
import Common.Database.Tables.iDBTable;
import Common.Visual.DataSetControlForm;
@@ -62,7 +62,7 @@ public class SapforSettingsCommandsDBTable extends iDBTable<SapforSettingsComman
}
@Override
public void fillFields() {
CommonUI.TrySelect(fields.cbPassCode, Result.passCode);
UI_.TrySelect(fields.cbPassCode, Result.passCode);
}
@Override
public void ProcessResult() {

View File

@@ -1,6 +1,6 @@
package _VisualDVM.TestingSystem.SAPFOR.SapforTask;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import Common.Database.Objects.DBObject;
import _VisualDVM.GlobalData.Tasks.TaskState;
import _VisualDVM.TestingSystem.SAPFOR.Json.*;
@@ -102,10 +102,10 @@ public class SapforTask extends DBObject {
public String getVersionsChain() {
Vector<String> versionsLines = new Vector<>();
for (int i = 1; i < versions.size(); ++i) {
versionsLines.add(CommonUtils.Brackets(versions.get(i).description));
versionsLines.add(Utils_.Brackets(versions.get(i).description));
}
if (!variants.isEmpty()) {
versionsLines.add(CommonUtils.Brackets(PassCode.CreateParallelVariants.getDescription()));
versionsLines.add(Utils_.Brackets(PassCode.CreateParallelVariants.getDescription()));
}
return String.join("", versionsLines);
}
@@ -167,7 +167,7 @@ public class SapforTask extends DBObject {
@Override
public String toString() {
return
"#" + id + " группа " + CommonUtils.Brackets(group_description) + " тест " + CommonUtils.Brackets(test_description) + " параметры " + CommonUtils.Brackets(sapfor_configuration_id);
"#" + id + " группа " + Utils_.Brackets(group_description) + " тест " + Utils_.Brackets(test_description) + " параметры " + Utils_.Brackets(sapfor_configuration_id);
// getUniqueKey();
}
public String getPassesInfo() {
@@ -176,7 +176,7 @@ public class SapforTask extends DBObject {
Vector<String> strings = new Vector<>();
for (String code_s : data) {
PassCode code = PassCode.valueOf(code_s);
strings.add(CommonUtils.Brackets(code.getDescription()));
strings.add(Utils_.Brackets(code.getDescription()));
}
return String.join("", strings);
}

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
@@ -7,7 +7,7 @@ public abstract class SapforPackageTreeNode extends DefaultMutableTreeNode {
public ImageIcon getIcon() {
ImageIcon res = new ImageIcon((getClass().getResource("/icons/versions/" + getImageKey() + ".png")));
if (res==null) {
CommonUtils.MainLog.Print("/icons/versions/" + getImageKey() + ".png=NULL");
Utils_.MainLog.Print("/icons/versions/" + getImageKey() + ".png=NULL");
// res= new ImageIcon((getClass().getResource("/icons/versions/Version.png")));
}
return (getImageKey() != null) ? res : null;

View File

@@ -1,5 +1,5 @@
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Controls.MenuBarButton;
@@ -30,7 +30,7 @@ public class SapforPackagesBar extends DataMenuBar {
});
}
public void Mark() {
setIcon(CommonUtils.getIcon(SapforPackageDBTable.filterMyOnly ? "/icons/Pick.png" : "/icons/NotPick.png"));
setIcon(Utils_.getIcon(SapforPackageDBTable.filterMyOnly ? "/icons/Pick.png" : "/icons/NotPick.png"));
}
});
add(new MenuBarButton() {
@@ -45,7 +45,7 @@ public class SapforPackagesBar extends DataMenuBar {
});
}
public void Mark() {
setIcon(CommonUtils.getIcon(SapforPackageDBTable.filterActive ? "/icons/Pick.png" : "/icons/NotPick.png"));
setIcon(Utils_.getIcon(SapforPackageDBTable.filterActive ? "/icons/Pick.png" : "/icons/NotPick.png"));
}
});
}

View File

@@ -1,7 +1,7 @@
package _VisualDVM.TestingSystem.SAPFOR;
import Common.CommonConstants;
import Common.Mode;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import _VisualDVM.GlobalProperties;
import _VisualDVM.Utils;
@@ -40,8 +40,8 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
File repo_err;
//--
public SapforTestingPlanner() {
repo = new File(CommonUtils.getHomeDirectory(), "Repo");
repoSapforHome = Paths.get(CommonUtils.getHomePath(), "Repo", Constants.SAPFOR_REPOSITORY_BIN).toFile();
repo = new File(Utils_.getHomeDirectory(), "Repo");
repoSapforHome = Paths.get(Utils_.getHomePath(), "Repo", Constants.SAPFOR_REPOSITORY_BIN).toFile();
repo_bin = new File(repoSapforHome, "Sapfor_F");
repo_out = new File(repoSapforHome, Constants.out_file);
repo_err = new File(repoSapforHome, Constants.err_file);
@@ -91,11 +91,11 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
protected void PackageWorkspaceCreation() throws Exception {
//копирование визуализатора
File visualiser = new File(workspace, "VisualSapfor.jar");
FileUtils.copyFile(new File(CommonUtils.getHomeDirectory(), "TestingSystem.jar"), visualiser);
FileUtils.copyFile(new File(Utils_.getHomeDirectory(), "TestingSystem.jar"), visualiser);
//создание настроек
GlobalProperties properties = new GlobalProperties(Global.properties);
properties.Mode = Mode.Package;
CommonUtils.jsonToFile(properties, new File(workspace, "properties"));
Utils_.jsonToFile(properties, new File(workspace, "properties"));
//подготовка пакетного режима. Запустит его уже очередь.
Utils.createScript(workspace, workspace, "start", "java -jar VisualSapfor.jar");
}
@@ -109,7 +109,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
File started = new File(workspace, Constants.STARTED);
while (!started.exists()) {
Print("waiting for package start...");
CommonUtils.sleep(1000);
Utils_.sleep(1000);
}
File pid = new File(workspace, "PID");
testingPackage.PID = FileUtils.readFileToString(pid, Charset.defaultCharset());
@@ -237,7 +237,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
return;
}
//-
File sapforHome = new File(Global.SapforsDirectory, CommonUtils.getDateName("sapfor"));
File sapforHome = new File(Global.SapforsDirectory, Utils_.getDateName("sapfor"));
//--
sapfor.home_path = sapforHome.getAbsolutePath();
sapfor.languageName = LanguageName.fortran;

View File

@@ -1,7 +1,7 @@
package _VisualDVM.TestingSystem.SAPFOR.ServerSapfor;
import Common.Database.Objects.DBObject;
import Common.Database.Objects.riDBObject;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.ProjectData.LanguageName;
import com.sun.org.glassfish.gmbal.Description;
@@ -45,6 +45,6 @@ public class ServerSapfor extends riDBObject {
return call_command;
}
public String getVersionCommand() {
return CommonUtils.DQuotes(call_command) + " " + version_command;
return Utils_.DQuotes(call_command) + " " + version_command;
}
}