auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void prepareMocks ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand < org.ovirt.engine.core.common.action.RemoveAuditLogByIdParameters > command ) { org.mockito.Mockito.doReturn ( auditLogDao ) . when ( command ) . getAuditLogDao ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_1 ) ; org.mockito.Mockito.doReturn ( getEventWithOvirtOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_2 ) ; org.mockito.Mockito.doReturn ( getEventWithExternalOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_3 ) ; }

Target:
private void prepareMocks ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand < org.ovirt.engine.core.common.action.RemoveAuditLogByIdParameters > command ) { org.mockito.Mockito.doReturn ( auditLogDao ) . when ( command ) . getAuditLogDao ( ) ; org.mockito.Mockito.doReturn ( getEventWithOvirtOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_2 ) ; org.mockito.Mockito.doReturn ( getEventWithExternalOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_3 ) ; }
Source:
private org.ovirt.engine.core.bll.hostdeploy.VdsMgmtPackages createPackagesManager ( final org.ovirt.engine.core.common.businessentities.VDS host , final boolean checkOnly ) throws java.security.KeyStoreException { final org.ovirt.engine.core.bll.hostdeploy.VdsMgmtPackages hostPackagesManager = new org.ovirt.engine.core.bll.hostdeploy.VdsMgmtPackages ( host , checkOnly ) ; java.lang.String correlationId = org.ovirt.engine.core.utils.CorrelationIdTracker.getCorrelationId ( ) ; hostPackagesManager.setCorrelationId ( correlationId ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( correlationId ) ) { correlationId = org.ovirt.engine.core.utils.log.LoggedUtils.getObjectId ( host ) ; } hostPackagesManager.setCorrelationId ( correlationId ) ; hostPackagesManager.useDefaultKeyPair ( ) ; return hostPackagesManager ; }

Target:
private org.ovirt.engine.core.bll.hostdeploy.VdsMgmtPackages createPackagesManager ( final org.ovirt.engine.core.common.businessentities.VDS host , final boolean checkOnly ) throws java.security.KeyStoreException { final org.ovirt.engine.core.bll.hostdeploy.VdsMgmtPackages hostPackagesManager = new org.ovirt.engine.core.bll.hostdeploy.VdsMgmtPackages ( host , checkOnly ) ; java.lang.String correlationId = org.ovirt.engine.core.utils.CorrelationIdTracker.getCorrelationId ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( correlationId ) ) { correlationId = org.ovirt.engine.core.utils.log.LoggedUtils.getObjectId ( host ) ; } hostPackagesManager.setCorrelationId ( correlationId ) ; hostPackagesManager.useDefaultKeyPair ( ) ; return hostPackagesManager ; }
Source:
private void removeCinderDisk ( org.ovirt.engine.core.compat.Guid cinderDiskId , org.ovirt.engine.core.compat.Guid storageDomainId ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RemoveCinderDisk , buildRevertParameters ( cinderDiskId ) , null , new org.ovirt.engine.core.common.businessentities.SubjectEntity ( org.ovirt.engine.core.common.VdcObjectType.Storage , storageDomainId ) ) ; try { future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { log.error ( "Fail to revert disk id '{}'." , cinderDiskId ) ; log.error ( "Exception: " , e ) ; } }

Target:
private void removeCinderDisk ( org.ovirt.engine.core.compat.Guid cinderDiskId ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RemoveCinderDisk , buildRevertParameters ( cinderDiskId ) , null ) ; try { future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { log.error ( "Fail to revert disk id '{}'." , cinderDiskId ) ; log.error ( "Exception: " , e ) ; } }
Source:
public void currentUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.interfaces.IVdcUser u = new org.ovirt.engine.core.common.users.VdcUser ( ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.common.interfaces.IVdcUser cu = b.getCurrentUser ( ) ; org.junit.Assert.assertEquals ( u , cu ) ; }

Target:
public void currentUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.users.VdcUser u = new org.ovirt.engine.core.common.users.VdcUser ( ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.common.users.VdcUser cu = b.getCurrentUser ( ) ; org.junit.Assert.assertEquals ( u , cu ) ; }
Source:
private void addSharedLockEntry ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( sharedLockMap ) == null ) { sharedLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; } sharedLockMap.put ( vds.getstorage_pool_id ( ) . toString ( ) , LockingGroup.POOL.name ( ) ) ; }

Target:
private void addSharedLockEntry ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( sharedLockMap ) == null ) { sharedLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; } sharedLockMap.put ( vds.getStoragePoolId ( ) . toString ( ) , LockingGroup.POOL.name ( ) ) ; }
Source:
private static boolean addPortMirroringToVmInterface ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.network.Network network ) { if ( ( vnicProfile != null ) && ( vnicProfile.isPortMirroring ( ) ) ) { if ( org.ovirt.engine.core.common.FeatureSupported.portMirroring ( version ) ) { struct.put ( VdsProperties.PORT_MIRRORING , ( network == null ? java.util.Collections.< java.lang.String > emptyList ( ) : java.util.Collections.singletonList ( network.getName ( ) ) ) ) ; } else { return false ; } } return true ; }

Target:
private static void addPortMirroringToVmInterface ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile , org.ovirt.engine.core.common.businessentities.network.Network network ) { if ( ( vnicProfile != null ) && ( vnicProfile.isPortMirroring ( ) ) ) { struct.put ( VdsProperties.PORT_MIRRORING , ( network == null ? java.util.Collections.< java.lang.String > emptyList ( ) : java.util.Collections.singletonList ( network.getName ( ) ) ) ) ; } }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkDao , vdsDao , hostSetupNetworksValidatorHelper , vmDao , effectiveHostNetworkQos ) ; return validator.validate ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkDao , vdsDao , hostSetupNetworksValidatorHelper , vmDao ) ; return validator.validate ( ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > findAllStorageDomainsBySharedStatus ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > items , org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus status ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain i : items ) { if ( ( i.getStorageDomainSharedStatus ( ) ) == status ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > findAllStorageDomainsBySharedStatus ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > items , org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus status ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain i : items ) { if ( ( i.getStorageDomainSharedStatus ( ) ) == status ) { ret.add ( i ) ; } } return ret ; }
Source:
private void updateWanColorDepthOptions ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getWANColorDepth ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.setWANColorDepth ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth ) ( returnValue ) ) ) ; } } ) ) ; }

Target:
private void updateWanColorDepthOptions ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getWANColorDepth ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.setWANColorDepth ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth ) ( returnValue ) ) ) ; } } ) ) ; }
Source:
public void testExecuteQueryGetAllEntitiesCommand ( ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { org.mockito.Mockito.when ( getQueryParameters ( ) . getEntityGuidList ( ) ) . thenReturn ( null ) ; getQuery ( ) . executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( "Wrong number of VMs in result" , 2 , result.size ( ) ) ; }

Target:
public void testExecuteQueryGetAllEntitiesCommand ( ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { getQuery ( ) . executeQueryCommand ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertEquals ( "Wrong number of VMs in result" , 2 , result.size ( ) ) ; }
Source:
private void addFeaturePortMirroring ( org.ovirt.engine.api.model.Features features ) { org.ovirt.engine.api.model.Feature feature = new org.ovirt.engine.api.model.Feature ( ) ; feature.setName ( "Port Mirroring" ) ; feature.setNic ( new org.ovirt.engine.api.model.NIC ( ) ) ; feature.getNic ( ) . setPortMirroring ( new org.ovirt.engine.api.model.PortMirroring ( ) ) ; features.getFeature ( ) . add ( feature ) ; }

Target:
private void addFeaturePortMirroring ( org.ovirt.engine.api.model.Features features ) { org.ovirt.engine.api.model.Feature feature = new org.ovirt.engine.api.model.Feature ( ) ; feature.setName ( "Port Mirroring" ) ; features.getFeature ( ) . add ( feature ) ; }
Source:
public void testEmptyDiskStats ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksStats ( disksStats ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVds ( ) , xml , false ) ; }

Target:
public void testEmptyDiskStats ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksStats ( disksStats ) ; validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVds ( ) , xml , false ) ; }
Source:
private void runNextActionFlowWithFirstActionFailureTestCommon ( boolean waitFoResult ) { org.ovirt.engine.ui.uicommonweb.action.UiAction action1 = createAction ( waitFoResult , true ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction action2 = createAction ( waitFoResult , true ) ; action1.then ( action2 ) ; action1.runAction ( ) ; verifyRunActionAndExecuteCallbacksRandomly ( false , action1.getActionFlowState ( ) , 1 , waitFoResult ) ; verifyRunActionAndExecuteCallbacksRandomly ( true , action1.getActionFlowState ( ) , 2 , 1 , waitFoResult ) ; assertFinishedWithErrors ( java.util.Arrays.asList ( action1 , action2 ) , 1 ) ; }

Target:
private void runNextActionFlowWithFirstActionFailureTestCommon ( boolean waitFoResult ) { org.ovirt.engine.ui.uicommonweb.action.UiAction action1 = createAction ( waitFoResult , true ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction action2 = createAction ( waitFoResult , true ) ; action1.then ( action2 ) ; action1.runAction ( ) ; verifyRunActionAndExecuteCallbacksRandomly ( action1.getActionFlowState ( ) , waitFoResult ) ; verifyRunActionAndExecuteCallbacksRandomly ( true , action1.getActionFlowState ( ) , 2 , 1 , waitFoResult ) ; assertFinishedWithErrors ( java.util.Arrays.asList ( action1 , action2 ) , 1 ) ; }
Source:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( true , false ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; initAndAssertValidation ( true ) ; }

Target:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; initAndAssertValidation ( true ) ; }
Source:
public void hostNicHaveOneFreeVfWhichShareIommuGroup ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = mockVnic ( true ) ; initHostWithOneVfsConfig ( java.util.Collections.singletonList ( vnic ) , 1 , true , false , false , true , true ) ; assertHostNotValid ( java.util.Collections.singletonList ( vnic ) , java.util.Collections.singletonList ( vnic.getName ( ) ) ) ; }

Target:
public void hostNicHaveOneFreeVfWhichShareIommuGroup ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = mockVnic ( true ) ; initHostWithOneVfsConfig ( java.util.Collections.singletonList ( vnic ) , 1 , true , false , false , true , true , false ) ; assertHostNotValid ( java.util.Collections.singletonList ( vnic ) , java.util.Collections.singletonList ( vnic.getName ( ) ) ) ; }
Source:
public void PostOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { Cancel ( ) ; if ( model.getIsNew ( ) ) { setGuideContext ( returnValue.getActionReturnValue ( ) ) ; UpdateActionAvailability ( ) ; getGuideCommand ( ) . Execute ( ) ; } } }

Target:
public void PostOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; Cancel ( ) ; if ( model.getIsNew ( ) ) { setGuideContext ( returnValue.getActionReturnValue ( ) ) ; UpdateActionAvailability ( ) ; getGuideCommand ( ) . Execute ( ) ; } }
Source:
private void setupVmNetworkInterfaceDao ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > expectedVmNetworkInterfaces ) { org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao vmNetworkInterfaceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao.class ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVmNetworkInterfaces ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmNetworkInterfaceDao ( ) ) . thenReturn ( vmNetworkInterfaceDaoMock ) ; }

Target:
private void setupVmNetworkInterfaceDao ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > expectedVmNetworkInterfaces ) { org.mockito.Mockito.when ( vmNetworkInterfaceDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVmNetworkInterfaces ) ; }
Source:
public java.lang.String generateId ( org.ovirt.engine.api.model.Version v ) { org.ovirt.engine.core.compat.NGuid guid = new org.ovirt.engine.core.compat.NGuid ( ( ( ( v.getMajor ( ) ) + "." ) + ( v.getMinor ( ) ) ) . getBytes ( ) , true ) ; return guid != null ? guid.toString ( ) : null ; }

Target:
public java.lang.String generateId ( org.ovirt.engine.api.model.Version v ) { org.ovirt.engine.core.compat.NGuid guid = new org.ovirt.engine.core.compat.NGuid ( ( ( ( v.getMajor ( ) ) + "." ) + ( v.getMinor ( ) ) ) . getBytes ( ) , true ) ; return guid.toString ( ) ; }
Source:
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.RunQuery ( VdcQueryType.Search , searchParams , 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:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkDAO ( ) . update ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : getClusterAttachments ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( clusterAttachment.getClusterId ( ) , org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; } org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkDAO ( ) . update ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getClusterAttachments ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( clusterAttachment.getClusterId ( ) , org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; } org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.setSucceeded ( true ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , T model , com.google.gwt.safehtml.shared.SafeHtml tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < T > valueUpdater ) { super . onBrowserEvent ( context , parent , model , tooltipContent , event , valueUpdater ) ; if ( ! ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) ) { return ; } onClickEvent ( model ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , T model , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < T > valueUpdater ) { super . onBrowserEvent ( context , parent , model , event , valueUpdater ) ; if ( ! ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) ) { return ; } onClickEvent ( model ) ; }
Source:
public void freeMacs ( java.util.List < java.lang.String > macs ) { lockObj.writeLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to free MAC addresses." ) ; } for ( java.lang.String mac : macs ) { internalFreeMac ( mac ) ; } } finally { lockObj.writeLock ( ) . unlock ( ) ; } }

Target:
public void freeMacs ( java.util.List < java.lang.String > macs ) { if ( ! ( macs.isEmpty ( ) ) ) { lockObj.writeLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to free MAC addresses." ) ; } for ( java.lang.String mac : macs ) { internalFreeMac ( mac ) ; } } finally { lockObj.writeLock ( ) . unlock ( ) ; } } }
Source:
public synchronized boolean hasTasksForEntityIdAndAction ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.action.VdcActionType type ) { boolean retVal = false ; if ( ( _tasks ) != null ) { for ( org.ovirt.engine.core.bll.SPMAsyncTask task : _tasks.values ( ) ) { if ( ( isCurrentTaskLookedFor ( id , task ) ) && ( type.equals ( task.getParameters ( ) . getDbAsyncTask ( ) . getaction_type ( ) ) ) ) { retVal = true ; break ; } } } return retVal ; }

Target:
public synchronized boolean hasTasksForEntityIdAndAction ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.action.VdcActionType type ) { if ( ( _tasks ) != null ) { for ( org.ovirt.engine.core.bll.SPMAsyncTask task : _tasks.values ( ) ) { if ( ( isCurrentTaskLookedFor ( id , task ) ) && ( type.equals ( task.getParameters ( ) . getDbAsyncTask ( ) . getaction_type ( ) ) ) ) { return true ; } } } return false ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > findAllVDSByPmEnabled ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS i : items ) { if ( i.isPmEnabled ( ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VDS > findAllVDSByPmEnabled ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > items ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS i : items ) { if ( i.isPmEnabled ( ) ) { ret.add ( i ) ; } } return ret ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Event model , int index ) { assertNotNull ( model ) ; assertEquals ( model.getId ( ) , java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; assertEquals ( model.getSeverity ( ) , LogSeverity.ALERT ) ; assertEquals ( model.getDescription ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; assertEquals ( model.getOrigin ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; assertEquals ( model.getCustomId ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Event model , int index ) { assertNotNull ( model ) ; assertEquals ( model.getId ( ) , java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; assertEquals ( LogSeverity.ALERT , model.getSeverity ( ) ) ; assertEquals ( model.getDescription ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; assertEquals ( model.getOrigin ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; assertEquals ( model.getCustomId ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; }
Source:
private org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > getBondOption ( org.ovirt.engine.core.common.businessentities.network.BondMode mode ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > entityModel = new org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > ( ) ; entityModel.setEntity ( mode.getDescription ( ) ) ; return new org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > ( mode.getConfigurationValue ( ) , entityModel ) ; }

Target:
private org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > getBondOption ( org.ovirt.engine.core.common.businessentities.network.BondMode mode ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > entityModel = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; entityModel.setEntity ( mode.getDescription ( ) ) ; return new org.ovirt.engine.core.compat.KeyValuePairCompat ( mode.getConfigurationValue ( ) , entityModel ) ; }
Source:
public int getCountByType ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataType type ) { int count = 0 ; for ( org.ovirt.engine.core.common.businessentities.Erratum e : errata ) { if ( ( e.getType ( ) ) == type ) { count ++ ; } } return count ; }

Target:
public int getCountByType ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataType type ) { if ( ( ( errata ) == null ) || ( errata.isEmpty ( ) ) ) { return 0 ; } int count = 0 ; for ( org.ovirt.engine.core.common.businessentities.Erratum e : errata ) { if ( ( e.getType ( ) ) == type ) { count ++ ; } } return count ; }
Source:
private boolean unmanagedNetworkChanged ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; return ( existingIface == null ) || ( ! ( iface.getNetworkName ( ) . equals ( existingIface.getNetworkName ( ) ) ) ) ; }

Target:
private boolean unmanagedNetworkChanged ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; return ( existingIface == null ) || ( ! ( iface.getNetworkName ( ) . equals ( existingIface.getNetworkName ( ) ) ) ) ; }
Source:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; }
Source:
public static void GetNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters ( dataCenterId ) , aQuery ) ; }
Source:
public void testStoragePoolDoesntExist ( ) { final int domainSizeGB = 20 ; final int sizeRequired = 5 ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( domainSizeGB , sizeRequired ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getStoragePool ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) ; }

Target:
public void testStoragePoolDoesntExist ( ) { final int domainSizeGB = 20 ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( domainSizeGB ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getStoragePool ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) ; }
Source:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQoS = getSelectedItem ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkQoSModel networkQoSModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkQoSModel ( networkQoS , this , getEntity ( ) ) ; setWindow ( networkQoSModel ) ; networkQoSModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkQoSModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }

Target:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQoS = getSelectedItem ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkQoSModel networkQoSModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkQoSModel ( networkQoS , this , getEntity ( ) ) ; setWindow ( networkQoSModel ) ; networkQoSModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) , getEntity ( ) ) ; }
Source:
private void retryCall ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request , final org.ovirt.vdsm.jsonrpc.client.internal.JsonRpcCall call ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy policy = this . client.getRetryPolicy ( ) ; org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking = new org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking ( request , call , new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryContext ( policy ) , org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.getTimeout ( policy.getRetryTimeOut ( ) , policy.getTimeUnit ( ) ) , this . client ) ; this . tracker.registerTrackingRequest ( request , tracking ) ; }

Target:
public org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy getRetryPolicy ( ) { return this . policy ; }
Source:
private boolean removeMemoryFromSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot , boolean clearFromDB ) { final java.lang.String memoryVolume = snapshot.getMemoryVolume ( ) ; if ( memoryVolume.isEmpty ( ) ) { return true ; } if ( clearFromDB ) { getSnapshotDao ( ) . removeMemoryFromSnapshot ( snapshot.getId ( ) ) ; } return removeMemoryVolumes ( memoryVolume ) ; }

Target:
private boolean removeMemoryFromSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot , boolean clearFromDB ) { final java.lang.String memoryVolume = snapshot.getMemoryVolume ( ) ; if ( memoryVolume.isEmpty ( ) ) { return true ; } if ( clearFromDB ) { getSnapshotDao ( ) . removeMemoryFromSnapshot ( snapshot.getId ( ) ) ; } return removeMemoryVolumes ( snapshot ) ; }
Source:
private java.lang.Runnable pendingOperations ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( this . nioEngine ) == null ) { return null ; } if ( ( this . certCallback ) != null ) { this . certCallback.registerSslSession ( this . nioEngine.getSSLEngine ( ) . getSession ( ) ) ; } return nioEngine.process ( ) ; }

Target:
private java.lang.Runnable pendingOperations ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( this . nioEngine ) == null ) { return null ; } return nioEngine.process ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc fullList ( java.lang.String [ ] vmIds ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getVMFullList" ) . withOptionalParameterAsList ( "vmList" , new java.util.ArrayList < > ( java.util.Arrays.asList ( vmIds ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc fullList ( java.util.List < java.lang.String > vmIds ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getVMFullList" ) . withOptionalParameterAsList ( "vmList" , vmIds ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( response ) ; }
Source:
protected boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String runOnceCustomProperties , java.util.List < java.lang.String > messages ) { java.lang.String customProperties = ( runOnceCustomProperties != null ) ? runOnceCustomProperties : vm.getCustomProperties ( ) ; java.util.List < org.ovirt.engine.core.common.utils.customprop.ValidationError > validationErrors = getVmPropertiesUtils ( ) . validateVmProperties ( vm.getVdsGroupCompatibilityVersion ( ) , customProperties ) ; if ( ! ( validationErrors.isEmpty ( ) ) ) { getVmPropertiesUtils ( ) . handleCustomPropertiesError ( validationErrors , messages ) ; return false ; } return true ; }

Target:
protected boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String runOnceCustomProperties , java.util.List < java.lang.String > messages ) { java.lang.String customProperties = ( runOnceCustomProperties != null ) ? runOnceCustomProperties : vm.getCustomProperties ( ) ; return getVmPropertiesUtils ( ) . validateVmProperties ( vm.getVdsGroupCompatibilityVersion ( ) , customProperties , messages ) ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }
Source:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel ) ( model ) ) ; java.lang.Boolean migrationNetworkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MigrationNetworkEnabled , clusterNetworkModel.getCluster ( ) . getcompatibility_version ( ) . toString ( ) ) ) ) ; return ( migrationNetworkEnabled && ( clusterNetworkModel.isAttached ( ) ) ) && ( ! ( clusterNetworkModel.isExternal ( ) ) ) ; }

Target:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel ) { java.lang.Boolean migrationNetworkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MigrationNetworkEnabled , clusterNetworkModel.getCluster ( ) . getcompatibility_version ( ) . toString ( ) ) ) ) ; return ( migrationNetworkEnabled && ( clusterNetworkModel.isAttached ( ) ) ) && ( ! ( clusterNetworkModel.isExternal ( ) ) ) ; }
Source:
public void testGetAllMultiClusterSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Clusters" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vdsGroupResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllMultiClusterSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Clusters" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( vdsGroupResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.canDoAction ( VdcActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getContext ( ) . clone ( ) . getExecutionContext ( ) , true ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.canDoAction ( VdcActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getContext ( ) . clone ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }
Source:
protected void buildModel ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.BuilderExecutionFinished < org.ovirt.engine.core.common.businessentities.VmBase , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel > callback ) { new org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor ( callback , new org.ovirt.engine.ui.uicommonweb.builders.vm.NameAndDescriptionVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommentVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.HwOnlyVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CoreVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.SerialNumberPolicyVmBaseToUnitBuilder ( ) . withEveryFeatureSupported ( ) ) . withEveryFeatureSupported ( ) ) ) . build ( vmBase , getModel ( ) ) ; }

Target:
protected void buildModel ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.BuilderExecutionFinished < org.ovirt.engine.core.common.businessentities.VmBase , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel > callback ) { new org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor ( callback , new org.ovirt.engine.ui.uicommonweb.builders.vm.NameAndDescriptionVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommentVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.HwOnlyVmBaseToUnitBuilder ( ) . withEveryFeatureSupported ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CoreVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.SerialNumberPolicyVmBaseToUnitBuilder ( ) . withEveryFeatureSupported ( ) ) . withEveryFeatureSupported ( ) ) ) . build ( vmBase , getModel ( ) ) ; }
Source:
public void snapshotExistsByGuidReturnsInvalidResultWhenNoSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.mockito.Mockito.when ( snapshotDao.exists ( vmId , snapshotId ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.snapshots.SnapshotsValidatorTest.validateInvalidResult ( validator.snapshotExists ( vmId , snapshotId ) , VdcBllMessages.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }

Target:
public void snapshotExistsByGuidReturnsInvalidResultWhenNoSnapshot ( ) throws java.lang.Exception { org.mockito.Mockito.when ( snapshotDao.exists ( vmId , snapshotId ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.snapshots.SnapshotsValidatorTest.validateInvalidResult ( validator.snapshotExists ( vmId , snapshotId ) , VdcBllMessages.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST ) ; }
Source:
private void mockVdsDao ( final org.ovirt.engine.core.dao.VdsDao vdsDao ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter search = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( ) ; org.mockito.Mockito.when ( vdsDao.getAllWithQuery ( org.mockito.Matchers.matches ( org.ovirt.engine.core.bll.SearchQueryTest.getVdsRegexString ( search ) ) ) ) . thenReturn ( vdsResultList ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setCpuFlags ( "flag" ) ; vds.setClusterCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; vdsResultList.add ( vds ) ; }

Target:
public void mockVdsDao ( ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter search = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( ) ; org.mockito.Mockito.when ( vdsDao.getAllWithQuery ( org.mockito.Matchers.matches ( org.ovirt.engine.core.bll.SearchQueryTest.getVdsRegexString ( search ) ) ) ) . thenReturn ( vdsResultList ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setCpuFlags ( "flag" ) ; vds.setClusterCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; vdsResultList.add ( vds ) ; }