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