auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.network.vm.GetVnicProfilesByNetworkIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.vm.GetVnicProfilesByNetworkIdQuery.getDbFacade ( ) . getVnicProfileViewDao ( ) . getAllForNetwork ( org.ovirt.engine.core.bll.network.vm.GetVnicProfilesByNetworkIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.GetVnicProfilesByNetworkIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.vm.GetVnicProfilesByNetworkIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.network.vm.GetVnicProfilesByNetworkIdQuery.getQueryReturnValue ( ) . setReturnValue ( vnicProfileViewDao.getAllForNetwork ( org.ovirt.engine.core.bll.network.vm.GetVnicProfilesByNetworkIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.GetVnicProfilesByNetworkIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.vm.GetVnicProfilesByNetworkIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public void diskImagesExist ( ) { org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( disk2.getId ( ) ) ; org.junit.Assert.assertEquals ( ValidationResult.VALID , validator.diskImagesNotExist ( ) ) ; }

Target:
public void diskImagesExist ( ) { org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesNotExist ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.VmPool deprecatedPopulate ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.api.model.VmPool entity ) { if ( ( model.isSetSize ( ) ) && ( ( model.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getVM ( model ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( vm.getVmtGuid ( ) . toString ( ) ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.VmPool deprecatedPopulate ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.api.model.VmPool entity ) { if ( ( model.isSetSize ( ) ) && ( ( model.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getVM ( model ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( vm.getVmtGuid ( ) . toString ( ) ) ; model = getMapper ( org.ovirt.engine.core.common.businessentities.VM.class , org.ovirt.engine.api.model.VmPool.class ) . map ( vm , model ) ; } return model ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; if ( ( ( cluster != null ) && ( cluster.supportsGlusterService ( ) ) ) && ( ! ( cluster.supportsVirtService ( ) ) ) ) { model.getForce ( ) . setIsAvailable ( true ) ; } model.StopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; if ( ( ( cluster != null ) && ( cluster.supportsGlusterService ( ) ) ) && ( ! ( cluster.supportsVirtService ( ) ) ) ) { model.getForce ( ) . setIsAvailable ( true ) ; } model.stopProgress ( ) ; }
Source:
private static void testFingerprintString ( final java.lang.String keyEncoding , final java.lang.String goodFingerprintString , java.lang.String algo ) throws java.lang.Exception { final java.security.PublicKey key = org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.decodeKey ( keyEncoding ) ; final java.lang.String fingerprintString = org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.getKeyFingerprint ( key , algo ) ; org.junit.Assert.assertEquals ( goodFingerprintString , fingerprintString ) ; }

Target:
private static void testFingerprintString ( final java.lang.String keyEncoding , final java.lang.String goodFingerprintString , java.lang.String algo ) throws java.lang.Exception { final java.security.PublicKey key = org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.decodeKey ( keyEncoding ) ; final java.lang.String fingerprintString = org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.getKeyFingerprint ( key , algo ) ; org.junit.Assert.assertEquals ( goodFingerprintString , fingerprintString ) ; org.junit.Assert.assertEquals ( algo , org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.getKeyFingerprintHash ( fingerprintString ) ) ; }
Source:
protected void failedToRunVm ( ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { processVmPoolOnStopVm ( ) ; } } ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; }

Target:
protected void runningFailed ( ) { try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
public static void GetCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void GetClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
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 , VdcBllMessages.NETWORK_INTERFACES_DONT_EXIST , ifaceName ) ; }

Target:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface anotherBond = createBond ( ( ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) + "1" ) , 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 ) ; parameters.getInterfaces ( ) . add ( createVlan ( anotherBond , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_DONT_EXIST , anotherBond.getName ( ) ) ; }
Source:
void saveSelectedDomain ( T loginModel ) { java.lang.String selectedItem = loginModel.getDomain ( ) . getSelectedItem ( ) ; if ( ( selectedItem == null ) || ( "" . equals ( selectedItem ) ) ) { return ; } clientStorage.setLocalItem ( getSelectedDomainKey ( ) , selectedItem ) ; }

Target:
void saveSelectedDomain ( T loginModel ) { java.lang.String selectedItem = loginModel.getProfile ( ) . getSelectedItem ( ) ; if ( ( selectedItem == null ) || ( "" . equals ( selectedItem ) ) ) { return ; } clientStorage.setLocalItem ( getSelectedDomainKey ( ) , selectedItem ) ; }
Source:
private void setUpGetCertuficateExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.CERTIFICATE ) ; } }

Target:
public void testCloneFromTemplateWithClonePermissionsDontClone ( ) throws java.lang.Exception { doTestCloneFromTemplateWithClonePermissions ( createModel ( createDisksCollection ( ) ) , false ) ; }
Source:
public void canDoActionVmRunningStateless ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS.name ( ) ) ) ; }

Target:
public void validateVmRunningStateless ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS.name ( ) ) ) ; }
Source:
private boolean shouldAbortOnClientInactivityTimeout ( org.ovirt.engine.core.common.businessentities.storage.ImageTransfer entity , long ts , java.lang.Integer idleTimeFromTicket ) { int inactivityTimeout = getTransferImageClientInactivityTimeoutInSeconds ( ) ; boolean timeoutExceeded = ( idleTimeFromTicket != null ) ? idleTimeFromTicket > inactivityTimeout : ts > ( ( ( entity.getLastUpdated ( ) . getTime ( ) ) / 1000 ) + inactivityTimeout ) ; return ( ( inactivityTimeout > 0 ) && timeoutExceeded ) && ( ! ( entity.getActive ( ) ) ) ; }

Target:
private boolean shouldAbortOnClientInactivityTimeout ( org.ovirt.engine.core.common.businessentities.storage.ImageTransfer entity , long ts , java.lang.Integer idleTimeFromTicket ) { int inactivityTimeout = entity.getClientInactivityTimeout ( ) ; boolean timeoutExceeded = ( idleTimeFromTicket != null ) ? idleTimeFromTicket > inactivityTimeout : ts > ( ( ( entity.getLastUpdated ( ) . getTime ( ) ) / 1000 ) + inactivityTimeout ) ; return ( ( inactivityTimeout > 0 ) && timeoutExceeded ) && ( ! ( entity.getActive ( ) ) ) ; }
Source:
public void snapshotExistsByGuidReturnsInvalidResultWhenNoSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.mockito.Mockito.when ( snapshotDao.exists ( vmId , snapshotId ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.snapshots.SnapshotsValidatorTest.validateInvalidResult ( validator.snapshotExists ( vmId , snapshotId ) , VdcBllMessages.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }

Target:
public void setUp ( ) { vmId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; snapshotId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.mockito.Mockito.doReturn ( snapshotDao ) . when ( validator ) . getSnapshotDao ( ) ; }
Source:
public void checkCidrBadFormat ( ) { org.mockito.Mockito.doReturn ( false ) . when ( mockedCidrValidator ) . isCidrFormatValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actualResult = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult expectedResult = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( false , java.util.Collections.singletonList ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.BAD_CIDR_FORMAT ) ) ; org.junit.Assert.assertEquals ( expectedResult , actualResult ) ; }

Target:
public void checkCidrBadFormat ( ) { org.mockito.Mockito.doReturn ( false ) . when ( mockedCidrValidator ) . isCidrFormatValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actualResult = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult expectedResult = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( false , java.util.Collections.singletonList ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.BAD_CIDR_FORMAT ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedResult , actualResult ) ; }
Source:
public void thpDefaultTrueTest ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 3 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.Cluster transform = getMapper ( ) . map ( cluster , null ) ; org.junit.Assert.assertTrue ( transform.getTransparentHugepages ( ) ) ; }

Target:
public void thpDefaultTrueTest ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 3 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.Cluster transform = getMapper ( ) . map ( cluster , null ) ; org.junit.jupiter.api.Assertions.assertTrue ( transform.getTransparentHugepages ( ) ) ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( VdcActionType.CopyImageGroup , p , org.ovirt.engine.core.bll.ImportVmCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.ImportVmCommand.getImagesActionType ( ) , p , org.ovirt.engine.core.bll.ImportVmCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }
Source:
public void testEffectiveEmulatedMachineWithoutCustomSet ( ) { final org.ovirt.engine.core.common.businessentities.VmBase vmBase = new org.ovirt.engine.core.common.businessentities.VmBase ( ) ; final org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setEmulatedMachine ( "cluster-pc-i440fx-rhel7.3.0" ) ; org.junit.Assert.assertEquals ( "cluster-pc-i440fx-rhel7.3.0" , org.ovirt.engine.core.bll.utils.EmulatedMachineUtils.getEffective ( vmBase , ( ) -> cluster ) ) ; }

Target:
public void testEffectiveEmulatedMachineWithoutCustomSet ( ) { final org.ovirt.engine.core.common.businessentities.VmBase vmBase = new org.ovirt.engine.core.common.businessentities.VmBase ( ) ; final org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setEmulatedMachine ( "cluster-pc-i440fx-rhel7.3.0" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "cluster-pc-i440fx-rhel7.3.0" , org.ovirt.engine.core.bll.utils.EmulatedMachineUtils.getEffective ( vmBase , ( ) -> cluster ) ) ; }
Source:
public void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getSearchResultsLimit ( 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 ) ) : 100 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SearchResultsLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void SleepOnReboot ( final org.ovirt.engine.core.common.businessentities.VDSStatus status ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ServerRebootTimeout ) ; log.infoFormat ( "Waiting {0} seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , status ) ) ; }

Target:
private void SleepOnReboot ( final org.ovirt.engine.core.common.businessentities.VDSStatus status ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ServerRebootTimeout ) ; log.infoFormat ( "Waiting {0} seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , status ) ) ; }
Source:
public static void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public 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 ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setTitle ( ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? getDefaultTitle ( ) : null ) ) ; return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.externalDiskIcon ( ) : null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.lunDisksLabel ( ) ) ; } return null ; }
Source:
private java.lang.String getMigrationNetworkAddress ( org.ovirt.engine.core.compat.Guid hostId , java.lang.String migrationNetworkName ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = org.ovirt.engine.core.bll.MigrateVmCommand.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( hostId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nics ) { if ( ( migrationNetworkName.equals ( nic.getNetworkName ( ) ) ) && ( migrationInterfaceUp ( nic , nics ) ) ) { return nic.getAddress ( ) ; } } return null ; }

Target:
private java.lang.String getMigrationNetworkAddress ( org.ovirt.engine.core.compat.Guid hostId , java.lang.String migrationNetworkName ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = org.ovirt.engine.core.bll.MigrateVmCommand.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( hostId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nics ) { if ( ( migrationNetworkName.equals ( nic.getNetworkName ( ) ) ) && ( migrationInterfaceUp ( nic , nics ) ) ) { return nic.getIpv4Address ( ) ; } } return null ; }
Source:
private void updateActionAvailability ( ) { java.util.List items = ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItem ( ) ) != null ) ) ? getSelectedItems ( ) : new java.util.ArrayList ( ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) == 1 ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) > 0 ) ) ; getCloneCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) == 1 ) ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.core.common.queries.SearchParameters tempVar = new org.ovirt.engine.core.common.queries.SearchParameters ( applySortOptions ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaListModel.getSearchString ( ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Quota , org.ovirt.engine.ui.uicommonweb.models.quota.QuotaListModel.isCaseSensitiveSearch ( ) ) ; tempVar.setMaxCount ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaListModel.getSearchPageSize ( ) ) ; super . syncSearch ( VdcQueryType.Search , tempVar ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Down ) ; vm.setstorage_pool_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; vm.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }
Source:
private void setupExpectedVolume ( ) { expected = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; expected.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; brickEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brickEntity.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; brickEntity.setServerId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; brickEntity.setBrickDirectory ( "/tmp/b1" ) ; brickEntity.setStatus ( GlusterStatus.DOWN ) ; bricks.add ( brickEntity ) ; expected.setBricks ( bricks ) ; }

Target:
private void setupExpectedVolume ( ) { expected = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; expected.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; brickEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brickEntity.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; brickEntity.setServerId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; brickEntity.setBrickDirectory ( "/tmp/b1" ) ; brickEntity.setStatus ( GlusterStatus.DOWN ) ; bricks.add ( brickEntity ) ; expected.setBricks ( bricks ) ; }
Source:
public void validateFailsWhenGlusterServerHasPeers ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.SERVER_ALREADY_PART_OF_ANOTHER_CLUSTER.toString ( ) ) ) ; }

Target:
public void validateFailsWhenGlusterServerHasPeers ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.SERVER_ALREADY_PART_OF_ANOTHER_CLUSTER.toString ( ) ) ) ; }
Source:
public java.lang.Boolean call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( _deploy.getVds ( ) . getVdsGroupId ( ) ) ; java.lang.String tunedProfile = ( vdsGroup.supportsGlusterService ( ) ) ? vdsGroup.getGlusterTunedProfile ( ) : null ; if ( ( tunedProfile == null ) || ( tunedProfile.isEmpty ( ) ) ) { _deploy.getParser ( ) . cliNoop ( ) ; } else { _deploy.getParser ( ) . cliEnvironmentSet ( TuneEnv.TUNED_PROFILE , tunedProfile ) ; } return true ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getClusterDao ( ) . get ( _deploy.getVds ( ) . getClusterId ( ) ) ; java.lang.String tunedProfile = ( cluster.supportsGlusterService ( ) ) ? cluster.getGlusterTunedProfile ( ) : null ; if ( ( tunedProfile == null ) || ( tunedProfile.isEmpty ( ) ) ) { _deploy.getParser ( ) . cliNoop ( ) ; } else { _deploy.getParser ( ) . cliEnvironmentSet ( TuneEnv.TUNED_PROFILE , tunedProfile ) ; } return true ; }
Source:
public javax.ws.rs.core.Response replace ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "Brick.serverId" , "Brick.brickDir" ) ; org.ovirt.engine.api.restapi.types.Mapper < org.ovirt.engine.api.model.GlusterBrick , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > mapper = getMapper ( org.ovirt.engine.api.model.GlusterBrick.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity.class ) ; return doAction ( VdcActionType.ReplaceGlusterVolumeBrick , new org.ovirt.engine.core.common.action.gluster.GlusterVolumeReplaceBrickActionParameters ( asGuid ( getVolumeId ( ) ) , org.ovirt.engine.core.common.businessentities.gluster.GlusterTaskOperation.START , mapper.map ( get ( ) , null ) , mapper.map ( action.getBrick ( ) , null ) , ( action.isSetForce ( ) ? action.isForce ( ) : false ) ) , action ) ; }

Target:
public javax.ws.rs.core.Response replace ( org.ovirt.engine.api.model.Action action ) { throw new org.ovirt.engine.api.restapi.resource.gluster.WebFaultException ( null , localize ( Messages.GLUSTER_VOLUME_REPLACE_BRICK_NOT_SUPPORTED ) , Response.Status.SERVICE_UNAVAILABLE ) ; }
Source:
public void validateFailsIHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters param = org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommandTest.createParameters ( ) ; org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = createCommand ( param ) ; org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommandTest.assertFailsWithValidateMessage ( command , EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }

Target:
public void validateFailsIfHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters param = org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommandTest.createParameters ( ) ; org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = createCommand ( param ) ; org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommandTest.assertFailsWithValidateMessage ( command , EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }
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 ) ; 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 ) ; }

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 ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > filter ( final java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > data ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > filtered = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable vmt_helper : data ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmt = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( vmt_helper ) ) ; if ( ( vmt.getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ) { continue ; } filtered.add ( vmt ) ; } return filtered ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > searchVMTemplates ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmTemplateDao ( ) , true ) ; }
Source:
protected void verifyModel ( R model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendResourceTest.verifyLinks ( model ) ; }

Target:
protected void verifyModel ( R 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 ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendResourceTest.verifyLinks ( model ) ; }
Source:
protected void updateManagedDeviceMap ( org.ovirt.engine.core.common.businessentities.DiskImage disk , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > managedDeviceMap ) { org.ovirt.engine.core.compat.Guid oldDiskId = newDiskIdForDisk.get ( disk.getId ( ) ) . getId ( ) ; managedDeviceMap.put ( disk.getId ( ) , managedDeviceMap.get ( oldDiskId ) ) ; managedDeviceMap.remove ( oldDiskId ) ; }

Target:
protected void updateManagedDeviceMap ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > managedDeviceMap ) { org.ovirt.engine.core.compat.Guid oldDiskId = newDiskIdForDisk.get ( disk.getId ( ) ) . getId ( ) ; managedDeviceMap.put ( disk.getId ( ) , managedDeviceMap.get ( oldDiskId ) ) ; managedDeviceMap.remove ( oldDiskId ) ; }
Source:
public void diskImagesHasDerivedDisksOnStorageDomain ( ) { org.ovirt.engine.core.compat.Guid storageDomainId = org.ovirt.engine.core.compat.Guid.Empty ; disk1.setVmEntityType ( VmEntityType.TEMPLATE ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageDomainIds = new java.util.ArrayList < > ( ) ; storageDomainIds.add ( storageDomainId ) ; disk2.setStorageIds ( storageDomainIds ) ; org.mockito.Mockito.when ( diskImageDao.getAllSnapshotsForParent ( disk1.getImageId ( ) ) ) . thenReturn ( java.util.Arrays.asList ( disk2 ) ) ; org.junit.Assert.assertThat ( validator.diskImagesHaveNoDerivedDisks ( storageDomainId ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DETECTED_DERIVED_DISKS ) ) ; }

Target:
public void diskImagesHasDerivedDisksOnStorageDomain ( ) { org.ovirt.engine.core.compat.Guid storageDomainId = org.ovirt.engine.core.compat.Guid.Empty ; disk1.setVmEntityType ( VmEntityType.TEMPLATE ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageDomainIds = new java.util.ArrayList < > ( ) ; storageDomainIds.add ( storageDomainId ) ; disk2.setStorageIds ( storageDomainIds ) ; org.mockito.Mockito.when ( diskImageDao.getAllSnapshotsForParent ( disk1.getImageId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( disk2 ) ) ; org.junit.Assert.assertThat ( validator.diskImagesHaveNoDerivedDisks ( storageDomainId ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DETECTED_DERIVED_DISKS ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( ! ( isVisible ( value ) ) ) { return ; } com.google.gwt.resources.client.ImageResource image = resources.expanderDownImage ( ) ; com.google.gwt.safehtml.shared.SafeHtml imageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( image ) . getHTML ( ) ) ; sb.append ( templates.volumeActivityMenu ( imageHtml ) ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( ! ( isVisible ( value ) ) ) { return ; } com.google.gwt.resources.client.ImageResource image = org.ovirt.engine.ui.webadmin.widget.table.cell.MenuCell.resources.expanderDownImage ( ) ; com.google.gwt.safehtml.shared.SafeHtml imageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( image ) . getHTML ( ) ) ; sb.append ( org.ovirt.engine.ui.webadmin.widget.table.cell.MenuCell.templates.volumeActivityMenu ( imageHtml ) ) ; }
Source:
protected void UpdateDefaultTimeZone ( ) { if ( ( cachedDefaultTimeZoneKey ) == null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDefaultTimeZone ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; cachedDefaultTimeZoneKey = ( ( java.lang.String ) ( returnValue ) ) ; behavior.PostUpdateDefaultTimeZone ( ) ; } } , getModel ( ) . getHash ( ) ) ) ; } else { PostUpdateDefaultTimeZone ( ) ; } }

Target:
protected void updateDefaultTimeZone ( ) { if ( ( cachedDefaultTimeZoneKey ) == null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultTimeZone ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; cachedDefaultTimeZoneKey = ( ( java.lang.String ) ( returnValue ) ) ; behavior.postUpdateDefaultTimeZone ( ) ; } } , getModel ( ) . getHash ( ) ) ) ; } else { postUpdateDefaultTimeZone ( ) ; } }
Source:
public void testAddStorageDomainNoHost ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageDomain model = org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "StorageDomain" , "add" , "host.id|name" ) ; } }

Target:
public void testAddStorageDomainNoHost ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageDomain model = org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "StorageDomain" , "add" , "host.id|name" ) ; } }
Source:
public void diskImagesAlreadyExistBothExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }

Target:
public void diskImagesAlreadyExistBothExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( org.mockito.ArgumentMatchers.any ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }
Source:
public void testValidModifiedBondsFailsWhenInsufficientNumberOfSlaves ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_BONDS_INVALID_SLAVE_COUNT_LIST , bond.getName ( ) ) ) , ValidationResult.VALID ) ; }

Target:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , bond.getName ( ) ) ) ; doTestValidModifiedBonds ( bond , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }
Source:
protected void synchronizeNics ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > nics , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; vmInterfaceManager.removeAll ( vmId ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmInterface : nics ) { if ( ( vmInterface.getId ( ) ) == null ) { vmInterface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } vmInterface.setVmId ( vmId ) ; vmInterfaceManager.add ( vmInterface , compensationContext , false ) ; } }

Target:
protected void synchronizeNics ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; vmInterfaceManager.removeAll ( vmId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmInterface : nics ) { if ( ( vmInterface.getId ( ) ) == null ) { vmInterface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } vmInterface.setVmId ( vmId ) ; vmInterfaceManager.add ( vmInterface , compensationContext , false ) ; } }