auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testResize ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage oldDisk = createDiskImage ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( parameters.getDiskInfo ( ) ) ) . setSize ( ( ( oldDisk.getSize ( ) ) * 2 ) ) ; initializeCommand ( parameters ) ; org.junit.Assert.assertTrue ( command.validateCanResizeDisk ( ) ) ; }

Target:
public void testResize ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage oldDisk = createDiskImage ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; org.ovirt.engine.core.common.action.VmDiskOperationParameterBase parameters = createParameters ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( parameters.getDiskInfo ( ) ) ) . setSize ( ( ( oldDisk.getSize ( ) ) * 2 ) ) ; initializeCommand ( parameters ) ; org.junit.Assert.assertTrue ( command.validateCanResizeDisk ( ) ) ; }
Source:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) , aQuery ) ; }

Target:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
protected void addStoragePoolToDb ( ) { org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . setStatus ( StoragePoolStatus.Uninitialized ) ; org.ovirt.engine.core.compat.Guid requestedMacPoolId = org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getMacPoolId ( ) ; org.ovirt.engine.core.compat.Guid macPoolIdToUse = ( requestedMacPoolId == null ) ? org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getMacPoolDao ( ) . getDefaultPool ( ) . getId ( ) : requestedMacPoolId ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . setMacPoolId ( macPoolIdToUse ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePoolDAO ( ) . save ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) ) ; }

Target:
private org.ovirt.engine.core.compat.Guid calculateMacPoolIdToUse ( ) { org.ovirt.engine.core.compat.Guid requestedMacPoolId = ( ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) ) == null ) ? null : org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getMacPoolId ( ) ; return requestedMacPoolId == null ? org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getDbFacade ( ) . getMacPoolDao ( ) . getDefaultPool ( ) . getId ( ) : requestedMacPoolId ; }
Source:
public void testAddLunDiskMissingType ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . setType ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostStorage" , "testAddLunDiskMissingType" , "type" ) ; } }

Target:
public void testAddLunDiskMissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "LogicalUnit" , "lambda$testAddLunDiskMissingId$4" , "id" ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc convertVmFromOva ( java.lang.String ovaPath , java.util.Map < java.lang.String , java.lang.Object > vm , java.lang.String jobUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.convertExternalVmFromOva" ) . withParameter ( "ova_path" , ovaPath ) . withParameter ( "vminfo" , vm ) . withParameter ( "jobid" , jobUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn convertVmFromOva ( java.lang.String ovaPath , java.util.Map < java.lang.String , java.lang.Object > vm , java.lang.String jobUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.convertExternalVmFromOva" ) . withParameter ( "ova_path" , ovaPath ) . withParameter ( "vminfo" , vm ) . withParameter ( "jobid" , jobUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class , org.ovirt.engine.ui.userportal.ApplicationDynamicConstants.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class , org.ovirt.engine.ui.userportal.ApplicationDynamicMessages.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void endSuccessfully ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.UpdateVmDiskCommand.getBackend ( ) . endAction ( VdcActionType.ExtendImageSize , createExtendImageSizeParameters ( ) ) ; if ( ret.getSucceeded ( ) ) { performDiskUpdate ( true ) ; } else { unlockImageInDb ( ) ; } org.ovirt.engine.core.bll.UpdateVmDiskCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; setSucceeded ( ret.getSucceeded ( ) ) ; }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.UpdateVmDiskCommand.getBackend ( ) . endAction ( VdcActionType.ExtendImageSize , createExtendImageSizeParameters ( ) , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; if ( ret.getSucceeded ( ) ) { performDiskUpdate ( true ) ; } else { unlockImageInDb ( ) ; } org.ovirt.engine.core.bll.UpdateVmDiskCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; setSucceeded ( ret.getSucceeded ( ) ) ; }
Source:
protected void OnSelectedItemChanged ( ) { super . OnSelectedItemChanged ( ) ; UpdateActionAvailability ( ) ; UpdateConsoleModels ( ) ; }

Target:
protected void SelectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . SelectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { UpdateActionAvailability ( ) ; } else if ( e.PropertyName.equals ( "display_type" ) ) { updateConsoleModels ( ) ; } }
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.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOMAIN_NFS_INACTIVE_ISO , result.get ( 0 ) . getId ( ) ) ; }

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.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 ( ) ) ; }
Source:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.ImagesHandler.addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) ) , vmId ) ; }

Target:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.ImagesHandler.addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) ) , vmId ) ; }
Source:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.StorageServerConnections > aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.Converter < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.StorageServerConnections convert ( java.lang.Object source ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
private boolean isQuotaDependant ( ) { return ( getActionType ( ) . getQuotaDependency ( ) ) != ( VdcActionType.QuotaDependency.NONE ) ; }

Target:
protected boolean isQuotaDependant ( ) { boolean result ; if ( ( getActionType ( ) . getQuotaDependency ( ) ) == ( VdcActionType.QuotaDependency.NONE ) ) result = false ; else if ( ! ( org.ovirt.engine.core.bll.CommandBase.isInternalExecution ( ) ) ) result = true ; else if ( getActionType ( ) . isQuotaDependentAsInternalCommand ( ) ) result = true ; else result = false ; return result ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( VDSGroup.DEFAULT_VDS_GROUP_ID ) ; group.setcpu_name ( "Intel Conroe" ) ; group.setcompatibility_version ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.STORAGE_POOL_ID ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setcpu_name ( "Intel Conroe" ) ; group.setcompatibility_version ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.STORAGE_POOL_ID ) ; return group ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.DbUser getByExternalId ( java.lang.String domain , byte [ ] externalId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "domain" , domain ) . addValue ( "external_id" , externalId ) ; return getCallsHandler ( ) . executeRead ( "GetUserByExternalId" , org.ovirt.engine.core.dao.DbUserDAODbFacadeImpl.DbUserRowMapper.instance , parameterSource ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.DbUser getByExternalId ( java.lang.String domain , org.ovirt.engine.core.common.utils.ExternalId externalId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "domain" , domain ) . addValue ( "external_id" , externalId.getBytes ( ) ) ; return getCallsHandler ( ) . executeRead ( "GetUserByExternalId" , org.ovirt.engine.core.dao.DbUserDAODbFacadeImpl.DbUserRowMapper.instance , parameterSource ) ; }
Source:
public static java.util.Map < org.ovirt.engine.core.common.businessentities.storage.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > filterConnectionsByStorageType ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > storageConnectionsForStorageTypeMap = new java.util.EnumMap ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections lunConnections : lun.getLunConnections ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( lunConnections.getstorage_type ( ) , lunConnections , storageConnectionsForStorageTypeMap ) ; } return storageConnectionsForStorageTypeMap ; }

Target:
public static java.util.Map < org.ovirt.engine.core.common.businessentities.storage.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > filterConnectionsByStorageType ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > storageConnectionsForStorageTypeMap = new java.util.EnumMap ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections lunConnections : lun.getLunConnections ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( lunConnections.getStorageType ( ) , lunConnections , storageConnectionsForStorageTypeMap ) ; } return storageConnectionsForStorageTypeMap ; }
Source:
private void addPermissionForTempalte ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.bll.PredefinedRoles role ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( userId ) ; perms.setObjectType ( VdcObjectType.VmTemplate ) ; perms.setObjectId ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getVmTemplateId ( ) ) ; perms.setrole_id ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
private org.ovirt.engine.core.compat.Guid getQuotaIdForDisk ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { if ( ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getDiskInfoDestinationMap ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getDiskInfoDestinationMap ( ) . get ( diskImage.getId ( ) ) ) != null ) ) { return org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getDiskInfoDestinationMap ( ) . get ( diskImage.getId ( ) ) . getQuotaId ( ) ; } return diskImage.getQuotaId ( ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hookEntity = org.ovirt.engine.core.bll.gluster.GetGlusterHookByIdQuery.getGlusterHookDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GetGlusterHookByIdQuery.getParameters ( ) . getHookId ( ) ) ; if ( ( hookEntity != null ) && ( org.ovirt.engine.core.bll.gluster.GetGlusterHookByIdQuery.getParameters ( ) . isIncludeServerHooks ( ) ) ) { hookEntity.setServerHooks ( org.ovirt.engine.core.bll.gluster.GetGlusterHookByIdQuery.getGlusterHookDao ( ) . getGlusterServerHooks ( org.ovirt.engine.core.bll.gluster.GetGlusterHookByIdQuery.getParameters ( ) . getHookId ( ) ) ) ; } org.ovirt.engine.core.bll.gluster.GetGlusterHookByIdQuery.getQueryReturnValue ( ) . setReturnValue ( hookEntity ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hookEntity = glusterHooksDao.getById ( org.ovirt.engine.core.bll.gluster.GetGlusterHookByIdQuery.getParameters ( ) . getHookId ( ) ) ; if ( ( hookEntity != null ) && ( org.ovirt.engine.core.bll.gluster.GetGlusterHookByIdQuery.getParameters ( ) . isIncludeServerHooks ( ) ) ) { hookEntity.setServerHooks ( glusterHooksDao.getGlusterServerHooks ( org.ovirt.engine.core.bll.gluster.GetGlusterHookByIdQuery.getParameters ( ) . getHookId ( ) ) ) ; } org.ovirt.engine.core.bll.gluster.GetGlusterHookByIdQuery.getQueryReturnValue ( ) . setReturnValue ( hookEntity ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( getEntityList ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UnlabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.NIC_ID , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( getEntityList ( ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.UnlabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.NIC_ID , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmDevice createCdRomDevice ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; device.setType ( VmDeviceGeneralType.DISK ) ; device.setDevice ( VmDeviceType.CDROM.getName ( ) ) ; device.setIsPlugged ( true ) ; device.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( id , null ) ) ; return device ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice createCdRomDevice ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; device.setType ( VmDeviceGeneralType.DISK ) ; device.setDevice ( VmDeviceType.CDROM.getName ( ) ) ; device.setPlugged ( true ) ; device.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( id , null ) ) ; return device ; }
Source:
public void validateSlaveHasNoLabelsHasNoOldNorNewLabelsValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . setExistingInterfaces ( java.util.Arrays.asList ( slave ) ) . setHost ( host ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateSlaveHasNoLabels ( slave.getName ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateQosNotPartiallyConfiguredWhenNotUpdatingAttachments ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setHost ( host ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . build ( ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = java.util.Collections.emptyList ( ) ; org.junit.Assert.assertThat ( validator.validateQosNotPartiallyConfigured ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.QuotaVdsGroup getQuotaVdsGroup ( int vCpu , int vCpuUsed , long mem , long memUsed ) { org.ovirt.engine.core.common.businessentities.QuotaVdsGroup vdsGroupQuota = new org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ( ) ; vdsGroupQuota.setVirtualCpu ( vCpu ) ; vdsGroupQuota.setVirtualCpuUsage ( vCpuUsed ) ; vdsGroupQuota.setMemSizeMB ( mem ) ; vdsGroupQuota.setMemSizeMBUsage ( memUsed ) ; vdsGroupQuota.setVdsGroupId ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID ) ; return vdsGroupQuota ; }

Target:
private org.ovirt.engine.core.common.businessentities.QuotaCluster getQuotaCluster ( int vCpu , int vCpuUsed , long mem , long memUsed ) { org.ovirt.engine.core.common.businessentities.QuotaCluster clusterQuota = new org.ovirt.engine.core.common.businessentities.QuotaCluster ( ) ; clusterQuota.setVirtualCpu ( vCpu ) ; clusterQuota.setVirtualCpuUsage ( vCpuUsed ) ; clusterQuota.setMemSizeMB ( mem ) ; clusterQuota.setMemSizeMBUsage ( memUsed ) ; clusterQuota.setClusterId ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID ) ; return clusterQuota ; }
Source:
public void SetDefaultNames3 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetClusterList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.clusterList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; SetDefaultNames4 ( ) ; } } , frontendHash ) ) ; }

Target:
public void setDefaultNames3 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.clusterList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; setDefaultNames4 ( ) ; } } , frontendHash ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVm ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolId ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL ) ; } if ( org.ovirt.engine.core.bll.RemoveVmCommand.isVmRunning ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getParameters ( ) . getVmId ( ) ) ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVm ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolId ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL ) ; } if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVm ( ) . isRunningOrPaused ( ) ) || ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL ) ; } return true ; }
Source:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void getUserIdVdcUserDefault ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.compat.Guid g = b.getUserId ( ) ; org.junit.Assert.assertEquals ( null , g ) ; }

Target:
public void getUserIdVdcUserDefault ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.compat.Guid g = b.getUserId ( ) ; org.junit.Assert.assertNull ( g ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.vms.ISpice extractSpice ( org.ovirt.engine.ui.uicommonweb.models.userportal.IUserPortalListModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel consoleModel = asUserPortalItem ( model ) . getDefaultConsole ( ) ; if ( ! ( consoleModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ) { return null ; } org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( consoleModel ) ) . getspice ( ) ; return spice ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.vms.ISpice extractSpice ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalConsolePopupModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel consoleModel = asUserPortalItem ( model ) . getDefaultConsole ( ) ; if ( ! ( consoleModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ) { return null ; } org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( consoleModel ) ) . getspice ( ) ; return spice ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotPlugNic ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugNic ( info.getInnerMap ( ) ) ; 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 java.util.concurrent.Future < java.util.Map < java.lang.String , java.lang.Object > > setupNetworks ( java.util.Map networks , java.util.Map bonds , java.util.Map options ) { return vdsServer.futureSetupNetworks ( networks , bonds , options ) ; }
Source:
public void testPrefixChange ( ) { org.ovirt.engine.core.bll.GetoVirtISOsTest.mcr.mockConfigValue ( ConfigValues.OvirtIsoPrefix , "a different prefix" ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . ExecuteCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.junit.Assert.assertTrue ( "Prefix was changed, no ISOs should be returned" , ( ( java.util.List < org.ovirt.engine.core.compat.RpmVersion > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) . isEmpty ( ) ) ; }

Target:
public void testPrefixChange ( ) { mcr.mockConfigValue ( ConfigValues.OvirtIsoPrefix , "a different prefix" ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . ExecuteCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.junit.Assert.assertTrue ( "Prefix was changed, no ISOs should be returned" , ( ( java.util.List < org.ovirt.engine.core.compat.RpmVersion > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) . isEmpty ( ) ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExcpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveTag , org.ovirt.engine.core.common.action.TagsActionParametersBase.class , new java.lang.String [ ] { "TagId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExcpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveTag , org.ovirt.engine.core.common.action.TagsActionParametersBase.class , new java.lang.String [ ] { "TagId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testImportWithClusterName ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClusterByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 1 ] } , getCluster ( 1 ) ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setName ( NAMES [ 1 ] ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false ) ; }

Target:
public void testImportWithClusterName ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetClusterByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 1 ] } , getCluster ( 1 ) ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setName ( NAMES [ 1 ] ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false ) ; }
Source:
protected void updateUserCdImage ( org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetIrsImageList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; setImagesToModel ( model , images ) ; } } ) , storagePoolId ) ; }

Target:
protected void updateUserCdImage ( org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getIrsImageList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; setImagesToModel ( model , images ) ; } } ) , storagePoolId ) ; }
Source:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }

Target:
public void canDoActionSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }
Source:
public void migrationSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void attestationServerConfigured ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void datacenter_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StoragePool datacenter = getDataCenter ( ) . getSelectedItem ( ) ; boolean isInVm = ( getVm ( ) ) != null ; if ( datacenter == null ) { return ; } updateShareableDiskEnabled ( datacenter ) ; updateDirectLunDiskEnabled ( datacenter ) ; updateInterface ( ( isInVm ? getVm ( ) . getVdsGroupCompatibilityVersion ( ) : null ) ) ; if ( ( getDiskStorageType ( ) . getEntity ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { updateStorageDomains ( datacenter ) ; } else { updateHosts ( datacenter ) ; } }

Target:
protected void datacenter_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StoragePool datacenter = getDataCenter ( ) . getSelectedItem ( ) ; boolean isInVm = ( getVm ( ) ) != null ; if ( datacenter == null ) { return ; } updateShareableDiskEnabled ( datacenter ) ; updateDirectLunDiskEnabled ( datacenter ) ; updateInterface ( ( isInVm ? getVm ( ) . getVdsGroupCompatibilityVersion ( ) : null ) ) ; if ( ( getDiskStorageType ( ) . getEntity ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) { updateStorageDomains ( datacenter ) ; } else { updateHosts ( datacenter ) ; } }
Source:
public void setItems ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > value ) { if ( ( items ) != value ) { ItemsChanging ( value , items ) ; items = value ; ItemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ( ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) . getAgent ( ) ) == null ) ) || ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) . getAgent ( ) . getId ( ) ) == null ) ) { return failCanDoAction ( EngineMessage.VDS_REMOVE_FENCE_AGENT_ID_REQUIRED ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean validate ( ) { if ( ( ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) . getAgent ( ) ) == null ) ) || ( ( org.ovirt.engine.core.bll.RemoveFenceAgentCommand.getParameters ( ) . getAgent ( ) . getId ( ) ) == null ) ) { return failValidation ( EngineMessage.VDS_REMOVE_FENCE_AGENT_ID_REQUIRED ) ; } return super . validate ( ) ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getNetworkList ( 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }