auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ev.equals ( ConsoleModel.ErrorEventDefinition ) ) && ( ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) || ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.RdpConsoleModel ) ) ) { consoleModelError ( sender , getConsoleModelErrorMessage ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ev.equals ( ConsoleModel.ErrorEventDefinition ) ) && ( ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) || ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.RdpConsoleModel ) ) ) { consoleModelError ( sender , getConsoleModelErrorMessage ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ) ; } }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > > configs = returnValue.getReturnValue ( ) ; if ( configs != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > clusterConfigOptions = configs.getFirst ( ) ; java.util.Collections.sort ( clusterConfigOptions , new org.ovirt.engine.ui.uicommonweb.Linq.GlusterVolumeSnapshotConfigComparator ( ) ) ; setModelItems ( getClusterConfigOptions ( ) , clusterConfigOptions , existingClusterConfigs ) ; } else { getClusterConfigOptions ( ) . setItems ( null ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > > configs = returnValue.getReturnValue ( ) ; if ( configs != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > clusterConfigOptions = configs.getFirst ( ) ; java.util.Collections.sort ( clusterConfigOptions , java.util.Comparator.comparing ( GlusterVolumeSnapshotConfig :: getParamName ) ) ; setModelItems ( getClusterConfigOptions ( ) , clusterConfigOptions , existingClusterConfigs ) ; } else { getClusterConfigOptions ( ) . setItems ( null ) ; } }
Source:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , bond.getName ( ) ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }

Target:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ; org.ovirt.engine.core.bll.ValidationResult slavesValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , "slaveA" ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_NAME , "networkName" ) ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , slavesValidationResult , slavesValidationResult ) ; }
Source:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "storageDomainId" , storageDomainId ) . append ( "imageGroupId" , imageGroupId ) . append ( "baseImageId" , baseImageId ) . append ( "topImageId" , topImageId ) . build ( ) ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "storageDomainId" , storageDomainId ) . append ( "imageGroupId" , imageGroupId ) . append ( "baseImageId" , baseImageId ) . append ( "topImageId" , topImageId ) . append ( "baseImageGeneration" , baseImageGeneration ) . build ( ) ; }
Source:
protected void persistCollectedData ( ) { super . persistCollectedData ( ) ; org.ovirt.engine.core.dao.VdsDynamicDAO vdsDynamicDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic hostFromDb = vdsDynamicDao.get ( getVds ( ) . getId ( ) ) ; hostFromDb.setsupported_cluster_levels ( getVds ( ) . getDynamicData ( ) . getsupported_cluster_levels ( ) ) ; vdsDynamicDao.update ( hostFromDb ) ; }

Target:
protected void persistCollectedData ( ) { super . persistCollectedData ( ) ; org.ovirt.engine.core.dao.VdsDynamicDAO vdsDynamicDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic hostFromDb = vdsDynamicDao.get ( getVds ( ) . getId ( ) ) ; hostFromDb.setSupportedClusterLevels ( getVds ( ) . getDynamicData ( ) . getSupportedClusterLevels ( ) ) ; vdsDynamicDao.update ( hostFromDb ) ; }
Source:
public org.ovirt.engine.core.dao.StorageDomainDAO getStorageDomainDAO ( ) { final org.ovirt.engine.core.common.businessentities.storage_domains sd = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; sd.setstorage_domain_type ( StorageDomainType.ImportExport ) ; sd.setstatus ( StorageDomainStatus.Active ) ; final org.ovirt.engine.core.dao.StorageDomainDAO d = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( d.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( sd ) ; return d ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage_domains getSourceDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains sd = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; sd.setstorage_domain_type ( StorageDomainType.ImportExport ) ; sd.setstatus ( StorageDomainStatus.Active ) ; return sd ; }
Source:
private java.lang.String startUserDialog ( ) throws java.io.IOException { org.ovirt.engine.core.config.EngineConfigLogic.log.debug ( "starting user dialog." ) ; java.lang.String user = null ; while ( org.apache.commons.lang.StringUtils.isBlank ( user ) ) { java.lang.System.out.println ( "Please enter user:" ) ; user = java.lang.System.console ( ) . readLine ( ) ; } return user ; }

Target:
private java.lang.String startUserDialog ( ) throws java.io.IOException { org.ovirt.engine.core.config.EngineConfigLogic.log.debug ( "starting user dialog." ) ; java.lang.String user = null ; while ( org.apache.commons.lang.StringUtils.isBlank ( user ) ) { org.ovirt.engine.core.config.EngineConfigLogic.console.writeLine ( "Please enter user: " ) ; user = org.ovirt.engine.core.config.EngineConfigLogic.console.readLine ( ) ; } return user ; }
Source:
protected void runAddAndVerify ( org.ovirt.engine.core.common.businessentities.network.VmNic iface , boolean addMacResult , org.mockito.verification.VerificationMode addMacVerification , org.ovirt.engine.core.compat.Version version ) { vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , false , version ) ; org.mockito.Mockito.verify ( macPoolManager , org.mockito.Mockito.times ( 1 ) ) . forceAddMac ( iface.getMacAddress ( ) ) ; verifyAddDelegatedCorrectly ( iface , addMacVerification ) ; }

Target:
public void addAllocateNewMacAddress ( ) { org.ovirt.engine.core.common.businessentities.network.VmNic iface = createNewInterface ( ) ; java.lang.String newMac = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( macPoolManager.allocateNewMac ( ) ) . thenReturn ( newMac ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , true , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.OS_ID , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.VERSION_3_2 ) ; org.junit.Assert.assertEquals ( newMac , iface.getMacAddress ( ) ) ; }
Source:
public org.ovirt.engine.sdk.decorators.VM update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.VM.class , org.ovirt.engine.sdk.decorators.VM.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VM update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.VM.class , org.ovirt.engine.sdk.decorators.VM.class , headers ) ; }
Source:
public static void addLink ( java.lang.String url , org.ovirt.engine.api.model.BaseResource resource , java.lang.String rel , org.ovirt.engine.api.utils.LinkHelper.LinkFlags flags , org.ovirt.engine.api.model.ParametersSet params ) { org.ovirt.engine.api.model.Link link = new org.ovirt.engine.api.model.Link ( ) ; link.setRel ( rel ) ; link.setHref ( org.ovirt.engine.api.utils.LinkHelper.combine ( url , rel ) ) ; resource.getLinks ( ) . add ( link ) ; if ( flags == ( org.ovirt.engine.api.utils.LinkHelper.LinkFlags.SEARCHABLE ) ) { org.ovirt.engine.api.utils.LinkHelper.addLink ( url , resource , rel , params ) ; } }

Target:
private static boolean isExceptionalPluralResource ( java.lang.String method , java.lang.String type ) { return ( "katelloerrata" . equals ( method ) ) && ( "katelloerratum" . equals ( type ) ) ; }
Source:
public org.ovirt.engine.core.common.job.Job getJobWithSteps ( final org.ovirt.engine.core.compat.Guid jobId ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > jobSubjectEntity = jobSubjectEntityDao.getJobSubjectEntityByJobId ( jobId ) ; job.setJobSubjectEntities ( jobSubjectEntity ) ; } return job ; }

Target:
public org.ovirt.engine.core.common.job.Job getJobWithSteps ( final org.ovirt.engine.core.compat.Guid jobId ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > jobSubjectEntity = jobSubjectEntityDao.getJobSubjectEntityByJobId ( jobId ) ; job.setJobSubjectEntities ( jobSubjectEntity ) ; loadJobSteps ( job ) ; } return job ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" ) ; if ( ! ( dataCenter.isSetLocal ( ) ) ) { validateParameters ( dataCenter , "local" ) ; } org.ovirt.engine.core.common.businessentities.StoragePool entity = map ( dataCenter ) ; return performCreate ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" ) ; if ( ! ( dataCenter.isSetLocal ( ) ) ) { validateParameters ( dataCenter , "local" ) ; } org.ovirt.engine.core.common.businessentities.StoragePool entity = map ( dataCenter ) ; return performCreate ( ActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel backupModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel ) ( model1 ) ) ; backupModel1.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel backupModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel ) ( model1 ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; backupModel1.setItems ( vms ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.pool.GetStoragePoolByIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.pool.GetStoragePoolByIdQuery.getDbFacade ( ) . getStoragePoolDao ( ) . get ( org.ovirt.engine.core.bll.storage.pool.GetStoragePoolByIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.pool.GetStoragePoolByIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.pool.GetStoragePoolByIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected java.lang.Object queryDataCenter ( ) { return storagePoolDao.get ( org.ovirt.engine.core.bll.storage.pool.GetStoragePoolByIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.pool.GetStoragePoolByIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.pool.GetStoragePoolByIdQuery.getParameters ( ) . isFiltered ( ) ) ; }
Source:
public int hashCode ( ) { return java.util.Objects.hash ( id , hostName , consoleAddress , name , otpValidity , pmEnabled , pmKdumpDetection , port , protocol , sshPort , sshUsername , serverSslEnabled , uniqueId , clusterId , vdsStrength , vdsType , disablePowerManagementPolicy , hostProviderId ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id , hostName , consoleAddress , name , otpValidity , pmEnabled , pmKdumpDetection , port , protocol , sshPort , sshUsername , serverSslEnabled , uniqueId , clusterId , vdsStrength , vdsType , disablePowerManagementPolicy , hostProviderId , openstackNetworkProviderId , currentKernelCmdline , kernelCmdlineParsable , lastStoredKernelCmdline , kernelCmdlineIommu , kernelCmdlineKvmNested , kernelCmdlinePciRealloc , kernelCmdlineUnsafeInterrupts ) ; }
Source:
private void endAction ( org.ovirt.engine.core.bll.CommandBase < ? > commandBase , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { if ( ( ( commandBase.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) || ( ! ( commandBase.getParameters ( ) . getShouldBeEndedByParent ( ) ) ) ) { obtainChildCommands ( commandBase , childCmdIds ) ; commandBase.endAction ( ) ; if ( ( commandBase.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( commandBase.getCommandId ( ) ) ; } } }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.bll.CommandBase < ? > commandBase = getCommand ( cmdId ) ; commandBase.getParameters ( ) . setTaskGroupSuccess ( false ) ; endAction ( commandBase , childCmdIds , false ) ; }
Source:
public static void clearNetworks ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > attachedNetworks = nic.getItems ( ) ; if ( ( attachedNetworks.size ( ) ) > 0 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel : new java.util.ArrayList ( attachedNetworks ) ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.getCommand ( networkModel , null , allNics ) . execute ( ) ; } } }

Target:
public static void clearNetworks ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > attachedNetworks = nic.getItems ( ) ; if ( ( attachedNetworks.size ( ) ) > 0 ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel : new java.util.ArrayList ( attachedNetworks ) ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.DETACH_NETWORK.getCommand ( networkModel , null , dataFromHostSetupNetworksModel ) . execute ( ) ; } } }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks ; if ( isFiltered ( ) ) { networks = mapCollection ( getBackendCollection ( queryType , getQueryParameters ( ) , SearchType.Network ) ) ; } else { networks = mapCollection ( getBackendCollection ( SearchType.Network ) ) ; } for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" , "dataCenter.name|id" ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , entity ) ; if ( network.isSetProfileRequired ( ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return performCreate ( VdcActionType.AddNetwork , parameters , new org.ovirt.engine.api.restapi.resource.BackendNetworksResource.AddedNetworkResolver ( ) ) ; }
Source:
public void testGetIncludeStatistics ( ) { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.junit.Assert.assertTrue ( disk.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( disk.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; } finally { accepts.clear ( ) ; } }
Source:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getStorageDoaminsByDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks , boolean isFillStorageTodDiskMap ) { java.util.Set < org.ovirt.engine.core.compat.Guid > domainsList = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; if ( disks != null ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { domainsList.addAll ( disk.getStorageIds ( ) ) ; if ( isFillStorageTodDiskMap ) { for ( org.ovirt.engine.core.compat.Guid storageDomainId : disk.getStorageIds ( ) ) { org.ovirt.engine.core.utils.MultiValueMapUtils.addToMap ( storageDomainId , disk , storageToDisksMap ) ; } } } } return domainsList ; }

Target:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getStorageDoaminsByDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks , boolean isFillStorageTodDiskMap ) { java.util.Set < org.ovirt.engine.core.compat.Guid > domainsList = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; if ( disks != null ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { domainsList.addAll ( disk.getStorageIds ( ) ) ; if ( isFillStorageTodDiskMap ) { for ( org.ovirt.engine.core.compat.Guid storageDomainId : disk.getStorageIds ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( storageDomainId , disk , storageToDisksMap ) ; } } } } return domainsList ; }
Source:
private void setUpStorageHelper ( ) { org.ovirt.engine.core.bll.storage.IStorageHelper helper = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.storage.IStorageHelper.class ) ; org.mockito.Mockito.when ( helper.connectStorageToDomainByVdsIdDetails ( storageDomain , command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , org.ovirt.engine.core.common.errors.EngineFault > ( true , null ) ) ; org.mockito.Mockito.when ( helper.disconnectStorageFromDomainByVdsId ( storageDomain , command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( helper ) . when ( command ) . getStorageHelper ( storageDomain ) ; }

Target:
private void setUpStorageHelper ( ) { org.ovirt.engine.core.bll.storage.connection.IStorageHelper helper = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.storage.connection.IStorageHelper.class ) ; org.mockito.Mockito.when ( helper.connectStorageToDomainByVdsIdDetails ( storageDomain , command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , org.ovirt.engine.core.common.errors.EngineFault > ( true , null ) ) ; org.mockito.Mockito.when ( helper.disconnectStorageFromDomainByVdsId ( storageDomain , command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( helper ) . when ( command ) . getStorageHelper ( storageDomain ) ; }
Source:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public synchronized void UpdateTaskWithActionParameters ( org.ovirt.engine.core.compat.Guid taskID , org.ovirt.engine.core.common.action.VdcActionParametersBase actionParameters ) { if ( _tasks.containsKey ( taskID ) ) { org.ovirt.engine.core.common.businessentities.async_tasks currentDbAsyncTask = _tasks.get ( taskID ) . getParameters ( ) . getDbAsyncTask ( ) ; currentDbAsyncTask.setaction_parameters ( actionParameters ) ; org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.updateAsyncTaskInDB ( _tasks.get ( taskID ) ) ; } }

Target:
public synchronized void UpdateTaskWithActionParameters ( org.ovirt.engine.core.compat.Guid taskID , org.ovirt.engine.core.common.action.VdcActionParametersBase actionParameters ) { if ( _tasks.containsKey ( taskID ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks currentDbAsyncTask = _tasks.get ( taskID ) . getParameters ( ) . getDbAsyncTask ( ) ; currentDbAsyncTask.setaction_parameters ( actionParameters ) ; org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.updateAsyncTaskInDB ( _tasks.get ( taskID ) ) ; } }
Source:
protected void postSaveAction ( boolean succeeded ) { if ( succeeded ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosItems = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( getQos ( ) . getItems ( ) ) ) ) ; qosItems.add ( 1 , networkQoS ) ; getQos ( ) . setItems ( qosItems ) ; getQos ( ) . setSelectedItem ( networkQoS ) ; } super . postSaveAction ( succeeded ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Iterable < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qos = ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; getQos ( ) . setItems ( qos ) ; getQos ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( qos , getNetwork ( ) . getQosId ( ) ) ) ; }
Source:
protected void setGetVdsQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setClusterId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , vds ) ; } }

