package _VisualDVM.TestingSystem.SAPFOR.Json;
import Common.CommonConstants;
import _VisualDVM.ServerObjectsCache.SapforConfigurationCache;
import _VisualDVM.ServerObjectsCache.VisualCaches;
import _VisualDVM.TestingSystem.Common.Test.Test;
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import com.google.gson.annotations.Expose;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Vector;
public class SapforTestingSet_json implements Serializable {
    @Expose
    public int id = CommonConstants.Nan;
    @Expose
    public List<SapforTest_json> tests = new Vector<>();
    @Expose
    public List<SapforConfiguration_json> configurations = new Vector<>();
    public SapforTestingSet_json(){}
    public SapforTestingSet_json(LinkedHashMap<String, Test> testsByDescriptions, Vector<SapforConfiguration> sapforConfigurations) {
        for (Test test : testsByDescriptions.values())
            tests.add(new SapforTest_json(test));
        for (SapforConfiguration configuration : sapforConfigurations) {
            for (SapforSettings sapforSettings : ((SapforConfigurationCache) VisualCaches.GetCache(configuration)).getSettings())
                configurations.add(new SapforConfiguration_json(sapforSettings));
        }
    }
}
