auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public static void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public final boolean connect ( java.lang.String server , java.lang.String certPath , java.lang.String password ) { org.ovirt.engine.core.utils.hostinstall.Credentials creds = new org.ovirt.engine.core.utils.hostinstall.Credentials ( ) ; creds.setPassphrase ( password ) ; creds.setCertPath ( certPath ) ; creds.setUsername ( "root" ) ; return _do_connect ( server , creds ) ; }

Target:
public final boolean connect ( java.lang.String server , java.lang.String certPath , java.lang.String password ) { org.ovirt.engine.core.utils.hostinstall.Credentials creds = new org.ovirt.engine.core.utils.hostinstall.Credentials ( ) ; creds.setPassphrase ( password ) ; creds.setCertPath ( certPath ) ; creds.setUsername ( "root" ) ; return _doConnect ( server , creds ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( getActionState ( ) ) { case EXECUTE : return getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_STARTING_IMPORT_VM : org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; case END_SUCCESS : return getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM : org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.IMPORTEXPORT_IMPORT_VM_FAILED ; } return super . getAuditLogTypeValue ( ) ; }

Target:
private void removeVmSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < java.lang.String > memoryStates = snapshotsManager.removeSnapshots ( vm.getId ( ) ) ; if ( ! ( memoryStates.isEmpty ( ) ) ) { new org.ovirt.engine.core.bll.memory.MemoryImageRemoverOnDataDomain ( vm , this ) . remove ( memoryStates ) ; } }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getParameters ( ) . getDstSnapshotId ( ) ) ; if ( snapshot != null ) { jobProperties.put ( VdcObjectType.Snapshot.name ( ) . toLowerCase ( ) , snapshot.getDescription ( ) ) ; } } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; if ( ( getSnapshotName ( ) ) != null ) { jobProperties.put ( VdcObjectType.Snapshot.name ( ) . toLowerCase ( ) , getSnapshotName ( ) ) ; } } return jobProperties ; }
Source:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDirectoryGroupById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Id" } , new java.lang.Object [ ] { DOMAIN , new java.lang.String ( javax.xml.bind.DatatypeConverter.parseHexBinary ( EXTERNAL_IDS [ index ] ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) } , ( notFound ? null : getEntity ( index ) ) ) ; }

Target:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDirectoryGroupById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Namespace" , "Id" } , new java.lang.Object [ ] { DOMAIN , "" , org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( EXTERNAL_IDS [ index ] ) } , ( notFound ? null : getEntity ( index ) ) ) ; }
Source:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
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 getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; if ( ( getStorageDomainStatus ( ) ) != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( getStorageDomainStatus ( ) ) ; } if ( ! valid ) { addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }

Target:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; if ( status != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( status ) ; } if ( ! valid ) { if ( status == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; } addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.LOCKED , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; runInternalAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }
Source:
public javax.ws.rs.core.Response performRemove ( java.lang.String id ) { return performAction ( VdcActionType.RemoveVm , new org.ovirt.engine.core.common.action.RemoveVmParameters ( asGuid ( id ) , false ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmTemplate lookupTemplate ( org.ovirt.engine.api.model.Template template , org.ovirt.engine.core.compat.Guid datacenterId ) { if ( template.isSetId ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( asGuid ( template.getId ( ) ) ) , "GetVmTemplate" ) ; } else if ( template.isSetName ( ) ) { org.ovirt.engine.core.common.queries.GetVmTemplateParameters params = new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( template.getName ( ) ) ; params.setDataCenterId ( datacenterId ) ; return getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , VdcQueryType.GetVmTemplate , params , "GetVmTemplate" ) ; } return null ; }
Source:
protected java.lang.String getHeaderBuilderCode ( java.util.List < org.ovirt.engine.sdk.entities.Header > headers ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.sdk.entities.Header header : headers ) { java.lang.String headerName = header.getName ( ) ; org.ovirt.engine.sdk.codegen.templates.HeaderBuilderParameterTemplate template = new org.ovirt.engine.sdk.codegen.templates.HeaderBuilderParameterTemplate ( ) ; buffer.append ( "\n" ) ; buffer.append ( template.getTemplate ( headerName , org.ovirt.engine.sdk.codegen.utils.FormatUtils.toJava ( headerName ) ) ) ; } return buffer.toString ( ) ; }

