упорядочил папки с кодом.
This commit is contained in:
49
src/Common/Passes/All/PublishTest.java
Normal file
49
src/Common/Passes/All/PublishTest.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package Common.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Repository.TestingSystem.Common.Test.Test;
|
||||
import Repository.TestingSystem.Common.TestingServer;
|
||||
import Common.Passes.PassCode_2021;
|
||||
import Common.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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user