auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testAllocateMacFromRequestForNonStatelessVmWhenMacDiffersButItsNotAvailable ( ) { nicBeingUpdated.setMacAddress ( org.ovirt.engine.core.bll.network.vm.OLD_MAC ) ; updatingNic.setMacAddress ( org.ovirt.engine.core.bll.network.vm.NEW_MAC ) ; org.mockito.Mockito.when ( macPool.addMac ( updatingNic.getMacAddress ( ) ) ) . thenReturn ( false ) ; underTest.initMacPoolData ( ) ; underTest.allocateMacFromRequest ( ) ; }

Target:
public void testAllocateMacFromRequestForNonStatelessVmWhenMacDiffersButItsNotAvailable ( ) { nicBeingUpdated.setMacAddress ( org.ovirt.engine.core.bll.network.vm.OLD_MAC ) ; updatingNic.setMacAddress ( org.ovirt.engine.core.bll.network.vm.NEW_MAC ) ; org.mockito.Mockito.when ( macPool.addMac ( updatingNic.getMacAddress ( ) ) ) . thenReturn ( false ) ; org.junit.jupiter.api.Assertions.assertThrows ( org.ovirt.engine.core.common.errors.EngineException.class , ( ) -> { org.ovirt.engine.core.bll.network.vm.underTest.initMacPoolData ( ) ; org.ovirt.engine.core.bll.network.vm.underTest.allocateMacFromRequest ( ) ; } ) ; }
Source:
public static void getMaximalVmMemSize64OS ( 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.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
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 ) ; }
Source:
private void removeVmStatelessImages ( ) { if ( ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDao ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) && ( ( getVmPoolType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmPoolType.MANUAL ) ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.info ( "Deleting snapshot for stateless vm '{}'" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }

Target:
private void removeVmStatelessImages ( ) { if ( ( snapshotDao.exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) && ( ( getVmPoolType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmPoolType.MANUAL ) ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.info ( "Deleting snapshot for stateless vm '{}'" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc stopImageTransferSession ( java.lang.String ticketId , java.lang.String spId , java.lang.String sdId , java.lang.String imgId , java.lang.String volId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.stopImageTransferSession ( ticketId , spId , sdId , imgId , volId ) ; 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.vdsbroker.StatusOnlyReturnForXmlRpc extend_image_ticket ( java.lang.String ticketId , long timeout ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.extend_image_ticket ( ticketId , timeout ) ; 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 ) ; } }
Source:
static boolean isPinningAndMigrationValid ( java.util.List < java.lang.String > reasons , org.ovirt.engine.core.common.businessentities.VmStatic vmStaticData , java.lang.String cpuPinning ) { final boolean cpuPinMigrationEnabled = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.CpuPinMigrationEnabled ) ) ; if ( ( ( ! cpuPinMigrationEnabled ) && ( ( vmStaticData.getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( cpuPinning ) ) ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_AND_MIGRATABLE.toString ( ) ) ; return false ; } return true ; }

Target:
static boolean validatePinningAndMigration ( java.util.List < java.lang.String > reasons , org.ovirt.engine.core.common.businessentities.VmStatic vmStaticData , java.lang.String cpuPinning ) { final boolean cpuPinMigrationEnabled = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.CpuPinMigrationEnabled ) ) ; if ( ( ( ! cpuPinMigrationEnabled ) && ( ( vmStaticData.getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( cpuPinning ) ) ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_AND_MIGRATABLE.toString ( ) ) ; return false ; } return true ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ( getrdp ( ) . getDisconnectedEvent ( ) ) != null ) && ( ev.equals ( getrdp ( ) . getDisconnectedEvent ( ) ) ) ) { Rdp_Disconnected ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ( getrdp ( ) . getDisconnectedEvent ( ) ) != null ) && ( ev.equals ( getrdp ( ) . getDisconnectedEvent ( ) ) ) ) { Rdp_Disconnected ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UnlabelNetwork , org.ovirt.engine.core.common.action.UnlabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.networkId } , true , true ) ) ; verifyRemove ( collection.remove ( org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.LABELS [ 0 ] ) ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByNetworkId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.NETWORK_ID } , getEntityList ( ) , failure ) ; control.replay ( ) ; }
Source:
protected boolean validate ( ) { boolean result = true ; if ( ( ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) == null ) || ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) . getOrigin ( ) . equalsIgnoreCase ( AuditLog.OVIRT_ORIGIN ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; result = false ; } if ( ! result ) { addValidationMessage ( EngineMessage.VAR__ACTION__ADD ) ; addValidationMessage ( EngineMessage.VAR__TYPE__EXTERNAL_EVENT ) ; } return result ; }

