auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.CleanConnection ( storageListModel.connection , storageListModel.hostId ) ; storageListModel.OnFinish ( storageListModel.context , false , storageListModel.storageModel ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private static void setActions ( org.ovirt.engine.api.model.BaseResource model , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.api.restapi.util.LinkHelper.Collection collection = org.ovirt.engine.api.restapi.util.LinkHelper.getCollection ( model ) ; if ( collection != null ) { java.lang.String path = org.ovirt.engine.api.restapi.util.LinkHelper.getPath ( model , suggestedParentType ) ; if ( path != null ) { org.ovirt.engine.api.restapi.util.ActionsBuilder actionsBuilder = new org.ovirt.engine.api.restapi.util.ActionsBuilder ( path , collection.getResourceType ( ) ) ; model.setActions ( actionsBuilder.build ( ) ) ; } } }

Target:
public static java.lang.String getPath ( org.ovirt.engine.api.model.BaseResource entity , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.api.restapi.util.LinkHelper.ApiLocationMetadata locationMetadata = org.ovirt.engine.api.restapi.util.LinkHelper.getLocationMetadata ( entity , suggestedParentType ) ; if ( locationMetadata != null ) { if ( ( locationMetadata.getParentType ( ) ) != ( org.ovirt.engine.api.restapi.util.LinkHelper.NO_PARENT ) ) { return org.ovirt.engine.api.restapi.util.LinkHelper.getPathConsideringParent ( entity , locationMetadata ) ; } else { return org.ovirt.engine.api.restapi.util.LinkHelper.getPathWithoutParent ( entity , locationMetadata ) ; } } else { return null ; } }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.ILLEGAL ) ; log.error ( "Failed extending disk. ID: {}" , getDiskId ( ) ) ; updateAuditLog ( AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE , getCommand ( ) . getNewDiskSizeInGB ( ) ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.bll.storage.disk.cinder.ExtendCinderDiskCommand command = getCommand ( cmdId ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( getDiskId ( command ) , ImageStatus.ILLEGAL ) ; log.error ( "Failed extending disk. ID: {}" , getDiskId ( command ) ) ; updateAuditLog ( command , AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE , command.getNewDiskSizeInGB ( ) ) ; super . onFailed ( cmdId , childCmdIds ) ; }
Source:
public void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void auditLogOvfLoadError ( java.lang.String machineName , java.lang.String errorMessage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; logable.addCustomValue ( "ImportedVmName" , machineName ) ; logable.addCustomValue ( "ErrorMessage" , errorMessage ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_FAILED_TO_IMPORT_VM ) ; }

Target:
private void auditLogOvfLoadError ( java.lang.String machineName , java.lang.String errorMessage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl ( ) ; logable.addCustomValue ( "ImportedVmName" , machineName ) . addCustomValue ( "ErrorMessage" , errorMessage ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_FAILED_TO_IMPORT_VM ) ; }
Source:
public void testNetworksOnNicMatchMtuWhenNoNetworksAreProvided ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.bll.network.host.NetworkMtuValidator networkMtuValidator = new org.ovirt.engine.core.bll.network.host.NetworkMtuValidator ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.emptyList ( ) ) ) ; org.junit.Assert.assertThat ( networkMtuValidator.validateMtu ( networksOnNics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworksOnNicMatchMtuWhenNoNetworksAreProvided ( ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.bll.network.host.NetworkMtuValidator networkMtuValidator = new org.ovirt.engine.core.bll.network.host.NetworkMtuValidator ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.emptyList ( ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( networkMtuValidator.validateMtu ( networksOnNics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
void overrideHref ( org.ovirt.engine.api.model.Label label ) { final java.lang.String href = label.getHref ( ) ; if ( href != null ) { final java.lang.String [ ] hRefSegments = href.split ( "/" ) ; if ( ( hRefSegments.length ) >= 2 ) { hRefSegments [ ( ( hRefSegments.length ) - 2 ) ] = getUriPath ( ) ; final java.lang.String fixedHref = org.apache.commons.lang.StringUtils.join ( hRefSegments , '/' ) ; label.setHref ( fixedHref ) ; } } }

Target:
void overrideHref ( org.ovirt.engine.api.model.NetworkLabel label ) { final java.lang.String href = label.getHref ( ) ; if ( href != null ) { final java.lang.String [ ] hRefSegments = href.split ( "/" ) ; if ( ( hRefSegments.length ) >= 2 ) { hRefSegments [ ( ( hRefSegments.length ) - 2 ) ] = getUriPath ( ) ; final java.lang.String fixedHref = org.apache.commons.lang.StringUtils.join ( hRefSegments , '/' ) ; label.setHref ( fixedHref ) ; } } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( listModel.getItems ( ) ) != null ) { setRowData ( ( ( java.util.ArrayList < IVdcQueryable > ) ( listModel.getItems ( ) ) ) ) ; } else { setRowData ( new java.util.ArrayList < IVdcQueryable > ( ) ) ; } }

Target:
public java.lang.Boolean getValue ( ) { if ( ( ( listModel ) == null ) || ( ( listModel.getItems ( ) ) == null ) ) { return false ; } return getCheckValue ( listModel.getItems ( ) , getSelectionModel ( ) ) ; }
Source:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void testAddIscsiLunDiskIncompleteParametersConnectionTarget ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setTarget ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDiskIncompleteParametersConnectionTarget" , "target" ) ; } }

Target:
public void testAddIscsiLunDiskIncompleteParametersConnectionTarget ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setTarget ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDiskIncompleteParametersConnectionTarget" , "target" ) ; } }
Source:
public static void getStorageDomainListByTemplate ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
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.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private boolean isDisplayNetworkAvailable ( org.ovirt.engine.core.common.businessentities.VDS host , boolean onlyRequiredNetworks , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForVds , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster ) { if ( onlyRequiredNetworks ) { return true ; } if ( ! ( displayNetworkInitialized ) ) { resolveClusterDisplayNetwork ( host , allNetworksInCluster ) ; } if ( ( displayNetwork ) == null ) { return true ; } for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : allInterfacesForVds ) { if ( displayNetwork.getName ( ) . equals ( nic.getNetworkName ( ) ) ) { return true ; } } return false ; }

Target:
private boolean isDisplayNetworkAvailable ( org.ovirt.engine.core.common.businessentities.VDS host , boolean onlyRequiredNetworks , java.util.List < java.lang.String > hostNetworks , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster ) { if ( onlyRequiredNetworks ) { return true ; } if ( ! ( displayNetworkInitialized ) ) { resolveClusterDisplayNetwork ( host , allNetworksInCluster ) ; } if ( ( displayNetwork ) == null ) { return true ; } for ( java.lang.String networkName : hostNetworks ) { if ( displayNetwork.getName ( ) . equals ( networkName ) ) { return true ; } } return false ; }
Source:
public void getRpmVersion ( 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public 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 ) ; }
Source:
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.storage.DiskImage > ( ) ; } return source ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; }
Source:
private boolean nicNameAndNicIdIsIncoherent ( org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface interfaceById = existingInterfacesMap.get ( nicId ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface interfaceByName = existingInterfacesMap.get ( nicName ) ; return ! ( java.util.Objects.equals ( interfaceById , interfaceByName ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return validateCoherentIdentification ( bond.getId ( ) , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
public void migrationNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }

Target:
public void migrationSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void setErrorMessageAtReturn ( org.ovirt.engine.core.utils.Pair < java.lang.Boolean , java.lang.Integer > result ) { org.ovirt.engine.core.common.errors.VdcFault fault = new org.ovirt.engine.core.common.errors.VdcFault ( ) ; fault.setError ( result.getSecond ( ) ) ; if ( ( fault.getError ( ) ) != null ) { fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . TranslateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; } org.ovirt.engine.core.bll.storage.ConnectStorageToVdsCommand.getReturnValue ( ) . setFault ( fault ) ; }

Target:
private void setErrorMessageAtReturn ( org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > result ) { org.ovirt.engine.core.common.errors.VdcFault fault = new org.ovirt.engine.core.common.errors.VdcFault ( ) ; fault.setError ( result.getSecond ( ) ) ; if ( ( fault.getError ( ) ) != null ) { fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . TranslateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; } org.ovirt.engine.core.bll.storage.ConnectStorageToVdsCommand.getReturnValue ( ) . setFault ( fault ) ; }
Source:
private void doTestValidateModifiedBondSlaves ( org.ovirt.engine.core.common.businessentities.network.Bond bond , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingInterfaces , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkBusinessEntityMap , org.ovirt.engine.core.bll.ValidationResult interfaceExistValidationResult , org.ovirt.engine.core.bll.ValidationResult interfaceIsValidSlaveValidationResult , boolean expectedValidationResult , org.ovirt.engine.core.common.errors.VdcBllMessages expectedViolation ) { doTestValidateModifiedBondSlaves ( bond , new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) , networkBusinessEntityMap , existingInterfaces , interfaceExistValidationResult , interfaceIsValidSlaveValidationResult , expectedValidationResult , expectedViolation ) ; }

Target:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator createHostSetupNetworksValidator ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { return createHostSetupNetworksValidator ( networks , new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters initVdsCreateVmParams ( ) { org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . setRunOnce ( true ) ; org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . initVdsCreateVmParams ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; return createVmParams ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters initCreateVmParams ( ) { org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . setRunOnce ( true ) ; org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . initCreateVmParams ( ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; createVmParams.setCloudInitParameters ( runOnceParams.getCloudInitParameters ( ) ) ; return createVmParams ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveAdGroup , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveGroup , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void successfulFenceWithDifferentProxyRetry ( ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult1 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult2 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS ) ; mockFenceVdsResult ( fenceVdsResult1 , fenceVdsResult2 ) ; mockProxyHost ( true ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.START , createAgent ( ) ) ; org.junit.Assert.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; verifyAuditFenceExecutionStart ( 2 ) ; verifyAuditFenceExecutionFailure ( 1 ) ; }

Target:
public void successfulFenceWithDifferentProxyRetry ( ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult1 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult2 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS ) ; mockFenceVdsResult ( fenceVdsResult1 , fenceVdsResult2 ) ; mockProxyHost ( true ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.START , createAgent ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; verifyAuditFenceExecutionStart ( 2 ) ; verifyAuditFenceExecutionFailure ( 1 ) ; }
Source:
public void testDeactivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.DeactivateStorageDomainWithOvfUpdate , org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; verifyActionResponse ( resource.deactivate ( action ) ) ; }

Target:
public void testDeactivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.DeactivateStorageDomainWithOvfUpdate , org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; verifyActionResponse ( resource.deactivate ( action ) ) ; }
Source:
public static void saveClass ( java.lang.String distPath , java.lang.String className , java.lang.String classCode ) throws java.io.IOException { java.io.File classFile = new java.io.File ( distPath , ( ( className.replace ( '.' , java.io.File.separatorChar ) ) + ".java" ) ) ; java.util.List < java.lang.String > classLines = java.util.Arrays.asList ( classCode.split ( "\n" ) ) ; classLines = org.ovirt.engine.sdk.codegen.utils.StringUtils.removeTrailingWhitespace ( classLines ) ; org.apache.commons.io.FileUtils.writeLines ( classFile , classLines ) ; }

Target:
public static void saveClass ( java.lang.String distPath , java.lang.String className , java.lang.String classCode ) throws java.io.IOException { java.io.File classFile = new java.io.File ( distPath , ( ( className.replace ( '.' , java.io.File.separatorChar ) ) + ".java" ) ) ; java.util.List < java.lang.String > classLines = new java.util.ArrayList < > ( org.ovirt.engine.sdk.codegen.utils.ClassUtils.COPYRIGHT ) ; classLines.add ( "" ) ; java.util.Collections.addAll ( classLines , classCode.split ( "\n" ) ) ; classLines = org.ovirt.engine.sdk.codegen.utils.StringUtils.removeTrailingWhitespace ( classLines ) ; org.apache.commons.io.FileUtils.writeLines ( classFile , classLines ) ; }
Source:
protected boolean validateVmNetwork ( ) { boolean retVal = true ; if ( ! ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) { org.ovirt.engine.core.compat.Version version = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) ; retVal = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , version.getValue ( ) ) ; if ( ! retVal ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; } } return retVal ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult stpForVmNetworkOnly ( ) { return ( getNetwork ( ) . isVmNetwork ( ) ) || ( ! ( getNetwork ( ) . getstp ( ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NON_VM_NETWORK_CANNOT_SUPPORT_STP ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.ad_groups initAdGroup ( org.ovirt.engine.core.common.businessentities.ad_groups adGroup ) { org.ovirt.engine.core.common.businessentities.ad_groups dbGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDao ( ) . get ( adGroup.getid ( ) ) ; if ( dbGroup == null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDao ( ) . save ( adGroup ) ; dbGroup = adGroup ; } return dbGroup ; }

Target:
public static org.ovirt.engine.core.common.businessentities.LdapGroup initAdGroup ( org.ovirt.engine.core.common.businessentities.LdapGroup adGroup ) { org.ovirt.engine.core.common.businessentities.LdapGroup dbGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDao ( ) . get ( adGroup.getid ( ) ) ; if ( dbGroup == null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDao ( ) . save ( adGroup ) ; dbGroup = adGroup ; } return dbGroup ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateProvider , org.ovirt.engine.core.common.action.ProviderParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyModel ( resource.update ( getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateProvider , org.ovirt.engine.core.common.action.ProviderParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyModel ( resource.update ( getModel ( 0 ) ) , 0 ) ; }
Source:
public static java.util.Map < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > getNotificationEventsByType ( org.ovirt.engine.core.common.EventNotificationEntity type ) { java.util.Map < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > map = new java.util.HashMap < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > ( ) ; if ( org.ovirt.engine.core.common.VdcEventNotificationUtils._eventNotificationTypeMap.containsKey ( type ) ) { map.put ( type , org.ovirt.engine.core.common.VdcEventNotificationUtils._eventNotificationTypeMap.get ( type ) ) ; } return map ; }

Target:
public static java.util.Map < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > getNotificationEventsByType ( org.ovirt.engine.core.common.EventNotificationEntity type ) { java.util.Map < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > map = new java.util.HashMap < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > ( ) ; if ( org.ovirt.engine.core.common.VdcEventNotificationUtils.eventNotificationTypeMap.containsKey ( type ) ) { map.put ( type , org.ovirt.engine.core.common.VdcEventNotificationUtils.eventNotificationTypeMap.get ( type ) ) ; } return map ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskImage getDiskImageToRemoveByParam ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters param ) { org.ovirt.engine.core.compat.Guid imageGroupId = param.getDestImageGroupId ( ) ; org.ovirt.engine.core.compat.Guid imageId = param.getDestinationImageId ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( imageGroupId ) ; diskImage.setImageId ( imageId ) ; return diskImage ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImageToRemoveByParam ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters param ) { org.ovirt.engine.core.compat.Guid imageGroupId = param.getDestImageGroupId ( ) ; org.ovirt.engine.core.compat.Guid imageId = param.getDestinationImageId ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setId ( imageGroupId ) ; diskImage.setImageId ( imageId ) ; return diskImage ; }
Source:
public void getVdsNullVdsId ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }

Target:
public void getVdsNullVdsId ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.jupiter.api.Assertions.assertNull ( v ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locks = new java.util.HashMap < > ( ) ; locks.put ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getconnection ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE_CONNECTION , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; locks.put ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE_CONNECTION , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; return locks ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locks = new java.util.HashMap < > ( ) ; locks.put ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getconnection ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE_CONNECTION , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; locks.put ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.STORAGE_CONNECTION , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; return locks ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { java.util.Set < java.lang.String > emulatedSet = new java.util.TreeSet < java.lang.String > ( ( ( java.util.HashSet < java.lang.String > ) ( returnValue ) ) ) ; emulatedSet.add ( "" ) ; java.lang.String oldVal = getModel ( ) . getEmulatedMachine ( ) . getSelectedItem ( ) ; getModel ( ) . getEmulatedMachine ( ) . setItems ( emulatedSet ) ; getModel ( ) . getEmulatedMachine ( ) . setSelectedItem ( oldVal ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.compat.Guid > fetchDomainsReportedAsProblematic ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainsData ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { return proxy.checkIfDomainsReportedAsProblematic ( vdsDomainsData ) ; } return java.util.Collections.emptyList ( ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.compat.Guid > fetchDomainsReportedAsProblematic ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainsData ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { return proxy.obtainDomainsReportedAsProblematic ( vdsDomainsData ) ; } return java.util.Collections.emptyList ( ) ; }
Source:
public void testSelfAndIdentifyEquality ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2463" ) ; org.ovirt.engine.core.compat.Guid deviceId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2464" ) ; org.ovirt.engine.core.common.businessentities.VmDevice device1 = createVmDevice ( deviceId , vmId ) ; assertTrue ( ( ( device1.compareTo ( device1 ) ) == 0 ) ) ; org.ovirt.engine.core.common.businessentities.VmDevice device2 = createVmDevice ( deviceId , vmId ) ; assertTrue ( ( ( device1.compareTo ( device2 ) ) == 0 ) ) ; }

Target:
public void testSelfAndIdentifyEquality ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2463" ) ; org.ovirt.engine.core.compat.Guid deviceId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2464" ) ; org.ovirt.engine.core.common.businessentities.VmDevice device1 = createVmDevice ( deviceId , vmId ) ; org.junit.Assert.assertTrue ( ( ( device1.compareTo ( device1 ) ) == 0 ) ) ; org.ovirt.engine.core.common.businessentities.VmDevice device2 = createVmDevice ( deviceId , vmId ) ; org.junit.Assert.assertTrue ( ( ( device1.compareTo ( device2 ) ) == 0 ) ) ; }
Source:
public void testGetAllNetworkSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Network" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Network ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( networkResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllQuotaSearch ( ) throws java.lang.Exception { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Quota" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.Quota ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( quotaResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getQuotaId ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) != null ) && ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) ) ) { org.ovirt.engine.core.compat.Guid quotaId = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getQuotaId ( ) ; if ( ! ( Guid.Empty.equals ( quotaId ) ) ) { return quotaId ; } } return null ; }

Target:
private org.ovirt.engine.core.compat.Guid getQuotaId ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) != null ) && ( ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) == ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) ) ) { org.ovirt.engine.core.compat.Guid quotaId = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getQuotaId ( ) ; if ( ! ( Guid.Empty.equals ( quotaId ) ) ) { return quotaId ; } } return null ; }