auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.NGuid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.vm_pool_map > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( poolId , VMStatus.Up ) ; int prestartedVmsInPool = 0 ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.vm_pool_map map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { prestartedVmsInPool ++ ; } } } return prestartedVmsInPool ; }

Target:
protected static int getNumOfPrestartedVmsInPool ( org.ovirt.engine.core.compat.NGuid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( poolId , VMStatus.Up ) ; int prestartedVmsInPool = 0 ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { prestartedVmsInPool ++ ; } } } return prestartedVmsInPool ; }
Source:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) , 0 ) ; }
Source:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v4_0 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( "VirtIO" ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v3_6 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( "VirtIO" ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }
Source:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
private void updateDisplayProtocols ( ) { boolean isVncSelected = ( vm.getDefaultDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.vga ) ; getDisplayConsole_Vnc_IsSelected ( ) . setEntity ( isVncSelected ) ; getDisplayConsole_Spice_IsSelected ( ) . setEntity ( ( ! isVncSelected ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean selectVnc = false ; java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( ( ( graphicsDevices.size ( ) ) == 1 ) && ( ( graphicsDevices.get ( 0 ) . getGraphicsType ( ) ) == ( org.ovirt.engine.core.common.businessentities.GraphicsType.VNC ) ) ) { selectVnc = true ; } getDisplayConsole_Vnc_IsSelected ( ) . setEntity ( selectVnc ) ; getDisplayConsole_Spice_IsSelected ( ) . setEntity ( ( ! selectVnc ) ) ; }
Source:
public boolean isProxyHostAvailable ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.FenceProxyLocator proxyHostLocator = new org.ovirt.engine.core.bll.FenceProxyLocator ( vds ) ; if ( ! ( proxyHostLocator.isProxyHostAvailable ( ) ) ) { messages.add ( VdcBllMessages.VDS_NO_VDS_PROXY_FOUND.name ( ) ) ; return false ; } else { return true ; } }

Target:
public boolean isProxyHostAvailable ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.FenceProxyLocator proxyHostLocator = getProxyLocator ( vds ) ; if ( ! ( proxyHostLocator.isProxyHostAvailable ( ) ) ) { messages.add ( VdcBllMessages.VDS_NO_VDS_PROXY_FOUND.name ( ) ) ; return false ; } else { return true ; } }
Source:
public void testIsNetworkInSyncWhenGatewayDifferent ( ) { initIpConfigurationBootProtocolGateway ( NetworkBootProtocol.STATIC_IP , false ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4GatewayBothBlank ( ) { java.util.List < java.lang.String > blankValues = java.util.Arrays.asList ( null , "" ) ; initIpv4ConfigurationStaticBootProtocol ( Ipv4BootProtocol.STATIC_IP ) ; int blankIndex = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 2 ) ; ipv4Address.setGateway ( blankValues.get ( blankIndex ) ) ; iface.setIpv4Gateway ( blankValues.get ( ( blankIndex ^ 1 ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public static org.ovirt.engine.core.compat.backendcompat.PropertyInfo GetProperty ( java.lang.Class < ? > type , java.lang.String idField ) { try { java.beans.PropertyDescriptor [ ] pds = java.beans.Introspector.getBeanInfo ( type ) . getPropertyDescriptors ( ) ; for ( java.beans.PropertyDescriptor pd : pds ) { if ( pd.getName ( ) . equalsIgnoreCase ( idField ) ) { return new org.ovirt.engine.core.compat.backendcompat.PropertyInfo ( pd ) ; } } } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.core.compat.CompatException ( e ) ; } return null ; }

Target:
public static org.ovirt.engine.core.compat.backendcompat.PropertyInfo GetProperty ( java.lang.Class < ? > type , java.lang.String idField ) { try { java.beans.PropertyDescriptor [ ] pds = java.beans.Introspector.getBeanInfo ( type ) . getPropertyDescriptors ( ) ; for ( java.beans.PropertyDescriptor pd : pds ) { if ( pd.getName ( ) . equalsIgnoreCase ( idField ) ) { return new org.ovirt.engine.core.compat.backendcompat.PropertyInfo ( pd ) ; } } } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } return null ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenStackVolumeProvider provider ) { validateParameters ( provider , "name" ) ; if ( provider.isSetDataCenter ( ) ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = getStoragePool ( provider.getDataCenter ( ) ) ; provider.setDataCenter ( org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ) ; } return performCreate ( ActionType.AddProvider , new org.ovirt.engine.core.common.action.ProviderParameters ( map ( provider ) ) , new org.ovirt.engine.api.restapi.resource.openstack.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenStackVolumeProvider provider ) { validateParameters ( provider , "name" ) ; if ( provider.isSetDataCenter ( ) ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = getStoragePool ( provider.getDataCenter ( ) ) ; provider.setDataCenter ( org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ) ; } return performCreate ( ActionType.AddProvider , new org.ovirt.engine.core.common.action.ProviderParameters ( map ( provider ) ) , new org.ovirt.engine.api.restapi.resource.openstack.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
protected boolean validateVmNetwork ( ) { boolean retVal = true ; if ( ! ( org.ovirt.engine.core.bll.storage.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) { org.ovirt.engine.core.compat.Version version = org.ovirt.engine.core.bll.storage.NetworkCommon.getStoragePoolDAO ( ) . get ( org.ovirt.engine.core.bll.storage.NetworkCommon.getParameters ( ) . getStoragePoolId ( ) ) . getcompatibility_version ( ) ; retVal = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , version.getValue ( ) ) ; if ( ! retVal ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; } } return retVal ; }

Target:
protected boolean validateMTUOverrideSupport ( ) { boolean mtuSupported = true ; if ( ( org.ovirt.engine.core.bll.storage.NetworkCommon.getParameters ( ) . getNetwork ( ) . getMtu ( ) ) != 0 ) { mtuSupported = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.MTUOverrideSupported , org.ovirt.engine.core.bll.storage.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) . getValue ( ) ) ; if ( ! mtuSupported ) { addCanDoActionMessage ( VdcBllMessages.NETWORK_MTU_OVERRIDE_NOT_SUPPORTED ) ; } } return mtuSupported ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmParameters parameters = new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic ) ; parameters.setDiskInfoList ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) ) ; parameters.setStorageDomainId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return runInternalActionWithTasksContext ( VdcActionType.AddVmFromScratch , parameters ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmParameters parameters = new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic ) ; parameters.setDiskInfoList ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) ) ; parameters.setStorageDomainId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; parameters.setDiskOperatorAuthzPrincipalDbId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskOperatorAuthzPrincipalDbId ( ) ) ; return runInternalActionWithTasksContext ( VdcActionType.AddVmFromScratch , parameters ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.bll.tasks.SPMAsyncTaskHandler > initTaskHandlers ( ) { return java.util.Arrays.< org.ovirt.engine.core.bll.tasks.SPMAsyncTaskHandler > asList ( new org.ovirt.engine.core.bll.storage.lsm.CreateImagePlaceholderTaskHandler ( this ) , new org.ovirt.engine.core.bll.storage.lsm.VmReplicateDiskStartTaskHandler ( this ) , new org.ovirt.engine.core.bll.storage.lsm.VmReplicateDiskFinishTaskHandler ( this ) ) ; }

Target:
protected void endWithFailure ( ) { if ( isConsiderSuccessful ( ) ) { auditLog ( this , AuditLogType.USER_MOVE_IMAGE_GROUP_FAILED_TO_DELETE_SRC_IMAGE ) ; this . endSuccessfully ( ) ; return ; } super . endWithFailure ( ) ; handleDestDisk ( ) ; unlockDisk ( ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.setSucceeded ( true ) ; }
Source:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected boolean isSoundDeviceEnabled ( ) { java.lang.Boolean soundDeviceEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) ; return soundDeviceEnabled != null ? soundDeviceEnabled : osRepository.isSoundDeviceEnabled ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) ) ; }

