v++
This commit is contained in:
@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
|
||||
|
||||
import java.util.Vector;
|
||||
public class Constants {
|
||||
public static final int version = 1168;
|
||||
public static final int version = 1171;
|
||||
public static final int planner_version = 6;
|
||||
public static final int testingMaxKernels = 64; //вообще говоря, это параметр машины.
|
||||
//--
|
||||
@@ -45,7 +45,7 @@ public class Constants {
|
||||
public static final int MailSocketPort = 465;
|
||||
public static final int ComponentsServerPort = 7995;
|
||||
public static final int TestingServerPort = 7998;
|
||||
public static final int SocketTimeout = 5000;
|
||||
public static final int SocketTimeout = 0;
|
||||
//-
|
||||
public static final String ServerAddress = "alex-freenas.ddns.net";
|
||||
public static final String ServerUserName = "testuser";
|
||||
|
||||
@@ -197,6 +197,7 @@ public class Global {
|
||||
//light_editor.xml-------->>
|
||||
mainModule.ActivateDB();
|
||||
/*
|
||||
https://habr.com/ru/articles/446888/ сертификат?
|
||||
mainModule.set(Current.Account, new Account() {
|
||||
{
|
||||
name = "M";
|
||||
|
||||
@@ -18,13 +18,8 @@ public class ConvertCorrectnessTests extends TestingServerPass<File> {
|
||||
Log.Writeln_("Вы не являетесь администратором");
|
||||
return false;
|
||||
}
|
||||
if (!Global.testingServer.db.serverSapfors.getUI().CheckCurrent(Log)) {
|
||||
return false;
|
||||
}
|
||||
return UI.Warning("Загрузить полный пакет DVM тестов на корректность и производительность.")&&
|
||||
SendRequest(ServerCode.RefreshDVMTests,
|
||||
String.valueOf(
|
||||
Global.testingServer.db.serverSapfors.getUI().getCurrent().id), Global.mainModule.getAccount(),0);
|
||||
SendRequest(ServerCode.RefreshDVMTests, "", Global.mainModule.getAccount());
|
||||
}
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
|
||||
@@ -72,7 +72,7 @@ public class DVMConvertProject extends ComponentsServerPass<db_project_info> {
|
||||
unit_args.add(target.languageName.toString());
|
||||
unit_args.add(target.sapforProperties.DVMConvertationOptions);
|
||||
unit_args.addAll(programsNames);
|
||||
return SendRequest(ServerCode.DVMConvertProject, String.join("\n", unit_args),Utils_.fileToBytes(archive),0);
|
||||
return SendRequest(ServerCode.DVMConvertProject, String.join("\n", unit_args),Utils_.fileToBytes(archive));
|
||||
//--
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -16,7 +16,7 @@ public class DetectSelectedTestsMinMaDim extends TestingServerPass<Vector<Object
|
||||
if (!Global.testingServer.db.tests.getUI().CheckSelectedOrCurrent(Log))
|
||||
return false;
|
||||
target=Global.testingServer.db.tests.getUI().getSelectedOrCurrentKeys();
|
||||
return SendRequest(ServerCode.DetectTestsMinMaxDim, "",target, 0);
|
||||
return SendRequest(ServerCode.DetectTestsMinMaxDim, "",target);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
|
||||
@@ -22,7 +22,7 @@ public class DownloadAllBugReportsArchives extends ComponentsServerPass<File> {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return SendRequest(ServerCode.ReceiveAllArchives, "", null, 60000);
|
||||
return SendRequest(ServerCode.ReceiveAllArchives, "", null);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class DownloadDVMPackages extends TestingServerPass<Vector<Integer>> {
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (Vector<Integer>) args[0];
|
||||
packed_packages = null;
|
||||
return SendRequest(ServerCode.DownloadDVMPackages, "", target,0 );
|
||||
return SendRequest(ServerCode.DownloadDVMPackages, "", target);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
|
||||
@@ -12,6 +12,10 @@ public class DownloadRepository extends ProcessPass {
|
||||
File dvmHome;
|
||||
File sapforHome;
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Загрузка репозитория";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
dvmHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
|
||||
"dvm").toFile();
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DownloadSapforPackage extends TestingServerPass<SapforPackage> {
|
||||
}
|
||||
int id = target.id;
|
||||
loaded = new File(target.getLocalWorkspace(), CommonConstants.LOADED);
|
||||
return !loaded.exists()&&SendRequest(ServerCode.DownloadSapforPackage, "", id, 0);
|
||||
return !loaded.exists()&&SendRequest(ServerCode.DownloadSapforPackage, "", id);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Email extends ComponentsServerPass<EmailMessage> {
|
||||
int i = 0;
|
||||
for (String address : recipients) {
|
||||
ShowProgress(recipients.size(), i, true);
|
||||
SendRequest(ServerCode.Email, address, target,0);
|
||||
SendRequest(ServerCode.Email, address, target);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class JoinSapforTestingVersionsToGroup extends TestingServerPass {
|
||||
Log.Writeln_("Пакет не завершен!");
|
||||
return false;
|
||||
}
|
||||
return SendRequest(ServerCode.JoinSapforVersionsToGroup, group.id+"\n"+sapforPackage.id, null, 0 );
|
||||
return SendRequest(ServerCode.JoinSapforVersionsToGroup, group.id+"\n"+sapforPackage.id, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public abstract class ClientPass <S extends RepositoryServer,T> extends Pass<T>
|
||||
return "";
|
||||
}
|
||||
protected abstract S getServer();
|
||||
protected boolean SendRequest(ServerCode code_in, String arg_in, Serializable object_in, int delay){
|
||||
protected boolean SendRequest(ServerCode code_in, String arg_in, Serializable object_in){
|
||||
request = null;
|
||||
request = new RepositoryPass(getServer()) {
|
||||
@Override
|
||||
@@ -38,7 +38,7 @@ public abstract class ClientPass <S extends RepositoryServer,T> extends Pass<T>
|
||||
}
|
||||
@Override
|
||||
protected int getTimeout() {
|
||||
return delay;
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
@@ -55,9 +55,6 @@ public abstract class ClientPass <S extends RepositoryServer,T> extends Pass<T>
|
||||
};
|
||||
return request.Do();
|
||||
}
|
||||
protected boolean SendRequest(ServerCode code_in,String arg_in, Serializable object_in){
|
||||
return SendRequest(code_in,arg_in, object_in, Constants.SocketTimeout);
|
||||
}
|
||||
protected boolean SendRequest(ServerCode code_in, String arg_in){
|
||||
return SendRequest(code_in,arg_in,null);
|
||||
}
|
||||
|
||||
@@ -11,10 +11,6 @@ public abstract class StartTestingPackage<P extends TestingPackage> extends Publ
|
||||
super(Global.testingServer, p_in);
|
||||
}
|
||||
@Override
|
||||
protected int getTimeout() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/Common/icons/BlueStart.png";
|
||||
}
|
||||
|
||||
@@ -305,10 +305,6 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
return "Ping";
|
||||
}
|
||||
@Override
|
||||
protected int getTimeout() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
try {
|
||||
super.body();
|
||||
|
||||
@@ -50,7 +50,7 @@ public abstract class TestingClient {
|
||||
}
|
||||
@Override
|
||||
protected int getTimeout() {
|
||||
return 120000;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
if (!pass.Do()) {
|
||||
|
||||
@@ -40,10 +40,6 @@ public class TestsForm extends DataSetControlForm<Test> {
|
||||
public Class getRendererClass() {
|
||||
return RendererLongCell.class;
|
||||
}
|
||||
@Override
|
||||
public int getMaxWidth() {
|
||||
return 600;
|
||||
}
|
||||
},
|
||||
new ColumnInfo<Test>("min_dim") {
|
||||
@Override
|
||||
|
||||
@@ -320,11 +320,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
}
|
||||
void RefreshDVMTests() throws Exception {
|
||||
Account account = (Account) request.object;
|
||||
int sapfor_id = Integer.parseInt(request.arg);
|
||||
ServerSapfor sapfor = null;
|
||||
if (!db.serverSapfors.containsKey(sapfor_id))
|
||||
throw new RepositoryRefuseException("Версия SAPFOR с ключом " + sapfor_id + " не найдена.");
|
||||
sapfor = db.serverSapfors.get(sapfor_id);
|
||||
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
||||
DownloadRepository downloadRepository = new DownloadRepository();
|
||||
if (!downloadRepository.Do())
|
||||
throw new RepositoryRefuseException("Не удалось обновить репозиторий");
|
||||
@@ -368,7 +364,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
//-теперь создать тесты.
|
||||
//--
|
||||
for (Pair<Group, Vector<File>> p : groups)
|
||||
db.RefreshGroup(account, sapfor, p);
|
||||
db.RefreshGroup(account, serverSapfor, p);
|
||||
}
|
||||
void GetFirstActiveSapforPackages() throws Exception {
|
||||
response.object = db.getFirstActiveSapforPackagesCopies();
|
||||
|
||||
@@ -196,10 +196,12 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
FileUtils.forceMkdir(tempProject);
|
||||
FileUtils.copyDirectory(testDirectory, tempProject);
|
||||
//--
|
||||
if (Sapfor.getMinMaxDim(Sapfor.getTempCopy(new File(sapfor.call_command)), tempProject, test)) {
|
||||
Update(test);
|
||||
} else
|
||||
throw new RepositoryRefuseException("Не удалось определить размерность теста " + Utils_.Brackets(test.description));
|
||||
if (sapfor!=null) {
|
||||
if (Sapfor.getMinMaxDim(Sapfor.getTempCopy(new File(sapfor.call_command)), tempProject, test)) {
|
||||
Update(test);
|
||||
} else
|
||||
throw new RepositoryRefuseException("Не удалось определить размерность теста " + Utils_.Brackets(test.description));
|
||||
}
|
||||
break;
|
||||
case c:
|
||||
test.max_dim = Utils.getCTestMaxDim(testFile);
|
||||
|
||||
@@ -62,10 +62,6 @@ public class DVMConfigurationsForm extends DataSetControlForm<DVMConfiguration>
|
||||
public Class getRendererClass() {
|
||||
return RendererMultiline.class;
|
||||
}
|
||||
@Override
|
||||
public int getMaxWidth() {
|
||||
return 700;
|
||||
}
|
||||
},
|
||||
new ColumnInfo<DVMConfiguration>("тестов") {
|
||||
@Override
|
||||
|
||||
@@ -50,10 +50,6 @@ public class DVMPackagesForm extends DataSetControlForm<DVMPackage> {
|
||||
public Object getFieldAt(DVMPackage object) {
|
||||
return ((PackageCache) VisualCaches.GetCache(object)).getConfifurationsDescriptionsLine();
|
||||
}
|
||||
@Override
|
||||
public int getMaxWidth() {
|
||||
return 500;
|
||||
}
|
||||
},
|
||||
new ColumnInfo<DVMPackage>("задач") {
|
||||
@Override
|
||||
|
||||
@@ -73,10 +73,6 @@ public class SapforConfigurationsForm extends DataSetControlForm<SapforConfigura
|
||||
public Object getFieldAt(SapforConfiguration object) {
|
||||
return ((ConfigurationCache) VisualCaches.GetCache(object)).settingsSummary;
|
||||
}
|
||||
@Override
|
||||
public int getMaxWidth() {
|
||||
return 500;
|
||||
}
|
||||
},
|
||||
new ColumnInfo<SapforConfiguration>("группы") {
|
||||
@Override
|
||||
|
||||
@@ -38,10 +38,6 @@ public class SapforPackagesForm extends DataSetControlForm<SapforPackage> {
|
||||
public Object getFieldAt(SapforPackage object) {
|
||||
return ((PackageCache) VisualCaches.GetCache(object)).getConfifurationsDescriptionsLine();
|
||||
}
|
||||
@Override
|
||||
public int getMaxWidth() {
|
||||
return 500;
|
||||
}
|
||||
},
|
||||
new ColumnInfo<SapforPackage>("задач") {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user