auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetNicsExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendInstanceTypeNicResourceTest.INSTANCE_TYPE_ID , org.ovirt.engine.api.restapi.resource.BackendInstanceTypeNicResourceTest.NIC_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 ) { setUpGetNicsExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendInstanceTypeNicResourceTest.INSTANCE_TYPE_ID , org.ovirt.engine.api.restapi.resource.BackendInstanceTypeNicResourceTest.NIC_ID } , valid , success ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: remove ) , detail ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getIrsProxy ( ) . deactivateStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getMasterStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getIrsProxy ( ) . deactivateStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getMasterStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DeactivateStorageDomainVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
private void updateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; if ( vds != null ) { getSyncStorageDevicesCommand ( ) . setIsExecutionAllowed ( ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) ; getCreateBrickCommand ( ) . setIsExecutionAllowed ( ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) ; } }

Target:
private void updateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; if ( ( vds != null ) && ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { getSyncStorageDevicesCommand ( ) . setIsExecutionAllowed ( true ) ; getCreateBrickCommand ( ) . setIsExecutionAllowed ( canCreateBrick ( ) ) ; } else { getSyncStorageDevicesCommand ( ) . setIsExecutionAllowed ( false ) ; getCreateBrickCommand ( ) . setIsExecutionAllowed ( false ) ; } }
Source:
public void insufficientDiskSpace ( ) { final int lotsOfSpace = 1073741824 ; final org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > c = setupDiskSpaceTest ( lotsOfSpace ) ; org.junit.Assert.assertFalse ( c.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( c.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void insufficientDiskSpaceWithCollapse ( ) { final org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > command = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.when ( command.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }

Target:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }
Source:
private java.lang.String offerHostId ( org.ovirt.engine.core.compat.Guid vdsGroupId ) { int i = 0 ; for ( org.ovirt.engine.core.common.businessentities.VDS host : dbFacade.getVdsDao ( ) . getAllForVdsGroup ( vdsGroupId ) ) { if ( ( host.getHighlyAvailableScore ( ) ) > 0 ) { i ++ ; } } return java.lang.String.valueOf ( ( i + 1 ) ) ; }

Target:
private int offerHostId ( org.ovirt.engine.core.compat.Guid vdsId ) { return dbFacade.getVdsSpmIdMapDao ( ) . get ( vdsId ) . getVdsSpmId ( ) ; }
Source:
private static boolean isRunOnce ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > cdList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceType.DISK.getName ( ) , VmDeviceType.CDROM.getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > floppyList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceType.DISK.getName ( ) , VmDeviceType.FLOPPY.getName ( ) ) ; return ( ( cdList.size ( ) ) > 1 ) || ( ( floppyList.size ( ) ) > 1 ) ; }

Target:
private static boolean isRunOnce ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > cdList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.DISK , VmDeviceType.CDROM.getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > floppyList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.DISK , VmDeviceType.FLOPPY.getName ( ) ) ; return ( ( cdList.size ( ) ) > 1 ) || ( ( floppyList.size ( ) ) > 1 ) ; }
Source:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc list ( java.lang.String mode , java.lang.String [ ] vmIds ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.list ( mode , vmIds ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc fullList ( java.util.List < java.lang.String > vmIds ) { try { java.lang.String [ ] vmIdsArray = vmIds.toArray ( new java.lang.String [ vmIds.size ( ) ] ) ; java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.list ( java.lang.Boolean.TRUE.toString ( ) , vmIdsArray ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > getLinuxOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; }

Target:
public static void initWindowsOsTypes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsIds = ( ( java.util.ArrayList < java.lang.Integer > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetWindowsOss ) , callback ) ; }
Source:
public void setHasAnyAlert ( boolean value ) { if ( ( hasAnyAlert ) != value ) { hasAnyAlert = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "HasAnyAlert" ) ) ; } }

Target:
public void setSwapFree ( java.lang.Long value ) { if ( ( ( swapFree ) == null ) && ( value == null ) ) { return ; } if ( ( ( swapFree ) == null ) || ( ! ( swapFree.equals ( value ) ) ) ) { swapFree = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SwapFree" ) ) ; } }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public 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 executeVmCommand ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.LockVm ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDynamicData ( ) , org.ovirt.engine.core.bll.RemoveVmCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( removeVm ( ) ) ; }

Target:
protected void executeVmCommand ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.lockVm ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDynamicData ( ) , org.ovirt.engine.core.bll.RemoveVmCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( removeVm ( ) ) ; }
Source:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( _vds.getstatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "ResourceManager::refreshVdsRunTimeInfo::Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getvds_name ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "ResourceManager::refreshVdsRunTimeInfo::Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getvds_name ( ) , e.getMessage ( ) ) ; } }

Target:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( _vds.getstatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getvds_name ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getvds_name ( ) , e.getMessage ( ) ) ; } }
Source:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.VDS vds = org.ovirt.engine.core.vdsbroker.irsbroker.DbFacade.getInstance ( ) . getVdsDAO ( ) . get ( this . getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getvds_spm_id ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.RemoveIrsProxy ( ) ; }

