auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void validateFailsUnSupportedVersionForDiscardAfterDelete ( ) { org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISCARD_AFTER_DELETE_NOT_SUPPORTED_BY_DC_VERSION ; org.mockito.Mockito.when ( storageDomainValidator.isDiscardAfterDeleteSupportedByDcVersion ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( message ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , message ) ; }

Target:
public void validateFailsUnSupportedVersionForDiscardAfterDelete ( ) { org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISCARD_AFTER_DELETE_NOT_SUPPORTED_BY_DC_VERSION ; org.mockito.Mockito.when ( storageDomainValidator.isDiscardAfterDeleteSupportedByDcVersion ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( message ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , message ) ; }
Source:
protected javax.ws.rs.core.Response createDisk ( org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource resource , org.ovirt.engine.api.model.DiskAttachment attachment , org.ovirt.engine.api.restapi.resource.IResolver entityResolver ) { org.ovirt.engine.api.model.Disk disk = attachment.getDisk ( ) ; validateDiskForCreation ( disk ) ; updateStorageTypeForDisk ( disk ) ; return resource.performCreate ( VdcActionType.AddDisk , getAddParameters ( attachment , new org.ovirt.engine.api.restapi.types.DiskMapper ( ) . map ( disk , null ) , disk ) , entityResolver ) ; }

Target:
protected javax.ws.rs.core.Response createDisk ( org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource resource , org.ovirt.engine.api.model.DiskAttachment attachment , org.ovirt.engine.api.restapi.resource.IResolver entityResolver ) { org.ovirt.engine.api.model.Disk disk = attachment.getDisk ( ) ; validateDiskForCreation ( disk ) ; updateStorageTypeForDisk ( disk ) ; return resource.performCreate ( VdcActionType.AddDisk , getAddParameters ( attachment , org.ovirt.engine.api.restapi.types.DiskMapper.map ( disk , null ) , disk ) , entityResolver ) ; }
Source:
protected void initProviderList ( ) { startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getAllNetworkProviders ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; } } ) ) ; }

Target:
protected void initProviderList ( ) { startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllNetworkProviders ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; } } ) ) ; }
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 = 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 = returnValueBase.isValid ( ) ; if ( ! isAllValidatePassed ) { break ; } } if ( isAllValidatePassed ) { cancel ( ) ; } }
Source:
public void testProxyCompatibilityWithFencingPolicy ( ) { org.ovirt.engine.core.common.businessentities.VDS host = createHost ( ) ; host.setSupportedClusterLevels ( "3.4,3.5" ) ; org.ovirt.engine.core.bll.pm.FenceProxyLocator locator = setupLocator ( ) ; org.junit.Assert.assertTrue ( locator.isFencingPolicySupported ( host , Version.v3_0 ) ) ; org.junit.Assert.assertTrue ( locator.isFencingPolicySupported ( host , Version.v3_5 ) ) ; org.junit.Assert.assertFalse ( locator.isFencingPolicySupported ( host , Version.v3_6 ) ) ; }

Target:
public void testProxyCompatibilityWithFencingPolicy ( ) { org.ovirt.engine.core.common.businessentities.VDS host = createHost ( ) ; host.setSupportedClusterLevels ( "3.4,3.5" ) ; org.ovirt.engine.core.bll.pm.FenceProxyLocator locator = setupLocator ( ) ; org.junit.Assert.assertTrue ( locator.isFencingPolicySupported ( host , Version.v3_5 ) ) ; org.junit.Assert.assertFalse ( locator.isFencingPolicySupported ( host , Version.v3_6 ) ) ; }
Source:
protected static java.lang.String encode ( byte b1 , byte b2 , byte b3 , int n ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; int w = ( ( ( b1 & 255 ) << 16 ) | ( ( b2 & 255 ) << 8 ) ) | ( b3 & 255 ) ; while ( ( n -- ) > 0 ) { result.append ( org.ovirt.engine.core.uutils.crypto.CryptMD5.b64t [ ( w & 63 ) ] ) ; w = w > > 6 ; } return result.toString ( ) ; }

Target:
private static java.lang.String encode ( byte b1 , byte b2 , byte b3 , int n ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; int w = ( ( ( b1 & 255 ) << 16 ) | ( ( b2 & 255 ) << 8 ) ) | ( b3 & 255 ) ; while ( ( n -- ) > 0 ) { result.append ( org.ovirt.engine.core.uutils.crypto.CryptMD5.b64t [ ( w & 63 ) ] ) ; w = w > > 6 ; } return result.toString ( ) ; }
Source:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; }
Source:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setvds_group_compatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDAO ( ) ; org.powermock.api.mockito.PowerMockito.when ( vdsDao.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; }

Target:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setvds_group_compatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; }
Source:
public static void updateVdsDomainsData ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainData ) { if ( ( StoragePoolDomainHelper.reportingVdsStatus.contains ( vds.getStatus ( ) ) ) && ( vds.getVdsGroupSupportsVirtService ( ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { proxy.updateVdsDomainsData ( vds.getId ( ) , vds.getName ( ) , vdsDomainData ) ; } } }

Target:
public static void updateVdsDomainsData ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainData ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { proxy.updateVdsDomainsData ( vds , vdsDomainData ) ; } }
Source:
private void mockStoragePoolIsoMap ( ) { org.ovirt.engine.core.common.businessentities.storage_pool_iso_map spim = new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( ) ; org.mockito.Mockito.doReturn ( storagePoolIsoMapDAO ) . when ( command ) . getStoragePoolIsoMapDao ( ) ; org.powermock.api.mockito.PowerMockito.when ( storagePoolIsoMapDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId.class ) ) ) . thenReturn ( spim ) ; }

Target:
private void mockStoragePoolIsoMap ( ) { org.ovirt.engine.core.common.businessentities.storage_pool_iso_map spim = new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( ) ; org.mockito.Mockito.when ( storagePoolIsoMapDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId.class ) ) ) . thenReturn ( spim ) ; }
Source:
public void setUp ( ) { vdsFromDb = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vdsFromDb.setId ( vdsId ) ; vdsFromDb.setClusterId ( clusterId ) ; virtStrategy = org.mockito.Mockito.spy ( new org.ovirt.engine.core.vdsbroker.monitoring.VirtMonitoringStrategy ( mockCluster ( ) , mockVdsDao ( ) , null ) ) ; org.mockito.Mockito.doNothing ( ) . when ( virtStrategy ) . vdsNonOperational ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.class ) , org.mockito.Matchers.any ( java.util.Map.class ) ) ; }

Target:
public void setUp ( ) { vdsFromDb = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vdsFromDb.setId ( vdsId ) ; vdsFromDb.setClusterId ( clusterId ) ; virtStrategy = org.mockito.Mockito.spy ( new org.ovirt.engine.core.vdsbroker.monitoring.VirtMonitoringStrategy ( mockCluster ( ) , mockVdsDao ( ) , null ) ) ; org.mockito.Mockito.doNothing ( ) . when ( virtStrategy ) . vdsNonOperational ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.class ) , org.mockito.Matchers.any ( ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = dbFacade.getVdsStaticDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VDS_ID ) ; org.junit.Assert.assertNotNull ( vds ) ; java.lang.String name = vds.getVdsName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VDS_ID , VdcObjectType.VDS ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = dbFacade.getVdsStaticDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VDS_ID ) ; org.junit.Assert.assertNotNull ( vds ) ; java.lang.String name = vds.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VDS_ID , VdcObjectType.VDS ) ) ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( ( ( org.ovirt.engine.core.searchbackend.StringHelper.EqOp ( fieldName , "SIZE" ) ) || ( org.ovirt.engine.core.searchbackend.StringHelper.EqOp ( fieldName , "USED" ) ) ) || ( org.ovirt.engine.core.searchbackend.StringHelper.EqOp ( fieldName , "COMMITTED" ) ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }

Target:
public org.ovirt.engine.core.searchbackend.IAutoCompleter getFieldRelationshipAutoCompleter ( java.lang.String fieldName ) { if ( ( ( "SIZE" . equals ( fieldName ) ) || ( "USED" . equals ( fieldName ) ) ) || ( "COMMITTED" . equals ( fieldName ) ) ) { return NumericConditionRelationAutoCompleter.INSTANCE ; } else { return StringConditionRelationAutoCompleter.INSTANCE ; } }
Source:
private org.ovirt.engine.core.common.businessentities.Snapshot getSnapshot ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk lastCinderVolume ) { org.ovirt.engine.core.compat.Guid vmSnapshotId = lastCinderVolume.getVmSnapshotId ( ) ; org.ovirt.engine.core.common.businessentities.Snapshot updated = null ; if ( ( vmSnapshotId != null ) && ( ! ( Guid.Empty.equals ( vmSnapshotId ) ) ) ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getSnapshotDao ( ) . get ( vmSnapshotId ) ; updated = org.ovirt.engine.core.bll.ImagesHandler.prepareSnapshotConfigWithoutImageSingleImage ( snapshot , lastCinderVolume.getImageId ( ) ) ; } return updated ; }

Target:
private org.ovirt.engine.core.common.businessentities.Snapshot getSnapshot ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk lastCinderVolume ) { org.ovirt.engine.core.compat.Guid vmSnapshotId = lastCinderVolume.getVmSnapshotId ( ) ; org.ovirt.engine.core.common.businessentities.Snapshot updated = null ; if ( ( vmSnapshotId != null ) && ( ! ( Guid.Empty.equals ( vmSnapshotId ) ) ) ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getSnapshotDao ( ) . get ( vmSnapshotId ) ; if ( snapshot != null ) { updated = org.ovirt.engine.core.bll.ImagesHandler.prepareSnapshotConfigWithoutImageSingleImage ( snapshot , lastCinderVolume.getImageId ( ) ) ; } } return updated ; }
Source:
protected void refreshModel ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; super . SyncSearch ( VdcQueryType.GetAllAuditLogsByVMName , new org.ovirt.engine.core.common.queries.GetAllAuditLogsByVMNameParameters ( vm.getVmName ( ) ) ) ; }

Target:
protected void refreshModel ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; super . SyncSearch ( VdcQueryType.GetAllAuditLogsByVMName , new org.ovirt.engine.core.common.queries.GetAllAuditLogsByVMNameParameters ( vm.getName ( ) ) ) ; }
Source:
protected org.ovirt.engine.api.model.Storage postPopulate ( org.ovirt.engine.api.model.Storage from ) { from.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageType.class ) . value ( ) ) ; org.ovirt.engine.api.model.LogicalUnit unit = new org.ovirt.engine.api.model.LogicalUnit ( ) ; unit.setId ( from.getId ( ) ) ; from.unsetLogicalUnits ( ) ; from.getLogicalUnits ( ) . add ( unit ) ; return from ; }

Target:
protected org.ovirt.engine.api.model.Storage postPopulate ( org.ovirt.engine.api.model.Storage from ) { from.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageType.class ) . value ( ) ) ; org.ovirt.engine.api.model.LogicalUnit unit = new org.ovirt.engine.api.model.LogicalUnit ( ) ; unit.setId ( from.getId ( ) ) ; from.getLogicalUnits ( ) . unsetLogicalUnits ( ) ; from.getLogicalUnits ( ) . getLogicalUnits ( ) . add ( unit ) ; return from ; }
Source:
private java.lang.String GetRealKey ( java.lang.String agent , java.lang.String displayedKey ) { java.lang.String result = "" ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( displayedKey ) ) ) { if ( fencingOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = fencingOptionMapping.get ( agent ) ; result = ( agentOptions.containsKey ( displayedKey ) ) ? agentOptions.get ( displayedKey ) : displayedKey ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.errorFormat ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } } return result ; }

Target:
private java.lang.String GetRealKey ( java.lang.String agent , java.lang.String displayedKey ) { java.lang.String result = "" ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( displayedKey ) ) ) { if ( fencingOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = fencingOptionMapping.get ( agent ) ; result = ( agentOptions.containsKey ( displayedKey ) ) ? agentOptions.get ( displayedKey ) : displayedKey ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.error ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } } return result ; }
Source:
public java.util.Set < org.ovirt.engine.core.utils.MockConfigRule.MockConfigDescriptor < java.lang.Boolean > > getExtraConfigDescriptors ( ) { return new java.util.HashSet ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.MockConfigRule.mockConfig ( ConfigValues.GlusterHostUUIDSupport , Version.v3_2.toString ( ) , false ) , org.ovirt.engine.core.utils.MockConfigRule.mockConfig ( ConfigValues.GlusterHostUUIDSupport , Version.v3_3.toString ( ) , true ) ) ) ; }

Target:
public java.util.Set < org.ovirt.engine.core.utils.MockConfigRule.MockConfigDescriptor < java.lang.Boolean > > getExtraConfigDescriptors ( ) { return new java.util.HashSet ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.MockConfigRule.mockConfig ( ConfigValues.GlusterHostUUIDSupport , Version.v3_2 , false ) , org.ovirt.engine.core.utils.MockConfigRule.mockConfig ( ConfigValues.GlusterHostUUIDSupport , Version.v3_3 , true ) ) ) ; }
Source:
boolean isTaskOverPrePollingLapse ( ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters parameters = getParameters ( ) ; long taskStartTime = parameters.getDbAsyncTask ( ) . getStartTime ( ) . getTime ( ) ; java.lang.Integer prePollingPeriod = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( org.ovirt.engine.core.common.config.ConfigValues.UknownTaskPrePollingLapse ) ; boolean idlePeriodPassed = ( ( java.lang.System.currentTimeMillis ( ) ) - taskStartTime ) > prePollingPeriod ; org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "task id {0} {1}. Pre-polling period is {2} millis. " , parameters.getVdsmTaskId ( ) , ( idlePeriodPassed ? "has passed pre-polling period time and should be polled" : "is in pre-polling period and should not be polled" ) , prePollingPeriod ) ; return idlePeriodPassed ; }

Target:
boolean isTaskOverPrePollingLapse ( ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters parameters = getParameters ( ) ; long taskStartTime = parameters.getDbAsyncTask ( ) . getStartTime ( ) . getTime ( ) ; java.lang.Integer prePollingPeriod = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( org.ovirt.engine.core.common.config.ConfigValues.UknownTaskPrePollingLapse ) ; boolean idlePeriodPassed = ( ( java.lang.System.currentTimeMillis ( ) ) - taskStartTime ) > prePollingPeriod ; org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "task id {0} {1}. Pre-polling period is {2} millis. " , parameters.getVdsmTaskId ( ) , ( idlePeriodPassed ? "has passed pre-polling period time and should be polled" : "is in pre-polling period and should not be polled" ) , prePollingPeriod ) ; return idlePeriodPassed ; }
Source:
private org.ovirt.engine.core.compat.Guid getVmToAttach ( org.ovirt.engine.core.compat.NGuid poolId ) { if ( ( vmToAttach ) == null ) { org.ovirt.engine.core.compat.Guid vmGuid = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getPrestartedVmToAttach ( poolId ) ; if ( ( vmGuid == null ) || ( Guid.Empty.equals ( vmGuid ) ) ) { vmGuid = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getNonPrestartedVmToAttach ( poolId ) ; } vmToAttach = vmGuid ; } return vmToAttach ; }

Target:
private org.ovirt.engine.core.compat.Guid getVmToAttach ( org.ovirt.engine.core.compat.NGuid poolId ) { if ( ( vmToAttach ) == null ) { org.ovirt.engine.core.compat.Guid vmGuid = getPrestartedVmToAttach ( poolId ) ; if ( ( vmGuid == null ) || ( Guid.Empty.equals ( vmGuid ) ) ) { vmGuid = getNonPrestartedVmToAttach ( poolId ) ; } vmToAttach = vmGuid ; } return vmToAttach ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getCompensationContext ( ) ) ; final boolean hasImages = ( imageTemplates.size ( ) ) > 0 ; if ( hasImages ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { if ( removeVmTemplateImages ( ) ) { org.ovirt.engine.core.bll.VmHandler.removeVmInitFromDB ( getVmTemplate ( ) ) ; setSucceeded ( true ) ; } return null ; } } ) ; } else { HandleEndAction ( ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getCompensationContext ( ) ) ; if ( ! ( imageTemplates.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { if ( removeVmTemplateImages ( ) ) { org.ovirt.engine.core.bll.VmHandler.removeVmInitFromDB ( getVmTemplate ( ) ) ; setSucceeded ( true ) ; } return null ; } } ) ; } else { HandleEndAction ( ) ; } }
Source:
public boolean deleteSnapshot ( final org.ovirt.engine.core.compat.Guid snapshotId ) { return execute ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) { try { proxy.deleteSnapshot ( snapshotId.toString ( ) ) ; return true ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } } } ) ; }

Target:
public boolean deleteSnapshot ( final org.ovirt.engine.core.compat.Guid snapshotId ) { return execute ( ( ) -> { try { proxy.deleteSnapshot ( snapshotId.toString ( ) ) ; return true ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } } ) ; }
Source:
protected boolean isDomainAttached ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { if ( ( storageDomain.getstorage_pool_id ( ) ) == null ) { return false ; } org.ovirt.engine.core.compat.Guid storageDomainId = storageDomain.getId ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = storageDomain.getstorage_pool_id ( ) . getValue ( ) ; return ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ) != null ; }

Target:
protected boolean isDomainAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( storageDomain.getstorage_pool_id ( ) ) == null ) { return false ; } org.ovirt.engine.core.compat.Guid storageDomainId = storageDomain.getId ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = storageDomain.getstorage_pool_id ( ) . getValue ( ) ; return ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ) != null ; }
Source:
public void iscsiBondWithTheSameNameDoesNotExistInDataCenter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.IscsiBond > iscsiBonds = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.compat.Guid dataCenterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; iscsiBonds.add ( createIscsiBond ( "First" , dataCenterId ) ) ; iscsiBonds.add ( createIscsiBond ( "Second" , dataCenterId ) ) ; org.mockito.Mockito.doReturn ( iscsiBonds ) . when ( iscsiBondDao ) . getAllByStoragePoolId ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( ValidationResult.VALID , validator.iscsiBondWithTheSameNameExistInDataCenter ( createIscsiBond ( "Third" , dataCenterId ) ) ) ; }

Target:
public void iscsiBondWithTheSameNameDoesNotExistInDataCenter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.IscsiBond > iscsiBonds = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.compat.Guid dataCenterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; iscsiBonds.add ( createIscsiBond ( "First" , dataCenterId ) ) ; iscsiBonds.add ( createIscsiBond ( "Second" , dataCenterId ) ) ; org.mockito.Mockito.doReturn ( iscsiBonds ) . when ( iscsiBondDao ) . getAllByStoragePoolId ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( ValidationResult.VALID , validator.iscsiBondWithTheSameNameExistInDataCenter ( createIscsiBond ( "Third" , dataCenterId ) ) ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.NIC model = new org.ovirt.engine.api.model.NIC ( ) ; model.setName ( null ) ; model.setNetwork ( new org.ovirt.engine.api.model.Network ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NIC" , "add" , "name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.NIC model = new org.ovirt.engine.api.model.NIC ( ) ; model.setName ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NIC" , "add" , "name" ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.StorageDomain map ( org.ovirt.engine.api.model.HostStorage model , org.ovirt.engine.api.restapi.types.StorageDomain template ) { org.ovirt.engine.api.restapi.types.StorageDomain entity = ( template != null ) ? template : new org.ovirt.engine.api.restapi.types.StorageDomain ( ) ; entity.setStorage ( model.getId ( ) ) ; if ( model.isSetType ( ) ) { org.ovirt.engine.api.model.StorageType storageType = org.ovirt.engine.api.model.StorageType.fromValue ( model.getType ( ) ) ; if ( storageType != null ) { entity.setStorageType ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( storageType , null ) ) ; } } return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.StorageDomain map ( org.ovirt.engine.api.model.HostStorage model , org.ovirt.engine.api.restapi.types.StorageDomain template ) { org.ovirt.engine.api.restapi.types.StorageDomain entity = ( template != null ) ? template : new org.ovirt.engine.api.restapi.types.StorageDomain ( ) ; entity.setStorage ( model.getId ( ) ) ; if ( model.isSetType ( ) ) { entity.setStorageType ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( model.getType ( ) , null ) ) ; } return entity ; }
Source:
public java.lang.String getReplacementStringNullSafe ( java.lang.Object data ) { return ( ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( data ) ) . getCluster ( ) . getName ( ) ) + "/" ) + ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( data ) ) . getDataCenter ( ) . getName ( ) ) ; }

Target:
public java.lang.String getReplacementStringNullSafe ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster data ) { return ( ( data.getCluster ( ) . getName ( ) ) + "/" ) + ( data.getDataCenter ( ) . getName ( ) ) ; }
Source:
public void onFailed ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; log.debug ( "Removing ImageTransfer id {}" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.endWithFailure ( ) ; log.error ( "Failed to transfer disk '{}' (command id '{}')" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; }

Target:
public void onFailed ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; log.debug ( "Removing ImageTransfer id {}" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; endWithFailure ( ) ; log.error ( "Failed to transfer disk '{}' (command id '{}')" , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getCommandId ( ) ) ; }
Source:
public void mockQuotaDao ( ) { quota = mockStorageQuota ( quotaGuid ) ; org.mockito.Mockito.when ( quotaDao.getById ( quotaGuid ) ) . thenReturn ( quota ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = new java.util.ArrayList < > ( ) ; quotaList.add ( new org.ovirt.engine.core.common.businessentities.Quota ( ) ) ; quotaList.add ( new org.ovirt.engine.core.common.businessentities.Quota ( ) ) ; org.mockito.Mockito.when ( quotaDao.getQuotaByStoragePoolGuid ( storagePoolUUID ) ) . thenReturn ( quotaList ) ; org.mockito.Mockito.when ( quotaDao.isQuotaInUse ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( false ) ; }

Target:
public void mockQuotaDao ( ) { quota = mockStorageQuota ( quotaGuid ) ; org.mockito.Mockito.when ( quotaDao.getById ( quotaGuid ) ) . thenReturn ( quota ) ; }
Source:
public static void getAllowClusterWithVirtGlusterEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.lang.Boolean.TRUE ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getAllowClusterWithVirtGlusterEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.lang.Boolean.TRUE ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void initVncKeyboardLayout ( ) { java.util.List < java.lang.String > layouts = ( ( java.util.List < java.lang.String > ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) ) ; java.util.List < java.lang.String > vncKeyboardLayoutItems = new java.util.ArrayList < java.lang.String > ( ) ; vncKeyboardLayoutItems.add ( null ) ; vncKeyboardLayoutItems.addAll ( layouts ) ; getVncKeyboardLayout ( ) . setItems ( vncKeyboardLayoutItems ) ; getVncKeyboardLayout ( ) . setIsChangable ( false ) ; }

Target:
private void initVncKeyboardLayout ( ) { java.util.List < java.lang.String > layouts = ( ( java.util.List < java.lang.String > ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VncKeyboardLayoutValidValues ) ) ) ; java.util.List < java.lang.String > vncKeyboardLayoutItems = new java.util.ArrayList < java.lang.String > ( ) ; vncKeyboardLayoutItems.add ( null ) ; vncKeyboardLayoutItems.addAll ( layouts ) ; getVncKeyboardLayout ( ) . setItems ( vncKeyboardLayoutItems ) ; getVncKeyboardLayout ( ) . setIsChangable ( false ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; }

Target:
public java.util.List < java.lang.String > convert ( java.lang.Object source ) { java.util.List < java.lang.String > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; }
Source:
public static < T > java.util.ArrayList < T > Intersection ( java.util.ArrayList < java.util.ArrayList < T > > lists ) { java.util.ArrayList < T > result = new java.util.ArrayList < T > ( ) ; if ( ( lists != null ) && ( ! ( lists.isEmpty ( ) ) ) ) { result.addAll ( lists.get ( 0 ) ) ; } for ( java.util.ArrayList < T > list : lists ) { result.retainAll ( list ) ; } return result ; }

Target:
public static < T > java.util.ArrayList < T > Intersection ( java.util.ArrayList < java.util.ArrayList < T > > lists ) { java.util.ArrayList < T > result = new java.util.ArrayList < T > ( ) ; if ( ( lists != null ) && ( ! ( lists.isEmpty ( ) ) ) ) { result.addAll ( lists.get ( 0 ) ) ; for ( java.util.ArrayList < T > list : lists ) { result.retainAll ( list ) ; } } return result ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { java.lang.String value = "" ; if ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) ; java.util.ArrayList < java.lang.String > quotaNamesArr = diskImage.getQuotaNames ( ) ; if ( quotaNamesArr != null ) { value = org.ovirt.engine.core.compat.StringHelper.join ( ", " , quotaNamesArr.toArray ( ) ) ; } } return value ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { java.lang.String value = "" ; if ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) ; java.util.ArrayList < java.lang.String > quotaNamesArr = diskImage.getQuotaNames ( ) ; if ( quotaNamesArr != null ) { value = java.lang.String.join ( ", " , quotaNamesArr ) ; } } return value ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpClusters ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpClusters ( ) , failure ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getCompensationContext ( ) ) ; org.ovirt.engine.core.bll.RemoveVmTemplateCommand.freeLock ( ) ; final boolean hasImages = ( imageTemplates.size ( ) ) > 0 ; if ( hasImages ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { if ( RemoveVmTemplateImages ( ) ) { setSucceeded ( true ) ; } return null ; } } ) ; } else { HandleEndAction ( ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getCompensationContext ( ) ) ; final boolean hasImages = ( imageTemplates.size ( ) ) > 0 ; if ( hasImages ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { if ( RemoveVmTemplateImages ( ) ) { setSucceeded ( true ) ; } return null ; } } ) ; } else { HandleEndAction ( ) ; } }
Source:
public void testGuestAgentStatus ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = dao.get ( vmId ) ; vmDynamic.setGuestAgentStatus ( GuestAgentStatus.UpdateNeeded ) ; dao.update ( vmDynamic ) ; vmDynamic = dao.get ( vmId ) ; org.junit.Assert.assertTrue ( ( ( vmDynamic.getGuestAgentStatus ( ) . getValue ( ) ) == ( GuestAgentStatus.UpdateNeeded.getValue ( ) ) ) ) ; }

Target:
public void testGuestAgentStatus ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = dao.get ( vmId ) ; vmDynamic.setGuestAgentStatus ( GuestAgentStatus.UpdateNeeded ) ; dao.update ( vmDynamic ) ; vmDynamic = dao.get ( vmId ) ; org.junit.Assert.assertEquals ( vmDynamic.getGuestAgentStatus ( ) . getValue ( ) , GuestAgentStatus.UpdateNeeded.getValue ( ) ) ; }
Source:
private void assertGetAllForStoragePoolValidResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup group : result ) { org.junit.Assert.assertEquals ( storagePool.getId ( ) , group.getstorage_pool_id ( ) ) ; } }

Target:
private void assertGetAllForStoragePoolValidResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup group : result ) { org.junit.Assert.assertEquals ( storagePool.getId ( ) , group.getStoragePoolId ( ) ) ; } }
Source:
protected boolean isVmUpOrDown ( ) { if ( ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL ) ; return false ; } return true ; }

Target:
protected boolean isVmUpOrDown ( ) { if ( ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL ) ; return false ; } return true ; }
Source:
public void getSpecParams ( ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setAction ( VmWatchdogAction.RESET ) ; params.setModel ( vmWatchdogType ) ; org.ovirt.engine.core.bll.UpdateWatchdogCommand command = new org.ovirt.engine.core.bll.UpdateWatchdogCommand ( params , null ) ; java.util.HashMap < java.lang.String , java.lang.Object > specParams = command.getSpecParams ( ) ; org.junit.Assert.assertNotNull ( specParams ) ; org.junit.Assert.assertEquals ( "i6300esb" , specParams.get ( "model" ) ) ; org.junit.Assert.assertEquals ( "reset" , specParams.get ( "action" ) ) ; }

Target:
public void getSpecParams ( ) { command.getParameters ( ) . setAction ( VmWatchdogAction.RESET ) ; command.getParameters ( ) . setModel ( vmWatchdogType ) ; java.util.HashMap < java.lang.String , java.lang.Object > specParams = command.getSpecParams ( ) ; org.junit.Assert.assertNotNull ( specParams ) ; org.junit.Assert.assertEquals ( "i6300esb" , specParams.get ( "model" ) ) ; org.junit.Assert.assertEquals ( "reset" , specParams.get ( "action" ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage mockDisk ( ) { org.ovirt.engine.core.compat.Guid diskGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid itGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; final org.ovirt.engine.core.common.businessentities.DiskImage expectedDisk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; expectedDisk.setImageId ( diskGuid ) ; expectedDisk.setit_guid ( itGuid ) ; expectedDisk.setInternalDriveMapping ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; return expectedDisk ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage mockDisk ( ) { org.ovirt.engine.core.compat.Guid diskGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid itGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; final org.ovirt.engine.core.common.businessentities.DiskImage expectedDisk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; expectedDisk.setImageId ( diskGuid ) ; expectedDisk.setit_guid ( itGuid ) ; return expectedDisk ; }
Source:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.DetachNetworkFromClusterInternal , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToClusterCommand.getParameters ( ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval ( getPersistedNetwork ( ) , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToClusterCommand.getCluster ( ) . getCompatibilityVersion ( ) ) ) { detachLabeledNetworksFromClusterHosts ( ) ; } } else { propagateFailure ( returnValue ) ; } }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.DetachNetworkFromClusterInternal , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToClusterCommand.getParameters ( ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval ( getPersistedNetwork ( ) ) ) { detachLabeledNetworksFromClusterHosts ( ) ; } } else { propagateFailure ( returnValue ) ; } }
Source:
public void encodeWhenNonAsciiAliasIsTruncated ( ) throws java.io.IOException { java.lang.String nonAsciiDiskAlias = "ááááááááááááááááááááááááááááááááááááááááááááááá" ; disk.setDiskAlias ( nonAsciiDiskAlias ) ; disk.setDiskDescription ( "DiskDescription" ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( nonAsciiDiskAlias.substring ( 0 , 46 ) ) ) , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateEncodingJsonEntry ( 1 ) ) ; }

Target:
public void encodeWhenNonAsciiAliasIsTruncated ( ) throws java.io.IOException { java.lang.String nonAsciiDiskAlias = "ááááááááááááááááááááááááááááááááááááááááááááááá" ; disk.setDiskAlias ( nonAsciiDiskAlias ) ; disk.setDiskDescription ( "DiskDescription" ) ; assertDiskDescriptionMap ( disk , generateDiskAliasJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( nonAsciiDiskAlias.substring ( 0 , 46 ) ) ) , generateEncodingJsonEntry ( 1 ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( getDisk ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } buildSharedLockMap ( ) ; return ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ) && ( validateAllVmsForDiskAreDown ( ) ) ) && ( canRemoveDiskBasedOnStorageTypeCheck ( ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( getDisk ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } return ( validateAllVmsForDiskAreDown ( ) ) && ( canRemoveDiskBasedOnStorageTypeCheck ( ) ) ; }