no message

This commit is contained in:
2024-09-23 21:16:52 +03:00
parent a420ddbc9d
commit 39dbf5f146
3 changed files with 9 additions and 53 deletions

View File

@@ -95,11 +95,10 @@ public class SapforConfiguration extends Configuration {
" запрещено применять более одного раза!");
} else matches.add(code);
}
//2. Проверка входящих групп и тестов на корректность
//2. Проверка входящих групп на единственный язык фортран
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(this);
//--
Vector<Group> groups = cache.getGroups();
Vector<Test> tests = cache.getTests();
Vector<LanguageName> groupsLanguages = new Vector<>();
//-
for (Group group : groups) {

View File

@@ -26,12 +26,9 @@ import java.util.LinkedHashMap;
import java.util.Vector;
public class StartSelectedSAPFORConfigurations extends PublishServerObject<TestingServer, SapforPackage> {
Vector<SapforConfiguration> configurations;
Vector<Group> groups;
Vector<Test> tests;
SapforTestingSet_json testingSet; //то, что добавляем.
//--
protected LinkedHashMap<String, Test> testsByDescriptions = null;
protected Vector<String> testsNames_lower = null; //все тесты что участвуют здесь
protected File sapfor = null;
//--
protected Vector<SapforTask> new_tasks = null;
@@ -40,39 +37,12 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
return "/icons/Start.png";
}
//--
protected boolean checkTestName(Test test) {
String name = test.description.toLowerCase();
if (testsNames_lower.contains(name)) {
Log.Writeln_("В пакет не могут входить тесты с одинаковыми именами (без учета регистра):" + test.description.toLowerCase());
return false;
}
testsNames_lower.add(name);
return true;
}
protected boolean checkTestsDescriptions(int groupId, Vector<Test> groupTests) {
if (groupTests.isEmpty()) {
Log.Writeln_("Пустая группа тестов: " + groupId);
return false;
}
for (Test test : groupTests) {
if (!checkTestName(test))
return false;
else
testsByDescriptions.put(test.description, test);
}
return true;
}
//--
public StartSelectedSAPFORConfigurations() {
super(Global.testingServer, SapforPackage.class);
}
@Override
protected boolean canStart(Object... args) throws Exception {
//--
groups = new Vector<>();
tests = new Vector<>();
//--
testsNames_lower = new Vector<>();
testsByDescriptions = new LinkedHashMap<>();
//--
new_tasks= new Vector<>();
@@ -101,19 +71,15 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
//-
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(configuration);
//--
groups = cache.getGroups();
tests = cache.getTests();
//--
for (Group group : groups) {
Vector<Test> groupTests = new Vector<>();
for (Test test : tests) {
if (test.group_id == group.id)
groupTests.add(test);
}
//---
if (!checkTestsDescriptions(group.id,groupTests))
Vector<Test>tests= cache.getTests();
for (Test test:tests){
String l_description = test.description.toLowerCase();
if (testsByDescriptions.containsKey(l_description)) {
Log.Writeln_("В пакет не могут входить тесты с одинаковыми именами (без учета регистра):" + test.description.toLowerCase());
return false;
//-
}else {
testsByDescriptions.put(l_description, test);
}
}
}
target = new SapforPackage(Current.getAccount(), Current.getServerSapfor(), max_kernels);