no message

This commit is contained in:
2023-11-24 20:51:16 +03:00
parent 5b02a435ce
commit 170e0eeaad
4 changed files with 33 additions and 24 deletions

View File

@@ -334,8 +334,10 @@ public abstract class RepositoryServer<D extends Database> {
response = new ServerExchangeUnit_2021(ServerCode.OK); response = new ServerExchangeUnit_2021(ServerCode.OK);
Vector<DBObject> objects = (Vector<DBObject>) request.object; Vector<DBObject> objects = (Vector<DBObject>) request.object;
for (DBObject dbObject: objects){ for (DBObject dbObject: objects){
System.out.println(db);
beforePublishAction(dbObject); beforePublishAction(dbObject);
response.object = publishObject(dbObject); response.object = publishObject(dbObject);
System.out.println(response.object);
afterPublishAction(dbObject); afterPublishAction(dbObject);
} }
//ключи не возвращаем. пока не нужны. //ключи не возвращаем. пока не нужны.

View File

@@ -3,6 +3,7 @@ import Common.Constants;
import Common.Current; import Common.Current;
import Common.Utils.Files.VDirectoryChooser; import Common.Utils.Files.VDirectoryChooser;
import Common.Utils.Utils; import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.Files.ProjectFile; import ProjectData.Files.ProjectFile;
import ProjectData.Project.db_project_info; import ProjectData.Project.db_project_info;
import Repository.Component.Sapfor.Sapfor; import Repository.Component.Sapfor.Sapfor;
@@ -25,11 +26,11 @@ public class CreateTestFromFolder extends Pass_2021<Test> {
} }
@Override @Override
protected boolean needsAnimation() { protected boolean needsAnimation() {
return true; return from_directory_chooser;
} }
Group group = null; Group group = null;
File dir = null; File dir = null;
boolean from_directory_chooser; boolean from_directory_chooser=false;
Vector<ProjectFile> project_files = new Vector<>(); Vector<ProjectFile> project_files = new Vector<>();
@Override @Override
protected boolean canStart(Object... args) throws Exception { protected boolean canStart(Object... args) throws Exception {
@@ -37,17 +38,20 @@ public class CreateTestFromFolder extends Pass_2021<Test> {
from_directory_chooser = true; from_directory_chooser = true;
if (!Current.Check(Log, Current.Group)) if (!Current.Check(Log, Current.Group))
return false; return false;
Utils.RestoreSelectedDirectory(directoryChooser);
dir = directoryChooser.ShowDialog(); dir = directoryChooser.ShowDialog();
group = Current.getGroup(); group = Current.getGroup();
if (dir == null) {
if (from_directory_chooser) Log.Writeln_("Папка не выбрана.");
return false;
} else {
Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(SettingName.ProjectsSearchDirectory, dir.getParent());
}
} else { } else {
from_directory_chooser = false; from_directory_chooser = false;
dir = (File) args[0]; dir = (File) args[0];
group = (Group) args[1]; group = (Group) args[1];
} }
if (dir == null) {
if (from_directory_chooser) Log.Writeln_("Папка не выбрана.");
return false;
}
//--- //---
File[] files = dir.listFiles(); File[] files = dir.listFiles();
project_files = new Vector<>(); project_files = new Vector<>();
@@ -144,9 +148,9 @@ public class CreateTestFromFolder extends Pass_2021<Test> {
if (Sapfor.analysis(Current.getSapfor().getFile(), project.Home, if (Sapfor.analysis(Current.getSapfor().getFile(), project.Home,
PassCode_2021.SPF_GetMaxMinBlockDistribution, PassCode_2021.SPF_GetMaxMinBlockDistribution,
Current.getSapfor().getConsoleFlags())) { Current.getSapfor().getConsoleFlags())) {
for (String line: Sapfor.outputLines){ for (String line : Sapfor.outputLines) {
String prefix = "GET_MIN_MAX_BLOCK_DIST: "; String prefix = "GET_MIN_MAX_BLOCK_DIST: ";
if (line.startsWith(prefix)){ if (line.startsWith(prefix)) {
String s = line.substring(prefix.length()); String s = line.substring(prefix.length());
System.out.println(Utils.Brackets(s)); System.out.println(Utils.Brackets(s));
String[] data = s.split(" "); String[] data = s.split(" ");

View File

@@ -5,6 +5,7 @@ import Common.Global;
import Common.UI.UI; import Common.UI.UI;
import Common.Utils.Utils; import Common.Utils.Utils;
import ProjectData.Project.db_project_info; import ProjectData.Project.db_project_info;
import TestingSystem.Common.Test.Test;
import Visual_DVM_2021.Passes.PassCode_2021; import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021; import Visual_DVM_2021.Passes.Pass_2021;
@@ -12,6 +13,7 @@ import java.util.Vector;
public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_project_info>> { public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_project_info>> {
int group_id; int group_id;
int test_id; int test_id;
Vector<Test> tests = new Vector<>();
@Override @Override
protected boolean needsAnimation() { protected boolean needsAnimation() {
return true; return true;
@@ -28,6 +30,7 @@ public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_pr
protected boolean canStart(Object... args) throws Exception { protected boolean canStart(Object... args) throws Exception {
group_id = Constants.Nan; group_id = Constants.Nan;
test_id = Constants.Nan; test_id = Constants.Nan;
tests = new Vector<>();
if (!Current.getAccount().CheckRegistered(Log)) if (!Current.getAccount().CheckRegistered(Log))
return false; return false;
if (!Global.versions_multiselection) { if (!Global.versions_multiselection) {
@@ -62,23 +65,23 @@ public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_pr
"\родолжить"); "\родолжить");
} }
@Override @Override
protected void performPreparation() throws Exception {
passes.get(PassCode_2021.CloseCurrentProject).Do();
}
@Override
protected void showPreparation() throws Exception { protected void showPreparation() throws Exception {
UI.testingBar.ShowAutoCheckTesting(); UI.testingBar.ShowAutoCheckTesting();
} }
@Override @Override
protected void body() throws Exception { protected void body() throws Exception {
/* ShowMessage1("Создание тестов");
CreateTestFromFolder createTestFromFolder = (CreateTestFromFolder) passes.get(PassCode_2021.CreateTestFromFolder);
PublishTests publishTests = (PublishTests) passes.get(PassCode_2021.PublishTests);
for (db_project_info vizTestProject : target) { for (db_project_info vizTestProject : target) {
//на случай если версия в текущем сеансе еще не открывалась. ShowMessage2(vizTestProject.name);
vizTestProject.Open(); if (createTestFromFolder.Do(vizTestProject.Home, Current.getGroup())) {
vizTestProject.Close(); tests.add(createTestFromFolder.target);
if (!passes.get(PassCode_2021.PublishTest).Do(vizTestProject, Current.getGroup().id)) break; } else break;
} }
*/ System.out.println("tests created " + tests.size());
ShowMessage1("Публикация тестов");
publishTests.Do(tests);
} }
@Override @Override
protected void performFinish() throws Exception { protected void performFinish() throws Exception {

View File

@@ -6,17 +6,17 @@ import Visual_DVM_2021.Passes.Server.TestingSystemPass;
import java.util.Vector; import java.util.Vector;
public class PublishTests extends TestingSystemPass<Vector<Test>> { public class PublishTests extends TestingSystemPass<Vector<Test>> {
@Override
protected boolean needsAnimation() {
return false;
}
@Override @Override
protected boolean canStart(Object... args) throws Exception { protected boolean canStart(Object... args) throws Exception {
target = (Vector<Test>) args[0];
return target != null && !target.isEmpty(); return target != null && !target.isEmpty();
} }
@Override @Override
protected void ServerAction() throws Exception { protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.PublishObjects, "", target)); Command(new ServerExchangeUnit_2021(ServerCode.PublishObjects, null, target));
}
@Override
protected void performFinish() throws Exception {
super.performFinish();
passes.get(server.db.getSynchronizePassCode()).Do();
} }
} }