Target:
protected java.lang.String getHeaderBuilderCode ( java.util.List < org.ovirt.engine.sdk.entities.Header > headers ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.sdk.entities.Header header : headers ) { java.lang.String headerName = header.getName ( ) ; org.ovirt.engine.sdk.codegen.templates.HeaderBuilderParameterTemplate template = new org.ovirt.engine.sdk.codegen.templates.HeaderBuilderParameterTemplate ( ) ; buffer.append ( "\n" ) ; buffer.append ( template.evaluate ( headerName , org.ovirt.engine.sdk.codegen.utils.FormatUtils.toJava ( headerName ) ) ) ; } return buffer.toString ( ) ; }
Source:
org.ovirt.engine.core.bll.validator.NetworkValidator getNetworkValidator ( ) { if ( ( networkValidator ) == null ) { networkValidator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( getNetwork ( ) ) ; } return networkValidator ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkNotAttachedToHost ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ALREADY_ATTACHED_TO_HOST , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "networkName" , getNetwork ( ) . getName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "hostName" , host.getName ( ) ) ) . when ( networkAttachedToHost ( ) ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
private void discoverGeoRepDataInCluster ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.lang.String volumeName ) { if ( ! ( supportsGlusterGeoRepFeature ( cluster ) ) ) { return ; } java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > sessionsMap = getSessionsFromCLI ( cluster , volumeName ) ; if ( sessionsMap == null ) { org.ovirt.engine.core.bll.gluster.GlusterGeoRepSyncJob.log.debug ( "No sessions retrieved for cluster: from CLI, nothing to do" , cluster.getName ( ) ) ; return ; } updateDiscoveredSessions ( cluster , sessionsMap ) ; }

Target:
private void discoverGeoRepDataInCluster ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { if ( ! ( supportsGlusterGeoRepFeature ( cluster ) ) ) { return ; } java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > sessionsMap = getSessionsFromCLI ( cluster , volume ) ; if ( sessionsMap == null ) { org.ovirt.engine.core.bll.gluster.GlusterGeoRepSyncJob.log.debug ( "No sessions retrieved for cluster: from CLI, nothing to do" , cluster.getName ( ) ) ; return ; } updateDiscoveredSessions ( cluster , sessionsMap , volume ) ; }
Source:
public void preventRollback ( ) { org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setExecutionIndex ( 0 ) ; }

Target:
private void setupParameters ( ) { org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setImageGroupID ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setDestinationImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ) ; }
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 ( ( ( nic.getStatistics ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ) && ( migrationNetworkName.equals ( nic.getNetworkName ( ) ) ) ) { 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.getAddress ( ) ; } } return null ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getRestoreCommand ( ) ) ) { return importVmPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterVmListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getImportCommand ( ) ) ) { return registerEntityPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public org.ovirt.engine.api.resource.DeviceResource < org.ovirt.engine.api.model.Nic > getNicResource ( java.lang.String id ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendTemplateNicResource ( parentId , id , this , updateType , getUpdateParametersProvider ( ) , getRequiredUpdateFields ( ) , subCollections ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Nic nic ) { validateEnums ( org.ovirt.engine.api.model.Nic.class , nic ) ; validateParameters ( nic , "name" ) ; return performCreate ( VdcActionType.AddVmTemplateInterface , new org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters ( instanceTypeId , map ( nic ) ) , new org.ovirt.engine.api.restapi.resource.NicResolver ( nic.getName ( ) ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.Erratum getErratumForHost ( java.lang.String hostName , java.lang.String erratumId ) { org.ovirt.engine.core.bll.host.provider.foreman.ContentHost contentHost = findContentHost ( hostName ) ; if ( contentHost == null ) { log.error ( "Failed to find host on provider '{}' by host name '{}' " , getProvider ( ) . getName ( ) , hostName ) ; return null ; } return runErratumMethod ( java.lang.String.format ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.CONTENT_HOST_ERRATUM_ENTRY_POINT , contentHost.getUuid ( ) , erratumId ) ) ; }

Target:
private org.ovirt.engine.core.bll.host.provider.ContentHostProvider getContentHostProvider ( ) { org.ovirt.engine.core.compat.Version foremanVersion = getForemanVersion ( ) ; if ( ( foremanVersion != null ) && ( foremanVersion.greaterOrEquals ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.KATELLO_V3_VERSION ) ) ) { return new org.ovirt.engine.core.bll.host.provider.foreman.KatelloV30Provider ( this ) ; } else { return new org.ovirt.engine.core.bll.host.provider.foreman.KatelloV21Provider ( this ) ; } }
Source:
private org.ovirt.engine.core.bll.network.macpool.MacPool getMacPoolWithoutLocking ( org.ovirt.engine.core.compat.Guid macPoolId , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { final org.ovirt.engine.core.bll.network.macpool.MacPool poolById = macPools.get ( macPoolId ) ; if ( poolById == null ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.INEXISTENT_POOL_EXCEPTION_MESSAGE ) ; } return decoratedMacPoolFactory.createDecoratedPool ( macPoolId , poolById , decorators ) ; }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacPool getMacPoolWithoutLocking ( org.ovirt.engine.core.compat.Guid macPoolId , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { final org.ovirt.engine.core.bll.network.macpool.MacPool poolById = macPools.get ( macPoolId ) ; if ( poolById == null ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.INEXISTENT_POOL_EXCEPTION_MESSAGE ) ; } return decoratedMacPoolFactory.createDecoratedPool ( macPoolId , poolById , decorators ) ; }
Source:
public void canDoActionFailsWhenGlusterServerHasPeers ( ) 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 ( commandMock.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getCanDoActionMessages ( ) . 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.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 ( commandMock.validate ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.SERVER_ALREADY_PART_OF_ANOTHER_CLUSTER.toString ( ) ) ) ; }
Source:
public void getVdsGroupIdVdsGroup ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup gr = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; gr.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVdsGroup ( gr ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsGroupId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }

Target:
public void getClusterIdCluster ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.Cluster gr = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; gr.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setCluster ( gr ) ; final org.ovirt.engine.core.compat.Guid g = b.getClusterId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }
Source:
public void testValidateNotEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesDisks = mockDisksList ( 4 ) ; org.mockito.Mockito.when ( storageDomainsValidator.allDomainsHaveSpaceForClonedDisks ( imagesDisks ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void testValidateNotEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; mockDisksList ( 2 ) ; org.mockito.Mockito.when ( storageDomainsValidator.allDomainsHaveSpaceForMerge ( org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.Provider provider = org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getDbFacade ( ) . getProviderDao ( ) . get ( org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . getProvidedBy ( ) . getProviderId ( ) ) ; org.ovirt.engine.core.bll.provider.network.NetworkProviderProxy proxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . getProvidedBy ( ) . setExternalId ( proxy.add ( org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) ) ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . setVlanId ( null ) ; super . executeCommand ( ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.provider.network.NetworkProviderProxy proxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . getProvidedBy ( ) . setExternalId ( proxy.add ( org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) ) ) ; org.ovirt.engine.core.bll.provider.network.AddNetworkOnProviderCommand.getNetwork ( ) . setVlanId ( null ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { addNetwork ( ) ; return null ; } } ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryDirectoryUsers ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { return org.ovirt.engine.core.aaa.DirectoryUtils.mapPrincipalRecords ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipalRecords ( extension , namespace , filter , groupsResolving , groupsResolvingRecursive ) ) ; }

Target:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > queryDirectoryGroups ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > directoryGroups = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : org.ovirt.engine.core.aaa.AuthzUtils.queryGroupRecords ( extension , namespace , filter , groupsResolving , groupsResolvingRecursive ) ) { directoryGroups.add ( org.ovirt.engine.core.aaa.DirectoryUtils.mapGroupRecordToDirectoryGroup ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , group ) ) ; } return directoryGroups ; }
Source:
protected boolean connectToStorage ( ) { org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters newConnectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) ) ; return runVdsCommand ( VDSCommandType.ConnectStorageServer , newConnectionParametersForVdsm ) . getSucceeded ( ) ; }

Target:
protected boolean connectToStorage ( ) { org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters newConnectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) ) ; return runVdsCommand ( VDSCommandType.ConnectStorageServer , newConnectionParametersForVdsm ) . getSucceeded ( ) ; }
Source:
public void latchedRunnableWrapperTest ( ) { final int threadsNumber = 100 ; runThreads ( threadsNumber , new org.ovirt.engine.core.utils.thread.LatchedRunnableWrapperTest.RunnableCreator ( ) { @ java.lang.Override public java.lang.Runnable createRunnable ( ) { return new org.ovirt.engine.core.utils.thread.LatchedRunnableWrapperTest.DummyRunnable ( ) ; } } ) ; org.junit.Assert.assertEquals ( threadsNumber , counter.intValue ( ) ) ; }

Target:
public void submitFullFailure ( ) { boolean gotException = false ; prepareMocks ( 0 ) ; try { latchedRunnableExecuter.execute ( ) ; } catch ( java.util.concurrent.RejectedExecutionException e ) { gotException = true ; } org.junit.Assert.assertTrue ( "expected RejectedExecutionException wasn't thrown" , gotException ) ; org.junit.Assert.assertEquals ( "the counter was incremented more times then expected" , 0 , counter.intValue ( ) ) ; org.junit.Assert.assertEquals ( "latch counter wasn't in the expected value" , org.ovirt.engine.core.utils.thread.LatchedRunnableWrapperTest.THREADS_NUMBER , latch.getCount ( ) ) ; verifyCommonFailureChecks ( ) ; }
Source:
public void getGlusterVolumeGeoRepRecommendationViolations ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId , org.ovirt.engine.core.compat.Guid slaveVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return returnValue == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ) ( returnValue ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNonEligibilityReasonsOfVolumeForGeoRepSession , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeGeoRepEligibilityParameters ( masterVolumeId , slaveVolumeId ) , aQuery ) ; }

Target:
public void getGlusterVolumeGeoRepRecommendationViolations ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId , org.ovirt.engine.core.compat.Guid slaveVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return returnValue == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ) ( returnValue ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNonEligibilityReasonsOfVolumeForGeoRepSession , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeGeoRepEligibilityParameters ( masterVolumeId , slaveVolumeId ) , aQuery ) ; }
Source:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public 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 ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { return new org.ovirt.engine.core.common.utils.Pair ( getGuid ( rs , "numa_node_id" ) , rs.getInt ( "cpu_core_id" ) ) ; }

Target:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmNumaNode > mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VmNumaNode entity = new org.ovirt.engine.core.common.businessentities.VmNumaNode ( ) ; entity.setId ( getGuid ( rs , "vm_numa_node_id" ) ) ; entity.setIndex ( rs.getInt ( "vm_numa_node_index" ) ) ; entity.setMemTotal ( rs.getLong ( "vm_numa_node_mem_total" ) ) ; return new org.ovirt.engine.core.common.utils.Pair ( getGuid ( rs , "vm_numa_node_vm_id" ) , entity ) ; }
Source:
public void testChangeCd ( ) throws java.lang.Exception { resource.setUriInfo ( setUpChangeCdUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , VMStatus.Up ) ; setUpActionExpectations ( VdcActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendCdRomResourceTest.ISO_PATH } , true , true ) ; org.ovirt.engine.api.model.CdRom cdrom = resource.update ( getUpdate ( ) ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }

Target:
public void testChangeCdUsingQueryParameter ( ) throws java.lang.Exception { resource.setUriInfo ( setUpChangeCdUriQueryExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , VMStatus.Up ) ; setUpActionExpectations ( VdcActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendCdRomResourceTest.ISO_PATH } , true , true ) ; org.ovirt.engine.api.model.CdRom cdrom = resource.update ( getUpdate ( ) ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getAllWithQuery ( java.lang.String query ) { return jdbcTemplate.query ( query , org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.VdsGroupRowMapper.instance ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getAllWithQuery ( java.lang.String query ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groups = jdbcTemplate.query ( query , org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.VdsGroupRowMapper.instance ) ; try { return getHostsAndVmsForClusters ( groups ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.log.error ( ( "Can't load host and vm count for cluster. Query is " + query ) , e ) ; } return groups ; }
Source:
public void testGetAllWithTemplate ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllWithTemplate ( FixturesTool.VM_TEMPLATE_RHEL5 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : result ) { org.junit.Assert.assertEquals ( FixturesTool.VM_TEMPLATE_RHEL5 , vm.getVmtGuid ( ) ) ; } }

Target:
public void testGetAllWithTemplate ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllWithTemplate ( FixturesTool.VM_TEMPLATE_RHEL5 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : result ) { org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.VM_TEMPLATE_RHEL5 , vm.getVmtGuid ( ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.setVmTicket ( vmId , otp64 , sec ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( 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.irsbroker.StatusReturnForXmlRpc verifyUntrustedVolume ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.verifyUntrustedVolume ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private static org.ovirt.engine.core.common.utils.Pair startOnBootFalse ( ) { org.ovirt.engine.core.common.businessentities.VmInit vmInit = new org.ovirt.engine.core.common.businessentities.VmInit ( ) ; org.ovirt.engine.core.common.businessentities.VmInitNetwork underTest = new org.ovirt.engine.core.common.businessentities.VmInitNetwork ( ) ; underTest.setStartOnBoot ( false ) ; vmInit.setNetworks ( java.util.Arrays.asList ( underTest ) ) ; return new org.ovirt.engine.core.common.utils.Pair ( vmInit , new java.lang.IllegalArgumentException ( "Malformed input" , new java.lang.IllegalArgumentException ( "'Start on boot' must be true" ) ) ) ; }

Target:
private static org.ovirt.engine.core.common.utils.Pair startOnBootFalse ( ) { org.ovirt.engine.core.common.businessentities.VmInit vmInit = new org.ovirt.engine.core.common.businessentities.VmInit ( ) ; org.ovirt.engine.core.common.businessentities.VmInitNetwork underTest = new org.ovirt.engine.core.common.businessentities.VmInitNetwork ( ) ; underTest.setStartOnBoot ( false ) ; vmInit.setNetworks ( java.util.Collections.singletonList ( underTest ) ) ; return new org.ovirt.engine.core.common.utils.Pair ( vmInit , new java.lang.IllegalArgumentException ( "Malformed input" , new java.lang.IllegalArgumentException ( "'Start on boot' must be true" ) ) ) ; }
Source:
public void testValidateGatewayWhenGatewayIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; attachment.getIpConfiguration ( ) . getPrimaryAddress ( ) . setGateway ( null ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . validateGateway ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateGatewayWhenMultipleGatewayIsSupported ( ) throws java.lang.Exception { host.setVdsGroupCompatibilityVersion ( Version.v3_6 ) ; doTestValidateGateway ( "someGateway" , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private boolean confirmDeleteDomain ( java.lang.String domainName ) { java.lang.String response = null ; while ( ( org.apache.commons.lang.StringUtils.isBlank ( response ) ) || ( ( ! ( org.apache.commons.lang.StringUtils.equalsIgnoreCase ( response , "yes" ) ) ) && ( ! ( org.apache.commons.lang.StringUtils.equalsIgnoreCase ( response , "no" ) ) ) ) ) { java.lang.System.out.println ( ( ( "Are you sure you like to delete domain " + domainName ) + " (yes/no) : " ) ) ; response = java.lang.System.console ( ) . readLine ( ) ; } return response.equals ( "yes" ) ; }

Target:
private boolean confirmDeleteDomain ( java.lang.String domainName ) { java.lang.String response = null ; while ( ( org.apache.commons.lang.StringUtils.isBlank ( response ) ) || ( ( ! ( org.apache.commons.lang.StringUtils.equalsIgnoreCase ( response , "yes" ) ) ) && ( ! ( org.apache.commons.lang.StringUtils.equalsIgnoreCase ( response , "no" ) ) ) ) ) { java.lang.System.out.print ( ( ( "Are you sure you like to delete domain " + domainName ) + " (yes/no): " ) ) ; response = java.lang.System.console ( ) . readLine ( ) ; } return response.equals ( "yes" ) ; }
Source:
public 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 getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
protected void ReadOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vmTemplate.setos ( org.ovirt.engine.core.common.businessentities.VmOsType.valueOf ( node.InnerText ) ) ; } else { _vmTemplate.setos ( VmOsType.Unassigned ) ; } }

Target:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vmTemplate.setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vmTemplate.setos ( org.ovirt.engine.core.common.businessentities.VmOsType.valueOf ( node.InnerText ) ) ; } else { _vmTemplate.setos ( VmOsType.Unassigned ) ; } }
Source:
public void updateMaxNumOfVmCpus ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmCpus ( 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 ) ) ; behavior.maxCpus = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.postUpdateNumOfSockets2 ( ) ; } } , getModel ( ) . getHash ( ) ) , version ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = this ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; }
Source:
public void testGetThemeStyleSheet ( ) { org.junit.Assert.assertEquals ( "User portal style sheet: 'user_portal.css'" , "user_portal.css" , testTheme.getThemeStyleSheet ( "userportal" ) ) ; org.junit.Assert.assertEquals ( "Wedadmin style sheet: 'web_admin.css'" , "web_admin.css" , testTheme.getThemeStyleSheet ( "webadmin" ) ) ; }

Target:
public void testGetThemeStyleSheet ( ) { org.junit.Assert.assertEquals ( "User portal style sheet: 'user_portal.css'" , "user_portal.css" , testTheme.getThemeStylesheets ( "userportal" ) . get ( 0 ) ) ; org.junit.Assert.assertEquals ( "User portal style sheet: 'abc.css'" , "abc.css" , testTheme.getThemeStylesheets ( "userportal" ) . get ( 1 ) ) ; org.junit.Assert.assertEquals ( "Wedadmin style sheet: 'web_admin.css'" , "web_admin.css" , testTheme.getThemeStylesheets ( "webadmin" ) . get ( 0 ) ) ; org.junit.Assert.assertEquals ( "Wedadmin style sheet: '123.css'" , "123.css" , testTheme.getThemeStylesheets ( "webadmin" ) . get ( 1 ) ) ; }