static VmTemplate setUpEntityExpectations(VmTemplate entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getClusterId()).thenReturn(GUIDS[2]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]); when(entity.getNumOfCpus()).thenReturn(8); when(entity.getNumOfSockets()).thenReturn(2); when(entity.getThreadsPerCpu()).thenReturn(1); when(entity.getCpuPerSocket()).thenReturn(4); if(index == 2) { when(entity.getTemplateVersionName()).thenReturn(VERSION_NAME); when(entity.getTemplateVersionNumber()).thenReturn(2); when(entity.getBaseTemplateId()).thenReturn(GUIDS[1]); when(entity.isBaseTemplate()).thenReturn(false); } else { when(entity.getTemplateVersionNumber()).thenReturn(1); // same base template id as the template itself when(entity.getBaseTemplateId()).thenReturn(GUIDS[index]); when(entity.isBaseTemplate()).thenReturn(true); } when(entity.getSmallIconId()).thenReturn(GUIDS[2]); when(entity.getLargeIconId()).thenReturn(GUIDS[3]); return entity; }
final String iconForParameters = IconCache.getInstance().getIcon(selectedItem.getLargeIconId()).equals( model.getIcon().getEntity().getIcon()) ? null
staticVm.setConsoleDisconnectAction(entity.getConsoleDisconnectAction()); staticVm.setSmallIconId(entity.getSmallIconId()); staticVm.setLargeIconId(entity.getLargeIconId()); staticVm.setQuotaId(entity.getQuotaId()); staticVm.setBootMenuEnabled(entity.isBootMenuEnabled());
obj.setCustomProperties(instance.getCustomProperties()); obj.setSmallIconId(instance.getSmallIconId()); obj.setLargeIconId(instance.getLargeIconId()); obj.setLeaseStorageDomainId(instance.getLeaseStorageDomainId()); obj.setMultiQueuesEnabled(instance.isMultiQueuesEnabled());