auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setupMock ( ) throws java.lang.Exception { commandMock = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ClearExternalJobCommand ( parameters , null ) ) ; org.mockito.Mockito.when ( commandMock.getParameters ( ) ) . thenReturn ( parameters ) ; org.mockito.Mockito.doReturn ( jobDaoMock ) . when ( commandMock ) . getJobDao ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.ClearExternalJobCommandTest.jobId ) ) . thenReturn ( makeTestJob ( org.ovirt.engine.core.bll.ClearExternalJobCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.ClearExternalJobCommandTest.nonExistingJobId ) ) . thenReturn ( null ) ; }

Target:
private void setupMock ( ) throws java.lang.Exception { commandMock = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ClearExternalJobCommand ( parameters , null ) ) ; org.mockito.Mockito.when ( commandMock.getParameters ( ) ) . thenReturn ( parameters ) ; org.mockito.Mockito.doReturn ( jobDaoMock ) . when ( commandMock ) . getJobDao ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.ClearExternalJobCommandTest.jobId ) ) . thenReturn ( makeTestJob ( org.ovirt.engine.core.bll.ClearExternalJobCommandTest.jobId ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createPosixConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , java.lang.String vfsType , java.lang.String mountOptions ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setVfsType ( vfsType ) ; connectionDetails.setMountOptions ( mountOptions ) ; return connectionDetails ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createPosixConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , java.lang.String vfsType , java.lang.String mountOptions ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( connection , type ) ; connectionDetails.setVfsType ( vfsType ) ; connectionDetails.setMountOptions ( mountOptions ) ; return connectionDetails ; }
Source:
public void storageDomain ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; b.setStorageDomain ( s ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain st = b.getStorageDomain ( ) ; org.junit.Assert.assertEquals ( s , st ) ; }

Target:
public void storageDomain ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; b.setStorageDomain ( s ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain st = b.getStorageDomain ( ) ; org.junit.Assert.assertEquals ( s , st ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterClustersWithoutArchitecture ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ) ; model.getCluster ( ) . setItems ( clusters ) ; model.getCluster ( ) . setIsEmpty ( clusters.isEmpty ( ) ) ; model.updateControlsAvailability ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterClustersWithoutArchitecture ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ) ; model.getCluster ( ) . setItems ( clusters ) ; model.getCluster ( ) . setIsEmpty ( clusters.isEmpty ( ) ) ; model.updateControlsAvailability ( ) ; stopProgress ( ) ; }
Source:
private boolean isDomainExistsInDiskDescription ( java.util.Map < java.lang.String , java.lang.Object > map , org.ovirt.engine.core.compat.Guid storageDomainId ) { return map.get ( OvfInfoFileConstants.Domains ) . toString ( ) . contains ( storageDomainId.toString ( ) ) ; }

Target:
private boolean isDomainExistsInDiskDescription ( java.util.Map < java.lang.String , java.lang.Object > map , org.ovirt.engine.core.compat.Guid storageDomainId ) { if ( ( map.get ( OvfInfoFileConstants.Domains ) ) == null ) { return false ; } return map.get ( OvfInfoFileConstants.Domains ) . toString ( ) . contains ( storageDomainId.toString ( ) ) ; }
Source:
public void validateFailsOnServerNotUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForAdd ( VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP.toString ( ) ) ) ; }

Target:
public void validateFailsOnServerNotUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; setUpMocksForAdd ( VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP.toString ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.Cluster createCluster ( int index ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setCompatibilityVersion ( Version.v3_2 ) ; return cluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.Cluster createCluster ( int index ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; return cluster ; }
Source:
public void diskInterfaceSupportedByOs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; initializeOsRepository ( vm.getOs ( ) , DiskInterface.VirtIO ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; org.junit.Assert.assertThat ( validator.isDiskInterfaceSupported ( vm , dve ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void diskInterfaceSupportedByOs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; initializeOsRepository ( DiskInterface.VirtIO ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; org.junit.Assert.assertThat ( validator.isDiskInterfaceSupported ( vm , dve ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private static void addImportedDiskDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToUpdate ) { final org.ovirt.engine.core.compat.Guid vmId = vmBase.getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk : org.ovirt.engine.core.bll.utils.VmDeviceUtils.getDisks ( vmBase.getImages ( ) ) ) { org.ovirt.engine.core.compat.Guid deviceId = disk.getId ( ) ; org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addDiskDevice ( vmId , deviceId , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getVmDeviceAddress ( vmBase , vmId ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateImportedVmDevice ( vmBase , vmDevice , deviceId , vmDevicesToUpdate ) ; } }

Target:
private void addImportedDiskDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToUpdate ) { final org.ovirt.engine.core.compat.Guid vmId = vmBase.getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk : getDisks ( vmBase.getImages ( ) ) ) { org.ovirt.engine.core.compat.Guid deviceId = disk.getId ( ) ; org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = addDiskDevice ( vmId , deviceId , getVmDeviceAddress ( vmBase , vmId ) ) ; updateImportedVmDevice ( vmBase , vmDevice , deviceId , vmDevicesToUpdate ) ; } }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , 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 ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , 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 ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmDevice generateNewEntity ( ) { java.util.Map < java.lang.String , java.lang.String > customProp = new java.util.LinkedHashMap < > ( ) ; customProp.put ( "prop1" , "value1" ) ; return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.dao.VmDeviceDAOTest.EXISTING_VM_ID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , "floppy" , "type:'drive', controller:'0', bus:'0', unit:'1'" , 2 , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , false , false , "alias" , customProp ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDevice generateNewEntity ( ) { java.util.Map < java.lang.String , java.lang.String > customProp = new java.util.LinkedHashMap < > ( ) ; customProp.put ( "prop1" , "value1" ) ; return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.dao.VmDeviceDAOTest.EXISTING_VM_ID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , "floppy" , "type:'drive', controller:'0', bus:'0', unit:'1'" , 2 , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , false , false , "alias" , customProp , null ) ; }
Source:
private java.lang.Integer getWarningLowSpaceSize ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel ) { if ( ! ( storageModel.isNewStorage ( ) ) ) { java.lang.Integer percentageValue = warningLowSpaceIndicatorEditor.asValueBox ( ) . getValue ( ) ; return percentageValue == null ? 0 : ( ( storageModel.getStorage ( ) . getTotalDiskSize ( ) ) * percentageValue ) / 100 ; } return 0 ; }

Target:
private java.lang.Integer getWarningLowSpaceSize ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel ) { java.lang.Integer percentageValue = warningLowSpaceIndicatorEditor.asValueBox ( ) . getValue ( ) ; return percentageValue == null ? 0 : ( ( storageModel.getStorage ( ) . getTotalDiskSize ( ) ) * percentageValue ) / 100 ; }
Source:
private org.ovirt.engine.core.vdsbroker.monitoring.VmStatsRefresher getRefresherForVds ( org.ovirt.engine.core.vdsbroker.VdsManager vdsManager ) { org.ovirt.engine.core.compat.Version version = vdsManager.getCompatibilityVersion ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = vdsManager.getCopyVds ( ) ; if ( ( ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ) == ( vds.getProtocol ( ) ) ) && ( org.ovirt.engine.core.common.FeatureSupported.vmStatsEvents ( version ) ) ) && ( org.ovirt.engine.core.common.FeatureSupported.events ( version ) ) ) { return new org.ovirt.engine.core.vdsbroker.monitoring.EventVmStatsRefresher ( vdsManager ) ; } return new org.ovirt.engine.core.vdsbroker.monitoring.PollListAndAllVmStatsRefresher ( vdsManager ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.monitoring.VmStatsRefresher getRefresherForVds ( org.ovirt.engine.core.vdsbroker.VdsManager vdsManager ) { org.ovirt.engine.core.common.businessentities.VDS vds = vdsManager.getCopyVds ( ) ; if ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ) == ( vds.getProtocol ( ) ) ) { return new org.ovirt.engine.core.vdsbroker.monitoring.EventVmStatsRefresher ( vdsManager ) ; } return new org.ovirt.engine.core.vdsbroker.monitoring.PollListAndAllVmStatsRefresher ( vdsManager ) ; }
Source:
private void mockBackend ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.RemoveGlusterHook ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters.class ) ) ) . thenReturn ( vdsReturnValue ) ; }

Target:
private void mockBackend ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.RemoveGlusterHook ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vdsReturnValue ) ; }
Source:
protected boolean detachStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom ) { org.ovirt.engine.core.compat.Guid domId = dom.getId ( ) ; org.ovirt.engine.core.compat.Guid poolId = dom.getstorage_pool_id ( ) . getValue ( ) ; org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters params = new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( domId , poolId ) ; params.setDestroyingPool ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getParameters ( ) . getDestroyingPool ( ) ) ; return org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.DetachStorageDomainFromPool , params ) . getSucceeded ( ) ; }

Target:
protected boolean detachStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom ) { org.ovirt.engine.core.compat.Guid domId = dom.getId ( ) ; org.ovirt.engine.core.compat.Guid poolId = dom.getStoragePoolId ( ) . getValue ( ) ; org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters params = new org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters ( domId , poolId ) ; params.setDestroyingPool ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getParameters ( ) . getDestroyingPool ( ) ) ; return org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getBackend ( ) . runInternalAction ( VdcActionType.DetachStorageDomainFromPool , params ) . getSucceeded ( ) ; }
Source:
public void validateSuccess ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateSuccess ( ) { org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private void containerChanged ( ) { if ( ( getContainer ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenter = getContainer ( ) . getDataCenter ( ) ; dataCenter.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { containerDataCenterChanged ( ) ; } } ) ; if ( ( dataCenter.getSelectedItem ( ) ) != null ) { containerDataCenterChanged ( ) ; } }

Target:
private void containerChanged ( ) { if ( ( getContainer ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenter = getContainer ( ) . getDataCenter ( ) ; dataCenter.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { containerDataCenterChanged ( ) ; } } ) ; if ( ( dataCenter.getSelectedItem ( ) ) != null ) { containerDataCenterChanged ( ) ; } }
Source:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( getQuery ( ) ) . getGlusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( CLUSTER_ID ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }

Target:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( CLUSTER_ID ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }
Source:
public void testList ( ) throws java.lang.Exception { int numOfEntitiesInList = 2 ; setUpGetEntityExpectations ( VdcQueryType.GetStorageServerConnectionExtensionsByHostId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionsResourceTest.hostID } , getEntityList ( numOfEntitiesInList ) ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; control.replay ( ) ; java.util.List < org.ovirt.engine.api.model.StorageConnectionExtension > retCollection = getCollection ( ) ; assertNotNull ( retCollection ) ; assertEquals ( numOfEntitiesInList , retCollection.size ( ) ) ; }

Target:
public void testList ( ) throws java.lang.Exception { int numOfEntitiesInList = 2 ; setUpGetEntityExpectations ( VdcQueryType.GetStorageServerConnectionExtensionsByHostId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionsResourceTest.hostID } , getEntityList ( numOfEntitiesInList ) ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.StorageConnectionExtension > retCollection = getCollection ( ) ; assertNotNull ( retCollection ) ; assertEquals ( numOfEntitiesInList , retCollection.size ( ) ) ; }
Source:
private void saveToDb ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { org.ovirt.engine.core.common.AuditLogSeverity severity = logType.getSeverity ( ) ; org.ovirt.engine.core.common.businessentities.AuditLog auditLog = createAuditLog ( auditLogable , logType , loggerString , severity ) ; if ( auditLog == null ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warn ( "Unable to create AuditLog" ) ; } else { setPropertiesFromAuditLogableBase ( auditLogable , auditLog ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getDbFacadeInstance ( ) . getAuditLogDao ( ) . save ( auditLog ) ; logMessage ( severity , getMessageToLog ( loggerString , auditLog ) ) ; } }

Target:
private void saveToDb ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { org.ovirt.engine.core.common.AuditLogSeverity severity = logType.getSeverity ( ) ; org.ovirt.engine.core.common.businessentities.AuditLog auditLog = createAuditLog ( auditLogable , logType , loggerString , severity ) ; if ( auditLog == null ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warn ( "Unable to create AuditLog" ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.setPropertiesFromAuditLogableBase ( auditLogable , auditLog ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getDbFacadeInstance ( ) . getAuditLogDao ( ) . save ( auditLog ) ; logMessage ( severity , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessageToLog ( loggerString , auditLog ) ) ; } }
Source:
public void run ( ) { try { waitForTasksToBeCleared ( ) ; executeDeactivateCommnad ( false ) ; ctx.resetCompensation ( ) ; } catch ( java.lang.Exception e ) { setSucceeded ( false ) ; log.error ( "Error when attempting to deactivate storage domain {}" , getStorageDomainId ( ) , e ) ; compensate ( ) ; } }

Target:
public void run ( ) { try { waitForTasksToBeCleared ( ) ; executeDeactivateCommnad ( false ) ; ctx.resetCompensation ( ) ; } catch ( java.lang.Exception e ) { log.error ( "Error when attempting to deactivate storage domain {}" , getStorageDomainId ( ) , e ) ; compensate ( ) ; } }
Source:
private void updateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) . getValue ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vmDynamicData ) ; } }

Target:
private void updateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vmDynamicData ) ; } }
Source:
private void updateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vmDynamicData ) ; } }

Target:
private void updateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( vmDynamicData ) ; } }
Source:
public org.ovirt.engine.api.model.Files list ( ) { if ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( getEntity ( org.ovirt.engine.api.model.StorageDomain.class , VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( asGuid ( storageDomainId ) ) , "storage_domain" ) ) ) { return mapCollection ( listFiles ( ) ) ; } else { return notFound ( org.ovirt.engine.api.model.Files.class ) ; } }

Target:
public org.ovirt.engine.api.model.Files list ( ) { if ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( getEntity ( org.ovirt.engine.api.model.StorageDomain.class , VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( storageDomainId ) ) , "storage_domain" ) ) ) { return mapCollection ( listFiles ( ) ) ; } else { return notFound ( org.ovirt.engine.api.model.Files.class ) ; } }
Source:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImageList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; diskImageList.add ( diskImage ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( spyCommand ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }

Target:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImageList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; diskImageList.add ( diskImage ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }
Source:
private void initDiskStorageDomain ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.Boolean sdSupportsDiscard , java.lang.Boolean sdSupportsDiscardZeroesData ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setStorageName ( org.ovirt.engine.core.bll.validator.storage.DiskVmElementDiscardSupportValidatorTest.storageDomainName ) ; storageDomain.setStorageType ( storageType ) ; storageDomain.setSupportsDiscard ( sdSupportsDiscard ) ; storageDomain.setSupportsDiscardZeroesData ( sdSupportsDiscardZeroesData ) ; storageDomainId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; storageDomain.setId ( storageDomainId ) ; org.mockito.MockitoAnnotations.initMocks ( this ) ; org.ovirt.engine.core.bll.validator.storage.DiskVmElementDiscardSupportValidatorTest.injectorRule.bind ( org.ovirt.engine.core.dao.StorageDomainDao.class , storageDomainDao ) ; org.mockito.Mockito.when ( storageDomainDao.get ( storageDomainId ) ) . thenReturn ( storageDomain ) ; }

Target:
private void initDiskStorageDomain ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.Boolean sdSupportsDiscard ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setStorageName ( org.ovirt.engine.core.bll.validator.storage.DiskVmElementDiscardSupportValidatorTest.storageDomainName ) ; storageDomain.setStorageType ( storageType ) ; storageDomain.setSupportsDiscard ( sdSupportsDiscard ) ; storageDomainId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; storageDomain.setId ( storageDomainId ) ; org.mockito.MockitoAnnotations.initMocks ( this ) ; org.ovirt.engine.core.bll.validator.storage.DiskVmElementDiscardSupportValidatorTest.injectorRule.bind ( org.ovirt.engine.core.dao.StorageDomainDao.class , storageDomainDao ) ; org.mockito.Mockito.when ( storageDomainDao.get ( storageDomainId ) ) . thenReturn ( storageDomain ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VdsDynamic generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic newDynamicVds = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; newDynamicVds.setId ( FixturesTool.VDS_JUST_STATIC_ID ) ; newDynamicVds.setUpdateAvailable ( true ) ; newDynamicVds.setReportedDnsResolverConfiguration ( new org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration ( ) ) ; newDynamicVds.getReportedDnsResolverConfiguration ( ) . setNameServers ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ) ; return newDynamicVds ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VdsDynamic generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic newDynamicVds = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; newDynamicVds.setId ( FixturesTool.VDS_JUST_STATIC_ID ) ; newDynamicVds.setUpdateAvailable ( true ) ; return newDynamicVds ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( ( ( p.getUsageCpuPercent ( ) ) + ( calcSpmCpuConsumption ( p ) ) ) >= highUtilization ) && ( ( p.getCpuOverCommitTimestamp ( ) ) != null ) ) && ( ( ( new java.util.Date ( ) . getTime ( ) ) - ( p.getCpuOverCommitTimestamp ( ) . getTime ( ) ) ) >= ( java.util.concurrent.TimeUnit.MINUTES.toMillis ( cpuOverCommitDurationMinutes ) ) ) ) && ( ( p.getVmCount ( ) ) > 0 ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( ( ( p.getUsageCpuPercent ( ) ) + ( calcSpmCpuConsumption ( p ) ) ) >= highUtilization ) && ( ( p.getCpuOverCommitTimestamp ( ) ) != null ) ) && ( ( ( getTime ( ) . getTime ( ) ) - ( p.getCpuOverCommitTimestamp ( ) . getTime ( ) ) ) >= ( java.util.concurrent.TimeUnit.MINUTES.toMillis ( cpuOverCommitDurationMinutes ) ) ) ) && ( ( p.getVmCount ( ) ) > 0 ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.RoleGroupMapId other = ( ( org.ovirt.engine.core.common.businessentities.RoleGroupMapId ) ( obj ) ) ; return ( java.util.Objects.equals ( actionGroup , other.actionGroup ) ) && ( java.util.Objects.equals ( roleId , other.roleId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.RoleGroupMapId ) ) { return false ; } org.ovirt.engine.core.common.businessentities.RoleGroupMapId other = ( ( org.ovirt.engine.core.common.businessentities.RoleGroupMapId ) ( obj ) ) ; return ( java.util.Objects.equals ( actionGroup , other.actionGroup ) ) && ( java.util.Objects.equals ( roleId , other.roleId ) ) ; }
Source:
protected void executeCommand ( ) { AddCustomValue ( "InterfaceType" , org.ovirt.engine.core.common.businessentities.VmInterfaceType.forValue ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) . getType ( ) ) . getDescription ( ) . toString ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . update ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) ) ; org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { AddCustomValue ( "InterfaceType" , org.ovirt.engine.core.common.businessentities.VmInterfaceType.forValue ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) . getType ( ) ) . getDescription ( ) . toString ( ) ) ; org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getVmNetworkInterfaceDao ( ) . update ( org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) ) ; org.ovirt.engine.core.bll.UpdateVmTemplateInterfaceCommand.setSucceeded ( true ) ; }
Source:
private void setupMock ( ) { expected = getExpectedHooksList ( ) ; emptyList = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.GetGlusterHooksQueryTest.CLUSTER_ID ) . when ( getQueryParameters ( ) ) . getClusterId ( ) ; glusterHookDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.gluster.GlusterHooksDao.class ) ; org.mockito.Mockito.doReturn ( glusterHookDaoMock ) . when ( getQuery ( ) ) . getGlusterHookDao ( ) ; }

Target:
private void setupMock ( ) { expected = getExpectedHooksList ( ) ; emptyList = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.GetGlusterHooksQueryTest.CLUSTER_ID ) . when ( getQueryParameters ( ) ) . getClusterId ( ) ; }
Source:
private void initNetworkModels ( ) { java.util.Map < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networkModels = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Network network : allNetworks ) { netTodcParams.put ( network.getname ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.DcNetworkParams ( network ) ) ; networkModels.put ( network.getname ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ( network , this ) ) ; } setNetworks ( networkModels ) ; }

Target:
private void initNetworkModels ( ) { java.util.Map < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networkModels = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Network network : allNetworks ) { networkModels.put ( network.getname ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ( network , this ) ) ; } setNetworks ( networkModels ) ; }
Source:
private static org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion computeTemplateWithVersionToSelect ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion > newItems , org.ovirt.engine.core.compat.Guid previousTemplateId , boolean useLatest , boolean addLatest ) { if ( previousTemplateId == null ) { return org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems , addLatest ) ; } org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion oldTemplateToSelect = org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.TemplateWithVersionPredicate ( previousTemplateId , useLatest ) ) ; return oldTemplateToSelect != null ? oldTemplateToSelect : org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems , addLatest ) ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion computeTemplateWithVersionToSelect ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion > newItems , org.ovirt.engine.core.compat.Guid previousTemplateId , boolean useLatest , boolean addLatest ) { if ( previousTemplateId == null ) { return org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems , addLatest ) ; } org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion oldTemplateToSelect = org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.TemplateWithVersionPredicate ( previousTemplateId , useLatest ) ) ; return oldTemplateToSelect != null ? oldTemplateToSelect : org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems , addLatest ) ; }
Source:
void registerModelEventListeners ( final org.ovirt.engine.ui.common.uicommon.model.ModelProvider < ? extends org.ovirt.engine.ui.uicommonweb.models.EntityModel > modelProvider ) { modelProvider.getModel ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "IsAvailable" . equals ( pcArgs.propertyName ) ) { boolean isAvailable = modelProvider.getModel ( ) . getIsAvailable ( ) ; setAccessible ( isAvailable ) ; } } } ) ; }

Target:
void registerModelEventListeners ( final org.ovirt.engine.ui.common.uicommon.model.ModelProvider < ? extends org.ovirt.engine.ui.uicommonweb.models.EntityModel > modelProvider ) { modelProvider.getModel ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = args ; if ( "IsAvailable" . equals ( pcArgs.propertyName ) ) { boolean isAvailable = modelProvider.getModel ( ) . getIsAvailable ( ) ; setAccessible ( isAvailable ) ; } } } ) ; }
Source:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getSingleBrickVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getMultiBrickVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontend ) . when ( cmd ) . getVdsBroker ( ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getSingleBrickVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getMultiBrickVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; clusterGuideModel.allHosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.updateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.allHosts = hosts ; clusterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
public org.ovirt.engine.core.aaa.DirectoryUser findUser ( org.ovirt.engine.core.common.utils.ExternalId id ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserId , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByIdParameters ( getProfileName ( ) , id ) ) ; org.ovirt.engine.core.common.businessentities.LdapUser ldapUser = ( ( org.ovirt.engine.core.common.businessentities.LdapUser ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUser ( ldapUser ) ; }

Target:
public org.ovirt.engine.core.aaa.DirectoryUser findUser ( org.ovirt.engine.core.common.utils.ExternalId id ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserId , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByIdParameters ( getName ( ) , id ) ) ; org.ovirt.engine.core.common.businessentities.LdapUser ldapUser = ( ( org.ovirt.engine.core.common.businessentities.LdapUser ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUser ( ldapUser ) ; }
Source:
private void generateNewDiskId ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskList , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.compat.Guid newGuidForDisk = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; newDiskIdForDisk.put ( newGuidForDisk , org.ovirt.engine.core.common.businessentities.DiskImage.copyOf ( disk ) ) ; disk.setId ( newGuidForDisk ) ; disk.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; for ( int i = 0 ; i < ( ( diskList.size ( ) ) - 1 ) ; i ++ ) { diskList.get ( i ) . setId ( disk.getId ( ) ) ; } }

Target:
private void generateNewDiskId ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskList , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.compat.Guid newGuidForDisk = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; newDiskIdForDisk.put ( newGuidForDisk , org.ovirt.engine.core.common.businessentities.DiskImage.copyOf ( disk ) ) ; disk.setId ( newGuidForDisk ) ; disk.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskList ) { diskImage.setId ( disk.getId ( ) ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.stopProgress ( ) ; boolean isAllValidatePassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllValidatePassed = returnValueBase.isValid ( ) ; if ( ! isAllValidatePassed ) { break ; } } if ( isAllValidatePassed ) { cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.stopProgress ( ) ; boolean isAllValidatePassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllValidatePassed = isAllValidatePassed && ( returnValueBase.isValid ( ) ) ; if ( ! isAllValidatePassed ) { break ; } } if ( isAllValidatePassed ) { cancel ( ) ; } }