auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ; behavior.postInitTemplate ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterTemplatesByArchitecture ( templates , dataCenterWithCluster.getCluster ( ) . getArchitecture ( ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior behavior = this ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ; behavior.postInitTemplate ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterTemplatesByArchitecture ( templates , dataCenterWithCluster.getCluster ( ) . getArchitecture ( ) ) ) ; }
Source:
public void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( isRaiseErrorModalPanel ( action , fault ) ) { errorPopupManager.show ( messages.uiCommonRunActionExecutionFailed ( org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( action ) , fault.getMessage ( ) ) ) ; } }

Target:
public void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( isRaiseErrorModalPanel ( action , fault ) ) { errorPopupManager.show ( messages.uiCommonRunActionExecutionFailed ( org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . get ( action ) , fault.getMessage ( ) ) ) ; } }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getVmName ( ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getVmName ( ) , LockMessagesMatchUtil.VM_NAME ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getName ( ) , LockMessagesMatchUtil.VM_NAME ) ; } return null ; }
Source:
void addDiskList ( org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel model ) { diskListPanel.clear ( ) ; int diskIndex = 0 ; for ( final org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : model.getDisks ( ) ) { org.ovirt.engine.ui.common.widget.uicommon.storage.DisksAllocationItemView disksAllocationItemView = new org.ovirt.engine.ui.common.widget.uicommon.storage.DisksAllocationItemView ( constants ) ; disksAllocationItemView.edit ( diskModel ) ; disksAllocationItemView.updateStyles ( showQuota ) ; disksAllocationItemView.setIsAliasChangeable ( model.getIsAliasChangable ( ) ) ; disksAllocationItemView.setElementId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , ( "disk" + ( diskIndex ++ ) ) ) ) ; diskListPanel.add ( disksAllocationItemView ) ; } }

Target:
void addDiskList ( org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel model ) { diskListPanel.clear ( ) ; int diskIndex = 0 ; for ( final org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : model.getDisks ( ) ) { org.ovirt.engine.ui.common.widget.uicommon.storage.DisksAllocationItemView disksAllocationItemView = new org.ovirt.engine.ui.common.widget.uicommon.storage.DisksAllocationItemView ( ) ; disksAllocationItemView.edit ( diskModel ) ; disksAllocationItemView.updateStyles ( showQuota ) ; disksAllocationItemView.setIsAliasChangeable ( model.getIsAliasChangable ( ) ) ; disksAllocationItemView.setElementId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , ( "disk" + ( diskIndex ++ ) ) ) ) ; diskListPanel.add ( disksAllocationItemView ) ; } }
Source:
protected java.lang.String getDescription ( ) { java.lang.String networkName = ( ( getNetworkName ( ) ) == null ) ? "" : getNetworkName ( ) ; java.lang.String clusterName = ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) ) == null ) ? "" : org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getName ( ) ; return ( networkName + " - " ) + clusterName ; }

Target:
protected java.lang.String getDescription ( ) { java.lang.String networkName = ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getNetworkName ( ) ) == null ) ? "" : org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getNetworkName ( ) ; java.lang.String clusterName = ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) ) == null ) ? "" : org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getName ( ) ; return ( networkName + " - " ) + clusterName ; }
Source:
protected void executeVDSCommand ( ) { try { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxyData = org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getCurrentIrsProxyData ( ) ; switch ( org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getReconstructMarkAction ( ) ) { case ClearJobs : proxyData.clearPoolTimers ( ) ; break ; case ClearCache : proxyData.clearCache ( ) ; break ; default : break ; } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.error ( ( "Could not change timers for pool " + ( org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ) , e ) ; } org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getVDSReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void executeVDSCommand ( ) { try { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxyData = org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getCurrentIrsProxyData ( ) ; proxyData.clearPoolTimers ( ) ; proxyData.clearCache ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.error ( ( "Could not change timers for pool " + ( org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ) , e ) ; } org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getVDSReturnValue ( ) . setSucceeded ( true ) ; }
Source:
protected void activateHostsAfterClusterChange ( final org.ovirt.engine.ui.uicommonweb.models.GuideModel guideModel , final java.lang.String searchStr , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > activateVdsParameterList ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.ActivateVds , activateVdsParameterList , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { com.google.gwt.user.client.Timer timer = new com.google.gwt.user.client.Timer ( ) { public void run ( ) { checkVdsActivateSucceeded ( guideModel , searchStr ) ; } } ; timer.schedule ( 5000 ) ; } } , this ) ; }

Target:
protected void activateHostsAfterClusterChange ( final java.lang.String searchStr , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > activateVdsParameterList ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.ActivateVds , activateVdsParameterList , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { com.google.gwt.user.client.Timer timer = new com.google.gwt.user.client.Timer ( ) { public void run ( ) { checkVdsActivateSucceeded ( searchStr ) ; } } ; timer.schedule ( 5000 ) ; } } , this ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ! ( getParameters ( ) . getTaskGroupSuccess ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_FAILURE ; } if ( ( isFirstTaskHandler ( ) ) && ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK ; } break ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ! ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_FAILURE ; } if ( ( isFirstTaskHandler ( ) ) && ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK ; } break ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getCluster ( 0 ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.DATA_CENTER_ID } , getNetworks ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , failure ) ; }
Source:
public boolean isHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; return ( vm != null ) && ( ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) ) ; }

Target:
public boolean isHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; return ( vm != null ) && ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterClustersWithoutArchitecture ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > ) ( returnValue ) ) ) ; model.getCluster ( ) . setItems ( clusters ) ; model.getCluster ( ) . setIsEmpty ( clusters.isEmpty ( ) ) ; model.updateControlsAvailability ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterClustersWithoutArchitecture ( returnValue ) ; getCluster ( ) . setItems ( clusters ) ; getCluster ( ) . setIsEmpty ( clusters.isEmpty ( ) ) ; updateControlsAvailability ( ) ; stopProgress ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createVdsInterface ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.lang.Boolean bonded , java.lang.String bondName , java.lang.Integer vlanId , java.lang.String networkName , boolean bridged ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface ( ) ; iface.setId ( id ) ; iface.setName ( name ) ; iface.setBonded ( bonded ) ; iface.setBondName ( bondName ) ; iface.setVlanId ( vlanId ) ; iface.setNetworkName ( networkName ) ; iface.setBridged ( bridged ) ; return iface ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVdsInterface ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.lang.Boolean bonded , java.lang.String bondName , java.lang.Integer vlanId , java.lang.String networkName , boolean bridged ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setId ( id ) ; iface.setName ( name ) ; iface.setBonded ( bonded ) ; iface.setBondName ( bondName ) ; iface.setVlanId ( vlanId ) ; iface.setNetworkName ( networkName ) ; iface.setBridged ( bridged ) ; return iface ; }
Source:
private static void interfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private static void interfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.SystemPermissionListModel systemPermissionListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.SystemPermissionListModel ) ( model ) ) ; systemPermissionListModel.setItems ( ( ( java.lang.Iterable ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.SystemPermissionListModel systemPermissionListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.SystemPermissionListModel ) ( model ) ) ; systemPermissionListModel.setItems ( ( ( java.lang.Iterable ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllLibvirtSecretsByProviderId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getLibvirtSecrets ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllLibvirtSecretsByProviderId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getLibvirtSecrets ( ) , failure ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.network.Network net1 , org.ovirt.engine.core.common.businessentities.network.Network net2 ) { final boolean managementNetwork1 = net1.getCluster ( ) . isManagement ( ) ; final boolean managementNetwork2 = net2.getCluster ( ) . isManagement ( ) ; if ( managementNetwork1 == managementNetwork2 ) { return lexoNumeric.compare ( net1.getName ( ) , net2.getName ( ) ) ; } else { return managementNetwork1 ? - 1 : 1 ; } }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.network.Network net1 , org.ovirt.engine.core.common.businessentities.network.Network net2 ) { final boolean managementNetwork1 = net1.getCluster ( ) . isManagement ( ) ; final boolean managementNetwork2 = net2.getCluster ( ) . isManagement ( ) ; if ( ( ! managementNetwork1 ) && ( ! managementNetwork2 ) ) { return lexoNumeric.compare ( net1.getName ( ) , net2.getName ( ) ) ; } else { return managementNetwork1 ? - 1 : 1 ; } }
Source:
public void vdsGroupWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.powermock.api.mockito.PowerMockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.powermock.api.mockito.PowerMockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.cpuExists ( ) ; allQueriesEmpty ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }

Target:
public void vdsGroupWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; allQueriesEmpty ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }
Source:
protected java.lang.Integer getProgressValue ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity object ) { if ( ( object.getBrickProperties ( ) ) == null ) { return 0 ; } org.ovirt.engine.core.common.businessentities.gluster.BrickProperties brickProperties = object.getBrickProperties ( ) ; return ( ( int ) ( ( ( ( brickProperties.getTotalSize ( ) ) - ( brickProperties.getFreeSize ( ) ) ) / ( brickProperties.getTotalSize ( ) ) ) * 100 ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.BrickProperties getValue ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity object ) { return object.getBrickProperties ( ) ; }
Source:
protected void initTableColumns ( ) { bricksTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getServerName ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.AddBrickPopupView.constants.serverBricks ( ) ) ; bricksTable.addEntityModelColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getBrickDirectory ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.AddBrickPopupView.constants.brickDirectoryBricks ( ) ) ; }

Target:
protected void initTableColumns ( ) { bricksTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getServerName ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.AddBrickPopupView.constants.serverBricks ( ) ) ; bricksTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractEntityModelTextColumn < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return entity.getBrickDirectory ( ) ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.AddBrickPopupView.constants.brickDirectoryBricks ( ) ) ; }
Source:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel ) { java.lang.Boolean migrationNetworkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.MigrationNetworkEnabled , clusterNetworkModel.getCluster ( ) . getCompatibilityVersion ( ) . toString ( ) ) ) ) ; return ( migrationNetworkEnabled && ( clusterNetworkModel.isAttached ( ) ) ) && ( ! ( clusterNetworkModel.isExternal ( ) ) ) ; }

Target:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel ) { return ( clusterNetworkModel.isAttached ( ) ) && ( ! ( clusterNetworkModel.isExternal ( ) ) ) ; }
Source:
public void validateInsufficientSpaceOnDomains ( ) { setupForStorageTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void validateInsufficientSpaceOnDomains ( ) { setupForStorageTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void updateStorageTypesByDomainType ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel ) { org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType = domainFunctionListEditor.asEditor ( ) . getActualEditor ( ) . getValue ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.storage.StorageType > filteredStorageTypes = new java.util.LinkedHashSet < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel currModel : storageModel.getItems ( ) ) { if ( ( currModel.getRole ( ) ) == storageDomainType ) { filteredStorageTypes.add ( currModel.getType ( ) ) ; } } storageModel.getAvailableStorageTypeItems ( ) . setItems ( filteredStorageTypes ) ; }

Target:
private void updateStorageTypesByDomainType ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel ) { storageModel.updateStorageTypesByDomainType ( ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetHostDeviceByHostIdAndDeviceName , org.ovirt.engine.core.common.queries.HostDeviceParameters.class , new java.lang.String [ ] { "HostId" , "DeviceName" } , new java.lang.Object [ ] { HOST_ID , DEVICE_NAME } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.HostDevice device = resource.get ( ) ; verifyHostDevice ( device ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetHostDeviceByHostIdAndDeviceName , org.ovirt.engine.core.common.queries.HostDeviceParameters.class , new java.lang.String [ ] { "HostId" , "DeviceName" } , new java.lang.Object [ ] { HOST_ID , DEVICE_NAME } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.HostDevice device = resource.get ( ) ; verifyHostDevice ( device ) ; }
Source:
public void onBrowserEvent ( com.google.gwt.cell.client.Cell.Context context , com.google.gwt.dom.client.Element elem , com.google.gwt.dom.client.NativeEvent event ) { getCell ( ) . onBrowserEvent ( context , elem , org.ovirt.engine.ui.common.widget.table.header.AbstractHeader.getValue ( ) , event , updater ) ; if ( ( BrowserEvents.CONTEXTMENU.equals ( event.getType ( ) ) ) && ( ( contextMenuHandler ) != null ) ) { contextMenuHandler.onContextMenu ( event ) ; } }

Target:
public void onBrowserEvent ( com.google.gwt.cell.client.Cell.Context context , com.google.gwt.dom.client.Element elem , com.google.gwt.dom.client.NativeEvent event ) { super . onBrowserEvent ( context , elem , event ) ; if ( ( BrowserEvents.CONTEXTMENU.equals ( event.getType ( ) ) ) && ( ( contextMenuHandler ) != null ) ) { contextMenuHandler.onContextMenu ( event ) ; } }
Source:
public void testGetNetworkDiskTypeForV41ClusterEnabled ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageTypes ( new java.util.ArrayList ( java.util.Arrays.asList ( StorageType.GLUSTERFS ) ) ) ; org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_1 ) ; vm.setClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getSupportedAdditionalClusterFeatures ( true ) ) . when ( clusterFeatureDao ) . getSupportedFeaturesByClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.junit.Assert.assertEquals ( VdsProperties.NETWORK , underTest.getNetworkDiskType ( vm , diskImage ) . get ( ) ) ; }

Target:
public void testGetNetworkDiskTypeForV41ClusterEnabled ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_1 ) ; vm.setClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getSupportedAdditionalClusterFeatures ( true ) ) . when ( clusterFeatureDao ) . getSupportedFeaturesByClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.junit.Assert.assertEquals ( VdsProperties.NETWORK , underTest.getNetworkDiskType ( vm , StorageType.GLUSTERFS ) . get ( ) ) ; }
Source:
public void setup ( ) throws java.lang.Exception { validator = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) ; org.ovirt.engine.core.common.config.IConfigUtilsInterface confUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( confUtils.GetValue ( ConfigValues.MaxMTU , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MAX_MTU ) ; org.mockito.Mockito.when ( confUtils.GetValue ( ConfigValues.ManagementNetwork , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MANAGEMENT_NETWORK ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( confUtils ) ; }

Target:
public void setup ( ) throws java.lang.Exception { validator = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) ; org.ovirt.engine.core.common.config.IConfigUtilsInterface confUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( confUtils.getValue ( ConfigValues.MaxMTU , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MAX_MTU ) ; org.mockito.Mockito.when ( confUtils.getValue ( ConfigValues.ManagementNetwork , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MANAGEMENT_NETWORK ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( confUtils ) ; }
Source:
public void testAddIncompleteParametersNoName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "id|name" ) ; } }

Target:
public void testAddIncompleteParametersNoName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "id|name" ) ; } }
Source:
public void testGetPeersWithWrongPassword ( ) throws java.io.IOException , javax.naming.AuthenticationException { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( client ) . when ( glusterUtil ) . getSSHClient ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.anySetOf ( java.lang.String.class ) ) ; glusterUtil.getPeers ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.WRONG_PASSWORD ) ; }

Target:
public void testGetPeersWithWrongPassword ( ) throws java.io.IOException , javax.naming.AuthenticationException { org.mockito.Mockito.doReturn ( client ) . when ( glusterUtil ) . getSSHClient ( ) ; glusterUtil.getPeers ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.WRONG_PASSWORD ) ; }
Source:
private org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase createBuilder ( ) { if ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isOldClusterVersion ( vm.getCompatibilityVersion ( ) ) ) { return new org.ovirt.engine.core.vdsbroker.vdsbroker.VmOldInfoBuilder ( vm , createInfo ) ; } else { return new org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder ( vm , org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getParameters ( ) . getVdsId ( ) , createInfo ) ; } }

Target:
private org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilderBase createBuilder ( ) { return new org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder ( vm , org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getParameters ( ) . getVdsId ( ) , createInfo ) ; }
Source:
protected void mockBackendStatusChange ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setReturnValue ( succeeded ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandTest.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.ovirt.engine.core.bll.gluster.GlusterHookCommandTest.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( vdsReturnValue ) ; }

Target:
protected void mockBackendStatusChange ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setReturnValue ( succeeded ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandTest.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.ovirt.engine.core.bll.gluster.GlusterHookCommandTest.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( vdsReturnValue ) ; }
Source:
private void assertGetAllForVdsCorrectResult ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.InterfaceDAOTest.VDS_ID , iface.getVdsId ( ) ) ; } }

Target:
private void assertGetAllForVdsCorrectResult ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.InterfaceDAOTest.VDS_ID , iface.getVdsId ( ) ) ; } }
Source:
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 ) ; } } ) ; }

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 < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > 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 void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { for ( org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup grp : ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > ) ( returnValue ) ) ) { items.add ( createUserGroup ( grp.getName ( ) , grp.getNamespace ( ) , grp.getAuthz ( ) ) ) ; } setItems ( items ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > returnValue ) { for ( org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup grp : returnValue ) { items.add ( createUserGroup ( grp.getName ( ) , grp.getNamespace ( ) , grp.getAuthz ( ) ) ) ; } setItems ( items ) ; }
Source:
private void removeVmStatelessImages ( ) { if ( getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }

Target:
private void removeVmStatelessImages ( ) { if ( getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }
Source:
public org.ovirt.engine.api.model.AffinityGroup update ( final org.ovirt.engine.api.model.AffinityGroup incoming ) { return performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAffinityGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) , VdcActionType.EditAffinityGroup , new org.ovirt.engine.api.restapi.resource.ParametersProvider < org.ovirt.engine.api.model.AffinityGroup , org.ovirt.engine.api.model.AffinityGroup > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.AffinityGroup model , org.ovirt.engine.api.model.AffinityGroup entity ) { return new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( guid , map ( incoming , entity ) ) ; } } ) ; }

Target:
public org.ovirt.engine.api.model.AffinityGroup update ( final org.ovirt.engine.api.model.AffinityGroup incoming ) { return performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAffinityGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) , VdcActionType.EditAffinityGroup , new org.ovirt.engine.api.restapi.resource.ParametersProvider < org.ovirt.engine.api.model.AffinityGroup , org.ovirt.engine.api.model.AffinityGroup > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.AffinityGroup model , org.ovirt.engine.api.model.AffinityGroup entity ) { return new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( guid , map ( incoming , entity ) ) ; } } ) ; }
Source:
public void testExecuteQueryWithDirectOnly ( ) { org.ovirt.engine.core.dao.PermissionDAO permissionDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.PermissionDAO.class ) ; org.mockito.Mockito.when ( permissionDAOMock.getAllForEntity ( objectID , getUser ( ) . getUserId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( mockedPermissions ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDAOMock ) ; assertQueryDAOCall ( true ) ; }

Target:
public void testExecuteQueryWithDirectOnly ( ) { org.ovirt.engine.core.dao.PermissionDAO permissionDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.PermissionDAO.class ) ; org.mockito.Mockito.when ( permissionDAOMock.getAllForEntity ( objectID , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( mockedPermissions ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDAOMock ) ; assertQueryDAOCall ( true ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { getView ( ) . clear ( ) ; return ; } getView ( ) . edit ( modelProvider.getModel ( ) ) ; getView ( ) . displayVmOsImages ( true ) ; setupDisks ( modelProvider ) ; setupConsole ( modelProvider ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } getView ( ) . edit ( modelProvider.getModel ( ) ) ; setupConsole ( modelProvider ) ; }
Source:
private void InitSpmPriorities1 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView view = ( ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView ) ( target ) ) ; view.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; InitSpmPriorities2 ( ) ; } } ) ) ; }

Target:
private void InitSpmPriorities1 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView view = ( ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView ) ( target ) ) ; view.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; InitSpmPriorities2 ( ) ; } } ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; actionGroup = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( org.ovirt.engine.core.common.businessentities.ActionGroup.values ( ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getQueryParameters ( ) . getActionGroup ( ) ) . thenReturn ( actionGroup ) ; java.lang.String sessionID = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getQueryParameters ( ) . getSessionId ( ) ) . thenReturn ( sessionID ) ; org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . setUser ( sessionID , org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getUser ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; actionGroup = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( org.ovirt.engine.core.common.businessentities.ActionGroup.values ( ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getQueryParameters ( ) . getActionGroup ( ) ) . thenReturn ( actionGroup ) ; sessionID = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getQueryParameters ( ) . getSessionId ( ) ) . thenReturn ( sessionID ) ; org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . setUser ( sessionID , org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getUser ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( ( ( getParameters ( ) . getQuotaId ( ) ) == null ? null : getParameters ( ) . getQuotaId ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.Quota , getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getParameters ( ) . getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , getActionType ( ) . getActionGroup ( ) ) ) ; }