исправил внесенные баги, связанные с созданием тестов из версий проекта.
This commit is contained in:
@@ -13,6 +13,7 @@ public interface MainWindow {
|
||||
void ShowUpdatesIcon();
|
||||
void FocusProject();
|
||||
void FocusCallback();
|
||||
void FocusTests();
|
||||
void FocusTesting();
|
||||
|
||||
void ShowTestingTab();
|
||||
|
||||
@@ -6,6 +6,7 @@ public class TestsMenuBar extends DataMenuBar {
|
||||
super("тесты",
|
||||
PassCode_2021.DownloadTest,
|
||||
PassCode_2021.PublishTest,
|
||||
PassCode_2021.CreateTestFromDirectory,
|
||||
PassCode_2021.EditTest,
|
||||
PassCode_2021.DeleteTest);
|
||||
}
|
||||
|
||||
20
src/Visual_DVM_2021/Passes/All/CreateTestFromDirectory.java
Normal file
20
src/Visual_DVM_2021/Passes/All/CreateTestFromDirectory.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.Files.VDirectoryChooser;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class CreateTestFromDirectory extends Pass_2021<Test> {
|
||||
VDirectoryChooser directoryChooser = new VDirectoryChooser("Выбор домашней папки теста");
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/OpenProject.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +1,18 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.Test.TestType;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
import java.util.Vector;
|
||||
public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_project_info>> {
|
||||
Group group;
|
||||
Test test;
|
||||
int group_id;
|
||||
int test_id;
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return true;
|
||||
@@ -28,6 +27,8 @@ public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_pr
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
group_id = Constants.Nan;
|
||||
test_id = Constants.Nan;
|
||||
if (!Current.getAccount().CheckRegistered(Log))
|
||||
return false;
|
||||
if (!Global.versions_multiselection) {
|
||||
@@ -35,8 +36,6 @@ public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_pr
|
||||
return false;
|
||||
}
|
||||
target = new Vector<>();
|
||||
group = null;
|
||||
test = null;
|
||||
Current.getRoot().getSelectedVersions(target);
|
||||
if (target.size() == 0) {
|
||||
Log.Writeln_("Не отмечено ни одной версии.");
|
||||
@@ -87,7 +86,7 @@ public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_pr
|
||||
};
|
||||
ShowMessage1("Публикация группы ");
|
||||
if (publishGroup.Do()) {
|
||||
group = publishGroup.target;
|
||||
group_id = (int) publishGroup.pk;
|
||||
for (db_project_info vizTestProject : target) {
|
||||
//на случай если версия в текущем сеансе еще не открывалась.
|
||||
vizTestProject.Open();
|
||||
@@ -99,18 +98,25 @@ public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_pr
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean fillObjectFields() throws Exception {
|
||||
public boolean setProject() {
|
||||
project = vizTestProject;
|
||||
if (project.checkSubdirectories(Log)) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean fillObjectFields() throws Exception {
|
||||
if (setProject() && project.checkSubdirectories(Log)) {
|
||||
target.description = project.getLocalName() + " " + project.description;
|
||||
target.group_id = group_id;
|
||||
switch (project.languageName) {
|
||||
case fortran:
|
||||
project.testMaxDim = Current.getSapfor().getTextMaxDim(null, project);
|
||||
break;
|
||||
target.dim = Current.getSapfor().getTextMaxDim(null, project);
|
||||
return true;
|
||||
case c:
|
||||
target.dim = Utils.getCProjectMaxDim(project);
|
||||
return true;
|
||||
default:
|
||||
project.testMaxDim = 0;
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -118,19 +124,31 @@ public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_pr
|
||||
public String getDescription() {
|
||||
return "Добавление версии " + vizTestProject.name;
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
test_id = (int) pk;
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
}
|
||||
};
|
||||
if (pass.Do())
|
||||
test = pass.target;
|
||||
}
|
||||
if (passes.get(PassCode_2021.SynchronizeTests).Do()) {
|
||||
if (group != null) Global.testingServer.db.groups.ui_.Show(group.getPK());
|
||||
if (test != null) Global.testingServer.db.tests.ui_.Show(test.getPK());
|
||||
if (!pass.Do()) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
super.performDone();
|
||||
passes.get(PassCode_2021.SynchronizeTests).Do();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
super.showDone();
|
||||
Global.testingServer.db.groups.ui_.Show(group_id);
|
||||
Global.testingServer.db.tests.ui_.Show(test_id);
|
||||
}
|
||||
@Override
|
||||
protected void FocusResult() {
|
||||
UI.getMainWindow().FocusTesting();
|
||||
UI.getMainWindow().getTestingWindow().FocusTestingSystem();
|
||||
UI.getMainWindow().FocusTests();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import Repository.Server.ComponentsServer;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DeleteSubscriber extends DeleteObjectPass<Subscriber> {
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObject;
|
||||
public class DeleteSubscriber extends DeleteServerObject<ComponentsServer,Subscriber> {
|
||||
public DeleteSubscriber() {
|
||||
super(Subscriber.class);
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.componentsServer.db;
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
passes.get(PassCode_2021.DeleteSubscriberOnServer).Do(target);
|
||||
super(Global.componentsServer, Subscriber.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DeleteSubscriberOnServer extends ComponentsRepositoryPass<Subscriber> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (Subscriber) args[0];
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.DeleteObject, "", target));
|
||||
}
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
super.performFinish();
|
||||
passes.get(PassCode_2021.SynchronizeBugReports).Do();
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,10 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import Repository.Server.ComponentsServer;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import Visual_DVM_2021.Passes.EditObjectPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class EditSubscriber extends EditObjectPass<Subscriber> {
|
||||
import Visual_DVM_2021.Passes.Server.EditServerObject;
|
||||
public class EditSubscriber extends EditServerObject<ComponentsServer,Subscriber> {
|
||||
public EditSubscriber() {
|
||||
super(Subscriber.class);
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.Subscriber)){
|
||||
target = Current.getSubscriber();
|
||||
return getTable().ShowEditObjectDialog(target);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.componentsServer.db;
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
//отправка.
|
||||
passes.get(PassCode_2021.EditSubscriberOnServer).Do(target);
|
||||
super(Global.componentsServer, Subscriber.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class EditSubscriberOnServer extends ComponentsRepositoryPass<Subscriber> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (Subscriber) args[0];
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.EditObject, "", target));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
super.performFinish();
|
||||
passes.get(PassCode_2021.SynchronizeBugReports).Do();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
super.showDone();
|
||||
server.db.subscribers.ui_.Show(target.getPK());
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
@@ -14,26 +13,15 @@ public class PublishTest extends PublishServerObject<TestingServer, Test> {
|
||||
}
|
||||
db_project_info project = null;
|
||||
protected boolean setProject() {
|
||||
if (Current.Check(Log, Current.Group, Current.Project)
|
||||
&& UI.Question("Добавить текущий проект в глобальную базу тестов")) {
|
||||
if (Current.Check(Log, Current.Group, Current.Project) && UI.Question("Добавить текущий проект в глобальную базу тестов")) {
|
||||
project = Current.getProject();
|
||||
if (project.checkSubdirectories(Log)) {
|
||||
switch (project.languageName) {
|
||||
case fortran:
|
||||
return passes.get(PassCode_2021.SPF_GetMaxMinBlockDistribution).Do();
|
||||
case c:
|
||||
project.testMaxDim = Utils.getCProjectMaxDim(project);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean fillObjectFields() throws Exception {
|
||||
if (setProject()) {
|
||||
if (setProject()&&project.checkSubdirectories(Log)) {
|
||||
target.description = project.getLocalName() + " " + project.description;
|
||||
target.dim = project.testMaxDim;
|
||||
target.group_id = Current.getGroup().id;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.SilentSapforPass;
|
||||
public class SPF_GetMaxMinBlockDistribution extends SilentSapforPass {
|
||||
@@ -14,6 +15,7 @@ public class SPF_GetMaxMinBlockDistribution extends SilentSapforPass {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (super.canStart(args)){
|
||||
UI.Info("+");
|
||||
SPF_ParseFilesWithOrder.silent = true;
|
||||
return (passes.get(PassCode_2021.SPF_ParseFilesWithOrder).isDone() || passes.get(PassCode_2021.SPF_ParseFilesWithOrder).Do());
|
||||
}
|
||||
|
||||
@@ -24,9 +24,7 @@ public enum PassCode_2021 {
|
||||
EditAccount,
|
||||
AddSubscriber,
|
||||
EditSubscriber,
|
||||
EditSubscriberOnServer,
|
||||
DeleteSubscriber,
|
||||
DeleteSubscriberOnServer,
|
||||
//----
|
||||
SetSelectedFilesLanguage,
|
||||
SetSelectedFilesStyle,
|
||||
@@ -262,7 +260,6 @@ public enum PassCode_2021 {
|
||||
GetTestsQueueSize,
|
||||
ApplyCurrentFunction,
|
||||
//->
|
||||
// GetRemoteUserHome,
|
||||
CheckRemoteWorkspace,
|
||||
PublishRemoteWorkspace,
|
||||
//->
|
||||
@@ -299,12 +296,16 @@ public enum PassCode_2021 {
|
||||
DeleteTest,
|
||||
DeleteConfiguration,
|
||||
AbortTaskPackage,
|
||||
//--
|
||||
CreateTestFromDirectory,
|
||||
//->
|
||||
TestPass;
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case Undefined:
|
||||
return "?";
|
||||
case CreateTestFromDirectory:
|
||||
return "Создать тест из папки";
|
||||
case AbortTaskPackage:
|
||||
return "Прерывать пакет тестирования DVM";
|
||||
case DeleteConfiguration:
|
||||
@@ -365,10 +366,6 @@ public enum PassCode_2021 {
|
||||
return "Редактировать учётную запись";
|
||||
case DeleteSubscriber:
|
||||
return "Удалить учётную запись";
|
||||
case DeleteSubscriberOnServer:
|
||||
return "Удалить учётную запись на сервере";
|
||||
case EditSubscriberOnServer:
|
||||
return "Редактировать учётную запись на сервере";
|
||||
case CheckAccount:
|
||||
return "Проверка учётной записи";
|
||||
case CheckRegistrationOnServer:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package Visual_DVM_2021.Passes.Server;
|
||||
import Common.Database.riDBObject;
|
||||
import Common.Database.DBObject;
|
||||
import Repository.RepositoryServer;
|
||||
public class DeleteServerObject<S extends RepositoryServer, D extends riDBObject> extends ServerObjectPass<S, D> {
|
||||
public class DeleteServerObject<S extends RepositoryServer, D extends DBObject> extends ServerObjectPass<S, D> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Delete.png";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package Visual_DVM_2021.Passes.Server;
|
||||
import Common.Database.riDBObject;
|
||||
import Common.Database.DBObject;
|
||||
import Repository.RepositoryServer;
|
||||
public class EditServerObject<S extends RepositoryServer, D extends riDBObject> extends ServerObjectPass<S, D> {
|
||||
public class EditServerObject<S extends RepositoryServer, D extends DBObject> extends ServerObjectPass<S, D> {
|
||||
//--
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package Visual_DVM_2021.Passes.Server;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.Database;
|
||||
import Common.Database.riDBObject;
|
||||
import Common.Global;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
public class PublishServerAccountObject<D extends riDBObject> extends PublishServerObject<TestingServer, D> {
|
||||
public class PublishServerAccountObject<D extends DBObject> extends PublishServerObject<TestingServer, D> {
|
||||
public PublishServerAccountObject(Class<D> d_in) {
|
||||
super(Global.testingServer, d_in);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package Visual_DVM_2021.Passes.Server;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.riDBObject;
|
||||
import Repository.RepositoryServer;
|
||||
public class PublishServerObject<S extends RepositoryServer, D extends riDBObject> extends ServerObjectPass<S, D> {
|
||||
protected Object pk = null;
|
||||
public class PublishServerObject<S extends RepositoryServer, D extends DBObject> extends ServerObjectPass<S, D> {
|
||||
public Object pk = null;
|
||||
public PublishServerObject(S server_in, Class<D> d_in) {
|
||||
super(server_in, d_in);
|
||||
}
|
||||
@@ -17,8 +18,11 @@ public class PublishServerObject<S extends RepositoryServer, D extends riDBObjec
|
||||
pk = null;
|
||||
if (Current.getAccount().CheckRegistered(Log)) {
|
||||
target = d.newInstance();
|
||||
target.sender_name = Current.getAccount().name;
|
||||
target.sender_address = Current.getAccount().email;
|
||||
if (target instanceof riDBObject) {
|
||||
riDBObject rTarget = (riDBObject) target;
|
||||
rTarget.sender_name = Current.getAccount().name;
|
||||
rTarget.sender_address = Current.getAccount().email;
|
||||
}
|
||||
return fillObjectFields();
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -9,8 +9,6 @@ public interface TestingWindow extends VisualizerForm {
|
||||
void ShowNoTestRunTask();
|
||||
//-
|
||||
void RefreshTabsNames();
|
||||
void FocusTestingSystem();
|
||||
|
||||
void RemountTestTable();
|
||||
//-
|
||||
void FocusTestingTasks();
|
||||
|
||||
@@ -240,6 +240,10 @@ public class MainForm extends Form implements MainWindow {
|
||||
globalTabs.setSelectedIndex(1);
|
||||
}
|
||||
@Override
|
||||
public void FocusTests() {
|
||||
globalTabs.setSelectedIndex(3);
|
||||
}
|
||||
@Override
|
||||
public void FocusTesting() {
|
||||
globalTabs.setSelectedIndex(4);
|
||||
}
|
||||
|
||||
@@ -140,10 +140,6 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
filterName = new StyledTextField();
|
||||
}
|
||||
@Override
|
||||
public void FocusTestingSystem() {
|
||||
testingTabs.setSelectedIndex(2);
|
||||
}
|
||||
@Override
|
||||
public void FocusTestingTasks() {
|
||||
}
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user