auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGuidListValuesWithOneGuid ( ) { java.lang.String listValues = "e61f7070-cd52-46ca-88c2-686e1c70fe44" ; java.util.List < org.ovirt.engine.core.compat.Guid > stringList = org.ovirt.engine.core.utils.GuidUtils.getGuidListFromString ( listValues ) ; java.util.List < org.ovirt.engine.core.compat.Guid > expectedList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; expectedList.add ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "e61f7070-cd52-46ca-88c2-686e1c70fe44" ) ) ; org.junit.Assert.assertEquals ( expectedList , stringList ) ; }

Target:
public void testGuidListValuesWithOneGuid ( ) { java.lang.String listValues = "e61f7070-cd52-46ca-88c2-686e1c70fe44" ; java.util.List < org.ovirt.engine.core.compat.Guid > stringList = org.ovirt.engine.core.utils.GuidUtils.getGuidListFromString ( listValues ) ; java.util.List < org.ovirt.engine.core.compat.Guid > expectedList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; expectedList.add ( new org.ovirt.engine.core.compat.Guid ( "e61f7070-cd52-46ca-88c2-686e1c70fe44" ) ) ; org.junit.Assert.assertEquals ( expectedList , stringList ) ; }
Source:
private void localize ( ) { lvNameEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.logicalVolume ( ) ) ; mountPointEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.mountPoint ( ) ) ; sizeEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.lvSize ( ) ) ; raidParamsLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.raidParameters ( ) ) ; raidTypeEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.raidType ( ) ) ; noOfPhysicalDisksEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.noOfPhysicalDisksInRaidVolume ( ) ) ; stripeSizeLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.stripeSize ( ) ) ; deviceHeader.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.storageDevices ( ) ) ; }

Target:
private void localize ( ) { stripeSizeLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.stripeSize ( ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.StorageConnectionExtension extension = resource.get ( ) ; assertNotNull ( extension ) ; assertEquals ( extension.getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionResourceTest.extensionID.toString ( ) ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageConnectionExtension extension = resource.get ( ) ; assertNotNull ( extension ) ; assertEquals ( extension.getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionResourceTest.extensionID.toString ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType , boolean forceRefresh ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > repoList ; if ( ! ( isStorageDomainValid ( storageDomainId , imageType , forceRefresh ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.GetIsoListError ) ; } repoList = getCachedIsoListByDomainId ( storageDomainId , imageType ) ; return repoList ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType , boolean forceRefresh ) { if ( ! ( isStorageDomainValid ( storageDomainId , imageType , forceRefresh ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.GetIsoListError ) ; } return getCachedIsoListByDomainId ( storageDomainId , imageType ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcActionParametersBase getParentParameters ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParametersForTask ( parentCommand , getParameters ( ) ) ; if ( ( ( parentParameters.getParametersCurrentUser ( ) ) == null ) && ( ( org.ovirt.engine.core.bll.CommandBase.getCurrentUser ( ) ) != null ) ) { parentParameters.setParametersCurrentUser ( org.ovirt.engine.core.bll.CommandBase.getCurrentUser ( ) ) ; } return parentParameters ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParentParameters ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParametersForTask ( parentCommand , getParameters ( ) ) ; if ( ( ( parentParameters.getParametersCurrentUser ( ) ) == null ) && ( ( org.ovirt.engine.core.bll.CommandBase.getCurrentUser ( ) ) != null ) ) { parentParameters.setParametersCurrentUser ( org.ovirt.engine.core.bll.CommandBase.getCurrentUser ( ) ) ; } return parentParameters ; }
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public java.lang.Long determineImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.Image sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid srcDomain , org.ovirt.engine.core.compat.Guid dstDomain , org.ovirt.engine.core.compat.Guid imageGroupID ) { if ( isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage imageInfoFromStorage = getVolumeInfoFromVdsm ( storagePoolId , srcDomain , imageGroupID , sourceImage.getId ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , imageInfoFromStorage.getActualSizeInBytes ( ) ) ; } return null ; }

Target:
public static java.lang.Long determineImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.Image sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid srcDomain , org.ovirt.engine.core.compat.Guid dstDomain , org.ovirt.engine.core.compat.Guid imageGroupID ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage imageInfoFromStorage = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getVolumeInfoFromVdsm ( storagePoolId , srcDomain , imageGroupID , sourceImage.getId ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , imageInfoFromStorage.getActualSizeInBytes ( ) ) ; } return null ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; vmListModel.postGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; postGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }
Source:
protected void executeValidatedCommand ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( ( ( executionContext ) == null ) || ( executionContext.isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) , new java.lang.Boolean ( hasCorrelationIdMap.get ( command.getCommandId ( ) ) ) ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setCorrelationId ( command.getCorrelationId ( ) ) ; command.executeAction ( ) ; }

Target:
protected void executeValidatedCommand ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( ( ( executionContext ) == null ) || ( executionContext.isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) , hasCorrelationIdMap.get ( command.getCommandId ( ) ) ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setCorrelationId ( command.getCorrelationId ( ) ) ; command.executeAction ( ) ; }
Source:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object networkQoS : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.action.QosParametersBase < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > parameter = new org.ovirt.engine.core.common.action.QosParametersBase < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS tempQos = ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( networkQoS ) ) ; parameter.setQos ( tempQos ) ; parameters.add ( parameter ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RemoveNetworkQoS , parameters ) ; cancel ( ) ; }

Target:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < > ( ) ; for ( java.lang.Object networkQoS : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.action.QosParametersBase < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > parameter = new org.ovirt.engine.core.common.action.QosParametersBase ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS tempQos = ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( networkQoS ) ) ; parameter.setQos ( tempQos ) ; parameters.add ( parameter ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RemoveNetworkQoS , parameters ) ; cancel ( ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.AbstractErrataCountModel transferObj ) { errataTableView.getErrataTable ( ) . setLoadingState ( LoadingState.LOADING ) ; model.setGuid ( transferObj.getGuid ( ) ) ; errataTableView.init ( model ) ; org.ovirt.engine.core.common.businessentities.HasErrata entity = transferObj.getEntity ( ) ; model.setEntity ( entity ) ; model.search ( ) ; buildErrataDetailPanel ( ) ; setErrataDetailPanelVisibilty ( false ) ; errataTableView.edit ( ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.AbstractErrataCountModel transferObj ) { errataTableView.getErrataTable ( ) . setLoadingState ( LoadingState.LOADING ) ; model.setGuid ( transferObj.getGuid ( ) ) ; errataTableView.init ( model ) ; org.ovirt.engine.core.common.businessentities.HasErrata entity = transferObj.getEntity ( ) ; model.setEntity ( entity ) ; model.search ( ) ; setErrataDetailPanelVisibilty ( false ) ; }
Source:
public void bondWithNoNetowrkAttached ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; validateAndExpectNoViolations ( helper ) ; assertBondModified ( helper , bond ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }

Target:
public void bondWithNoNetowrkAttached ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; validateAndExpectNoViolations ( helper ) ; assertBondModified ( helper , bond ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( getNic ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; } if ( ( ( getNic ( ) . getLabels ( ) ) == null ) || ( ! ( getNic ( ) . getLabels ( ) . contains ( org.ovirt.engine.core.bll.network.host.UnlabelNicCommand.getParameters ( ) . getLabel ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.INTERFACE_NOT_LABELED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( getNic ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; } if ( ( ( getNic ( ) . getLabels ( ) ) == null ) || ( ! ( getNic ( ) . getLabels ( ) . contains ( getLabel ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.INTERFACE_NOT_LABELED ) ; } return true ; }
Source:
public void twoNetworkInterfacesWithNullIp ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > listOfInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ; listOfInterfaces.add ( createVdsNetworkInterfaceWithStaticIp ( null ) ) ; listOfInterfaces.add ( createVdsNetworkInterfaceWithStaticIp ( null ) ) ; validateAndAssertResult ( listOfInterfaces , true ) ; }

Target:
public void twoNetworkInterfacesWithNullIp ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > listOfInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; listOfInterfaces.add ( createVdsNetworkInterfaceWithStaticIp ( null ) ) ; listOfInterfaces.add ( createVdsNetworkInterfaceWithStaticIp ( null ) ) ; validateAndAssertResult ( listOfInterfaces , true ) ; }
Source:
public void setup ( ) { org.ovirt.engine.core.common.config.IConfigUtilsInterface configUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( configUtils.getValue ( ConfigValues.AdUserPassword , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( new java.util.HashMap < java.lang.String , java.lang.String > ( ) ) ; org.mockito.Mockito.when ( configUtils.getValue ( ConfigValues.AdUserName , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( "" ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( configUtils ) ; }

Target:
public void setup ( ) { org.ovirt.engine.core.common.config.IConfigUtilsInterface configUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( configUtils ) ; }
Source:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expectedProfileInfo ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeProfileInfo ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; }

Target:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expectedProfileInfo ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeProfileInfo ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosValuesTest ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; iface.setQosOverridden ( true ) ; mockExistingIfaces ( iface ) ; iface.setQos ( qos ) ; return createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; }

Target:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosValuesTest ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQos ( qos ) ; return createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute Logoff: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.asyncCallback.OnSuccess ( callback.getModel ( ) , null ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute Logoff: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.asyncCallback.onSuccess ( callback.getModel ( ) , null ) ; }
Source:
private void UpdateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.Network network = ( ( org.ovirt.engine.core.common.businessentities.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangeble = ( ( getIsStaticAddress ( ) ) && ( network != null ) ) && ( ! ( network.getId ( ) . equals ( NGuid.Empty ) ) ) ; getAddress ( ) . setIsChangable ( isChangeble ) ; getSubnet ( ) . setIsChangable ( isChangeble ) ; getGateway ( ) . setIsChangable ( isChangeble ) ; }

Target:
private void UpdateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangeble = ( ( getIsStaticAddress ( ) ) && ( network != null ) ) && ( ! ( network.getId ( ) . equals ( NGuid.Empty ) ) ) ; getAddress ( ) . setIsChangable ( isChangeble ) ; getSubnet ( ) . setIsChangable ( isChangeble ) ; getGateway ( ) . setIsChangable ( isChangeble ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getBroker ( ) . getStorageDomainInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , org.ovirt.engine.core.compat.Guid > pairSdStatic = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.buildStorageStaticFromStruct ( result.storageInfo ) ; pairSdStatic.getFirst ( ) . setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( pairSdStatic ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getBroker ( ) . getStorageDomainInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , org.ovirt.engine.core.compat.Guid > pairSdStatic = buildStorageStaticFromStruct ( result.storageInfo ) ; pairSdStatic.getFirst ( ) . setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( pairSdStatic ) ; }
Source:
public void rollback ( ) { super . rollback ( ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.bll.RestartVdsCommand.getVdsId ( ) ; org.ovirt.engine.core.bll.RestartVdsCommand.log.warnFormat ( "Restart host action failed, updating host {0} to {1}" , vdsId , VDSStatus.NonResponsive.name ( ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( vdsId , org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ; }

Target:
public void rollback ( ) { super . rollback ( ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.bll.RestartVdsCommand.getVdsId ( ) ; log.warnFormat ( "Restart host action failed, updating host {0} to {1}" , vdsId , VDSStatus.NonResponsive.name ( ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( vdsId , org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ; }
Source:
public void testValidateNoVM ( ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setId ( new org.ovirt.engine.core.compat.Guid ( "a09f57b1-5739-4352-bf88-a6f834ed46db" ) ) ; params.setAction ( VmWatchdogAction.PAUSE ) ; params.setModel ( vmWatchdogType ) ; final org.ovirt.engine.core.dao.VmDao vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDao.class ) ; org.ovirt.engine.core.bll.UpdateWatchdogCommand command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateWatchdogCommand ( params , null ) ) ; org.mockito.Mockito.doReturn ( vmDaoMock ) . when ( command ) . getVmDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void testValidateNoVM ( ) { command.getParameters ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( "a09f57b1-5739-4352-bf88-a6f834ed46db" ) ) ; command.getParameters ( ) . setAction ( VmWatchdogAction.PAUSE ) ; command.getParameters ( ) . setModel ( vmWatchdogType ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
private void loadFile ( java.nio.file.Path path ) { try ( java.io.BufferedReader reader = java.nio.file.Files.newBufferedReader ( path , java.nio.charset.StandardCharsets.UTF_8 ) ) { properties = new java.util.Properties ( properties ) ; properties.load ( reader ) ; log.info ( ( "Loaded file " + path ) ) ; } catch ( java.io.IOException e ) { log.error ( ( "Failed loading file " + path ) ) ; } }

Target:
private void loadFile ( java.nio.file.Path path ) { try ( java.io.BufferedReader reader = java.nio.file.Files.newBufferedReader ( path , java.nio.charset.StandardCharsets.UTF_8 ) ) { properties = new java.util.Properties ( properties ) ; properties.load ( reader ) ; } catch ( java.io.IOException e ) { log.error ( ( "Failed loading file " + path ) ) ; } }
Source:
public void updateInterestedOps ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( outbox.isEmpty ( ) ) && ( ( ( nioEngine ) == null ) || ( ! ( nioEngine.handshakeInProgress ( ) ) ) ) ) { getSelectionKey ( ) . interestOps ( java.nio.channels.SelectionKey.OP_READ ) ; } else { getSelectionKey ( ) . interestOps ( ( ( java.nio.channels.SelectionKey.OP_READ ) | ( java.nio.channels.SelectionKey.OP_WRITE ) ) ) ; } }

Target:
public void updateInterestedOps ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( outbox.isEmpty ( ) ) && ( ( ( this . nioEngine ) == null ) || ( ! ( this . nioEngine.handshakeInProgress ( ) ) ) ) ) { getSelectionKey ( ) . interestOps ( java.nio.channels.SelectionKey.OP_READ ) ; } else { getSelectionKey ( ) . interestOps ( ( ( java.nio.channels.SelectionKey.OP_READ ) | ( java.nio.channels.SelectionKey.OP_WRITE ) ) ) ; } }
Source:
void bindInfrastructure ( ) { bindCommonInfrastructure ( ) ; bind ( com.gwtplatform.mvp.client.proxy.PlaceManager.class ) . to ( org.ovirt.engine.ui.webadmin.place.WebAdminPlaceManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.webadmin.system.ApplicationInit.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.system.InternalConfiguration.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.system.PostMessageDispatcher.class ) . asEagerSingleton ( ) ; }

Target:
void bindInfrastructure ( ) { bindCommonInfrastructure ( org.ovirt.engine.ui.webadmin.place.WebAdminPlaceManager.class ) ; bind ( org.ovirt.engine.ui.webadmin.system.ApplicationInit.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.system.InternalConfiguration.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.system.PostMessageDispatcher.class ) . asEagerSingleton ( ) ; }
Source:
private void prepareMocks ( ) { org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDynamicDao ) . when ( command ) . getStorageDomainDynamicDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolIsoMapDao ) . when ( command ) . getStoragePoolIsoMapDao ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . findConnectionWithSameDetails ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageServerConnections.class ) ) ; org.mockito.Mockito.doReturn ( lunDao ) . when ( command ) . getLunDao ( ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; }

Target:
private void prepareMocks ( ) { org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolIsoMapDao ) . when ( command ) . getStoragePoolIsoMapDao ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . findConnectionWithSameDetails ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageServerConnections.class ) ) ; org.mockito.Mockito.doReturn ( lunDao ) . when ( command ) . getLunDao ( ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cdrom model = new org.ovirt.engine.api.model.Cdrom ( ) ; model.setName ( NAMES [ 0 ] ) ; model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "add" , "file.id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cdrom model = new org.ovirt.engine.api.model.Cdrom ( ) ; model.setName ( NAMES [ 0 ] ) ; model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "add" , "file.id" ) ; } }
Source:
public void testStorageDomainTemplateLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Template template = new org.ovirt.engine.api.model.Template ( ) ; template.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TEMPLATE_ID ) ; template.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; template.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; template = org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , template ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_TEMPLATE_HREF , template.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , template.getStorageDomain ( ) . getHref ( ) ) ; }

Target:
public void testStorageDomainTemplateLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Template template = new org.ovirt.engine.api.model.Template ( ) ; template.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TEMPLATE_ID ) ; template.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; template.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; template = org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( template ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_TEMPLATE_HREF , template.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , template.getStorageDomain ( ) . getHref ( ) ) ; }
Source:
public void testRunQuery_GetUserBySessionId ( ) { java.lang.String sessionId = "sessionId" ; org.ovirt.engine.core.common.queries.VdcQueryType queryType = org.ovirt.engine.core.common.queries.VdcQueryType.GetUserBySessionId ; java.lang.Object result = testServlet.runQuery ( queryType , mockQueryParams , sessionId ) ; org.junit.Assert.assertEquals ( result , mockUser ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setSessionId ( sessionId ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setHttpSessionId ( sessionId ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setFiltered ( testServlet.filterQueries ( ) ) ; org.mockito.Mockito.verify ( mockBackend ) . runQuery ( queryType , mockQueryParams ) ; }

Target:
public void testRunQuery_GetUserBySessionId ( ) { java.lang.String sessionId = "sessionId" ; org.ovirt.engine.core.common.queries.VdcQueryType queryType = org.ovirt.engine.core.common.queries.VdcQueryType.GetUserBySessionId ; java.lang.Object result = testServlet.runQuery ( queryType , mockQueryParams , sessionId ) ; org.junit.Assert.assertEquals ( result , mockUser ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setSessionId ( sessionId ) ; org.mockito.Mockito.verify ( mockQueryParams ) . setFiltered ( testServlet.filterQueries ( ) ) ; org.mockito.Mockito.verify ( mockBackend ) . runQuery ( queryType , mockQueryParams ) ; }
Source:
protected void setUpGetSystemStatisticsExpectations ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryResult = org.powermock.api.easymock.PowerMock.createMock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) ; org.easymock.EasyMock.expect ( backend.RunQuery ( org.easymock.EasyMock.eq ( VdcQueryType.GetSystemStatistics ) , queryParams ( ) ) ) . andReturn ( queryResult ) ; org.easymock.EasyMock.expect ( queryResult.getSucceeded ( ) ) . andReturn ( true ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( queryResult.getReturnValue ( ) ) . andReturn ( setUpStats ( ) ) . anyTimes ( ) ; org.powermock.api.easymock.PowerMock.replayAll ( ) ; }

Target:
protected void setUpGetSystemStatisticsExpectations ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryResult = org.powermock.api.easymock.PowerMock.createMock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) ; org.easymock.EasyMock.expect ( backend.runQuery ( org.easymock.EasyMock.eq ( VdcQueryType.GetSystemStatistics ) , queryParams ( ) ) ) . andReturn ( queryResult ) ; org.easymock.EasyMock.expect ( queryResult.getSucceeded ( ) ) . andReturn ( true ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( queryResult.getReturnValue ( ) ) . andReturn ( setUpStats ( ) ) . anyTimes ( ) ; org.powermock.api.easymock.PowerMock.replayAll ( ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage_domains object ) { if ( ( object.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getstorage_domain_shared_status ( ) ) ; } else { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getstatus ( ) ) ; } }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain object ) { if ( ( object.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getstorage_domain_shared_status ( ) ) ; } else { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getstatus ( ) ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.GetStoragePoolByIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.GetStoragePoolByIdQuery.getDbFacade ( ) . getStoragePoolDao ( ) . get ( org.ovirt.engine.core.bll.storage.GetStoragePoolByIdQuery.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.GetStoragePoolByIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.GetStoragePoolByIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.GetStoragePoolByIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.GetStoragePoolByIdQuery.getDbFacade ( ) . getStoragePoolDao ( ) . get ( org.ovirt.engine.core.bll.storage.GetStoragePoolByIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.GetStoragePoolByIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.GetStoragePoolByIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public boolean isColumnVisible ( com.google.gwt.user.cellview.client.Column < T , ? > column ) { if ( ! ( isColumnPresent ( column ) ) ) { return false ; } boolean visible = true ; if ( columnVisibleMap.containsKey ( column ) ) { visible = columnVisibleMap.get ( column ) ; } if ( visible && ( columnVisibleMapOverride.containsKey ( column ) ) ) { visible = columnVisibleMapOverride.get ( column ) ; } visible = visible && ( ( getHiddenPersistedColumnWidth ( column ) ) == null ) ; return visible ; }

Target:
public boolean isColumnVisible ( com.google.gwt.user.cellview.client.Column < T , ? > column ) { if ( ! ( isColumnPresent ( column ) ) ) { return false ; } boolean visible = true ; if ( columnVisibleMap.containsKey ( column ) ) { visible = columnVisibleMap.get ( column ) ; } if ( visible && ( columnVisibleMapOverride.containsKey ( column ) ) ) { visible = columnVisibleMapOverride.get ( column ) ; } return visible ; }
Source:
public void testPersistNetworkAttachmentsForNotReportedNetworkAttachmentIsNotPersisted ( ) { org.mockito.Mockito.when ( networkAttachmentDao.getAllForHost ( org.mockito.Matchers.eq ( hostId ) ) ) . thenReturn ( new java.util.ArrayList < > ( ) ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface interfaceWithUnreportedNetwork = createVdsNetworkInterface ( "interfaceWithUnreportedNetwork" ) ; interfaceWithUnreportedNetwork.setNetworkName ( "unreportedNetwork" ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister persister = createPersister ( java.util.Collections.emptyList ( ) , interfaceWithUnreportedNetwork ) ; persister.persistNetworkAttachments ( ) ; org.mockito.Mockito.verify ( networkAttachmentDao ) . getAllForHost ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( networkAttachmentDao ) ; }

Target:
public void testPersistNetworkAttachmentsForNotReportedNetworkAttachmentIsNotPersisted ( ) { org.mockito.Mockito.when ( networkAttachmentDao.getAllForHost ( org.mockito.Matchers.eq ( hostId ) ) ) . thenReturn ( new java.util.ArrayList < > ( ) ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface interfaceWithUnreportedNetwork = createVdsNetworkInterface ( ) ; interfaceWithUnreportedNetwork.setNetworkName ( "unreportedNetwork" ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersister persister = createPersister ( java.util.Collections.emptyList ( ) , interfaceWithUnreportedNetwork ) ; persister.persistNetworkAttachments ( ) ; org.mockito.Mockito.verify ( networkAttachmentDao ) . getAllForHost ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( networkAttachmentDao ) ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static 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 ) ; }
Source:
protected void enableDisableBySync ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceModel model ) { boolean bootProtocolsAvailable = model.getBootProtocolsAvailable ( ) ; bootProtocolLabel.setEnabled ( bootProtocolsAvailable ) ; bootProtocol.setEnabled ( bootProtocolsAvailable ) ; bootProtocol.setEnabled ( NetworkBootProtocol.NONE , model.getNoneBootProtocolAvailable ( ) ) ; customPropertiesLabel.setEnabled ( bootProtocolsAvailable ) ; customPropertiesWidget.setEnabled ( bootProtocolsAvailable ) ; }

Target:
protected void enableDisableBySync ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceModel model ) { boolean bootProtocolsAvailable = model.getBootProtocolsAvailable ( ) ; bootProtocolLabel.setEnabled ( bootProtocolsAvailable ) ; bootProtocol.setEnabled ( bootProtocolsAvailable ) ; bootProtocol.setEnabled ( NetworkBootProtocol.NONE , model.getNoneBootProtocolAvailable ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.Network lookupClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.util.List < org.ovirt.engine.api.model.Network > networks ) { for ( org.ovirt.engine.api.model.Network network : networks ) { if ( ( ( id != null ) && ( id.equals ( network.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( network.getname ( ) ) ) ) ) { return network ; } } return null ; }

Target:
protected org.ovirt.engine.api.model.Network lookupClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.util.List < org.ovirt.engine.api.model.Network > networks ) { for ( org.ovirt.engine.api.model.Network network : networks ) { if ( ( ( id != null ) && ( id.equals ( network.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( network.getName ( ) ) ) ) ) { return network ; } } return null ; }
Source:
public void geoRepResumeFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters param = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( ) ; param.setForce ( false ) ; param.setVolumeId ( startedVolumeId ) ; param.setGeoRepSessionId ( geoRepSessionId ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ResumeGeoRepSessionCommand ( param ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.ACTIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void geoRepResumeFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters param = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( ) ; param.setForce ( false ) ; param.setVolumeId ( startedVolumeId ) ; param.setGeoRepSessionId ( geoRepSessionId ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ResumeGeoRepSessionCommand ( param , null ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.ACTIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetCpuProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetCpuProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( ) ; } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.UnLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }

Target:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( true ) ; } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.UnLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }
Source:
private void updateMemoryBoxVisibility ( ) { org.ovirt.engine.core.common.businessentities.VM vm = model.getVm ( ) ; if ( vm == null ) { return ; } boolean memorySnapshotSupported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isMemorySnapshotSupported ( vm ) ; memoryEditor.setVisible ( ( memorySnapshotSupported && ( vm.isRunning ( ) ) ) ) ; if ( ! ( memoryEditor.isVisible ( ) ) ) { model.getMemory ( ) . setEntity ( false ) ; } }

Target:
private void updateMemoryBoxVisibility ( ) { org.ovirt.engine.core.common.businessentities.VM vm = model.getVm ( ) ; if ( vm == null ) { return ; } boolean memorySnapshotSupported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isMemorySnapshotSupported ( vm ) ; memoryEditor.setVisible ( ( memorySnapshotSupported && ( vm.isRunning ( ) ) ) ) ; if ( ! ( memoryEditor.isVisible ( ) ) ) { model.getMemory ( ) . setEntity ( false ) ; } }