auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUpdateVolumeStatus ( ) { org.junit.Assert.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatus ( existingDistVol.getId ( ) , GlusterStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.Assert.assertNotNull ( volume ) ; org.junit.Assert.assertFalse ( volume.isOnline ( ) ) ; org.junit.Assert.assertNotEquals ( volume , existingDistVol ) ; existingDistVol.setStatus ( GlusterStatus.DOWN ) ; org.junit.Assert.assertEquals ( existingDistVol , volume ) ; }

Target:
public void testUpdateVolumeStatus ( ) { org.junit.jupiter.api.Assertions.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatus ( existingDistVol.getId ( ) , GlusterStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( volume ) ; org.junit.jupiter.api.Assertions.assertFalse ( volume.isOnline ( ) ) ; org.junit.jupiter.api.Assertions.assertNotEquals ( volume , existingDistVol ) ; existingDistVol.setStatus ( GlusterStatus.DOWN ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingDistVol , volume ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > findPermissionCheckSubjects ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( clusterId , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , actionType.getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > findPermissionCheckSubjects ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( clusterId , org.ovirt.engine.core.common.VdcObjectType.Cluster , actionType.getActionGroup ( ) ) ) ; return permissionList ; }
Source:
private static void addEmptyCD ( org.ovirt.engine.core.compat.Guid dstId ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , dstId ) , VmDeviceType.DISK , VmDeviceType.CDROM , java.util.Collections.< java.lang.String , java.lang.Object > singletonMap ( VdsProperties.Path , "" ) , true , true ) ; }

Target:
private static void addEmptyCD ( org.ovirt.engine.core.compat.Guid dstId ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , dstId ) , VmDeviceGeneralType.DISK , VmDeviceType.CDROM , java.util.Collections.< java.lang.String , java.lang.Object > singletonMap ( VdsProperties.Path , "" ) , true , true , null ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( ! ( "IsPowerManagementTabSelected" . equals ( propName ) ) ) { return ; } if ( model.getIsPowerManagementTabSelected ( ) ) { getView ( ) . showPowerManagement ( ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getView ( ) . flush ( ) ; getView ( ) . getTestButton ( ) . getCommand ( ) . Execute ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getRoleDAO ( ) ) ; existingRole = dao.get ( new org.ovirt.engine.core.compat.Guid ( "f5972bfa-7102-4d33-ad22-9dd421bfba78" ) ) ; newRole = new org.ovirt.engine.core.common.businessentities.roles ( ) ; newRole.setname ( "new role" ) ; newRole.setdescription ( "This is a new role." ) ; newRole.setType ( RoleType.USER ) ; newRole.setAllowsViewingChildren ( false ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getRoleDao ( ) ) ; existingRole = dao.get ( new org.ovirt.engine.core.compat.Guid ( "f5972bfa-7102-4d33-ad22-9dd421bfba78" ) ) ; newRole = new org.ovirt.engine.core.common.businessentities.Role ( ) ; newRole.setname ( "new role" ) ; newRole.setdescription ( "This is a new role." ) ; newRole.setType ( RoleType.USER ) ; newRole.setAllowsViewingChildren ( false ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( ) { org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainIdForQuery ( ) ; if ( Guid.Empty.equals ( storageDomainId ) ) { return new java.util.ArrayList < > ( ) ; } return org.ovirt.engine.core.bll.storage.domain.IsoDomainListSyncronizer.getInstance ( ) . getUserRequestForStorageDomainRepoFileList ( storageDomainId , org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getParameters ( ) . getImageType ( ) , org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getParameters ( ) . getForceRefresh ( ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( ) { org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainIdForQuery ( ) ; if ( Guid.Empty.equals ( storageDomainId ) ) { return new java.util.ArrayList < > ( ) ; } return isoDomainListSynchronizer.getUserRequestForStorageDomainRepoFileList ( storageDomainId , org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getParameters ( ) . getImageType ( ) , org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getParameters ( ) . getForceRefresh ( ) ) ; }
Source:
public void massUpdateNumaNode ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > numaNodes ) { for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode node : numaNodes ) { update ( node ) ; } }

Target:
public void massUpdateNumaNodeStatistics ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > numaNodes ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList ( numaNodes.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode node : numaNodes ) { executions.add ( createNumaNodeStatisticsParametersMapper ( node ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "UpdateNumaNodeStatistics" , executions ) ; }
Source:
private void showPreviouslyShownDialog ( ) { getDiskModel ( ) . getEntity ( ) . updateBootableFrom ( parentModel.getAllCurrentDisksModels ( ) ) ; if ( ( getDiskModel ( ) . getEntity ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel ) { maybeLoadAttachableDisks ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel ) ( getDiskModel ( ) . getEntity ( ) ) ) ) ; } showDialog ( getDiskModel ( ) . getEntity ( ) ) ; }

Target:
private void showPreviouslyShownDialog ( ) { getDiskModel ( ) . getEntity ( ) . updateBootableFrom ( parentModel.getAllCurrentDisksModels ( ) ) ; if ( ( getDiskModel ( ) . getEntity ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel ) { maybeLoadAttachableDisks ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel ) ( getDiskModel ( ) . getEntity ( ) ) ) ) ; } setDiskModel ( getDiskModel ( ) . getEntity ( ) ) ; }
Source:
private void initVm ( ) { vm_1_vdsm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm_1_db = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm_1_db.setId ( org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfoTest.VM_1 ) ; vm_1_vdsm.setId ( org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfoTest.VM_1 ) ; vm_1_db.setStatus ( VMStatus.WaitForLaunch ) ; vm_1_vdsm.setStatus ( VMStatus.Up ) ; vm_1_db.setName ( "vm-prod-mailserver" ) ; vm_1_vdsm.setName ( "vm-prod-mailserver" ) ; org.mockito.Mockito.when ( vmDynamicDao.get ( org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfoTest.VM_1 ) ) . thenReturn ( vm_1_db.getDynamicData ( ) ) ; }

Target:
private void initVm ( ) { vm_1_vdsm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm_1_db = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm_1_db.setId ( org.ovirt.engine.core.vdsbroker.HostMonitoringTest.VM_1 ) ; vm_1_vdsm.setId ( org.ovirt.engine.core.vdsbroker.HostMonitoringTest.VM_1 ) ; vm_1_db.setStatus ( VMStatus.WaitForLaunch ) ; vm_1_vdsm.setStatus ( VMStatus.Up ) ; vm_1_db.setName ( "vm-prod-mailserver" ) ; vm_1_vdsm.setName ( "vm-prod-mailserver" ) ; org.mockito.Mockito.when ( vmDynamicDao.get ( org.ovirt.engine.core.vdsbroker.HostMonitoringTest.VM_1 ) ) . thenReturn ( vm_1_db.getDynamicData ( ) ) ; }
Source:
public void testNeedToProcessHardwareCapsTrue ( ) { org.ovirt.engine.core.common.businessentities.VDS oldVds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; oldVds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldVds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldVds.setCpuFlags ( "flag1" ) ; org.ovirt.engine.core.common.businessentities.VDS newVds = oldVds.clone ( ) ; newVds.setCpuFlags ( "flag2" ) ; org.junit.Assert.assertTrue ( virtStrategy.processHardwareCapabilitiesNeeded ( oldVds , newVds ) ) ; }

Target:
public void testNeedToProcessHardwareCapsTrue ( ) { org.ovirt.engine.core.common.businessentities.VDS oldVds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; oldVds.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldVds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldVds.setCpuFlags ( "flag1" ) ; org.ovirt.engine.core.common.businessentities.VDS newVds = oldVds.clone ( ) ; newVds.setCpuFlags ( "flag2" ) ; org.junit.Assert.assertTrue ( virtStrategy.processHardwareCapabilitiesNeeded ( oldVds , newVds ) ) ; }
Source:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; if ( status != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( status ) ; } if ( ! valid ) { if ( status.isStorageDomainInProcess ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; } addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }

Target:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; if ( status != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( status ) ; } if ( ! valid ) { if ( status.isStorageDomainInProcess ( ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; } addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }
Source:
public void testPositiveCanDoActionWithDisks ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getSnappableVmDisks ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testPositiveCanDoActionWithDisks ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }
Source:
protected void init ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setStoragePoolId ( parameters.getStoragePoolId ( ) ) ; imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap ( ) ; }

