auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; java.lang.String host = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionResource.HOST ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( host != null ) { hostId = getHostId ( host ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; java.lang.String host = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionResource.HOST ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( host != null ) { hostId = getHostId ( host ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId , false ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }
Source:
public java.lang.Boolean getNicHotplugSupport ( java.lang.Integer osId , org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Integer , org.ovirt.engine.core.compat.Version > pair = new org.ovirt.engine.core.common.utils.Pair < java.lang.Integer , org.ovirt.engine.core.compat.Version > ( osId , version ) ; if ( getNicHotplugSupportMap ( ) . containsKey ( pair ) ) { return getNicHotplugSupportMap ( ) . get ( pair ) ; } return false ; }

Target:
public java.lang.Boolean getNicHotplugSupport ( java.lang.Integer osId , org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Integer , org.ovirt.engine.core.compat.Version > pair = new org.ovirt.engine.core.common.utils.Pair ( osId , version ) ; if ( getNicHotplugSupportMap ( ) . containsKey ( pair ) ) { return getNicHotplugSupportMap ( ) . get ( pair ) ; } return false ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > devs = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( devs.isEmpty ( ) ) ) ) ; getModel ( ) . setRngDevice ( ( devs.isEmpty ( ) ? new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) : devs.get ( 0 ) ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > devs = returnValue.getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( devs.isEmpty ( ) ) ) ) ; getModel ( ) . setRngDevice ( ( devs.isEmpty ( ) ? new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) : devs.get ( 0 ) ) ) ; }
Source:
private boolean validateStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > memoryDisksList = getMemoryImageBuilder ( ) . getDisksToBeCreated ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getAllDisks ( vmDisksList , memoryDisksList ) ; org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator ( disksList ) ; return ( ( validate ( sdValidator.allDomainsExistAndActive ( ) ) ) && ( validate ( sdValidator.allDomainsWithinThresholds ( ) ) ) ) && ( validate ( sdValidator.allDomainsHaveSpaceForAllDisks ( vmDisksList , memoryDisksList ) ) ) ; }

Target:
private boolean validateStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisksList , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > memoryDisksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getAllDisks ( vmDisksList , memoryDisksList ) ; org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator ( disksList ) ; return ( ( validate ( sdValidator.allDomainsExistAndActive ( ) ) ) && ( validate ( sdValidator.allDomainsWithinThresholds ( ) ) ) ) && ( validate ( sdValidator.allDomainsHaveSpaceForAllDisks ( vmDisksList , memoryDisksList ) ) ) ; }
Source:
public void saveOrUpdateNewVariable ( ) { org.ovirt.engine.core.common.ExternalVariable newVar = new org.ovirt.engine.core.common.ExternalVariable ( ) ; newVar.setName ( "new-var" ) ; newVar.setValue ( "123456" ) ; newVar.setUpdateDate ( new java.util.Date ( ) ) ; dbFacade.getExternalVariableDao ( ) . saveOrUpdate ( newVar ) ; org.ovirt.engine.core.common.ExternalVariable found = dbFacade.getExternalVariableDao ( ) . get ( newVar.getName ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( newVar , found ) ; }

Target:
public void saveOrUpdateNewVariable ( ) { org.ovirt.engine.core.common.ExternalVariable newVar = new org.ovirt.engine.core.common.ExternalVariable ( ) ; newVar.setName ( "new-var" ) ; newVar.setValue ( "123456" ) ; newVar.setUpdateDate ( new java.util.Date ( ) ) ; dao.saveOrUpdate ( newVar ) ; org.ovirt.engine.core.common.ExternalVariable found = dao.get ( newVar.getName ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( newVar , found ) ; }
Source:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public static void GetAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; getAllFromExportDomainQueryParamenters.setGetAll ( true ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public static void GetAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . update ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getParameters ( ) . getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( cluster.getId ( ) , org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getParameters ( ) . getNetwork ( ) ) ; } org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . update ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( cluster.getId ( ) , org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; } org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.setSucceeded ( true ) ; }
Source:
private void initHostWithOneVfsConfig ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > passthroughVnics , int numOfVfs , boolean allNetworksAllowed , boolean networkInSriovConfig , boolean labelInSriovConfig , boolean hasFreeVf , boolean freeVfShareIommuGroup ) { org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig hostNicVfsConfig = new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic : passthroughVnics ) { updateVfsConfig ( hostNicVfsConfig , vnic , numOfVfs , allNetworksAllowed , networkInSriovConfig , labelInSriovConfig , hasFreeVf , freeVfShareIommuGroup ) ; } mockVfsConfigsOnHost ( java.util.Collections.singletonList ( hostNicVfsConfig ) ) ; }

Target:
private void initHostWithOneVfsConfig ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > passthroughVnics , int numOfVfs , boolean allNetworksAllowed , boolean networkInSriovConfig , boolean labelInSriovConfig , boolean hasFreeVf ) { initHostWithOneVfsConfig ( passthroughVnics , numOfVfs , allNetworksAllowed , networkInSriovConfig , labelInSriovConfig , hasFreeVf , false , false ) ; }
Source:
public static void initOsArchitecture ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osArchitectures = ( ( java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsArchitectures ) , callback ) ; }

Target:
public static void initOsArchitecture ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osArchitectures = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsArchitectures ) , callback ) ; }
Source:
private void mockValidators ( ) { org.mockito.Mockito.doReturn ( vmValidator ) . when ( command ) . createVmValidator ( ) ; org.mockito.Mockito.doReturn ( diskValidator ) . when ( command ) . createDiskValidator ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( diskVmElementValidator ) . when ( command ) . createDiskVmElementValidator ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
private void mockValidators ( ) { org.mockito.Mockito.doReturn ( diskValidator ) . when ( command ) . createDiskValidator ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( diskVmElementValidator ) . when ( command ) . createDiskVmElementValidator ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > vmTemplates = org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getDbFacade ( ) . getVmTemplateDao ( ) . getAllTemplatesRelatedToQuotaId ( org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getParameters ( ) . getQuotaId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate : vmTemplates ) { org.ovirt.engine.core.bll.VmTemplateHandler.UpdateDisksFromDb ( vmTemplate ) ; } org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vmTemplates ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > vmTemplates = org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getDbFacade ( ) . getVmTemplateDao ( ) . getAllTemplatesRelatedToQuotaId ( org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate : vmTemplates ) { org.ovirt.engine.core.bll.VmTemplateHandler.UpdateDisksFromDb ( vmTemplate ) ; } org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vmTemplates ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcActionType getActionType ( ) { try { if ( ( actionType ) == null ) { java.lang.String name = getClass ( ) . getName ( ) ; name = name.substring ( 0 , ( ( name.length ( ) ) - 7 ) ) ; name = name.substring ( ( ( name.lastIndexOf ( '.' ) ) + 1 ) ) ; actionType = org.ovirt.engine.core.common.action.VdcActionType.valueOf ( name ) ; } return actionType ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.action.VdcActionType.Unknown ; } }

Target:
public org.ovirt.engine.core.common.action.VdcActionType getActionType ( ) { try { if ( ( actionType ) == null ) { java.lang.String name = getClass ( ) . getName ( ) ; name = name.substring ( 0 , ( ( name.length ( ) ) - 7 ) ) ; name = name.substring ( ( ( name.lastIndexOf ( '.' ) ) + 1 ) ) ; actionType = org.ovirt.engine.core.common.action.VdcActionType.valueOf ( name ) ; } return actionType ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.action.VdcActionType.Unknown ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; model.getQuota ( ) . setItems ( quotas ) ; model.getQuota ( ) . setIsEmpty ( quotas.isEmpty ( ) ) ; model.updateControlsAvailability ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( returnValue ) ) ; quotas = ( quotas != null ) ? quotas : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; getQuota ( ) . setItems ( quotas ) ; getQuota ( ) . setIsEmpty ( quotas.isEmpty ( ) ) ; updateControlsAvailability ( ) ; stopProgress ( ) ; }
Source:
protected boolean validate ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.supportedInConfig ( ConfigValues.GlusterEventingSupported , org.ovirt.engine.core.bll.gluster.AddGlusterWebhookInternalCommand.getCluster ( ) . getCompatibilityVersion ( ) ) ) ) { return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.supportedInConfig ( ConfigValues.GlusterEventingSupported , org.ovirt.engine.core.bll.gluster.AddGlusterWebhookInternalCommand.getCluster ( ) . getCompatibilityVersion ( ) ) ) ) { return false ; } return true ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Boolean interfaceHasSiblingVlanInterfaces = ( ( java.lang.Boolean ) ( returnValue ) ) ; if ( ! interfaceHasSiblingVlanInterfaces ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface i : interfaceList ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( i.getBondName ( ) , vlanParent.getName ( ) ) ) { ifacesOptions.add ( i ) ; } } } defaultInterfaceName.append ( vlanParent.getName ( ) ) ; asyncQuery.asyncCallback.OnSuccess ( asyncQuery.Model , ifacesOptions ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Boolean interfaceHasSiblingVlanInterfaces = ( ( java.lang.Boolean ) ( returnValue ) ) ; if ( ! interfaceHasSiblingVlanInterfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaceList ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( i.getBondName ( ) , vlanParent.getName ( ) ) ) { ifacesOptions.add ( i ) ; } } } defaultInterfaceName.append ( vlanParent.getName ( ) ) ; asyncQuery.asyncCallback.OnSuccess ( asyncQuery.Model , ifacesOptions ) ; }
Source:
public void moveFloatingDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( ( ( command.getMoveDiskParametersList ( ) . size ( ) ) == 1 ) ) ; }

Target:
public void moveFloatingDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getMoveDiskParametersList ( ) . size ( ) ) ; }
Source:
public java.lang.String generateEngineSessionId ( ) { java.lang.String engineSessionId ; try { byte [ ] s = new byte [ 64 ] ; java.security.SecureRandom.getInstance ( "SHA1PRNG" ) . nextBytes ( s ) ; engineSessionId = new org.apache.commons.codec.binary.Base64 ( 0 ) . encodeToString ( s ) ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new java.lang.RuntimeException ( e ) ; } return engineSessionId ; }

Target:
public java.lang.String generateEngineSessionId ( ) { java.lang.String engineSessionId ; byte [ ] s = new byte [ 64 ] ; new java.security.SecureRandom ( ) . nextBytes ( s ) ; engineSessionId = new org.apache.commons.codec.binary.Base64 ( 0 ) . encodeToString ( s ) ; return engineSessionId ; }
Source:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( CLUSTER_ID ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }

Target:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( CLUSTER_ID ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }
Source:
private void logException ( java.lang.RuntimeException ex ) { if ( ! ( ex.getMessage ( ) . contains ( "Policy reset" ) ) ) { log.error ( "Command '{}' execution failed: {}" , this , ex.getMessage ( ) ) ; log.debug ( "Exception" , ex ) ; } }

Target:
private void logException ( java.lang.RuntimeException ex ) { if ( ( ( ex.getMessage ( ) ) == null ) || ( ! ( ex.getMessage ( ) . contains ( "Policy reset" ) ) ) ) { log.error ( "Command '{}' execution failed: {}" , this , ex.getMessage ( ) ) ; log.debug ( "Exception" , ex ) ; } }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource mapper = createIdParameterMapper ( networkAttachment.getId ( ) ) . addValue ( "network_id" , networkAttachment.getNetworkId ( ) ) . addValue ( "nic_id" , networkAttachment.getNicId ( ) ) . addValue ( "custom_properties" , org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serialize ( networkAttachment.getProperties ( ) ) ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = networkAttachment.getIpConfiguration ( ) ; mapIpConfiguration ( mapper , ( ipConfiguration == null ? new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) : ipConfiguration ) ) ; return mapper ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource mapper = createIdParameterMapper ( networkAttachment.getId ( ) ) . addValue ( "network_id" , networkAttachment.getNetworkId ( ) ) . addValue ( "nic_id" , networkAttachment.getNicId ( ) ) . addValue ( "custom_properties" , org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serialize ( networkAttachment.getProperties ( ) ) ) ; mapIpConfiguration ( networkAttachment , mapper ) ; return mapper ; }
Source:
private void validateInvalidDestinationAndSourceDomainOfDifferentStorageSubtypes ( org.ovirt.engine.core.common.businessentities.storage.StorageType sourceType , org.ovirt.engine.core.common.businessentities.storage.StorageType destType ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; srcStorageDomain.setStorageType ( sourceType ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setStorageType ( destType ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
private void validateInvalidDestinationAndSourceDomainOfDifferentStorageSubtypes ( org.ovirt.engine.core.common.businessentities.storage.StorageType sourceType , org.ovirt.engine.core.common.businessentities.storage.StorageType destType ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; srcStorageDomain.setStorageType ( sourceType ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setStorageType ( destType ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }
Source:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > objL = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StoragePool > cast ( getSelectedItems ( ) ) ) { objL.add ( a.getId ( ) ) ; } return objL.toArray ( new java.lang.Object [ ] { } ) ; } }

Target:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > objL = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : getSelectedItems ( ) ) { objL.add ( a.getId ( ) ) ; } return objL.toArray ( new java.lang.Object [ ] { } ) ; } }
Source:
protected < T > T getConfigurationValue ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.ConfigurationValues config , final org.ovirt.engine.api.model.Version version ) { return getEntity ( clz , VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config ) { { setVersion ( org.ovirt.engine.api.restapi.resource.BackendResource.asString ( version ) ) ; } } , config.toString ( ) ) ; }

Target:
protected < T > T getConfigurationValue ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.ConfigurationValues config , final org.ovirt.engine.api.model.Version version ) { return getEntity ( clz , VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.api.restapi.resource.BackendResource.asString ( version ) ) , config.toString ( ) ) ; }
Source:
public void getVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; b.setVm ( v ) ; final org.ovirt.engine.core.common.businessentities.VM vm = b.getVm ( ) ; org.junit.Assert.assertEquals ( v , vm ) ; }

Target:
public void getVm ( ) { final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; b.setVm ( v ) ; final org.ovirt.engine.core.common.businessentities.VM vm = b.getVm ( ) ; org.junit.Assert.assertEquals ( v , vm ) ; }
Source:
public boolean validate ( java.lang.String text ) { text = text.trim ( ) . toLowerCase ( ) ; for ( java.lang.String os : map.values ( ) ) { if ( os.equals ( text ) ) { return true ; } } return false ; }

Target:
public boolean validate ( java.lang.String text ) { text = text.trim ( ) ; for ( java.lang.String os : map.values ( ) ) { if ( os.equals ( text ) ) { return true ; } } return false ; }
Source:
public static 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; }
Source:
public void testShouldCheckVmOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; group.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void testShouldCheckVmOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; group.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vm ) { super . edit ( vm ) ; hostTab.setVisible ( false ) ; resourceAllocationTab.setVisible ( false ) ; templateEditor.setVisible ( false ) ; highAvailabilityTab.setVisible ( true ) ; customPropertiesTab.setVisible ( false ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vm ) { super . edit ( vm ) ; hostTab.setVisible ( false ) ; resourceAllocationTab.setVisible ( false ) ; templateEditor.setVisible ( false ) ; highAvailabilityTab.setVisible ( true ) ; customPropertiesTab.setVisible ( true ) ; }
Source:
protected void copyVmDevices ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmDevice > ( vmFromConfiguration.getVmUnamagedDeviceList ( ) ) ; devices.addAll ( vmFromConfiguration.getManagedVmDeviceMap ( ) . values ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( getVmIdFromSnapshot ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVmId ( ) , vmFromConfiguration , vmFromConfiguration.getStaticData ( ) , true , devices , newDiskImages , _vmInterfaces , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getParameters ( ) . isConsoleEnabled ( ) ) ; }

Target:
protected void copyVmDevices ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmDevice > ( vmFromConfiguration.getVmUnamagedDeviceList ( ) ) ; devices.addAll ( vmFromConfiguration.getManagedVmDeviceMap ( ) . values ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( getVmIdFromSnapshot ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVmId ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVm ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVm ( ) . getStaticData ( ) , true , devices , newDiskImages , _vmInterfaces , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getParameters ( ) . isConsoleEnabled ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VmDevice createVMDevice ( org.ovirt.engine.core.compat.Guid vmID , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getImageId ( ) , vmID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 1 , null , true , true , true , "" ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VmDevice createVMDevice ( org.ovirt.engine.core.compat.Guid vmID , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getImageId ( ) , vmID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 1 , null , true , true , true , "" , null ) ; }
Source:
private void mockGetForDisk ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; vms.add ( vm ) ; java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > vmsMap = new java.util.HashMap < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > ( ) ; vmsMap.put ( java.lang.Boolean.TRUE , vms ) ; org.mockito.Mockito.when ( vmDAO.getForDisk ( diskImageGuid ) ) . thenReturn ( vmsMap ) ; }

Target:
private void mockGetForDisk ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > vmsMap = new java.util.HashMap < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > ( ) ; vmsMap.put ( java.lang.Boolean.TRUE , vms ) ; org.mockito.Mockito.when ( vmDAO.getForDisk ( diskImageGuid ) ) . thenReturn ( vmsMap ) ; }
Source:
private void templateValidate ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.countAllTemplates ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { int count = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( count <= 1 ) { getModel ( ) . disableEditing ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . notAvailableWithNoTemplates ( ) ) ; } } } ) ) ; }

Target:
private void templateValidate ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . countAllTemplates ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { int count = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( count <= 1 ) { getModel ( ) . disableEditing ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . notAvailableWithNoTemplates ( ) ) ; } } } ) ) ; }
Source:
public void doTestFence ( org.ovirt.engine.api.model.FenceType fenceType , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.businessentities.pm.FenceActionType fenceActionType ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( actionType , org.ovirt.engine.core.common.action.FenceVdsActionParameters.class , new java.lang.String [ ] { "VdsId" , "Action" } , new java.lang.Object [ ] { GUIDS [ 0 ] , fenceActionType } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setFenceType ( fenceType.value ( ) ) ; verifyActionResponse ( resource.fence ( action ) ) ; }

Target:
public void doTestFence ( org.ovirt.engine.api.model.FenceType fenceType , org.ovirt.engine.core.common.action.VdcActionType actionType ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( actionType , org.ovirt.engine.core.common.action.FenceVdsActionParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setFenceType ( fenceType.value ( ) ) ; verifyActionResponse ( resource.fence ( action ) ) ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getRoleGroupMapDao ( ) ) ; existingRoleGroupMap = dao.getByActionGroupAndRole ( ActionGroup.VM_BASIC_OPERATIONS , org.ovirt.engine.core.dao.RoleGroupMapDAOTest.EXISTING_ROLE_ID ) ; actionGroup = org.ovirt.engine.core.common.businessentities.ActionGroup.CONNECT_TO_VM ; newRoleGroupMap = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( actionGroup , org.ovirt.engine.core.dao.RoleGroupMapDAOTest.EXISTING_ROLE_ID ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getRoleGroupMapDao ( ) ; existingRoleGroupMap = dao.getByActionGroupAndRole ( ActionGroup.VM_BASIC_OPERATIONS , org.ovirt.engine.core.dao.RoleGroupMapDAOTest.EXISTING_ROLE_ID ) ; actionGroup = org.ovirt.engine.core.common.businessentities.ActionGroup.CONNECT_TO_VM ; newRoleGroupMap = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( actionGroup , org.ovirt.engine.core.dao.RoleGroupMapDAOTest.EXISTING_ROLE_ID ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.authentication.DirectoryUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDAO dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = dao.getByExternalId ( directoryUser.getDirectory ( ) . getName ( ) , directoryUser.getId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( directoryUser ) ; dbUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dao.save ( dbUser ) ; } return dbUser ; }

Target:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.authentication.DirectoryUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDAO dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = dao.getByExternalId ( directoryUser.getDirectory ( ) . getName ( ) , directoryUser.getId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( directoryUser ) ; dao.save ( dbUser ) ; } return dbUser ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_DISABLE , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , getEntityList ( ) ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , getEntityList ( ) ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult vmDuringInitialization ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( vm.isRunning ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.NotResponding ) ) ) || ( isVmDuringInitiating ( vm ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult vmDuringInitialization ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( vm.isRunning ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.NotResponding ) ) ) || ( isVmDuringInitiating ( vm ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( "isSelectionAvailable" . equals ( propName ) ) { if ( ( listModel.getItems ( ) ) != null ) { showModels ( ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > ) ( listModel.getItems ( ) ) ) ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( "isSelectionAvailable" . equals ( propName ) ) { if ( ( listModel.getItems ( ) ) != null ) { showModels ( ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > ) ( listModel.getItems ( ) ) ) , vds ) ; } } }
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 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 > ( ) ; }