auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }

Target:
public 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.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.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.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc startSpice ( java.lang.String vdsIp , int port , java.lang.String ticket ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.startSpice ( vdsIp , port , ticket ) ; 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.OneMapReturnForXmlRpc get_image_transfer_session_stats ( java.lang.String ticketId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.get_image_transfer_session_stats ( ticketId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.OneMapReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.OneMapReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testSaveConfig ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration sessionConfig = getGlusterGeoRepSessionConfig ( ) ; dao.saveConfig ( sessionConfig ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > fetchedSessionConfigList = dao.getGeoRepSessionConfig ( FixturesTool.GLUSTER_GEOREP_SESSION_ID ) ; org.junit.Assert.assertEquals ( sessionConfig , fetchedSessionConfigList.get ( 0 ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration fetchedSessionConfig = dao.getGeoRepSessionConfigByKey ( FixturesTool.GLUSTER_GEOREP_SESSION_ID , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDaoTest.GEOREP_CONFIG_CRAWL ) ; org.junit.Assert.assertEquals ( sessionConfig , fetchedSessionConfig ) ; }

Target:
public void testSaveConfig ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration sessionConfig = getGlusterGeoRepSessionConfig ( ) ; dao.saveConfig ( sessionConfig ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > fetchedSessionConfigList = dao.getGeoRepSessionConfig ( FixturesTool.GLUSTER_GEOREP_SESSION_ID ) ; org.junit.jupiter.api.Assertions.assertEquals ( sessionConfig , fetchedSessionConfigList.get ( 0 ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration fetchedSessionConfig = dao.getGeoRepSessionConfigByKey ( FixturesTool.GLUSTER_GEOREP_SESSION_ID , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDaoTest.GEOREP_CONFIG_CRAWL ) ; org.junit.jupiter.api.Assertions.assertEquals ( sessionConfig , fetchedSessionConfig ) ; }
Source:
private org.ovirt.engine.core.common.users.VdcUser getLoggedInUser ( javax.servlet.http.HttpServletRequest request ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = backend.RunQuery ( VdcQueryType.GetUserBySessionId , createQueryParams ( request.getSession ( ) . getId ( ) , filterQueries ( ) ) ) ; if ( returnValue.getSucceeded ( ) ) { return ( ( org.ovirt.engine.core.common.users.VdcUser ) ( returnValue.getReturnValue ( ) ) ) ; } else { return null ; } }

Target:
protected void initQueryParams ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , javax.servlet.http.HttpServletRequest request ) { java.lang.String sessionId = request.getSession ( ) . getId ( ) ; queryParams.setSessionId ( sessionId ) ; queryParams.setHttpSessionId ( sessionId ) ; queryParams.setFiltered ( false ) ; }
Source:
private void setUpGetSoundcardExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetSoundDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; }

Target:
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.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( 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.Cluster > ( ) ; }
Source:
private org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters createParameters ( org.ovirt.engine.core.compat.Guid storageDomainId , java.util.List < org.ovirt.engine.api.model.LogicalUnit > newLuns , boolean force ) { org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters params = new org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters ( ) ; params.setStorageDomainId ( storageDomainId ) ; java.util.ArrayList < java.lang.String > lunIds = newLuns.stream ( ) . map ( LogicalUnit :: getId ) . collect ( java.util.stream.Collectors.toCollection ( java.util.ArrayList :: new ) ) ; params.setLunIds ( lunIds ) ; params.setForce ( force ) ; return params ; }

Target:
private org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters createParameters ( org.ovirt.engine.core.compat.Guid storageDomainId , java.util.List < org.ovirt.engine.api.model.LogicalUnit > newLuns , boolean force ) { org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters params = new org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters ( ) ; params.setStorageDomainId ( storageDomainId ) ; java.util.Set < java.lang.String > lunIds = newLuns.stream ( ) . map ( LogicalUnit :: getId ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; params.setLunIds ( lunIds ) ; params.setForce ( force ) ; return params ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfiguration ( ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; address.setAddress ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IP_ADDRESS ) ; address.setNetmask ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.NETMASK ) ; address.setGateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.GATEWAY ) ; address.setBootProtocol ( NetworkBootProtocol.STATIC_IP ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration result = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; result.setIPv4Addresses ( java.util.Collections.singletonList ( address ) ) ; return result ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IpV6Address createIpv6Address ( ) { org.ovirt.engine.core.common.businessentities.network.IpV6Address address = new org.ovirt.engine.core.common.businessentities.network.IpV6Address ( ) ; address.setAddress ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IPV6_ADDRESS ) ; address.setPrefix ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IPV6_PREFIX ) ; address.setGateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IPV6_GATEWAY ) ; address.setBootProtocol ( Ipv4BootProtocol.STATIC_IP ) ; return address ; }
Source:
public void OnTimer ( ) { try { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "Start deleteAgedOutAuditLogs" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.AuditLogAgingThreshold ) ) * ( - 1 ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . removeAllBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "Finished deleteAgedOutAuditLogs" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.error ( "deleteAgedOutAuditLog failed with exception" , e ) ; } }

Target:
public void onTimer ( ) { try { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "Start deleteAgedOutAuditLogs" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.AuditLogAgingThreshold ) ) * ( - 1 ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . removeAllBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "Finished deleteAgedOutAuditLogs" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.error ( "deleteAgedOutAuditLog failed with exception" , e ) ; } }
Source:
protected < T > T getConfigurationValueDefault ( org.ovirt.engine.core.common.config.ConfigValues config ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ) ; if ( result.getSucceeded ( ) ) { return ( ( T ) ( result.getReturnValue ( ) ) ) ; } return null ; }

Target:
protected < T > T getConfigurationValueDefault ( org.ovirt.engine.core.common.config.ConfigValues config ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( QueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ) ; if ( result.getSucceeded ( ) ) { return ( ( T ) ( result.getReturnValue ( ) ) ) ; } return null ; }
Source:
private void loadVmPayload ( org.ovirt.engine.core.bll.AddVmParameters addVmParams ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmTemplateId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) { addVmParams.setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ) ; return ; } } }

Target:
private void loadVmPayload ( org.ovirt.engine.core.common.action.VmManagementParametersBase addVmParams ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmTemplateId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) { addVmParams.setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ) ; return ; } } }
Source:
public void startPollingTask ( ) { org.ovirt.engine.core.bll.tasks.AsyncTaskState state = getState ( ) ; if ( ( ( state != ( AsyncTaskState.AttemptingEndAction ) ) && ( state != ( AsyncTaskState.Cleared ) ) ) && ( state != ( AsyncTaskState.ClearFailed ) ) ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::startPollingTask: Starting to poll task '{0}'." , getVdsmTaskId ( ) ) ; concreteStartPollingTask ( ) ; } }

Target:
public void startPollingTask ( ) { org.ovirt.engine.core.bll.tasks.AsyncTaskState state = getState ( ) ; if ( ( ( state != ( AsyncTaskState.AttemptingEndAction ) ) && ( state != ( AsyncTaskState.Cleared ) ) ) && ( state != ( AsyncTaskState.ClearFailed ) ) ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.info ( "BaseAsyncTask::startPollingTask: Starting to poll task '{}'." , getVdsmTaskId ( ) ) ; concreteStartPollingTask ( ) ; } }
Source:
protected java.lang.String hostnameOrIpOrEmpty ( ) { return ( ( ( ( '(' + ( ip ( ) ) ) + '|' ) + ( fqdn ( ) ) ) + '|' ) + ')' ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { if ( ( acceptEmptyInput ) && ( ( value == null ) || ( ( value instanceof java.lang.String ) && ( value.equals ( "" ) ) ) ) ) { return new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; } return super . validate ( value ) ; }
Source:
public boolean performNextOperation ( int completedChildCount ) { if ( ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getOvfUpdateStep ( ) ) == ( org.ovirt.engine.core.common.action.ProcessOvfUpdateParameters.OvfUpdateStep.OVF_STORES_CREATION ) ) { setOvfUpdateStep ( OvfUpdateStep.OVF_UPLOAD ) ; updateOvfStoreContent ( ) ; return true ; } return false ; }

Target:
public boolean performNextOperation ( int completedChildCount ) { if ( ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getOvfUpdateStep ( ) ) == ( org.ovirt.engine.core.common.action.ProcessOvfUpdateParameters.OvfUpdateStep.OVF_STORES_CREATION ) ) { setOvfUpdateStep ( OvfUpdateStep.OVF_UPLOAD ) ; if ( ! ( updateOvfStoreContent ( ) ) ) { org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( false ) ; log.error ( "Failed to update OVF_STORE content" ) ; throw new java.lang.RuntimeException ( ) ; } return true ; } return false ; }
Source:
protected void initGeneralSubTabView ( ) { com.google.gwt.user.client.ui.ScrollPanel generalPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > modelProvider = new org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > ( ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel getModel ( ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel ) ( importModel.getDetailModels ( ) . get ( 0 ) ) ) ; } @ java.lang.Override public void onSubTabSelected ( ) { } } ; generalView = new org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportTemplateGeneralSubTabView ( modelProvider , constants ) ; generalPanel.add ( generalView ) ; subTabLayoutPanel.add ( generalPanel , constants.generalImpTempTab ( ) ) ; }

