auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.common.vdscommands.VDSReturnValue RunVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , org.ovirt.engine.core.common.vdscommands.VDSParametersBase parameters ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setReturnValue ( false ) ; return value ; }

Target:
public void canRunVmDuringInit ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }
Source:
protected boolean validateSpaceRequirements ( ) { fetchVmDisksFromDb ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskList ( ) ; org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator msdValidator = createMultipleStorageDomainsValidator ( disksList ) ; return ( validate ( msdValidator.allDomainsHaveSpaceForNewDisks ( disksList ) ) ) && ( validate ( msdValidator.allDomainsWithinThresholds ( ) ) ) ; }

Target:
protected void loadPayloadDevice ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmPayload ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = getVmPayloadByDeviceType ( VmDeviceType.CDROM ) ; if ( payload != null ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( payload ) ; } else { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( getVmPayloadByDeviceType ( VmDeviceType.FLOPPY ) ) ; } } }
Source:
public org.ovirt.engine.core.common.businessentities.VDS getValue ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return vds ; }

Target:
public org.ovirt.engine.core.common.businessentities.VDS getValue ( S object ) { if ( object instanceof org.ovirt.engine.core.common.businessentities.VDS ) { return ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( object ) ) ; } if ( object instanceof org.ovirt.engine.core.common.utils.PairQueryable ) { if ( ( ( ( org.ovirt.engine.core.common.utils.PairQueryable ) ( object ) ) . getSecond ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VDS ) { return ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( ( ( org.ovirt.engine.core.common.utils.PairQueryable ) ( object ) ) . getSecond ( ) ) ) ; } } return null ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public org.ovirt.engine.api.model.Disks list ( ) { if ( org.ovirt.engine.api.common.util.QueryHelper.hasMatrixParam ( getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDisksResource.UNREGISTERED_CONSTRAINT_PARAMETER ) ) { return mapCollection ( getBackendCollection ( VdcQueryType.GetUnregisteredDisks , new org.ovirt.engine.core.common.queries.GetUnregisteredDisksQueryParameters ( storageDomainId , getStoragePoolIdForDomain ( storageDomainId ) ) ) ) ; } else { return mapCollection ( getBackendCollection ( VdcQueryType.GetAllDisksByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( this . storageDomainId ) ) ) ; } }

Target:
public org.ovirt.engine.api.model.Disks list ( ) { boolean unregistered = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDisksResource.UNREGISTERED_CONSTRAINT_PARAMETER , true , false ) ; if ( unregistered ) { return mapCollection ( getBackendCollection ( VdcQueryType.GetUnregisteredDisks , new org.ovirt.engine.core.common.queries.GetUnregisteredDisksQueryParameters ( storageDomainId , getStoragePoolIdForDomain ( storageDomainId ) ) ) ) ; } else { return mapCollection ( getBackendCollection ( VdcQueryType.GetAllDisksByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( this . storageDomainId ) ) ) ; } }
Source:
public void testCheckIfRoleIsReadOnlyTrue ( ) { getRole ( ) . setReadonly ( true ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( 1 ) ; org.junit.Assert.assertTrue ( "Role should be read only" , getCommand ( ) . checkIfRoleIsReadOnly ( messages ) ) ; org.junit.Assert.assertEquals ( "Wrong canDoAction message" , EngineMessage.ACTION_TYPE_FAILED_ROLE_IS_READ_ONLY.toString ( ) , messages.get ( 0 ) ) ; }

Target:
public void testCheckIfRoleIsReadOnlyTrue ( ) { getRole ( ) . setReadonly ( true ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( 1 ) ; org.junit.Assert.assertTrue ( "Role should be read only" , getCommand ( ) . checkIfRoleIsReadOnly ( messages ) ) ; org.junit.Assert.assertEquals ( "Wrong validate message" , EngineMessage.ACTION_TYPE_FAILED_ROLE_IS_READ_ONLY.toString ( ) , messages.get ( 0 ) ) ; }
Source:
public void massUpdateNumaNodeStatistics ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > numaNodes ) { for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode node : numaNodes ) { update ( node ) ; } }

Target:
public void massUpdateNumaNodeStatistics ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > numaNodes ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList ( numaNodes.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode node : numaNodes ) { executions.add ( createNumaNodeStatisticsParametersMapper ( node ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "UpdateNumaNodeStatistics" , executions ) ; }
Source:
private boolean isDiskNotShareable ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageById ( imageId ) ; if ( diskImage.isShareable ( ) ) { addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; } return true ; }

