2023-11-19 02:12:44 +03:00
|
|
|
package Visual_DVM_2021.Passes.All;
|
2023-09-17 22:13:42 +03:00
|
|
|
import Common.Current;
|
2023-11-16 21:03:25 +03:00
|
|
|
import Common.Global;
|
2023-09-17 22:13:42 +03:00
|
|
|
import Common.UI.UI;
|
|
|
|
|
import ProjectData.Project.db_project_info;
|
2023-11-19 02:12:44 +03:00
|
|
|
import TestingSystem.Common.Test.Test;
|
|
|
|
|
import TestingSystem.Common.TestingServer;
|
|
|
|
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
|
|
|
import Visual_DVM_2021.Passes.Server.PublishServerObject;
|
2023-11-16 21:03:25 +03:00
|
|
|
public class PublishTest extends PublishServerObject<TestingServer, Test> {
|
|
|
|
|
public PublishTest() {
|
|
|
|
|
super(Global.testingServer, Test.class);
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
2023-11-17 00:04:21 +03:00
|
|
|
db_project_info project = null;
|
2023-09-17 22:13:42 +03:00
|
|
|
protected boolean setProject() {
|
2023-11-20 00:15:22 +03:00
|
|
|
if (Current.Check(Log, Current.Group, Current.Project) && UI.Question("Добавить текущий проект в глобальную базу тестов")) {
|
2023-09-17 22:13:42 +03:00
|
|
|
project = Current.getProject();
|
2023-11-20 00:15:22 +03:00
|
|
|
return true;
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2023-11-16 21:03:25 +03:00
|
|
|
public boolean fillObjectFields() throws Exception {
|
2023-11-20 00:15:22 +03:00
|
|
|
if (setProject()&&project.checkSubdirectories(Log)) {
|
2023-09-17 22:13:42 +03:00
|
|
|
target.description = project.getLocalName() + " " + project.description;
|
|
|
|
|
target.dim = project.testMaxDim;
|
|
|
|
|
target.group_id = Current.getGroup().id;
|
2023-11-17 00:04:21 +03:00
|
|
|
return super.fillObjectFields();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void performDone() throws Exception {
|
|
|
|
|
super.performDone();
|
2023-11-17 00:58:58 +03:00
|
|
|
passes.get(PassCode_2021.PublishTestProject).Do(project, pk);
|
2023-11-17 00:04:21 +03:00
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|