no message
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
package TestingSystem.Common.Group;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
@@ -65,7 +66,7 @@ public class Group extends riDBObject {
|
||||
int i = 1;
|
||||
for (ProjectFile program : programs.get(language)) {
|
||||
//--
|
||||
String object = Utils.DQuotes(language + "_" + i + ".o");
|
||||
String object = CommonUtils.DQuotes(language + "_" + i + ".o");
|
||||
module_objects.add(object);
|
||||
module_body +=
|
||||
object + ":\n" +
|
||||
@@ -82,7 +83,7 @@ public class Group extends riDBObject {
|
||||
++i;
|
||||
}
|
||||
titles.add(String.join("\n",
|
||||
LANG_ + "COMMAND=" + Utils.DQuotes(dvm_drv) + " " +
|
||||
LANG_ + "COMMAND=" + CommonUtils.DQuotes(dvm_drv) + " " +
|
||||
language.getDVMCompile(),
|
||||
LANG_ + "FLAGS=" + flags_in,
|
||||
LANG_ + "OBJECTS=" + String.join(" ", module_objects),
|
||||
@@ -98,12 +99,12 @@ public class Group extends riDBObject {
|
||||
Vector<String> titles = new Vector<>();
|
||||
Vector<String> objects = new Vector<>();
|
||||
Vector<String> bodies = new Vector<>();
|
||||
String binary = Utils.DQuotes("0");
|
||||
String binary = CommonUtils.DQuotes("0");
|
||||
//----->>
|
||||
generateForLanguage(dvm_drv, programs, language, titles, objects, bodies, flags_in);
|
||||
//----->>
|
||||
return String.join("\n",
|
||||
"LINK_COMMAND=" + Utils.DQuotes(dvm_drv) + " " +
|
||||
"LINK_COMMAND=" + CommonUtils.DQuotes(dvm_drv) + " " +
|
||||
language.getDVMLink(),
|
||||
"LINK_FLAGS=" + flags_in + "\n",
|
||||
String.join("\n", titles),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package TestingSystem.Common.MachineProcess;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common_old.Current;
|
||||
@@ -15,7 +16,7 @@ import java.util.Vector;
|
||||
public class MachineProcess extends DBObject {
|
||||
public String id = "";
|
||||
public String machineAddress = "";
|
||||
public int machinePort = Constants.Nan;
|
||||
public int machinePort = CommonConstants.Nan;
|
||||
public String userName = "";
|
||||
public String userPassword = "";
|
||||
public String userWorkspace = "";
|
||||
@@ -104,13 +105,13 @@ public class MachineProcess extends DBObject {
|
||||
Current.Mode.MachineQueue;
|
||||
CommonUtils.jsonToFile(properties, new File(workspace, "properties"));
|
||||
Vector<String> args = new Vector<>();
|
||||
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));
|
||||
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));
|
||||
//--
|
||||
Utils.startScript(workspace, workspace,
|
||||
"start",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package TestingSystem.Common.Test;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common_old.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
@@ -27,7 +27,7 @@ public class Test extends riDBObject {
|
||||
@Description("DEFAULT ''")
|
||||
public String args = ""; //аргументы командной строки. на всякий случай поле зарезервирую. пусть будут.
|
||||
@Description("DEFAULT -1")
|
||||
public int group_id = Constants.Nan;
|
||||
public int group_id = CommonConstants.Nan;
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package TestingSystem.Common.TestingPackageToKill;
|
||||
import Common_old.Constants;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
public class TestingPackageToKill extends iDBObject {
|
||||
public int packageId = Constants.Nan;
|
||||
public int packageId = CommonConstants.Nan;
|
||||
public int type = 0; // 0 - dvm /1 - sapfor
|
||||
public TestingPackageToKill() {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
package TestingSystem.Common;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
@@ -62,7 +64,7 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
|
||||
if (testingPackage.needsEmail == 1) {
|
||||
EmailMessage message = new EmailMessage();
|
||||
message.subject = "Состояние пакета тестирования "+packageDescription()+ " "+
|
||||
Utils.Brackets(testingPackage.id) + " изменилось на " + Utils.Brackets(testingPackage.state.getDescription());
|
||||
CommonUtils.Brackets(testingPackage.id) + " изменилось на " + CommonUtils.Brackets(testingPackage.state.getDescription());
|
||||
message.text = testingPackage.description;
|
||||
message.targets.add(testingPackage.sender_address);
|
||||
ServerCommand(ServerCode.Email, message);
|
||||
@@ -108,7 +110,7 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
|
||||
try {
|
||||
if (Connect()) {
|
||||
int ptk_id = (int) ServerCommand(getCheckIfNeedsKillCode(), testingPackage.id);
|
||||
if (ptk_id != Constants.Nan) {
|
||||
if (ptk_id != CommonConstants.Nan) {
|
||||
Print("package " + testingPackage.id + " NEEDS TO KILL");
|
||||
Kill();
|
||||
UpdatePackageState(TasksPackageState.Aborted);
|
||||
@@ -215,12 +217,12 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
|
||||
machine = new Machine(machineAddress, machineAddress, machinePort, MachineType.Server);
|
||||
user = new User(userName, userPassword, userWorkspace);
|
||||
//---
|
||||
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(Global.Home));
|
||||
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(Global.Home));
|
||||
Print("serverName=" + serverName);
|
||||
Print("=====");
|
||||
//----
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package TestingSystem.Common;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
@@ -127,7 +128,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
public TestingServer() {
|
||||
super(TestsDatabase.class);
|
||||
name = Utils.getDateName("testingServer");
|
||||
System.out.println("ServerName=" + Utils.Brackets(name));
|
||||
System.out.println("ServerName=" + CommonUtils.Brackets(name));
|
||||
}
|
||||
//основа
|
||||
@Override
|
||||
@@ -178,7 +179,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
EmailMessage message = Log.isEmpty() ?
|
||||
new EmailMessage(
|
||||
"Запущено автоматическое тестирование версии " + request.arg + " системы SAPFOR",
|
||||
"Пакет "+ Utils.Brackets(autoPackage.id), new Vector<>()) :
|
||||
"Пакет "+ CommonUtils.Brackets(autoPackage.id), new Vector<>()) :
|
||||
new EmailMessage(
|
||||
"Не удалось запустить автоматическое тестирование версии " + request.arg + " системы SAPFOR",
|
||||
Log.toString(),
|
||||
@@ -295,7 +296,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
pathname.isFile()
|
||||
&& !pathname.getName().equals("settings")
|
||||
&& !pathname.getName().equals("test-analyzer.sh")
|
||||
&& Utils.getExtension(pathname).startsWith(languageName.getDVMCompile()));
|
||||
&& CommonUtils.getExtension(pathname).startsWith(languageName.getDVMCompile()));
|
||||
;
|
||||
if (files != null) {
|
||||
groupFiles = new Vector<>(Arrays.asList(files));
|
||||
@@ -392,7 +393,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
}
|
||||
private void DVMPackageNeedsKill() {
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
response.object = Constants.Nan;
|
||||
response.object = CommonConstants.Nan;
|
||||
int packageId = (int) request.object;
|
||||
for (TestingPackageToKill packageToKill : db.testingPackagesToKill.Data.values()) {
|
||||
if ((packageToKill.packageId == packageId) && (packageToKill.type == 0)) {
|
||||
@@ -403,7 +404,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
}
|
||||
private void SapforPackageNeedsKill() throws Exception {
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
response.object = Constants.Nan;
|
||||
response.object = CommonConstants.Nan;
|
||||
int packageId = (int) request.object;
|
||||
for (TestingPackageToKill packageToKill : db.testingPackagesToKill.Data.values()) {
|
||||
if ((packageToKill.packageId == packageId) && (packageToKill.type == 1)) {
|
||||
@@ -483,11 +484,11 @@ 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 " + Utils.Brackets(package_id) + " не существует.");
|
||||
throw new RepositoryRefuseException("Пакета задач DVM " + CommonUtils.Brackets(package_id) + " не существует.");
|
||||
DVMPackage dvmPackage = db.dvmPackages.get(package_id);
|
||||
File json = dvmPackage.getJsonFile();
|
||||
if (!json.exists())
|
||||
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач DVM " + Utils.Brackets(package_id));
|
||||
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач DVM " + CommonUtils.Brackets(package_id));
|
||||
jsons.add((DVMPackage_json) CommonUtils.jsonFromFile(json, DVMPackage_json.class));
|
||||
}
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
@@ -498,11 +499,11 @@ 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 " + Utils.Brackets(package_id) + " не существует.");
|
||||
throw new RepositoryRefuseException("Пакета задач SAPFOR " + CommonUtils.Brackets(package_id) + " не существует.");
|
||||
SapforPackage sapforPackage = db.sapforPackages.get(package_id);
|
||||
File json = sapforPackage.getJsonFile();
|
||||
if (!json.exists())
|
||||
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач SAPFOR " + Utils.Brackets(package_id));
|
||||
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач SAPFOR " + CommonUtils.Brackets(package_id));
|
||||
jsons.add((SapforPackage_json) CommonUtils.jsonFromFile(json, SapforPackage_json.class));
|
||||
}
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
@@ -562,7 +563,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
Global.TempDirectory,
|
||||
"get_version",
|
||||
"wget --user dvmhuser --password dvmh2013 -P " +
|
||||
Utils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
|
||||
CommonUtils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
|
||||
" http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h"
|
||||
).waitFor();
|
||||
if (!versionFile.exists())
|
||||
@@ -582,7 +583,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
Global.TempDirectory,
|
||||
"get_version",
|
||||
"wget --user dvmhuser --password dvmh2013 -P " +
|
||||
Utils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
|
||||
CommonUtils.DQuotes(Global.TempDirectory.getAbsolutePath()) +
|
||||
" http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h"
|
||||
).waitFor();
|
||||
if (!versionFile.exists())
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
package TestingSystem.Common;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import _VisualDVM.Global;
|
||||
@@ -194,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("Не удалось определить размерность теста " + Utils.Brackets(test.description));
|
||||
throw new RepositoryRefuseException("Не удалось определить размерность теста " + CommonUtils.Brackets(test.description));
|
||||
break;
|
||||
case c:
|
||||
test.max_dim = Utils.getCTestMaxDim(testFile);
|
||||
@@ -222,12 +224,12 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
if (oldGroup == null) {
|
||||
Insert(group);
|
||||
for (File file : files) {
|
||||
String testDescription = Utils.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
|
||||
String testDescription = CommonUtils.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
|
||||
CreateTestFromSingleFile(account, sapfor, group, file, testDescription);
|
||||
}
|
||||
} else {
|
||||
for (File file : files) {
|
||||
String testDescription = Utils.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
|
||||
String testDescription = CommonUtils.getNameWithoutExtension(file.getName()) + "_" + group.language.getDVMCompile();
|
||||
Test oldTest = tests.getTestByDescription(oldGroup.id, testDescription);
|
||||
if (oldTest == null) {
|
||||
CreateTestFromSingleFile(account, sapfor, oldGroup, file, testDescription);
|
||||
@@ -287,10 +289,10 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
|
||||
}
|
||||
public Integer getInstalledSapforMaxVersion() {
|
||||
int max_version = Constants.Nan;
|
||||
int max_version = CommonConstants.Nan;
|
||||
for (ServerSapfor sapfor : serverSapfors.Data.values()) {
|
||||
if (sapfor.state.equals(ServerSapforState.Done)) {
|
||||
int version = Constants.Nan;
|
||||
int version = CommonConstants.Nan;
|
||||
try {
|
||||
version = Integer.parseInt(sapfor.version);
|
||||
} catch (Exception ex) {
|
||||
|
||||
Reference in New Issue
Block a user