no message
This commit is contained in:
@@ -12,14 +12,20 @@ import TestingSystem.Common.Test.Test;
|
||||
import java.util.Vector;
|
||||
public class ConfigurationCache extends VisualCache{
|
||||
public GroupsJson groupsJson = null;
|
||||
public Vector<String> groupsDescriptions = null;
|
||||
public String groupsDescriptions = null;
|
||||
public TestsJson testsJson = null;
|
||||
//--
|
||||
public ConfigurationCache(Configuration configuration) {
|
||||
if (configuration.packedGroupsJson.isEmpty())
|
||||
// System.out.println("configuration cache new instance for "+configuration.id);
|
||||
// System.out.println("packageGroupsJson="+Utils.Brackets(configuration.packedGroupsJson));
|
||||
if (configuration.packedGroupsJson.isEmpty()) {
|
||||
// System.out.println("empty");
|
||||
groupsJson = new GroupsJson(); //просто пустой
|
||||
else
|
||||
}
|
||||
else {
|
||||
// System.out.println("not empty");
|
||||
groupsJson = Utils.gson.fromJson(configuration.packedGroupsJson, GroupsJson.class);
|
||||
}
|
||||
//--
|
||||
if (testsJson == null) {
|
||||
if (configuration.packedTestsJson.isEmpty())
|
||||
@@ -28,14 +34,15 @@ public class ConfigurationCache extends VisualCache{
|
||||
testsJson = Utils.gson.fromJson(configuration.packedTestsJson, TestsJson.class);
|
||||
}
|
||||
//-
|
||||
groupsDescriptions = new Vector<>();
|
||||
Vector<String> groupsDescriptionsVector = new Vector<>();
|
||||
for (GroupJson groupJson : groupsJson.array)
|
||||
groupsDescriptions.add(groupJson.description);
|
||||
groupsDescriptionsVector.add(groupJson.description);
|
||||
groupsDescriptions= String.join(";", groupsDescriptionsVector);
|
||||
}
|
||||
public int getTestsCount() {
|
||||
return testsJson.array.size();
|
||||
}
|
||||
public Vector<String> getGroupsDescriptions() {
|
||||
public String getGroupsDescriptions() {
|
||||
return groupsDescriptions;
|
||||
}
|
||||
public Vector<Group> getGroups(){
|
||||
|
||||
@@ -26,22 +26,23 @@ public class VisualCaches {
|
||||
return new VisualCache();
|
||||
}
|
||||
public static VisualCache GetCache(DBObject object) {
|
||||
// System.out.println("get visual cache for " + object.getPK()+" "+object.getClass());
|
||||
// System.out.println("get visual cache for " + object.getPK()+" "+object.getClass());
|
||||
VisualCache res = null;
|
||||
LinkedHashMap<Object, VisualCache> data = getDataForClass(object.getClass());
|
||||
if (!data.containsKey(object.getPK())) {
|
||||
// System.out.println("cache not found, creating...");
|
||||
// System.out.println("cache not found, creating...");
|
||||
data.put(object.getPK(), res = createCache(object));
|
||||
} else {
|
||||
// System.out.println("cache found");
|
||||
// System.out.println("cache found");
|
||||
res = data.get(object.getPK());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static void DeleteCahce(DBObject object){
|
||||
DeleteCahce(object.getClass(), object.getPK());
|
||||
public static void DeleteCache(DBObject object){
|
||||
DeleteCache(object.getClass(), object.getPK());
|
||||
}
|
||||
public static void DeleteCahce(Class class_, Object pk){
|
||||
public static void DeleteCache(Class class_, Object pk){
|
||||
// System.out.println("Delete for " + pk+" "+class_);
|
||||
LinkedHashMap<Object, VisualCache> data = getDataForClass(class_);
|
||||
if (data.containsKey(pk))
|
||||
data.remove(pk);
|
||||
|
||||
Reference in New Issue
Block a user