Target:
protected boolean isBalloonEnabled ( ) { java.lang.Boolean balloonEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isBalloonEnabled ( ) ; return balloonEnabled != null ? balloonEnabled : osRepository.isBalloonEnabled ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; }
Source:
public void rollbackQuota ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { rollbackQuota ( vm.getstorage_pool_id ( ) , java.util.Arrays.asList ( vm.getQuotaId ( ) ) ) ; } }

Target:
public void rollbackQuotaByVmId ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { rollbackQuota ( vm.getstorage_pool_id ( ) , java.util.Arrays.asList ( vm.getQuotaId ( ) ) ) ; } }
Source:
private java.lang.String getInnerQuery ( java.lang.String tableName , java.lang.String primeryKey , java.lang.String fromStatement , java.lang.StringBuilder wherePhrase , java.lang.StringBuilder sortExpr ) { if ( ( sortExpr.indexOf ( "(" ) ) > 0 ) { return org.ovirt.engine.core.compat.StringFormat.format ( "SELECT %1$s.%2$s FROM %3$s %4$s" , tableName , primeryKey , fromStatement , wherePhrase ) ; } else { return org.ovirt.engine.core.compat.StringFormat.format ( "SELECT distinct %1$s.%2$s FROM %3$s %4$s" , tableName , primeryKey , fromStatement , wherePhrase ) ; } }

Target:
private java.lang.String getInnerQuery ( java.lang.String tableName , java.lang.String primeryKey , java.lang.String fromStatement , java.lang.StringBuilder wherePhrase , java.lang.StringBuilder sortExpr , boolean useDistinct ) { if ( ( sortExpr.indexOf ( "(" ) ) > 0 ) { return org.ovirt.engine.core.compat.StringFormat.format ( "SELECT %1$s.%2$s FROM %3$s %4$s" , tableName , primeryKey , fromStatement , wherePhrase ) ; } else { return org.ovirt.engine.core.compat.StringFormat.format ( "SELECT %5$s %1$s.%2$s FROM %3$s %4$s" , tableName , primeryKey , fromStatement , wherePhrase , ( useDistinct ? "distinct" : "" ) ) ; } }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getEditConsoleCommand ( ) ) ) { editConsole ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnEditConsoleSave" ) ) { onEditConsoleSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getEditConsoleCommand ( ) ) ) { editConsole ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnEditConsoleSave" ) ) { onEditConsoleSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , Model.CANCEL_COMMAND ) ) { cancel ( ) ; } }
Source:
protected void startPollingAsyncTasks ( java.util.Collection < org.ovirt.engine.core.compat.Guid > taskIds ) { for ( org.ovirt.engine.core.compat.Guid taskID : taskIds ) { getAsyncTaskManager ( ) . startPollingTask ( taskID ) ; } }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }
Source:
public void getSearchResultsLimit ( 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 ) ) : 100 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SearchResultsLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > > aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void executionFailure ( ) { try { command.executeVmCommand ( ) ; } catch ( java.lang.Exception expected ) { } org.junit.Assert.assertFalse ( command.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.NETWORK_REMOVE_NIC_FILTER_PARAMETER_FAILED , command.getAuditLogTypeValue ( ) ) ; }

Target:
public void executionFailure ( ) { try { command.executeVmCommand ( ) ; } catch ( java.lang.Exception expected ) { } org.junit.jupiter.api.Assertions.assertFalse ( command.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( AuditLogType.NETWORK_REMOVE_NIC_FILTER_PARAMETER_FAILED , command.getAuditLogTypeValue ( ) ) ; }
Source:
public org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity entity = new org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity ( ) ; entity.setEntityId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "entity_id" ) ) ) ; entity.setEntityType ( org.ovirt.engine.core.common.VdcObjectType.valueOf ( rs.getString ( "entity_type" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity entity = new org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity ( ) ; entity.setEntityId ( getGuidDefaultEmpty ( rs , "entity_id" ) ) ; entity.setEntityType ( org.ovirt.engine.core.common.VdcObjectType.valueOf ( rs.getString ( "entity_type" ) ) ) ; return entity ; }
Source:
protected org.ovirt.engine.api.model.Disk getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DiskImage entity = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setvolume_format ( VolumeFormat.RAW ) ; entity.setDiskInterface ( DiskInterface.VirtIO ) ; entity.setimageStatus ( ImageStatus.OK ) ; entity.setvolume_type ( VolumeType.Sparse ) ; entity.setBoot ( false ) ; entity.setShareable ( false ) ; entity.setPropagateErrors ( PropagateErrors.On ) ; return org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.setUpStatisticalEntityExpectations ( entity ) ; }

Target:
protected org.ovirt.engine.api.model.Disk getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DiskImage entity = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setvolume_format ( VolumeFormat.RAW ) ; entity.setDiskInterface ( DiskInterface.VirtIO ) ; entity.setImageStatus ( ImageStatus.OK ) ; entity.setvolume_type ( VolumeType.Sparse ) ; entity.setBoot ( false ) ; entity.setShareable ( false ) ; entity.setPropagateErrors ( PropagateErrors.On ) ; return org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.setUpStatisticalEntityExpectations ( entity ) ; }
Source:
public static java.util.Locale getLocaleFromString ( java.lang.String localeString , boolean returnDefaultLocale ) { java.util.Locale result = ( returnDefaultLocale ) ? null : java.util.Locale.US ; try { result = org.apache.commons.lang.LocaleUtils.toLocale ( ( localeString != null ? localeString.replaceAll ( "\\-" , "_" ) : localeString ) ) ; if ( ( result == null ) && returnDefaultLocale ) { result = java.util.Locale.US ; } } catch ( java.lang.IllegalArgumentException e ) { result = ( returnDefaultLocale ) ? java.util.Locale.US : null ; } return result ; }

Target:
public static java.util.Locale getLocaleFromString ( java.lang.String localeString , boolean returnDefaultLocale ) { java.util.Locale result = ( returnDefaultLocale ) ? null : org.ovirt.engine.core.utils.servlet.LocaleFilter.DEFAULT_LOCALE ; try { if ( localeString != null ) { result = org.apache.commons.lang.LocaleUtils.toLocale ( localeString.replaceAll ( "\\-" , "_" ) ) ; } else { result = null ; } if ( ( result == null ) && returnDefaultLocale ) { result = org.ovirt.engine.core.utils.servlet.LocaleFilter.DEFAULT_LOCALE ; } } catch ( java.lang.IllegalArgumentException e ) { result = ( returnDefaultLocale ) ? org.ovirt.engine.core.utils.servlet.LocaleFilter.DEFAULT_LOCALE : null ; } return result ; }
Source:
public java.util.List < java.lang.String > getAllNamesPinnedToHost ( org.ovirt.engine.core.compat.Guid host ) { org.springframework.jdbc.core.simple.ParameterizedRowMapper < java.lang.String > mapper = new org.springframework.jdbc.core.simple.ParameterizedRowMapper < java.lang.String > ( ) { @ java.lang.Override public java.lang.String mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { return rs.getString ( "vm_name" ) ; } } ; return getCallsHandler ( ) . executeReadList ( "GetNamesOfVmStaticDedicatedToVds" , mapper , getCustomMapSqlParameterSource ( ) . addValue ( "vds_id" , host ) ) ; }

Target:
public java.util.List < java.lang.String > getAllNamesPinnedToHost ( org.ovirt.engine.core.compat.Guid host ) { org.springframework.jdbc.core.RowMapper < java.lang.String > mapper = new org.springframework.jdbc.core.RowMapper < java.lang.String > ( ) { @ java.lang.Override public java.lang.String mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { return rs.getString ( "vm_name" ) ; } } ; return getCallsHandler ( ) . executeReadList ( "GetNamesOfVmStaticDedicatedToVds" , mapper , getCustomMapSqlParameterSource ( ) . addValue ( "vds_id" , host ) ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel model ) { setAgentTabVisibility ( model.getNeutronAgentModel ( ) . isPluginConfigurationAvailable ( ) . getEntity ( ) ) ; driver.edit ( model ) ; neutronAgentWidget.edit ( model.getNeutronAgentModel ( ) ) ; vmwarePropertiesWidget.edit ( model.getVmwarePropertiesModel ( ) ) ; kvmPropertiesWidget.edit ( model.getKvmPropertiesModel ( ) ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel model ) { setAgentTabVisibility ( model.getNeutronAgentModel ( ) . isPluginConfigurationAvailable ( ) . getEntity ( ) ) ; driver.edit ( model ) ; neutronAgentWidget.edit ( model.getNeutronAgentModel ( ) ) ; vmwarePropertiesWidget.edit ( model.getVmwarePropertiesModel ( ) ) ; kvmPropertiesWidget.edit ( model.getKvmPropertiesModel ( ) ) ; xenPropertiesWidget.edit ( model.getXenPropertiesModel ( ) ) ; }
Source:
public void testRemoveAllBeforeDate ( ) throws java.lang.Exception { java.util.Date cutoff = org.ovirt.engine.core.dao.AuditLogDAOTest.EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:11:00" ) ; dao.removeAllBeforeDate ( cutoff ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( ) ; org.junit.Assert.assertEquals ( 3 , result.size ( ) ) ; }

Target:
public void testRemoveAllBeforeDate ( ) throws java.lang.Exception { java.util.Date cutoff = org.ovirt.engine.core.dao.AuditLogDAOTest.EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:11:00" ) ; dao.removeAllBeforeDate ( cutoff ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertEquals ( 3 , result.size ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.GlusterVolumeStatusReturnForXmlRpc glusterVolumeStatus ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName , java.lang.String brickName , java.lang.String volumeStatusOption ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeStatus ( volumeName , brickName , volumeStatusOption ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GlusterVolumeStatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.GlusterVolumeStatusReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc glusterVolumeProfileInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeProfileInfo ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected org.ovirt.engine.api.model.VM setUpStatisticalExpectations ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.setUpStatisticalEntityExpectations ( entity , entity.getStatisticsData ( ) ) ; setUpGetEntityExpectations ( 1 , false , entity ) ; control.replay ( ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM setUpStatisticalExpectations ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.VM entity = new org.ovirt.engine.api.restapi.resource.VM ( ) ; org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.setUpStatisticalEntityExpectations ( entity , entity.getStatisticsData ( ) ) ; setUpGetEntityExpectations ( 1 , false , entity ) ; control.replay ( ) ; return entity ; }
Source:
public synchronized org.ovirt.engine.sdk.Hosts getHosts ( ) { if ( ( this . hosts ) == null ) { this . hosts = new org.ovirt.engine.sdk.Hosts ( proxy ) ; } return hosts ; }

Target:
public org.ovirt.engine.sdk.Hosts getHosts ( ) { if ( ( this . hosts ) == null ) { synchronized ( this . LOCK ) { if ( ( this . hosts ) == null ) { this . hosts = new org.ovirt.engine.sdk.Hosts ( proxy ) ; } } } return hosts ; }
Source:
public void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotSchedule > aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public void testGetLunsToUpdateInDbLunExistsInDbButNotInVgInfo ( ) { org.ovirt.engine.core.compat.Guid lunFromDbId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsToRemoveFromDb = getLunsToUpdateInDb ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , lunFromDbId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . get ( command.removeLunsHandler ) ; assertLunIdInList ( lunsToRemoveFromDb , lunFromDbId ) ; }

Target:
public void testGetLunsToUpdateInDbLunExistsInDbButNotInVgInfo ( ) { org.ovirt.engine.core.compat.Guid lunFromDbId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.Map < org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > lunsToUpdateInDb = getLunsToUpdateInDb ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , lunFromDbId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsToRemoveFromDb = lunsToUpdateInDb.get ( command.removeLunsHandler ) ; org.junit.Assert.assertEquals ( java.util.stream.Stream.of ( command.saveLunsHandler , command.removeLunsHandler ) . collect ( java.util.stream.Collectors.toSet ( ) ) , lunsToUpdateInDb.keySet ( ) ) ; assertLunIdInList ( lunsToRemoveFromDb , lunFromDbId ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosBondSpeedSetup ( java.lang.Integer slaveSpeed , java.lang.Integer bondSpeed ) { return setupCompositeQosConfiguration ( true , createQos ( ) , slaveSpeed , bondSpeed , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_MODE_4 ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , int vlanId , java.lang.String networkName ) { java.lang.String baseIfaceName = baseNic.getName ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ( ( baseIfaceName + "." ) + vlanId ) , false , null , baseIfaceName , vlanId , networkName , true , null , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenVlanNicIsPassed ( baseNic , nic ) ; return nic ; }
Source:
protected void updateLinkChangability ( ) { super . updateLinkChangability ( ) ; if ( ! ( getLinked ( ) . getIsChangable ( ) ) ) { return ; } boolean isPlugged = isPluggedBeforeAndAfterEdit ( ) ; if ( ( ( ( isVmUp ( ) ) && ( hotUpdateSupported ) ) && isPlugged ) && ( selectedNetworkExternal ( ) ) ) { getLinked ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . hotLinkStateUpdateNotSupportedExternalNetworks ( ) ) ; getLinked ( ) . setIsChangable ( false ) ; initLinked ( ) ; } }

Target:
protected void updateLinkChangability ( ) { super . updateLinkChangability ( ) ; if ( ! ( getLinked ( ) . getIsChangable ( ) ) ) { return ; } boolean isPlugged = isPluggedBeforeAndAfterEdit ( ) ; if ( ( ( ( isVmUp ( ) ) && ( hotUpdateSupported ) ) && isPlugged ) && ( selectedNetworkExternal ( ) ) ) { getLinked ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . hotLinkStateUpdateNotSupportedExternalNetworks ( ) ) ; getLinked ( ) . setIsChangeable ( false ) ; initLinked ( ) ; } }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( nameEditor.asValueBox ( ) , nameEditor.asValueBox ( ) . getValue ( ) ) ; } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel model ) { driver.edit ( model ) ; publicInfo.setVisible ( model.getPublicUse ( ) . getIsAvailable ( ) ) ; nameEditor.fireValueChangeOnKeyDown ( ) ; model.getName ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( org.ovirt.engine.ui.webadmin.widget.vnicProfile.VnicProfileWidget.this , model ) ; } } ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.ActionGroup map ( org.ovirt.engine.api.model.Permit model , org.ovirt.engine.core.common.businessentities.ActionGroup template ) { assert ( model.isSetId ( ) ) || ( model.isSetName ( ) ) ; return template != null ? template : ( model.getId ( ) ) != null ? org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( java.lang.Integer.valueOf ( model.getId ( ) ) ) : org.ovirt.engine.core.common.businessentities.ActionGroup.valueOf ( model.getName ( ) ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.ActionGroup map ( org.ovirt.engine.api.model.Permit model , org.ovirt.engine.core.common.businessentities.ActionGroup template ) { assert ( model.isSetId ( ) ) || ( model.isSetName ( ) ) ; return template != null ? template : ( model.getId ( ) ) != null ? org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( java.lang.Integer.valueOf ( model.getId ( ) ) ) : org.ovirt.engine.core.common.businessentities.ActionGroup.valueOf ( model.getName ( ) . toUpperCase ( ) ) ; }
Source:
public void testGetAllStoragePoolIsoMapsForStoragePool ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > result = dao.getAllForStoragePool ( existingPool.getId ( ) ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapping : result ) { assertEquals ( existingPool.getId ( ) , mapping.getstorage_pool_id ( ) ) ; } }

Target:
public void testGetAllStoragePoolIsoMapsForStoragePool ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > result = dao.getAllForStoragePool ( existingPool.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapping : result ) { org.junit.Assert.assertEquals ( existingPool.getId ( ) , mapping.getstorage_pool_id ( ) ) ; } }
Source:
public void successfulConfFileConvertToMap ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( ActionType.RetrieveImageData , successfulVdcReturnValue ( load ( "hosted-engine-config.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( ActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "sdUUID" ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "host_id" ) ) ; }

Target:
public void successfulConfFileConvertToMap ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( ActionType.RetrieveImageData , successfulActionReturnValue ( load ( "hosted-engine-config.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( ActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "sdUUID" ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "host_id" ) ) ; }
Source:
public void testAllDomainsWithinTheshold ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.name ( ) ) ) ; }

Target:
public void testAllDomainsWithinThreshold ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.name ( ) ) ) ; }
Source:
public void updateTasksInCluster ( ) { org.mockito.Mockito.doReturn ( getTasks ( ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( jobRepository , org.mockito.Mockito.times ( 1 ) ) . updateStep ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 1 ) ) . endStepJob ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }

Target:
public void updateTasksInCluster ( ) { org.mockito.Mockito.doReturn ( getTasks ( ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( jobRepository , org.mockito.Mockito.times ( 1 ) ) . updateStep ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 1 ) ) . endStepJob ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }
Source:
public void testUpdateVolumeStatusByName ( ) { org.junit.Assert.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatusByName ( existingDistVol.getClusterId ( ) , existingDistVol.getName ( ) , GlusterVolumeStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.Assert.assertNotNull ( volume ) ; org.junit.Assert.assertFalse ( volume.isOnline ( ) ) ; org.junit.Assert.assertFalse ( volume.equals ( existingDistVol ) ) ; existingDistVol.setStatus ( GlusterVolumeStatus.DOWN ) ; org.junit.Assert.assertEquals ( existingDistVol , volume ) ; }

Target:
public void testUpdateVolumeStatusByName ( ) { org.junit.Assert.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatusByName ( existingDistVol.getClusterId ( ) , existingDistVol.getName ( ) , GlusterStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.Assert.assertNotNull ( volume ) ; org.junit.Assert.assertFalse ( volume.isOnline ( ) ) ; org.junit.Assert.assertFalse ( volume.equals ( existingDistVol ) ) ; existingDistVol.setStatus ( GlusterStatus.DOWN ) ; org.junit.Assert.assertEquals ( existingDistVol , volume ) ; }
Source:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }