fix
This commit is contained in:
@@ -76,62 +76,10 @@ public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_pr
|
||||
//на случай если версия в текущем сеансе еще не открывалась.
|
||||
vizTestProject.Open();
|
||||
vizTestProject.Close();
|
||||
ShowMessage1("Публикация теста " + vizTestProject.getTitle());
|
||||
PublishTest pass = new PublishTest() {
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean setProject() {
|
||||
project = vizTestProject;
|
||||
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:
|
||||
target.dim = Current.getSapfor().getTextMaxDim(null, project);
|
||||
return true;
|
||||
case c:
|
||||
target.dim = Utils.getCProjectMaxDim(project);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
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()) return;
|
||||
if (!passes.get(PassCode_2021.PublishTest).Do(vizTestProject, Current.getGroup())) break;
|
||||
}
|
||||
}
|
||||
@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().FocusTests();
|
||||
}
|
||||
|
||||
@@ -2,32 +2,62 @@ 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.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Server.PublishServerObject;
|
||||
public class PublishTest extends PublishServerObject<TestingServer, Test> {
|
||||
boolean from_current_project;
|
||||
protected Group group = null;
|
||||
protected db_project_info project = null;
|
||||
public PublishTest() {
|
||||
super(Global.testingServer, Test.class);
|
||||
}
|
||||
db_project_info project = null;
|
||||
protected boolean setProject() {
|
||||
if (Current.Check(Log, Current.Group, Current.Project) && UI.Question("Добавить текущий проект в глобальную базу тестов")) {
|
||||
project = Current.getProject();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean fillObjectFields() throws Exception {
|
||||
if (setProject()&&project.checkSubdirectories(Log)) {
|
||||
target.description = project.getLocalName() + " " + project.description;
|
||||
target.description = project.getLocalName() + " " + project.description;
|
||||
target.group_id = group.id;
|
||||
if (from_current_project) {
|
||||
target.dim = project.testMaxDim;
|
||||
target.group_id = Current.getGroup().id;
|
||||
return super.fillObjectFields();
|
||||
} else {
|
||||
switch (project.languageName) {
|
||||
case fortran:
|
||||
target.dim = Current.getSapfor().getTextMaxDim(null, project);
|
||||
break;
|
||||
case c:
|
||||
target.dim = Utils.getCProjectMaxDim(project);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
group = null;
|
||||
project = null;
|
||||
if (args.length == 0) {
|
||||
from_current_project = true;
|
||||
if (Current.Check(Log, Current.Group, Current.Project) && UI.Question("Добавить текущий проект в глобальную базу тестов")) {
|
||||
project = Current.getProject();
|
||||
group= Current.getGroup();
|
||||
}
|
||||
} else {
|
||||
from_current_project = false;
|
||||
project = (db_project_info) args[0];
|
||||
group = (Group) args[1];
|
||||
}
|
||||
//--
|
||||
if (project == null)
|
||||
return false;
|
||||
//--
|
||||
if (!project.checkSubdirectories(Log))
|
||||
return false;
|
||||
//-
|
||||
return super.canStart(args);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user