auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > ) ( returnValue ) ) ; clusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterClustersWithoutArchitecture ( clusters ) ; model.setDataCentersAndClusters ( model , dataCenters , clusters , null ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters ) { clusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterClustersWithoutArchitecture ( clusters ) ; getModel ( ) . setDataCentersAndClusters ( getModel ( ) , dataCenters , clusters , null ) ; }
Source:
private void mockJobSubjectEntityDao ( org.ovirt.engine.core.compat.Guid jobId ) { org.mockito.Mockito.when ( jobSubjectEntityDao.getJobSubjectEntityByJobId ( org.mockito.ArgumentMatchers.eq ( jobId ) ) ) . thenReturn ( org.ovirt.engine.core.bll.job.JobRepositoryTest.JOB_SUBJECT_ENTITIES_MAP ) ; org.mockito.Mockito.when ( jobSubjectEntityDao.getJobIdByEntityId ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( jobId ) ) ; }

Target:
private void mockJobSubjectEntityDao ( org.ovirt.engine.core.compat.Guid jobId ) { org.mockito.Mockito.when ( jobSubjectEntityDao.getJobSubjectEntityByJobId ( org.mockito.ArgumentMatchers.eq ( jobId ) ) ) . thenReturn ( org.ovirt.engine.core.bll.job.JobRepositoryTest.JOB_SUBJECT_ENTITIES_MAP ) ; org.mockito.Mockito.when ( jobSubjectEntityDao.getJobIdByEntityId ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( jobId ) ) ; }
Source:
private void mockExistingIfacesWithBond ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifacesToBond ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface [ ] ifaces = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface [ ( ifacesToBond.size ( ) ) + 1 ] ; ifacesToBond.toArray ( ifaces ) ; ifaces [ ( ( ifaces.length ) - 1 ) ] = bond ; mockExistingIfaces ( ifaces ) ; }

Target:
private void mockExistingIfacesWithBond ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifacesToBond ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface [ ] ifaces = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface [ ( ifacesToBond.size ( ) ) + 1 ] ; ifacesToBond.toArray ( ifaces ) ; ifaces [ ( ( ifaces.length ) - 1 ) ] = bond ; mockExistingIfaces ( ifaces ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "IsChangable" . equals ( propName ) ) { passwordSetEditor.setTitle ( ( model.getPasswordSet ( ) . getIsChangable ( ) ? org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.vmInitPasswordSetToolTip ( ) : org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.vmInitPasswordNotSetToolTip ( ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( args != null ) && ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "IsChangable" . equals ( propName ) ) { passwordSetEditor.setTitle ( ( model.getPasswordSet ( ) . getIsChangable ( ) ? org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.vmInitPasswordSetToolTip ( ) : org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.vmInitPasswordNotSetToolTip ( ) ) ) ; } } }
Source:
protected < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 ) { try { return doGetEntity ( clz , query , queryParams , identifier ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }

Target:
public < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 ) { try { return doGetEntity ( clz , query , queryParams , identifier ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }
Source:
private void resetIrs ( ) { if ( ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getspm_vds_id ( ) ) != null ) { org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters tempVar = new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getspm_vds_id ( ) . getValue ( ) ) ; tempVar.setIgnoreStopFailed ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ResetIrs , tempVar ) ; } }

Target:
private void resetIrs ( ) { if ( ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getspm_vds_id ( ) ) != null ) { org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters tempVar = new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getspm_vds_id ( ) ) ; tempVar.setIgnoreStopFailed ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ResetIrs , tempVar ) ; } }
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { setStorageDomain ( null ) ; setStoragePool ( null ) ; if ( canDoAction ( ) ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainPoolMap = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( getRecoveryStoragePoolParametersData ( ) . getNewMasterDomainId ( ) , getRecoveryStoragePoolParametersData ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . save ( domainPoolMap ) ; getStoragePool ( ) . setstatus ( StoragePoolStatus.Problematic ) ; executeReconstruct ( ) ; } return new org.ovirt.engine.core.common.eventqueue.EventResult ( reconstructOpSucceeded , org.ovirt.engine.core.common.eventqueue.EventType.RECONSTRUCT ) ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainPoolMap = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( getRecoveryStoragePoolParametersData ( ) . getNewMasterDomainId ( ) , getRecoveryStoragePoolParametersData ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . save ( domainPoolMap ) ; getStoragePool ( ) . setstatus ( StoragePoolStatus.Problematic ) ; executeReconstruct ( ) ; return new org.ovirt.engine.core.common.eventqueue.EventResult ( reconstructOpSucceeded , org.ovirt.engine.core.common.eventqueue.EventType.RECONSTRUCT ) ; }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters params = new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( getEntityList ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.NetworkLabel model = resource.get ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] , model.getId ( ) ) ; verifyLinks ( model ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( getEntityList ( ) ) ; org.ovirt.engine.api.model.NetworkLabel model = resource.get ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] , model.getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public void testGuestFQDN ( ) { org.ovirt.engine.api.restapi.types.VM vm = new org.ovirt.engine.api.restapi.types.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setVmFQDN ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.Vm map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertNotNull ( map.getFqdn ( ) ) ; assertEquals ( map.getFqdn ( ) , "localhost.localdomain" ) ; }

Target:
public void testGuestFQDN ( ) { org.ovirt.engine.api.restapi.types.VM vm = new org.ovirt.engine.api.restapi.types.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setVmFQDN ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.Vm map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertNotNull ( map.getFqdn ( ) ) ; assertEquals ( "localhost.localdomain" , map.getFqdn ( ) ) ; }
Source:
protected void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVm ( GUIDS [ 1 ] ) ) ; setUpGetConsoleExpectations ( new int [ ] { 0 } ) ; setUpGetSoundcardExpectations ( new int [ ] { 0 } ) ; super . doTestBadAdd ( valid , success , detail ) ; }

Target:
protected void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVm ( GUIDS [ 1 ] ) ) ; setUpGetConsoleExpectations ( 0 ) ; setUpGetSoundcardExpectations ( 0 ) ; super . doTestBadAdd ( valid , success , detail ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > getGlusterVolumes ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus status ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumesList = new java.util.ArrayList < > ( ) ; java.lang.String volumeOptions = "cluster.quorum-type=fixed,cluster.quorum-count=2" ; volumesList.add ( getGlusterVolume ( "Vol-1" , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.VOL_ID_1 , GlusterVolumeType.REPLICATE , 3 , volumeOptions , getBricksForVolume ( 1 ) , status ) ) ; volumesList.add ( getGlusterVolume ( "Vol-2" , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.VOL_ID_2 , GlusterVolumeType.DISTRIBUTED_REPLICATE , 3 , "cluster.quorum-type=auto" , getBricksForVolume ( 2 ) , status ) ) ; return volumesList ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > getGlusterVolumes ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus status ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumesList = new java.util.ArrayList < > ( ) ; java.lang.String volumeOptions = "cluster.quorum-type=fixed,cluster.quorum-count=2" ; volumesList.add ( getGlusterVolume ( "Vol-1" , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.VOL_ID_1 , GlusterVolumeType.REPLICATE , volumeOptions , getBricksForVolume ( 1 ) , status ) ) ; volumesList.add ( getGlusterVolume ( "Vol-2" , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.VOL_ID_2 , GlusterVolumeType.DISTRIBUTED_REPLICATE , "cluster.quorum-type=auto" , getBricksForVolume ( 2 ) , status ) ) ; return volumesList ; }
Source:
public void testListExport ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetDataCenterByStorageDomainExpectations ( GUIDS [ 3 ] , 1 ) ; setUpQueryExpectations ( "" , null , StorageDomainType.ImportExport , true ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }

Target:
public void testListExport ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetDataCenterByStorageDomainExpectations ( GUIDS [ 3 ] , 1 ) ; setUpQueryExpectations ( "" , null , StorageDomainType.ImportExport ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }
Source:
private void validateArgStartsWithDash ( java.lang.String arg ) { org.ovirt.engine.core.config.EngineConfigCLIParser.log.debug ( ( "Validating arrgument" + arg ) ) ; if ( ! ( arg.startsWith ( "-" ) ) ) { org.ovirt.engine.core.config.EngineConfigCLIParser.log.debug ( ( ( "parseAction error: first argument '" + arg ) + "' did not start with '-' or '--'." ) ) ; throw new java.lang.IllegalArgumentException ( "First argument must be an action, and start with '-' or '--'" ) ; } }

Target:
private void validateArgStartsWithDash ( java.lang.String arg ) { if ( ! ( arg.startsWith ( "-" ) ) ) { throw new java.lang.IllegalArgumentException ( "First argument must be an action, and start with '-' or '--'" ) ; } }
Source:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setactive ( true ) ; disk.setvm_guid ( vmId ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( true ) ; }

Target:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setactive ( true ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( true ) ; }
Source:
public static java.util.Collection < java.lang.Object [ ] > namesParams ( ) { return java.util.Arrays.asList ( new java.lang.Object [ ] [ ] { new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , false } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , true } } ) ; }

Target:
public static java.lang.Object [ ] [ ] namesParams ( ) { return new java.lang.Object [ ] [ ] { new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , false } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , true } } ; }
Source:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.AddVmFromScratchCommand.getVdsGroup ( ) ) == null ) && ( Guid.Empty.equals ( super . getStorageDomainId ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.VM_CLUSTER_IS_NOT_VALID ) ; } if ( ! ( org.ovirt.engine.core.bll.ImagesHandler.CheckImagesConfiguration ( getStorageDomainId ( ) . getValue ( ) , org.ovirt.engine.core.bll.AddVmFromScratchCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmFromScratchCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ) ) { return false ; } return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.AddVmFromScratchCommand.getVdsGroup ( ) ) == null ) && ( Guid.Empty.equals ( super . getStorageDomainId ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.VM_CLUSTER_IS_NOT_VALID ) ; } if ( ! ( org.ovirt.engine.core.bll.ImagesHandler.CheckImagesConfiguration ( getStorageDomainId ( ) , org.ovirt.engine.core.bll.AddVmFromScratchCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmFromScratchCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ) ) { return false ; } return super . canDoAction ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createVlan ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.Network net ) { return createVdsInterface ( ( ( ( iface.getName ( ) ) + "." ) + ( net.getvlan_id ( ) ) ) , false , null , null , NetworkBootProtocol.None , net.getName ( ) , net.getvlan_id ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.Network net ) { return createVdsInterface ( ( ( ( iface.getName ( ) ) + "." ) + ( net.getvlan_id ( ) ) ) , false , null , null , NetworkBootProtocol.None , net.getName ( ) , net.getvlan_id ( ) ) ; }
Source:
public void testValidateVmUpHostCapable ( ) { prepareForVmValidatorTests ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void testValidateVmUpHostCapable ( ) { prepareForVmValidatorTests ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
protected org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , org.ovirt.engine.core.common.errors.EngineFault > runConnectionStorageToDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.compat.Guid vdsId , int type ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.storage.connection.GLUSTERFSStorageHelper.getVdsDao ( ) . get ( vdsId ) ; if ( ! ( org.ovirt.engine.core.bll.storage.connection.GLUSTERFSStorageHelper.canVDSConnectToGlusterfs ( vds ) ) ) { org.ovirt.engine.core.bll.storage.connection.GLUSTERFSStorageHelper.log.error ( "Couldn't find glusterfs-cli package on vds (needed for connecting storage domain {})." , vds.getName ( ) , storageDomain.getName ( ) ) ; addMessageToAuditLog ( AuditLogType.VDS_CANNOT_CONNECT_TO_GLUSTERFS , null , vds ) ; return new org.ovirt.engine.core.common.utils.Pair ( false , null ) ; } return super . runConnectionStorageToDomain ( storageDomain , vdsId , type ) ; }

Target:
protected org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , org.ovirt.engine.core.common.errors.EngineFault > runConnectionStorageToDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.compat.Guid vdsId , int type ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.storage.connection.GLUSTERFSStorageHelper.getVdsDao ( ) . get ( vdsId ) ; if ( ! ( canVDSConnectToGlusterfs ( vds ) ) ) { org.ovirt.engine.core.bll.storage.connection.GLUSTERFSStorageHelper.log.error ( "Couldn't find glusterfs-cli package on vds (needed for connecting storage domain {})." , vds.getName ( ) , storageDomain.getName ( ) ) ; addMessageToAuditLog ( AuditLogType.VDS_CANNOT_CONNECT_TO_GLUSTERFS , null , vds ) ; return new org.ovirt.engine.core.common.utils.Pair ( false , null ) ; } return super . runConnectionStorageToDomain ( storageDomain , vdsId , type ) ; }
Source:
public void testAllowRhel6InRhel7 ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 7Server - 1.el7" ) ; vds.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; cluster.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertNotEquals ( vds.getStatus ( ) , VDSStatus.NonOperational ) ; }

Target:
public void testAllowRhel6InRhel7 ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 7Server - 1.el7" ) ; vds.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; cluster.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertNotEquals ( VDSStatus.NonOperational , vds.getStatus ( ) ) ; }
Source:
private void commonTestFlow ( boolean withDummyLun ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVgId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VG_ID ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VDS_ID ) ; expectGetLunsForVg ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VG_ID , withDummyLun ) ; expectGetDeviceList ( ) ; expectGetLunsMap ( storageServerConnectionLunMapDao ) ; expectGetConnections ( storageServerConnectionDao ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; checkReturnValue ( getQuery ( ) ) ; }

Target:
private void commonTestFlow ( boolean withDummyLun ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVgId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VG_ID ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VDS_ID ) ; expectGetLunsForVg ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.VG_ID , withDummyLun ) ; expectGetDeviceList ( ) ; expectGetLunsMap ( ) ; expectGetConnections ( ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; checkReturnValue ( getQuery ( ) ) ; }
Source:
public static boolean isAuthenticated ( javax.servlet.http.HttpServletRequest request ) { javax.servlet.http.HttpSession session = request.getSession ( false ) ; return ( session != null ) && ( ( session.getAttribute ( SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY ) ) != null ) ; }

Target:
public static boolean isAuthenticated ( javax.servlet.http.HttpServletRequest request ) { return ( ( ( request.getSession ( false ) ) != null ) && ( ( request.getSession ( false ) . getAttribute ( SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY ) ) != null ) ) || ( ( request.getAttribute ( SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY ) ) != null ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDAO ( ) . get ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetwork ( ) . getId ( ) ) ) ; return ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notManagementNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.Network getNetwork ( ) { if ( ( network ) == null ) { network = org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDAO ( ) . get ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getParameters ( ) . getId ( ) ) ; } return network ; }
Source:
public void createCommand ( ) { org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter param = new org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter ( getExistingVdsGroupId ( ) , getNetwork ( ) ) ; command = new org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand < org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter > ( param ) { @ java.lang.Override public org.ovirt.engine.core.dao.VdsGroupDAO getVdsGroupDAO ( ) { return vdsGroupDAO ; } @ java.lang.Override protected org.ovirt.engine.core.dao.network.NetworkClusterDao getNetworkClusterDAO ( ) { return networkClusterDAO ; } @ java.lang.Override protected org.ovirt.engine.core.dao.network.NetworkDao getNetworkDAO ( ) { return networkDao ; } } ; }

Target:
public void createCommand ( ) { param = new org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter ( getExistingVdsGroupId ( ) , getNetwork ( ) ) ; command = new org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand < org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter > ( param ) { @ java.lang.Override public org.ovirt.engine.core.dao.VdsGroupDAO getVdsGroupDAO ( ) { return vdsGroupDAO ; } @ java.lang.Override protected org.ovirt.engine.core.dao.network.NetworkClusterDao getNetworkClusterDAO ( ) { return networkClusterDAO ; } @ java.lang.Override protected org.ovirt.engine.core.dao.network.NetworkDao getNetworkDAO ( ) { return networkDao ; } } ; }
Source:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.Guid poolId , java.util.ArrayList < java.lang.String > messages ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . getAllForVmPool ( poolId ) ; int numOfPrestartedVmsInPool = 0 ; if ( vmsInPool != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsInPool ) { if ( ( vm.isStartingOrUp ( ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( vm.getId ( ) , messages ) ) ) ++ numOfPrestartedVmsInPool ; } } return numOfPrestartedVmsInPool ; }

Target:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.Guid poolId , java.util.ArrayList < java.lang.String > messages ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . getAllForVmPool ( poolId ) ; int numOfPrestartedVmsInPool = 0 ; if ( vmsInPool != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsInPool ) { if ( ( vm.isStartingOrUp ( ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( vm.getId ( ) , messages ) ) ) { ++ numOfPrestartedVmsInPool ; } } } return numOfPrestartedVmsInPool ; }
Source:
private org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.NGuid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDAO ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.Guid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDAO ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public void testAddIncompleteParameters_noName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { ( ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResource ) ( collection ) ) . add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "name" ) ; } }

Target:
public void testAddIncompleteParameters_noName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "name" ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.Object > parameters ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > list = new java.util.ArrayList < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { list.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > ( host.getId ( ) , 1 ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { return super . score ( hosts , vm , parameters ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Watchdog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { org.ovirt.engine.core.common.action.WatchdogParameters parameters = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; parameters.setAction ( org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( org.ovirt.engine.api.model.WatchdogAction.fromValue ( model.getAction ( ) ) ) ) ; parameters.setModel ( org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( org.ovirt.engine.api.model.WatchdogModel.fromValue ( model.getModel ( ) ) ) ) ; parameters.setId ( instanceTypeId ) ; parameters.setVm ( false ) ; return parameters ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Watchdog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { org.ovirt.engine.core.common.action.WatchdogParameters parameters = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; parameters.setAction ( org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model.getAction ( ) ) ) ; parameters.setModel ( org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model.getModel ( ) ) ) ; parameters.setId ( instanceTypeId ) ; parameters.setVm ( false ) ; return parameters ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; dataCenterGuideModel.isoStorageDomains = storageDomains ; dataCenterGuideModel.UpdateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; dataCenterGuideModel.isoStorageDomains = storageDomains ; dataCenterGuideModel.UpdateOptionsNonLocalFS ( ) ; }
Source:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int duplicateEventsIntrvalValue = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getDuplicateEventsIntervalValue ( ) ; if ( duplicateEventsIntrvalValue > 0 ) { auditLogable.setEndTime ( ( ( java.lang.System.currentTimeMillis ( ) ) + ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( duplicateEventsIntrvalValue ) ) ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }

Target:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int duplicateEventsIntrvalValue = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getDuplicateEventsIntervalValue ( ) ; if ( duplicateEventsIntrvalValue > 0 ) { auditLogable.setEndTime ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( duplicateEventsIntrvalValue ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }
Source:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . update ( foremanTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( consoleTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) . visibleInAdvancedModeOnly ( ) ) . putOne ( baseTemplateEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( consoleTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) . visibleInAdvancedModeOnly ( ) ) . putOne ( baseTemplateEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > getConfigByVolumeId ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > configs = getCallsHandler ( ) . executeReadList ( "GetGlusterVolumeSnapshotConfigByVolumeId" , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoImpl.snapshotConfigRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , clusterId ) . addValue ( "volume_id" , volumeId ) ) ; return configs ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > getConfigByVolumeId ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { return getCallsHandler ( ) . executeReadList ( "GetGlusterVolumeSnapshotConfigByVolumeId" , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoImpl.snapshotConfigRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , clusterId ) . addValue ( "volume_id" , volumeId ) ) ; }
Source:
public void poll ( ) { if ( vdsManager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = getVmsFetcher ( ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( ) . perform ( fetcher.getChangedVms ( ) , fetchTime ) ; processDevices ( fetcher.getVdsmVms ( ) . stream ( ) . map ( VmInternalData :: getVmDynamic ) , fetchTime ) ; } else { org.ovirt.engine.core.vdsbroker.PollVmStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , vdsManager.getVdsName ( ) ) ; } } }

Target:
public void poll ( ) { if ( vdsManager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = getVmsFetcher ( ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( ) . perform ( fetcher.getChangedVms ( ) , fetchTime , vdsManager ) ; processDevices ( fetcher.getVdsmVms ( ) . stream ( ) . map ( VmInternalData :: getVmDynamic ) , fetchTime ) ; } else { org.ovirt.engine.core.vdsbroker.PollVmStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , vdsManager.getVdsName ( ) ) ; } } }
Source:
public static void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap ) { try { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addDisk ( image ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }

Target:
public void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap ) { try { addImage ( image , active , imageStorageDomainMap ) ; addDisk ( image ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }
Source:
protected boolean canDoAction ( ) { super . canDoAction ( ) ; addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__ACTIVATE ) ; boolean returnValue = ( ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStoragePool ( ) ) && ( CheckStoragePoolStatusNotEqual ( StoragePoolStatus.Uninitialized , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ) ) && ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.CheckStorageDomain ( ) ) ) && ( storageDomainStatusIsValid ( ) ) ) && ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) || ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.CheckMasterDomainIsUp ( ) ) ) ; return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.checkStoragePool ( ) ) && ( CheckStoragePoolStatusNotEqual ( StoragePoolStatus.Uninitialized , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ) ) && ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.CheckStorageDomain ( ) ) ) && ( storageDomainStatusIsValid ( ) ) ) && ( ( ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) || ( org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand.CheckMasterDomainIsUp ( ) ) ) ; return returnValue ; }
Source:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( networkDao ) . when ( cmd ) . getNetworkDao ( ) ; org.mockito.Mockito.doReturn ( interfaceDao ) . when ( cmd ) . getInterfaceDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . get ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.serverId ) ; org.mockito.Mockito.doReturn ( getCluster ( true ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( interfaceDao ) . when ( cmd ) . getInterfaceDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . get ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.serverId ) ; org.mockito.Mockito.doReturn ( getCluster ( true ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectHostNetworkDataVdsCommandParameters ( getVds ( ) , getParameters ( ) . getInterfaces ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }

Target:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectHostNetworkDataVdsCommandParameters ( getVds ( ) , getInterfaces ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }
Source:
public void createStatusForVds ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus newVdsKdumpStatus = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; newVdsKdumpStatus.setVdsId ( FixturesTool.HOST_WITH_NO_VFS_CONFIGS_ID ) ; newVdsKdumpStatus.setStatus ( KdumpFlowStatus.DUMPING ) ; newVdsKdumpStatus.setAddress ( "[\"192.168.122.16\", 1111]" ) ; dbFacade.getVdsKdumpStatusDao ( ) . update ( newVdsKdumpStatus ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dbFacade.getVdsKdumpStatusDao ( ) . get ( newVdsKdumpStatus.getVdsId ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( newVdsKdumpStatus , found ) ; }

Target:
public void createStatusForVds ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus newVdsKdumpStatus = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; newVdsKdumpStatus.setVdsId ( FixturesTool.HOST_WITH_NO_VFS_CONFIGS_ID ) ; newVdsKdumpStatus.setStatus ( KdumpFlowStatus.DUMPING ) ; newVdsKdumpStatus.setAddress ( "[\"192.168.122.16\", 1111]" ) ; dao.update ( newVdsKdumpStatus ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dao.get ( newVdsKdumpStatus.getVdsId ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( newVdsKdumpStatus , found ) ; }