public VmTemplate() { setNiceLevel(0); setCpuShares(0); diskTemplateMap = new HashMap<>(); status = VmTemplateStatus.OK; diskImageMap = new HashMap<>(); templateType = VmEntityType.TEMPLATE; baseTemplateId = Guid.Empty; setTemplateVersionNumber(BASE_VERSION_NUMBER); setDescription(this.getDescription()); }
static org.ovirt.engine.core.common.businessentities.InstanceType setUpEntityExpectations(VmTemplate entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); 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); when(entity.isBaseTemplate()).thenReturn(true); return entity; }
protected org.ovirt.engine.core.common.businessentities.VmTemplate getTemplateEntity() { VmTemplate entity = mock(VmTemplate.class); when(entity.getId()).thenReturn(GUIDS[1]); when(entity.getClusterId()).thenReturn(GUIDS[2]); when(entity.getName()).thenReturn(NAMES[1]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[1]); when(entity.getNumOfCpus()).thenReturn(8); when(entity.getNumOfSockets()).thenReturn(2); when(entity.getDefaultDisplayType()).thenReturn(DisplayType.vga); when(entity.getNumOfMonitors()).thenReturn(2); when(entity.getVmType()).thenReturn(VmType.Server); return entity; }
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; }
public VmTemplate(VmTemplate template) { super(template); diskTemplateMap = new HashMap<>(); diskImageMap = new HashMap<>(); setChildCount(template.getChildCount()); setStatus(template.getStatus()); setTemplateType(template.getTemplateType()); setBaseTemplateId(template.getBaseTemplateId()); setTemplateVersionName(template.getTemplateVersionName()); setTemplateVersionNumber(template.getTemplateVersionNumber()); setDisabled(template.isDisabled()); setDescription(this.getDescription()); }
setTemplateVersionNumber(BASE_VERSION_NUMBER); setTemplateVersionName(templateVersionName); setDescription(this.getDescription());
setDescription(template.getDescription()); setQuotaName(template.getQuotaName() != null ? template.getQuotaName() : ""); //$NON-NLS-1$ setQuotaAvailable(template.getQuotaEnforcementType() != null