обновлены проходы создания группы из папки, и теста из папки. Осталось обновить загрузку тестов из репозитория, там тоже задействована размерность.
This commit is contained in:
@@ -1,94 +1,44 @@
|
||||
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.Test.Test;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import Visual_DVM_2021.Passes.PublishTests;
|
||||
|
||||
import java.util.Vector;
|
||||
public class CreateTestsGroupFromSelectedVersions extends Pass_2021<Vector<db_project_info>> {
|
||||
int group_id;
|
||||
int test_id;
|
||||
Vector<Test> tests = new Vector<>();
|
||||
@Override
|
||||
protected boolean needsAnimation() {
|
||||
return true;
|
||||
}
|
||||
public class CreateTestsGroupFromSelectedVersions extends PublishTests {
|
||||
Vector<db_project_info> versions = new Vector<>();
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Publish.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
protected boolean getGroup() {
|
||||
if (Current.Check(Log, Current.Group)) {
|
||||
group = Current.getGroup();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
group_id = Constants.Nan;
|
||||
test_id = Constants.Nan;
|
||||
tests = new Vector<>();
|
||||
if (!Current.getAccount().CheckRegistered(Log))
|
||||
return false;
|
||||
protected boolean findFiles() {
|
||||
if (!Global.versions_multiselection) {
|
||||
Log.Writeln_("Нажмите правую клавишу мыши, и перейдите в режим выбора версий.");
|
||||
return false;
|
||||
}
|
||||
if (!Current.Check(Log, Current.Group)) {
|
||||
return false;
|
||||
}
|
||||
target = new Vector<>();
|
||||
group_id = Current.getGroup().id;
|
||||
Current.getRoot().getSelectedVersions(target);
|
||||
if (target.size() == 0) {
|
||||
versions = new Vector<>();
|
||||
Current.getRoot().getSelectedVersions(versions);
|
||||
if (versions.size() == 0) {
|
||||
Log.Writeln_("Не отмечено ни одной версии.");
|
||||
return false;
|
||||
}
|
||||
if (Current.getProject().hasSubdirectories()) {
|
||||
Log.Writeln_("Запрещено добавлять тестовые проекты, содержащие подпапки!");
|
||||
for (db_project_info version : versions)
|
||||
files.add(version.Home);
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (!Current.getAccount().CheckRegistered(Log))
|
||||
return false;
|
||||
}
|
||||
String cp_info = "";
|
||||
if (Current.HasProject()) {
|
||||
for (db_project_info version : target) {
|
||||
if (version.Home.getAbsolutePath().equals(Current.getProject().Home.getAbsolutePath())) {
|
||||
cp_info = "Текущий проект будет закрыт.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return UI.Question("В текущую группу " + Utils.Brackets(Current.getGroup().description) +
|
||||
"\nбудет добавлено " + target.size() + " тестов.\n" + cp_info +
|
||||
"\nПродолжить");
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
UI.testingBar.ShowAutoCheckTesting();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
ShowMessage1("Создание тестов");
|
||||
CreateTestFromDirectory createTestFromDirectory = (CreateTestFromDirectory) passes.get(PassCode_2021.CreateTestFromDirectory);
|
||||
PublishTests publishTests = (PublishTests) passes.get(PassCode_2021.PublishTests);
|
||||
for (db_project_info vizTestProject : target) {
|
||||
ShowMessage2(vizTestProject.name);
|
||||
if (createTestFromDirectory.Do(vizTestProject.Home, Current.getGroup())) {
|
||||
tests.add(createTestFromDirectory.target);
|
||||
} else break;
|
||||
}
|
||||
System.out.println("tests created " + tests.size());
|
||||
ShowMessage1("Публикация тестов");
|
||||
publishTests.Do(tests);
|
||||
}
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
passes.get(PassCode_2021.SynchronizeTests).Do();
|
||||
}
|
||||
@Override
|
||||
protected void FocusResult() {
|
||||
UI.getMainWindow().FocusTests();
|
||||
return super.canStart(args);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user