Target:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.VDS vds = org.ovirt.engine.core.vdsbroker.irsbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( this . getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getvds_spm_id ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.RemoveIrsProxy ( ) ; }
Source:
private void endCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = getVmsForDiskId ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { org.ovirt.engine.core.bll.RemoveDiskCommand.getVmStaticDAO ( ) . incrementDbGeneration ( vm.getId ( ) ) ; } getDisk ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . EndAction ( VdcActionType.RemoveImage , org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) ) ; org.ovirt.engine.core.bll.RemoveDiskCommand.setSucceeded ( true ) ; }

Target:
private void incrementVmsGeneration ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = getVmsForDiskId ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { org.ovirt.engine.core.bll.RemoveDiskCommand.getVmStaticDAO ( ) . incrementDbGeneration ( vm.getId ( ) ) ; } }
Source:
public void testAllDomainsExistAndActive ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.name ( ) ) ) ; }

Target:
public void testAllDomainsExistAndActive ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.name ( ) ) ) ; }
Source:
public static org.ovirt.engine.api.model.CdRom map ( org.ovirt.engine.core.common.businessentities.VM entity , org.ovirt.engine.api.model.CdRom template ) { org.ovirt.engine.api.model.CdRom model = ( template != null ) ? template : new org.ovirt.engine.api.model.CdRom ( ) ; model.setId ( org.ovirt.engine.api.restapi.types.CdRomMapper.CDROM_ID.toString ( ) ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getStaticData ( ) . getIsoPath ( ) ) ) ) { model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; model.getFile ( ) . setId ( entity.getStaticData ( ) . getIsoPath ( ) ) ; } return model ; }

Target:
public static org.ovirt.engine.api.model.Cdrom map ( org.ovirt.engine.core.common.businessentities.VM entity , org.ovirt.engine.api.model.Cdrom template ) { org.ovirt.engine.api.model.Cdrom model = ( template != null ) ? template : new org.ovirt.engine.api.model.Cdrom ( ) ; model.setId ( org.ovirt.engine.api.restapi.types.CdRomMapper.CDROM_ID.toString ( ) ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getStaticData ( ) . getIsoPath ( ) ) ) ) { model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; model.getFile ( ) . setId ( entity.getStaticData ( ) . getIsoPath ( ) ) ; } return model ; }
Source:
private void updateMemoryBalloonDevice ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } boolean isBalloonEnabled = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isBalloonEnabled ( osType , cluster.getCompatibilityVersion ( ) ) ; getMemoryBalloonDeviceEnabled ( ) . setIsChangeable ( isBalloonEnabled ) ; if ( getBehavior ( ) . basedOnCustomInstanceType ( ) ) { getMemoryBalloonDeviceEnabled ( ) . setEntity ( isBalloonEnabled ) ; } }

Target:
public org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.ConsoleDisconnectAction > getConsoleDisconnectAction ( ) { return consoleDisconnectAction ; }
Source:
public static void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getMaxNumOfVmCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }

Target:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public boolean match ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile ) { return ( java.util.Objects.equals ( getEntity ( ) . getExternalNetworkName ( ) , vnicProfile.getNetworkName ( ) ) ) && ( java.util.Objects.equals ( getEntity ( ) . getExternalNetworkName ( ) , vnicProfile.getName ( ) ) ) ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile ) { return ( java.util.Objects.equals ( getEntity ( ) . getExternalNetworkName ( ) , vnicProfile.getNetworkName ( ) ) ) && ( java.util.Objects.equals ( getEntity ( ) . getExternalNetworkProfileName ( ) , vnicProfile.getName ( ) ) ) ; }
Source:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setVmName ( getVm ( ) . getName ( ) ) ; }

Target:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; }
Source:
public static void GetDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void testGetAllForValidQos ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > result = dao.getAllForQos ( FixturesTool.HOST_NETWORK_QOS_A ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.NETWORK_ENGINE , result.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetAllForValidQos ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > result = dao.getAllForQos ( FixturesTool.HOST_NETWORK_QOS_A ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , result.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.NETWORK_ENGINE , result.get ( 0 ) . getId ( ) ) ; }
Source:
protected void postBuild ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { model.getOSType ( ) . setSelectedItem ( vm.getOsId ( ) ) ; model.getAllowConsoleReconnect ( ) . setEntity ( vm.isAllowConsoleReconnect ( ) ) ; model.getIsStateless ( ) . setEntity ( vm.isStateless ( ) ) ; model.getIsRunAndPause ( ) . setEntity ( vm.isRunAndPause ( ) ) ; }

Target:
protected void postBuild ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { model.getOSType ( ) . setSelectedItem ( vm.getOsId ( ) ) ; model.getAllowConsoleReconnect ( ) . setEntity ( vm.isAllowConsoleReconnect ( ) ) ; model.getIsStateless ( ) . setEntity ( vm.isStateless ( ) ) ; model.getIsRunAndPause ( ) . setEntity ( vm.isRunAndPause ( ) ) ; model.getNumaTuneMode ( ) . setSelectedItem ( vm.getNumaTuneMode ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.bll.ChangeVMClusterCommand.getActionType ( ) . getActionGroup ( ) ) ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.getParameters ( ) . getClusterId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.ChangeVMClusterCommand.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.bll.ChangeVMClusterCommand.getActionType ( ) . getActionGroup ( ) ) ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.getParameters ( ) . getClusterId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_VM ) ) ; return permissionList ; }
Source:
public org.ovirt.engine.sdk.entities.Action exportDisk ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/export" ; 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 ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VMDisk update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; if ( correlationId != null ) { headersBuilder.add ( "Correlation-Id" , correlationId ) ; } 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 ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.VMDisk.class , headers ) ; }
Source:
protected static boolean canAttachPrestartedVmToUser ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < java.lang.String > messages ) { return ( ! ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmAssignedToUser ( vmId , messages ) ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmIsRunningStateless ( vmId ) ) ; }

Target:
protected static boolean canAttachPrestartedVmToUser ( org.ovirt.engine.core.compat.Guid vmId , boolean isStatefulPool , java.util.List < java.lang.String > messages ) { return ( ! ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmAssignedToUser ( vmId , messages ) ) ) && ( ( isStatefulPool && ( ! ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmIsStartedByRunOnce ( vmId ) ) ) ) || ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmIsRunningStateless ( vmId ) ) ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.getGroupKeys ( args , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL , java.lang.String.class ) ) ) ; if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.getGroupKeys ( args , context.get ( ContextKeys.POSITIONAL , java.lang.String.class ) ) ) ; if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
public static void getMaximalVmMemSize32OS ( 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 ( ) : 20480 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
private void runQueryByIdParameter ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.AsIsAsyncConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( queryType , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected boolean validateVmPoolProperties ( ) { if ( ( ( updateReadOnlyRequested ( ) ) || ( updateWipeAfterDeleteRequested ( ) ) ) && ( ( org.ovirt.engine.core.bll.storage.disk.UpdateVmDiskCommand.getVm ( ) . getVmPoolId ( ) ) != null ) ) return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_ATTACHED_TO_POOL ) ; return true ; }

Target:
protected boolean validateCanUpdateReadOnly ( org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator ) { if ( updateReadOnlyRequested ( ) ) { if ( ( ( org.ovirt.engine.core.bll.storage.disk.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return validate ( diskValidator.isReadOnlyPropertyCompatibleWithInterface ( ) ) ; } return true ; }
Source:
public void canDoActionFailsOnNullCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( null , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
public void testNotEnoughForMultipleDiskAndDomainsSecondDomainFails ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; imagesDisks.addAll ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; mockStorageDomainDAOGetForStoragePool ( 10 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 ) ; org.junit.Assert.assertFalse ( "Validation should fail. Second domain should not have enough free space for request." , cmd.validateStorageDomains ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnapshotsDummiesForStorageAllocations ( ) ; return disksList ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getClusterFeaturesByClusterId ( 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 ? ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( this . getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.RemoveIrsProxy ( ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( this . getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.removeIrsProxy ( ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "\n" ) ; builder.append ( super . toString ( ) ) ; builder.append ( "\n" ) ; org.ovirt.engine.core.vdsbroker.ObjectDescriptor.toStringBuilder ( storagePoolInfo , builder ) ; org.ovirt.engine.core.vdsbroker.ObjectDescriptor.toStringBuilder ( domainsList , builder ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "\n" ) ; builder.append ( super . toString ( ) ) ; builder.append ( "\n" ) ; org.ovirt.engine.core.utils.ObjectDescriptor.toStringBuilder ( storagePoolInfo , builder ) ; org.ovirt.engine.core.utils.ObjectDescriptor.toStringBuilder ( domainsList , builder ) ; return builder.toString ( ) ; }
Source:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getusb_policy ( ) , vm.getos ( ) , getVdsGroup ( ) , getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getUsbPolicy ( ) , vm.getOs ( ) , getVdsGroup ( ) , getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
public void testNotLinkedToExternalNetworkPositive ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkDao.getAllExternalNetworksLinkedToPhysicalNetwork ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.notLinkedToExternalNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void networkNotLabeled ( ) { org.hamcrest.MatcherAssert.assertThat ( validator.notLabeled ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void startFailedAutoStartVms ( ) { org.ovirt.engine.core.compat.DateTime now = org.ovirt.engine.core.compat.DateTime.getNow ( ) ; while ( ( ( autoStartVmsToRun.peek ( ) ) != null ) && ( ( now.compareTo ( autoStartVmsToRun.peek ( ) . getFirst ( ) ) ) > 0 ) ) { runVm ( autoStartVmsToRun.poll ( ) . getSecond ( ) ) ; } }

Target:
public void addVmToRun ( org.ovirt.engine.core.compat.Guid vmId ) { autoStartVmsToRun.add ( vmId ) ; }