public static ConfigModel createConfigModelWithGroups() { final ConfigModel configModel = createConfigModelWithCstic(); final InstanceModel rootInstance = configModel.getRootInstance(); rootInstance.getCstics().add(createCheckBoxListCsticWithValue2Assigned()); rootInstance.getCstics().add(createCheckBoxCstic()); final List<CsticGroupModel> csticGroups = new ArrayList<>(); final CsticGroupModel group1 = createCsticGroup("GROUP1", "Group 1", STR_NAME, CHBOX_NAME); final CsticGroupModel group2 = createCsticGroup("GROUP2", "Group 2", CHBOX_LIST_NAME); csticGroups.add(group1); csticGroups.add(group2); rootInstance.setCsticGroups(csticGroups); return configModel; }
public static ConfigModel createConfigModelWithGroupsAndSubInstances() { final ConfigModel model = createConfigModelWithGroups(); final ArrayList<InstanceModel> subInstancesLevel1 = new ArrayList<InstanceModel>(); final InstanceModel subInstance1Level1 = createSubInstance("SUBINSTANCE1LEVEL1"); subInstancesLevel1.add(subInstance1Level1); final List<CsticGroupModel> csticGroups = new ArrayList<>(); final CsticGroupModel group1 = createCsticGroup("GROUP1INST1", "Group 1", STR_NAME, CHBOX_NAME); final CsticGroupModel group2 = createCsticGroup("GROUP2INST1", "Group 2", CHBOX_LIST_NAME); csticGroups.add(group1); csticGroups.add(group2); subInstance1Level1.setCsticGroups(csticGroups); List<CsticModel> cstics = new ArrayList<CsticModel>(); cstics.add(createSTRCstic()); cstics.add(createCheckBoxCstic()); cstics.add(createCheckBoxListCsticWithValue2Assigned()); subInstance1Level1.setCstics(cstics); final ArrayList<InstanceModel> subInstancesLevel2 = new ArrayList<InstanceModel>(); final InstanceModel subInstance1Level2 = createSubInstance("SUBINSTANCE1LEVEL2"); cstics = new ArrayList<CsticModel>(); cstics.add(createSTRCstic()); cstics.add(createCheckBoxCstic()); cstics.add(createCheckBoxListCsticWithValue2Assigned()); subInstance1Level2.setCstics(cstics); subInstancesLevel2.add(subInstance1Level2); subInstancesLevel2.add(createSubInstance("SUBINSTANCE2LEVEL2")); subInstance1Level1.setSubInstances(subInstancesLevel2); final ArrayList<InstanceModel> subInstancesLevel3 = new ArrayList<InstanceModel>(); subInstancesLevel3.add(createSubInstance("SUBINSTANCE1LEVEL3")); subInstance1Level2.setSubInstances(subInstancesLevel3); subInstancesLevel1.add(createSubInstance("SUBINSTANCE2LEVEL1")); model.getRootInstance().setSubInstances(subInstancesLevel1); return model; }