auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void GetHighUtilizationForPowerSave ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HighUtilizationForPowerSave , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetLowUtilizationForPowerSave ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LowUtilizationForPowerSave , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private static void addAddress ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { java.util.Map < java.lang.String , java.lang.String > addressMap = org.ovirt.engine.core.utils.StringUtils.string2Map ( vmDevice.getAddress ( ) ) ; if ( ( addressMap.size ( ) ) > 0 ) { struct.add ( VdsProperties.Address , addressMap ) ; } }

Target:
private static void addAddress ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { java.util.Map < java.lang.String , java.lang.String > addressMap = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( vmDevice.getAddress ( ) ) ; if ( ( addressMap.size ( ) ) > 0 ) { struct.add ( VdsProperties.Address , addressMap ) ; } }
Source:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) , org.hamcrest.CoreMatchers.hasItem ( UPGRADE_ERROR.VM_NUMA_PINNED ) ) ; }

Target:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( UpgradeError.VM_NUMA_PINNED ) ; }
Source:
public void testReorderMacAddresses ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , control.createMock ( org.ovirt.engine.api.model.VM.class ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.ReorderVmNics , org.ovirt.engine.core.common.action.VmOperationParameterBase.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.reorderMacAddresses ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testReorderMacAddresses ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , control.createMock ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.ReorderVmNics , org.ovirt.engine.core.common.action.VmOperationParameterBase.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.reorderMacAddresses ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public java.lang.String getItemsCountString ( ) { if ( ( getItems ( ) ) == null ) { return "" ; } int fromItemCount = ( ( getSearchPageSize ( ) ) * ( ( getSearchPageNumber ( ) ) - 1 ) ) + 1 ; int toItemCount = ( fromItemCount - 1 ) + ( ( ( java.util.List ) ( getItems ( ) ) ) . size ( ) ) ; if ( ( toItemCount == 0 ) || ( fromItemCount > toItemCount ) ) { return "" ; } return ( fromItemCount + "-" ) + toItemCount ; }

Target:
public java.lang.String getItemsCountString ( ) { if ( ( getItems ( ) ) == null ) { return "" ; } int fromItemCount = ( ( getSearchPageSize ( ) ) * ( ( getSearchPageNumber ( ) ) - 1 ) ) + 1 ; int toItemCount = ( fromItemCount - 1 ) + ( ( ( java.util.Collection ) ( getItems ( ) ) ) . size ( ) ) ; if ( ( toItemCount == 0 ) || ( fromItemCount > toItemCount ) ) { return "" ; } return ( fromItemCount + "-" ) + toItemCount ; }
Source:
public void testIscsiLunCanBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; org.mockito.Mockito.when ( diskLunMapDAO.getDiskIdByLunId ( disk.getLun ( ) . getLUN_id ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed for valid iscsi lun" , command.checkIfLunDiskCanBeAdded ( ) ) ; }

Target:
public void testIscsiLunCanBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; org.mockito.Mockito.when ( diskLunMapDAO.getDiskIdByLunId ( disk.getLun ( ) . getLUN_id ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed for valid iscsi lun" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; }
Source:
private void failureEventHandler ( final java.lang.String description , final java.lang.String errorMessage ) { handleNotLoggedInEvent ( errorMessage ) ; frontendFailureEvent.raise ( org.ovirt.engine.ui.frontend.Frontend.class , new org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ( new org.ovirt.engine.ui.frontend.Message ( description , errorMessage ) ) ) ; }

Target:
private void failureEventHandler ( final java.lang.Throwable caught ) { java.lang.String errorMessage ; if ( caught instanceof com.google.gwt.user.client.rpc.StatusCodeException ) { errorMessage = ( ( getConstants ( ) . requestToServerFailedWithCode ( ) ) + ": " ) + ( ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( caught ) ) . getStatusCode ( ) ) ; } else { errorMessage = ( ( getConstants ( ) . requestToServerFailed ( ) ) + ": " ) + ( caught.getLocalizedMessage ( ) ) ; } failureEventHandler ( null , java.util.Collections.singletonList ( errorMessage ) ) ; }
Source:
public void testCDAStoragePoolHasTasks ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > tasks = java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( tasks ) . when ( asyncTaskDAOMock ) . getAsyncTaskIdsByStoragePoolId ( storagePoolId ) ; org.junit.Assert.assertFalse ( "canDoAction did not fail on a Storage Pool with running tasks" , command.canDoAction ( ) ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkMessagesContains ( command , VdcBllMessages.CANNOT_FORCE_SELECT_SPM_STORAGE_POOL_HAS_RUNNING_TASKS ) ; }

Target:
public void testCDAVdsNotUp ( ) { vds.setStatus ( VDSStatus.Down ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( "canDoAction did not fail for a VDS with a status different from UP" , command , VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_NOT_UP ) ; }
Source:
public void setUp ( ) { vm = createVm ( ) ; validator = new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) ) . thenReturn ( vmNetworkInterfaceDao ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVnicProfileDao ( ) ) . thenReturn ( vnicProfileDao ) ; }

Target:
public void setUp ( ) { vm = createVm ( ) ; validator = new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao.class , vmNetworkInterfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.VnicProfileDao.class , vnicProfileDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.DiskVmElementDao.class , diskVmElementDao ) ; }
Source:
protected void removeOvfForTemplatesAndVmsOfStoragePool ( org.ovirt.engine.core.compat.Guid poolId ) { java.util.List < org.ovirt.engine.core.compat.Guid > idsForRemoval = getVmAndTemplatesGenerationsDao ( ) . getIdsForOvfDeletion ( poolId ) ; if ( ! ( idsForRemoval.isEmpty ( ) ) ) { for ( org.ovirt.engine.core.compat.Guid id : idsForRemoval ) { executeRemoveVmInSpm ( poolId , id , Guid.Empty ) ; } getVmAndTemplatesGenerationsDao ( ) . deleteOvfGenerations ( idsForRemoval ) ; } }

Target:
protected void removeOvfForTemplatesAndVmsOfStoragePool ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { org.ovirt.engine.core.compat.Guid poolId = pool.getId ( ) ; removedOvfIdsInfo = getVmAndTemplatesGenerationsDao ( ) . getIdsForOvfDeletion ( poolId ) ; if ( ! ( ovfOnAnyDomainSupported ( pool ) ) ) { for ( org.ovirt.engine.core.compat.Guid id : removedOvfIdsInfo ) { executeRemoveVmInSpm ( poolId , id , Guid.Empty ) ; } } markDomainsWithOvfsForOvfUpdate ( removedOvfIdsInfo ) ; getVmAndTemplatesGenerationsDao ( ) . deleteOvfGenerations ( removedOvfIdsInfo ) ; }
Source:
public 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.storage.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.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getVmTemplatesByBaseTemplateId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid baseTemplate ) { asyncQuery.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.VmTemplate > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesByBaseTemplateId , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( baseTemplate ) , asyncQuery ) ; }
Source:
public void init ( ) { super . init ( ) ; getIsAutoAssign ( ) . setEntity ( true ) ; getCustomPropertySheet ( ) . setKeyValueString ( customPropertiesKeysList ) ; getCustomPropertySheet ( ) . deserialize ( vm.getCustomProperties ( ) ) ; loadHosts ( ) ; }

Target:
public void init ( ) { super . init ( ) ; getIsAutoAssign ( ) . setEntity ( true ) ; getCustomPropertySheet ( ) . setKeyValueString ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getCustomPropertiesList ( ) . get ( vm.getVdsGroupCompatibilityVersion ( ) ) ) ; getCustomPropertySheet ( ) . deserialize ( vm.getCustomProperties ( ) ) ; loadHosts ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getNetworkDao ( ) ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setname ( "newnet1" ) ; new_net.setdescription ( "New network" ) ; new_net.setstorage_pool_id ( datacenter ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getNetworkDao ( ) ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setName ( "newnet1" ) ; new_net.setDescription ( "New network" ) ; new_net.setDataCenterId ( datacenter ) ; }
Source:
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.VDS > ( ) ; } return source ; }

Target:
public T convert ( java.lang.Object source ) { java.lang.Iterable < T > iterable = ( ( java.lang.Iterable < T > ) ( source ) ) ; java.util.Iterator < T > iterator = iterable.iterator ( ) ; while ( iterator.hasNext ( ) ) { return iterator.next ( ) ; } return null ; }
Source:
public void canDoActionWrongStorage ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic nfsStatic = createStorageDomain ( ) ; nfsStatic.setStorageType ( StorageType.NFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setStorageStaticData ( nfsStatic ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setStoragePoolId ( spId ) ; org.mockito.Mockito.doReturn ( sd ) . when ( cmd ) . getStorageDomain ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; }

Target:
public void validateWrongStorage ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic nfsStatic = createStorageDomain ( ) ; nfsStatic.setStorageType ( StorageType.NFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setStorageStaticData ( nfsStatic ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setStoragePoolId ( spId ) ; org.mockito.Mockito.doReturn ( sd ) . when ( cmd ) . getStorageDomain ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected abstract void performProfilesActions ( org.ovirt.engine.core.compat.Guid networkGuid ) ;

Target:
private void initProfiles ( ) { java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > existingProfiles = getProfiles ( ) . getItems ( ) ; if ( existingProfiles == null ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > profiles = new java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ( ) ; profiles.add ( getDefaultProfile ( ) ) ; getProfiles ( ) . setItems ( profiles ) ; } else { for ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profile : existingProfiles ) { profile.updateDc ( getSelectedDc ( ) . getcompatibility_version ( ) , getSelectedDc ( ) . getId ( ) ) ; } } }
Source:
public void queryFailed ( ) { getWindow ( ) . stopProgress ( ) ; cancel ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { setWindow ( null ) ; setGuideContext ( returnValue.getActionReturnValue ( ) ) ; updateActionAvailability ( ) ; getGuideCommand ( ) . execute ( ) ; } else { cancel ( ) ; } super . executed ( result ) ; }
Source:
private void MigrationMode_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) == ( getMigrationMode ( ) . getSelectedItem ( ) ) ) { getHostCpu ( ) . setIsChangable ( true ) ; } else { getHostCpu ( ) . setEntity ( false ) ; getHostCpu ( ) . setIsChangable ( false ) ; } behavior.updateCpuPinningVisibility ( ) ; }

Target:
private void setIsRunAndPause ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.NotChangableForVmInPoolEntityModel value ) { privateIsRunAndPause = value ; }
Source:
public static org.ovirt.engine.core.compat.RpmVersion getOvirtHostOsVersion ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.compat.RpmVersion vdsOsVersion = null ; try { vdsOsVersion = new org.ovirt.engine.core.compat.RpmVersion ( vds.gethost_os ( ) , "RHEV Hypervisor -" , true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.VdsHandler.log.errorFormat ( "Failed to parse version of Host {0},{1} and Host OS '{2}' with error {3}" , vds.getId ( ) , vds.getvds_name ( ) , vds.gethost_os ( ) , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } return vdsOsVersion ; }

Target:
public static org.ovirt.engine.core.compat.RpmVersion getOvirtHostOsVersion ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.compat.RpmVersion vdsOsVersion = null ; try { vdsOsVersion = new org.ovirt.engine.core.compat.RpmVersion ( vds.getHostOs ( ) , "RHEV Hypervisor -" , true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.VdsHandler.log.errorFormat ( "Failed to parse version of Host {0},{1} and Host OS '{2}' with error {3}" , vds.getId ( ) , vds.getName ( ) , vds.getHostOs ( ) , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } return vdsOsVersion ; }
Source:
public void failRunStatelessHA_VM ( ) { canRunVmAsStateless ( true , false , true , true , false , VdcBllMessages.VM_CANNOT_RUN_STATELESS_HA ) ; canRunVmAsStateless ( true , false , true , null , false , VdcBllMessages.VM_CANNOT_RUN_STATELESS_HA ) ; canRunVmAsStateless ( true , false , false , true , false , VdcBllMessages.VM_CANNOT_RUN_STATELESS_HA ) ; }

Target:
public void failRunStatelessHA_VM ( ) { canRunVmAsStateless ( true , false , true , true , false , EngineMessage.VM_CANNOT_RUN_STATELESS_HA ) ; canRunVmAsStateless ( true , false , true , null , false , EngineMessage.VM_CANNOT_RUN_STATELESS_HA ) ; canRunVmAsStateless ( true , false , false , true , false , EngineMessage.VM_CANNOT_RUN_STATELESS_HA ) ; }
Source:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . getAllForTemplate ( getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . remove ( iface.getId ( ) ) ; } }

Target:
protected void removeNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . getAllForTemplate ( getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . remove ( iface.getId ( ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc glusterSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withOptionalParameter ( "description" , description ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc glusterSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withOptionalParameter ( "snapDescription" , description ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc ( response ) ; }
Source:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getstatus ( ) ; if ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( org.ovirt.engine.core.common.businessentities.VM.isGuestUp ( runningVm.getstatus ( ) ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; vmToUpdate.setmigrating_to_vds ( null ) ; } }

Target:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getstatus ( ) ; if ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( org.ovirt.engine.core.common.businessentities.VM.isGuestUp ( runningVm.getstatus ( ) ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setmigrating_to_vds ( null ) ; } }
Source:
public static java.lang.String toJson ( final java.util.List < org.ovirt.engine.core.bll.validator.InClusterUpgradeValidator.UpgradeError > vm ) { final org.codehaus.jackson.map.ObjectMapper mapper = new org.codehaus.jackson.map.ObjectMapper ( ) ; mapper.setSerializationInclusion ( JsonSerialize.Inclusion.NON_NULL ) ; try { return mapper.writerWithDefaultPrettyPrinter ( ) . writeValueAsString ( new org.ovirt.engine.core.bll.validator.InClusterUpgradeValidator.VmValidation ( vm ) ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public org.ovirt.engine.core.bll.ValidationResult checkClusterUpgradeIsEnabled ( final org.ovirt.engine.core.common.businessentities.Cluster cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.MIXED_HOST_VERSIONS_NOT_ALLOWED ) . when ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.CheckMixedRhelVersions , cluster.getCompatibilityVersion ( ) . getValue ( ) ) ) ; }
Source:
private void handleFinalizingFailure ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { log.error ( "Finalizing failed transfer. {}" , getTransferDescription ( ) ) ; stopImageTransferSession ( context.entity ) ; setImageStatus ( ImageStatus.ILLEGAL ) ; updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; }

Target:
private void handleFinalizingFailure ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { log.error ( "Finalizing failed transfer. {}" , getTransferDescription ( ) ) ; stopImageTransferSession ( context.entity ) ; setImageStatus ( ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Upload ) ? org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL : org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) ; updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; setAuditLogTypeFromPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void GetAllProviders ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.validator.HostValidator mockHostForUniqueId ( java.lang.String value ) { mockConfigRule.mockConfigValue ( ConfigValues.InstallVds , java.lang.Boolean.TRUE ) ; org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( host.getUniqueId ( ) ) . thenReturn ( value ) ; return new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; }

Target:
private org.ovirt.engine.core.bll.validator.HostValidator mockHostForUniqueId ( java.lang.String value ) { mockConfigRule.mockConfigValue ( ConfigValues.InstallVds , java.lang.Boolean.TRUE ) ; org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( host.getUniqueId ( ) ) . thenReturn ( value ) ; return new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; }
Source:
public void testGetCascadingResource_missingResourcesFile ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "04-test4.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme4 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.Assert.assertTrue ( "Theme 4 should load" , theme4.load ( ) ) ; org.junit.Assert.assertNull ( "getCascadingResource not handling missing resources.properties gracefully" , theme4.getCascadingResource ( "this_file_is_missing_anyway" ) ) ; }

Target:
public void testGetCascadingResourceMissingResourcesFile ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "04-test4.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme4 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.Assert.assertTrue ( "Theme 4 should load" , theme4.load ( ) ) ; org.junit.Assert.assertNull ( "getCascadingResource not handling missing resources.properties gracefully" , theme4.getCascadingResource ( "this_file_is_missing_anyway" ) ) ; }
Source:
private void executeVolumeStatusInfo ( java.lang.String volumeStatusOption ) { result = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.getBroker ( ) . glusterVolumeStatus ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.getParameters ( ) . getClusterId ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.getParameters ( ) . getVolumeName ( ) , ( ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.getParameters ( ) . getBrickName ( ) ) == null ? "" : org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.getParameters ( ) . getBrickName ( ) ) , volumeStatusOption ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
private void executeVolumeStatusInfo ( java.lang.String volumeStatusOption ) { result = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.getBroker ( ) . glusterVolumeStatus ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.getParameters ( ) . getClusterId ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.getParameters ( ) . getVolumeName ( ) , ( ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.getParameters ( ) . getBrickName ( ) ) == null ? "" : org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.getParameters ( ) . getBrickName ( ) ) , volumeStatusOption ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeAdvancedDetailsVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = adjustReturnValue ( returnValue ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = org.ovirt.engine.ui.uicommonweb.Linq.disksToDiskModelList ( disks ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > > entities = org.ovirt.engine.ui.uicommonweb.Linq.toEntityModelList ( org.ovirt.engine.ui.uicommonweb.Linq.filterDisksByType ( diskModels , diskStorageType ) ) ; initAttachableDisks ( entities ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object virtioScsiEnabledReturnValue ) { if ( java.lang.Boolean.FALSE.equals ( virtioScsiEnabledReturnValue ) ) { diskInterfaces.remove ( DiskInterface.VirtIO_SCSI ) ; } for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : diskModels ) { diskModel.getDiskInterface ( ) . setItems ( diskInterfaces ) ; diskModel.getDiskInterface ( ) . setSelectedItem ( DiskInterface.VirtIO ) ; } java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > > entities = org.ovirt.engine.ui.uicommonweb.Linq.toEntityModelList ( org.ovirt.engine.ui.uicommonweb.Linq.filterDisksByType ( diskModels , diskStorageType ) ) ; initAttachableDisks ( entities ) ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterVolumeSnapshotsForVolume ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ) ( returnValue ) ) ; java.util.Collections.sort ( snapshots , new org.ovirt.engine.ui.uicommonweb.Linq.GlusterVolumeSnapshotComparer ( ) ) ; setItems ( snapshots ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterVolumeSnapshotsForVolume ( new org.ovirt.engine.ui.uicommonweb.models.gluster.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots ) { java.util.Collections.sort ( snapshots , new org.ovirt.engine.ui.uicommonweb.Linq.GlusterVolumeSnapshotComparer ( ) ) ; setItems ( snapshots ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
private int getOccupiedVmSlots ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.String > parameters ) { int occupiedSlots = vds.getVmActive ( ) ; final int SPMVMCountGrace = org.apache.commons.lang.math.NumberUtils.toInt ( parameters.get ( "SpmVmGrace" ) , spmVmGrace ) ; if ( vds.isSpm ( ) ) occupiedSlots += SPMVMCountGrace ; return occupiedSlots ; }

Target:
private int getOccupiedVmSlots ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.String > parameters ) { int occupiedSlots = vds.getVmActive ( ) ; final int SPMVMCountGrace = org.apache.commons.lang.math.NumberUtils.toInt ( parameters.get ( PolicyUnitParameter.SPM_VM_GRACE.getDbName ( ) ) , spmVmGrace ) ; if ( vds.isSpm ( ) ) occupiedSlots += SPMVMCountGrace ; return occupiedSlots ; }
Source:
private void mockGraphicsDevice ( ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setDeviceId ( Guid.Empty ) ; graphicsDevice.setVmId ( vm.getId ( ) ) ; org.mockito.Mockito.when ( vmDeviceDAO.getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.GRAPHICS ) ) . thenReturn ( java.util.Arrays.asList ( graphicsDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }

Target:
private void mockVmDevice ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { org.mockito.Mockito.when ( vmDeviceDAO.getVmDeviceByVmIdAndType ( vm.getId ( ) , vmDevice.getType ( ) ) ) . thenReturn ( java.util.Arrays.asList ( vmDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testGetAllSupportedNetworkFiltersByVersion ( ) { final org.ovirt.engine.core.compat.Version version = new org.ovirt.engine.core.compat.Version ( "4.0" ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > allNetworkFilter = dao.getAllSupportedNetworkFiltersByVersion ( version ) ; org.junit.Assert.assertNotNull ( allNetworkFilter ) ; org.junit.Assert.assertEquals ( 3 , allNetworkFilter.size ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkFilter expectedNetworkFilter = initOvirtNoFilter ( ) ; org.junit.Assert.assertEquals ( expectedNetworkFilter , allNetworkFilter.get ( 1 ) ) ; expectedNetworkFilter = expectedNetworkFilter ( ) ; org.junit.Assert.assertEquals ( expectedNetworkFilter , allNetworkFilter.get ( 0 ) ) ; }

Target:
public void testGetAllSupportedNetworkFiltersByVersion ( ) { final org.ovirt.engine.core.compat.Version version = new org.ovirt.engine.core.compat.Version ( "4.0" ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkFilter > allNetworkFilter = dao.getAllSupportedNetworkFiltersByVersion ( version ) ; org.junit.jupiter.api.Assertions.assertNotNull ( allNetworkFilter ) ; org.junit.jupiter.api.Assertions.assertEquals ( 3 , allNetworkFilter.size ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkFilter expectedNetworkFilter = initOvirtNoFilter ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedNetworkFilter , allNetworkFilter.get ( 1 ) ) ; expectedNetworkFilter = expectedNetworkFilter ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedNetworkFilter , allNetworkFilter.get ( 0 ) ) ; }
Source:
public void testDiscoverGeoRepDataWhenNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( 0 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . save ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }

Target:
public void testDiscoverGeoRepDataWhenNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( 0 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . save ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > getExistingStorageDomains ( boolean existing ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; if ( existing ) { ret.add ( new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ) ; } return ret ; }

Target:
protected java.util.List < org.ovirt.engine.api.model.StorageDomain > getExistingStorageDomains ( boolean existing ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > ret = new java.util.ArrayList < org.ovirt.engine.api.model.StorageDomain > ( ) ; if ( existing ) { ret.add ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; } return ret ; }
Source:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public void isSupportBridgesReportByVDSM ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.GetStorageDomainByIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.GetStorageDomainByIdQuery.getDbFacade ( ) . getStorageDomainDAO ( ) . get ( org.ovirt.engine.core.bll.storage.GetStorageDomainByIdQuery.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.GetStorageDomainByIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.GetStorageDomainByIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.GetStorageDomainByIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.GetStorageDomainByIdQuery.getDbFacade ( ) . getStorageDomainDao ( ) . get ( org.ovirt.engine.core.bll.storage.GetStorageDomainByIdQuery.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.GetStorageDomainByIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.GetStorageDomainByIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveOrCopyParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } if ( ( action.isSetDiscardSnapshots ( ) ) && ( action.isDiscardSnapshots ( ) ) ) { params.setCopyCollapse ( true ) ; } return doAction ( ActionType.ExportVm , params , action ) ; }

Target:
public javax.ws.rs.core.Response exportToExportDomain ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.core.common.action.MoveOrCopyParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } if ( ( action.isSetDiscardSnapshots ( ) ) && ( action.isDiscardSnapshots ( ) ) ) { params.setCopyCollapse ( true ) ; } return doAction ( ActionType.ExportVm , params , action ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpQueryExpectations ( "" , null , StorageDomainType.ImportExport ) ; setUpGetDataCenterByStorageDomainExpectations ( GUIDS [ 3 ] , 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplateFromImportExport , org.ovirt.engine.core.common.action.VmTemplateImportExportParameters.class , new java.lang.String [ ] { "VmTemplateId" , "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] , GUIDS [ 3 ] , GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpQueryExpectations ( "" , null , StorageDomainType.ImportExport ) ; setUpGetDataCenterByStorageDomainExpectations ( GUIDS [ 3 ] , 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplateFromImportExport , org.ovirt.engine.core.common.action.VmTemplateImportExportParameters.class , new java.lang.String [ ] { "VmTemplateId" , "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] , GUIDS [ 3 ] , GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }