auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void removeVmStatelessImages ( ) { if ( getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }

Target:
private void removeVmStatelessImages ( ) { if ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; } } , this ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; }
Source:
private boolean updateIsoListFromVDSM ( org.ovirt.engine.core.compat.Guid repoStoragePoolId , org.ovirt.engine.core.compat.Guid repoStorageDomainId ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue fileStats = getFileStats ( repoStoragePoolId , repoStorageDomainId , org.ovirt.engine.core.bll.IsoDomainListSyncronizer.ISO_FILE_PATTERN , VDSCommandType.GetIsoList ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed fileListRefreshed = new org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed ( ) { @ java.lang.Override public void onFileListRefreshed ( org.ovirt.engine.core.compat.Guid poolId , java.util.Set < java.lang.String > isoList ) { org.ovirt.engine.core.bll.VmHandler.refreshVmsToolsVersion ( poolId , isoList ) ; } } ; return refreshVdsmFileList ( repoStoragePoolId , repoStorageDomainId , fileListRefreshed , ImageFileType.ISO , fileStatsFromVDSReturnValue ( fileStats ) ) ; }

Target:
private boolean updateIsoListFromVDSM ( org.ovirt.engine.core.compat.Guid repoStoragePoolId , org.ovirt.engine.core.compat.Guid repoStorageDomainId , java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > fileStats ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed fileListRefreshed = new org.ovirt.engine.core.bll.IsoDomainListSyncronizer.FileListRefreshed ( ) { @ java.lang.Override public void onFileListRefreshed ( org.ovirt.engine.core.compat.Guid poolId , java.util.Set < java.lang.String > isoList ) { org.ovirt.engine.core.bll.VmHandler.refreshVmsToolsVersion ( poolId , isoList ) ; } } ; return refreshVdsmFileList ( repoStoragePoolId , repoStorageDomainId , ImageFileType.ISO , fileStats , fileListRefreshed ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ) ( source ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo cifsOption = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ( ) ; cifsOption.setKey ( "user.cifs" ) ; list.add ( cifsOption ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.lang.Boolean.TRUE ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel snapshotModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( returnValue ) ) ; if ( snapshotModel.showWarningForByVmSnapshotsValidation ( snapshots ) ) { snapshotModel.getCommands ( ) . add ( getCloseCommand ( ) ) ; snapshotModel.StopProgress ( ) ; } else { snapshotModel.initVmDisks ( ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel snapshotModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( returnValue ) ) ; if ( snapshotModel.showWarningForByVmSnapshotsValidation ( snapshots ) ) { snapshotModel.getCommands ( ) . add ( getCloseCommand ( ) ) ; snapshotModel.StopProgress ( ) ; } else { snapshotModel.initVmDisks ( ) ; } }
Source:
public void testDiskLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk disk = new org.ovirt.engine.api.model.Disk ( ) ; disk.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DISK_ID ) ; disk.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; disk.getVm ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , disk ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DISK_HREF , disk.getHref ( ) ) ; }

Target:
public void testDiskLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk disk = new org.ovirt.engine.api.model.Disk ( ) ; disk.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DISK_ID ) ; disk.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; disk.getVm ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( disk ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DISK_HREF , disk.getHref ( ) ) ; }
Source:
public static void fillImagesBySnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; diskImage.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) , diskImage.getImageTemplateId ( ) ) ) ; } } }

Target:
public static void fillImagesBySnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : vm.getDiskMap ( ) . values ( ) ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; diskImage.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) ) ) ; } } }
Source:
public < T > T pickRandom ( java.util.Collection < T > c ) { int elementIndex = super . nextInt ( c.size ( ) ) ; java.util.Iterator < T > iter = c.iterator ( ) ; for ( int i = 0 ; i < elementIndex ; ++ i ) { iter.next ( ) ; } return iter.next ( ) ; }

Target:
public < T > T pickRandom ( java.util.Collection < T > c ) { int elementIndex = nextInt ( c.size ( ) ) ; java.util.Iterator < T > iter = c.iterator ( ) ; for ( int i = 0 ; i < elementIndex ; ++ i ) { iter.next ( ) ; } return iter.next ( ) ; }
Source:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return org.ovirt.engine.core.bll.VmSlaPolicyCommand.failVmStatusIllegal ( ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.vmSlaPolicy ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) ) { return failValidation ( EngineMessage.VM_SLA_POLICY_NOT_SUPPORTED ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return org.ovirt.engine.core.bll.VmSlaPolicyCommand.failVmStatusIllegal ( ) ; } return true ; }
Source:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 0 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }
Source:
private void addVdsGroupId ( org.ovirt.engine.core.compat.Guid id , java.util.List < org.ovirt.engine.core.compat.NGuid > ids ) { ids.add ( id ) ; org.hibernate.Query query = getSession ( ) . createQuery ( "from VDSGroup where id = :id" ) ; query.setParameter ( "id" , id ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( query.uniqueResult ( ) ) ) ; if ( vdsGroup != null ) { ids.add ( vdsGroup.getstorage_pool_id ( ) ) ; } }

Target:
private void addVdsGroupId ( org.ovirt.engine.core.compat.Guid id , java.util.List < org.ovirt.engine.core.compat.NGuid > ids ) { ids.add ( id ) ; org.hibernate.Query query = getSession ( ) . createQuery ( "from VDSGroup where id = :id" ) ; query.setParameter ( "id" , id ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( query.uniqueResult ( ) ) ) ; if ( vdsGroup != null ) { ids.add ( vdsGroup.getStoragePoolId ( ) ) ; } }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.aaa.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendGroupsResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.aaa.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendGroupsResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } }
Source:
public void setSupportBridgesReportByVDSM ( boolean isSupportBridgesReportByVDSM ) { if ( ! isSupportBridgesReportByVDSM ) { getIsVmNetwork ( ) . setEntity ( true ) ; getIsVmNetwork ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . bridlessNetworkNotSupported ( getSelectedDc ( ) . getCompatibilityVersion ( ) . toString ( ) ) ) ; getIsVmNetwork ( ) . setIsChangeable ( false ) ; } else { if ( ( this . isSupportBridgesReportByVDSM ) != isSupportBridgesReportByVDSM ) { initIsVm ( ) ; } getIsVmNetwork ( ) . setIsChangeable ( true ) ; } this . isSupportBridgesReportByVDSM = isSupportBridgesReportByVDSM ; }

Target:
public void setSupportBridgesReportByVDSM ( ) { if ( ! ( this . isSupportBridgesReportByVDSM ) ) { initIsVm ( ) ; } getIsVmNetwork ( ) . setIsChangeable ( true ) ; this . isSupportBridgesReportByVDSM = true ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendedVmDynamic ( org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendedVmDynamic ( org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) ) ; }
Source:
public void setupMock ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( jobDaoMock ) . when ( command ) . getJobDao ( ) ; org.mockito.Mockito.doReturn ( stepDaoMock ) . when ( command ) . getStepDao ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.jobId ) ) . thenReturn ( makeExternalTestJob ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.nonExternalJobId ) ) . thenReturn ( makeNonExternalTestJob ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.nonExternalJobId ) ) ; }

Target:
public void setupMock ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( stepDaoMock ) . when ( command ) . getStepDao ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.jobId ) ) . thenReturn ( makeExternalTestJob ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.nonExternalJobId ) ) . thenReturn ( makeNonExternalTestJob ( org.ovirt.engine.core.bll.AddExternalStepCommandTest.nonExternalJobId ) ) ; }
Source:
private boolean hostEmulationModeMatchesTheConfigValues ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.String [ ] hostSupportedEmulatedMachines ) { java.lang.String matchedEmulatedMachine = org.ovirt.engine.core.common.utils.ListUtils.firstMatch ( java.util.Arrays.asList ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ClusterEmulatedMachines , vds.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) . split ( "," ) ) , hostSupportedEmulatedMachines ) ; if ( ( matchedEmulatedMachine != null ) && ( ! ( matchedEmulatedMachine.isEmpty ( ) ) ) ) { setClusterEmulatedMachine ( vds , matchedEmulatedMachine ) ; return true ; } return false ; }

Target:
private boolean hostEmulationModeMatchesTheConfigValues ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.String [ ] hostSupportedEmulatedMachines ) { java.lang.String matchedEmulatedMachine = org.ovirt.engine.core.common.utils.ListUtils.firstMatch ( org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > GetValue ( ConfigValues.ClusterEmulatedMachines , vds.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) , hostSupportedEmulatedMachines ) ; if ( ( matchedEmulatedMachine != null ) && ( ! ( matchedEmulatedMachine.isEmpty ( ) ) ) ) { setClusterEmulatedMachine ( vds , matchedEmulatedMachine ) ; return true ; } return false ; }
Source:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( T qos : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.action.QosParametersBase < T > parameter = new org.ovirt.engine.core.common.action.QosParametersBase < T > ( ) ; parameter.setQosId ( qos.getId ( ) ) ; parameters.add ( parameter ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( getRemoveActionType ( ) , parameters ) ; cancel ( ) ; }

Target:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < > ( ) ; for ( T qos : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.action.QosParametersBase < T > parameter = new org.ovirt.engine.core.common.action.QosParametersBase ( ) ; parameter.setQosId ( qos.getId ( ) ) ; parameters.add ( parameter ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( getRemoveActionType ( ) , parameters ) ; cancel ( ) ; }
Source:
public void testGetClustersByServiceAndCompatibilityVersion ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = ( ( org.ovirt.engine.core.dao.ClusterDaoImpl ) ( dao ) ) . getClustersByServiceAndCompatibilityVersion ( true , false , "2.3" ) ; org.junit.Assert.assertNotNull ( clusters ) ; org.junit.Assert.assertEquals ( 1 , clusters.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_CLUSTER_ID , clusters.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetClustersByServiceAndCompatibilityVersion ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = dao.getClustersByServiceAndCompatibilityVersion ( true , false , "2.3" ) ; org.junit.Assert.assertNotNull ( clusters ) ; org.junit.Assert.assertEquals ( 1 , clusters.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_CLUSTER_ID , clusters.get ( 0 ) . getId ( ) ) ; }
Source:
public org.ovirt.engine.api.model.NIC update ( org.ovirt.engine.api.model.NIC resource ) { validateParameters ( resource , requiredUpdateFields ) ; org.ovirt.engine.core.common.businessentities.Network network = findNetwork ( resource ) ; if ( network != null ) { resource.getNetwork ( ) . setName ( network.getname ( ) ) ; resource.getNetwork ( ) . setId ( null ) ; } return performUpdate ( resource , entityResolver , updateType , updateParametersProvider ) ; }

Target:
public org.ovirt.engine.api.model.NIC update ( org.ovirt.engine.api.model.NIC resource ) { validateParameters ( resource , requiredUpdateFields ) ; org.ovirt.engine.core.common.businessentities.network.Network network = findNetwork ( resource ) ; if ( network != null ) { resource.getNetwork ( ) . setName ( network.getname ( ) ) ; resource.getNetwork ( ) . setId ( null ) ; } return performUpdate ( resource , entityResolver , updateType , updateParametersProvider ) ; }
Source:
private java.lang.String getPublicEntity ( java.lang.String entityName ) { if ( this . entitiesMap.containsKey ( entityName.toLowerCase ( ) ) ) { return this . entitiesMap.get ( entityName.toLowerCase ( ) ) . getSimpleName ( ) ; } throw new java.lang.RuntimeException ( ( ( "Public entity \"" + entityName ) + "\" fetch has failed." ) ) ; }

Target:
private java.lang.String getPublicEntity ( java.lang.String entityName ) { if ( this . entitiesMap.containsKey ( entityName.toLowerCase ( ) ) ) { return this . entitiesMap.get ( entityName.toLowerCase ( ) ) ; } throw new java.lang.RuntimeException ( ( ( "Public entity \"" + entityName ) + "\" fetch has failed." ) ) ; }
Source:
public void validateEnums ( org.ovirt.engine.api.model.DataCenter dataCenter ) { if ( dataCenter != null ) { if ( dataCenter.isSetStorageType ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) , true ) ; } if ( dataCenter.isSetStorageFormat ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.StorageFormat.class , dataCenter.getStorageFormat ( ) , true ) ; } if ( dataCenter.isSetQuotaMode ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.QuotaModeType.class , dataCenter.getQuotaMode ( ) , true ) ; } } }

Target:
public void validateEnums ( org.ovirt.engine.api.model.DataCenter dataCenter ) { if ( dataCenter != null ) { if ( dataCenter.isSetStorageFormat ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.StorageFormat.class , dataCenter.getStorageFormat ( ) , true ) ; } if ( dataCenter.isSetQuotaMode ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.QuotaModeType.class , dataCenter.getQuotaMode ( ) , true ) ; } } }
Source:
public void setUp ( ) { tested = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.common.system.ClientStorageImpl ( ) { @ java.lang.Override void initStorage ( ) { } } ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setLocalItemImpl ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyString ( ) ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setSessionItemImpl ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyString ( ) ) ; }

Target:
public void setUp ( ) { tested = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.common.system.ClientStorageImpl ( ) { @ java.lang.Override void initStorage ( ) { } } ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setLocalItemImpl ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setSessionItemImpl ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMetadataDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ; image.setVolumeType ( VolumeType.Preallocated ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; image.setDiskInterface ( DiskInterface.VirtIO ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMetadataDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ; image.setVolumeType ( VolumeType.Preallocated ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; return image ; }
Source:
private void networkNameTest ( org.ovirt.engine.core.bll.ValidationResult expected , boolean networkLinkingSupported , java.lang.String networkName ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , null , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.getNetworkName ( ) ) . thenReturn ( networkName ) ; org.junit.Assert.assertEquals ( expected , validator.networkNameValid ( ) ) ; }

Target:
private void networkNameTest ( org.ovirt.engine.core.bll.ValidationResult expected , boolean networkLinkingSupported , java.lang.String networkName ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.getNetworkName ( ) ) . thenReturn ( networkName ) ; org.junit.Assert.assertEquals ( expected , validator.networkNameValid ( ) ) ; }
Source:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; 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.Arrays.asList ( storageDevice ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; 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.Arrays.asList ( storageDevice ) ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void testListCrash ( ) throws java.lang.Exception { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpDiskProfilesQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; control.replay ( ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpDiskProfilesQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
public void storagePoolIdWithStorageDomain ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setStoragePoolId ( null ) ; b.setStoragePool ( null ) ; final org.ovirt.engine.core.common.businessentities.storage_domains s = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; s.setstorage_pool_id ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStorageDomain ( s ) ; final org.ovirt.engine.core.compat.NGuid n = b.getStoragePoolId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , n ) ; }

Target:
public void storagePoolIdWithStorageDomain ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setStoragePoolId ( null ) ; b.setStoragePool ( null ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setStoragePoolId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStorageDomain ( s ) ; final org.ovirt.engine.core.compat.NGuid n = b.getStoragePoolId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , n ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateImagesForRunVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisks ) { if ( vmDisks.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return ! ( vm.isAutoStartup ( ) ) ? new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( vmDisks ) . diskImagesNotLocked ( ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateImagesForRunVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisks ) { if ( vmDisks.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return ! ( vm.isAutoStartup ( ) ) ? new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( vmDisks ) . diskImagesNotLocked ( ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > mockVfsOnNetDevice ( int numOfVfs , org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > vfs = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < numOfVfs ; ++ i ) { org.ovirt.engine.core.common.businessentities.HostDevice vfPciDevice = new org.ovirt.engine.core.common.businessentities.HostDevice ( ) ; vfPciDevice.setParentPhysicalFunction ( pciDevice.getDeviceName ( ) ) ; vfPciDevice.setDeviceName ( java.lang.String.valueOf ( i ) ) ; vfPciDevice.setHostId ( org.ovirt.engine.core.bll.network.host.HostNicVfsConfigHelperImplTest.HOST_ID ) ; vfPciDevice.setVmId ( vmId ) ; vfs.add ( vfPciDevice ) ; } return vfs ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > mockVfsOnNetDevice ( int numOfVfs ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > vfs = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < numOfVfs ; ++ i ) { org.ovirt.engine.core.common.businessentities.HostDevice vfPciDevice = new org.ovirt.engine.core.common.businessentities.HostDevice ( ) ; vfPciDevice.setParentPhysicalFunction ( pciDevice.getDeviceName ( ) ) ; vfPciDevice.setDeviceName ( java.lang.String.valueOf ( i ) ) ; vfPciDevice.setHostId ( org.ovirt.engine.core.bll.network.host.HostNicVfsConfigHelperImplTest.HOST_ID ) ; vfs.add ( vfPciDevice ) ; } return vfs ; }
Source:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ( getVm ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ! ( memoryChecker.evaluate ( vds , getVm ( ) ) ) ) ) { sb.append ( "has insufficient memory to run the VM" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_MEMORY ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ( getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ! ( memoryChecker.evaluate ( vds , getVm ( ) ) ) ) ) { sb.append ( "has insufficient memory to run the VM" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_MEMORY ; } return null ; }
Source:
public void passwordProvidedForHostInstallation ( ) { org.mockito.Mockito.when ( host.getVdsType ( ) ) . thenReturn ( VDSType.VDS ) ; validator = createValidatorForHostInstallation ( ) ; org.junit.Assert.assertThat ( validator.passwordProvidedForHostInstallation ( AuthenticationMethod.Password , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void passwordProvidedForHostInstallation ( ) { validator = createValidatorForHostInstallation ( ) ; org.junit.Assert.assertThat ( validator.passwordProvidedForHostInstallation ( AuthenticationMethod.Password , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateHostIsReadyToRun ( final org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { sb.append ( " VDS " ) . append ( vds.getVdsName ( ) ) . append ( " " ) . append ( vds.getId ( ) ) . append ( " " ) ; for ( org.ovirt.engine.core.bll.VdsSelector.HostValidator validator : this . hostValidators ) { org.ovirt.engine.core.dal.VdcBllMessages result = validator.validate ( vds , sb , isMigrate ) ; if ( result != null ) { return new org.ovirt.engine.core.bll.ValidationResult ( result ) ; } } return ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateHostIsReadyToRun ( final org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { sb.append ( " VDS " ) . append ( vds.getName ( ) ) . append ( " " ) . append ( vds.getId ( ) ) . append ( " " ) ; for ( org.ovirt.engine.core.bll.VdsSelector.HostValidator validator : this . hostValidators ) { org.ovirt.engine.core.dal.VdcBllMessages result = validator.validate ( vds , sb , isMigrate ) ; if ( result != null ) { return new org.ovirt.engine.core.bll.ValidationResult ( result ) ; } } return ValidationResult.VALID ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM initializeMock ( final int domainSizeGB , final int sizeRequired ) { mockVmTemplateDAOReturnVmTemplate ( ) ; mockDiskImageDAOGetSnapshotById ( ) ; mockStorageDomainDAOGetForStoragePool ( domainSizeGB ) ; mockStorageDomainDAOGet ( domainSizeGB ) ; mockGetImageDomainsListVdsCommand ( ) ; mockConfig ( ) ; mockConfigSizeRequirements ( sizeRequired ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.AddVmCommandTest.createVm ( ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM initializeMock ( final int domainSizeGB , final int sizeRequired ) { mockVmTemplateDAOReturnVmTemplate ( ) ; mockDiskImageDAOGetSnapshotById ( ) ; mockStorageDomainDAOGetForStoragePool ( domainSizeGB ) ; mockStorageDomainDAOGet ( domainSizeGB ) ; mockConfig ( ) ; mockConfigSizeRequirements ( sizeRequired ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.AddVmCommandTest.createVm ( ) ; return vm ; }
Source:
public void setClientPolicy ( org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy policy ) { this . policy = policy ; this . validate ( ) ; if ( ! ( isOpen ( ) ) ) { return ; } try ( org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper wrapper = new org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper ( this . lock ) ) { if ( ( isOpen ( ) ) && ( ! ( this . closing.get ( ) ) ) ) { scheduleClose ( "Policy reset" ) ; this . closing.set ( true ) ; } } }

Target:
public void setClientPolicy ( org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy policy ) { this . validate ( policy ) ; this . policy = policy ; }
Source:
private void changeStatus ( org.ovirt.engine.core.common.vdscommands.DestroyVmVDSCommandParameters parameters , org.ovirt.engine.core.common.businessentities.VM curVm ) { if ( org.ovirt.engine.core.vdsbroker.DestroyVmVDSCommand.getVdsId ( ) . equals ( curVm.getRunOnVds ( ) ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . InternalSetVmStatus ( curVm , ( parameters.getGracefully ( ) ? org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown : org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; } }

Target:
private void changeStatus ( org.ovirt.engine.core.common.vdscommands.DestroyVmVDSCommandParameters parameters , org.ovirt.engine.core.common.businessentities.VM curVm ) { if ( org.ovirt.engine.core.vdsbroker.DestroyVmVDSCommand.getParameters ( ) . getVdsId ( ) . equals ( curVm.getRunOnVds ( ) ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . InternalSetVmStatus ( curVm , ( parameters.getGracefully ( ) ? org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown : org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; } }
Source:
public void testLiveSnapshotWhenNoPluggedDiskSnapshot ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . isLiveSnapshotApplicable ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testLiveSnapshotWhenNoPluggedDiskSnapshot ( ) { org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . isLiveSnapshotApplicable ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { sb.append ( org.ovirt.engine.ui.common.widget.table.cell.ImageResourceCell.template.imageContainerWithStyleClass ( style , styleClass , com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( value != null ) { sb.append ( org.ovirt.engine.ui.common.widget.table.cell.ImageResourceCell.template.imageContainerWithStyleClass ( style , styleClass , com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ) ) ; } }
Source:
public java.lang.Object runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.storage_pool_iso_map domainPoolMap = new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( getRecoveryStoragePoolParametersData ( ) . getNewMasterDomainId ( ) , getRecoveryStoragePoolParametersData ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . save ( domainPoolMap ) ; getCompensationContext ( ) . snapshotNewEntity ( domainPoolMap ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage_pool_iso_map runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.storage_pool_iso_map domainPoolMap = new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( getRecoveryStoragePoolParametersData ( ) . getNewMasterDomainId ( ) , getRecoveryStoragePoolParametersData ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . save ( domainPoolMap ) ; return domainPoolMap ; }
Source:
public void testCleanExpiredUsersSessionsNoUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }

Target:
public void testCleanExpiredUsersSessionsNoUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.InitVdsOnUpCommand.getVdsGroup ( ) ; if ( vdsGroup.supportsVirtService ( ) ) { initVirtResources ( ) ; } if ( vdsGroup.supportsGlusterService ( ) ) { initGlusterPeerProcess ( ) ; } org.ovirt.engine.core.bll.InitVdsOnUpCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.InitVdsOnUpCommand.getVdsGroup ( ) ; if ( vdsGroup.supportsVirtService ( ) ) { org.ovirt.engine.core.bll.InitVdsOnUpCommand.setSucceeded ( initVirtResources ( ) ) ; } if ( vdsGroup.supportsGlusterService ( ) ) { org.ovirt.engine.core.bll.InitVdsOnUpCommand.setSucceeded ( initGlusterPeerProcess ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VDS uniteAgentsSingleVds ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList ) { java.util.List < org.ovirt.engine.core.common.businessentities.FenceAgent > agents = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdsList ) { agents.addAll ( vds.getFenceAgents ( ) ) ; } org.ovirt.engine.core.common.businessentities.VDS vds = vdsList.get ( 0 ) ; vds.setFenceAgents ( agents ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS uniteAgentsSingleVds ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList ) { java.util.List < org.ovirt.engine.core.common.businessentities.FenceAgent > agents = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdsList ) { agents.addAll ( vds.getFenceAgents ( ) ) ; } org.ovirt.engine.core.common.businessentities.VDS vds = vdsList.get ( 0 ) ; vds.setFenceAgents ( agents ) ; return vds ; }
Source:
public void setUp ( ) { super . setUp ( ) ; vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( getDiskImageId ( ) , java.lang.Boolean.FALSE ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( cmd ) . getVmDao ( ) ; org.mockito.Mockito.doReturn ( getDiskDao ( ) ) . when ( cmd ) . getDiskDao ( ) ; org.mockito.Mockito.doReturn ( getProviderProxy ( ) ) . when ( cmd ) . getProviderProxy ( ) ; }

Target:
public void setUp ( ) { super . setUp ( ) ; vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( getDiskImageId ( ) , java.lang.Boolean.FALSE ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( cmd ) . getVmDao ( ) ; }