50 lines
1.8 KiB
Java
50 lines
1.8 KiB
Java
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;
|
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
import Visual_DVM_2021.Passes.Server.PublishServerObject;
|
|
public class PublishTest extends PublishServerObject<TestingServer, Test> {
|
|
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();
|
|
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 false;
|
|
}
|
|
@Override
|
|
public boolean fillObjectFields() throws Exception {
|
|
if (setProject()) {
|
|
target.description = project.getLocalName() + " " + project.description;
|
|
target.dim = project.testMaxDim;
|
|
target.group_id = Current.getGroup().id;
|
|
return super.fillObjectFields();
|
|
}
|
|
return false;
|
|
}
|
|
@Override
|
|
protected void performDone() throws Exception {
|
|
super.performDone();
|
|
passes.get(PassCode_2021.PublishTestProject).Do(project, pk);
|
|
}
|
|
}
|