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; }
@Mapping(from = VmTemplate.class, to = Display.class) public static Display map(VmTemplate vmTemplate, Display display) { Display result = (display == null) ? new Display() : display; result.setMonitors(vmTemplate.getNumOfMonitors()); result.setSingleQxlPci(vmTemplate.getSingleQxlPci()); result.setAllowOverride(vmTemplate.isAllowConsoleReconnect()); result.setSmartcardEnabled(vmTemplate.isSmartcardEnabled()); result.setKeyboardLayout(vmTemplate.getVncKeyboardLayout()); result.setFileTransferEnabled(vmTemplate.isSpiceFileTransferEnabled()); result.setCopyPasteEnabled(vmTemplate.isSpiceCopyPasteEnabled()); return result; }
setIsHighlyAvailable(template.isAutoStartup()); setPriority(AsyncDataProvider.getInstance().priorityToString(template.getPriority())); setMonitorCount(template.getNumOfMonitors()); setAllowConsoleReconnect(template.isAllowConsoleReconnect()); setCpuInfo(ConstantsManager.getInstance().getMessages().cpuInfoLabel(
obj.setName(instance.getName()); obj.setNiceLevel(instance.getNiceLevel()); obj.setNumOfMonitors(instance.getNumOfMonitors()); obj.setAllowConsoleReconnect(instance.isAllowConsoleReconnect()); obj.setNumOfSockets(instance.getNumOfSockets());