auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean isSearchUsingTags ( ) { return ( ( ( origText.contains ( "tag" ) ) || ( ( ( getSearchObjectStr ( ) ) != null ) && ( getSearchObjectStr ( ) . equals ( SearchObjects.VDC_USER_OBJ_NAME ) ) ) ) || ( getCrossRefObjList ( ) . contains ( SearchObjects.VDC_STORAGE_POOL_OBJ_NAME ) ) ) || ( getCrossRefObjList ( ) . contains ( SearchObjects.VDC_STORAGE_DOMAIN_OBJ_NAME ) ) ; }

Target:
private boolean isUserSearchUsingTags ( ) { return ( SearchObjects.VDC_USER_OBJ_NAME.equals ( getSearchObjectStr ( ) ) ) && ( origText.contains ( "vm" ) ) ; }
Source:
public void checkNetworkLabelFormat ( ) { java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.utils.NetworkLabelFormatValidatorTest.NetworkLabelContainer > > validate = validator.validate ( new org.ovirt.engine.core.common.utils.NetworkLabelFormatValidatorTest.NetworkLabelContainer ( labels ) ) ; org.junit.Assert.assertEquals ( expectedResult , validate.isEmpty ( ) ) ; }

Target:
public void checkNetworkLabelFormat ( ) { org.ovirt.engine.core.common.utils.NetworkLabelFormatValidatorTest.NetworkLabelContainer labelContainer = new org.ovirt.engine.core.common.utils.NetworkLabelFormatValidatorTest.NetworkLabelContainer ( labels ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.utils.NetworkLabelFormatValidatorTest.NetworkLabelContainer > > validate = validator.validate ( labelContainer ) ; org.junit.Assert.assertEquals ( ( "Failed to validate " + ( labelContainer.getLabels ( ) ) ) , expectedResult , validate.isEmpty ( ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.core.common.businessentities.UserProfile entity = getEntity ( org.ovirt.engine.core.common.businessentities.UserProfile.class , VdcQueryType.GetUserProfile , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , userId.toString ( ) , true ) ; entity.setSshPublicKeyId ( Guid.Empty ) ; entity.setSshPublicKey ( "" ) ; org.ovirt.engine.core.common.action.UserProfileParameters parameters = new org.ovirt.engine.core.common.action.UserProfileParameters ( ) ; parameters.setUserProfile ( entity ) ; return performAction ( ActionType.UpdateUserProfile , parameters ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.core.common.businessentities.UserProfile entity = getEntity ( org.ovirt.engine.core.common.businessentities.UserProfile.class , QueryType.GetUserProfile , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , userId.toString ( ) , true ) ; entity.setSshPublicKeyId ( Guid.Empty ) ; entity.setSshPublicKey ( "" ) ; org.ovirt.engine.core.common.action.UserProfileParameters parameters = new org.ovirt.engine.core.common.action.UserProfileParameters ( ) ; parameters.setUserProfile ( entity ) ; return performAction ( ActionType.UpdateUserProfile , parameters ) ; }
Source:
public void testExecuteQuery ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . isWindowsOS ( ) ) . thenReturn ( true ) ; getQuery ( ) . executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.lang.String > result = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; assertEquals ( "Wrong number of time zones" , SysprepHandler.timeZoneIndex.size ( ) , result.size ( ) ) ; }

Target:
public void testExecuteQuery ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . isWindowsOS ( ) ) . thenReturn ( true ) ; getQuery ( ) . executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.lang.String > result = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( "Wrong number of time zones" , SysprepHandler.timeZoneIndex.size ( ) , result.size ( ) ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckFailsSize ( ) { final int availableSize = 3 ; final int usedSize = 7 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
private static org.ovirt.engine.core.bll.validator.StorageDomainValidator mockStorageDomainValidatorWithSpace ( ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidator ( ) ; org.mockito.Mockito.when ( storageDomainValidator.hasSpaceForNewDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.DiskImage.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; return storageDomainValidator ; }
Source:
public void testEmptyDisksUsages ( ) { java.lang.Object [ ] disksUsages = new java.lang.Object [ 0 ] ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksUsage ( disksUsages ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.validateDisksUsagesList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVmStatistics ( ) , disksUsages , xml ) ; }

Target:
public void testDisksUsagesWithEmptyEntry ( ) { java.lang.Object [ ] disksUsages = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.initDisksUsageData ( ) ; disksUsages [ 1 ] = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksUsage ( disksUsages ) ; validateDisksUsagesList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVmStatistics ( ) , disksUsages , xml ) ; }
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.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 ) ; }

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:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { boolean bothIdentificationSet = ( nicId != null ) && ( nicName != null ) ; java.lang.String [ ] replacements = createIncoherentNicIdentificationErrorReplacements ( violatingEntityId , nicId , nicName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( nicNameAndNicIdIsIncoherent ( nicId , nicName ) ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; boolean bothIdentificationSet = ( networkId != null ) && ( networkName != null ) ; java.lang.String [ ] replacements = createIncoherentNetworkIdentificationErrorReplacements ( attachment.getId ( ) , networkId , networkName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , replacements ) . when ( ( bothIdentificationSet && ( networkNameAndNetworkIdIsIncoherent ( networkId , networkName ) ) ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getDataCenterId ( org.ovirt.engine.api.model.Network network ) { java.lang.String networkName = network.getDataCenter ( ) . getName ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getEntity ( org.ovirt.engine.core.common.businessentities.StoragePool.class , VdcQueryType.GetStoragePoolByDatacenterName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( networkName ) , networkName , true ) ; return dataCenter.getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getDataCenterId ( org.ovirt.engine.api.model.Network network ) { java.lang.String networkName = network.getDataCenter ( ) . getName ( ) ; return getEntity ( org.ovirt.engine.core.common.businessentities.StoragePool.class , VdcQueryType.GetStoragePoolByDatacenterName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( networkName ) , ( "Datacenter: name=" + networkName ) ) . getId ( ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addNetworkInterfaceDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , boolean plugged ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , VmDeviceGeneralType.INTERFACE , VmDeviceType.BRIDGE , java.util.Collections.< java.lang.String , java.lang.Object > emptyMap ( ) , plugged , false , null ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addNetworkInterfaceDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , boolean plugged , boolean hostDev ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , VmDeviceGeneralType.INTERFACE , ( hostDev ? org.ovirt.engine.core.common.utils.VmDeviceType.HOST_DEVICE : org.ovirt.engine.core.common.utils.VmDeviceType.BRIDGE ) , java.util.Collections.< java.lang.String , java.lang.Object > emptyMap ( ) , plugged , false , null ) ; }
Source:
protected boolean validateSpaceRequirements ( ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = createStorageDomainValidator ( ) ; if ( validate ( storageDomainValidator.isDomainWithinThresholds ( ) ) ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getSnapshots ( ) . addAll ( getAllImageSnapshots ( ) ) ; return validate ( storageDomainValidator.hasSpaceForClonedDisk ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) ) ; } return false ; }

Target:
protected boolean validateSpaceRequirements ( ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = createStorageDomainValidator ( ) ; if ( validate ( storageDomainValidator.isDomainWithinThresholds ( ) ) ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getSnapshots ( ) . addAll ( getAllImageSnapshots ( ) ) ; return validate ( storageDomainValidator.hasSpaceForDiskWithSnapshots ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) ) ; } return false ; }
Source:
public void validateBadUUIDSFiltered ( ) { java.util.Map < java.lang.String , java.lang.Object > innerMap = java.util.Collections.singletonMap ( org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturnTest.IMAGES_LIST , new java.lang.Object [ ] { "28e983b9-c2f6-4a50-a5d5-7a38089797c7" , "c3d75234-b360-4aed-8d78-413d7488bd9b" , "_remove_me_2f17489c-285e-496d-bd86-0d63d1be2efe" } ) ; org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturn imagesListReturn = new org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturn ( innerMap ) ; java.lang.String [ ] expectedUUIDList = new java.lang.String [ ] { "28e983b9-c2f6-4a50-a5d5-7a38089797c7" , "c3d75234-b360-4aed-8d78-413d7488bd9b" } ; org.junit.Assert.assertArrayEquals ( expectedUUIDList , imagesListReturn.getImageList ( ) ) ; }

Target:
public void validateBadUUIDSFiltered ( ) { java.util.Map < java.lang.String , java.lang.Object > innerMap = java.util.Collections.singletonMap ( org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturnTest.IMAGES_LIST , new java.lang.Object [ ] { "28e983b9-c2f6-4a50-a5d5-7a38089797c7" , "c3d75234-b360-4aed-8d78-413d7488bd9b" , "_remove_me_2f17489c-285e-496d-bd86-0d63d1be2efe" } ) ; org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturn imagesListReturn = new org.ovirt.engine.core.vdsbroker.irsbroker.ImagesListReturn ( innerMap ) ; java.lang.String [ ] expectedUUIDList = new java.lang.String [ ] { "28e983b9-c2f6-4a50-a5d5-7a38089797c7" , "c3d75234-b360-4aed-8d78-413d7488bd9b" } ; org.junit.jupiter.api.Assertions.assertArrayEquals ( expectedUUIDList , imagesListReturn.getImageList ( ) ) ; }
Source:
private static void addUsbSlots ( org.ovirt.engine.core.common.businessentities.VmBase vm , int numOfSlots ) { for ( int index = 1 ; index <= numOfSlots ; index ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vm.getId ( ) ) , VmDeviceType.REDIR , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getUsbSlotSpecParams ( ) , true , false ) ; } }

Target:
private static void addUsbSlots ( org.ovirt.engine.core.common.businessentities.VmBase vm , int numOfSlots ) { for ( int index = 1 ; index <= numOfSlots ; index ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.CHANNEL , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getUsbSlotSpecParams ( ) , true , false ) ; } }
Source:
private void initMinimalVmMemSize ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMinimalVmMemSize ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MinMemSize ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; } } , getHash ( ) ) ) ; }

Target:
public void setIsAdvancedModeLocalStorageKey ( java.lang.String isAdvancedModeLocalStorageKey ) { this . isAdvancedModeLocalStorageKey = isAdvancedModeLocalStorageKey ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStorageDomain ( org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getParameters ( ) . getStorageDomainId ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > temp = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( result ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : temp ) { if ( ( domain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) { result.remove ( domain ) ; } } org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStorageDomain ( org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getParameters ( ) . getStorageDomainId ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > temp = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( result ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : temp ) { if ( ( domain.getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) { result.remove ( domain ) ; } } org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
private void optimizationCustomFormatter ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel object ) { if ( ( ( object.getOptimizationCustom ( ) ) != null ) && ( ( object.getOptimizationCustom ( ) . getEntity ( ) ) != null ) ) { optimizationCustomEditor.setLabel ( messages.clusterPopupMemoryOptimizationCustomLabel ( java.lang.String.valueOf ( object.getMemoryOverCommit ( ) ) ) ) ; } }

Target:
private void optimizationCustomFormatter ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel object ) { if ( ( ( object.getOptimizationCustom ( ) ) != null ) && ( ( object.getOptimizationCustom ( ) . getEntity ( ) ) != null ) ) { optimizationCustomEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.cluster.ClusterPopupView.messages.clusterPopupMemoryOptimizationCustomLabel ( java.lang.String.valueOf ( object.getMemoryOverCommit ( ) ) ) ) ; } }
Source:
protected void setActionMessageParameters ( ) { addCanDoActionMessage ( EngineMessage.VAR__ACTION__ADD ) ; addCanDoActionMessage ( EngineMessage.VAR__TYPE__USER_PROFILE ) ; }

Target:
protected void setActionMessageParameters ( ) { org.ovirt.engine.core.common.businessentities.UserProfile existingProfile = org.ovirt.engine.core.bll.AddUserProfileCommand.getUserProfile ( ) ; if ( ( existingProfile != null ) && ( isSSHPublicKeyUpdate ( existingProfile ) ) ) { addValidationMessage ( EngineMessage.VAR__ACTION__UPDATE ) ; } else { addValidationMessage ( EngineMessage.VAR__ACTION__ADD ) ; } addValidationMessage ( EngineMessage.VAR__TYPE__USER_PROFILE ) ; }
Source:
public static void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void wakeup ( ) { this . auditLogDirector = _auditLogDirector ; this . vdsDao = _vdsDao ; this . vdsGroupDao = _vdsGroupDao ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.scheduling.arem.AffinityRulesEnforcementPerCluster ( ) { @ java.lang.Override public void wakeup ( ) { this . affinityGroupDao = _affinityGroupDao ; this . vmDao = _vmDao ; this . vdsDao = _vdsDao ; this . vdsGroupDao = _vdsGroupDao ; super . wakeup ( ) ; } } ) . when ( _perClusterProvider ) . get ( ) ; this . perClusterProvider = _perClusterProvider ; super . wakeup ( ) ; addInjectionsToPerClusterObjects ( ) ; }

Target:
public void wakeup ( ) { this . auditLogDirector = _auditLogDirector ; this . vdsDao = _vdsDao ; this . vdsGroupDao = _vdsGroupDao ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.scheduling.AffinityRulesEnforcementManagerTest.TestingAffinityRulesEnforcementPerCluster ( ) ) . when ( _perClusterProvider ) . get ( ) ; this . perClusterProvider = _perClusterProvider ; super . wakeup ( ) ; addInjectionsToPerClusterObjects ( ) ; }
Source:
private void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; initSorting ( ) ; getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminButtonDefinition < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > > ( constants.removeInterface ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getDetailModel ( ) . getRemoveCommand ( ) ; } } ) ; }

Target:
private void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; initSorting ( ) ; getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminButtonDefinition < 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.ui.webadmin.section.main.view.tab.network.SubTabNetworkVmView.constants.removeInterface ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getDetailModel ( ) . getRemoveCommand ( ) ; } } ) ; }
Source:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getUserMessageOfTheDayViaPublic ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , networkAttachmentId.toString ( ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.MODIFIED_NETWORK_ATTACHMENT_DOES_NOT_EXISTS ; java.lang.String replacement = org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , networkAttachmentId.toString ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , replacement ) ; }
Source:
private void setBondOptions ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity , org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel bondDialogModel ) { org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > BondPair = ( ( org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > ) ( bondDialogModel.getBondingOptions ( ) . getSelectedItem ( ) ) ) ; java.lang.String key = BondPair.getKey ( ) ; entity.setBondOptions ( ( ( java.lang.String ) ( "custom" . equals ( key ) ? BondPair.getValue ( ) . getEntity ( ) : key ) ) ) ; }

Target:
private void setBondOptions ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity , org.ovirt.engine.ui.uicommonweb.models.hosts.SetupNetworksBondModel bondDialogModel ) { org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > BondPair = ( ( org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > ) ( bondDialogModel.getBondingOptions ( ) . getSelectedItem ( ) ) ) ; java.lang.String key = BondPair.getKey ( ) ; entity.setBondOptions ( ( ( java.lang.String ) ( "custom" . equals ( key ) ? BondPair.getValue ( ) . getEntity ( ) : key ) ) ) ; }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
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 getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private java.util.List < java.lang.String > getSecurityGroups ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile ) { java.util.Map < java.lang.String , java.lang.String > customProperties = vnicProfile.getCustomProperties ( ) ; if ( customProperties.containsKey ( org.ovirt.engine.core.bll.provider.network.openstack.OpenstackNetworkProviderProxy.SECURITY_GROUPS_PROPERTY ) ) { return java.util.Arrays.asList ( customProperties.get ( org.ovirt.engine.core.bll.provider.network.openstack.OpenstackNetworkProviderProxy.SECURITY_GROUPS_PROPERTY ) . split ( ",\\w*" ) ) ; } return java.util.Collections.emptyList ( ) ; }

Target:
private java.util.List < java.lang.String > getSecurityGroups ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile ) { java.util.Map < java.lang.String , java.lang.String > customProperties = vnicProfile.getCustomProperties ( ) ; if ( customProperties.containsKey ( org.ovirt.engine.core.bll.provider.network.openstack.OpenstackNetworkProviderProxy.SECURITY_GROUPS_PROPERTY ) ) { java.lang.String securityGroupsString = customProperties.get ( org.ovirt.engine.core.bll.provider.network.openstack.OpenstackNetworkProviderProxy.SECURITY_GROUPS_PROPERTY ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( securityGroupsString ) ) { return org.ovirt.engine.core.bll.provider.network.openstack.OpenstackNetworkProviderProxy.NO_SECURITY_GROUPS ; } return java.util.Arrays.asList ( securityGroupsString.split ( ",\\w*" ) ) ; } return org.ovirt.engine.core.bll.provider.network.openstack.OpenstackNetworkProviderProxy.DEFAULT_SECURITY_GROUP ; }
Source:
public static void GetExternalNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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.network.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }

Target:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
public void hostNInUse ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }

Target:
public void hostNInUse ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }
Source:
public void checkEmptyIdHost ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void checkEmptyIdHost ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Vm model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Vm model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; verifyLinks ( model ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > list = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > newList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : list ) { if ( ! ( permission.getRoleId ( ) . equals ( ApplicationGuids.quotaConsumer.asGuid ( ) ) ) ) { newList.add ( permission ) ; } } setItems ( newList ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > list = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > newList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : list ) { if ( ! ( permission.getRoleId ( ) . equals ( ApplicationGuids.quotaConsumer.asGuid ( ) ) ) ) { newList.add ( permission ) ; } } setItems ( newList ) ; }
Source:
public void freeMac ( java.lang.String mac ) { lockObj.writeLock ( ) . lock ( ) ; try { checkIfInitialized ( ) ; macsStorage.freeMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; } finally { lockObj.writeLock ( ) . unlock ( ) ; } }

Target:
public void freeMac ( java.lang.String mac ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.writeLock ( ) ) ) { checkIfInitialized ( ) ; macsStorage.freeMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; } }
Source:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { 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 source ; } return "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDefaultTimeZone , params , aQuery ) ; }

Target:
public void getAAAProfilesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.convertAAAProfilesResult ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testGetPackagesForCheckUpdate ( ) throws java.lang.Exception { java.util.Collection < java.lang.String > expectedPackages = new java.util.HashSet < > ( java.util.Arrays.asList ( "a" , "b" , "c" , "d" ) ) ; java.util.Collection < java.lang.String > actualPackages = org.ovirt.engine.core.bll.host.HostUpgradeManager.getPackagesForCheckUpdate ( VDSType.VDS ) ; org.junit.Assert.assertEquals ( expectedPackages , actualPackages ) ; }

Target:
public void testGetPackagesForCheckUpdate ( ) throws java.lang.Exception { java.util.Collection < java.lang.String > expectedPackages = new java.util.HashSet < > ( java.util.Arrays.asList ( "a" , "b" , "c" , "d" ) ) ; java.util.Collection < java.lang.String > actualPackages = org.ovirt.engine.core.bll.host.HostUpgradeManager.getPackagesForCheckUpdate ( VDSType.VDS , Version.v4_0 ) ; org.junit.Assert.assertEquals ( expectedPackages , actualPackages ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterBrick model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBricksResourceTest.volumeId.toString ( ) , model.getGlusterVolume ( ) . getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBricksResourceTest.serverId.toString ( ) , model.getServerId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBricksResourceTest.brickDir , model.getBrickDir ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterBrick model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.volumeId.toString ( ) , model.getGlusterVolume ( ) . getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.serverId.toString ( ) , model.getServerId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.brickDir , model.getBrickDir ( ) ) ; verifyLinks ( model ) ; }
Source:
public static void getGlusterHooks ( 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void testNegativeAffinity ( ) throws java.lang.Exception { hosts = java.util.Arrays.asList ( host_negative_enforcing , host_not_in_affinity_group ) ; java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > affinityGroups = java.util.Arrays.asList ( negative_enforcing_group ) ; org.mockito.Mockito.doReturn ( affinityGroups ) . when ( affinityGroupDao ) . getAllAffinityGroupsByVmId ( org.mockito.Matchers.any ( ) ) ; org.assertj.core.api.Assertions.assertThat ( unit.filter ( cluster , hosts , vm , new java.util.HashMap < > ( ) , new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ) ) . contains ( host_not_in_affinity_group ) ; }

Target:
public void testNegativeAffinity ( ) throws java.lang.Exception { hosts = java.util.Arrays.asList ( host_negative_enforcing , host_not_in_affinity_group ) ; java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > affinityGroups = java.util.Arrays.asList ( negative_enforcing_group ) ; org.mockito.Mockito.doReturn ( affinityGroups ) . when ( affinityGroupDao ) . getAllAffinityGroupsByVmId ( org.mockito.ArgumentMatchers.any ( ) ) ; org.assertj.core.api.Assertions.assertThat ( unit.filter ( cluster , hosts , vm , new java.util.HashMap < > ( ) , new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ) ) . contains ( host_not_in_affinity_group ) ; }
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 , 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.storage_domains > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }

Target:
public static int GetMaxVmPriority ( ) { return ( ( java.lang.Integer ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.VmPriorityMaxValue , Config.DefaultConfigurationVersion ) ) ) ; }
Source:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }