auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic.getName ( ) , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }

Target:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }
Source:
private boolean networkAttachedToHost ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsAttachedToNetwork = getDbFacade ( ) . getVdsDao ( ) . getAllForNetwork ( attachment.getNetworkId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS hostAttachedToNetwork : hostsAttachedToNetwork ) { if ( hostAttachedToNetwork.getId ( ) . equals ( host.getId ( ) ) ) { return true ; } } return false ; }

Target:
protected boolean isRoleNetwork ( ) { return ( ( getNetworkCluster ( ) . isDisplay ( ) ) || ( getNetworkCluster ( ) . isMigration ( ) ) ) || ( getNetworkCluster ( ) . isGluster ( ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnaValue = runVdsCommand ( VDSCommandType.StopRebalanceGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters ( upServer.getId ( ) , getGlusterVolumeName ( ) ) ) ; if ( ! ( vdsReturnaValue.getSucceeded ( ) ) ) { handleVdsError ( AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED , vdsReturnaValue.getVdsError ( ) . getMessage ( ) ) ; setSucceeded ( false ) ; return ; } endStepJob ( ) ; releaseVolumeLock ( ) ; setSucceeded ( vdsReturnaValue.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnaValue = runVdsCommand ( VDSCommandType.StopRebalanceGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters ( upServer.getId ( ) , getGlusterVolumeName ( ) ) ) ; if ( ! ( vdsReturnaValue.getSucceeded ( ) ) ) { handleVdsError ( AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED , vdsReturnaValue.getVdsError ( ) . getMessage ( ) ) ; setSucceeded ( false ) ; return ; } endStepJobAborted ( ) ; releaseVolumeLock ( ) ; setSucceeded ( vdsReturnaValue.getSucceeded ( ) ) ; }
Source:
public void testFindDefaultManagementNetworkDefault ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockNetworkDao.getByNameAndDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.DEFAULT_ENGINE_NETWORK_NAME , org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( mockDefaultEngineNetwork ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertSame ( actual , mockDefaultEngineNetwork ) ; }

Target:
public void testFindDefaultManagementNetworkDefault ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockManagementNetworkUtil.getDefaultManagementNetworkName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.DEFAULT_ENGINE_NETWORK_NAME ) ; org.mockito.Mockito.when ( mockNetworkDao.getByNameAndDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.DEFAULT_ENGINE_NETWORK_NAME , org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( mockDefaultEngineNetwork ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertSame ( actual , mockDefaultEngineNetwork ) ; }
Source:
protected org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters createSetupNetworksParameters ( org.ovirt.engine.core.compat.Guid hostId ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( hostId ) ; org.ovirt.engine.core.bll.network.NetworkConfigurator configurator = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( host ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = configurator.filterBondsWithoutSlaves ( getHostInterfaces ( hostId ) ) ; org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters ( ) ; parameters.setVdsId ( host.getId ( ) ) ; parameters.setInterfaces ( nics ) ; parameters.setCheckConnectivity ( true ) ; parameters.setShouldBeLogged ( false ) ; return parameters ; }

Target:
protected org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters createSetupNetworksParameters ( org.ovirt.engine.core.compat.Guid hostId ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( hostId ) ; org.ovirt.engine.core.bll.network.NetworkConfigurator configurator = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( host , commandContext ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = configurator.filterBondsWithoutSlaves ( getHostInterfaces ( hostId ) ) ; org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.PersistentSetupNetworksParameters ( ) ; parameters.setVdsId ( host.getId ( ) ) ; parameters.setInterfaces ( nics ) ; parameters.setCheckConnectivity ( true ) ; parameters.setShouldBeLogged ( false ) ; return parameters ; }
Source:
public void cluster_SelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; }
Source:
public org.ovirt.engine.sdk.decorators.HostNIC add ( org.ovirt.engine.sdk.decorators.HostNIC hostnic ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , hostnic , org.ovirt.engine.sdk.entities.HostNIC.class , org.ovirt.engine.sdk.decorators.HostNIC.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.HostHostNic add ( org.ovirt.engine.sdk.decorators.HostNic hostnic ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , hostnic , org.ovirt.engine.sdk.entities.HostNic.class , org.ovirt.engine.sdk.decorators.HostHostNic.class , headers ) ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
protected void freeLock ( ) { if ( ( context.getLock ( ) ) != null ) { getLockManager ( ) . releaseLock ( context.getLock ( ) ) ; log.infoFormat ( "Lock freed to object {0}" , context.getLock ( ) ) ; context.withLock ( null ) ; } }
Source:
protected void SetValue ( java.lang.String name , java.lang.String value , java.lang.String version ) { org.ovirt.engine.core.common.businessentities.VdcOption vdcOption = dbfacade.getVdcOptionDao ( ) . getByNameAndVersion ( name , version ) ; vdcOption.setoption_value ( value ) ; dbfacade.getVdcOptionDao ( ) . update ( vdcOption ) ; try { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.get ( vdcOption.getoption_name ( ) ) . put ( version , org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.GetValue ( vdcOption ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.log.errorFormat ( "Could not update option {0} in cache." , name ) ; } }

Target:
protected void setValue ( java.lang.String name , java.lang.String value , java.lang.String version ) { org.ovirt.engine.core.common.businessentities.VdcOption vdcOption = dbfacade.getVdcOptionDao ( ) . getByNameAndVersion ( name , version ) ; vdcOption.setoption_value ( value ) ; dbfacade.getVdcOptionDao ( ) . update ( vdcOption ) ; try { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.get ( vdcOption.getoption_name ( ) ) . put ( version , org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.getValue ( vdcOption ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.log.errorFormat ( "Could not update option {0} in cache." , name ) ; } }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameLabel.setText ( constants.loginFormUserNameLabel ( ) ) ; passwordLabel.setText ( constants.loginFormPasswordLabel ( ) ) ; domainLabel.setText ( constants.loginFormDomainLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationDynamicConstants dynamicConstants ) { headerLabel.setText ( dynamicConstants.loginHeaderLabel ( ) ) ; userNameLabel.setText ( constants.loginFormUserNameLabel ( ) ) ; passwordLabel.setText ( constants.loginFormPasswordLabel ( ) ) ; domainLabel.setText ( constants.loginFormDomainLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }
Source:
protected java.lang.String getDescription ( ) { java.lang.String networkName = ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getNetworkName ( ) ) == null ) ? "" : org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getNetworkName ( ) ; java.lang.String clusterName = ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getVdsGroup ( ) ) == null ) ? "" : org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getVdsGroup ( ) . getName ( ) ; return ( networkName + " - " ) + clusterName ; }

Target:
protected java.lang.String getDescription ( ) { java.lang.String networkName = ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getNetworkName ( ) ) == null ) ? "" : org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getNetworkName ( ) ; java.lang.String clusterName = ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getCluster ( ) ) == null ) ? "" : org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getCluster ( ) . getName ( ) ; return ( networkName + " - " ) + clusterName ; }
Source:
private static void addSoundCard ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.Version vdsGroupCompatibilityVersion ) { java.lang.String soundDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.getSoundDevice ( vmBase.getOsId ( ) , vdsGroupCompatibilityVersion ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) , VmDeviceGeneralType.SOUND , org.ovirt.engine.core.common.utils.VmDeviceType.getSoundDeviceType ( soundDevice ) , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , true , null ) ; }

Target:
private static java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.getVideoDeviceSpecParams ( vmBase.getNumOfMonitors ( ) , vmBase.getSingleQxlPci ( ) ) ; }
Source:
protected void writeManagedDeviceInfo ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.backendcompat.XmlTextWriter writer , org.ovirt.engine.core.compat.Guid deviceId ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = vmBase.getManagedVmDeviceMap ( ) . get ( deviceId ) ; if ( ( ( deviceId != null ) && ( vmDevice != null ) ) && ( ( vmDevice.getAddress ( ) ) != null ) ) { writeVmDeviceInfo ( vmDevice ) ; } }

Target:
protected void writeManagedDeviceInfo ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.compat.backendcompat.XmlTextWriter writer , org.ovirt.engine.core.compat.Guid deviceId ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = vmBase.getManagedDeviceMap ( ) . get ( deviceId ) ; if ( ( ( deviceId != null ) && ( vmDevice != null ) ) && ( ( vmDevice.getAddress ( ) ) != null ) ) { writeVmDeviceInfo ( vmDevice ) ; } }
Source:
private boolean canRemoveVmWithDetachDisks ( ) { if ( ! ( Guid.Empty.equals ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getVmtGuid ( ) ) ) ) { return failCanDoAction ( EngineMessage.VM_CANNOT_REMOVE_WITH_DETACH_DISKS_BASED_ON_TEMPLATE ) ; } for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDiskList ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageList = org.ovirt.engine.core.bll.RemoveVmCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( disk.getId ( ) ) ; if ( ( diskImageList.size ( ) ) > 1 ) { return failCanDoAction ( EngineMessage.VM_CANNOT_REMOVE_WITH_DETACH_DISKS_SNAPSHOTS_EXIST ) ; } } return true ; }

Target:
private boolean canRemoveVmWithDetachDisks ( ) { if ( ! ( Guid.Empty.equals ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getVmtGuid ( ) ) ) ) { return failValidation ( EngineMessage.VM_CANNOT_REMOVE_WITH_DETACH_DISKS_BASED_ON_TEMPLATE ) ; } for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDiskList ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageList = org.ovirt.engine.core.bll.RemoveVmCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( disk.getId ( ) ) ; if ( ( diskImageList.size ( ) ) > 1 ) { return failValidation ( EngineMessage.VM_CANNOT_REMOVE_WITH_DETACH_DISKS_SNAPSHOTS_EXIST ) ; } } return true ; }
Source:
public static void GetDocumentationBaseURL ( 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.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
protected void mockUninterestingMethods ( ) { super . mockUninterestingMethods ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getVmFromConfiguration ( ) ; }

Target:
public void canAddCloneVmFromSnapshotNoConfiguration ( ) { cmd.getVm ( ) . setName ( "vm1" ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getVmFromConfiguration ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommandTest.SOURCE_SNAPSHOT_ID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_HAS_NO_CONFIGURATION ) ; }
Source:
protected void verifyRemoveAllDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , org.mockito.verification.VerificationMode freeMacVerification ) { org.mockito.Mockito.verify ( macPoolManager , freeMacVerification ) . freeMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceDAO ) . remove ( iface.getId ( ) ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . remove ( iface.getId ( ) ) ; }

Target:
protected void verifyRemoveAllDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface ) { org.mockito.Mockito.verify ( macPoolManager , org.mockito.Mockito.times ( 1 ) ) . freeMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceDAO ) . remove ( iface.getId ( ) ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . remove ( iface.getId ( ) ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VmHostDevice > getExistingVmHostDevicesByName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > existingDevices = org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmId ( ) , VmDeviceGeneralType.HOSTDEV ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmHostDevice > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : existingDevices ) { result.add ( new org.ovirt.engine.core.common.businessentities.VmHostDevice ( device ) ) ; } return org.ovirt.engine.core.bll.utils.VmDeviceUtils.vmDevicesByDevice ( result ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VmHostDevice > getExistingVmHostDevicesByName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > existingDevices = org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmId ( ) , VmDeviceGeneralType.HOSTDEV ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmHostDevice > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : existingDevices ) { result.add ( new org.ovirt.engine.core.common.businessentities.VmHostDevice ( device ) ) ; } return org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmDeviceUtils ( ) . vmDevicesByDevice ( result ) ; }
Source:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveBookmark , org.ovirt.engine.core.common.action.BookmarksParametersBase.class , new java.lang.String [ ] { "BookmarkId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveBookmark , org.ovirt.engine.core.common.action.BookmarksParametersBase.class , new java.lang.String [ ] { "BookmarkId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondsResourceTest.DATA_CENTER_ID } , org.ovirt.engine.api.restapi.resource.BackendIscsiBondsResourceTest.setUpIscsiBonds ( ) , failure ) ; } }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondsResourceTest.DATA_CENTER_ID } , org.ovirt.engine.api.restapi.resource.BackendIscsiBondsResourceTest.setUpIscsiBonds ( ) , failure ) ; control.replay ( ) ; }
Source:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.WatchDog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { validateEnums ( org.ovirt.engine.api.model.WatchDog.class , model ) ; org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setModel ( org.ovirt.engine.core.common.businessentities.VmWatchdogType.getByName ( model.getModel ( ) ) ) ; params.setAction ( org.ovirt.engine.core.common.businessentities.VmWatchdogAction.getByName ( model.getAction ( ) ) ) ; params.setId ( parentId ) ; params.setVm ( isVm ( parentId ) ) ; return params ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.WatchDog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { validateEnums ( org.ovirt.engine.api.model.WatchDog.class , model ) ; org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setModel ( org.ovirt.engine.core.common.businessentities.VmWatchdogType.getByName ( model.getModel ( ) ) ) ; params.setAction ( org.ovirt.engine.core.common.businessentities.VmWatchdogAction.getByName ( model.getAction ( ) ) ) ; params.setId ( parentId ) ; params.setVm ( parentIsVm ) ; return params ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult validateVmStatusUsingMatrix ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ! ( org.ovirt.engine.core.common.VdcActionUtils.CanExecute ( java.util.Arrays.asList ( vm ) , org.ovirt.engine.core.common.businessentities.VM.class , VdcActionType.RunVm ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateVmStatusUsingMatrix ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ! ( org.ovirt.engine.core.common.VdcActionUtils.canExecute ( java.util.Arrays.asList ( vm ) , org.ovirt.engine.core.common.businessentities.VM.class , VdcActionType.RunVm ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( vm.getStatus ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void detachUserFromVmFromPool ( ) { if ( ! ( Guid.Empty.equals ( getAdUserId ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.Permission perm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getForRoleAndAdElementAndObject ( PredefinedRoles.ENGINE_USER.getId ( ) , getAdUserId ( ) , getVmId ( ) ) ; if ( perm != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . remove ( perm.getId ( ) ) ; } } }

Target:
protected void detachUserFromVmFromPool ( ) { if ( ! ( Guid.Empty.equals ( getAdUserId ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.Permission perm = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getPermissionDao ( ) . getForRoleAndAdElementAndObject ( PredefinedRoles.ENGINE_USER.getId ( ) , getAdUserId ( ) , getVmId ( ) ) ; if ( perm != null ) { org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getPermissionDao ( ) . remove ( perm.getId ( ) ) ; } } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.KatelloErratum model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , org.ovirt.engine.api.restapi.utils.HexUtils.hex2string ( model.getId ( ) ) ) ; org.junit.Assert.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.KatelloErratum model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , org.ovirt.engine.api.restapi.utils.HexUtils.hex2string ( model.getId ( ) ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; verifyLinks ( model ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.ArchitectureType map ( org.ovirt.engine.api.model.Architecture model , org.ovirt.engine.core.common.businessentities.ArchitectureType template ) { if ( model != null ) { switch ( model ) { case UNDEFINED : return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; case X86_64 : return org.ovirt.engine.core.common.businessentities.ArchitectureType.x86_64 ; case PPC64 : return org.ovirt.engine.core.common.businessentities.ArchitectureType.ppc64 ; default : return null ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.ArchitectureType map ( org.ovirt.engine.api.model.Architecture model , org.ovirt.engine.core.common.businessentities.ArchitectureType template ) { if ( model != null ) { switch ( model ) { case UNDEFINED : return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; case X86_64 : return org.ovirt.engine.core.common.businessentities.ArchitectureType.x86_64 ; case PPC64 : return org.ovirt.engine.core.common.businessentities.ArchitectureType.ppc64 ; case S390X : return org.ovirt.engine.core.common.businessentities.ArchitectureType.s390x ; default : return null ; } } return null ; }
Source:
private void addInlineDisks ( org.ovirt.engine.api.model.Vm vm ) { org.ovirt.engine.api.restapi.resource.BackendVmDisksResource disksResource = inject ( new org.ovirt.engine.api.restapi.resource.BackendVmDisksResource ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( vm.getId ( ) ) , org.ovirt.engine.core.common.queries.VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( vm.getId ( ) ) ) ) ) ; org.ovirt.engine.api.model.Disks disks = disksResource.list ( ) ; vm.setDisks ( disks ) ; }

Target:
private void addInlineDisks ( org.ovirt.engine.api.model.Vm vm ) { org.ovirt.engine.core.compat.Guid vmId = asGuid ( vm.getId ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendVmDisksResource disksResource = inject ( new org.ovirt.engine.api.restapi.resource.BackendVmDisksResource ( vmId ) ) ; org.ovirt.engine.api.model.Disks disks = disksResource.list ( ) ; vm.setDisks ( disks ) ; }
Source:
private boolean connectStorageToLunByVdsId ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.LUNs lun ) { try { return org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getstorage_type ( ) ) . connectStorageToLunByVdsId ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) , vds.getId ( ) , lun , Guid.Empty ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { final org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.ConnectAllHostsToLunCommandReturnValue result = getResult ( ) ; result.setFailedVds ( vds ) ; result.setFailedLun ( lun ) ; throw e ; } }

Target:
private boolean connectStorageToLunByVdsId ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.LUNs lun ) { try { return org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getStorageType ( ) ) . connectStorageToLunByVdsId ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) , vds.getId ( ) , lun , Guid.Empty ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { final org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.ConnectAllHostsToLunCommandReturnValue result = getResult ( ) ; result.setFailedVds ( vds ) ; result.setFailedLun ( lun ) ; throw e ; } }
Source:
private void addEntriesToCummulativeStatistics ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.FopStats > fopStats ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > > fopStatsEntities = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > > ( ) ; for ( int i = 0 ; i < ( fopStats.size ( ) ) ; i ++ ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > fopStatEntity = new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > ( fopStats.get ( i ) ) ; fopStatsEntities.add ( fopStatEntity ) ; } getCumulativeStatistics ( ) . setItems ( fopStatsEntities ) ; }

Target:
public void setSuccessfulProfileStatsFetch ( boolean successfulProfileStatsFetch ) { this . successfulProfileStatsFetch = successfulProfileStatsFetch ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "statusOfFetchingProfileStats" ) ) ; }
Source:
public static int map ( org.ovirt.engine.api.model.OsType type , java.lang.Class < java.lang.Integer > incoming ) { for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > e : org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getOsNames ( ) . entrySet ( ) ) { if ( e.getValue ( ) . equalsIgnoreCase ( type.name ( ) . replace ( "_" , "" ) ) ) { return e.getKey ( ) ; } } return 0 ; }

Target:
public static int map ( org.ovirt.engine.api.model.OsType type , java.lang.Class < java.lang.Integer > incoming ) { for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > e : org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) . entrySet ( ) ) { if ( e.getValue ( ) . equalsIgnoreCase ( type.name ( ) . replace ( "_" , "" ) ) ) { return e.getKey ( ) ; } } return 0 ; }
Source:
public void testAlerts ( ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 100 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( "Events: severity=error" , true ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; junit.framework.Assert.assertEquals ( "SELECT * FROM (SELECT audit_log.* FROM audit_log WHERE audit_log.severity = '2' and (not deleted) ORDER BY audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 0" , query ) ; }

Target:
public void testAlerts ( ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 100 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.CreateBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( "Events: severity=error" , true ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; junit.framework.Assert.assertEquals ( "SELECT * FROM (SELECT audit_log.* FROM audit_log WHERE audit_log.severity = '2' and (not deleted) ORDER BY audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 0" , query ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.compat.Guid networkId , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNicId ( nicId ) ; networkAttachment.setNicName ( nicName ) ; networkAttachment.setNetworkId ( networkId ) ; networkAttachment.setNetworkName ( networkName ) ; return networkAttachment ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.compat.Guid networkId , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNicId ( nicId ) ; networkAttachment.setNicName ( nicName ) ; networkAttachment.setNetworkId ( networkId ) ; networkAttachment.setNetworkName ( networkName ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = org.ovirt.engine.core.utils.NetworkUtils.createDefaultIpConfiguration ( ) ; networkAttachment.setIpConfiguration ( ipConfiguration ) ; return networkAttachment ; }
Source:
public void networkQosDoesntExist ( ) throws java.lang.Exception { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkQosDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ) ; }

Target:
public void networkQosDoesntExist ( ) throws java.lang.Exception { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkQosDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetDomainExpectations ( StorageType.NFS , false ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetDomainExpectations ( StorageType.NFS , false ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) return true ; if ( ( o == null ) || ( ( getClass ( ) ) != ( o.getClass ( ) ) ) ) return false ; if ( ! ( super . equals ( o ) ) ) return false ; org.ovirt.engine.core.common.businessentities.storage.CinderDisk that = ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( o ) ) ; return ! ( ( cinderConnectionInfo ) != null ? ! ( cinderConnectionInfo.equals ( that.cinderConnectionInfo ) ) : ( that.cinderConnectionInfo ) != null ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.CinderDisk other = ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( obj ) ) ; return ( super . equals ( obj ) ) && ( java.util.Objects.equals ( cinderConnectionInfo , other.cinderConnectionInfo ) ) ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; getDataCenters ( ) . setItems ( dataCenters ) ; getDataCenters ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCenters ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetExternalNetworkList ( networkQuery , provider.getId ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dataCenters.addAll ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getExternalNetworkMap ( networkQuery , provider.getId ( ) ) ; }
Source:
private void initProfileParentList ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel < P , Q , R > model ) { model.getParentListModel ( ) . setItems ( java.util.Arrays.< R > asList ( getParentEntity ( ) ) ) ; model.getParentListModel ( ) . setSelectedItem ( getParentEntity ( ) ) ; model.getParentListModel ( ) . setIsChangable ( false ) ; }

Target:
private void initProfileParentList ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel < P , Q , R > model ) { model.getParentListModel ( ) . setItems ( java.util.Arrays.< R > asList ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileListModel.getEntity ( ) ) ) ; model.getParentListModel ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileListModel.getEntity ( ) ) ; model.getParentListModel ( ) . setIsChangable ( false ) ; }
Source:
protected java.util.HashMap < java.lang.String , java.lang.Object > getSpecParams ( ) { java.util.HashMap < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( "action" , org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getAction ( ) . name ( ) . toLowerCase ( ) ) ; specParams.put ( "model" , org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getModel ( ) . name ( ) ) ; return specParams ; }

Target:
protected java.util.HashMap < java.lang.String , java.lang.Object > getSpecParams ( ) { org.ovirt.engine.core.common.businessentities.VmWatchdog watchdog = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getModel ( ) , org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getAction ( ) ) ; return watchdog.getSpecParams ( ) ; }
Source:
public void refresh ( ) { log.debug ( "Affinity Rules Enforcement Manager interval reached." ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmCandidates = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : findMigrationFreeClusters ( ) ) { final org.ovirt.engine.core.common.businessentities.VM candidate = rulesEnforcer.chooseNextVmToMigrate ( cluster ) ; if ( candidate != null ) { vmCandidates.add ( candidate ) ; } } for ( org.ovirt.engine.core.common.businessentities.VM vm : vmCandidates ) { migrateVM ( vm ) ; } }

Target:
public void refresh ( ) { log.debug ( "Affinity Rules Enforcement Manager interval reached." ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmCandidates = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : vdsGroupDao.getWithoutMigratingVms ( ) ) { final org.ovirt.engine.core.common.businessentities.VM candidate = rulesEnforcer.chooseNextVmToMigrate ( cluster ) ; if ( candidate != null ) { vmCandidates.add ( candidate ) ; } } for ( org.ovirt.engine.core.common.businessentities.VM vm : vmCandidates ) { migrateVM ( vm ) ; } }