auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static boolean isNumOfMonitorsLegal ( java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes , int numOfMonitors , java.util.List < java.lang.String > reasons ) { boolean legal = false ; if ( graphicsTypes.contains ( GraphicsType.VNC ) ) { legal = numOfMonitors <= 1 ; } else if ( graphicsTypes.contains ( GraphicsType.SPICE ) ) { legal = numOfMonitors <= ( org.ovirt.engine.core.bll.VmHandler.getMaxNumberOfMonitors ( ) ) ; } if ( ! legal ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_NUM_OF_MONITORS.toString ( ) ) ; } return legal ; }

Target:
public static boolean isNumOfMonitorsLegal ( java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes , int numOfMonitors , java.util.List < java.lang.String > reasons ) { boolean legal = false ; if ( graphicsTypes.contains ( GraphicsType.VNC ) ) { legal = numOfMonitors <= 1 ; } else if ( graphicsTypes.contains ( GraphicsType.SPICE ) ) { legal = numOfMonitors <= ( org.ovirt.engine.core.bll.VmHandler.getMaxNumberOfMonitors ( ) ) ; } if ( ! legal ) { reasons.add ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_NUM_OF_MONITORS.toString ( ) ) ; } return legal ; }
Source:
protected void executeCommand ( ) { if ( isMemoryRemovable ( ) ) { java.util.List < org.ovirt.engine.core.compat.Guid > guids = org.ovirt.engine.core.utils.GuidUtils.getGuidListFromString ( org.ovirt.engine.core.bll.RemoveMemoryVolumesCommand.getParameters ( ) . getMemoryVolumes ( ) ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters removeMemoryDumpDiskParameters = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guids.get ( 2 ) ) ; removeMemoryDumpDiskParameters.setShouldBeLogged ( false ) ; runInternalAction ( VdcActionType.RemoveDisk , removeMemoryDumpDiskParameters ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters removeMemoryMetadataDiskParameters = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guids.get ( 4 ) ) ; removeMemoryMetadataDiskParameters.setShouldBeLogged ( false ) ; runInternalAction ( VdcActionType.RemoveDisk , removeMemoryMetadataDiskParameters ) ; } org.ovirt.engine.core.bll.RemoveMemoryVolumesCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { if ( isMemoryRemovable ( ) ) { java.util.List < org.ovirt.engine.core.compat.Guid > guids = org.ovirt.engine.core.utils.GuidUtils.getGuidListFromString ( org.ovirt.engine.core.bll.RemoveMemoryVolumesCommand.getParameters ( ) . getMemoryVolumes ( ) ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters removeMemoryDumpDiskParameters = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guids.get ( 2 ) ) ; removeMemoryDumpDiskParameters.setShouldBeLogged ( false ) ; runInternalAction ( ActionType.RemoveDisk , removeMemoryDumpDiskParameters ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters removeMemoryMetadataDiskParameters = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guids.get ( 4 ) ) ; removeMemoryMetadataDiskParameters.setShouldBeLogged ( false ) ; runInternalAction ( ActionType.RemoveDisk , removeMemoryMetadataDiskParameters ) ; } org.ovirt.engine.core.bll.RemoveMemoryVolumesCommand.setSucceeded ( true ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } else { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { _defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { _defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; }

Target:
public static void getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }
Source:
public void testRemoveForcedIncomplete ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpVersionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveStoragePool , org.ovirt.engine.core.common.action.StoragePoolParametersBase.class , new java.lang.String [ ] { "StoragePoolId" , "ForceDelete" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; resource.remove ( action ) ; }

Target:
public void testRemoveForcedIncomplete ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpVersionExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveStoragePool , org.ovirt.engine.core.common.action.StoragePoolParametersBase.class , new java.lang.String [ ] { "StoragePoolId" , "ForceDelete" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendDataCenterResource.FORCE , java.lang.Boolean.FALSE.toString ( ) ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; resource.remove ( ) ; }
Source:
protected void getVersionV1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { org.ovirt.engine.core.services.RegisterServlet.log.info ( java.lang.String.format ( "Version request: source='%s', secured='%s'" , request.getRemoteHost ( ) , request.isSecure ( ) ) ) ; try ( java.io.PrintWriter out = response.getWriter ( ) ) { response.setContentType ( "text/plain" ) ; out.print ( org.ovirt.engine.core.services.RegisterServlet.INTERFACE_VERSION ) ; } }

Target:
protected void getVersionV1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { org.ovirt.engine.core.services.RegisterServlet.log.info ( "Version request: source={}', secured='{}'" , request.getRemoteHost ( ) , request.isSecure ( ) ) ; try ( java.io.PrintWriter out = response.getWriter ( ) ) { response.setContentType ( "text/plain" ) ; out.print ( org.ovirt.engine.core.services.RegisterServlet.INTERFACE_VERSION ) ; } }
Source:
public static void GetRedirectServletReportsPage ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage ) , aQuery ) ; }

Target:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) , aQuery ) ; }
Source:
private boolean isHeadlessModeChanged ( org.ovirt.engine.core.common.businessentities.VM source , org.ovirt.engine.core.common.action.VmManagementParametersBase updateVmParameters ) { return ( ( source.getDefaultDisplayType ( ) ) != ( updateVmParameters.getVmStaticData ( ) . getDefaultDisplayType ( ) ) ) && ( ( ( source.getDefaultDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.none ) ) || ( ( updateVmParameters.getVmStaticData ( ) . getDefaultDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.none ) ) ) ; }

Target:
public void setDiskWindow ( org.ovirt.engine.ui.uicommonweb.models.Model value ) { if ( ( diskModel ) != value ) { diskModel = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel.DISK_WINDOW ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object loadedCluster ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster newItem = new org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( loadedDataCenter ) ) , ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( loadedCluster ) ) ) ; unitModel.getDataCenterWithClustersList ( ) . setItems ( java.util.Arrays.asList ( newItem ) ) ; unitModel.getDataCenterWithClustersList ( ) . setSelectedItem ( newItem ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object loadedCluster ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster newItem = new org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( loadedDataCenter ) ) , ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( loadedCluster ) ) ) ; unitModel.getDataCenterWithClustersList ( ) . setItems ( java.util.Arrays.asList ( newItem ) ) ; unitModel.getDataCenterWithClustersList ( ) . setSelectedItem ( newItem ) ; }
Source:
public java.lang.Void runInTransaction ( ) { coco.persistCommand ( asyncTask.getRootCmdEntity ( ) ) ; coco.persistCommand ( asyncTask.getChildCmdEntity ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { if ( ! ( asyncTask.getChildCmdEntity ( ) . getRootCommandId ( ) . equals ( asyncTask.getChildCmdEntity ( ) . getId ( ) ) ) ) { coco.persistCommand ( asyncTask.getRootCmdEntity ( ) ) ; } coco.persistCommand ( asyncTask.getChildCmdEntity ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask ) ; return null ; }
Source:
protected void initUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUser ( ) ; if ( ( user != null ) && ( ( user.getId ( ) ) == null ) ) { user.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUserDAO ( ) . save ( user ) ; } }

Target:
protected void initUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUser ( ) ; if ( ( user != null ) && ( ( user.getId ( ) ) == null ) ) { user.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUserDao ( ) . save ( user ) ; } }
Source:
protected void initializeCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.HotPlugDiskToVmCommand < org.ovirt.engine.core.common.action.HotPlugDiskToVmParameters > ( createParameters ( ) ) ) ; mockVds ( ) ; org.powermock.api.mockito.PowerMockito.when ( command.getActionType ( ) ) . thenReturn ( VdcActionType.HotPlugDiskToVm ) ; }

Target:
public void initializeCommand ( ) { command = org.mockito.Mockito.spy ( createCommand ( ) ) ; mockVds ( ) ; org.mockito.Mockito.when ( command.getActionType ( ) ) . thenReturn ( getCommandActionType ( ) ) ; org.mockito.Mockito.doReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAO.class ) ) . when ( command ) . getVmNetworkInterfaceDAO ( ) ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > setupCanAddVmFromSnapshotTests ( final int domainSizeGB , final int sizeRequired , org.ovirt.engine.core.compat.Guid sourceSnapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; initializeVmDAOMock ( vm ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = createVmFromSnapshotCommand ( vm , sourceSnapshotId ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }

Target:
protected org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > setupCanAddVmFromSnapshotTests ( final int domainSizeGB , final int sizeRequired , org.ovirt.engine.core.compat.Guid sourceSnapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; initializeVmDaoMock ( vm ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = createVmFromSnapshotCommand ( vm , sourceSnapshotId ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }
Source:
private void setKeyAndValidate ( final java.lang.String keyName , final java.lang.String value , final java.lang.String version ) throws java.lang.IllegalAccessException { config.getEngineConfigLogic ( ) . persist ( keyName , value , version ) ; org.ovirt.engine.core.config.entity.ConfigKey currentConfigKey = config.getEngineConfigLogic ( ) . fetchConfigKey ( keyName , "general" ) ; org.junit.Assert.assertEquals ( value , currentConfigKey.getValue ( ) ) ; }

Target:
private void setKeyAndValidate ( final java.lang.String keyName , final java.lang.String value , final java.lang.String version ) throws java.lang.IllegalAccessException { config.getEngineConfigLogic ( ) . persist ( keyName , value , version ) ; org.ovirt.engine.core.config.entity.ConfigKey currentConfigKey = config.getEngineConfigLogic ( ) . fetchConfigKey ( keyName , "general" ) ; org.junit.jupiter.api.Assertions.assertEquals ( value , currentConfigKey.getValue ( ) ) ; }
Source:
public static void getUserMessageOfTheDayViaPublic ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getStorageDomainListByTemplate ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public void testVmsRuleNeg ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( false ) ; model.setPositive ( true ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.POSITIVE , entity.getVmAffinityRule ( ) ) ; org.junit.Assert.assertEquals ( false , entity.isVmEnforcing ( ) ) ; org.junit.Assert.assertEquals ( true , entity.isVmAffinityEnabled ( ) ) ; }

Target:
public void testVmsRuleNeg ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( false ) ; model.setPositive ( true ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.POSITIVE , entity.getVmAffinityRule ( ) ) ; org.junit.Assert.assertFalse ( entity.isVmEnforcing ( ) ) ; org.junit.Assert.assertTrue ( entity.isVmAffinityEnabled ( ) ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllDisksByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , getEntityList ( ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.api.model.Disk entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , entity ) ; } }
Source:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void onOk ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel windowModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel > currentModels = windowModel.getCurrentProxies ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel selectedModel = windowModel.getAvailableProxies ( ) . getSelectedItem ( ) ; setEntity ( selectedModel.getEntity ( ) ) ; java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel > items = currentModels.getItems ( ) ; currentModels.setItems ( null ) ; currentModels.setItems ( items ) ; setWindow ( null ) ; }

Target:
private void onOk ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel windowModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel selectedModel = windowModel.getAvailableProxies ( ) . getSelectedItem ( ) ; setEntity ( selectedModel.getEntity ( ) ) ; setWindow ( null ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel > currentModels = currentProxies.getItemsAsList ( ) ; currentProxies.setItems ( java.util.Collections.emptyList ( ) ) ; currentProxies.setItems ( currentModels ) ; }
Source:
public void getUsbPolicyUsbTypeLegacy ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "legacy" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyUsbTypeNative ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "native" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult domainIsValidDestination ( ) { if ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult domainIsValidDestination ( ) { if ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdsActionParameters parameters = new org.ovirt.engine.core.common.action.VdsActionParameters ( getVdsId ( ) ) ; parameters.setLockProperties ( org.ovirt.engine.core.common.action.LockProperties.create ( LockProperties.Scope.Execution ) . withWait ( isInternalExecution ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.RefreshHostCapabilities , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { return ; } returnValue = runInternalAction ( VdcActionType.RefreshHostDevices , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { return ; } setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdsActionParameters parameters = new org.ovirt.engine.core.common.action.VdsActionParameters ( getVdsId ( ) ) ; parameters.setLockProperties ( org.ovirt.engine.core.common.action.LockProperties.create ( LockProperties.Scope.Execution ) . withWait ( isInternalExecution ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.RefreshHostCapabilities , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { return ; } returnValue = runInternalAction ( ActionType.RefreshHostDevices , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { return ; } setSucceeded ( true ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVmNetworkStatisticsDAO ( ) ) ; newVmStatistics = new org.ovirt.engine.core.common.businessentities.VmNetworkStatistics ( ) ; newVmStatistics.setId ( org.ovirt.engine.core.dao.VmNetworkStatisticsDAOTest.NEW_INTERFACE_ID ) ; newVmStatistics.setVmId ( org.ovirt.engine.core.dao.VmNetworkStatisticsDAOTest.VM_ID ) ; newVmStatistics.setStatus ( InterfaceStatus.Down ) ; newVmStatistics.setReceiveDropRate ( 0.0 ) ; newVmStatistics.setReceiveRate ( 0.0 ) ; newVmStatistics.setTransmitDropRate ( 0.0 ) ; newVmStatistics.setTransmitRate ( 0.0 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVmNetworkStatisticsDao ( ) ) ; newVmStatistics = new org.ovirt.engine.core.common.businessentities.VmNetworkStatistics ( ) ; newVmStatistics.setId ( org.ovirt.engine.core.dao.VmNetworkStatisticsDAOTest.NEW_INTERFACE_ID ) ; newVmStatistics.setVmId ( org.ovirt.engine.core.dao.VmNetworkStatisticsDAOTest.VM_ID ) ; newVmStatistics.setStatus ( InterfaceStatus.Down ) ; newVmStatistics.setReceiveDropRate ( 0.0 ) ; newVmStatistics.setReceiveRate ( 0.0 ) ; newVmStatistics.setTransmitDropRate ( 0.0 ) ; newVmStatistics.setTransmitRate ( 0.0 ) ; }
Source:
protected boolean isVmPartOfManualPool ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) == null ) { return false ; } final org.ovirt.engine.core.common.businessentities.VmPool vmPool = org.ovirt.engine.core.bll.RunVmCommand.getDbFacade ( ) . getVmPoolDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) ; return vmPool.getVmPoolType ( ) . equals ( VmPoolType.MANUAL ) ; }

Target:
protected boolean isVmPartOfManualPool ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) == null ) { return false ; } final org.ovirt.engine.core.common.businessentities.VmPool vmPool = vmPoolDao.get ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) ; return vmPool.getVmPoolType ( ) . equals ( VmPoolType.MANUAL ) ; }
Source:
public void filterImageDisksFilterDiskSnapshots ( ) { disk1.setActive ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > result = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( java.util.Arrays.asList ( disk1 , disk2 ) , false , false , true ) ; org.junit.Assert.assertEquals ( "Wrong number of Guids returned" , 1 , result.size ( ) ) ; org.junit.Assert.assertTrue ( "The result should contain the active image disk" , result.contains ( disk1 ) ) ; }

Target:
public void filterImageDisksFilterDiskSnapshots ( ) { disk1.setActive ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > result = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( java.util.Arrays.asList ( disk1 , disk2 ) , false , false , true ) ; org.junit.Assert.assertEquals ( "Wrong number of Guids returned" , 1 , result.size ( ) ) ; org.junit.Assert.assertTrue ( "The result should contain the active image disk" , result.contains ( disk1 ) ) ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > runBalance ( java.lang.String balanceName , java.util.List < org.ovirt.engine.core.compat.Guid > hostIDs , java.util.Map < java.lang.String , java.lang.String > propertiesMap ) { try { org.apache.xmlrpc.client.XmlRpcClient client = new org.apache.xmlrpc.client.XmlRpcClient ( ) ; client.setConfig ( config ) ; java.lang.Object result = client.execute ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.BALANCE , createBalanceArgs ( balanceName , hostIDs , propertiesMap ) ) ; return parseBalanceResults ( result ) ; } catch ( org.apache.xmlrpc.XmlRpcException e ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( "Could not communicate with the external scheduler while balancing" , e ) ; return null ; } }

Target:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > runBalance ( java.lang.String balanceName , java.util.List < org.ovirt.engine.core.compat.Guid > hostIDs , java.util.Map < java.lang.String , java.lang.String > propertiesMap ) { try { org.apache.xmlrpc.client.XmlRpcClient client = new org.apache.xmlrpc.client.XmlRpcClient ( ) ; client.setConfig ( config ) ; java.lang.Object result = client.execute ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.BALANCE , createBalanceArgs ( balanceName , hostIDs , propertiesMap ) ) ; return parseBalanceResults ( result ) ; } catch ( org.apache.xmlrpc.XmlRpcException e ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( "Could not communicate with the external scheduler while balancing" , e ) ; auditLogFailedToConnect ( ) ; return null ; } }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( getGuidDefaultEmpty ( rs , "storage_id" ) ) ; entity.setstorage_pool_id ( getGuid ( rs , "storage_pool_id" ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( getGuidDefaultEmpty ( rs , "storage_id" ) ) ; entity.setstorage_pool_id ( getGuid ( rs , "storage_pool_id" ) ) ; entity.setStatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }
Source:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { 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.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
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 ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void testEvalDifferentName ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockOtherIface.getName ( ) ) . thenReturn ( ( "not" + ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_NAME ) ) ) ; org.mockito.Mockito.when ( mockOtherIface.getAddress ( ) ) . thenReturn ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_ADDRESS ) ; junit.framework.Assert.assertFalse ( underTest.eval ( mockOtherIface ) ) ; }

Target:
public void testEvalDifferentName ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockOtherIface.getName ( ) ) . thenReturn ( ( "not" + ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_NAME ) ) ) ; org.mockito.Mockito.when ( mockOtherIface.getAddress ( ) ) . thenReturn ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_ADDRESS ) ; org.junit.Assert.assertFalse ( underTest.eval ( mockOtherIface ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Event model , int index ) { assertNotNull ( model ) ; assertEquals ( model.getId ( ) , java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; assertEquals ( LogSeverity.ALERT , model.getSeverity ( ) ) ; assertEquals ( model.getDescription ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; assertEquals ( model.getOrigin ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; assertEquals ( model.getCustomId ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Event model , int index ) { org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( model.getId ( ) , java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; org.junit.Assert.assertEquals ( LogSeverity.ALERT , model.getSeverity ( ) ) ; org.junit.Assert.assertEquals ( model.getDescription ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; org.junit.Assert.assertEquals ( model.getOrigin ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; org.junit.Assert.assertEquals ( model.getCustomId ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; }
Source:
public void isValidVmNetworkForValidNetwork ( ) { org.ovirt.engine.core.common.businessentities.Network network = createNewNetwork ( true , NETWORK_NAME ) ; org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface = createNewInterface ( ) ; iface.setNetworkName ( network.getName ( ) ) ; org.junit.Assert.assertTrue ( vmInterfaceManager.isValidVmNetwork ( iface , java.util.Collections.singletonMap ( network.getName ( ) , network ) ) ) ; }

Target:
public void isValidVmNetworkForValidNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNewNetwork ( true , NETWORK_NAME ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = createNewInterface ( ) ; iface.setNetworkName ( network.getName ( ) ) ; org.junit.Assert.assertTrue ( vmInterfaceManager.isValidVmNetwork ( iface , java.util.Collections.singletonMap ( network.getName ( ) , network ) ) ) ; }
Source:
public void updateChangeability ( org.ovirt.engine.core.common.queries.ConfigurationValues feature , org.ovirt.engine.core.compat.Version version ) { boolean featureSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( feature , version.getValue ( ) ) ) ) ; setIsChangeable ( featureSupported ) ; setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . optionNotSupportedClusterVersionTooOld ( version.getValue ( ) ) ) ; }

Target:
public void updateChangeability ( org.ovirt.engine.core.common.config.ConfigValues feature , org.ovirt.engine.core.compat.Version version ) { boolean featureSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( feature , version.getValue ( ) ) ) ) ; setIsChangeable ( featureSupported ) ; setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . optionNotSupportedClusterVersionTooOld ( version.getValue ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmPool pool = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( returnValue ) ) ; boolean isManualPool = ( pool.getVmPoolType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmPoolType.Manual ) ; behavior.updateCommandsAccordingToPoolType ( isManualPool ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmPool pool = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( returnValue ) ) ; boolean isManualPool = ( pool.getVmPoolType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmPoolType.MANUAL ) ; behavior.updateCommandsAccordingToPoolType ( isManualPool ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryPrincipals ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean recursiveGroupsResolving ) { org.ovirt.engine.api.extensions.ExtMap inputMap = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.PRINCIPAL ) . mput ( Authz.InvokeKeys.RESOLVE_GROUPS_RECURSIVE , recursiveGroupsResolving ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.NAMESPACE , namespace ) ; return org.ovirt.engine.core.aaa.AuthzUtils.populatePrincipals ( extension , namespace , inputMap ) ; }

Target:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryPrincipals ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { org.ovirt.engine.api.extensions.ExtMap inputMap = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.PRINCIPAL ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , org.ovirt.engine.core.aaa.AuthzUtils.queryFlagValue ( groupsResolving , groupsResolvingRecursive ) ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.NAMESPACE , namespace ) ; return org.ovirt.engine.core.aaa.AuthzUtils.populatePrincipals ( extension , namespace , inputMap ) ; }
Source:
public void numOfSocketChanged ( ) { int numOfSockets = extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ; int totalCpuCores = getTotalCpuCores ( ) ; if ( numOfSockets == 0 ) { return ; } getModel ( ) . getCoresPerSocket ( ) . setSelectedItem ( ( totalCpuCores / numOfSockets ) ) ; }

Target:
public void numOfSocketChanged ( ) { final int numOfSockets = extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ; final int totalCpuCores = getTotalCpuCores ( ) ; if ( ( numOfSockets == 0 ) || ( totalCpuCores == 0 ) ) { return ; } getModel ( ) . getThreadsPerCore ( ) . setSelectedItem ( 1 ) ; getModel ( ) . getCoresPerSocket ( ) . setSelectedItem ( ( totalCpuCores / numOfSockets ) ) ; setCpuChangeability ( ) ; }
Source:
public void getClusterWithVm ( ) { final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setClusterId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( v ) ; final org.ovirt.engine.core.common.businessentities.Cluster g = b.getCluster ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g.getId ( ) ) ; }

Target:
public void getClusterWithVm ( ) { final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setClusterId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( v ) ; final org.ovirt.engine.core.common.businessentities.Cluster g = b.getCluster ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g.getId ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc monitorCommand ( java.lang.String vmId , java.lang.String monitorCommand ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.monitorCommand ( vmId , monitorCommand ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( 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.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password , java.util.List < java.lang.String > vmsNames ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMs ( uri , username , password , vmsNames ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }