auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.Object answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { org.ovirt.engine.core.compat.Guid poolId = ( ( org.ovirt.engine.core.compat.Guid ) ( invocation.getArguments ( ) [ 0 ] ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > toReturn = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo > , org.ovirt.engine.core.common.businessentities.StorageDomain > pair : poolDomainsOvfInfo.values ( ) ) { toReturn.add ( pair.getSecond ( ) ) ; } return toReturn ; }

Target:
public java.lang.Object answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > toReturn = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo > , org.ovirt.engine.core.common.businessentities.StorageDomain > pair : poolDomainsOvfInfo.values ( ) ) { toReturn.add ( pair.getSecond ( ) ) ; } return toReturn ; }
Source:
protected boolean validateInputs ( ) { java.util.List < java.lang.String > messages = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( getValidationGroups ( ) , getParameters ( ) ) ; if ( ! ( messages.isEmpty ( ) ) ) { getReturnValue ( ) . getCanDoActionMessages ( ) . addAll ( messages ) ; return false ; } return true ; }

Target:
protected boolean validateInputs ( ) { return validate ( getParameters ( ) ) ; }
Source:
public void validateFailure ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_NOT_EXIST ) ; }

Target:
public void validateFailure ( ) { org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_NOT_EXIST ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenstackVolumeAuthenticationKey authenticationKey ) { validateParameters ( authenticationKey , "uuid" , "value" , "usageType" ) ; validateEnums ( org.ovirt.engine.api.model.OpenstackVolumeAuthenticationKey.class , authenticationKey ) ; return performCreate ( VdcActionType.AddLibvirtSecret , new org.ovirt.engine.core.common.action.LibvirtSecretParameters ( map ( addProvider ( authenticationKey ) ) ) , new org.ovirt.engine.api.restapi.resource.openstack.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLibvirtSecretById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenstackVolumeAuthenticationKey authenticationKey ) { validateParameters ( authenticationKey , "uuid" , "value" , "usageType" ) ; return performCreate ( VdcActionType.AddLibvirtSecret , new org.ovirt.engine.core.common.action.LibvirtSecretParameters ( map ( addProvider ( authenticationKey ) ) ) , new org.ovirt.engine.api.restapi.resource.openstack.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLibvirtSecretById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
private void initStoragePool ( ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; storagePool.setcompatibility_version ( Version.v3_1 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }

Target:
private void initStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setcompatibility_version ( Version.v3_1 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( command.getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; }
Source:
protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { super . setVmId ( parameters.getContainerId ( ) ) ; if ( ( ( getDiskImage ( ) ) != null ) && ( ( getDiskImage ( ) . getstorage_pool_id ( ) ) != null ) ) { setStoragePoolId ( getDiskImage ( ) . getstorage_pool_id ( ) . getValue ( ) ) ; } }

Target:
protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { super . setVmId ( parameters.getContainerId ( ) ) ; if ( ( ( getDiskImage ( ) ) != null ) && ( ( getDiskImage ( ) . getStoragePoolId ( ) ) != null ) ) { setStoragePoolId ( getDiskImage ( ) . getStoragePoolId ( ) . getValue ( ) ) ; } }
Source:
protected void setStorageDomainStatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , org.ovirt.engine.core.bll.context.CompensationContext context ) { if ( ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStoragePoolId ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ; if ( context != null ) { context.snapshotEntityStatus ( map ) ; } org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . setStatus ( status ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , status ) ; } }

Target:
protected void setStorageDomainStatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , org.ovirt.engine.core.bll.context.CompensationContext context ) { if ( ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStoragePoolId ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ; if ( context != null ) { context.snapshotEntityStatus ( map ) ; } org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . setStatus ( status ) ; org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , status ) ; } }
Source:
public void getUnknownImageList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean forceRefresh ) { getIrsImageList ( aQuery , storagePoolId , forceRefresh , ImageFileType.All , new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.RepoImageToImageFileNameAsyncConverter ( ) { @ java.lang.Override protected java.lang.String transform ( java.util.ArrayList < java.lang.String > fileNameList , org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ISO_PREFIX ) + ( super . transform ( fileNameList , repoImage ) ) ; } @ java.lang.Override protected boolean desiredImage ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return ( org.ovirt.engine.core.common.businessentities.storage.ImageFileType.Unknown ) == ( repoImage.getFileType ( ) ) ; } } ) ; }

Target:
public void getUnknownImageList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < java.lang.String > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean forceRefresh ) { getIrsImageList ( aQuery , storagePoolId , forceRefresh , ImageFileType.All , new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.RepoImageToImageFileNameAsyncConverter ( ) { @ java.lang.Override protected java.lang.String transform ( java.util.ArrayList < java.lang.String > fileNameList , org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ISO_PREFIX ) + ( super . transform ( fileNameList , repoImage ) ) ; } @ java.lang.Override protected boolean desiredImage ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { return ( org.ovirt.engine.core.common.businessentities.storage.ImageFileType.Unknown ) == ( repoImage.getFileType ( ) ) ; } } ) ; }
Source:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
public static void GetProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public static void GetProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
public void testZeroLatency ( ) { java.lang.String doubleValue = "0" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) ) ; org.junit.Assert.assertEquals ( vmDynamic.getDisks ( ) . get ( 0 ) . getWriteLatency ( ) , new java.lang.Double ( "0" ) ) ; }

Target:
public void testZeroLatency ( ) { java.lang.String doubleValue = "0" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) ) ; org.junit.Assert.assertEquals ( new java.lang.Double ( "0" ) , vmDynamic.getDisks ( ) . get ( 0 ) . getWriteLatency ( ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.UpgradeHostValidator validator = new org.ovirt.engine.core.bll.validator.UpgradeHostValidator ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getVds ( ) ) ; return ( ( ( validate ( validator.hostExists ( ) ) ) && ( validate ( validator.statusSupportedForHostUpgrade ( ) ) ) ) && ( validate ( validator.updatesAvailable ( ) ) ) ) && ( validate ( validator.imageProvidedForOvirtNode ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getParameters ( ) . getoVirtIsoFile ( ) ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.UpgradeHostValidator validator = new org.ovirt.engine.core.bll.validator.UpgradeHostValidator ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getVds ( ) ) ; return ( ( ( validate ( validator.hostExists ( ) ) ) && ( validate ( validator.statusSupportedForHostUpgrade ( ) ) ) ) && ( validate ( validator.updatesAvailable ( ) ) ) ) && ( validate ( validator.imageProvidedForOvirtNode ( org.ovirt.engine.core.bll.hostdeploy.UpgradeHostCommand.getParameters ( ) . getoVirtIsoFile ( ) ) ) ) ; }
Source:
public boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk = getCinderDisk ( ) ; cinderDisk.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.storage.disk.cinder.RegisterCinderDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; org.ovirt.engine.core.bll.validator.storage.CinderDisksValidator cinderDiskValidator = getCinderDisksValidator ( cinderDisk ) ; return validate ( cinderDiskValidator.validateCinderDisksAlreadyRegistered ( ) ) ; }

Target:
public boolean validate ( ) { org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk = getCinderDisk ( ) ; cinderDisk.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.storage.disk.cinder.RegisterCinderDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; org.ovirt.engine.core.bll.validator.storage.CinderDisksValidator cinderDiskValidator = getCinderDisksValidator ( cinderDisk ) ; return validate ( cinderDiskValidator.validateCinderDisksAlreadyRegistered ( ) ) ; }
Source:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateInterfaceListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateStorageListModel ( ) ) ; addCustomModelsDetailModelList ( list ) ; setDetailModels ( list ) ; }

Target:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateInterfaceListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateStorageListModel ( ) ) ; addCustomModelsDetailModelList ( list ) ; setDetailModels ( list ) ; }
Source:
private void WatchdogModel_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "" . equals ( getWatchdogModel ( ) . getEntity ( ) ) ) { getWatchdogAction ( ) . setIsChangable ( false ) ; getWatchdogAction ( ) . setSelectedItem ( "" ) ; } else { getWatchdogAction ( ) . setIsChangable ( true ) ; } }

Target:
private void WatchdogModel_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getWatchdogModel ( ) . getEntity ( ) ) == null ) { getWatchdogAction ( ) . setIsChangable ( false ) ; getWatchdogAction ( ) . setSelectedItem ( null ) ; } else { getWatchdogAction ( ) . setIsChangable ( true ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setId ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
public boolean match ( org.ovirt.engine.core.common.businessentities.DbUser source ) { return ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( source.getDomain ( ) , target.getDomain ( ) ) ) && ( ( ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( target.getLoginName ( ) ) ) || ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( target.getLoginName ( ) , "*" ) ) ) || ( source.getLoginName ( ) . toLowerCase ( ) . startsWith ( target.getLoginName ( ) ) ) ) ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.DbUser source ) { return ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( source.getDomain ( ) , target.getDomain ( ) ) ) && ( ( ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( target.getLoginName ( ) ) ) || ( "*" . equals ( target.getLoginName ( ) ) ) ) || ( source.getLoginName ( ) . toLowerCase ( ) . startsWith ( target.getLoginName ( ) ) ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setId ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , iface.getMtu ( ) , iface.getVlanId ( ) , createQos ( ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , ( ! ( iface.isBridged ( ) ) ) , iface.getMtu ( ) , iface.getVlanId ( ) , createQos ( ) ) ; }
Source:
protected void EndWithFailure ( ) { org.ovirt.engine.core.bll.ExportVmCommand.EndActionOnAllImageGroups ( ) ; if ( ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ExportVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "ExportVmCommand::EndMoveVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }

Target:
protected void EndWithFailure ( ) { org.ovirt.engine.core.bll.ExportVmCommand.EndActionOnAllImageGroups ( ) ; if ( ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ExportVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "ExportVmCommand::EndMoveVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }
Source:
public void testIllegalImageReturnedByQuery ( ) throws java.lang.Exception { existingVm.getDiskMap ( ) . put ( existingDiskImage.getId ( ) , existingDiskImage ) ; existingVm.getImages ( ) . add ( existingDiskImage ) ; snapshotVmConfigurationHelper.markImagesIllegalIfNotInDb ( existingVm , existingSnapshotId ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk diskImage : existingVm.getDiskMap ( ) . values ( ) ) { org.junit.Assert.assertEquals ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( diskImage ) ) . getImageStatus ( ) , ImageStatus.ILLEGAL ) ; } }

Target:
public void testIllegalImageReturnedByQuery ( ) throws java.lang.Exception { existingVm.getDiskMap ( ) . put ( existingDiskImage.getId ( ) , existingDiskImage ) ; existingVm.getImages ( ) . add ( existingDiskImage ) ; snapshotVmConfigurationHelper.markImagesIllegalIfNotInDb ( existingVm , existingSnapshotId ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk diskImage : existingVm.getDiskMap ( ) . values ( ) ) { org.junit.Assert.assertEquals ( ImageStatus.ILLEGAL , ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( diskImage ) ) . getImageStatus ( ) ) ; } }
Source:
public void testStorageDomainLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; storageDomain.setStorage ( new org.ovirt.engine.api.model.HostStorage ( ) ) ; storageDomain.getStorage ( ) . setPath ( "foo" ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , storageDomain ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , storageDomain.getHref ( ) ) ; assertNull ( storageDomain.getStorage ( ) . getHref ( ) ) ; }

Target:
public void testStorageDomainLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; storageDomain.setStorage ( new org.ovirt.engine.api.model.HostStorage ( ) ) ; storageDomain.getStorage ( ) . setPath ( "foo" ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( storageDomain ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , storageDomain.getHref ( ) ) ; assertNull ( storageDomain.getStorage ( ) . getHref ( ) ) ; }
Source:
protected R addLinks ( R model , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParent , java.lang.String ... subCollectionMembersToExclude ) { model = addParents ( model ) ; model = org.ovirt.engine.api.common.util.LinkHelper.addLinks ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource.getUriInfo ( ) , model , suggestedParent ) ; model = linkSubCollections ( model , suggestedParent , subCollectionMembersToExclude ) ; return model ; }

Target:
protected R addLinks ( R model , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParent , java.lang.String ... subCollectionMembersToExclude ) { model = addParents ( model ) ; model = linkSubCollections ( model , suggestedParent , subCollectionMembersToExclude ) ; model = org.ovirt.engine.api.common.util.LinkHelper.addLinks ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource.getUriInfo ( ) , model , suggestedParent ) ; return model ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Cluster cluster ) { validateParameters ( cluster , "name" , "dataCenter.name|id" ) ; validateEnums ( org.ovirt.engine.api.model.Cluster.class , cluster ) ; org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.getStoragePool ( cluster , this ) ; org.ovirt.engine.core.common.businessentities.VDSGroup entity = map ( cluster , map ( pool ) ) ; return performCreate ( VdcActionType.AddVdsGroup , new org.ovirt.engine.core.common.action.VdsGroupOperationParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Cluster cluster ) { validateParameters ( cluster , "name" , "dataCenter.name|id" ) ; validateEnums ( org.ovirt.engine.api.model.Cluster.class , cluster ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.getStoragePool ( cluster , this ) ; org.ovirt.engine.core.common.businessentities.VDSGroup entity = map ( cluster , map ( pool ) ) ; return performCreate ( VdcActionType.AddVdsGroup , new org.ovirt.engine.core.common.action.VdsGroupOperationParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters.class ) ) ; }
Source:
public void getVdsSwallowsException ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }

Target:
public void getVdsSwallowsException ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; b.setVds ( vds ) ; b.setVdsId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }
Source:
public void addFunction ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { usedFunctions.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.scheduling.PolicyUnit , java.lang.Integer > ( policyUnit , 1 ) ) ; for ( int i = 0 ; i < ( unusedFunctions.size ( ) ) ; i ++ ) { if ( unusedFunctions.get ( i ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { unusedFunctions.remove ( policyUnit ) ; break ; } } refreshCustomProperties ( null ) ; getFunctionsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void addFunction ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { usedFunctions.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.scheduling.PolicyUnit , java.lang.Integer > ( policyUnit , 1 ) ) ; for ( int i = 0 ; i < ( unusedFunctions.size ( ) ) ; i ++ ) { if ( unusedFunctions.get ( i ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { unusedFunctions.remove ( policyUnit ) ; break ; } } refreshCustomProperties ( null , false ) ; getFunctionsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; }
Source:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( networkDeviceHelper.getFreeVf ( nic , null ) ) ) ; }

Target:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( networkDeviceHelper.getFreeVf ( nic , null ) ) ) ; }
Source:
private boolean containsDeviceWithType ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType generalType , org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( device.getType ( ) ) == generalType ) { if ( ( deviceType == null ) || ( deviceType.equals ( device.getDevice ( ) ) ) ) { return true ; } } } return false ; }

Target:
private boolean containsDeviceWithType ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType generalType , org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( device.getType ( ) ) == generalType ) { if ( ( deviceType == null ) || ( ( ( deviceType.getName ( ) ) != null ) && ( deviceType.getName ( ) . equals ( device.getDevice ( ) ) ) ) ) { return true ; } } } return false ; }
Source:
private double calcDistributeMetric ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VM vm , int hostCores ) { int vcpu = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VcpuConsumptionPercentage ) ; int spmCpu = ( ( vds.getSpmStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) ? 0 : org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SpmVCpuConsumption ) ; double hostCpu = vds.getUsageCpuPercent ( ) ; double pendingVcpus = vds.getPendingVcpusCount ( ) ; return ( hostCpu / vcpu ) + ( ( ( pendingVcpus + ( vm.getNumOfCpus ( ) ) ) + spmCpu ) / hostCores ) ; }

Target:
private double calcDistributeMetric ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VM vm , int hostCores ) { int vcpu = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VcpuConsumptionPercentage ) ; int spmCpu = ( ( vds.getSpmStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) ? 0 : org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SpmVCpuConsumption ) ; double hostCpu = vds.getUsageCpuPercent ( ) ; double pendingVcpus = vds.getPendingVcpusCount ( ) ; return ( hostCpu / vcpu ) + ( ( ( pendingVcpus + ( vm.getNumOfCpus ( ) ) ) + spmCpu ) / hostCores ) ; }
Source:
public boolean disconnectStorageFromDomainByVdsId ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.common.businessentities.Provider provider = getProviderDao ( ) . get ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( storageDomain.getStorage ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = getLibvirtSecretDao ( ) . getAllByProviderId ( provider.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = getVdsDao ( ) . get ( vdsId ) ; return org.ovirt.engine.core.bll.storage.connection.CINDERStorageHelper.unregisterLibvirtSecrets ( storageDomain , vds , libvirtSecrets ) ; }

Target:
public boolean disconnectStorageFromDomainByVdsId ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.common.businessentities.Provider provider = getProviderDao ( ) . get ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( storageDomain.getStorage ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = getLibvirtSecretDao ( ) . getAllByProviderId ( provider.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = getVdsDao ( ) . get ( vdsId ) ; return unregisterLibvirtSecrets ( storageDomain , vds , libvirtSecrets ) ; }
Source:
public void validateVmInPreview ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage_domains sp ) { setEnumTitle ( sp.getstorage_domain_shared_status ( ) ) ; switch ( sp.getstorage_domain_shared_status ( ) ) { case Unattached : return getApplicationResources ( ) . tornChainImage ( ) ; case Active : return getApplicationResources ( ) . upImage ( ) ; case InActive : return getApplicationResources ( ) . downImage ( ) ; case Mixed : return getApplicationResources ( ) . upalertImage ( ) ; case Locked : return getApplicationResources ( ) . lockImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain sp ) { setEnumTitle ( sp.getstorage_domain_shared_status ( ) ) ; switch ( sp.getstorage_domain_shared_status ( ) ) { case Unattached : return getApplicationResources ( ) . tornChainImage ( ) ; case Active : return getApplicationResources ( ) . upImage ( ) ; case InActive : return getApplicationResources ( ) . downImage ( ) ; case Mixed : return getApplicationResources ( ) . upalertImage ( ) ; case Locked : return getApplicationResources ( ) . lockImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; domainEditor.setLabel ( constants.loginFormDomainLabel ( ) ) ; loginButton.setText ( constants.loginButtonLabel ( ) ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; domainEditor.setLabel ( constants.loginFormDomainLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel ) ( sender ) ) ; if ( "Bricks" . equals ( ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ) ) { bricksCountEditor.setText ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . noOfBricksSelected ( model.getBricks ( ) . getSelectedItems ( ) . size ( ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel ) ( sender ) ) ; if ( "Bricks" . equals ( ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ) ) { bricksCountEditor.setText ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . noOfBricksSelected ( ( ( model.getBricks ( ) . getSelectedItems ( ) ) == null ? 0 : model.getBricks ( ) . getSelectedItems ( ) . size ( ) ) ) ) ; } }
Source:
private void mockBackend ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase addClusterReturnValue = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.action.VdcReturnValueBase.class ) ; org.mockito.Mockito.when ( addClusterReturnValue.getSucceeded ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( backend.runAction ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionType.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.CpuProfileParameters.class ) ) ) . thenReturn ( addClusterReturnValue ) ; }

Target:
private void mockBackend ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase addClusterReturnValue = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.action.VdcReturnValueBase.class ) ; org.mockito.Mockito.when ( backend.runAction ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionType.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.CpuProfileParameters.class ) ) ) . thenReturn ( addClusterReturnValue ) ; }
Source:
public void validateFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }

Target:
public void validateFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( null ) , null ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
public void executeCommandWhenServerIdPresent ( ) { setUpMocksForUpdate ( ) ; mockForReadContent ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_UPDATED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenServerIdPresent ( ) { setUpMocksForUpdate ( ) ; mockForReadContent ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_UPDATED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; java.util.List < org.ovirt.engine.api.model.Permission > perms = setUpPermissions ( ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , perms , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; java.util.List < org.ovirt.engine.api.model.Permission > perms = setUpPermissions ( ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , perms , failure ) ; }
Source:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( target ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue response = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( response.getSucceeded ( ) ) { model.applyData ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( response.getReturnValue ( ) ) ) , false ) ; model.setGetLUNsFailure ( "" ) ; } else { model.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue response = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( response.getSucceeded ( ) ) { model.applyData ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( response.getReturnValue ( ) ) ) , false ) ; model.setGetLUNsFailure ( "" ) ; } else { model.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }
Source:
public void setup ( ) { storagePool = new org.ovirt.engine.core.common.businessentities.storage_pool ( "test" , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , "test" , StorageType.UNKNOWN.getValue ( ) , StoragePoolStatus.Up.getValue ( ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( storagePool , new java.util.ArrayList < java.lang.String > ( ) ) ) ; }

Target:
public void setup ( ) { storagePool = new org.ovirt.engine.core.common.businessentities.storage_pool ( "test" , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , "test" , StorageType.UNKNOWN.getValue ( ) , StoragePoolStatus.Up.getValue ( ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( storagePool ) ) ; }