auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static boolean canRemoveVmFromPool ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolMapByVmGuid ( vmId ) ) == null ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL.toString ( ) ) ; returnValue = false ; } if ( returnValue ) { if ( org.ovirt.engine.core.bll.RemoveVmCommand.IsVmRunning ( vmId ) ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL.toString ( ) ) ; returnValue = false ; } } return returnValue ; }

Target:
public static boolean canRemoveVmFromPool ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolMapByVmGuid ( vmId ) ) == null ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL.toString ( ) ) ; returnValue = false ; } if ( returnValue ) { if ( org.ovirt.engine.core.bll.RemoveVmCommand.isVmRunning ( vmId ) ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL.toString ( ) ) ; returnValue = false ; } } return returnValue ; }
Source:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; java.lang.String ifaceName = ( bond.getName ( ) ) + "1" ; parameters.getInterfaces ( ) . add ( createVlan ( ifaceName , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_DONT_EXIST , ifaceName ) ; }

Target:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String label = getNetworkLabel ( ) . getSelectedItem ( ) ; getNetworkLabel ( ) . setItems ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; getNetworkLabel ( ) . setSelectedItem ( label ) ; onExportChanged ( ) ; }

Target:
public void onSuccess ( java.util.SortedSet < java.lang.String > returnValue ) { java.lang.String label = getNetworkLabel ( ) . getSelectedItem ( ) ; getNetworkLabel ( ) . setItems ( returnValue ) ; getNetworkLabel ( ) . setSelectedItem ( label ) ; onExportChanged ( ) ; }
Source:
private org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface build ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = effectiveHostNetworkQos.getQos ( networkAttachment , network ) ; return new org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface ( vdsNetworkInterface , network , hostNetworkQos ) ; }

Target:
private org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface build ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = effectiveHostNetworkQos.getQos ( networkAttachment , network ) ; return new org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface ( vdsNetworkInterface , network , hostNetworkQos , ( networkAttachment == null ? null : networkAttachment.getIpConfiguration ( ) ) ) ; }
Source:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksToCheck = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( disksToCheck ) ; return validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ; }

Target:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksToCheck = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( disksToCheck ) ; return validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ; }
Source:
protected void postInitDisks ( ) { onDataLoad ( ) ; checkDestFormatCompatibility ( ) ; StopProgress ( ) ; getStorage ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { onDataLoad ( ) ; } } ) ; getCollapseSnapshots ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel.ON_DISK_LOAD ) ) ; } } ) ; }

Target:
protected void postInitDisks ( ) { onDataLoad ( ) ; checkDestFormatCompatibility ( ) ; StopProgress ( ) ; getStorage ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { onDataLoad ( ) ; } } ) ; }
Source:
protected void initLoginModel ( ) { final T loginModel = getLoginModel ( ) ; loginModel.getLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { onLogin ( loginModel ) ; } } ) ; }

Target:
public final void onBootstrap ( ) { java.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger ( "" ) ; initLocalStorageLogHandler ( rootLogger ) ; initUncaughtExceptionHandler ( rootLogger ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { performBootstrap ( ) ; } } ) ; }
Source:
void initCheckBoxEditors ( ) { attachFloppyEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; attachIsoEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; bootMenuEnabledEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAsStatelessEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAndPauseEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; useAlternateCredentialsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; spiceFileTransferEnabledEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; spiceCopyPasteEnabledEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }

Target:
void initCheckBoxEditors ( ) { attachFloppyEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; attachIsoEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; bootMenuEnabledEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAsStatelessEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAndPauseEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; useAlternateCredentialsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; spiceFileTransferEnabledEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; spiceCopyPasteEnabledEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; cloudInitEnabledEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc updateVmPolicy ( java.util.Map params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.updateVmPolicy" ) . withParameter ( "params" , params ) . 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.StatusOnlyReturnForXmlRpc updateVmPolicy ( java.util.Map params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.updateVmPolicy" ) . withParameter ( "vmID" , ( ( java.lang.String ) ( params.get ( "vmId" ) ) ) ) . withParameter ( "params" , params ) . 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 ) ; }
Source:
public void testAggregateDisksSnapshots ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = new java.util.ArrayList ( snapshotsList ) ; java.util.Collections.addAll ( disks , diskWithSnapshots , diskWithoutSnapshots , ovfImage , cinderDisk , lunDisk ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > result = getQuery ( ) . aggregateDisksSnapshots ( disks ) ; assertAllDisksAreActive ( result ) ; org.junit.Assert.assertEquals ( "wrong number of disks returned" , 5 , result.size ( ) ) ; }

Target:
public void testAggregateDisksSnapshots ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = new java.util.ArrayList ( snapshotsList ) ; java.util.Collections.addAll ( disks , diskWithSnapshots , diskWithoutSnapshots , ovfImage , cinderDisk , lunDisk ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > result = getQuery ( ) . aggregateDisksSnapshots ( disks ) ; assertAllDisksAreActive ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( 5 , result.size ( ) , "wrong number of disks returned" ) ; }
Source:
private void verifyModelSpecific ( org.ovirt.engine.api.model.NetworkFilterParameter model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.VALUES [ index ] , model.getValue ( ) ) ; org.junit.Assert.assertTrue ( model.isSetNic ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.VM_NIC_ID.toString ( ) , model.getNic ( ) . getId ( ) ) ; }

Target:
private void verifyModelSpecific ( org.ovirt.engine.api.model.NetworkFilterParameter model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.VALUES [ index ] , model.getValue ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( model.isSetNic ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.VM_NIC_ID.toString ( ) , model.getNic ( ) . getId ( ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.FenceAgent agent = org.ovirt.engine.core.bll.AddFenceAgentCommand.getParameters ( ) . getAgent ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getFenceAgentDao ( ) . save ( agent ) ; org.ovirt.engine.core.bll.AddFenceAgentCommand.getReturnValue ( ) . setActionReturnValue ( agent.getId ( ) ) ; org.ovirt.engine.core.bll.AddFenceAgentCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent = org.ovirt.engine.core.bll.AddFenceAgentCommand.getParameters ( ) . getAgent ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getFenceAgentDao ( ) . save ( agent ) ; org.ovirt.engine.core.bll.AddFenceAgentCommand.getReturnValue ( ) . setActionReturnValue ( agent.getId ( ) ) ; org.ovirt.engine.core.bll.AddFenceAgentCommand.setSucceeded ( true ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > getSessions ( int count ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > sessions = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { sessions.add ( getSession ( ) ) ; } return sessions ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > getSessions ( int count , boolean populateVoId ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > sessions = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { sessions.add ( getSession ( populateVoId ) ) ; } return sessions ; }
Source:
private void updateActionAvailability ( ) { boolean hasSelectedItems = ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( hasSelectedItems && ( ! ( selectionContainsPlaceholderDevices ( ) ) ) ) ) ; }

Target:
private void updateActionAvailability ( ) { getRemoveCommand ( ) . setIsExecutionAllowed ( ( ! ( getSelectedPrimaryDeviceNames ( ) . isEmpty ( ) ) ) ) ; }
Source:
public void validateFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; createVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskVmElementValidator.isDiskInterfaceSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }

Target:
public void validateFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; createVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskVmElementValidator.isDiskInterfaceSupported ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }
Source:
public static void getMinimalVmMemSize ( 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.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getDataCenterList ( 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void testGetAllForUsersAndGroupsInvalidUserAndGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > result = dao.getAllForUserAndGroups ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllForUsersAndGroupsInvalidUserAndGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > result = dao.getAllForUserAndGroups ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) , ApplicationMode.AllModes.getValue ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }
Source:
protected boolean checkMasterDomainIsUp ( ) { boolean hasUpMaster = ! ( org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBase.getStorageDomainDao ( ) . getStorageDomains ( org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBase.getStoragePool ( ) . getId ( ) , StorageDomainType.Master , StorageDomainStatus.Active ) . isEmpty ( ) ) ; if ( ! hasUpMaster ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_MASTER_STORAGE_DOMAIN_NOT_ACTIVE ) ; } return true ; }

Target:
protected boolean checkMasterDomainIsUp ( ) { boolean hasUpMaster = ! ( org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBase.getStorageDomainDao ( ) . getStorageDomains ( org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBase.getStoragePool ( ) . getId ( ) , StorageDomainType.Master , StorageDomainStatus.Active ) . isEmpty ( ) ) ; if ( ! hasUpMaster ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_MASTER_STORAGE_DOMAIN_NOT_ACTIVE ) ; } return true ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > createInterfacesToBond ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > existingIfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ; existingIfaces.add ( createVdsInterface ( "eth0" , false , null , null , null ) ) ; existingIfaces.add ( createVdsInterface ( "eth1" , false , null , null , null ) ) ; return existingIfaces ; }

Target:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface enslaveOrReleaseNIC ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String bondName ) { return createVdsInterface ( iface.getId ( ) , iface.getName ( ) , false , bondName , null , null ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getImages ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getImages ( ) , failure ) ; }
Source:
public void extractRemovedNetwork ( ) { org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ) ; helper.extractRemoveNetworks ( new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( "red" ) ) , java.util.Arrays.asList ( "blue" ) ) ; junit.framework.Assert.assertTrue ( helper.getRemoveNetworks ( ) . get ( 0 ) . equals ( "blue" ) ) ; }

Target:
public void ipChanged ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , net.getName ( ) ) ; nic.setBootProtocol ( NetworkBootProtocol.StaticIp ) ; nic.setAddress ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; mockExistingIfaces ( nic ) ; nic.setAddress ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
private void styleTextBoxEditor ( org.ovirt.engine.ui.common.widget.editor.EntityModelTextBoxOnlyEditor editor , org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { if ( ! ( model.getIsChangable ( ) ) ) { editor.setEnabled ( true ) ; com.google.gwt.user.client.ui.ValueBox < java.lang.Object > valueBox = editor.asValueBox ( ) ; valueBox.setReadOnly ( true ) ; valueBox.getElement ( ) . getStyle ( ) . setBorderWidth ( 0 , Style.Unit.PX ) ; } }

Target:
private void styleTextBoxEditor ( org.ovirt.engine.ui.common.widget.editor.EntityModelTextBoxOnlyEditor editor , boolean enabled ) { if ( ! enabled ) { editor.setEnabled ( true ) ; com.google.gwt.user.client.ui.ValueBox < java.lang.Object > valueBox = editor.asValueBox ( ) ; valueBox.setReadOnly ( true ) ; valueBox.getElement ( ) . getStyle ( ) . setBorderWidth ( 0 , Style.Unit.PX ) ; } }
Source:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) == null ) { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "VM is null, not performing full endAction" ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.StopVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.StopVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full endAction" ) ; } org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster CloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setstatus ( instance.getstatus ( ) ) ; obj.setis_display ( instance.getis_display ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; return obj ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster CloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; return obj ; }
Source:
public void onFailureResetInitialStatus ( ) { mockExecutor ( false ) ; try { command.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException exception ) { org.mockito.Mockito.verify ( vdsBrokerFrontend ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.SetVdsStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters.class ) ) ; return ; } org.junit.Assert.fail ( ) ; }

Target:
public void onFailureResetInitialStatus ( ) { mockExecutor ( false ) ; try { command.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException exception ) { org.mockito.Mockito.verify ( vdsBrokerFrontend ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.SetVdsStatus ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters.class ) ) ; return ; } org.junit.Assert.fail ( ) ; }
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 ) { java.lang.Boolean entity = getAllowOverbooking ( ) . getEntity ( ) ; if ( entity ) { getOptimizeForUtilization ( ) . setEntity ( true ) ; } getOptimizeForSpeed ( ) . setIsChangable ( ( ! entity ) ) ; }

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 ) { java.lang.Boolean entity = getOptimizeForSpeed ( ) . getEntity ( ) ; if ( entity ) { getGuarantyResources ( ) . setEntity ( true ) ; } getAllowOverbooking ( ) . setIsChangeable ( ( ! entity ) ) ; }
Source:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.util.Map < java.lang.String , java.lang.Object > data = new java.util.HashMap < > ( ) ; data.put ( "status" , "active" ) ; data.put ( "status_description" , "SSO Webapp Deployed" ) ; data.put ( "version" , SSOConstants.OVIRT_SSO_VERSION ) ; org.ovirt.engine.core.sso.utils.SSOUtils.sendJsonData ( response , data ) ; }

Target:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.util.Map < java.lang.String , java.lang.Object > data = new java.util.HashMap < > ( ) ; data.put ( "status" , "active" ) ; data.put ( "status_description" , "SSO Webapp Deployed" ) ; data.put ( "version" , SsoConstants.OVIRT_SSO_VERSION ) ; org.ovirt.engine.core.sso.utils.SsoUtils.sendJsonData ( response , data ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc formatStorageDomain ( java.lang.String sdUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.format" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "autoDetach" , false ) . 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 formatStorageDomain ( java.lang.String sdUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.format" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "autoDetach" , false ) . 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 testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.aaa.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.aaa.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.aaa.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Role model , int index ) { super . verifyModel ( model , index ) ; assertTrue ( model.isSetUser ( ) ) ; assertTrue ( model.getUser ( ) . isSetId ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getUser ( ) . getId ( ) ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Role model , int index ) { super . verifyModel ( model , index ) ; org.junit.Assert.assertTrue ( model.isSetUser ( ) ) ; org.junit.Assert.assertTrue ( model.getUser ( ) . isSetId ( ) ) ; org.junit.Assert.assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getUser ( ) . getId ( ) ) ; }
Source:
public void testAttachFailFormatType ( ) { storageDomain.setStorageFormat ( StorageFormatType.V3 ) ; storagePool.setCompatibilityVersion ( Version.v3_0 ) ; org.ovirt.engine.core.bll.ValidationResult invalidFormatAttachingResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertFalse ( "Attaching domain with unsupported version succeeded while it should have failed" , invalidFormatAttachingResult.isValid ( ) ) ; assertFailingMessage ( "Attaching domain with unsupported version failed with the wrong message" , invalidFormatAttachingResult , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL ) ; }

Target:
public void testAttachFailFormatType ( ) { storageDomain.setStorageFormat ( StorageFormatType.V3 ) ; storagePool.setCompatibilityVersion ( Version.v3_0 ) ; org.ovirt.engine.core.bll.ValidationResult invalidFormatAttachingResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertFalse ( "Attaching domain with unsupported version succeeded while it should have failed" , invalidFormatAttachingResult.isValid ( ) ) ; assertFailingMessage ( "Attaching domain with unsupported version failed with the wrong message" , invalidFormatAttachingResult , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL ) ; }
Source:
public org.ovirt.engine.sdk.decorators.HostNICLabel get ( java.util.UUID id ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ) + ( SLASH ) ) + ( id.toString ( ) ) ; return getProxy ( ) . get ( url , org.ovirt.engine.sdk.entities.Label.class , org.ovirt.engine.sdk.decorators.HostNICLabel.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.HostHostNicLabel get ( java.util.UUID id ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ) + ( SLASH ) ) + ( id.toString ( ) ) ; return getProxy ( ) . get ( url , org.ovirt.engine.sdk.entities.Label.class , org.ovirt.engine.sdk.decorators.HostHostNicLabel.class ) ; }
Source:
public void clearEnvironment ( ) { org.ovirt.engine.core.utils.CorrelationIdTracker.clean ( ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . removeSessionOnLogout ( session ) ; }

Target:
public void setupEnvironment ( ) { org.ovirt.engine.core.utils.CorrelationIdTracker.clean ( ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.aaa.DbUser.class ) ; org.mockito.Mockito.when ( engineSessionDao.remove ( org.mockito.Matchers.any ( java.lang.Long.class ) ) ) . thenReturn ( 1 ) ; sessionDataContainer.setUser ( session , user ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlanSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVlan ( nicName , network.getvlan_id ( ) , network.getName ( ) ) ; nic.setBridged ( network.isVmNetwork ( ) ) ; nic.setMtu ( network.getMtu ( ) ) ; return nic ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlanSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVlan ( nicName , network.getVlanId ( ) , network.getName ( ) ) ; nic.setBridged ( network.isVmNetwork ( ) ) ; nic.setMtu ( network.getMtu ( ) ) ; return nic ; }
Source:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( ) ) ; }

Target:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.ArgumentMatchers.any ( java.lang.Boolean.class ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.ArgumentMatchers.any ( java.lang.Boolean.class ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void verifyIps ( org.ovirt.engine.api.model.ReportedDevice device ) { java.util.List < org.ovirt.engine.api.model.IP > ips = device.getIps ( ) . getIPs ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length , ips.size ( ) ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length ) ; i ++ ) { assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES [ i ] , ips.get ( i ) . getAddress ( ) ) ; } }

Target:
private void verifyIps ( org.ovirt.engine.api.model.ReportedDevice device ) { java.util.List < org.ovirt.engine.api.model.Ip > ips = device.getIps ( ) . getIps ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length , ips.size ( ) ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length ) ; i ++ ) { assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES [ i ] , ips.get ( i ) . getAddress ( ) ) ; } }
Source:
public static void GetCustomPropertiesList ( 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.util.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void GetPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }
Source:
private void initCommand ( ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( ) ; params.setVdsId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ; command = new org.ovirt.engine.core.bll.StartVdsCommand ( params ) ; command.setFenceExecutor ( executor ) ; command = org.mockito.Mockito.spy ( command ) ; org.mockito.Mockito.stub ( command.getSleepBeforeFirstAttempt ( ) ) . toReturn ( 0 ) ; command.setVdsGroupId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_CLUSTER_ID ) ; }

Target:
private void initCommand ( ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( ) ; params.setVdsId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ; command = new org.ovirt.engine.core.bll.StartVdsCommand ( params ) ; command.setFenceExecutor ( executor ) ; command = org.mockito.Mockito.spy ( command ) ; org.mockito.Mockito.stub ( command.getSleepBeforeFirstAttempt ( ) ) . toReturn ( 0 ) ; command.setAuditLogDirector ( auditLogDirector ) ; command.setVdsGroupId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_CLUSTER_ID ) ; }
Source:
protected void initializeCommand ( org.ovirt.engine.core.common.businessentities.ImageOperation operation ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.MoveOrCopyDiskCommandDummy ( new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( diskImageGuid , srcStorageId , destStorageId , operation ) ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . acquireLock ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }

Target:
protected void initializeCommand ( org.ovirt.engine.core.common.businessentities.ImageOperation operation ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.MoveOrCopyDiskCommandDummy ( new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( diskImageGuid , srcStorageId , destStorageId , operation ) ) ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . acquireLock ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }
Source:
public void getClusterGlusterServices ( 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 ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpEntityQueryExpectations ( 2 , false , false , false , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpEntityQueryExpectations ( 2 , false , false , false , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , valid , success ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: remove ) , detail ) ; }
Source:
protected void setDiskImportData ( org.ovirt.engine.core.compat.Guid diskId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains , org.ovirt.engine.core.common.businessentities.VolumeType volumeType ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportData data = new org.ovirt.engine.ui.uicommonweb.models.vms.ImportData ( ) ; diskImportDataMap.put ( diskId , data ) ; data.setAllStorageDomains ( filteredStorageDomains ) ; data.setCollapseSnapshot ( getCollapseSnapshots ( ) ) ; data.setStorageDomains ( storageDomains ) ; data.setVolumeType ( volumeType ) ; data.setStorageQuotaList ( storageQuotaMap ) ; }

Target:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByIds ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getstorage_ids ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getstorage_ids ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : filteredStorageDomains ) { if ( storageDomainId.equals ( storageDomain.getId ( ) ) ) { domains.add ( storageDomain ) ; break ; } } } return domains ; }