Target:
private boolean isDiskNotShareable ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageByImageId ( imageId ) ; if ( diskImage.isShareable ( ) ) { addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; } return true ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addLabels ( org.ovirt.engine.core.common.businessentities.network.NicLabel ... nicLabels ) { if ( emptyParameters ( nicLabels ) ) { return this ; } if ( ( parameters.getLabels ( ) ) == null ) { parameters.setLabels ( new java.util.HashSet < org.ovirt.engine.core.common.businessentities.network.NicLabel > ( ) ) ; } parameters.getLabels ( ) . addAll ( java.util.Arrays.asList ( nicLabels ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( nullParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getNetworkAttachments ( ) ) == null ) { parameters.setNetworkAttachments ( new java.util.ArrayList < > ( ) ) ; } parameters.getNetworkAttachments ( ) . addAll ( java.util.Arrays.asList ( networkAttachments ) ) ; return this ; }
Source:
private void initCommand ( org.ovirt.engine.core.common.businessentities.OvfEntityData resultOvfEntityData ) { org.ovirt.engine.core.common.action.ImportVmParameters parameters = createParametersWhenImagesExistOnTargetStorageDomain ( ) ; initUnregisteredOVFData ( resultOvfEntityData ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand < org.ovirt.engine.core.common.action.ImportVmParameters > ( parameters ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override protected org.ovirt.engine.core.dao.UnregisteredOVFDataDAO getUnregisteredOVFDataDao ( ) { return unregisteredOVFDataDao ; } public org.ovirt.engine.core.common.businessentities.VDSGroup getVdsGroup ( ) { return vdsGroup ; } } ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImages ( ) { return java.util.Collections.emptyList ( ) ; }
Source:
protected boolean isOsSupportingHotPlug ( ) { int vmOs = org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getOs ( ) ; java.lang.String [ ] unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.HotPlugUnsupportedOsList ) . split ( "," ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( osRepository.getOsName ( vmOs ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; return false ; } } return true ; }

Target:
protected boolean isDiskSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { java.util.Set < java.lang.String > diskHotpluggableInterfaces = osRepository.getDiskHotpluggableInterfaces ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ; if ( ( org.springframework.util.CollectionUtils.isEmpty ( diskHotpluggableInterfaces ) ) || ( ! ( diskHotpluggableInterfaces.contains ( disk.getDiskInterface ( ) . name ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } return true ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" , "storageType" ) ; validateEnums ( org.ovirt.engine.api.model.DataCenter.class , dataCenter ) ; validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) . toUpperCase ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool entity = map ( dataCenter ) ; return performCreate ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" , "storageType" ) ; validateEnums ( org.ovirt.engine.api.model.DataCenter.class , dataCenter ) ; validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) . toUpperCase ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool entity = map ( dataCenter ) ; return performCreate ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( ) { return org.ovirt.engine.core.bll.IsoDomainListSyncronizer.getInstance ( ) . getUserRequestForStorageDomainRepoFileList ( getStorageDomainIdForQuery ( ) , org.ovirt.engine.core.bll.GetImagesListQueryBase.getParameters ( ) . getImageType ( ) , org.ovirt.engine.core.bll.GetImagesListQueryBase.getParameters ( ) . getForceRefresh ( ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( ) { org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainIdForQuery ( ) ; if ( Guid.Empty.equals ( storageDomainId ) ) { return new java.util.ArrayList < > ( ) ; } return org.ovirt.engine.core.bll.IsoDomainListSyncronizer.getInstance ( ) . getUserRequestForStorageDomainRepoFileList ( storageDomainId , org.ovirt.engine.core.bll.GetImagesListQueryBase.getParameters ( ) . getImageType ( ) , org.ovirt.engine.core.bll.GetImagesListQueryBase.getParameters ( ) . getForceRefresh ( ) ) ; }
Source:
private void analyzeHostedEngineVm ( ) { if ( ( ( ( dbVm ) != null ) && ( ( vdsmVm ) != null ) ) && ( ( dbVm.getOrigin ( ) ) == ( org.ovirt.engine.core.common.businessentities.OriginType.HOSTED_ENGINE ) ) ) { hostedEngineUnmanaged = true ; } }

Target:
protected void analyze ( ) { if ( ( vdsmVm ) == null ) { removeVmFromCache ( ) ; return ; } proceedDownVms ( ) ; proceedWatchdogEvents ( ) ; proceedBalloonCheck ( ) ; proceedGuaranteedMemoryCheck ( ) ; updateRepository ( ) ; prepareGuestAgentNetworkDevicesForUpdate ( ) ; updateLunDisks ( ) ; updateVmJobs ( ) ; analyzeExternalVms ( ) ; analyzeHostedEngineVm ( ) ; }
Source:
void bindInfrastructure ( ) { bindCommonInfrastructure ( org.ovirt.engine.ui.userportal.place.UserPortalPlaceManager.class ) ; bind ( org.ovirt.engine.ui.userportal.auth.LoggedInExtendedPlaceGatekeeper.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.auth.CurrentUserRole.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.system.ApplicationInit.class ) . asEagerSingleton ( ) ; bindTypeAndImplAsSingleton ( org.ovirt.engine.ui.uicommonweb.auth.CurrentUserRole.class , org.ovirt.engine.ui.userportal.auth.UserPortalCurrentUserRole.class ) ; }

Target:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.system.ClientStorageKeyPrefix.class ) . to ( org.ovirt.engine.ui.userportal.gin.SystemModule.CLIENT_STORAGE_KEY_PREFIX ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class , org.ovirt.engine.ui.userportal.ApplicationDynamicMessages.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public void OnRemove ( ) { org.ovirt.engine.core.common.businessentities.bookmarks selectedBookmark = ( ( org.ovirt.engine.core.common.businessentities.bookmarks ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.action.BookmarksParametersBase parameters = new org.ovirt.engine.core.common.action.BookmarksParametersBase ( selectedBookmark.getbookmark_id ( ) ) ; org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback async = new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { PostOnSave ( result.getReturnValue ( ) ) ; } } ; getWindow ( ) . StartProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveBookmark , parameters , async ) ; }

Target:
public void OnRemove ( ) { org.ovirt.engine.core.common.businessentities.Bookmark selectedBookmark = ( ( org.ovirt.engine.core.common.businessentities.Bookmark ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.action.BookmarksParametersBase parameters = new org.ovirt.engine.core.common.action.BookmarksParametersBase ( selectedBookmark.getbookmark_id ( ) ) ; org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback async = new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { PostOnSave ( result.getReturnValue ( ) ) ; } } ; getWindow ( ) . StartProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveBookmark , parameters , async ) ; }
Source:
private java.lang.String getPrintableDomainsList ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.vdscommands.storage_pool_iso_map map : getDomainsList ( ) ) { sb.append ( "{ domainId: " ) ; sb.append ( map.getstorage_id ( ) ) ; sb.append ( ", status: " ) ; sb.append ( map.getstatus ( ) . name ( ) ) ; sb.append ( " };" ) ; } return sb.toString ( ) ; }

Target:
private java.lang.String getPrintableDomainsList ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.vdscommands.StoragePoolIsoMap map : getDomainsList ( ) ) { sb.append ( "{ domainId: " ) ; sb.append ( map.getstorage_id ( ) ) ; sb.append ( ", status: " ) ; sb.append ( map.getstatus ( ) . name ( ) ) ; sb.append ( " };" ) ; } return sb.toString ( ) ; }
Source:
public void testNicLinks ( ) { org.ovirt.engine.api.model.Nic nic = new org.ovirt.engine.api.model.Nic ( ) ; nic.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.NIC_ID ) ; nic.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; nic.getVm ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( nic ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.NIC_HREF , nic.getHref ( ) ) ; }

Target:
public void testNicLinks ( ) { org.ovirt.engine.api.model.Nic nic = new org.ovirt.engine.api.model.Nic ( ) ; nic.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.NIC_ID ) ; nic.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; nic.getVm ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( nic ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.NIC_HREF , nic.getHref ( ) ) ; }
Source:
private void doLoad ( org.ovirt.engineextensions.aaa.misc.http.ExtMap input , org.ovirt.engineextensions.aaa.misc.http.ExtMap output ) throws java.lang.Exception { org.ovirt.engineextensions.aaa.misc.http.ExtMap context = input.< org.ovirt.engineextensions.aaa.misc.http.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; java.util.Properties configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , Config.PACKAGE_VERSION ) . mput ( Base.ContextKeys.EXTENSION_NOTES , java.lang.String.format ( "Display name: %s" , Config.PACKAGE_DISPLAY_NAME ) ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) . mput ( Base.ContextKeys.EXTENSION_NAME , "aaa.misc.http.authn" ) . mput ( Authn.ContextKeys.CAPABILITIES , ( ( Authn.Capabilities.AUTHENTICATE_NEGOTIATE_NON_INTERACTIVE ) | 0 ) ) ; java.lang.String artifactName = configuration.getProperty ( "config.artifact.name" , org.ovirt.engineextensions.aaa.misc.http.AuthnExtension.Artifact.PRINCIPAL.toString ( ) ) ; artifact = org.ovirt.engineextensions.aaa.misc.http.AuthnExtension.Artifact.valueOf ( artifactName ) ; if ( ( artifact ) == null ) { throw new java.lang.IllegalArgumentException ( ( "Unsupported artifact " + artifactName ) ) ; } artifactArg = configuration.getProperty ( "config.artifact.arg" ) ; }

Target:
private void doLoad ( org.ovirt.engineextensions.aaa.misc.http.ExtMap input , org.ovirt.engineextensions.aaa.misc.http.ExtMap output ) throws java.lang.Exception { org.ovirt.engineextensions.aaa.misc.http.ExtMap context = input.< org.ovirt.engineextensions.aaa.misc.http.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; java.util.Properties configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , Config.PACKAGE_VERSION ) . mput ( Base.ContextKeys.EXTENSION_NOTES , java.lang.String.format ( "Display name: %s" , Config.PACKAGE_DISPLAY_NAME ) ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) . mput ( Base.ContextKeys.EXTENSION_NAME , "aaa.misc.http.authn" ) . mput ( Authn.ContextKeys.CAPABILITIES , ( ( Authn.Capabilities.AUTHENTICATE_NEGOTIATE_NON_INTERACTIVE ) | 0 ) ) ; artifact = org.ovirt.engineextensions.aaa.misc.http.AuthnExtension.Artifact.valueOf ( configuration.getProperty ( "config.artifact.name" , org.ovirt.engineextensions.aaa.misc.http.AuthnExtension.Artifact.PRINCIPAL.toString ( ) ) ) ; artifactArg = configuration.getProperty ( "config.artifact.arg" ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { boolean bothIdentificationSet = ( nicId != null ) && ( nicName != null ) ; java.lang.String [ ] replacements = createIncoherentNicIdentificationErrorReplacements ( violatingEntityId , nicId , nicName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( nicNameAndNicIdIsIncoherent ( nicId , nicName ) ) ) ) ; }

Target:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > org.ovirt.engine.core.bll.ValidationResult validateCoherentIdentification ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName , org.ovirt.engine.core.common.errors.EngineMessage message , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { boolean bothIdentificationSet = ( referringId != null ) && ( referringName != null ) ; java.lang.String [ ] replacements = createIncoherentIdentificationErrorReplacements ( violatingEntityId , referringId , referringName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( isNameAndIdIncoherent ( referringId , referringName , map ) ) ) ) ; }
Source:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) throws java.lang.Exception { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.singleton ( bond.getId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( params , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > singletonList ( bond ) ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testInvalidNetworkAttachmentIpConfiguration ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = initValidator ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = validator.getAttachmentsToConfigure ( ) . iterator ( ) . next ( ) ; java.util.Collection < java.lang.String > replacements = createReplacement ( networkAttachment ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_MISSING_IP_CONFIGURATION ; initMockNetworkAttachmentIpConfigurationValidator ( engineMessage , replacements ) ; org.junit.Assert.assertThat ( validator.validNewOrModifiedNetworkAttachments ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , replacements ) ) ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
private void addVideoCardByDisplayType ( org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; struct.put ( VdsProperties.Type , VmDeviceType.VIDEO.getName ( ) ) ; struct.put ( VdsProperties.Device , displayType.getVmDeviceType ( ) . getName ( ) ) ; struct.put ( VdsProperties.SpecParams , org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.getNewMonitorSpecParams ( ) ) ; struct.put ( VdsProperties.DeviceId , java.lang.String.valueOf ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ) ; devices.add ( struct ) ; }

Target:
private void addVideoCardByDisplayType ( org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; struct.put ( VdsProperties.Type , VmDeviceGeneralType.VIDEO.getValue ( ) ) ; struct.put ( VdsProperties.Device , displayType.getVmDeviceType ( ) . getName ( ) ) ; struct.put ( VdsProperties.SpecParams , org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.getNewMonitorSpecParams ( ) ) ; struct.put ( VdsProperties.DeviceId , java.lang.String.valueOf ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ) ; devices.add ( struct ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3Cluster update ( org.ovirt.engine.api.v3.types.V3Cluster cluster ) { return adaptUpdate ( delegate :: update , cluster ) ; }

Target:
public org.ovirt.engine.api.v3.types.V3Cluster update ( org.ovirt.engine.api.v3.types.V3Cluster v3Cluster ) { org.ovirt.engine.api.model.Cluster v4Cluster = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Cluster ) ; org.ovirt.engine.api.v3.helpers.V3ClusterHelper.assignCompatiblePolicy ( v3Cluster , v4Cluster ) ; try { return org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( delegate.update ( v4Cluster ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }
Source:
protected void addStoragePermissionByQuotaMode ( java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permsList , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid StorageDomainId ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = null ; if ( storagePoolId != null ) { storagePool = org.ovirt.engine.core.bll.CommandBase.getStoragePoolDAO ( ) . get ( storagePoolId ) ; if ( storagePool != null ) { if ( ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) || ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT ) ) ) { permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( StorageDomainId , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; } } } }

Target:
protected final boolean failCanDoAction ( org.ovirt.engine.core.common.errors.VdcBllMessages message ) { addCanDoActionMessage ( message ) ; return false ; }
Source:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) , org.mockito.ArgumentMatchers.anyListOf ( java.lang.String.class ) ) ; initCommandMethods ( ) ; initDestSDs ( ) ; generateStorageToDisksMap ( ) ; cmd.init ( ) ; }

Target:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; initCommandMethods ( ) ; initDestSDs ( ) ; generateStorageToDisksMap ( ) ; cmd.init ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.Linq.sort ( storageDomains , new org.ovirt.engine.ui.uicommonweb.Linq.StorageDomainByNameComparer ( ) ) ; setStorageDomains ( storageDomains ) ; setItems ( model.value ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.Linq.sort ( storageDomains , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; setStorageDomains ( storageDomains ) ; setItems ( model.value ) ; }
Source:
private boolean isTaskStateError ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue ) { if ( ( ( vdsReturnValue != null ) && ( ( vdsReturnValue.getVdsError ( ) ) != null ) ) && ( ( vdsReturnValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.TaskStateError ) ) ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.infoFormat ( "SPMAsyncTask::ClearAsyncTask: At time of attempt to clear task '{0}' the response code was {1} and message was {2}. Task will not be cleaned" , getVdsmTaskId ( ) , vdsReturnValue.getVdsError ( ) . getCode ( ) , vdsReturnValue.getVdsError ( ) . getMessage ( ) ) ; return true ; } return false ; }

Target:
private boolean isTaskStateError ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue ) { if ( ( ( vdsReturnValue != null ) && ( ( vdsReturnValue.getVdsError ( ) ) != null ) ) && ( ( vdsReturnValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.TaskStateError ) ) ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.info ( ( "SPMAsyncTask::ClearAsyncTask: At time of attempt to clear task '{}' the response code" + " was '{}' and message was '{}'. Task will not be cleaned" ) , getVdsmTaskId ( ) , vdsReturnValue.getVdsError ( ) . getCode ( ) , vdsReturnValue.getVdsError ( ) . getMessage ( ) ) ; return true ; } return false ; }
Source:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }

Target:
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 ) ; }
Source:
private void calculateNetworkImplementationDetailsAndAssertSync ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectSync , boolean vmNet , int mtu , int vlanId , org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( vmNet , mtu , vlanId ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( network , qos , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectSync ? "in" : "out of" ) ) + " sync." ) , expectSync , networkImplementationDetails.isInSync ( ) ) ; }

Target:
private void calculateNetworkImplementationDetailsAndAssertSync ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectSync , boolean vmNet , int mtu , int vlanId , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( vmNet , mtu , vlanId ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( network , qos , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectSync ? "in" : "out of" ) ) + " sync." ) , expectSync , networkImplementationDetails.isInSync ( ) ) ; }
Source:
public void setUp ( ) { org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager pendingResourceManager = new org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager ( ) ; powerSavingCPUWeightPolicyUnit = new org.ovirt.engine.core.bll.scheduling.policyunits.PowerSavingCPUWeightPolicyUnit ( null , pendingResourceManager ) ; powerSavingMemoryWeightPolicyUnit = new org.ovirt.engine.core.bll.scheduling.policyunits.PowerSavingMemoryWeightPolicyUnit ( null , pendingResourceManager ) ; }

Target:
public void setUp ( ) { org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager pendingResourceManager = new org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager ( ) ; powerSavingCPUWeightPolicyUnit = new org.ovirt.engine.core.bll.scheduling.policyunits.PowerSavingCPUWeightPolicyUnit ( null , pendingResourceManager ) ; powerSavingMemoryWeightPolicyUnit = new org.ovirt.engine.core.bll.scheduling.policyunits.PowerSavingMemoryWeightPolicyUnit ( null , pendingResourceManager ) ; parameters.put ( PolicyUnitParameter.HIGH_UTILIZATION.getDbName ( ) , "80" ) ; parameters.put ( PolicyUnitParameter.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED.getDbName ( ) , "700" ) ; parameters.put ( PolicyUnitParameter.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED.getDbName ( ) , "900" ) ; }
Source:
public void testFaultyResize ( ) { org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( parameters.getDiskInfo ( ) ) ) . setSize ( ( ( parameters.getDiskInfo ( ) . getSize ( ) ) / 2 ) ) ; initializeCommand ( parameters ) ; org.junit.Assert.assertFalse ( command.validateCanResizeDisk ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "wrong failure" , command , EngineMessage.ACTION_TYPE_FAILED_REQUESTED_DISK_SIZE_IS_TOO_SMALL ) ; }

Target:
public void testFaultyResize ( ) { org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.ovirt.engine.core.common.action.VmDiskOperationParameterBase parameters = createParameters ( ) ; ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( parameters.getDiskInfo ( ) ) ) . setSize ( ( ( parameters.getDiskInfo ( ) . getSize ( ) ) / 2 ) ) ; initializeCommand ( parameters ) ; org.junit.Assert.assertFalse ( command.validateCanResizeDisk ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "wrong failure" , command , EngineMessage.ACTION_TYPE_FAILED_REQUESTED_DISK_SIZE_IS_TOO_SMALL ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }
Source:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasGlusterVolumes ( ) ; canDoActionFailedWithReason ( EngineMessage.VDS_GROUP_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }

Target:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasGlusterVolumes ( ) ; validateFailedWithReason ( EngineMessage.VDS_GROUP_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }
Source:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }
Source:
static void checkSeverities ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.mSeverities.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.mSeverities.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warnFormat ( "AuditLogType: {0} not have severity. Assumed Normal" , value.toString ( ) ) ; } } } }

Target:
static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.infoFormat ( "AuditLogType: {0} not exist in string table" , value.toString ( ) ) ; } } } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.network.host.LabelNicCommand.getBackend ( ) . runInternalAction ( VdcActionType.PersistentSetupNetworks , new AddNetworksByLabelParametersBuilder ( ) . buildParameters ( getNic ( ) , getLabel ( ) , getClusterNetworksByLabel ( ) ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.network.host.LabelNicCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; } else { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.network.host.LabelNicCommand.getBackend ( ) . runInternalAction ( VdcActionType.PersistentSetupNetworks , new org.ovirt.engine.core.bll.network.AddNetworksByLabelParametersBuilder ( ) . buildParameters ( getNic ( ) , getLabel ( ) , getClusterNetworksByLabel ( ) ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.network.host.LabelNicCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; } else { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }
Source:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getGuestLastLoginTime ( ) ) != null ) && ( ( ( getGuestLastLogoutTime ( ) ) == null ) || ( ( getGuestLastLoginTime ( ) . compareTo ( getGuestLastLogoutTime ( ) ) ) > 0 ) ) ) { setGuestLastLogoutTime ( new java.util.Date ( ) ) ; } }

Target:
public org.ovirt.engine.core.common.businessentities.GuestAgentStatus getGuestAgentStatus ( ) { return vmDynamic.getGuestAgentStatus ( ) ; }