Target:
protected void init ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setVdsGroupId ( parameters.getVdsGroupId ( ) ) ; setVm ( parameters.getVm ( ) ) ; }
Source:
public void testParseMultiple ( ) { java.util.List < org.ovirt.engine.api.model.PowerManagement > ret = org.ovirt.engine.api.restapi.util.FencingOptionsParser.parse ( "foo:one=1,two=2,three=3;bar:ninetynine=99" , "one=bool,two=int,three=bool,ninetynine=int" ) ; assertNotNull ( ret ) ; assertEquals ( 2 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; verifyResult ( ret.get ( 1 ) , "bar" , "ninetynine" , "int" , "99" ) ; }

Target:
public void testParseMultiple ( ) { java.util.List < org.ovirt.engine.api.model.PowerManagement > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three=3;bar:ninetynine=99" , "one=bool,two=int,three=bool,ninetynine=int" ) ; assertNotNull ( ret ) ; assertEquals ( 2 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; verifyResult ( ret.get ( 1 ) , "bar" , "ninetynine" , "int" , "99" ) ; }
Source:
public void testGetNetworkNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNetworkNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: get ) ) ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedBonds ( org.ovirt.engine.core.compat.Guid ... ids ) { if ( emptyParameters ( ids ) ) { return this ; } if ( ( parameters.getRemovedBonds ( ) ) == null ) { parameters.setRemovedBonds ( new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ) ; } parameters.getRemovedBonds ( ) . addAll ( java.util.Arrays.asList ( ids ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedBonds ( org.ovirt.engine.core.compat.Guid ... ids ) { if ( nullParameters ( ids ) ) { return this ; } if ( ( parameters.getRemovedBonds ( ) ) == null ) { parameters.setRemovedBonds ( new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ) ; } parameters.getRemovedBonds ( ) . addAll ( java.util.Arrays.asList ( ids ) ) ; return this ; }
Source:
protected boolean isInterfaceSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ! ( ( DiskInterface.VirtIO.equals ( disk.getDiskInterface ( ) ) ) || ( DiskInterface.VirtIO_SCSI.equals ( disk.getDiskInterface ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO ) ; return false ; } return true ; }

Target:
protected boolean isHotPlugDiskSnapshotSupported ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.hotPlugDiskSnapshot ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVds ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.HOT_PLUG_DISK_SNAPSHOT_IS_NOT_SUPPORTED ) ; } return true ; }
Source:
protected org.ovirt.engine.core.compat.Guid generateNewDiskId ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.compat.Guid newGuidForDisk = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; newDiskIdForDisk.put ( newGuidForDisk , org.ovirt.engine.core.common.businessentities.DiskImage.copyOf ( disk ) ) ; disk.setId ( newGuidForDisk ) ; disk.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return newGuidForDisk ; }

Target:
protected void postConstruct ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setStoragePoolId ( parameters.getStoragePoolId ( ) ) ; imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap ( ) ; }
Source:
org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > createActionTable ( com.google.gwt.event.shared.EventBus eventBus , org.ovirt.engine.ui.common.system.ClientStorage clientStorage ) { return new org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > ( modelProvider , getTableHeaderlessResources ( ) , getTableResources ( ) , eventBus , clientStorage ) ; }

Target:
org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > createActionTable ( com.google.gwt.event.shared.EventBus eventBus , org.ovirt.engine.ui.common.system.ClientStorage clientStorage ) { return new org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > ( modelProvider , getTableHeaderlessResources ( ) , getTableResources ( ) , eventBus , clientStorage ) { { if ( useTableWidgetForContent ( ) ) { enableHeaderContextMenu ( ) ; } } } ; }
Source:
public static void getMaxVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean is64 ) { 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 262144 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ( is64 ? org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
public void testRangeCanContainOnlyIntSizeNumberOfElements ( ) throws java.lang.Exception { org.apache.commons.lang.math.LongRange longRange = org.ovirt.engine.core.utils.MacAddressRangeUtils.clipRange ( new org.apache.commons.lang.math.LongRange ( 0 , java.lang.Long.MAX_VALUE ) ) ; org.ovirt.engine.core.bll.network.macpoolmanager.Range range = new org.ovirt.engine.core.bll.network.macpoolmanager.Range ( longRange.getMinimumLong ( ) , longRange.getMaximumLong ( ) ) ; org.junit.Assert.assertThat ( range.getAvailableCount ( ) , org.hamcrest.CoreMatchers.is ( java.lang.Integer.MAX_VALUE ) ) ; }

Target:
public void testRangeCanContainOnlyIntSizeNumberOfElements ( ) throws java.lang.Exception { org.apache.commons.lang.math.LongRange longRange = org.ovirt.engine.core.utils.MacAddressRangeUtils.clipRange ( new org.apache.commons.lang.math.LongRange ( 0 , java.lang.Long.MAX_VALUE ) ) ; org.ovirt.engine.core.bll.network.macpool.Range range = new org.ovirt.engine.core.bll.network.macpool.Range ( longRange.getMinimumLong ( ) , longRange.getMaximumLong ( ) ) ; org.junit.Assert.assertThat ( range.getAvailableCount ( ) , org.hamcrest.CoreMatchers.is ( java.lang.Integer.MAX_VALUE ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private static void validateDisksUsagesList ( org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics , java.lang.Object [ ] disksUsages , java.util.Map < java.lang.String , java.lang.Object > xml ) { org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( disksUsages ) , new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserializeUnformattedJson ( vmStatistics.getDisksUsage ( ) , java.util.ArrayList.class ) ) ; }

Target:
private void validateDisksUsagesList ( org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics , java.lang.Object [ ] disksUsages , java.util.Map < java.lang.String , java.lang.Object > xml ) { vdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( disksUsages ) , new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserializeUnformattedJson ( vmStatistics.getDisksUsage ( ) , java.util.ArrayList.class ) ) ; }
Source:
public void testVmDiskWithValues ( ) { org.ovirt.engine.sdk4.internal.containers.VmContainer vm = new org.ovirt.engine.sdk4.internal.containers.VmContainer ( ) ; vm.disks ( java.util.Arrays.asList ( ( ( org.ovirt.engine.sdk4.types.Disk ) ( new org.ovirt.engine.sdk4.internal.containers.DiskContainer ( ) ) ) ) ) ; org.junit.Assert.assertNotNull ( vm.disks ( ) ) ; org.junit.Assert.assertEquals ( 1 , vm.disks ( ) . size ( ) ) ; org.junit.Assert.assertNotNull ( vm.disks ( ) . get ( 0 ) ) ; }

Target:
public void testVmDiskWithValues ( ) { org.ovirt.engine.sdk4.internal.containers.VmContainer vm = new org.ovirt.engine.sdk4.internal.containers.VmContainer ( ) ; vm.diskAttachments ( java.util.Arrays.asList ( ( ( org.ovirt.engine.sdk4.types.DiskAttachment ) ( new org.ovirt.engine.sdk4.internal.containers.DiskAttachmentContainer ( ) ) ) ) ) ; org.junit.Assert.assertNotNull ( vm.diskAttachments ( ) ) ; org.junit.Assert.assertEquals ( 1 , vm.diskAttachments ( ) . size ( ) ) ; org.junit.Assert.assertNotNull ( vm.diskAttachments ( ) . get ( 0 ) ) ; }
Source:
private void releaseVolumeLock ( org.ovirt.engine.core.compat.Guid taskId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity vol = getVolumeDao ( ) . getVolumeByGlusterTask ( taskId ) ; if ( vol != null ) { releaseLock ( vol.getId ( ) ) ; } else { org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJob.log.debugFormat ( "Did not find a volume associated with task {0}" , taskId ) ; } }

Target:
private void createJobForTaskFromCLI ( final org.ovirt.engine.core.common.businessentities.VDSGroup cluster , final org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { 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 ( ) { try { createJobToMonitor ( cluster , task ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJob.log.error ( "Error creating job for task from CLI" , e ) ; } return null ; } } ) ; } } ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > vmsIds ) { return getCallsHandler ( ) . executeReadList ( "GetVmsByIds" , org.ovirt.engine.core.dao.VmDaoImpl.VMRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vms_ids" , org.apache.commons.lang.StringUtils.join ( vmsIds , ',' ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > vmsIds ) { java.lang.Object [ ] uuids = vmsIds.stream ( ) . map ( Guid :: getUuid ) . toArray ( ) ; return getCallsHandler ( ) . executeReadList ( "GetVmsByIds" , org.ovirt.engine.core.dao.VmDaoImpl.VMRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vms_ids" , createArrayOf ( "uuid" , uuids ) ) ) ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateQuotaByCluster ( null , null ) ; updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateVirtioScsiAvailability ( ) ; updateOSValues ( ) ; updateTemplate ( ) ; updateNumOfSockets ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateQuotaByCluster ( null , null ) ; updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateVirtioScsiAvailability ( ) ; updateOSValues ( ) ; updateTemplate ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { updateCpuProfile ( getModel ( ) . getSelectedCluster ( ) . getId ( ) , getModel ( ) . getSelectedCluster ( ) . getcompatibility_version ( ) , vm.getCpuProfileId ( ) ) ; } }
Source:
public java.util.Map < java.lang.String , java.lang.String > convertToStatusList ( ) { java.util.HashMap < java.lang.String , java.lang.String > result = new java.util.HashMap < > ( ) ; for ( java.util.Map < java.lang.String , java.lang.Object > st : this . statusList ) { java.lang.String status = st.get ( "status" ) . toString ( ) ; java.lang.String id = st.get ( "id" ) . toString ( ) ; result.put ( id , status ) ; } return result ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > convertToStatusList ( ) { return java.util.Arrays.stream ( statusList ) . collect ( java.util.stream.Collectors.toMap ( ( s ) -> s.get ( "id" ) . toString ( ) , ( s ) -> s.get ( "status" ) . toString ( ) ) ) ; }
Source:
public void testRemoveByNetworkId ( ) { org.ovirt.engine.core.compat.Guid networkAttachmentId = networkAttachment.getId ( ) ; org.ovirt.engine.core.compat.Guid networkIdUsedForAttachmentRemoval = networkAttachment.getNetworkId ( ) ; dao.save ( networkAttachment ) ; org.junit.Assert.assertNotNull ( dao.get ( networkAttachmentId ) ) ; dao.removeByNetworkId ( networkIdUsedForAttachmentRemoval ) ; org.junit.Assert.assertNull ( dao.get ( networkAttachmentId ) ) ; }

Target:
public void testRemoveByNetworkId ( ) { org.ovirt.engine.core.compat.Guid networkAttachmentId = networkAttachment.getId ( ) ; org.ovirt.engine.core.compat.Guid networkIdUsedForAttachmentRemoval = networkAttachment.getNetworkId ( ) ; dao.save ( networkAttachment ) ; org.junit.jupiter.api.Assertions.assertNotNull ( dao.get ( networkAttachmentId ) ) ; dao.removeByNetworkId ( networkIdUsedForAttachmentRemoval ) ; org.junit.jupiter.api.Assertions.assertNull ( dao.get ( networkAttachmentId ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" ) ; if ( ! ( network.isSetId ( ) ) ) { network.setId ( getNetworkId ( network.getName ( ) , clusterId ) ) ; } org.ovirt.engine.api.model.Network entity = map ( network ) ; return performCreation ( addAction , getActionParameters ( network , entity ) , new org.ovirt.engine.api.restapi.resource.NetworkIdResolver ( network.getName ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" ) ; if ( ! ( network.isSetId ( ) ) ) { network.setId ( getNetworkId ( network.getName ( ) , clusterId ) ) ; } org.ovirt.engine.api.model.Network entity = map ( network ) ; return performCreate ( addAction , getActionParameters ( network , entity ) , new org.ovirt.engine.api.restapi.resource.NetworkIdResolver ( network.getName ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlanDevice ( java.lang.String underlyingNic , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = new org.ovirt.engine.core.common.businessentities.network.Vlan ( ) ; vlan.setNetworkName ( network.getName ( ) ) ; vlan.setVdsId ( hostId ) ; vlan.setName ( ( ( underlyingNic + "." ) + ( network.getVlanId ( ) ) ) ) ; vlan.setBootProtocol ( NetworkBootProtocol.NONE ) ; return vlan ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlanDevice ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = new org.ovirt.engine.core.common.businessentities.network.Vlan ( ) ; vlan.setNetworkName ( network.getName ( ) ) ; vlan.setVdsId ( hostId ) ; vlan.setName ( org.ovirt.engine.core.utils.NetworkUtils.getVlanDeviceName ( nic , network ) ) ; vlan.setBootProtocol ( NetworkBootProtocol.NONE ) ; return vlan ; }
Source:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setstatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . sethibernation_vol_handle ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setHibernationVolHandle ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }
Source:
protected void executeQuery ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > results = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LdapUser > ( ) ; for ( org.ovirt.engine.core.compat.Guid guid : getUserIds ( ) ) { org.ovirt.engine.core.common.businessentities.LdapUser user = org.ovirt.engine.core.bll.adbroker.InternalBrokerUtils.getUserByUserGuid ( guid ) ; if ( user != null ) { results.add ( user ) ; } } setReturnValue ( results ) ; setSucceeded ( true ) ; }

Target:
protected void executeQuery ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > results = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LdapUser > ( ) ; for ( org.ovirt.engine.core.common.utils.ExternalId id : getUserIds ( ) ) { org.ovirt.engine.core.common.businessentities.LdapUser user = org.ovirt.engine.core.bll.adbroker.InternalBrokerUtils.getUserById ( id ) ; if ( user != null ) { results.add ( user ) ; } } setReturnValue ( results ) ; setSucceeded ( true ) ; }
Source:
public void getUsbPolicyUsbTypeLegacy ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "legacy" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicySetDisabled ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( false ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb ) , UsbPolicy.DISABLED ) ; }
Source:
public void testCompleteSubFieldAlternatives ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; vm.getHost ( ) . setName ( "zog" ) ; org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "host.id|name" ) ; }

Target:
public void testCompleteSubFieldAlternatives ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; vm.getHost ( ) . setName ( "zog" ) ; org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "host.id|name" ) ; }
Source:
public void testGetDefaultQuotaToDCWithoutDefaultQuotaWithNoReuse ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true , false ) . getFirst ( ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }

Target:
public void testGetDefaultQuotaToDCWithoutDefaultQuotaWithNoReuse ( ) throws java.lang.Exception { java.lang.String defaultQuotaName = quotaHelper.getDefaultQuotaName ( storagePool.getname ( ) ) ; org.mockito.Mockito.when ( quotaHelper.generateDefaultQuotaName ( storagePool ) ) . thenReturn ( defaultQuotaName ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true , false ) . getFirst ( ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }
Source:
protected org.ovirt.engine.core.dao.StorageServerConnectionLunMapDao setUpStorageServerConnectionLunMapDao ( ) { storageServerConnectionLunMapDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDao.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionLunMapDao ( ) ) . thenReturn ( storageServerConnectionLunMapDao ) ; return storageServerConnectionLunMapDao ; }

Target:
private void prepareMocks ( ) { vdsBrokerFrontendMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.VDSBrokerFrontend.class ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontendMock ) . when ( getQuery ( ) ) . getVdsBroker ( ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionDao ( ) ) . thenReturn ( storageServerConnectionDao ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionLunMapDao ( ) ) . thenReturn ( storageServerConnectionLunMapDao ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( lunDao ) ; }
Source:
protected boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { return org.ovirt.engine.core.bll.ImagesHandler.checkImageConfiguration ( destStorages.get ( diskInfoDestinationMap.get ( diskImage.getId ( ) ) . getStorageIds ( ) . get ( 0 ) ) . getStorageStaticData ( ) , diskImage , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected void updateOriginalTemplate ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { }
Source:
private void logResultOfPrestartVms ( int prestartedVmsCounter , int numOfVmsToPrestart , org.ovirt.engine.core.compat.Guid vmPoolId ) { if ( prestartedVmsCounter > 0 ) { org.ovirt.engine.core.bll.VmPoolMonitor.log.info ( "Prestarted Vms out of the required, in VmPool '{}'" , prestartedVmsCounter , numOfVmsToPrestart , vmPoolId ) ; } else { org.ovirt.engine.core.bll.VmPoolMonitor.log.info ( "Failed to prestart any Vms for VmPool '{}'" , vmPoolId ) ; } }

Target:
private void collectVmPrestartFailureReasons ( java.util.Map < java.lang.String , java.lang.Integer > failureReasons , java.util.List < java.lang.String > messages ) { if ( org.ovirt.engine.core.bll.VmPoolMonitor.log.isInfoEnabled ( ) ) { java.lang.String reason = messages.stream ( ) . filter ( ErrorMessageUtils :: isMessage ) . collect ( java.util.stream.Collectors.joining ( ", " ) ) ; java.lang.Integer count = failureReasons.get ( reason ) ; failureReasons.put ( reason , ( count == null ? 1 : count + 1 ) ) ; } }
Source:
public void setSelection ( java.lang.Boolean value ) { if ( ( ( selection ) == null ) && ( value == null ) ) { return ; } if ( ( ( selection ) == null ) || ( ! ( selection.equals ( value ) ) ) ) { selection = value ; getSelectionChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "Selection" ) ) ; } }

Target:
public void setSelection ( java.lang.Boolean value ) { if ( ( ( selection ) == null ) && ( value == null ) ) { return ; } if ( ( ( selection ) == null ) || ( ! ( selection.equals ( value ) ) ) ) { selection = value ; getSelectionChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Selection" ) ) ; } }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void testNoMemoryPciPassthroughSuccess ( ) { cmd.getParameters ( ) . setSaveMemory ( false ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotsForVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void testNoMemoryPciPassthroughSuccess ( ) { cmd.getParameters ( ) . setSaveMemory ( false ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getBroker ( ) . migrateCancel ( org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . getVmId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . getVmId ( ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getBroker ( ) . migrateCancel ( vmId.toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . RemoveAsyncRunningVm ( vmId ) ; }
Source:
public static java.lang.String getHugePageSize ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.common.utils.customprop.SimpleCustomPropertiesUtil util = org.ovirt.engine.core.common.utils.customprop.SimpleCustomPropertiesUtil.getInstance ( ) ; java.util.Map < java.lang.String , java.lang.String > customProperties = util.convertProperties ( vm.getCustomProperties ( ) ) ; return customProperties.get ( "hugepages" ) ; }

Target:
public static java.util.Optional < java.lang.Integer > getHugePageSize ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.common.utils.customprop.SimpleCustomPropertiesUtil util = org.ovirt.engine.core.common.utils.customprop.SimpleCustomPropertiesUtil.getInstance ( ) ; java.util.Map < java.lang.String , java.lang.String > customProperties = util.convertProperties ( vm.getCustomProperties ( ) ) ; java.lang.String hugePageStr = customProperties.get ( "hugepages" ) ; if ( hugePageStr == null ) { return java.util.Optional.empty ( ) ; } try { return java.util.Optional.of ( java.lang.Integer.parseInt ( hugePageStr ) ) ; } catch ( java.lang.NumberFormatException e ) { return java.util.Optional.empty ( ) ; } }