Target:
protected boolean validate ( ) { if ( ( ( getEvent ( ) ) == null ) || ( AuditLog.OVIRT_ORIGIN.equalsIgnoreCase ( getEvent ( ) . getOrigin ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; } return true ; }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void writeLogEvent ( java.lang.String name , java.lang.String value ) { java.lang.StringBuilder fullNameSB = new java.lang.StringBuilder ( org.ovirt.engine.core.utils.ovf.OvfVmWriter.EXPORT_ONLY_PREFIX ) ; fullNameSB.append ( name ) ; _writer.WriteStartElement ( fullNameSB.toString ( ) ) ; _writer.WriteRaw ( value ) ; _writer.WriteEndElement ( ) ; }

Target:
private void writeLogEvent ( java.lang.String name , java.lang.String value ) { java.lang.StringBuilder fullNameSB = new java.lang.StringBuilder ( org.ovirt.engine.core.utils.ovf.OvfVmWriter.EXPORT_ONLY_PREFIX ) ; fullNameSB.append ( name ) ; _writer.writeStartElement ( fullNameSB.toString ( ) ) ; _writer.writeRaw ( value ) ; _writer.writeEndElement ( ) ; }
Source:
protected boolean migrationInterfaceUp ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( nic ) ) { java.lang.String physicalNic = org.ovirt.engine.core.utils.NetworkUtils.stripVlan ( nic.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : nics ) { if ( iface.getName ( ) . equals ( physicalNic ) ) { return ( iface.getStatistics ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } } } return ( nic.getStatistics ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; }

Target:
protected boolean migrationInterfaceUp ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( nic ) ) { java.lang.String physicalNic = nic.getBaseInterface ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : nics ) { if ( iface.getName ( ) . equals ( physicalNic ) ) { return ( iface.getStatistics ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } } } return ( nic.getStatistics ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.PARAMETER_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; try { resource.update ( getParameter ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.PARAMETER_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; try { resource.update ( getParameter ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void openDocumentation ( T model ) { java.lang.String helpTag = model.getHelpTag ( ) . name ; java.lang.String documentationPath = org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.getPath ( helpTag ) ; java.lang.String documentationLibURL = model.getConfigurator ( ) . getDocumentationLibURL ( ) ; org.ovirt.engine.ui.common.utils.WebUtils.openUrlInNewWindow ( "_blank" , ( documentationLibURL + documentationPath ) ) ; }

Target:
protected void openDocumentation ( T model ) { java.lang.String helpTag = model.getHelpTag ( ) . name ; java.lang.String documentationPath = org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.getPath ( helpTag ) ; java.lang.String documentationLibURL = model.getConfigurator ( ) . getDocumentationLibURL ( ) ; org.ovirt.engine.ui.common.utils.WebUtils.openUrlInNewWindow ( "_blank" , ( documentationLibURL + documentationPath ) , WebUtils.OPTION_SCROLLBARS ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }
Source:
static java.lang.String cpuTuneToString ( final org.ovirt.engine.api.model.CpuTune tune ) { final java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; boolean first = true ; for ( final org.ovirt.engine.api.model.VCpuPin pin : tune.getVcpuPin ( ) ) { if ( first ) { first = false ; } else { builder.append ( "_" ) ; } builder.append ( pin.getVcpu ( ) ) . append ( '#' ) . append ( pin.getCpuSet ( ) ) ; } return builder.toString ( ) ; }

Target:
static java.lang.String cpuTuneToString ( final org.ovirt.engine.api.model.CpuTune tune ) { final java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; boolean first = true ; for ( final org.ovirt.engine.api.model.VCpuPin pin : tune.getVCpuPin ( ) ) { if ( first ) { first = false ; } else { builder.append ( "_" ) ; } builder.append ( pin.getVcpu ( ) ) . append ( '#' ) . append ( pin.getCpuSet ( ) ) ; } return builder.toString ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getDiskImageDynamicDAO ( ) ) ; imageDao = prepareDAO ( dbFacade.getImageDao ( ) ) ; diskDao = prepareDAO ( dbFacade.getBaseDiskDao ( ) ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.DiskImageDynamicDAOTest.EXISTING_IMAGE_ID ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getDiskImageDynamicDao ( ) ) ; imageDao = prepareDAO ( dbFacade.getImageDao ( ) ) ; diskDao = prepareDAO ( dbFacade.getBaseDiskDao ( ) ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.DiskImageDynamicDAOTest.EXISTING_IMAGE_ID ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkIsSet ( ) { return ( network ) == null ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_NOT_EXISTS ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult notIscsiBondNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.IscsiBond > iscsiBonds = getDbFacade ( ) . getIscsiBondDao ( ) . getIscsiBondsByNetworkId ( network.getId ( ) ) ; if ( ! ( iscsiBonds.isEmpty ( ) ) ) { java.util.Collection < java.lang.String > replaceNameables = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "IscsiBonds" , iscsiBonds ) ; replaceNameables.add ( getNetworkNameReplacement ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CANNOT_REMOVE_ISCSI_BOND_NETWORK , replaceNameables ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void fillMacAddressIfMissing ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( iface.getMacAddress ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getavailableMacsCount ( ) ) >= 1 ) ) { iface.setMacAddress ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . allocateNewMac ( ) ) ; } }

Target:
protected void fillMacAddressIfMissing ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( iface.getMacAddress ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getAvailableMacsCount ( ) ) >= 1 ) ) { iface.setMacAddress ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . allocateNewMac ( ) ) ; } }
Source:
protected void addCommands ( ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.QosModel.getCommands ( ) . add ( new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) . setIsDefault ( true ) ) ; org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.QosModel.getCommands ( ) . add ( new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) . setIsCancel ( true ) ) ; }

Target:
protected void addCommands ( ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.QosModel.getCommands ( ) . add ( org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "OnSave" , this ) ) ; org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.QosModel.getCommands ( ) . add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM initializeMock ( final int domainSizeGB , final int sizeRequired ) { mockVmTemplateDAOReturnVmTemplate ( ) ; mockDiskImageDAOGetSnapshotById ( ) ; mockStorageDomainDAOGetForStoragePool ( domainSizeGB ) ; mockStorageDomainDAOGet ( domainSizeGB ) ; mockGetImageDomainsListVdsCommand ( ) ; mockConfig ( ) ; mockConfigSizeRequirements ( sizeRequired ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.AddVmCommandTest.createVm ( ) ; return vm ; }

Target:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > cmd = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( createVdsGroup ( ) ) . when ( cmd ) . getVdsGroup ( ) ; junit.framework.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }
Source:
public static org.ovirt.engine.core.bll.gluster.GlusterSyncJob getInstance ( ) { return org.ovirt.engine.core.bll.gluster.GlusterSyncJob.instance ; }

Target:
public static org.ovirt.engine.core.bll.gluster.GlusterSyncJob getInstance ( ) { if ( ( org.ovirt.engine.core.bll.gluster.GlusterSyncJob.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.gluster.GlusterSyncJob.class ) { if ( ( org.ovirt.engine.core.bll.gluster.GlusterSyncJob.instance ) == null ) { org.ovirt.engine.core.bll.gluster.GlusterSyncJob.instance = new org.ovirt.engine.core.bll.gluster.GlusterSyncJob ( ) ; } } } return org.ovirt.engine.core.bll.gluster.GlusterSyncJob.instance ; }
Source:
public void getVmTemplatesByBaseTemplateId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid baseTemplate ) { asyncQuery.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.VmTemplate > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesByBaseTemplateId , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( baseTemplate ) , asyncQuery ) ; }

Target:
public boolean isGetNamesOfVmsFromExternalProviderSupported ( org.ovirt.engine.core.compat.Version dataCenterVersion ) { return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.GetNamesOfVmsFromExternalProviderSupported , dataCenterVersion.toString ( ) ) ) ) ; }
Source:
private java.lang.String generatePreviewSentence ( ) { java.lang.String outOfSyncPreviewSentence = org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.constants.hostOutOfSyncPreviewSentence ( ) ; outOfSyncPreviewSentence = outOfSyncPreviewSentence.replaceAll ( "Host" , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.templates.strongText ( "Host" ) . asString ( ) ) ; outOfSyncPreviewSentence = outOfSyncPreviewSentence.replaceAll ( "DC" , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.templates.strongText ( "DC" ) . asString ( ) ) ; return outOfSyncPreviewSentence ; }

Target:
private java.lang.String generatePreviewSentence ( ) { com.google.gwt.safehtml.shared.SafeHtml host = org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.templates.strongTextWithColor ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.constants.hostForOutOfSyncSentence ( ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.WHITE_TEXT_COLOR ) ; com.google.gwt.safehtml.shared.SafeHtml dc = org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.templates.strongTextWithColor ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.constants.dcForOutOfSyncSentence ( ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.WHITE_TEXT_COLOR ) ; com.google.gwt.safehtml.shared.SafeHtml outOfSyncPreviewSentence = org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.templates.coloredText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.constants.hostOutOfSyncPreviewSentence ( ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.TEXT_COLOR ) ; return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.templates.hostOutOfSyncPreviewSentence ( host , outOfSyncPreviewSentence , dc ) . asString ( ) ; }
Source:
private void removeRedundantVolumesForOrphanedDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderVolumesToRemove = org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getCinderVolumesToRemove ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderVolume : cinderVolumesToRemove ) { org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getDbFacade ( ) . getImageStorageDomainMapDao ( ) . remove ( cinderVolume.getImageId ( ) ) ; imageDao.remove ( cinderVolume.getImageId ( ) ) ; } }

Target:
private void removeRedundantVolumesForOrphanedDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderVolumesToRemove = org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getCinderVolumesToRemove ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderVolume : cinderVolumesToRemove ) { imageStorageDomainMapDao.remove ( cinderVolume.getImageId ( ) ) ; imageDao.remove ( cinderVolume.getImageId ( ) ) ; } }
Source:
public static void getVmNicList ( 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 < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.RemoveQuotaCommand < org.ovirt.engine.core.common.action.QuotaCRUDParameters > createCommand ( ) { org.ovirt.engine.core.common.action.QuotaCRUDParameters param = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( ) ; param.setQuotaId ( generalGuidQuota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveQuotaCommand < org.ovirt.engine.core.common.action.QuotaCRUDParameters > ( param ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( command ) . getStoragePoolDAO ( ) ; org.mockito.Mockito.doReturn ( quotaDAO ) . when ( command ) . getQuotaDAO ( ) ; return command ; }

Target:
private org.ovirt.engine.core.bll.RemoveQuotaCommand < org.ovirt.engine.core.common.action.QuotaCRUDParameters > createCommand ( ) { org.ovirt.engine.core.common.action.QuotaCRUDParameters param = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( ) ; param.setQuotaId ( generalGuidQuota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveQuotaCommand < org.ovirt.engine.core.common.action.QuotaCRUDParameters > ( param ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( command ) . getStoragePoolDAO ( ) ; org.mockito.Mockito.doReturn ( quotaDAO ) . when ( command ) . getQuotaDAO ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; return command ; }
Source:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void IsHotPlugAvailable ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HotPlugEnabled ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void GetVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }
Source:
public void testAdd ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetVmHostDevicesExpectations ( ) ; setUpActionExpectations ( VdcActionType.AddVmHostDevices , org.ovirt.engine.core.common.action.VmHostDevicesParameters.class , new java.lang.String [ ] { "VmId" , "DeviceNames" } , new java.lang.Object [ ] { VM_ID , java.util.Collections.singletonList ( org.ovirt.engine.api.restapi.resource.DEVICE_NAME ) } , true , true ) ; org.ovirt.engine.api.model.HostDevice device = new org.ovirt.engine.api.model.HostDevice ( ) ; device.setName ( org.ovirt.engine.api.restapi.resource.DEVICE_NAME ) ; resource.add ( device ) ; }

Target:
public void testAdd ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetVmHostDevicesExpectations ( ) ; setUpActionExpectations ( ActionType.AddVmHostDevices , org.ovirt.engine.core.common.action.VmHostDevicesParameters.class , new java.lang.String [ ] { "VmId" , "DeviceNames" } , new java.lang.Object [ ] { VM_ID , java.util.Collections.singletonList ( org.ovirt.engine.api.restapi.resource.DEVICE_NAME ) } , true , true ) ; org.ovirt.engine.api.model.HostDevice device = new org.ovirt.engine.api.model.HostDevice ( ) ; device.setName ( org.ovirt.engine.api.restapi.resource.DEVICE_NAME ) ; resource.add ( device ) ; }
Source:
public void diskImagesAlreadyExistOneExist ( ) { org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isDiskExists ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }

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.assertEquals ( validator.diskImagesNotExist ( ) , ValidationResult.VALID ) ; }
Source:
public static boolean isManagedVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( ! ( org.ovirt.engine.core.bll.VmHandler.isHostedEngine ( vm ) ) ) && ( ! ( org.ovirt.engine.core.bll.VmHandler.isExternalVm ( vm ) ) ) ; }

Target:
public static boolean isDisplayTypeSupported ( int osId , org.ovirt.engine.core.common.businessentities.DisplayType defaultDisplayType , java.util.List < java.lang.String > reasons , org.ovirt.engine.core.compat.Version clusterVersion ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isDisplayTypeSupported ( osId , clusterVersion , defaultDisplayType ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS.name ( ) ) ; } return result ; }
Source:
protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getactual_size ( ) : ( ( long ) ( ( ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( object ) ) . getLun ( ) . getDeviceSize ( ) ) * ( java.lang.Math.pow ( 1024 , 3 ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { disksViewRadioGroup.setDiskStorageType ( ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType ) ( getModel ( ) . getDiskViewType ( ) . getEntity ( ) ) ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > getLogicalUnits ( ) { boolean reportStatus = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostStorageResource.REPORT_STATUS , true , true ) ; return getBackendCollection ( VdcQueryType.GetDeviceList , new org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters ( asGuid ( hostId ) , org.ovirt.engine.core.common.businessentities.storage.StorageType.UNKNOWN , reportStatus , null ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > getLogicalUnits ( ) { boolean reportStatus = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostStorageResource.REPORT_STATUS , true , true ) ; org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters params = new org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters ( asGuid ( hostId ) , org.ovirt.engine.core.common.businessentities.storage.StorageType.UNKNOWN , reportStatus , null , true ) ; return getBackendCollection ( QueryType.GetDeviceList , params ) ; }
Source:
private org.ovirt.engine.api.model.WatchDog getModel ( int i ) { org.ovirt.engine.api.model.WatchDog watchDog = new org.ovirt.engine.api.model.WatchDog ( ) ; watchDog.setAction ( WatchdogAction.RESET.name ( ) . toLowerCase ( ) ) ; watchDog.setModel ( WatchdogModel.I6300ESB.name ( ) . toLowerCase ( ) ) ; watchDog.setId ( org.ovirt.engine.api.restapi.resource.PARENT_ID.toString ( ) ) ; return watchDog ; }

Target:
private org.ovirt.engine.api.model.WatchDog getModel ( int i ) { org.ovirt.engine.api.model.WatchDog watchDog = new org.ovirt.engine.api.model.WatchDog ( ) ; watchDog.setAction ( WatchdogAction.RESET.name ( ) . toLowerCase ( ) ) ; watchDog.setModel ( WatchdogModel.I6300ESB.name ( ) . toLowerCase ( ) ) ; watchDog.setId ( GUIDS [ i ] . toString ( ) ) ; return watchDog ; }
Source:
public void dataCenterDoesntExist ( ) throws java.lang.Exception { org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertEquals ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) , validator.dataCenterExists ( ) ) ; }

Target:
public void dataCenterDoesntExist ( ) throws java.lang.Exception { org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertThat ( validator.dataCenterExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; existingPool.setstatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; vdsGroup = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; newPool.setname ( "newPoolDude" ) ; newPool.setcompatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.0" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; existingPool.setstatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; vdsGroup = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; newPool.setName ( "newPoolDude" ) ; newPool.setcompatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.0" ) ) ; }
Source:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > org.ovirt.engine.core.bll.ValidationResult validateCoherentIdentification ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName , org.ovirt.engine.core.common.errors.EngineMessage message , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { boolean bothIdentificationSet = ( referringId != null ) && ( referringName != null ) ; java.lang.String [ ] replacements = createIncoherentIdentificationErrorReplacements ( violatingEntityId , referringId , referringName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( isNameAndIdIncoherent ( referringId , referringName , map ) ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( java.lang.String.valueOf ( attachment.getId ( ) ) , attachment.getNicId ( ) , attachment.getNicName ( ) , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NICS_INCOHERENTLY , existingInterfacesMap ) ; }
Source:
protected boolean validateSpaceRequirements ( ) { fetchVmDisksFromDb ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskList ( ) ; org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator msdValidator = createMultipleStorageDomainsValidator ( disksList ) ; return ( validate ( msdValidator.allDomainsHaveSpaceForNewDisks ( disksList ) ) ) && ( validate ( msdValidator.allDomainsWithinThresholds ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmPayload getVmPayloadByDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.RunVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK , deviceType.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) { return new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ; } } return null ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network > getEntityList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network > entities = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }

Target:
protected java.util.List < org.ovirt.engine.api.model.Network > getEntityList ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities = new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( profile.isPortMirroring ( ) ) { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.PORT_MIRRORING ) ) { return profile ; } } else { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.CONFIGURE_VM_NETWORK ) ) { return profile ; } } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = org.ovirt.engine.core.bll.ImportVmCommand.getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( profile.isPortMirroring ( ) ) { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.PORT_MIRRORING ) ) { return profile ; } } else { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.CONFIGURE_VM_NETWORK ) ) { return profile ; } } } return null ; }
Source:
private void createUpStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; pool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; }

Target:
private void createUpStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; pool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult passwordProvidedForHostInstallation ( org.ovirt.engine.core.common.action.VdsOperationActionParameters.AuthenticationMethod method , java.lang.String password ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.VDS_CANNOT_INSTALL_EMPTY_PASSWORD ) . when ( ( ( ( ( installHost ) && ( method == ( org.ovirt.engine.core.common.action.VdsOperationActionParameters.AuthenticationMethod.Password ) ) ) && ( org.apache.commons.lang.StringUtils.isEmpty ( password ) ) ) && ( ( getHost ( ) . getVdsType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSType.VDS ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult passwordProvidedForHostInstallation ( org.ovirt.engine.core.common.action.VdsOperationActionParameters.AuthenticationMethod method , java.lang.String password ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_CANNOT_INSTALL_EMPTY_PASSWORD ) . when ( ( ( ( ( installHost ) && ( method == ( org.ovirt.engine.core.common.action.VdsOperationActionParameters.AuthenticationMethod.Password ) ) ) && ( org.apache.commons.lang.StringUtils.isEmpty ( password ) ) ) && ( ( getHost ( ) . getVdsType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSType.VDS ) ) ) ) ; }