auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getStorageDomainMaxNameLength ( 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 ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void validateVmMemoryCanRunOnVds ( ) { boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCanStartOnVdsHostTooSmallButLowOverhead ( ) { vds.setMemFree ( 8835L ) ; org.mockito.Mockito.doReturn ( 0 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
private void commit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getInPreview ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }

Target:
private void commit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.SnapshotActionEnum.COMMIT ) , null , null ) ; } }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetworkAttachment , org.ovirt.engine.core.common.action.NetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddNetworkAttachment ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpVerifyHostExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AddNetworkAttachment , org.ovirt.engine.core.common.action.NetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void validateCantLiveMigrateToBackupDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( srcStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setBackup ( true ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE ) ; }

Target:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { initStorageDomain ( srcStorageId ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToAnyNonDownVm ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { com.google.gwt.view.client.SingleSelectionModel SingleSelectionModel = ( ( com.google.gwt.view.client.SingleSelectionModel ) ( event.getSource ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LunModel selectedLunModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel ) ( SingleSelectionModel.getSelectedObject ( ) ) ) ; if ( selectedLunModel != null ) { updateSelectedLunWarning ( selectedLunModel ) ; } }

Target:
public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { com.google.gwt.view.client.SingleSelectionModel SingleSelectionModel = ( ( com.google.gwt.view.client.SingleSelectionModel ) ( event.getSource ( ) ) ) ; selectedLunModel = ( ( SingleSelectionModel.getSelectedObject ( ) ) == null ) ? selectedLunModel : ( ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel ) ( SingleSelectionModel.getSelectedObject ( ) ) ) ; if ( ( selectedLunModel ) != null ) { updateSelectedLunWarning ( selectedLunModel ) ; sortedLeafModel.setSelectedItem ( selectedLunModel ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = getDiskDao ( ) . get ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; } } return diskImage ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = getDiskDao ( ) . get ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; } } return diskImage ; }
Source:
private void onShutdown ( ) { final org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; onPowerAction ( VdcActionType.ShutdownVm , new org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.PowerActionParametersFactory < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.action.VdcActionParametersBase createActionParameters ( org.ovirt.engine.core.common.businessentities.VM vm ) { return new org.ovirt.engine.core.common.action.ShutdownVmParameters ( vm.getId ( ) , true , model.getReason ( ) . getEntity ( ) ) ; } } ) ; }

Target:
private void onShutdown ( ) { final org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) ) ; onPowerAction ( VdcActionType.ShutdownVm , new org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.PowerActionParametersFactory < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.action.VdcActionParametersBase createActionParameters ( org.ovirt.engine.core.common.businessentities.VM vm ) { return new org.ovirt.engine.core.common.action.ShutdownVmParameters ( vm.getId ( ) , true , model.getReason ( ) . getEntity ( ) ) ; } } ) ; }
Source:
protected void updateData ( ) { java.util.List < T > items = ( ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) == null ) ? null : new java.util.ArrayList < T > ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) ; if ( items != null ) { if ( ! ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . hasItemsSorted ( ) ) ) { java.util.Collections.sort ( items , getDefaultItemComparator ( ) ) ; } updateDataProvider ( items ) ; } }

Target:
protected void updateData ( ) { java.util.List < T > items = ( ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) == null ) ? null : new java.util.ArrayList < T > ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) ; if ( items != null ) { if ( ! ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . hasItemsSorted ( ) ) ) { java.util.Collections.sort ( items , defaultComparator ) ; } updateDataProvider ( items ) ; } }
Source:
public void testPersistentAuthWithParameters ( ) { org.junit.Assert.assertTrue ( isPersistentAuth ( "persistent-auth; x=0; y=0" ) ) ; }

Target:
public void testPreferWithValue ( ) { org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=false" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=true" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=junk" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_NEW_AUTH , getPrefer ( "new-auth=false" ) ) ; org.junit.Assert.assertEquals ( ( ( FiltersHelper.PREFER_PERSISTENCE_AUTH ) | ( FiltersHelper.PREFER_NEW_AUTH ) ) , getPrefer ( "persistent-auth=false, new-auth=false" ) ) ; }
Source:
public javax.ws.rs.core.Response performRemove ( java.lang.String id ) { return performAction ( VdcActionType.RemoveVm , new org.ovirt.engine.core.common.action.RemoveVmParameters ( asGuid ( id ) , false ) ) ; }

Target:
private void updateIdForSingleHost ( org.ovirt.engine.api.model.Host host , java.util.Set < org.ovirt.engine.core.compat.Guid > guidsSet ) { if ( ( host.isSetName ( ) ) && ( ! ( host.isSetId ( ) ) ) ) { org.ovirt.engine.core.compat.Guid hostGuid = getHostId ( host ) ; if ( hostGuid != null ) { guidsSet.add ( hostGuid ) ; host.setId ( hostGuid.toString ( ) ) ; } } else if ( host.isSetId ( ) ) { guidsSet.add ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( host.getId ( ) ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.HashMap < java.lang.Integer , java.lang.String > result = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.lang.String defaultValue = result.get ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DEFAULT_OS_ID ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames = new org.ovirt.engine.ui.uicommonweb.MapWithDefaults < java.lang.Integer , java.lang.String > ( result , defaultValue ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { osNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; initOsIds ( ) ; }
Source:
protected void addStorageDomainStatusIllegalMessage ( ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus sharedStatus = getStorageDomainSharedStatus ( ) ; java.lang.Object messageParameter = status ; if ( ( status == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unknown ) ) && ( sharedStatus != null ) ) { messageParameter = sharedStatus ; } org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBase.addCanDoActionMessageVariable ( "status" , messageParameter ) ; }

Target:
protected void addStorageDomainStatusIllegalMessage ( ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus sharedStatus = getStorageDomainSharedStatus ( ) ; java.lang.Object messageParameter = status ; if ( ( status == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Unknown ) ) && ( sharedStatus != null ) ) { messageParameter = sharedStatus ; } org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBase.addValidationMessageVariable ( "status" , messageParameter ) ; }
Source:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getClusterList ( 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected void endStepJobAborted ( ) { endStepJob ( JobExecutionStatus.ABORTED , getStepMessageMap ( JobExecutionStatus.ABORTED ) , false ) ; }

Target:
protected void startSubStep ( ) { asyncTaskStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( this . getExecutionContext ( ) , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , getStepType ( ) , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( getStepType ( ) , getStepMessageMap ( JobExecutionStatus.STARTED , null ) ) ) ; }
Source:
public void confFileNotExistInTar ( ) { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( ActionType.RetrieveImageData , successfulVdcReturnValue ( new byte [ 10 ] ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void confFileNotExistInTar ( ) { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( ActionType.RetrieveImageData , successfulActionReturnValue ( new byte [ 10 ] ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; setTitle ( ( disk.isBoot ( ) ? constants.bootableDisk ( ) : null ) ) ; return disk.isBoot ( ) ? resources.bootableDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; return disk.isBoot ( ) ? org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmDiskAttachPopupWidget.resources.bootableDiskIcon ( ) : null ; }
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 ) ; }

Target:
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 ) ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean value = getClone ( ) . getEntity ( ) ; if ( value ) { getNoClone ( ) . setEntity ( false ) ; if ( getApplyToAll ( ) . getEntity ( ) ) { getSuffix ( ) . setIsChangable ( true ) ; } else { getName ( ) . setIsChangable ( true ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean value = getClone ( ) . getEntity ( ) ; if ( value ) { getNoClone ( ) . setEntity ( false ) ; if ( getApplyToAll ( ) . getEntity ( ) ) { getSuffix ( ) . setIsChangeable ( true ) ; } else { getName ( ) . setIsChangeable ( true ) ; } } }
Source:
public void testSubResourceLocator ( ) throws java.lang.Exception { control.replay ( ) ; java.lang.Object subResource = collection.getDeviceResource ( GUIDS [ 0 ] . toString ( ) ) ; assertFalse ( ( subResource instanceof org.ovirt.engine.api.resource.DeviceResource ) ) ; assertTrue ( ( subResource instanceof org.ovirt.engine.api.resource.ReadOnlyDeviceResource ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( ( ! ( model.isBootable ( ) ) ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup createCluster ( org.ovirt.engine.core.compat.Version v ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setcompatibility_version ( v ) ; return cluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getSession ( boolean populateVoId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession session = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession ( ) ; session.setMasterVolumeName ( "VOL1" ) ; if ( populateVoId ) { session.setMasterVolumeId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } session.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; session.setSessionKey ( ( ( session.getId ( ) ) + ( session.getMasterVolumeName ( ) ) ) ) ; session.setStatus ( GeoRepSessionStatus.ACTIVE ) ; session.setSessionDetails ( getSessionDetailsList ( ) ) ; return session ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionDelete ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionDelete" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterVolumeGeoRepSessionDelete ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionDelete" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private static void handleErrorLog ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > tempProblematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; org.ovirt.engine.core.common.businessentities.RepoFileMetaData repoFileMetaData = new org.ovirt.engine.core.common.businessentities.RepoFileMetaData ( ) ; repoFileMetaData.setStoragePoolId ( storagePoolId ) ; repoFileMetaData.setRepoDomainId ( storageDomainId ) ; repoFileMetaData.setFileType ( imageType ) ; tempProblematicRepoFileList.add ( repoFileMetaData ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( tempProblematicRepoFileList ) ; }

Target:
private static void handleErrorLog ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > tempProblematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ( ) ; org.ovirt.engine.core.common.businessentities.RepoImage repoImage = new org.ovirt.engine.core.common.businessentities.RepoImage ( ) ; repoImage.setStoragePoolId ( storagePoolId ) ; repoImage.setRepoDomainId ( storageDomainId ) ; repoImage.setFileType ( imageType ) ; tempProblematicRepoFileList.add ( repoImage ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( tempProblematicRepoFileList ) ; }
Source:
public static void GetRedirectServletReportsPage ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public static void GetDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void GetDataCenterMaxNameLength ( 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 ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }

Target:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetTemplateInterfacesByTemplateId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateNicsResourceTest.VM_ID } , getEntityList ( ) , failure ) ; } }
Source:
private boolean isDiskExistInVm ( org.ovirt.engine.core.common.businessentities.Disk disk ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { if ( vm.getId ( ) . equals ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ) { return true ; } } return false ; }

Target:
private boolean isDiskExistInVm ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { if ( vm.getId ( ) . equals ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ) { return true ; } } return false ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validOrFirstFailure ( org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator.ValidatorPredicate predicate ) { for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry : domainValidators.entrySet ( ) ) { org.ovirt.engine.core.bll.ValidationResult currResult = predicate.evaluate ( getStorageDomainValidator ( entry ) ) ; if ( ! ( currResult.isValid ( ) ) ) { return currResult ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForNewDisks ( final java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > domainsDisksMap = getDomainsDisksMap ( disksList ) ; return validOrFirstFailure ( new org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator.ValidatorPredicate ( ) { @ java.lang.Override public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List disksForDomain = domainsDisksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForNewDisks ( disksForDomain ) ; } } ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { numaSupport ( ) ; }

Target:
public void setSelectedItem ( java.lang.Integer value ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . osNameExists ( value ) ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( dataCenterWithCluster == null ) ? null : dataCenterWithCluster.getCluster ( ) ; if ( cluster == null ) { return ; } super . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultOs ( cluster.getArchitecture ( ) ) ) ; } else { super . setSelectedItem ( value ) ; } }
Source:
public void autoLogin ( org.ovirt.engine.core.common.businessentities.DbUser user ) { loggingInAutomatically = true ; getUserName ( ) . setEntity ( user.getLoginName ( ) ) ; getDomain ( ) . setSelectedItem ( user.getDomain ( ) ) ; disableLoginScreen ( ) ; setLoggedUser ( user ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . setLoggedInUser ( user ) ; raiseLoggedInEvent ( ) ; }

Target:
public void autoLogin ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { loggingInAutomatically = true ; getUserName ( ) . setEntity ( user.getLoginName ( ) ) ; getDomain ( ) . setSelectedItem ( user.getDomain ( ) ) ; disableLoginScreen ( ) ; setLoggedUser ( user ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . setLoggedInUser ( user ) ; raiseLoggedInEvent ( ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Disk add ( org.ovirt.engine.sdk.decorators.Disk disk ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , disk , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.Disk.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Disk add ( org.ovirt.engine.sdk.decorators.Disk disk ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , disk , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.Disk.class , headers ) ; }
Source:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( RemoveImages ( ) ) { if ( ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) ) { org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . setactive ( true ) ; org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . getImage ( ) ) ; } org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( removeImages ( ) ) { if ( ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) ) { org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . setactive ( true ) ; org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . getImage ( ) ) ; } org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.setSucceeded ( true ) ; } }
Source:
public void executeQueryCommandWithNull ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDeviceDao ( ) ) . thenReturn ( vmDeviceDAO ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.Guid ( "ee655a4d-effc-4aab-be2b-2f80ff40cd1c" ) ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertNull ( getQuery ( ) . getReturnValue ( ) ) ; }

Target:
public void executeQueryCommandWithNull ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDeviceDao ( ) ) . thenReturn ( vmDeviceDAO ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.Guid ( "ee655a4d-effc-4aab-be2b-2f80ff40cd1c" ) ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( java.util.List < ? > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) . isEmpty ( ) ) ; }
Source:
public void loadVmsFromVmware ( ) { clearProblem ( ) ; if ( ! ( validateVmwareConfiguration ( ) ) ) { return ; } org.ovirt.engine.core.compat.Guid proxyId = ( ( getProxyHosts ( ) . getSelectedItem ( ) ) != null ) ? getProxyHosts ( ) . getSelectedItem ( ) . getId ( ) : null ; loadVMsFromExternalProvider ( OriginType.VMWARE , getUrl ( ) , getUsername ( ) . getEntity ( ) , getPassword ( ) . getEntity ( ) , proxyId ) ; }

Target:
public void loadVmsFromVmware ( ) { clearForLoad ( ) ; if ( ! ( validateVmwareConfiguration ( ) ) ) { return ; } org.ovirt.engine.core.compat.Guid proxyId = ( ( getProxyHosts ( ) . getSelectedItem ( ) ) != null ) ? getProxyHosts ( ) . getSelectedItem ( ) . getId ( ) : null ; loadVMsFromExternalProvider ( OriginType.VMWARE , getUrl ( ) , getUsername ( ) . getEntity ( ) , getPassword ( ) . getEntity ( ) , proxyId ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBond ( ) { return createVdsInterface ( "bond0" , true , null , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 100 ) , null , null , null , null ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBond ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createVdsInterface ( "bond0" , true , null , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 100 ) , null , null , null , null ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( bond ) ) . thenReturn ( bond ) ; return bond ; }
Source:
public void testGetAllForRoleAndAdElement ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForRoleAndAdElement ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , permission.getrole_id ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , permission.getad_element_id ( ) ) ; } }

Target:
public void testGetAllForRoleAndAdElement ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForRoleAndAdElement ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , permission.getRoleId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , permission.getAdElementId ( ) ) ; } }
Source:
private synchronized void refreshActivatedStorageDomainFromVdsm ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { if ( ! ( updateIsoListFromVDSM ( storagePoolId , storageDomainId ) ) ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( storagePoolId , storageDomainId , FileTypeExtension.ISO ) ; } if ( ! ( updateFloppyListFromVDSM ( storagePoolId , storageDomainId ) ) ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( storagePoolId , storageDomainId , FileTypeExtension.Floppy ) ; } }

Target:
private synchronized void refreshActivatedStorageDomainFromVdsm ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { if ( ! ( updateIsoListFromVDSM ( storagePoolId , storageDomainId ) ) ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( storagePoolId , storageDomainId , ImageType.ISO ) ; } if ( ! ( updateFloppyListFromVDSM ( storagePoolId , storageDomainId ) ) ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.handleErrorLog ( storagePoolId , storageDomainId , ImageType.Floppy ) ; } }
Source:
public void testGetFilteredWithPermissionsNoFilter ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk result = dao.get ( getExistingEntityId ( ) , org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , false ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( getExistingEntityId ( ) . toString ( ) , result.getId ( ) . toString ( ) ) ; }

Target:
public void testGetFilteredWithPermissionsNoFilter ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk result = dao.get ( getExistingEntityId ( ) , org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , false ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( getExistingEntityId ( ) . toString ( ) , result.getId ( ) . toString ( ) ) ; }
Source:
private static void addVideoDevice ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VmDevice entity = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vm.getId ( ) ) , VmDeviceType.VIDEO , vm.getdefault_display_type ( ) . getVmDeviceType ( ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getMemExpr ( vm.getnum_of_monitors ( ) ) , true , true ) ; }

Target:
private static void addVideoDevice ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VmDevice entity = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vm.getId ( ) ) , VmDeviceType.VIDEO , vm.getDefaultDisplayType ( ) . getVmDeviceType ( ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getMemExpr ( vm.getNumOfMonitors ( ) ) , true , true ) ; }