auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void handleEntityType ( java.lang.String entityType , org.ovirt.engine.core.common.businessentities.Disk entity ) { if ( ( entityType != null ) && ( ! ( entityType.isEmpty ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.VmEntityType vmEntityType = org.ovirt.engine.core.common.businessentities.VmEntityType.valueOf ( entityType ) ; entity.setVmEntityType ( vmEntityType ) ; } }

Target:
private static void handleEntityType ( java.lang.String entityType , org.ovirt.engine.core.common.businessentities.storage.Disk entity ) { if ( ( entityType != null ) && ( ! ( entityType.isEmpty ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.VmEntityType vmEntityType = org.ovirt.engine.core.common.businessentities.VmEntityType.valueOf ( entityType ) ; entity.setVmEntityType ( vmEntityType ) ; } }
Source:
private void resetIrs ( ) { if ( ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getspm_vds_id ( ) ) != null ) { org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters tempVar = new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getspm_vds_id ( ) ) ; tempVar.setIgnoreStopFailed ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ResetIrs , tempVar ) ; } }

Target:
private void resetIrs ( ) { if ( ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getspm_vds_id ( ) ) != null ) { org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters tempVar = new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getspm_vds_id ( ) ) ; tempVar.setIgnoreStopFailed ( true ) ; runVdsCommand ( VDSCommandType.ResetIrs , tempVar ) ; } }
Source:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void testGetAllForParent ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags > result = dao.getAllForParent ( parent ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : result ) { org.junit.Assert.assertEquals ( parent , tag.getparent_id ( ) ) ; } }

Target:
public void testGetAllForParent ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Tags > result = dao.getAllForParent ( parent ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : result ) { org.junit.Assert.assertEquals ( parent , tag.getparent_id ( ) ) ; } }
Source:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( true , false ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( dbFacadeMock ) . getStoragePoolDao ( ) ; setupCpu ( ) ; validateFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }

Target:
public void randomAdditionalRngDeviceUsed ( ) { final org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.bll.UpdateClusterCommandTest.createDefaultCluster ( ) ; cluster.setAdditionalRngSources ( java.util.Collections.singleton ( VmRngDevice.Source.RANDOM ) ) ; createCommand ( cluster ) ; cpuExists ( ) ; validateFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_RANDOM_RNG_SOURCE_CANT_BE_ADDED_TO_CLUSTER_ADDITIONAL_RNG_SOURCES ) ; }
Source:
public void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getStage ( ) ) == ( org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters.LiveMigrateStage.CREATE_SNAPSHOT ) ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.OK , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }

Target:
public void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getStage ( ) ) == ( org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters.LiveMigrateStage.CREATE_SNAPSHOT ) ) { imagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.OK , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }
Source:
protected void EndActionOnDisks ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.VmCommand.getParameters ( ) . getImagesParameters ( ) ) { if ( overrideChildCommandSuccess ( ) ) { p.setTaskGroupSuccess ( org.ovirt.engine.core.bll.VmCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ; } org.ovirt.engine.core.bll.VmCommand.getBackend ( ) . EndAction ( ( ( p.getCommandType ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ? getChildActionType ( ) : p.getCommandType ( ) ) , p ) ; } }

Target:
protected void endActionOnDisks ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.VmCommand.getParameters ( ) . getImagesParameters ( ) ) { if ( overrideChildCommandSuccess ( ) ) { p.setTaskGroupSuccess ( org.ovirt.engine.core.bll.VmCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ; } org.ovirt.engine.core.bll.VmCommand.getBackend ( ) . EndAction ( ( ( p.getCommandType ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ? getChildActionType ( ) : p.getCommandType ( ) ) , p ) ; } }
Source:
public void testMigratoinCanBeSetWhenVMUsesScsiReservation ( ) { prepareVmToPassCanDoAction ( ) ; vm.setMigrationSupport ( MigrationSupport.MIGRATABLE ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = createVmDevice ( ) ; device.setUsingScsiReservation ( false ) ; mockVmDevice ( device ) ; mockVmValidator ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testMigratoinCanBeSetWhenVMUsesScsiReservation ( ) { prepareVmToPassValidate ( ) ; vm.setMigrationSupport ( MigrationSupport.MIGRATABLE ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = createVmDevice ( ) ; device.setUsingScsiReservation ( false ) ; mockVmDevice ( device ) ; mockVmValidator ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected boolean canDoAction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool_iso_map > poolDomains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getStoragePool ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool_iso_map poolDomain : poolDomains ) { if ( ( poolDomain.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ) { addInvalidSDStatusMessage ( poolDomain.getstatus ( ) ) ; return false ; } } return org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.InitializeVds ( ) ; }

Target:
protected boolean canDoAction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > poolDomains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getStoragePool ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap poolDomain : poolDomains ) { if ( ( poolDomain.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ) { addInvalidSDStatusMessage ( poolDomain.getstatus ( ) ) ; return false ; } } return org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.InitializeVds ( ) ; }
Source:
public void testQuotaStorageByQuotaGuidWithGeneralDefaultNoDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = dao.getQuotaStorageByQuotaGuidWithGeneralDefault ( FixturesTool.QUOTA_SPECIFIC ) ; org.junit.Assert.assertNotNull ( quotaStorageList ) ; org.junit.Assert.assertEquals ( "wrong number of quotas returned" , 1 , quotaStorageList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaStorage group : quotaStorageList ) { org.junit.Assert.assertNotNull ( "Storage ID should not be null in specific mode" , group.getStorageId ( ) ) ; org.junit.Assert.assertNotNull ( "Storage name should not be null in specific mode" , group.getStorageName ( ) ) ; } }

Target:
public void testQuotaStorageByQuotaGuidWithGeneralDefaultNoDefault ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = dao.getQuotaStorageByQuotaGuidWithGeneralDefault ( FixturesTool.QUOTA_SPECIFIC ) ; org.junit.jupiter.api.Assertions.assertNotNull ( quotaStorageList ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , quotaStorageList.size ( ) , "wrong number of quotas returned" ) ; for ( org.ovirt.engine.core.common.businessentities.QuotaStorage group : quotaStorageList ) { org.junit.jupiter.api.Assertions.assertNotNull ( group.getStorageId ( ) , "Storage ID should not be null in specific mode" ) ; org.junit.jupiter.api.Assertions.assertNotNull ( group.getStorageName ( ) , "Storage name should not be null in specific mode" ) ; } }
Source:
private org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct setMockForTesting ( java.util.Map < java.lang.String , java.lang.Object > diskData ) { java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > disksData = new java.util.HashMap < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > ( ) ; disksData.put ( "vda" , diskData ) ; org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xml = setDisksInXmlRpc ( disksData ) ; mockDiskImageDao ( ) ; return xml ; }

Target:
private org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct setMockForTesting ( java.util.Map < java.lang.String , java.lang.Object > diskData ) { java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > disksData = new java.util.HashMap < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > ( ) ; disksData.put ( "vda" , diskData ) ; org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksInXmlRpc ( disksData ) ; mockDiskImageDao ( ) ; return xml ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.VolumeListReturnForXmlRpc reconcileVolumeChain ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String leafVolUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.reconcileVolumeChain" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "leafVolID" , leafVolUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.VolumeListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.VolumeListReturnForXmlRpc reconcileVolumeChain ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String leafVolUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.reconcileVolumeChain" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "leafVolID" , leafVolUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "volumes" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.VolumeListReturnForXmlRpc ( response ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { datacenterCreated = constants.guidePopupDataCenterCreatedLabel ( ) ; clusterCreated = constants.guidePopupClusterCreatedLabel ( ) ; vmCreated = constants.guidePopupVMCreatedLabel ( ) ; unconfigured = constants.guidePopupUnconfiguredLabel ( ) ; configurationCompleted = constants.guidePopupConfigurationCompletedLabel ( ) ; compulsoryActionsLabel.setText ( constants.guidePopupRequiredActionsLabel ( ) ) ; optionalActionsLabel.setText ( constants.guidePopupOptionalActionsLabel ( ) ) ; }

Target:
void localize ( ) { datacenterCreated = org.ovirt.engine.ui.webadmin.section.main.view.popup.guide.GuidePopupView.constants.guidePopupDataCenterCreatedLabel ( ) ; clusterCreated = org.ovirt.engine.ui.webadmin.section.main.view.popup.guide.GuidePopupView.constants.guidePopupClusterCreatedLabel ( ) ; vmCreated = org.ovirt.engine.ui.webadmin.section.main.view.popup.guide.GuidePopupView.constants.guidePopupVMCreatedLabel ( ) ; unconfigured = org.ovirt.engine.ui.webadmin.section.main.view.popup.guide.GuidePopupView.constants.guidePopupUnconfiguredLabel ( ) ; configurationCompleted = org.ovirt.engine.ui.webadmin.section.main.view.popup.guide.GuidePopupView.constants.guidePopupConfigurationCompletedLabel ( ) ; compulsoryActionsLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.guide.GuidePopupView.constants.guidePopupRequiredActionsLabel ( ) ) ; optionalActionsLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.guide.GuidePopupView.constants.guidePopupOptionalActionsLabel ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.GlusterVolumeProfileInfoReturnForXmlRpc glusterVolumeProfileInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeProfileInfo ( volumeName ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GlusterVolumeProfileInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.GlusterVolumeProfileInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc glusterVolumeProfileInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeProfileInfo ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNic , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNic , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( resource.getStatisticsResource ( ) ) ) ; org.junit.Assert.assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }

Target:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNic , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNic , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( resource.getStatisticsResource ( ) ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.Network getGlusterNetwork ( ) { if ( ( glusterNetwork ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster = getNetworkDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworksInCluster ) { if ( network.getCluster ( ) . isGluster ( ) ) { glusterNetwork = network ; return glusterNetwork ; } } } return glusterNetwork ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network getGlusterNetwork ( ) { if ( ( glusterNetwork ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster = getNetworkDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworksInCluster ) { if ( network.getCluster ( ) . isGluster ( ) ) { glusterNetwork = network ; return glusterNetwork ; } } } return glusterNetwork ; }
Source:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand < org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters > ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < org.ovirt.engine.core.common.action.LiveMigrateDiskParameters > ( ) , vmId ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isValidSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; }

Target:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand < org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters > ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < org.ovirt.engine.core.common.action.LiveMigrateDiskParameters > ( ) , vmId ) , null ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; }
Source:
protected org.ovirt.engine.core.common.queries.VdcQueryReturnValue getExistingStorageDomainList ( org.ovirt.engine.core.common.businessentities.StorageServerConnections storageServerConnection ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.core.bll.storage.domain.GetFileStorageDomainsWithAttachedStoragePoolGuidQuery.getBackend ( ) . runInternalQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( org.ovirt.engine.core.bll.storage.domain.GetFileStorageDomainsWithAttachedStoragePoolGuidQuery.getVdsId ( ) , storageServerConnection.getStorageType ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainType.Data , storageServerConnection.getConnection ( ) ) ) ; return returnValue ; }

Target:
protected org.ovirt.engine.core.common.queries.VdcQueryReturnValue getExistingStorageDomainList ( org.ovirt.engine.core.common.businessentities.StorageServerConnections storageServerConnection ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = backend.runInternalQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( org.ovirt.engine.core.bll.storage.domain.GetFileStorageDomainsWithAttachedStoragePoolGuidQuery.getVdsId ( ) , storageServerConnection.getStorageType ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainType.Data , storageServerConnection.getConnection ( ) ) ) ; return returnValue ; }
Source:
private void processVmPoolOnStopVm ( ) { org.ovirt.engine.core.bll.VmPoolHandler.processVmPoolOnStopVm ( org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ) ) ; }

Target:
public void reportCompleted ( ) { try { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ; if ( ( ( executionContext != null ) && ( executionContext.isMonitored ( ) ) ) && ( ! ( executionContext.isCompleted ( ) ) ) ) { endExecutionMonitoring ( ) ; } } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
public void initUniqueOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { uniqueOsNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( uniqueOsNames ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetUniqueOsNames ) , callback ) ; }

Target:
public void initUniqueOsNames ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetUniqueOsNames ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { uniqueOsNames = returnValue.getReturnValue ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( uniqueOsNames ) ) ; } } ) ) ; }
Source:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateInterfaceListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateStorageListModel ( ) ) ; addCustomModelsDetailModelList ( list ) ; setDetailModels ( list ) ; }

Target:
private void setDetailList ( final java.util.List < org.ovirt.engine.ui.uicommonweb.models.HasEntity < org.ovirt.engine.core.common.businessentities.VmTemplate > > list , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel templateGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateVmListModel templateVmListModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateInterfaceListModel templateInterfaceListModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateStorageListModel templateStorageListModel ) { list.add ( templateGeneralModel ) ; list.add ( templateVmListModel ) ; list.add ( templateInterfaceListModel ) ; list.add ( templateStorageListModel ) ; }
Source:
public static boolean canVmsBePaused ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > items ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : items ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSuspendSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) { return false ; } } return true ; }

Target:
public boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( actionType ) ; result = ( prime * result ) + ( ( clusterMinimalVersion ) == null ? 0 : clusterMinimalVersion.hashCode ( ) ) ; result = ( prime * result ) + ( ( storagePoolMinimalVersion ) == null ? 0 : storagePoolMinimalVersion.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( actionType , clusterMinimalVersion , storagePoolMinimalVersion ) ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
private void cancelTasks ( ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.cancelTasks ( this ) ; }
Source:
public void testRemoveMultiple ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > idsToRemove = new java.util.ArrayList < > ( ) ; idsToRemove.add ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_DIST_ID ) ; idsToRemove.add ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID ) ; dao.removeAll ( idsToRemove ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertTrue ( volumes.isEmpty ( ) ) ; }

Target:
public void testRemoveMultiple ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > idsToRemove = new java.util.ArrayList < > ( ) ; idsToRemove.add ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_DIST_ID ) ; idsToRemove.add ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID ) ; dao.removeAll ( idsToRemove ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID ) ; org.junit.jupiter.api.Assertions.assertTrue ( volumes.isEmpty ( ) ) ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel object ) { driver.edit ( object ) ; final org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = object ; storageModel.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 ) { revealStorageView ( storageModel ) ; } } ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { datacenterAlertIcon.setVisible ( storageModel.getDataCenterAlert ( ) . getIsAvailable ( ) ) ; datacenterAlertIcon.setTitle ( ( ( java.lang.String ) ( storageModel.getDataCenterAlert ( ) . getEntity ( ) ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isOsSupportedForVirtIoScsi ( org.ovirt.engine.core.common.businessentities.VM vm ) { final java.util.List < java.lang.String > unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.VirtIoScsiUnsupportedOsList ) ; java.lang.String vmOs = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) . get ( vm.getVmOsId ( ) ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isDiskInterfaceSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm != null ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , disk.getDiskInterface ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED , java.lang.String.format ( "$osName %s" , org.ovirt.engine.core.bll.validator.DiskValidator.getOsRepository ( ) . getOsName ( vm.getOs ( ) ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void addVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( getVmId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStatisticsDao ( ) . save ( stats ) ; getCompensationContext ( ) . snapshotNewEntity ( stats ) ; getCompensationContext ( ) . stateChanged ( ) ; }

Target:
private void addVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( getVmId ( ) ) ; getVmStatisticsDAO ( ) . save ( stats ) ; getCompensationContext ( ) . snapshotNewEntity ( stats ) ; getCompensationContext ( ) . stateChanged ( ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.UpdateVolumeVDSCommandParameters p = new org.ovirt.engine.core.common.vdscommands.UpdateVolumeVDSCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.FenceVolumeJobCommand.getParameters ( ) . getStorageJobId ( ) , org.ovirt.engine.core.bll.storage.disk.image.FenceVolumeJobCommand.getParameters ( ) . getImageLocationInfo ( ) ) ; p.setGeneration ( ( ( org.ovirt.engine.core.bll.storage.disk.image.FenceVolumeJobCommand.getParameters ( ) . getImageLocationInfo ( ) . getGeneration ( ) ) + ( org.ovirt.engine.core.common.constants.StorageConstants.ENTITY_FENCING_GENERATION_DIFF ) ) ) ; org.ovirt.engine.core.bll.storage.utils.VdsCommandsHelper.runVdsCommandWithoutFailover ( VDSCommandType.UpdateVolume , p , org.ovirt.engine.core.bll.storage.disk.image.FenceVolumeJobCommand.getParameters ( ) . getStoragePoolId ( ) , this ) ; org.ovirt.engine.core.bll.storage.disk.image.FenceVolumeJobCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.UpdateVolumeVDSCommandParameters p = new org.ovirt.engine.core.common.vdscommands.UpdateVolumeVDSCommandParameters ( org.ovirt.engine.core.bll.storage.disk.image.FenceVolumeJobCommand.getParameters ( ) . getStorageJobId ( ) , org.ovirt.engine.core.bll.storage.disk.image.FenceVolumeJobCommand.getParameters ( ) . getImageLocationInfo ( ) ) ; p.setGeneration ( ( ( org.ovirt.engine.core.bll.storage.disk.image.FenceVolumeJobCommand.getParameters ( ) . getImageLocationInfo ( ) . getGeneration ( ) ) + ( org.ovirt.engine.core.common.constants.StorageConstants.ENTITY_FENCING_GENERATION_DIFF ) ) ) ; vdsCommandsHelper.runVdsCommandWithoutFailover ( VDSCommandType.UpdateVolume , p , org.ovirt.engine.core.bll.storage.disk.image.FenceVolumeJobCommand.getParameters ( ) . getStoragePoolId ( ) , this ) ; org.ovirt.engine.core.bll.storage.disk.image.FenceVolumeJobCommand.setSucceeded ( true ) ; }
Source:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void EntityPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . EntityPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "IsSelectedNullable" ) ) { org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel selectionTreeNodeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.tags.TagModel tagModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( selectionTreeNodeModel.getEntity ( ) ) ) ; tagModel.setSelection ( selectionTreeNodeModel.getIsSelectedNullable ( ) ) ; OnTagSelectionChanged ( tagModel , e ) ; } }

Target:
protected void entityPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . entityPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "IsSelectedNullable" ) ) { org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel selectionTreeNodeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.tags.TagModel tagModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( selectionTreeNodeModel.getEntity ( ) ) ) ; tagModel.setSelection ( selectionTreeNodeModel.getIsSelectedNullable ( ) ) ; OnTagSelectionChanged ( tagModel , e ) ; } }
Source:
public void completeExternalProvidersNoNameTest ( ) { org.ovirt.engine.api.model.ExternalProviders providers = getExternalProviders ( 1 ) ; providers.getExternalProviders ( ) . get ( 0 ) . setName ( null ) ; try { org.ovirt.engine.api.restapi.resource.BackendExternalProviderHelper.completeExternalProviders ( resource , providers ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , Response.Status.BAD_REQUEST.getStatusCode ( ) ) ; } }

Target:
public void completeExternalProvidersNoNameTest ( ) { org.ovirt.engine.api.model.ExternalProviders providers = getExternalProviders ( 1 ) ; providers.getExternalProviders ( ) . get ( 0 ) . setName ( null ) ; try { org.ovirt.engine.api.restapi.resource.BackendExternalProviderHelper.completeExternalProviders ( resource , providers ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , Response.Status.BAD_REQUEST.getStatusCode ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__RECONSTRUCT_MASTER ) ; addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool_iso_map > poolDomains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDAO ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getStoragePool ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool_iso_map poolDomain : poolDomains ) { if ( ( poolDomain.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; return false ; } } return org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.InitializeVds ( ) ; }

Target:
protected boolean canDoAction ( ) { addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__RECONSTRUCT_MASTER ) ; addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool_iso_map > poolDomains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDAO ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getStoragePool ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool_iso_map poolDomain : poolDomains ) { if ( ( poolDomain.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ) { addInvalidSDStatusMessage ( poolDomain.getstatus ( ) ) ; return false ; } } return org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.InitializeVds ( ) ; }
Source:
private boolean isCopyCollapseOrNoSnapshots ( ) { return ! ( isCopyCollapseDisabledWithSnapshots ( ) ) ; }

Target:
private boolean isCopyCollapseDisabledWithSnapshotsOrWithTemplate ( ) { return ( ( ( getParameters ( ) . getVm ( ) . getSnapshots ( ) . size ( ) ) > 1 ) || ( ( ! ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals ( getVm ( ) . getVmtGuid ( ) ) ) ) && ( ( org.ovirt.engine.core.bll.ImportVmCommand.getVmTemplate ( ) ) != null ) ) ) && ( ! ( getParameters ( ) . getCopyCollapse ( ) ) ) ; }
Source:
public static void verifyIconModel ( org.ovirt.engine.api.model.Icon model , int index ) { assertEquals ( org.ovirt.engine.core.common.businessentities.VmIcon.dataUrlToTypeAndData ( org.ovirt.engine.api.restapi.resource.BackendIconsResourceTest.DATA_URLS [ index ] ) . getFirst ( ) , model.getMediaType ( ) ) ; assertEquals ( org.ovirt.engine.core.common.businessentities.VmIcon.dataUrlToTypeAndData ( org.ovirt.engine.api.restapi.resource.BackendIconsResourceTest.DATA_URLS [ index ] ) . getSecond ( ) , model.getData ( ) ) ; assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; }

Target:
public static void verifyIconModel ( org.ovirt.engine.api.model.Icon model , int index ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.common.businessentities.VmIcon.dataUrlToTypeAndData ( org.ovirt.engine.api.restapi.resource.BackendIconsResourceTest.DATA_URLS [ index ] ) . getFirst ( ) , model.getMediaType ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.common.businessentities.VmIcon.dataUrlToTypeAndData ( org.ovirt.engine.api.restapi.resource.BackendIconsResourceTest.DATA_URLS [ index ] ) . getSecond ( ) , model.getData ( ) ) ; org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageId ( ) ; if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( imageId ) ) ) { return validateImageTransfer ( imageId ) ; } else { return validateCreateImage ( ) ; } }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageId ( ) ; if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( imageId ) ) ) { return validateImageTransfer ( imageId ) ; } else if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Download ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_IMAGE_NOT_SPECIFIED_FOR_DOWNLOAD ) ; } return validateCreateImage ( ) ; }
Source:
protected java.util.Set < org.ovirt.engine.core.utils.MockConfigDescriptor < java.lang.Object > > getExtraConfigDescriptors ( ) { return new java.util.HashSet ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.LldpInformationSupported , Version.v4_1 , false ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.LldpInformationSupported , Version.v4_2 , true ) ) ) ; }

Target:
public static java.util.stream.Stream < org.ovirt.engine.core.utils.MockConfigDescriptor < ? > > mockConfiguration ( ) { return java.util.stream.Stream.concat ( org.ovirt.engine.core.bll.AbstractQueryTest.mockConfiguration ( ) , java.util.stream.Stream.of ( org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.LldpInformationSupported , Version.v4_1 , false ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.LldpInformationSupported , Version.v4_2 , true ) ) ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID , ServiceType.GLUSTER ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.RUNNING , service.getStatus ( ) ) ; service.setStatus ( GlusterServiceStatus.STOPPED ) ; dao.update ( service ) ; service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID , ServiceType.GLUSTER ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.STOPPED , service.getStatus ( ) ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID , ServiceType.GLUSTER ) ; org.junit.jupiter.api.Assertions.assertNotNull ( service ) ; org.junit.jupiter.api.Assertions.assertEquals ( GlusterServiceStatus.RUNNING , service.getStatus ( ) ) ; service.setStatus ( GlusterServiceStatus.STOPPED ) ; dao.update ( service ) ; service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID , ServiceType.GLUSTER ) ; org.junit.jupiter.api.Assertions.assertNotNull ( service ) ; org.junit.jupiter.api.Assertions.assertEquals ( GlusterServiceStatus.STOPPED , service.getStatus ( ) ) ; }