auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; initializeInterfaceValidation ( DiskInterface.VirtIO ) ; disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( ) ; validator = new org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidator ( disk , dve ) ; }

Target:
public void setUp ( ) { injectorRule.bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; initializeInterfaceValidation ( DiskInterface.VirtIO ) ; disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( ) ; validator = new org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidator ( disk , dve ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.StorageDomainStatic CloneStorageDomainStatic ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic instance ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic obj = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; obj.setConnection ( instance.getConnection ( ) ) ; obj.setId ( instance.getId ( ) ) ; obj.setstorage ( instance.getstorage ( ) ) ; obj.setstorage_domain_type ( instance.getstorage_domain_type ( ) ) ; obj.setstorage_type ( instance.getstorage_type ( ) ) ; obj.setstorage_name ( instance.getstorage_name ( ) ) ; obj.setStorageFormat ( instance.getStorageFormat ( ) ) ; return obj ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StorageDomainStatic CloneStorageDomainStatic ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic instance ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic obj = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; obj.setConnection ( instance.getConnection ( ) ) ; obj.setId ( instance.getId ( ) ) ; obj.setStorage ( instance.getStorage ( ) ) ; obj.setStorageDomainType ( instance.getStorageDomainType ( ) ) ; obj.setStorageType ( instance.getStorageType ( ) ) ; obj.setStorageName ( instance.getStorageName ( ) ) ; obj.setStorageFormat ( instance.getStorageFormat ( ) ) ; return obj ; }
Source:
public void testGetStorageDomainWithCorrectStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getStorageDomains ( FixturesTool.STORAGE_POOL_NFS_INACTIVE_ISO , StorageDomainType.ISO , StorageDomainStatus.Inactive ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = result.get ( 0 ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOMAIN_NFS_INACTIVE_ISO , domain.getId ( ) ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 0 , domain.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 0 , domain.getActualImagesSize ( ) ) ; }

Target:
public void testGetStorageDomainWithCorrectStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getStorageDomains ( FixturesTool.STORAGE_POOL_NFS_INACTIVE_ISO , StorageDomainType.ISO , StorageDomainStatus.Inactive ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = result.get ( 0 ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.STORAGE_DOMAIN_NFS_INACTIVE_ISO , domain.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , domain.getCommittedDiskSize ( ) , "Wrong committed disk size" ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , domain.getActualImagesSize ( ) , "Wrong actual disk size" ) ; }
Source:
private void postInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }

Target:
private void postInitTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > rootTemplates = filterNotBaseTemplates ( templates ) ; org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = getModel ( ) . getBaseTemplate ( ) . getSelectedItem ( ) ; getModel ( ) . getBaseTemplate ( ) . setItems ( rootTemplates ) ; getModel ( ) . getBaseTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( rootTemplates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }
Source:
public boolean ShouldEndAction ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.EntityAsyncTask > CurrentActionTypeTasks = GetCurrentActionTypeTasks ( ) ; for ( org.ovirt.engine.core.bll.EntityAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getState ( ) ) != ( AsyncTaskState.Ended ) ) { return false ; } } } return true ; }

Target:
public boolean ShouldEndAction ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.EntityAsyncTask > CurrentActionTypeTasks = GetCurrentActionTypeTasks ( ) ; for ( org.ovirt.engine.core.bll.EntityAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getState ( ) ) != ( AsyncTaskState.Ended ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "Task ID: '{0}' is in state {1}. End action for entity {2} will proceed when all the entity's tasks are completed." , task.getTaskID ( ) , task.getState ( ) , getContainerId ( ) ) ; return false ; } } } return true ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc sendHcCmdToDesktop ( java.lang.String vmId , java.lang.String hcCommand ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.sendHcCmdToDesktop ( vmId , hcCommand ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterHooksListReturnForXmlRpc glusterHooksList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHooksList ( ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterHooksListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterHooksListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return i ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return i ; }
Source:
private static void assertCorrectSnapshots ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.storage.disk.GetAllDisksByVmIdQueryTest.NUM_DISKS_OF_EACH_KIND ) ; ++ i ) { org.junit.Assert.assertEquals ( ( ( "Wrong snapshot " + i ) + " for disk " ) , disk.getId ( ) , disk.getSnapshots ( ) . get ( i ) . getId ( ) ) ; } }

Target:
private static void assertCorrectSnapshots ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.storage.disk.GetAllDisksByVmIdQueryTest.NUM_DISKS_OF_EACH_KIND ) ; ++ i ) { org.junit.jupiter.api.Assertions.assertEquals ( disk.getId ( ) , disk.getSnapshots ( ) . get ( i ) . getId ( ) , ( ( "Wrong snapshot " + i ) + " for disk " ) ) ; } }
Source:
private void deleteVolumeFromCinder ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk lastCinderVolume ) { try { org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getCinderBroker ( ) . deleteVolumeByClassificationType ( lastCinderVolume ) ; } catch ( java.lang.Exception e ) { if ( ! ( org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . isFaultTolerant ( ) ) ) { throw e ; } else { org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.log.error ( "Failed to remove volume from Cinder provider. continue to delete the disk." ) ; } } }

Target:
protected boolean removeCinderVolume ( int removedVolumeIndex ) { org.ovirt.engine.core.common.action.RemoveCinderDiskVolumeParameters param = org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . getChildCommandsParameters ( ) . get ( removedVolumeIndex ) ; try { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = getFutureRemoveCinderDiskVolume ( removedVolumeIndex ) . get ( ) ; if ( ( vdcReturnValueBase == null ) || ( ! ( vdcReturnValueBase.getSucceeded ( ) ) ) ) { handleExecutionFailure ( param.getRemovedVolume ( ) , vdcReturnValueBase ) ; return false ; } } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { e.printStackTrace ( ) ; return false ; } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage_domains getExistingStorageDomain ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage_server_connections cnx ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > existing = asCollection ( org.ovirt.engine.core.common.businessentities.storage_domains.class , getEntity ( java.util.ArrayList.class , VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , cnx.getconnection ( ) ) , ( "Existing storage domains: path=" + ( cnx.getconnection ( ) ) ) ) ) ; return ( existing.size ( ) ) != 0 ? existing.get ( 0 ) : null ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage_domains getExistingStorageDomain ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageServerConnections cnx ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > existing = asCollection ( org.ovirt.engine.core.common.businessentities.storage_domains.class , getEntity ( java.util.ArrayList.class , VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , cnx.getconnection ( ) ) , ( "Existing storage domains: path=" + ( cnx.getconnection ( ) ) ) ) ) ; return ( existing.size ( ) ) != 0 ? existing.get ( 0 ) : null ; }
Source:
public void put ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid parentCommandId , org.ovirt.engine.core.bll.tasks.SPMAsyncTask task ) { commandMap.put ( stepId , buildGetCommandEntity ( commandId , parentCommandId , task ) ) ; }

Target:
private void initializeCache ( ) { if ( ! ( cacheInitialized ) ) { synchronized ( LOCK ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = cmdEntityDao.getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity : cmdEntities ) { commandMap.put ( cmdEntity.getId ( ) , cmdEntity ) ; } cacheInitialized = true ; } } }
Source:
public void testList ( ) { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( QueryType.GetVdsHooksById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; org.junit.Assert.assertNotNull ( hooks.getHooks ( ) ) ; org.junit.Assert.assertEquals ( 4 , hooks.getHooks ( ) . size ( ) ) ; }

Target:
public void testList ( ) { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( QueryType.GetVdsHooksById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( hooks.getHooks ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 4 , hooks.getHooks ( ) . size ( ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.Cancel ( ) ; } }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; } }
Source:
public javax.ws.rs.core.Response setOption ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.api.model.Option option = action.getOption ( ) ; validateParameters ( option , "name" , "value" ) ; return doAction ( VdcActionType.SetGlusterVolumeOption , new org.ovirt.engine.core.common.action.gluster.GlusterVolumeOptionParameters ( new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity ( guid , option.getName ( ) , option.getValue ( ) ) ) , action ) ; }

Target:
public javax.ws.rs.core.Response setOption ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.api.model.Option option = action.getOption ( ) ; validateParameters ( option , "name" , "value" ) ; return doAction ( ActionType.SetGlusterVolumeOption , new org.ovirt.engine.core.common.action.gluster.GlusterVolumeOptionParameters ( new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity ( guid , option.getName ( ) , option.getValue ( ) ) ) , action ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.MigrationSupport getMigrationSupport ( ) { org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport = org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getMigrationSupport ( ) ; if ( migrationSupport != null ) { return migrationSupport ; } return org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getMigrationSupport ( ) ; }

Target:
protected final void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmId ( ) ) != null ) { setVmId ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmId ( ) ) ; } else { setVm ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVm ( ) ) ; } if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) ) != null ) { setVmNumaNodesForValidation ( getVmNumaNodeDao ( ) . getAllVmNumaNodeByVmId ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getId ( ) ) ) ; doInit ( ) ; } }
Source:
protected int tryParseWithDefault ( java.lang.String candidate , int defaultValue ) { if ( candidate != null ) { try { return java.lang.Integer.parseInt ( candidate ) ; } catch ( java.lang.Exception e ) { } } return defaultValue ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondarySources ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) ? java.lang.Long.valueOf ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) : 0L ; return getOverUtilizedMemoryHosts ( candidateHosts , requiredMemory ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc glusterVolumeGeoRepStatusDetail ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response = vdsServer.glusterVolumeGeoRepStatusDetail ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepSessionList ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.exportimport.ImportVmTemplateFromConfigurationCommand.getParameters ( ) . isImagesExistOnTargetStorageDomain ( ) ) { if ( ! ( getImages ( ) . isEmpty ( ) ) ) { findAndSaveDiskCopies ( ) ; } unregisteredOVFDataDao.removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; unregisteredDisksDao.removeUnregisteredDiskRelatedToVM ( ovfEntityData.getEntityId ( ) , null ) ; } setActionReturnValue ( org.ovirt.engine.core.bll.exportimport.ImportVmTemplateFromConfigurationCommand.getVmTemplate ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.exportimport.ImportVmTemplateFromConfigurationCommand.setSucceeded ( true ) ; }

Target:
public void executeCommand ( ) { addAuditLogForPartialVMs ( ) ; super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.exportimport.ImportVmTemplateFromConfigurationCommand.getParameters ( ) . isImagesExistOnTargetStorageDomain ( ) ) { if ( ! ( getImages ( ) . isEmpty ( ) ) ) { findAndSaveDiskCopies ( ) ; } unregisteredOVFDataDao.removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; unregisteredDisksDao.removeUnregisteredDiskRelatedToVM ( ovfEntityData.getEntityId ( ) , null ) ; } setActionReturnValue ( org.ovirt.engine.core.bll.exportimport.ImportVmTemplateFromConfigurationCommand.getVmTemplate ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.exportimport.ImportVmTemplateFromConfigurationCommand.setSucceeded ( true ) ; }
Source:
private void VdsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void vdsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }
Source:
private boolean validateManagementNetwork ( ) { if ( ( getManagementNetworkId ( ) ) == null ) { return findDefaultManagementNetwork ( ) ; } else { return validateInputManagementNetwork ( ) ; } }

Target:
protected boolean validateInputManagementNetwork ( ) { if ( ! ( org.ovirt.engine.core.bll.AddClusterCommand.findInputManagementNetwork ( ) ) ) { return false ; } final org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.networkBelongsToClusterDataCenter ( org.ovirt.engine.core.bll.AddClusterCommand.getCluster ( ) , managementNetwork ) ) ) && ( validate ( networkClusterValidator.managementNetworkRequired ( managementNetwork ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkNotExternal ( managementNetwork ) ) ) ; }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getAllocationColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.EnumColumn < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.VolumeType > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.VolumeType getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getVolumeType ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getAllocationColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.VolumeType > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.VolumeType getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getVolumeType ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getUpdate ( false ) ) ; assertNotNull ( nic ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 3 ) ; setGetVmQueryExpectations ( 2 ) ; setGetNetworksQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( false ) ) ; assertNotNull ( nic ) ; }
Source:
public static void GetStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void executeCommandFailedWhenServerIdPresent ( ) { setUpMocksForUpdate ( ) ; mockForReadContent ( false , EngineError.GlusterHookNotFound ) ; try { cmd.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.junit.Assert.assertEquals ( EngineError.GlusterHookNotFound , e.getErrorCode ( ) ) ; } org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void executeCommandFailedWhenServerIdPresent ( ) { setUpMocksForUpdate ( ) ; mockForReadContent ( false , EngineError.GlusterHookNotFound ) ; try { cmd.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.junit.jupiter.api.Assertions.assertEquals ( EngineError.GlusterHookNotFound , e.getErrorCode ( ) ) ; } org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
private static void assertCorrectGetAllResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDAOTest.VM_COUNT , result.size ( ) ) ; }

Target:
private static void assertCorrectGetAllResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDAOTest.VM_COUNT , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : result ) { org.junit.Assert.assertEquals ( "Vm db generation wasn't loaded as expected" , 1 , vm.getDbGeneration ( ) ) ; } }
Source:
protected void extractBondIfModified ( java.util.Set < java.lang.String > bonds , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String name ) { if ( bonds.contains ( name ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { bonds.add ( name ) ; if ( interfaceWasModified ( iface ) ) { modifiedBonds.put ( name , iface ) ; } } }

Target:
private boolean addInterfaceToProcessedList ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { if ( ifaceNames.contains ( iface.getName ( ) ) ) { if ( isBond ( iface ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { violations.add ( VdcBllMessages.NETWORK_INTERFACE_NAME_ALREADY_IN_USE ) ; } return false ; } ifaceNames.add ( iface.getName ( ) ) ; return true ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { try { model.getAutoConnectableConsoles ( ) . get ( 0 ) . connect ( ) ; alreadyOpened = true ; } catch ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles e ) { errorPopupManager.show ( e.getLocalizedErrorMessage ( ) ) ; } } unregisterModels ( ) ; }

Target:
private void connect ( boolean isPasswordDelegationPossible ) { if ( isPasswordDelegationPossible ) { try { model.getAutoConnectableConsoles ( ) . get ( 0 ) . connect ( ) ; alreadyOpened = true ; } catch ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles e ) { errorPopupManager.show ( e.getLocalizedErrorMessage ( ) ) ; } } unregisterModels ( ) ; }
Source:
public void Template_SelectedItemChanged ( ) { super . Template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; if ( template == null ) { return ; } setupWindowModelFrom ( template ) ; updateHostPinning ( template.getMigrationSupport ( ) ) ; doChangeDefautlHost ( template.getDedicatedVmForVds ( ) ) ; }

Target:
public void template_SelectedItemChanged ( ) { super . template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; if ( template == null ) { return ; } setupWindowModelFrom ( template , template.getStoragePoolId ( ) . getValue ( ) ) ; updateHostPinning ( template.getMigrationSupport ( ) ) ; doChangeDefautlHost ( template.getDedicatedVmForVds ( ) ) ; }
Source:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private java.lang.String ParseRangePart ( java.lang.String start ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( java.lang.String part : start.split ( "[:]" , ( - 1 ) ) ) { java.lang.String tempPart = part.trim ( ) ; if ( ( tempPart.length ( ) ) == 1 ) { builder.append ( '0' ) ; } else if ( ( tempPart.length ( ) ) > 2 ) { return null ; } builder.append ( tempPart ) ; } return builder.toString ( ) ; }

Target:
private java.lang.String parseRangePart ( java.lang.String start ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( java.lang.String part : start.split ( "[:]" , ( - 1 ) ) ) { java.lang.String tempPart = part.trim ( ) ; if ( ( tempPart.length ( ) ) == 1 ) { builder.append ( '0' ) ; } else if ( ( tempPart.length ( ) ) > 2 ) { return null ; } builder.append ( tempPart ) ; } return builder.toString ( ) ; }
Source:
private void mockGetVmsListForDisk ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; org.ovirt.engine.core.common.businessentities.VM vm1 = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm1.setstatus ( VMStatus.PoweredDown ) ; org.ovirt.engine.core.common.businessentities.VM vm2 = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm2.setstatus ( VMStatus.Down ) ; vmList.add ( vm1 ) ; vmList.add ( vm2 ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vmList ) ; }

Target:
private void mockGetVmsListForDisk ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; org.ovirt.engine.core.common.businessentities.VM vm1 = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm1.setStatus ( VMStatus.PoweredDown ) ; org.ovirt.engine.core.common.businessentities.VM vm2 = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm2.setStatus ( VMStatus.Down ) ; vmList.add ( vm1 ) ; vmList.add ( vm2 ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vmList ) ; }
Source:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }

Target:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.vds_spm_id_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.vds_spm_id_map entity = new org.ovirt.engine.core.common.businessentities.vds_spm_id_map ( ) ; entity.setstorage_pool_id ( getGuidDefaultEmpty ( rs , "storage_pool_id" ) ) ; entity.setId ( getGuidDefaultEmpty ( rs , "vds_id" ) ) ; entity.setvds_spm_id ( rs.getInt ( "vds_spm_id" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.VdsSpmIdMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VdsSpmIdMap entity = new org.ovirt.engine.core.common.businessentities.VdsSpmIdMap ( ) ; entity.setStoragePoolId ( getGuidDefaultEmpty ( rs , "storage_pool_id" ) ) ; entity.setId ( getGuidDefaultEmpty ( rs , "vds_id" ) ) ; entity.setVdsSpmId ( rs.getInt ( "vds_spm_id" ) ) ; return entity ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.safehtml.shared.SafeHtml value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { java.lang.String rawData = ( value != null ) ? value.asString ( ) : "" ; sb.append ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.template.textContainer ( getContainerElementId ( context ) , getRenderedValue ( rawData ) ) ) ; }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.safehtml.shared.SafeHtml value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { java.lang.String rawData = ( value != null ) ? value.asString ( ) : "" ; sb.append ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.template.textContainer ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) , getRenderedValue ( rawData ) ) ) ; }
Source:
public void testValidateNotRemovingUsedNetworkByVmsSingleNetworkSingleVm ( ) { final java.util.List < java.lang.String > vmsNames = java.util.Arrays.asList ( org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidatorTest.VM_A ) ; final java.util.List < java.lang.String > removedNetworks = java.util.Arrays.asList ( org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidatorTest.NETWORK_A ) ; underTest = new org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator ( vmsNames , removedNetworks ) ; org.junit.Assert.assertThat ( underTest.validate ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_SINGLE_VM , org.ovirt.engine.core.utils.linq.LinqUtils.concat ( org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( DetachNetworkUsedByVmValidator.VAR_VM_NAME , vmsNames ) , org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( DetachNetworkUsedByVmValidator.VAR_NETWORK_NAME , removedNetworks ) ) ) ) ; }

Target:
public void testValidateNotRemovingUsedNetworkByVmsSingleNetworkSingleVm ( ) { final java.util.List < java.lang.String > vmsNames = java.util.Arrays.asList ( org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidatorTest.VM_A ) ; final java.util.List < java.lang.String > removedNetworks = java.util.Arrays.asList ( org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidatorTest.NETWORK_A ) ; underTest = new org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator ( vmsNames , removedNetworks ) ; org.junit.Assert.assertThat ( underTest.validate ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.SINGLE_NETWORK_CANNOT_DETACH_NETWORK_USED_BY_SINGLE_VM , org.ovirt.engine.core.utils.linq.LinqUtils.concat ( org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( DetachNetworkUsedByVmValidator.VAR_VM_NAME , vmsNames ) , org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( DetachNetworkUsedByVmValidator.VAR_NETWORK_NAME , removedNetworks ) ) ) ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { if ( value == null ) { super . setItems ( null ) ; return ; } java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > Cast ( value ) ; super . setItems ( disks ) ; }

Target:
public void setItems ( java.lang.Iterable value ) { if ( value == null ) { super . setItems ( null ) ; return ; } java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > cast ( value ) ; super . setItems ( disks ) ; }
Source:
protected boolean checkCpuSockets ( ) { return org.ovirt.engine.core.bll.AddVmCommand.checkCpuSockets ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfSockets ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getCpuPerSocket ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) . toString ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean checkCpuSockets ( ) { return org.ovirt.engine.core.bll.AddVmCommand.checkCpuSockets ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfSockets ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getCpuPerSocket ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getThreadsPerCpu ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) . toString ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getValidationMessages ( ) ) ; }
Source:
private void setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.core.compat.Guid id , int times ) { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetStoragePoolsByStorageDomainId , org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { id } , org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplatesResourceTest.setUpStoragePool ( ) ) ; } }

Target:
private void setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.core.compat.Guid id , int times ) { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetStoragePoolsByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { id } , org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplatesResourceTest.setUpStoragePool ( ) ) ; } }