auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gwt.safehtml.shared.SafeHtml renderTooltip ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.String value ) { if ( value != null ) { com.google.gwt.safehtml.shared.SafeHtml safeHtmlValue = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( value ) ; if ( ( maxTextLength ) >= 0 ) { com.google.gwt.safehtml.shared.SafeHtml renderedValue = getRenderedValue ( safeHtmlValue ) ; if ( ! ( safeHtmlValue.equals ( renderedValue ) ) ) { return safeHtmlValue ; } } else if ( contentOverflows ( parent.getFirstChildElement ( ) ) ) { return safeHtmlValue ; } } return null ; }

Target:
public java.lang.String renderTooltip ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.String value ) { if ( value != null ) { if ( ( maxTextLength ) >= 0 ) { java.lang.String renderedValue = getRenderedValue ( value ) ; if ( ! ( value.equals ( renderedValue ) ) ) { return value ; } } else if ( contentOverflows ( parent.getFirstChildElement ( ) ) ) { return value ; } } return "" ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeParameterListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddParameterCommand ( ) ) ) { return addParameterPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditParameterCommand ( ) ) ) { return editParameterPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }

Target:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }
Source:
protected < T > org.springframework.jdbc.core.simple.SimpleJdbcCall getCall ( java.lang.String procedureName , org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.CallCreator callCreator , org.springframework.jdbc.core.RowMapper < T > mapper ) { org.springframework.jdbc.core.simple.SimpleJdbcCall call = callsMap.get ( procedureName ) ; if ( call == null ) { call = callCreator.createCall ( ) ; call.compile ( ) ; callsMap.putIfAbsent ( procedureName , call ) ; } else if ( mapper != null ) { call.returningResultSet ( BaseDAODbFacade.RETURN_VALUE_PARAMETER , mapper ) ; } return call ; }

Target:
protected < T > org.springframework.jdbc.core.simple.SimpleJdbcCall getCall ( java.lang.String procedureName , org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.CallCreator callCreator , org.springframework.jdbc.core.RowMapper < T > mapper ) { org.springframework.jdbc.core.simple.SimpleJdbcCall call = callsMap.get ( procedureName ) ; if ( call == null ) { call = callCreator.createCall ( ) ; call.compile ( ) ; callsMap.putIfAbsent ( procedureName , call ) ; } else if ( mapper != null ) { call.returningResultSet ( org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.RETURN_VALUE_PARAMETER , mapper ) ; } return call ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_OPERATION_INPROGRESS ) ) ; } return super . getExclusiveLocks ( ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getClusterId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_OPERATION_INPROGRESS ) ) ; } return super . getExclusiveLocks ( ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic before = dao.get ( existingVm.getId ( ) ) ; before.setVmHost ( "farkle.redhat.com" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.VmDynamic after = dao.get ( existingVm.getId ( ) ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic before = dao.get ( existingVm.getId ( ) ) ; before.setVmHost ( "farkle.redhat.com" ) ; before.setRunOnce ( ( ! ( before.isRunOnce ( ) ) ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.VmDynamic after = dao.get ( existingVm.getId ( ) ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) , true ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }

Target:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmDeviceUtils ( ) . setVmDevices ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) , true ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full endAction" ) ; } }
Source:
public void testGetAllForVolumeGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > result = dao.getAllForVolumeGroup ( existingLUN.getvolume_group_id ( ) ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.LUNs lun : result ) { assertEquals ( existingLUN.getvolume_group_id ( ) , lun.getvolume_group_id ( ) ) ; } }

Target:
public void testGetAllForVolumeGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > result = dao.getAllForVolumeGroup ( existingLUN.getvolume_group_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.LUNs lun : result ) { org.junit.Assert.assertEquals ( existingLUN.getvolume_group_id ( ) , lun.getvolume_group_id ( ) ) ; } }
Source:
public void labelInVfsConfigNotValid ( ) { labelInVfsConfigCommonTest ( false ) ; org.junit.Assert.assertThat ( validator.labelInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_LABEL_NOT_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.LABEL_REPLACEMENT , org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) ) ) ; }

Target:
public void labelInVfsConfigNotValid ( ) { labelInVfsConfigCommonTest ( false ) ; org.junit.Assert.assertThat ( validator.labelInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_LABEL_NOT_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.LABEL_REPLACEMENT , org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) ) ) ; }
Source:
protected boolean removeVmLease ( org.ovirt.engine.core.compat.Guid leaseStorageDomainId , org.ovirt.engine.core.compat.Guid vmId ) { if ( leaseStorageDomainId == null ) { return true ; } return runInternalActionWithTasksContext ( ActionType.RemoveVmLease , new org.ovirt.engine.core.common.action.VmLeaseParameters ( getStoragePoolId ( ) , leaseStorageDomainId , vmId ) ) . getSucceeded ( ) ; }

Target:
protected java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vdsId ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( windowsPath ) ) { return "" ; } if ( windowsPath.matches ( ValidationUtils.GUID ) ) { org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk = diskDao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( windowsPath ) ) ; if ( disk != null ) { return vmInfoBuildUtils.getPathToImage ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ) ; } } return cdPathWindowsToLinux ( windowsPath , getIsoPrefix ( storagePoolId , vdsId ) ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel getImportModel ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importVirtualMachinesTitle ( ) ) ; model.setHelpTag ( HelpTag.import_virtual_machine ) ; model.setHashName ( "import_virtual_machine" ) ; model.setEntity ( getEntity ( ) ) ; return model ; }

Target:
protected void setModelProvider ( com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel > importModelProvider ) { this . importModelProvider = importModelProvider ; }
Source:
private java.lang.String GetValue ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.common.businessentities.VM ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( obj ) ) . getVmName ( ) ; } if ( obj instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { return ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( obj ) ) . getvm_pool_name ( ) ; } throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }

Target:
private java.lang.String GetValue ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.engine.core.common.businessentities.VM ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( obj ) ) . getVmName ( ) ; } if ( obj instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { return ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( obj ) ) . getVmPoolName ( ) ; } throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { hostVersionEditor.setLabel ( constants.hostInstallHostVersionLabel ( ) ) ; isoEditor.setLabel ( constants.hostInstallIsoLabel ( ) ) ; overrideIpTablesEditor.setLabel ( constants.hostInstallOverrideIpTablesLabel ( ) ) ; authLabel.setText ( constants.hostPopupAuthLabel ( ) ) ; userNameEditor.setLabel ( constants.hostPopupUsernameLabel ( ) ) ; publicKeyEditor.setTitle ( constants.publicKeyUsage ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { hostVersionEditor.setLabel ( constants.hostInstallHostVersionLabel ( ) ) ; isoEditor.setLabel ( constants.hostInstallIsoLabel ( ) ) ; overrideIpTablesEditor.setLabel ( constants.hostInstallOverrideIpTablesLabel ( ) ) ; activateHostAfterInstallEditor.setLabel ( constants.activateHostAfterInstallLabel ( ) ) ; authLabel.setText ( constants.hostPopupAuthLabel ( ) ) ; userNameEditor.setLabel ( constants.hostPopupUsernameLabel ( ) ) ; publicKeyEditor.setTitle ( constants.publicKeyUsage ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.extensions.mgr.ExtensionProxy > extensions = getExtensionsManager ( ) . getExtensionsByService ( org.ovirt.engine.api.extensions.aaa.Authz.class . getName ( ) ) ; java.util.List < java.lang.String > names = new java.util.ArrayList ( extensions.size ( ) ) ; for ( org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension : extensions ) { names.add ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) ) ; } java.util.Collections.sort ( names ) ; org.ovirt.engine.core.bll.GetDomainListQuery.getQueryReturnValue ( ) . setReturnValue ( names ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.String , java.lang.Object > response = getDomainList ( ) ; java.util.List < java.lang.String > names = new java.util.ArrayList < > ( ) ; if ( response.containsKey ( "result" ) ) { names.addAll ( ( ( java.util.List < java.lang.String > ) ( response.get ( "result" ) ) ) ) ; } java.util.Collections.sort ( names ) ; org.ovirt.engine.core.bll.GetDomainListQuery.getQueryReturnValue ( ) . setReturnValue ( names ) ; }
Source:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > bricks ) { java.util.List < java.lang.String > lvNames = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.StorageDevice brick : bricks ) { if ( ( ( brick.getMountPoint ( ) ) != null ) && ( ! ( brick.getMountPoint ( ) . isEmpty ( ) ) ) ) { lvNames.add ( brick.getMountPoint ( ) ) ; } } getBricksFromServer ( ) . setItems ( lvNames ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > bricks ) { java.util.List < java.lang.String > lvNames = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.StorageDevice brick : bricks ) { java.lang.String mountPoint = brick.getMountPoint ( ) ; if ( ( mountPoint != null ) && ( ! ( mountPoint.isEmpty ( ) ) ) ) { lvNames.add ( ( mountPoint + ( mountPoint.substring ( mountPoint.lastIndexOf ( "/" ) ) ) ) ) ; } } getBricksFromServer ( ) . setItems ( lvNames ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosValuesTest ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { return qosValuesTest ( createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) , qos ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getName ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_NAME , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getName ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_NAME , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }
Source:
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 > ( ) ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.StartGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters ( getUpServer ( ) . getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . isForceAction ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { updateVolumeStatusInDb ( getParameters ( ) . getVolumeId ( ) ) ; } else { handleVdsError ( AuditLogType.GLUSTER_VOLUME_START_FAILED , returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.StartGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters ( upServer.getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . isForceAction ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { updateVolumeStatusInDb ( getParameters ( ) . getVolumeId ( ) ) ; } else { handleVdsError ( AuditLogType.GLUSTER_VOLUME_START_FAILED , returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }
Source:
private void vdsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void vdsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vdsList ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getCachedIsoListByPoolAndDomainId ( org.ovirt.engine.core.compat.Guid isoStoragePoolId , org.ovirt.engine.core.compat.Guid isoStorageDomainId ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > fileListMD = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; if ( ( isoStorageDomainId != null ) && ( isoStoragePoolId != null ) ) { fileListMD = repoStorageDom.getRepoListForStorageDomainAndStoragePool ( isoStoragePoolId , isoStorageDomainId , FileTypeExtension.ISO ) ; } return fileListMD ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getCachedIsoListByStoragePoolAndDomainId ( org.ovirt.engine.core.compat.Guid isoStoragePoolId , org.ovirt.engine.core.compat.Guid isoStorageDomainId , org.ovirt.engine.core.common.businessentities.FileTypeExtension fileTypeExtension ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > fileListMD = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; if ( ( ( isoStorageDomainId != null ) && ( isoStoragePoolId != null ) ) && ( ( org.ovirt.engine.core.bll.VmRunHandler.getInstance ( ) . findActiveISODomain ( isoStoragePoolId ) ) != null ) ) { fileListMD = repoStorageDom.getRepoListForStorageDomainAndStoragePool ( isoStoragePoolId , isoStorageDomainId , fileTypeExtension ) ; } return fileListMD ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ! ( areRequiredNetworksAvailable ( vds ) ) ) { sb.append ( "is missing networks required by VM nics " ) . append ( org.ovirt.engine.core.common.businessentities.Entities.interfacesByNetworkName ( getVmNICs ( ) ) . keySet ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_NETWORKS ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ! ( areRequiredNetworksAvailable ( vds ) ) ) { sb.append ( "is missing networks required by VM nics " ) . append ( org.ovirt.engine.core.common.businessentities.Entities.interfacesByNetworkName ( getVmNICs ( ) ) . keySet ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_NETWORKS ; } return null ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
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 < org.ovirt.engine.core.compat.RpmVersion > ( ( ( 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.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { getNetworkQoS ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getNetworkQoSDao ( ) . save ( getNetworkQoS ( ) ) ; getReturnValue ( ) . setActionReturnValue ( getNetworkQoS ( ) . getId ( ) ) ; setSucceeded ( true ) ; }

Target:
protected boolean canDoAction ( ) { return ( super . canDoAction ( ) ) && ( validate ( getQosValidator ( getQos ( ) ) . peakConsistentWithAverage ( ) ) ) ; }
Source:
private boolean resizeDiskImageRequested ( ) { return ( ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) && ( ( vmDeviceForVm.getSnapshotId ( ) ) == null ) ) && ( ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ) ; }

Target:
private boolean updateIsUsingScsiReservationRequested ( org.ovirt.engine.core.common.businessentities.storage.LunDisk lunDisk ) { java.lang.Boolean isUsingScsiReservationNewValue = lunDisk.isUsingScsiReservation ( ) ; return ( isUsingScsiReservationNewValue != null ) && ( ( getVmDeviceForVm ( ) . isUsingScsiReservation ( ) ) != isUsingScsiReservationNewValue ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageServerConnectionDAO ( ) ) ; existingConnection = dao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ; newServerConnection = new org.ovirt.engine.core.common.businessentities.storage_server_connections ( ) ; newServerConnection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionDAOTest.EXISTING_DOMAIN_STORAGE_NAME ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageServerConnectionDao ( ) ) ; existingConnection = dao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ; newServerConnection = new org.ovirt.engine.core.common.businessentities.storage_server_connections ( ) ; newServerConnection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionDAOTest.EXISTING_DOMAIN_STORAGE_NAME ) ; }
Source:
public void setUp ( ) { parameters = new org.ovirt.engine.core.common.action.StorageDomainManagementParameter ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getStorageDomain ( ) ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommand ( parameters ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }

Target:
public void setUp ( ) { parameters = new org.ovirt.engine.core.common.action.StorageDomainManagementParameter ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getStorageDomain ( ) ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommand ( parameters ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . addStorageDomainInDb ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . updateStorageDomainDynamicFromIrs ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . saveLUNsInDB ( org.mockito.Matchers.anyList ( ) ) ; }
Source:
private java.lang.String getManagementOptions ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementOptions = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFencingOptions.getDefaultAgentOptions ( _vds.getpm_type ( ) , _vds.getpm_options ( ) ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFencingOptions.getDefaultAgentOptions ( _vds.getPmSecondaryType ( ) , _vds.getPmSecondaryOptions ( ) ) ; } return managementOptions ; }

Target:
private java.lang.String getManagementOptions ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementOptions = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( _vds.getpm_type ( ) , _vds.getpm_options ( ) ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( _vds.getPmSecondaryType ( ) , _vds.getPmSecondaryOptions ( ) ) ; } return managementOptions ; }
Source:
public java.lang.Void runInTransaction ( ) { if ( ! ( numaNodesToRemove.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDao ( ) . massRemoveNumaNodeByNumaNodeId ( numaNodesToRemove ) ; } if ( ! ( numaNodesToUpdate.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDao ( ) . massUpdateNumaNode ( numaNodesToUpdate ) ; } if ( ! ( numaNodesToSave.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDao ( ) . massSaveNumaNode ( numaNodesToSave , vds.getId ( ) , null ) ; } return null ; }

Target:
public void updatePendingData ( int pendingMemory , int pendingCpuCount ) { synchronized ( getLockObj ( ) ) { cachedVds.setPendingVcpusCount ( pendingCpuCount ) ; cachedVds.setPendingVmemSize ( pendingMemory ) ; org.ovirt.engine.core.vdsbroker.monitoring.HostMonitoring.refreshCommitedMemory ( cachedVds , dbFacade.getVmDao ( ) . getAllRunningForVds ( getVdsId ( ) ) ) ; updateDynamicData ( cachedVds.getDynamicData ( ) ) ; } }
Source:
public void testDoGet_ExtraAttributes_WithoutUserInfoObject ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.doReturn ( mockApplicationModeObject ) . when ( testServlet ) . getApplicationModeObject ( org.mockito.Matchers.any ( java.lang.Integer.class ) ) ; org.mockito.Mockito.doReturn ( mockPluginDefinitionsArray ) . when ( testServlet ) . getPluginDefinitionsArray ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData.class ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_APPLICATION_MODE , mockApplicationModeObject ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_PLUGIN_DEFS , mockPluginDefinitionsArray ) ; }

Target:
public void testDoGet_ExtraAttributes_WithoutUserInfoObject ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.doReturn ( mockApplicationModeObject ) . when ( testServlet ) . getApplicationModeObject ( org.mockito.ArgumentMatchers.nullable ( java.lang.Integer.class ) ) ; org.mockito.Mockito.doReturn ( mockPluginDefinitionsArray ) . when ( testServlet ) . getPluginDefinitionsArray ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData.class ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_APPLICATION_MODE , mockApplicationModeObject ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_PLUGIN_DEFS , mockPluginDefinitionsArray ) ; }
Source:
public void testDiskAttachedToVMFail ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToVm ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_ATTACHED_TO_VM ) ) ; }

Target:
public void testDiskAttachedToVMFail ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToVm ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_ATTACHED_TO_VM ) ) ; }
Source:
public void imagesListIsNull ( ) { mockVdsCommand ( VDSCommandType.GetImagesList , unsuccessfulReturnValue ( null ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.never ( ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void imagesListIsNull ( ) { mockVdsCommand ( VDSCommandType.GetImagesList , unsuccessfulReturnValue ( null ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.never ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static 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 < org.ovirt.engine.core.compat.RpmVersion > ( ( ( 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.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( templateExistsInSetup ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > ) ( sender ) ) . getEntity ( ) ) { getCollapseSnapshots ( ) . setEntity ( true ) ; getCollapseSnapshots ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importCloneVMMustCollapseSnapshots ( ) ) ; getCollapseSnapshots ( ) . setIsChangable ( false ) ; } else { getCollapseSnapshots ( ) . setIsChangable ( true ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( templateExistsInSetup ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > ) ( sender ) ) . getEntity ( ) ) { getCollapseSnapshots ( ) . setEntity ( true ) ; getCollapseSnapshots ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . importCloneVMMustCollapseSnapshots ( ) ) ; getCollapseSnapshots ( ) . setIsChangeable ( false ) ; } else { getCollapseSnapshots ( ) . setIsChangeable ( true ) ; } } }
Source:
public void insufficientDiskSpaceWithSnapshots ( ) { final org.ovirt.engine.core.bll.exportimport.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > command = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateImages ( org.mockito.Matchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.mockito.Mockito.when ( command.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ) . 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 ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void insufficientDiskSpaceWithCollapse ( ) { setupDiskSpaceTest ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.mockito.Mockito.when ( cmd.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ) . 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:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( java.lang.Object object ) { java.lang.String problem = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getWarning ( ) ; return problem != null ? com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( problem ) : null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( java.lang.Object object ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) ; java.lang.String problem = ( ( ! ( importVmData.getClone ( ) . getEntity ( ) ) ) && ( ( importVmData.getError ( ) ) != null ) ) ? importVmData.getError ( ) : importVmData.getWarning ( ) ; return problem != null ? com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( problem ) : null ; }
Source:
public void hasLocalDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdc = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; sdc.setStorageType ( StorageType.LOCALFS ) ; org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createDefaultStoragePool ( ) ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sdc ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ERROR_CANNOT_CHANGE_STORAGE_POOL_TYPE_WITH_LOCAL ) ; }

Target:
public void hasLocalDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdc = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; sdc.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StoragePool existingSp = org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createStoragePool ( ) ; existingSp.setIsLocal ( true ) ; org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( existingSp ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sdc ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ERROR_CANNOT_CHANGE_STORAGE_POOL_TYPE_WITH_LOCAL ) ; }
Source:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public static void initCache ( org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( loginModel , 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.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( target ) ; } } ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initUniqueOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initLinuxOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initWindowsOsTypes ( ) ; }

Target:
public static void initCache ( org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( loginModel , 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.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( target ) ; } } ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initUniqueOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initLinuxOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initWindowsOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initHasSpiceSupport ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initNicHotplugSupportMap ( ) ; }
Source:
public void testResolveKnownVariable ( ) { final java.lang.String message = "This is my ${Variable}" ; final java.lang.String expectedResolved = "This is my value" ; java.util.Map < java.lang.String , java.lang.String > values = java.util.Collections.singletonMap ( "variable" , "value" ) ; java.lang.String resolvedMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( message , values ) ; junit.framework.Assert.assertEquals ( expectedResolved , resolvedMessage ) ; }

Target:
public void testResolveKnownVariable ( ) { final java.lang.String message = "This is my ${Variable}" ; final java.lang.String expectedResolved = "This is my value" ; java.util.Map < java.lang.String , java.lang.String > values = java.util.Collections.singletonMap ( "variable" , "value" ) ; java.lang.String resolvedMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( message , values ) ; org.junit.Assert.assertEquals ( expectedResolved , resolvedMessage ) ; }
Source:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }

Target:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }