auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageIdList = new java.util.ArrayList < > ( ) ; storageIdList.add ( storageDomainId ) ; disk.setStorageIds ( storageIdList ) ; disk.setStoragePoolId ( storagePoolId ) ; return disk ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImage ( ) { disk.setImageId ( diskImageGuid ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageIdList = new java.util.ArrayList < > ( ) ; storageIdList.add ( storageDomainId ) ; disk.setStorageIds ( storageIdList ) ; disk.setStoragePoolId ( storagePoolId ) ; return disk ; }
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.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) : java.lang.Boolean.FALSE ; }
Source:
protected void executeCommand ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveVdsCommand.getVdsIdRef ( ) ) != null ) && ( CanBeRemoved ( org.ovirt.engine.core.bll.RemoveVdsCommand.getVdsId ( ) ) ) ) { org.ovirt.engine.core.compat.Guid vdsGroupId = org.ovirt.engine.core.bll.RemoveVdsCommand.getVds ( ) . getvds_group_id ( ) ; glusterHostRemove ( ) ; RemoveVdsStatisticsFromDb ( ) ; RemoveVdsDynamicFromDb ( ) ; RemoveVdsStaticFromDb ( ) ; RemoveVdsFromCollection ( ) ; org.ovirt.engine.core.bll.RemoveVdsCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveVdsCommand.getVdsIdRef ( ) ) != null ) && ( CanBeRemoved ( org.ovirt.engine.core.bll.RemoveVdsCommand.getVdsId ( ) ) ) ) { glusterHostRemove ( ) ; RemoveVdsStatisticsFromDb ( ) ; RemoveVdsDynamicFromDb ( ) ; RemoveVdsStaticFromDb ( ) ; RemoveVdsFromCollection ( ) ; org.ovirt.engine.core.bll.RemoveVdsCommand.setSucceeded ( true ) ; } }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "FORMAT" ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VolumeFormat.class ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "STATUS" ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ImageStatus.class ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( fieldName , "DISK_TYPE" ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.class ) ; } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "FORMAT" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VolumeFormat.class ) ; } else if ( "STATUS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ImageStatus.class ) ; } else if ( "DISK_TYPE" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.class ) ; } return null ; }
Source:
private void extractRemovedBonds ( ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : getExistingIfaces ( ) . values ( ) ) { java.lang.String bondName = iface.getBondName ( ) ; if ( ( org.apache.commons.lang.StringUtils.isNotBlank ( bondName ) ) && ( ! ( bonds.containsKey ( bondName ) ) ) ) { removedBonds.add ( bondName ) ; } } }

Target:
private void extractRemovedBonds ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : getExistingIfaces ( ) . values ( ) ) { java.lang.String bondName = iface.getBondName ( ) ; if ( ( org.apache.commons.lang.StringUtils.isNotBlank ( bondName ) ) && ( ! ( bonds.containsKey ( bondName ) ) ) ) { removedBonds.add ( bondName ) ; } } }
Source:
public void testExecuteQueryUseVdcVersion ( ) { mcr.mockConfigValue ( ConfigValues.ProductRPMVersion , "1unparsable1.1.12." ) ; mcr.mockConfigValue ( ConfigValues.VdcVersion , "3.3.0.0." ) ; org.ovirt.engine.core.bll.GetProductVersionQuery < org.ovirt.engine.core.common.queries.QueryParametersBase > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.lang.Object returnValue = query.getQueryReturnValue ( ) . getReturnValue ( ) ; verifyVersionEqual ( returnValue , 3 , 3 , 0 ) ; }

Target:
public void testExecuteQueryUseVdcVersion ( ) { org.ovirt.engine.core.bll.GetProductVersionQuery < org.ovirt.engine.core.common.queries.QueryParametersBase > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.lang.Object returnValue = query.getQueryReturnValue ( ) . getReturnValue ( ) ; verifyVersionEqual ( returnValue , 3 , 3 , 0 ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.Cluster group ) { org.ovirt.engine.core.compat.Guid id = group.getId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; group.setId ( id ) ; } getCallsHandler ( ) . executeModification ( "InsertCluster" , getClusterParamSource ( group ) ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { org.ovirt.engine.core.compat.Guid id = cluster.getId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; cluster.setId ( id ) ; } getCallsHandler ( ) . executeModification ( "InsertCluster" , getClusterParamSource ( cluster ) ) ; }
Source:
public void testIncreaseStoragePoolMasterVersion ( ) { int result = dao.increaseStoragePoolMasterVersion ( existingPool.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool dbPool = dao.get ( existingPool.getId ( ) ) ; org.junit.Assert.assertEquals ( result , ( ( existingPool.getmaster_domain_version ( ) ) + 1 ) ) ; org.junit.Assert.assertEquals ( result , dbPool.getmaster_domain_version ( ) ) ; }

Target:
public void testIncreaseStoragePoolMasterVersion ( ) { int result = dao.increaseStoragePoolMasterVersion ( existingPool.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dbPool = dao.get ( existingPool.getId ( ) ) ; org.junit.Assert.assertEquals ( result , ( ( existingPool.getmaster_domain_version ( ) ) + 1 ) ) ; org.junit.Assert.assertEquals ( result , dbPool.getmaster_domain_version ( ) ) ; }
Source:
private void buildDictionaries ( ) { for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { mVerbs.put ( field.fieldName , field.fieldName ) ; } buildCompletions ( ) ; for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { getTypeDictionary ( ) . put ( field.fieldName , field.fieldType ) ; } for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { columnNameDict.put ( field.fieldName , field.columnName ) ; } buildBasicValidationTable ( ) ; }

Target:
private void buildDictionaries ( ) { for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { mVerbs.add ( field.fieldName ) ; } buildCompletions ( ) ; for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { getTypeDictionary ( ) . put ( field.fieldName , field.fieldType ) ; } for ( org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.AutoCompletionField field : org.ovirt.engine.core.searchbackend.gluster.GlusterVolumeConditionFieldAutoCompleter.fields ) { columnNameDict.put ( field.fieldName , field.columnName ) ; } buildBasicValidationTable ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; clusterGuideModel.hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.updateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.hosts = hosts ; clusterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
public void setUp ( ) { setUpQuota ( ) ; params = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( quota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateQuotaCommand ( params ) ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaFromCache ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . afterUpdate ( ) ; }

Target:
public void setUp ( ) { setUpQuota ( ) ; params = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( quota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateQuotaCommand ( params , null ) ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaFromCache ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . afterUpdate ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; this . allNics = allNics ; initNicModels ( ) ; StopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; this . allNics = allNics ; initNicModels ( ) ; StopProgress ( ) ; }
Source:
protected void endWithFailure ( ) { setIsVmRunningStateless ( ) ; rollbackQuota ( ) ; if ( _isVmRunningStateless ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }

Target:
protected void endWithFailure ( ) { setIsVmRunningStateless ( ) ; if ( _isVmRunningStateless ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }
Source:
private void addAddress ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct map , java.lang.String address ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { map.add ( "address" , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugDiskVDSCommand.getParameters ( ) . getVmDevice ( ) . getAddress ( ) ) ) ; } }

Target:
private void addAddress ( java.util.Map < java.lang.String , java.lang.Object > map , java.lang.String address ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { map.put ( "address" , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugDiskVDSCommand.getParameters ( ) . getVmDevice ( ) . getAddress ( ) ) ) ; } }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , vm.getVdsGroupId ( ) . getValue ( ) ) ; initTemplate ( ) ; initCdImage ( ) ; initSoundCard ( vm.getId ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; initCdImage ( ) ; initSoundCard ( vm.getId ( ) ) ; }
Source:
private boolean isDomainExistsInDiskDescription ( java.util.Map < java.lang.String , java.lang.Object > map , org.ovirt.engine.core.compat.Guid storageDomainId ) { if ( ( map.get ( OvfInfoFileConstants.Domains ) ) == null ) { return false ; } return map.get ( OvfInfoFileConstants.Domains ) . toString ( ) . contains ( storageDomainId.toString ( ) ) ; }

Target:
private boolean isDomainExistsInDiskDescription ( java.util.Map < java.lang.String , java.lang.Object > map , org.ovirt.engine.core.compat.Guid storageDomainId ) { return map.get ( OvfInfoFileConstants.Domains ) . toString ( ) . contains ( storageDomainId.toString ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( templates , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; setItems ( templates ) ; setIsEmpty ( ( ( templates.size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = returnValue.getReturnValue ( ) ; java.util.Collections.sort ( templates , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; setItems ( templates ) ; setIsEmpty ( ( ( templates.size ( ) ) == 0 ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > getStorageDomainList ( int availableDiskSizeFirstDomain , int availableDiskSizeSecondDomain ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomainList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; storageDomainList.add ( mockFirstStorageDomain ( availableDiskSizeFirstDomain ) ) ; storageDomainList.add ( mockSecondStorageDomain ( availableDiskSizeSecondDomain ) ) ; return storageDomainList ; }

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

Target:
protected void synchronizeNics ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > nics , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; vmInterfaceManager.removeAll ( vmId ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmInterface : nics ) { if ( ( vmInterface.getId ( ) ) == null ) { vmInterface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } vmInterface.setVmId ( vmId ) ; vmInterfaceManager.add ( vmInterface , compensationContext , false ) ; } }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public void setup ( ) { validator = new org.ovirt.engine.core.bll.validator.FenceValidator ( ) ; validator = org.mockito.Mockito.spy ( validator ) ; org.mockito.Mockito.stub ( validator.getProxyLocator ( org.mockito.Mockito.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) . toReturn ( proxyLocator ) ; org.mockito.Mockito.doReturn ( backend ) . when ( validator ) . getBackend ( ) ; }

Target:
public void setup ( ) { org.mockito.Mockito.doReturn ( proxyLocator ) . when ( validator ) . getProxyLocator ( org.mockito.Mockito.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.mockito.Mockito.doReturn ( backend ) . when ( validator ) . getBackend ( ) ; }
Source:
private java.lang.String getIpTableConfig ( ) { java.lang.String ipTablesConfig = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfig ) ; java.lang.String serviceIPTablesConfig = "" ; if ( supportVirt ) { serviceIPTablesConfig += org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfigForVirt ) ; } if ( supportGluster ) { serviceIPTablesConfig += org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfigForGluster ) ; } ipTablesConfig.replace ( org.ovirt.engine.core.bll.VdsInstaller.IP_TABLE_CUSTOM_RULES_PLACE_HOLDER , serviceIPTablesConfig ) ; return ipTablesConfig ; }

Target:
private java.lang.String getIpTableConfig ( ) { java.lang.String ipTablesConfig = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfig ) ; java.lang.String serviceIPTablesConfig = "" ; if ( supportVirt ) { serviceIPTablesConfig += org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfigForVirt ) ; } if ( supportGluster ) { serviceIPTablesConfig += org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfigForGluster ) ; } ipTablesConfig = ipTablesConfig.replace ( org.ovirt.engine.core.bll.VdsInstaller.IP_TABLE_CUSTOM_RULES_PLACE_HOLDER , serviceIPTablesConfig ) ; return ipTablesConfig ; }
Source:
public static java.util.List < java.lang.String > getValueFromMapRecord ( org.ovirt.engineextensions.aaa.ldap.MapProperties props , java.lang.String key , java.lang.String def ) { java.util.List < java.lang.String > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engineextensions.aaa.ldap.MapProperties entry : props.getMap ( ) . values ( ) ) { java.lang.String v = entry.getString ( null , key ) ; if ( v == null ) { v = def ; } ret.add ( v ) ; } return ret ; }

Target:
public static java.util.List < java.lang.String > getValueFromMapRecord ( org.ovirt.engineextensions.aaa.ldap.MapProperties props , java.lang.String key ) { java.util.List < java.lang.String > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engineextensions.aaa.ldap.MapProperties entry : props.getMap ( ) . values ( ) ) { java.lang.String v = entry.getString ( null , key ) ; if ( v != null ) { ret.add ( v ) ; } } return ret ; }
Source:
public void testRefreshStatusNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( false ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void testRefreshStatusNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( false ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.ArgumentMatchers.any ( ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
public void Template_SelectedItemChanged ( ) { super . Template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; setupWindowModelFrom ( template ) ; updateHostPinning ( template.getMigrationSupport ( ) ) ; doChangeDefautlHost ( template.getdedicated_vm_for_vds ( ) ) ; }

Target:
public void Template_SelectedItemChanged ( ) { super . Template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; if ( template == null ) { return ; } setupWindowModelFrom ( template ) ; updateHostPinning ( template.getMigrationSupport ( ) ) ; doChangeDefautlHost ( template.getdedicated_vm_for_vds ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { boolean returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ; if ( returnValue ) { command.execute ( ) ; } else { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.HasAdElementReconnectPermission , portalUserReconnectPermParams , portalUserReconnectPermissionQuery ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue result ) { boolean returnValue = result.getReturnValue ( ) ; if ( returnValue ) { command.execute ( ) ; } else { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.HasAdElementReconnectPermission , portalUserReconnectPermParams , portalUserReconnectPermissionQuery ) ; } }
Source:
public void validateInvalidDestinationDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setStorageDomainType ( StorageDomainType.ISO ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; }

Target:
public void validateInvalidDestinationDomain ( ) { initStorageDomain ( srcStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStorageDomainType ( StorageDomainType.ISO ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; }
Source:
private java.lang.String getDiskSharedLockMessage ( ) { if ( ( cachedDiskSharedLockMessage ) == null ) { cachedDiskSharedLockMessage = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_USED_FOR_CREATE_VM.name ( ) ) . append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.AddVmCommand.getVmName ( ) ) ) . toString ( ) ; } return cachedDiskSharedLockMessage ; }

Target:
protected java.lang.String getDiskSharedLockMessage ( ) { if ( ( cachedDiskSharedLockMessage ) == null ) { cachedDiskSharedLockMessage = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_USED_FOR_CREATE_VM.name ( ) ) . append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.AddVmCommand.getVmName ( ) ) ) . toString ( ) ; } return cachedDiskSharedLockMessage ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkDao ( ) ; newNet = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; newNet.setName ( "newnet1" ) ; newNet.setVdsmName ( "newnet1" ) ; newNet.setDescription ( "New network" ) ; newNet.setDataCenterId ( FixturesTool.DATA_CENTER ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; newNet = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; newNet.setName ( "newnet1" ) ; newNet.setVdsmName ( "newnet1" ) ; newNet.setDescription ( "New network" ) ; newNet.setDataCenterId ( FixturesTool.DATA_CENTER ) ; }
Source:
public void setUp ( ) { connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; connection.setstorage_type ( StorageType.ISCSI ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator ( connection ) ) ; domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStorageType ( StorageType.ISCSI ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; domain.setStatus ( StorageDomainStatus.Maintenance ) ; domain.setStorageDomainSharedStatus ( StorageDomainSharedStatus.Inactive ) ; }

Target:
public void setUp ( ) { connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; connection.setstorage_type ( StorageType.ISCSI ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator ( connection ) ) ; domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStorageType ( StorageType.ISCSI ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; domain.setStatus ( StorageDomainStatus.Maintenance ) ; domain.setStorageDomainSharedStatus ( StorageDomainSharedStatus.Inactive ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { if ( model.equals ( getViewFilterType ( ) ) ) { this . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { if ( model.equals ( getViewFilterType ( ) ) ) { this . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; } }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
public static void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.compat.Version clusterVersion ) { if ( ( org.ovirt.engine.core.common.FeatureSupported.antiMacSpoofing ( clusterVersion ) ) && ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableMACAntiSpoofingFilterRules ) ) ) { struct.put ( VdsProperties.NW_FILTER , NetworkFilters.NO_MAC_SPOOFING.getFilterName ( ) ) ; } }

Target:
public static void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableMACAntiSpoofingFilterRules ) ) { struct.put ( VdsProperties.NW_FILTER , NetworkFilters.NO_MAC_SPOOFING.getFilterName ( ) ) ; } }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.HibernateVmCommand.getActionState ( ) ) { case EXECUTE : return getHibernateVmParams ( ) . getAutomaticSuspend ( ) ? org.ovirt.engine.core.bll.HibernateVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.AUTO_SUSPEND_VM : org.ovirt.engine.core.common.AuditLogType.AUTO_FAILED_SUSPEND_VM : org.ovirt.engine.core.bll.HibernateVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_SUSPEND_VM ; case END_SUCCESS : case END_FAILURE : default : return getHibernateVmParams ( ) . getAutomaticSuspend ( ) ? org.ovirt.engine.core.common.AuditLogType.AUTO_SUSPEND_VM_FINISH_FAILURE : isHibernateVdsProblematic ? org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM_FINISH_FAILURE_WILL_TRY_AGAIN : org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM_FINISH_FAILURE ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.HibernateVmCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.HibernateVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_SUSPEND_VM ; case END_SUCCESS : case END_FAILURE : default : return isHibernateVdsProblematic ? org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM_FINISH_FAILURE_WILL_TRY_AGAIN : org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM_FINISH_FAILURE ; } }
Source:
private void updateIsSysprepEnabled ( ) { boolean isFloppyAttached = ( ( java.lang.Boolean ) ( getAttachFloppy ( ) . getEntity ( ) ) ) ; boolean isVmFirstRun = ( ( java.lang.Boolean ) ( getIsVmFirstRun ( ) . getEntity ( ) ) ) ; getIsSysprepEnabled ( ) . setEntity ( ( ( getIsWindowsOS ( ) ) && ( getReinitialize ( ) ) ) ) ; }

Target:
private void updateIsSysprepEnabled ( ) { getIsSysprepEnabled ( ) . setEntity ( ( ( getIsWindowsOS ( ) ) && ( getReinitialize ( ) ) ) ) ; }
Source:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v4_0 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Collections.singletonList ( "VirtIO" ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v4_0 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( "VirtIO" ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }
Source:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.VM model , int index ) { assertNotNull ( model.getCluster ( ) . getId ( ) ) ; assertEquals ( GUIDS [ 2 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }

Target:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.VM model , int index ) { assertNotNull ( model.getCluster ( ) . getId ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }
Source:
public void successfullSpmFence ( ) { mockProxyHost ( ) ; mockFenceSuccess ( ) ; org.ovirt.engine.core.common.businessentities.FenceAgent agent = createAgent ( ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result = executor.fence ( FenceActionType.Stop , agent ) ; org.mockito.Mockito.verify ( vdsBrokerFrontend ) . RunVdsCommand ( org.mockito.Mockito.eq ( VDSCommandType.SpmStop ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; org.junit.Assert.assertTrue ( result.getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( result.getFenceAgentUsed ( ) , agent ) ; }

Target:
public void successfullSpmFence ( ) { mockProxyHost ( ) ; mockFenceSuccess ( ) ; org.ovirt.engine.core.common.businessentities.FenceAgent agent = createAgent ( ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result = executor.fence ( FenceActionType.Stop , agent ) ; org.mockito.Mockito.verify ( vdsBrokerFrontend ) . RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.SpmStop ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; org.junit.Assert.assertTrue ( result.getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( result.getFenceAgentUsed ( ) , agent ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getMacPoolId ( ) ) ; return ( ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool ) . macPoolExists ( ) ) ) && ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( getMacPoolEntity ( ) ) . hasUniqueName ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( oldMacPool , getMacPoolEntity ( ) ) ) ) ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getMacPoolId ( ) ) ; return ( ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool ) . macPoolExists ( ) ) ) && ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( getMacPoolEntity ( ) ) . hasUniqueName ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( oldMacPool , getMacPoolEntity ( ) ) ) ) ; }
Source:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.HostStorage > collection ) throws java.lang.Exception { assertNotNull ( collection ) ; assertEquals ( ( ( NAMES.length ) * 2 ) , collection.size ( ) ) ; for ( int i = 0 ; i < ( ( NAMES.length ) * 2 ) ; i ++ ) { verifyModel ( collection.get ( i ) , ( i % ( NAMES.length ) ) ) ; } }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.HostStorage > collection ) throws java.lang.Exception { assertNotNull ( collection ) ; assertEquals ( NAMES.length , collection.size ( ) ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { verifyModel ( collection.get ( i ) , ( i % ( NAMES.length ) ) ) ; } }
Source:
public void testBadGuidValidation ( ) throws java.lang.Exception { setUpGetEntityExpectations ( false , false ) ; org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; host.getCluster ( ) . setId ( "!!!" ) ; control.replay ( ) ; resource.update ( host ) ; }

Target:
public void testBadGuidValidation ( ) throws java.lang.Exception { setUpGetEntityExpectations ( false ) ; org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; host.getCluster ( ) . setId ( "!!!" ) ; control.replay ( ) ; resource.update ( host ) ; }