Target:
protected void setGetVdsQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setClusterId ( GUIDS [ 0 ] ) ; setUpEntityQueryExpectations ( QueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , vds ) ; } }
Source:
protected void validateParameters ( org.ovirt.engine.api.model.CpuProfile cpuProfile ) { validateParameters ( cpuProfile , "name" , "cluster.id" ) ; java.lang.String clusterId = cpuProfile.getCluster ( ) . getId ( ) ; getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , VdcQueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( clusterId ) ) , ( "cluster: id=" + clusterId ) ) ; }

Target:
protected void validateParameters ( org.ovirt.engine.api.model.CpuProfile cpuProfile ) { validateParameters ( cpuProfile , "name" , "cluster.id" ) ; java.lang.String clusterId = cpuProfile.getCluster ( ) . getId ( ) ; getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , QueryType.GetClusterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( clusterId ) ) , ( "cluster: id=" + clusterId ) ) ; }
Source:
public static void refreshReloadableConfigsInVdcOptionCache ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdcOption > list = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.getVdcOptionDAO ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdcOption option : list ) { try { if ( org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.isReloadable ( option.getoption_name ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.updateOption ( option ) ; } } catch ( java.lang.NoSuchFieldException e ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.log.error ( "Not refreshing field '{}': does not exist in class {}." , option.getoption_name ( ) , org.ovirt.engine.core.common.config.ConfigValues.class . getSimpleName ( ) ) ; } } }

Target:
public static void refreshReloadableConfigsInVdcOptionCache ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdcOption > list = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.getVdcOptionDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdcOption option : list ) { try { if ( org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.isReloadable ( option.getoption_name ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.updateOption ( option ) ; } } catch ( java.lang.NoSuchFieldException e ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.log.error ( "Not refreshing field '{}': does not exist in class {}." , option.getoption_name ( ) , org.ovirt.engine.core.common.config.ConfigValues.class . getSimpleName ( ) ) ; } } }
Source:
public static void cancelTimer ( java.lang.String timerName ) { for ( java.lang.String name : org.ovirt.engine.ui.common.uicommon.TimerFactory.timerList.keySet ( ) ) { if ( name.equals ( timerName ) ) { org.ovirt.engine.ui.common.uicommon.TimerFactory.logger.fine ( ( ( "Cancelling the timer '" + name ) + "'" ) ) ; org.ovirt.engine.ui.common.uicommon.TimerFactory.timerList.get ( name ) . cancel ( ) ; } } }

Target:
public static void cancelTimer ( java.lang.String timerName ) { for ( java.util.Map.Entry < java.lang.String , com.google.gwt.user.client.Timer > timerEntry : org.ovirt.engine.ui.common.uicommon.TimerFactory.timerList.entrySet ( ) ) { if ( timerEntry.getKey ( ) . equals ( timerName ) ) { org.ovirt.engine.ui.common.uicommon.TimerFactory.logger.fine ( ( ( "Cancelling the timer '" + ( timerEntry.getKey ( ) ) ) + "'" ) ) ; timerEntry.getValue ( ) . cancel ( ) ; } } }
Source:
public void validateSuccess ( ) { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }

Target:
public void validateSuccessFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskValidator.isDiskInterfaceSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.mockito.Mockito.when ( command.getDiskValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.Disk.class ) ) ) . thenReturn ( diskValidator ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > createClusterList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.VERSION_1_0 ) ; cluster.setName ( "firstCluster" ) ; clusters.add ( cluster ) ; return clusters ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > createClusterList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.VERSION_1_0 ) ; cluster.setName ( "firstCluster" ) ; clusters.add ( cluster ) ; return clusters ; }
Source:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > all = org.ovirt.engine.core.bll.VmCommand.getTagDao ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagVm : all ) { org.ovirt.engine.core.bll.VmCommand.getTagDao ( ) . detachVmFromTag ( tagVm.getTagId ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }

Target:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > all = tagDao.getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagVm : all ) { tagDao.detachVmFromTag ( tagVm.getTagId ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }
Source:
public 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 ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void vlanIdAvailableTest ( org.ovirt.engine.core.bll.ValidationResult expected , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { this . networks.addAll ( networks ) ; org.mockito.Mockito.when ( network.getVlanId ( ) ) . thenReturn ( DEFAULT_VLAN_ID ) ; org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( DEFAULT_GUID ) ; org.junit.Assert.assertEquals ( expected.getMessage ( ) , validator.vlanIdNotUsed ( ) . getMessage ( ) ) ; }

Target:
private void vlanIdAvailableTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { this . networks.addAll ( networks ) ; org.mockito.Mockito.when ( network.getVlanId ( ) ) . thenReturn ( DEFAULT_VLAN_ID ) ; org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( DEFAULT_GUID ) ; org.junit.Assert.assertThat ( validator.vlanIdNotUsed ( ) , matcher ) ; }
Source:
public void testGetNotFound1 ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( new java.util.ArrayList < > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound1 ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( new java.util.ArrayList < > ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void runAsSuperAdmin ( ) { if ( ( org.ovirt.engine.core.itests.AbstractBackendTest.sessionId ) == null ) { org.ovirt.engine.core.itests.AbstractBackendTest.generateUserSession ( ) ; } org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( org.ovirt.engine.core.itests.AbstractBackendTest.user.getUserId ( ) ) ; perms.setObjectId ( MultiLevelAdministrationHandler.SYSTEM_OBJECT_ID ) ; perms.setObjectType ( VdcObjectType.System ) ; perms.setrole_id ( PredefinedRoles.SUPER_USER.getId ( ) ) ; try { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDAO ( ) . save ( perms ) ; } catch ( java.lang.Exception e ) { java.lang.System.out.println ( "User is already super user." ) ; } }

Target:
public static void runAsSuperAdmin ( ) { if ( ( org.ovirt.engine.core.itests.AbstractBackendTest.sessionId ) == null ) { org.ovirt.engine.core.itests.AbstractBackendTest.generateUserSession ( ) ; } org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( org.ovirt.engine.core.itests.AbstractBackendTest.user.getUserId ( ) ) ; perms.setObjectId ( MultiLevelAdministrationHandler.SYSTEM_OBJECT_ID ) ; perms.setObjectType ( VdcObjectType.System ) ; perms.setrole_id ( PredefinedRoles.SUPER_USER.getId ( ) ) ; try { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . save ( perms ) ; } catch ( java.lang.Exception e ) { java.lang.System.out.println ( "User is already super user." ) ; } }
Source:
private void handleOperationException ( org.ovirt.engine.core.bll.adbroker.LdapSearchExceptionHandlingResponse response , java.lang.Throwable throwable ) { response.setServerScore ( Score.HIGH ) . setTranslatedException ( new org.ovirt.engine.core.bll.adbroker.EngineDirectoryServiceException ( org.ovirt.engine.core.utils.kerberos.AuthenticationResult.USER_ACCOUNT_DISABLED_OR_LOCKED , throwable ) ) . setTryNextServer ( false ) ; }

Target:
private void handleOperationException ( org.ovirt.engine.core.bll.adbroker.LdapSearchExceptionHandlingResponse response , java.lang.Throwable throwable , org.ovirt.engine.core.bll.adbroker.LdapCredentials credentials ) { response.setServerScore ( Score.HIGH ) . setTranslatedException ( new org.ovirt.engine.core.bll.adbroker.EngineDirectoryServiceException ( org.ovirt.engine.core.utils.kerberos.AuthenticationResult.USER_ACCOUNT_DISABLED_OR_LOCKED , throwable ) ) . setTryNextServer ( false ) ; org.ovirt.engine.core.bll.adbroker.LdapBrokerUtils.logEventForUser ( credentials.getUserName ( ) , AuthenticationResult.USER_ACCOUNT_DISABLED_OR_LOCKED.getAuditLogType ( ) ) ; }
Source:
private java.lang.String GetLocalStoragesFormattedString ( ) { java.lang.String localStorages = "" ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { localStorages += ( a.getStorageName ( ) ) + ", " ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }

Target:
private java.lang.String GetLocalStoragesFormattedString ( ) { java.lang.StringBuilder localStorages = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { localStorages.append ( a.getStorageName ( ) ) . append ( ", " ) ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }
Source:
public void canDoActionFailsForNoStorageDevice ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.Raid0 , null , null , java.util.Collections.EMPTY_LIST ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionFailsForNoStorageDevice ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.Raid0 , null , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > emptyList ( ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }
Source:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.VmPool selectedItem ) { driver.edit ( getDetailModel ( ) ) ; monitorCount.setText ( java.lang.String.valueOf ( getDetailModel ( ) . getMonitorCount ( ) ) ) ; isStateless.setText ( java.lang.Boolean.toString ( getDetailModel ( ) . getIsStateless ( ) ) ) ; oS.setText ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getDetailModel ( ) . getOS ( ) ) ) ; formBuilder.update ( getDetailModel ( ) ) ; defaultHost.setTitle ( getDetailModel ( ) . getDefaultHost ( ) ) ; }

Target:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.VmPool selectedItem ) { driver.edit ( getDetailModel ( ) ) ; monitorCount.setValue ( java.lang.String.valueOf ( getDetailModel ( ) . getMonitorCount ( ) ) ) ; isStateless.setValue ( java.lang.Boolean.toString ( getDetailModel ( ) . getIsStateless ( ) ) ) ; oS.setValue ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getDetailModel ( ) . getOS ( ) ) ) ; formBuilder.update ( getDetailModel ( ) ) ; defaultHost.setTitle ( getDetailModel ( ) . getDefaultHost ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmWatchdogAction map ( org.ovirt.engine.api.restapi.types.WatchdogAction action , org.ovirt.engine.core.common.businessentities.VmWatchdogAction incoming ) { switch ( action ) { case DUMP : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.DUMP ; case NONE : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.NONE ; case PAUSE : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.PAUSE ; case POWEROFF : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.POWEROFF ; case RESET : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.RESET ; default : return null ; } }

Target:
public static org.ovirt.engine.core.common.businessentities.VmWatchdogAction map ( org.ovirt.engine.api.model.WatchdogAction action , org.ovirt.engine.core.common.businessentities.VmWatchdogAction incoming ) { switch ( action ) { case DUMP : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.DUMP ; case NONE : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.NONE ; case PAUSE : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.PAUSE ; case POWEROFF : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.POWEROFF ; case RESET : return org.ovirt.engine.core.common.businessentities.VmWatchdogAction.RESET ; default : return null ; } }
Source:
public void canDoActionSuccess ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void validateSuccess ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
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 , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getUserMessageOfTheDayViaPublic ( 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.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }