auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "IsHostTabVisible" . equals ( propName ) ) { hostPanel.setVisible ( object.getIsHostTabVisible ( ) ) ; } else if ( "IsCustomPropertiesSheetVisible" . equals ( propName ) ) { customPropertiesPanel.setVisible ( object.getIsCustomPropertiesSheetVisible ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateSysprepVisibility ( object ) ; updateInitialRunTabVisibility ( object ) ; }
Source:
private boolean validBootProtocolForRoleNetwork ( ) { if ( ! ( isRoleNetwork ( ) ) ) { return true ; } org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; if ( ipConfiguration == null ) { return false ; } if ( getNetworkCluster ( ) . isMigration ( ) ) { return hasBootProtocol ( ipConfiguration ) ; } return hasIpv4BootProtocol ( ipConfiguration ) ; }

Target:
private boolean validBootProtocolForRoleNetwork ( ) { if ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isRoleNetwork ( getNetworkCluster ( ) ) ) ) { return true ; } org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; if ( ipConfiguration == null ) { return false ; } if ( getNetworkCluster ( ) . isMigration ( ) ) { return hasBootProtocol ( ipConfiguration ) ; } return hasIpv4BootProtocol ( ipConfiguration ) ; }
Source:
private static java.lang.String encode ( java.util.Map < java.lang.String , java.lang.Object > args , java.lang.String clientSecret ) throws java.io.IOException , java.security.GeneralSecurityException { return org.ovirt.engine.core.uutils.crypto.EnvelopePBE.encode ( ( ( java.lang.String ) ( args.get ( "encoding-algorithm" ) ) ) , java.lang.Integer.parseInt ( ( ( java.lang.String ) ( args.get ( "key-size" ) ) ) ) , java.lang.Integer.parseInt ( ( ( java.lang.String ) ( args.get ( "iterations" ) ) ) ) , null , clientSecret ) ; }

Target:
private static java.lang.String encode ( java.util.Map < java.lang.String , java.lang.Object > args , java.lang.String clientSecret ) throws java.io.IOException , java.security.GeneralSecurityException { return org.ovirt.engine.core.uutils.crypto.EnvelopePBE.encode ( ( ( java.lang.String ) ( args.get ( "encoding-algorithm" ) ) ) , java.lang.Integer.parseInt ( ( ( java.lang.String ) ( args.get ( "encoding-keysize" ) ) ) ) , java.lang.Integer.parseInt ( ( ( java.lang.String ) ( args.get ( "encoding-iterations" ) ) ) ) , null , clientSecret ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.removeConnection = false ; storageListModel.OnFinish ( storageListModel.context , true , storageListModel.storageModel ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; if ( storageListModel.removeConnection ) { storageListModel.cleanConnection ( storageListModel.connection , storageListModel.hostId ) ; storageListModel.removeConnection = false ; } storageListModel.onFinish ( storageListModel.context , false , storageListModel.storageModel ) ; }
Source:
private void onForceSave ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; if ( ( confirmationModel != null ) && ( ! ( confirmationModel.validate ( ) ) ) ) { return ; } cancelConfirm ( ) ; getSanStorageModel ( ) . setForce ( true ) ; onSave ( ) ; }

Target:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = getStorageDomain ( ) . getSelectedItem ( ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; if ( getIsNew ( ) ) { getIsWipeAfterDelete ( ) . setEntity ( selectedStorage.getWipeAfterDelete ( ) ) ; } } updateQuota ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateDiskProfiles ( getDataCenter ( ) . getSelectedItem ( ) ) ; updateCinderVolumeTypes ( ) ; updatePassDiscardAvailability ( ) ; }
Source:
public void initTable ( final org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { super . initTable ( constants ) ; getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.BooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.BooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } } ; getTable ( ) . addColumnWithHtmlHeader ( portMirroringColumn , constants.portMirroring ( ) , "85px" ) ; }

Target:
public void initTable ( final org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { super . initTable ( constants ) ; getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.BooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.BooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } } ; portMirroringColumn.makeSortable ( ) ; getTable ( ) . addColumnWithHtmlHeader ( portMirroringColumn , constants.portMirroring ( ) , "85px" ) ; }
Source:
public void updatePartialVdsDynamicCalc ( org.ovirt.engine.core.compat.Guid id , int vmCount , int pendingVcpusCount , int pendingVmemSize , int memCommited , int vmsCoresCount ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_guid" , id ) . addValue ( "vmCount" , vmCount ) . addValue ( "pendingVcpusCount" , pendingVcpusCount ) . addValue ( "pendingVmemSize" , pendingVmemSize ) . addValue ( "memCommited" , memCommited ) . addValue ( "vmsCoresCount" , vmsCoresCount ) ; getCallsHandler ( ) . executeModification ( "UpdatePartialVdsDynamicCalc" , parameterSource ) ; }

Target:
public void updateExternalStatus ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.businessentities.ExternalStatus status ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_guid" , id ) . addValue ( "external_status" , status ) ; getCallsHandler ( ) . executeModification ( "UpdateHostExternalStatus" , parameterSource ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.CleanConnection ( storageListModel.connection , storageListModel.hostId ) ; storageListModel.OnFinish ( storageListModel.context , false , storageListModel.storageModel ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
private void Preview ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.TryBackToAllSnapshotsOfVm , new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }

Target:
private void preview ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.TryBackToAllSnapshotsOfVm , new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }
Source:
public static org.ovirt.engine.api.restapi.model.StorageFormat map ( org.ovirt.engine.core.common.businessentities.StorageFormatType model , org.ovirt.engine.api.restapi.model.StorageFormat template ) { if ( model == null ) { return null ; } switch ( model ) { case V1 : return org.ovirt.engine.api.restapi.model.StorageFormat.V1 ; case V2 : return org.ovirt.engine.api.restapi.model.StorageFormat.V2 ; default : assert false : "unknown storage-format value: " + ( model.toString ( ) ) ; return null ; } }

Target:
public static org.ovirt.engine.api.restapi.model.StorageFormat map ( org.ovirt.engine.core.common.businessentities.StorageFormatType model , org.ovirt.engine.api.restapi.model.StorageFormat template ) { if ( model == null ) { return null ; } switch ( model ) { case V1 : return org.ovirt.engine.api.restapi.model.StorageFormat.V1 ; case V2 : return org.ovirt.engine.api.restapi.model.StorageFormat.V2 ; case V3 : return org.ovirt.engine.api.restapi.model.StorageFormat.V3 ; default : assert false : "unknown storage-format value: " + ( model.toString ( ) ) ; return null ; } }
Source:
public org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel > getNetworkGeneralProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider ) { return new org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel > ( eventBus , defaultConfirmPopupProvider , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel.class , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel > getNetworkGeneralProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel > mainModelProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel > modelProvider ) { org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel > result = new org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel > ( eventBus , defaultConfirmPopupProvider ) ; result.setMainModelProvider ( mainModelProvider ) ; result.setModelProvider ( modelProvider ) ; return result ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configList" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigSet ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String configValue ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepConfigSet" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "key" , configKey ) . withParameter ( "value" , configValue ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
protected javax.ws.rs.core.Response performRemove ( java.lang.String id ) { org.ovirt.engine.core.common.scheduling.AffinityGroup affinityGroup = getEntity ( ) ; if ( ! ( affinityGroup.getEntityIds ( ) . remove ( asGuid ( id ) ) ) ) { throw new javax.ws.rs.WebApplicationException ( Response.Status.NOT_FOUND ) ; } return performAction ( VdcActionType.EditAffinityGroup , new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( affinityGroup.getId ( ) , affinityGroup ) ) ; }

Target:
public org.ovirt.engine.api.resource.AffinityGroupVmResource getAffinityGroupVmSubResource ( java.lang.String id ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendAffinityGroupVmResource ( affinityGroupId , id ) ) ; }
Source:
protected int calcSpmCpuConsumption ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( vds.getSpmStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ? 0 : ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SpmVCpuConsumption ) ) * ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VcpuConsumptionPercentage ) ) ) / ( vds.getCpuCores ( ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondarySources ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) ? java.lang.Long.valueOf ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED ) ) : 0L ; return getOverUtilizedMemoryHosts ( candidateHosts , requiredMemory ) ; }
Source:
public void validateSucceedsWithStopActionTypeAndClusterId ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; cmd.getParameters ( ) . setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd.setClusterId ( cmd.getParameters ( ) . getClusterId ( ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceedsWithStopActionType ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; prepareMocks ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void testAddIncompleteParameters2 ( ) { org.ovirt.engine.api.model.Disk model = org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.getModel ( ) ; model.setProvisionedSize ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters2" , "provisionedSize|size" ) ; } }

Target:
public void testAddIncompleteParameters2 ( ) { org.ovirt.engine.api.model.Disk model = org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.getModel ( ) ; model.setProvisionedSize ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters2" , "provisionedSize|size" ) ; } }
Source:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }

Target:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }
Source:
public void getNetworkLabelsByDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.ui.frontend.AsyncQuery query ) { query.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.SortedSet < java.lang.String > > ( ) { @ java.lang.Override public java.util.SortedSet < java.lang.String > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworkLabelsByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , query ) ; }

Target:
public void getNetworkLabelsByDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.ui.frontend.AsyncQuery < java.util.SortedSet < java.lang.String > > query ) { query.converterCallback = new org.ovirt.engine.ui.frontend.Converter < java.util.SortedSet < java.lang.String > > ( ) { @ java.lang.Override public java.util.SortedSet < java.lang.String > convert ( java.lang.Object returnValue ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworkLabelsByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , query ) ; }
Source:
public void testEmptyVms ( ) { org.ovirt.engine.core.common.businessentities.VM srcVm = createEmptyVm ( ) ; org.ovirt.engine.core.common.businessentities.VM dstVm = createEmptyVm ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getOriginal ( ) ) . thenReturn ( srcVm ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getUpdated ( ) ) . thenReturn ( dstVm ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertFalse ( ( ( boolean ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testEmptyVms ( ) { org.ovirt.engine.core.common.businessentities.VM srcVm = createEmptyVm ( ) ; org.ovirt.engine.core.common.businessentities.VM dstVm = createEmptyVm ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getOriginal ( ) ) . thenReturn ( srcVm ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getUpdated ( ) ) . thenReturn ( dstVm ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( java.util.List < java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) . isEmpty ( ) ) ; }
Source:
public static void prepareImage ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid newStorageDomainID , org.ovirt.engine.core.compat.Guid newImageGroupId , org.ovirt.engine.core.compat.Guid newImageId , org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.PrepareImage , new org.ovirt.engine.core.common.vdscommands.PrepareImageVDSCommandParameters ( vdsId , storagePoolId , newStorageDomainID , newImageGroupId , newImageId , true ) ) ; }

Target:
public void prepareImage ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid newStorageDomainID , org.ovirt.engine.core.compat.Guid newImageGroupId , org.ovirt.engine.core.compat.Guid newImageId , org.ovirt.engine.core.compat.Guid vdsId ) { resourceManager.runVdsCommand ( VDSCommandType.PrepareImage , new org.ovirt.engine.core.common.vdscommands.PrepareImageVDSCommandParameters ( vdsId , storagePoolId , newStorageDomainID , newImageGroupId , newImageId , true ) ) ; }
Source:
private void addNetworkToPool ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setName ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultManagementNetwork ) ) + "2" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = new java.util.ArrayList < > ( ) ; networks.add ( network ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }

Target:
private void addManagementNetworksToPool ( int numberOfNetworks ) { for ( int i = 0 ; i < numberOfNetworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid managementNetworkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; allDcNetworks.add ( createNetwork ( managementNetworkId ) ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( managementNetworkId ) ) . thenReturn ( true ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }
Source:
public java.lang.String getDescription ( ) { return ( ( ( ( ( ( ( ( ( "OS: " + ( operatingsystemName ) ) + "\n" ) + " | Subnet: " ) + ( subnetName ) ) + "\n" ) + " | Domain: " ) + ( domainName ) ) + "\n" ) + " | Arch: " ) + ( architectureName ) ; }

Target:
public java.lang.String getDescription ( ) { return ( ( ( ( ( ( ( ( ( "OS: " + ( ( operatingsystemName ) != null ? operatingsystemName : "[N/A]" ) ) + "\n" ) + " | Subnet: " ) + ( ( subnetName ) != null ? subnetName : "[N/A]" ) ) + "\n" ) + " | Domain: " ) + ( ( domainName ) != null ? domainName : "[N/A]" ) ) + "\n" ) + " | Arch: " ) + ( ( architectureName ) != null ? architectureName : "[N/A]" ) ; }
Source:
public void testDetachUserGroupFromTag ( ) { dao.detachUserGroupFromTag ( existingUserGroupTag.gettag_id ( ) , existingUserGroupTag.getgroup_id ( ) ) ; org.ovirt.engine.core.common.businessentities.TagsUserGroupMap result = dao.getTagUserGroupByGroupIdAndByTagId ( existingUserGroupTag.gettag_id ( ) , existingUserGroupTag.getgroup_id ( ) ) ; assertNull ( result ) ; }

Target:
public void testDetachUserGroupFromTag ( ) { dao.detachUserGroupFromTag ( existingUserGroupTag.gettag_id ( ) , existingUserGroupTag.getgroup_id ( ) ) ; org.ovirt.engine.core.common.businessentities.TagsUserGroupMap result = dao.getTagUserGroupByGroupIdAndByTagId ( existingUserGroupTag.gettag_id ( ) , existingUserGroupTag.getgroup_id ( ) ) ; org.junit.Assert.assertNull ( result ) ; }
Source:
private void networkNotUsedByVmsTest ( org.ovirt.engine.core.bll.ValidationResult expected , java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { org.ovirt.engine.core.dao.VmDAO vmDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDAO.class ) ; org.mockito.Mockito.when ( vmDao.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vms ) ; org.mockito.Mockito.when ( dbFacade.getVmDao ( ) ) . thenReturn ( vmDao ) ; org.junit.Assert.assertEquals ( expected.getMessage ( ) , validator.networkNotUsedByVms ( ) . getMessage ( ) ) ; }

Target:
private void networkNotUsedByVmsTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { org.ovirt.engine.core.dao.VmDAO vmDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDAO.class ) ; org.mockito.Mockito.when ( vmDao.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vms ) ; org.mockito.Mockito.when ( dbFacade.getVmDao ( ) ) . thenReturn ( vmDao ) ; org.junit.Assert.assertThat ( validator.networkNotUsedByVms ( ) , matcher ) ; }
Source:
public void addExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS ) ; }

Target:
public void addExistingConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection , null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getById ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterHook = getCallsHandler ( ) . executeRead ( "GetGlusterHookById" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterHookRowMapper , createGlusterHookIdParams ( id ) ) ; if ( glusterHook != null ) { getGlusterServerHook ( glusterHook , null ) ; } return glusterHook ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getGlusterHook ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String glusterCommand , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStage stage , java.lang.String hookName ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterHook = getCallsHandler ( ) . executeRead ( "GetGlusterHook" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterHookRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , clusterId ) . addValue ( "gluster_command" , glusterCommand ) . addValue ( "stage" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( stage ) ) . addValue ( "name" , hookName ) . addValue ( "includeContent" , false ) ) ; return glusterHook ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { fetchSSHFingerprint ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( pk ) ; } }
Source:
private void setUpGetCertuficateExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.ovirt.engine.api.restapi.resource.BackendVmResourceTest.CERTIFICATE ) ; }

Target:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.Vm model , int index ) { assertNotNull ( model.getCluster ( ) . getId ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }
Source:
public static void GetTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , aQuery ) ; }

Target:
public static void GetStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRemove" ) ) { OnRemove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRestore" ) ) { OnRestore ( ) ; } }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command.getName ( ) . equals ( "OnRemove" ) ) { OnRemove ( ) ; } else if ( command.getName ( ) . equals ( "OnRestore" ) ) { OnRestore ( ) ; } else if ( command.getName ( ) . equals ( "onClone" ) ) { onClone ( ) ; } else if ( command.getName ( ) . equals ( "closeClone" ) ) { closeClone ( ) ; } }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void canDoActionFailsOnNullHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }
Source:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void getStorageDomainList ( 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.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void testGetExportNotFound ( ) { setUpGetStorageDomainExpectations ( StorageDomainType.ImportExport ) ; setUpGetEntityExpectations ( StorageDomainType.ImportExport , org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID , true ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetExportNotFound ( ) { setUpGetStorageDomainExpectations ( StorageDomainType.ImportExport ) ; setUpGetEntityExpectations ( StorageDomainType.ImportExport , org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID , true ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private void clusterSelectedItemChanged ( ) { if ( ( getCluster ( ) . getSelectedItem ( ) ) != null ) { getAddBricksCommand ( ) . setIsExecutionAllowed ( true ) ; } else { getAddBricksCommand ( ) . setIsExecutionAllowed ( false ) ; } }

Target:
private void clusterSelectedItemChanged ( ) { if ( ( getCluster ( ) . getSelectedItem ( ) ) != null ) { getAddBricksCommand ( ) . setIsExecutionAllowed ( true ) ; } else { getAddBricksCommand ( ) . setIsExecutionAllowed ( false ) ; } setBricks ( new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ) ; }
Source:
public void testIsQcowV3SupportedForDcVersionV3 ( ) { disk1.setVolumeFormat ( VolumeFormat.COW ) ; disk1.setQcowCompat ( QcowCompat.QCOW2_V3 ) ; org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setStoragePoolFormatType ( StorageFormatType.V3 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( sp ) ; org.junit.Assert.assertThat ( validator.isQcowVersionSupportedForDcVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_QCOW_COMPAT_DOES_NOT_MATCH_DC_VERSION ) ) ; }

Target:
public void testIsQcowV3SupportedForDcVersionV3 ( ) { disk1.setVolumeFormat ( VolumeFormat.COW ) ; disk1.setQcowCompat ( QcowCompat.QCOW2_V3 ) ; org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setStoragePoolFormatType ( StorageFormatType.V3 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( sp ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isQcowVersionSupportedForDcVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_QCOW_COMPAT_DOES_NOT_MATCH_DC_VERSION ) ) ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.HostNIC addMasterLink ( org.ovirt.engine.api.model.HostNIC nic , java.lang.String bondName , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : ifaces ) { if ( i.getName ( ) . equals ( bondName ) ) { nic.getLinks ( ) . add ( masterLink ( i.getId ( ) . toString ( ) ) ) ; break ; } } return nic ; }

Target:
protected org.ovirt.engine.api.model.HostNic addMasterLink ( org.ovirt.engine.api.model.HostNic nic , java.lang.String bondName , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : ifaces ) { if ( i.getName ( ) . equals ( bondName ) ) { nic.getLinks ( ) . add ( masterLink ( i.getId ( ) . toString ( ) ) ) ; break ; } } return nic ; }
Source:
private void totalCPUCores_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getNumOfSockets ( ) . getSelectedItemChangedEvent ( ) . removeListener ( this ) ; getTotalCPUCores ( ) . getEntityChangedEvent ( ) . removeListener ( this ) ; getCoresPerSocket ( ) . getSelectedItemChangedEvent ( ) . removeListener ( this ) ; behavior.totalCpuCoresChanged ( ) ; getTotalCPUCores ( ) . getEntityChangedEvent ( ) . addListener ( this ) ; getNumOfSockets ( ) . getSelectedItemChangedEvent ( ) . addListener ( this ) ; getCoresPerSocket ( ) . getSelectedItemChangedEvent ( ) . addListener ( this ) ; }

Target:
private void removeCPUListeners ( ) { getTotalCPUCores ( ) . getEntityChangedEvent ( ) . removeListener ( this ) ; getNumOfSockets ( ) . getSelectedItemChangedEvent ( ) . removeListener ( this ) ; getCoresPerSocket ( ) . getSelectedItemChangedEvent ( ) . removeListener ( this ) ; getThreadsPerCore ( ) . getSelectedItemChangedEvent ( ) . removeListener ( this ) ; }
Source:
private void mockVmDevice ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { org.mockito.Mockito.when ( vmDeviceDao.getVmDeviceByVmIdAndType ( vm.getId ( ) , vmDevice.getType ( ) ) ) . thenReturn ( java.util.Arrays.asList ( vmDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }

Target:
private void mockVmDevice ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { org.mockito.Mockito.when ( vmDeviceDao.getVmDeviceByVmIdAndType ( vm.getId ( ) , vmDevice.getType ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( vmDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }
Source:
public void testAddLunDisk_MissingType ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . setType ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Storage" , "testAddLunDisk_MissingType" , "type" ) ; } }

Target:
public void testAddLunDisk_MissingType ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . setType ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "HostStorage" , "testAddLunDisk_MissingType" , "type" ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { newSubnet ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.VDSGroup getCluster ( org.ovirt.engine.api.model.Vm vm ) { if ( namedCluster ( vm ) ) { return isFiltered ( ) ? lookupClusterByName ( vm.getCluster ( ) . getName ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( vm.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( vm.getCluster ( ) . getName ( ) ) ) ) ; } return lookupCluster ( asGuid ( vm.getCluster ( ) . getId ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Cluster getCluster ( org.ovirt.engine.api.model.Vm vm ) { if ( namedCluster ( vm ) ) { return isFiltered ( ) ? lookupClusterByName ( vm.getCluster ( ) . getName ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , VdcQueryType.GetClusterByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( vm.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( vm.getCluster ( ) . getName ( ) ) ) ) ; } return lookupCluster ( asGuid ( vm.getCluster ( ) . 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 = vmDeviceDao.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 ) ; }

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.VmHostDevice > devices = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmId ( ) , VmDeviceGeneralType.HOSTDEV ) . stream ( ) . map ( VmHostDevice :: new ) . collect ( java.util.stream.Collectors.toList ( ) ) ; return org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVmDeviceUtils ( ) . vmDevicesByDevice ( devices ) ; }