удаление инфы о тестах при удалении группы из конфиги
This commit is contained in:
@@ -17,6 +17,7 @@ import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class Configuration extends riDBObject {
|
||||
@@ -115,7 +116,6 @@ public class Configuration extends riDBObject {
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public boolean tryUpdateSettings(Settings settings) {
|
||||
ConfigurationCache unpacked = new ConfigurationCache(this);
|
||||
for (SettingsJson settingsJson : unpacked.settingsJson.array) {
|
||||
@@ -147,7 +147,23 @@ public class Configuration extends riDBObject {
|
||||
ConfigurationCache unpacked = new ConfigurationCache(this);
|
||||
List<TestJson> actualTests = new Vector<>();
|
||||
for (TestJson testJson : unpacked.testsJson.array) {
|
||||
if (testJson.id == test.id)
|
||||
if (testJson.id==test.id)
|
||||
flag = true;
|
||||
else actualTests.add(testJson);
|
||||
}
|
||||
if (flag) {
|
||||
unpacked.testsJson.array = actualTests;
|
||||
packedTestsJson = Utils_.gson.toJson(unpacked.testsJson);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public boolean tryDeleteTests(LinkedHashMap<Integer, Test> tests) {
|
||||
boolean flag = false;
|
||||
ConfigurationCache unpacked = new ConfigurationCache(this);
|
||||
List<TestJson> actualTests = new Vector<>();
|
||||
for (TestJson testJson : unpacked.testsJson.array) {
|
||||
if (tests.containsKey(testJson.id))
|
||||
flag = true;
|
||||
else actualTests.add(testJson);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user