no message
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user