каскадное удаление информации о тестах вконфигурации при удалении теста
This commit is contained in:
@@ -11,6 +11,7 @@ import _VisualDVM.TestingSystem.Common.Group.Json.GroupsJson;
|
||||
import _VisualDVM.TestingSystem.Common.Settings.Json.SettingsArrayJson;
|
||||
import _VisualDVM.TestingSystem.Common.Settings.Json.SettingsJson;
|
||||
import _VisualDVM.TestingSystem.Common.Settings.Settings;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Json.TestJson;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Json.TestsJson;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
@@ -141,6 +142,22 @@ public class Configuration extends riDBObject {
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
public boolean tryDeleteTest(Test test) {
|
||||
boolean flag = false;
|
||||
ConfigurationCache unpacked = new ConfigurationCache(this);
|
||||
List<TestJson> actualTests = new Vector<>();
|
||||
for (TestJson testJson : unpacked.testsJson.array) {
|
||||
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 void updateTest(Test test){
|
||||
ConfigurationCache unpacked = new ConfigurationCache(this);
|
||||
|
||||
Reference in New Issue
Block a user