Target:
public void onSubTabDeselected ( ) { }
Source:
public void shouldCreateNiceJsonValidationResult ( ) throws java.io.IOException { invalidVM.setCpuPinning ( "i am pinned" ) ; invalidVM.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; invalidVM.setMigrationSupport ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) ; invalidVM.setId ( Guid.Empty ) ; newHost1.setHostOs ( "invalid os" ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = validator.isUpgradePossible ( java.util.Arrays.asList ( newHost1 ) , java.util.Arrays.asList ( invalidVM ) ) ; org.assertj.core.api.Assertions.assertThat ( validationResult.getVariableReplacements ( ) . get ( 0 ) ) . contains ( "VM_CPUS_PINNED" , "VM_NOT_MIGRATABLE" , "HOST_INVALID_OS" ) ; }

Target:
public void shouldCreateNiceValidationResult ( ) throws java.io.IOException { invalidVM.setCpuPinning ( "i am pinned" ) ; invalidVM.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; invalidVM.setMigrationSupport ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) ; invalidVM.setId ( Guid.Empty ) ; newHost1.setHostOs ( "invalid os" ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = validator.isUpgradePossible ( java.util.Arrays.asList ( newHost1 ) , java.util.Arrays.asList ( invalidVM ) ) ; org.assertj.core.api.Assertions.assertThat ( validationResult.getVariableReplacements ( ) ) . contains ( "CLUSTER_UPGRADE_DETAIL_HOST_INVALID_OS" , "CLUSTER_UPGRADE_DETAIL_VM_CPUS_PINNED" , "CLUSTER_UPGRADE_DETAIL_VM_NOT_MIGRATABLE" ) ; }
Source:
protected boolean isMemorySizeLegal ( org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStaticData = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) ; return org.ovirt.engine.core.bll.VmHandler.isMemorySizeLegal ( vmStaticData.getOs ( ) , vmStaticData.getMemSizeMb ( ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , version.toString ( ) ) ; }

Target:
protected boolean isMemorySizeLegal ( org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStaticData = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) ; return org.ovirt.engine.core.bll.VmHandler.isMemorySizeLegal ( vmStaticData.getOsId ( ) , vmStaticData.getMemSizeMb ( ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , version ) ; }
Source:
public void getClusterFeaturesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForDisksWithSnapshots ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( diskImages ) ; return validOrFirstFailure ( new org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator.ValidatorPredicate ( ) { @ java.lang.Override public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForDisksWithSnapshots ( diskImages ) ; } } ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForDisksWithSnapshots ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( diskImages ) ; return validOrFirstFailure ( ( entry ) -> { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForDisksWithSnapshots ( diskList ) ; } ) ; }
Source:
public void testNotRemovingLabeledNetworksNicHasLabelOldAttachRemovedNewAttachWithSameNetworkAddedToNicValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicWithLabel = createNic ( "nicWithLabel" ) ; nicWithLabel.setLabels ( java.util.Collections.singleton ( "lbl1" ) ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithNameAndLabel ( "net" , "lbl1" ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment = createNetworkAttachment ( network , nicWithLabel ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment addedAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( removedAttachment ) ; addedAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; assertTestNotRemovingLabeledNetworksValid ( nicWithLabel , removedAttachment , new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( addedAttachment ) . build ( ) , network ) ; }

Target:
public void testValidModifiedBondsWhenAllOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.CreateOrUpdateBond createOrUpdateBond = createNewCreateOrUpdateBond ( null , "bond1" , "slaveA" , "slaveB" ) ; doTestValidModifiedBonds ( createOrUpdateBond , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID ) ; }
Source:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { initCommand ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }

Target:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { initCommand ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }
Source:
public void networkInVfsConfigNotValid ( ) { networkInVfsConfigCommonTest ( false ) ; org.junit.Assert.assertThat ( validator.networkInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_NOT_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) ) ; }

Target:
public void networkInVfsConfigNotValid ( ) { networkInVfsConfigCommonTest ( false ) ; org.hamcrest.MatcherAssert.assertThat ( validator.networkInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_NOT_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) ) ; }
Source:
public java.lang.String getMessage ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { return getVerb ( op1 ) ; }

Target:
public boolean isDisplayNetworkAffected ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { if ( ( op1 != null ) && ( op1 instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel ) ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel network : ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel ) ( op1 ) ) . getNetworks ( ) ) { if ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.ATTACH_NETWORK.isDisplayNetworkAffected ( network , null ) ) { return true ; } } } return false ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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 ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
private void addStatistics ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity , javax.ws.rs.core.UriInfo ui ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.utils.LinkHelper.addLinks ( ui , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }

Target:
private void addStatistics ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity , javax.ws.rs.core.UriInfo ui ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( ui , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }
Source:
private java.lang.String readPasswordInteractively ( ) { java.lang.String password = null ; while ( org.apache.commons.lang.StringUtils.isBlank ( password ) ) { java.lang.System.out.print ( "Enter password:" ) ; password = new java.lang.String ( java.lang.System.console ( ) . readPassword ( ) ) ; } return password ; }

Target:
private java.lang.String readInteractively ( java.lang.String prompt , boolean isPassword ) { java.lang.String value = null ; while ( org.apache.commons.lang.StringUtils.isBlank ( value ) ) { if ( isPassword ) { value = new java.lang.String ( java.lang.System.console ( ) . readPassword ( prompt ) ) ; } else { value = java.lang.System.console ( ) . readLine ( prompt ) ; } } return value ; }
Source:
private void localize ( ) { serverEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.ReplaceBrickPopupView.constants.serverBricks ( ) ) ; brickDirEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.ReplaceBrickPopupView.constants.brickDirectoryBricks ( ) ) ; }

Target:
private void localize ( ) { serverEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.ReplaceBrickPopupView.constants.serverBricks ( ) ) ; brickDirEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.ReplaceBrickPopupView.constants.brickDirectoryBricks ( ) ) ; bricksFromServerList.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.ReplaceBrickPopupView.constants.brickDirectoryBricks ( ) ) ; showBricksListEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.ReplaceBrickPopupView.constants.addBricksShowBricksFromHost ( ) ) ; }
Source:
protected void setBallooning ( org.ovirt.engine.api.model.VM vm ) { java.lang.Boolean balloonEnabled = getEntity ( java.lang.Boolean.class , VdcQueryType.IsBalloonEnabled , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( new org.ovirt.engine.core.compat.Guid ( vm.getId ( ) ) ) , null , true ) ; if ( ! ( vm.isSetMemoryPolicy ( ) ) ) { vm.setMemoryPolicy ( new org.ovirt.engine.api.model.MemoryPolicy ( ) ) ; } vm.getMemoryPolicy ( ) . setBallooning ( balloonEnabled ) ; }

Target:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { return model ; }
Source:
public static void GetCustomPropertiesList ( 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.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void GetSANWipeAfterDelete ( 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 ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , java.lang.Object taskReturn , java.lang.String baseUri , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , null , null , null , baseUri , replay ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , boolean reply ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , reply , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaVdsConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaVdsGroupConsumptionParameter ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupId ( ) , ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getCpuPerSocket ( ) ) * ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getNumOfSockets ( ) ) ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getMemSizeMb ( ) ) ) ; return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaVdsConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaClusterConsumptionParameter ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getClusterId ( ) , ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getCpuPerSocket ( ) ) * ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getNumOfSockets ( ) ) ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getMemSizeMb ( ) ) ) ; return list ; }
Source:
public void canDoActionSuccess ( ) { initializeCommand ( ) ; mockVmStatusUp ( ) ; cretaeVirtIODisk ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }

Target:
public void initializeCommand ( ) { command = org.mockito.Mockito.spy ( createCommand ( ) ) ; mockVds ( ) ; org.mockito.Mockito.when ( command.getActionType ( ) ) . thenReturn ( getCommandActionType ( ) ) ; org.mockito.Mockito.doReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAO.class ) ) . when ( command ) . getVmNetworkInterfaceDAO ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getBehavior ( ) . deactivateInstanceTypeManager ( ) ; updateWatchdogItems ( ( ( java.util.HashSet < org.ovirt.engine.core.common.businessentities.VmWatchdogType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; getBehavior ( ) . activateInstanceTypeManager ( ) ; }

Target:
public void onSuccess ( java.lang.String currentOsDefaultIcon ) { java.lang.String iconToShow = getIconToShow ( currentOsDefaultIcon ) ; org.ovirt.engine.core.compat.Guid smallIconId = getSmallIconId ( iconToShow , oldIcon , currentOsDefaultIcon , osDefaultIconId ) ; org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault newIconPair = new org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault ( iconToShow , currentOsDefaultIcon , smallIconId ) ; getIcon ( ) . setEntity ( newIconPair ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeWithRebalanceTask ) ) ; prepareMocks ( cmd ) ; mockBackend ( false , VdcBllErrors.GlusterVolumeRebalanceStopFailed ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . endStepJob ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . clearVolumeTaskAndReleaseLock ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeWithRebalanceTask ) ) ; prepareMocks ( cmd ) ; mockBackend ( false , VdcBllErrors.GlusterVolumeRebalanceStopFailed ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . endStepJob ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED ) ; }
Source:
public boolean validateArchitectures ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsToImport = getVmsToImport ( ) ; final org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenters ( ) . getSelectedItem ( ) ; if ( ( vmsToImport.isEmpty ( ) ) || ( dataCenter == null ) ) { return false ; } return ( validateSameArchitecture ( vmsToImport ) ) && ( validateClusterExistsForArchitecture ( vmsToImport.get ( 0 ) . getClusterArch ( ) , dataCenter ) ) ; }

Target:
public boolean vmsToImportHaveFullInfo ( ) { switch ( importSources.getSelectedItem ( ) ) { case VMWARE : case KVM : case XEN : if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isGetNamesOfVmsFromExternalProviderSupported ( getDataCenters ( ) . getSelectedItem ( ) . getCompatibilityVersion ( ) ) ) { return false ; } break ; default : } return true ; }
Source:
public void canDoActionDiskIsOvfStore ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; command.getImage ( ) . setContentType ( DiskContentType.OVF_STORE ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED ) ; }

Target:
public void canDoActionTemplateImageIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED.toString ( ) ) ) ; }
Source:
public void testSaveAndGet ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = dao.get ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ; org.junit.Assert.assertNull ( service ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService newService = insertTestService ( ) ; service = dao.get ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( newService , service ) ; }

Target:
public void testSaveAndGet ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = dao.get ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ; org.junit.jupiter.api.Assertions.assertNull ( service ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService newService = insertTestService ( ) ; service = dao.get ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( service ) ; org.junit.jupiter.api.Assertions.assertEquals ( newService , service ) ; }
Source:
private static java.lang.String generateWhere ( org.ovirt.engine.api.extensions.ExtMap input ) { java.lang.String cond ; if ( ( input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserIdentifiers.USER_ID ) ) != null ) { cond = org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "id = {}" , input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserIdentifiers.USER_ID ) ) ; } else if ( ( input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserIdentifiers.USERNAME ) ) != null ) { cond = org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "name = '{}'" , input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserIdentifiers.USERNAME , java.lang.String.class ) ) ; } else { throw new java.lang.RuntimeException ( "No user Identifier provided" ) ; } return cond ; }

Target:
private static java.lang.String generateWhere ( org.ovirt.engine.api.extensions.ExtMap input ) { java.lang.String cond ; if ( ( input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserIdentifiers.USER_ID ) ) != null ) { cond = org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "id = {}" , input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserIdentifiers.USER_ID ) ) ; } else if ( ( input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserIdentifiers.USERNAME ) ) != null ) { cond = org.ovirt.engine.extension.aaa.jdbc.Formatter.format ( "name = {}" , org.ovirt.engine.extension.aaa.jdbc.Formatter.escapeString ( input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserIdentifiers.USERNAME , java.lang.String.class ) ) ) ; } else { throw new java.lang.RuntimeException ( "No user Identifier provided" ) ; } return cond ; }
Source:
protected void setUpGetNoPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , null ) ; } }

Target:
protected void setUpGetNoPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( QueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , null ) ; } }
Source:
public void validateFailureOnMovingLunDisk ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.LunDisk ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE ) ; }

Target:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }