auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getMaximalVmMemSize32OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 20480 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void testAddHostedEngineStorageFails ( ) { parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }

Target:
public void testAddHostedEngineStorageSucceeds ( ) { parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.compat.Guid > getPredefinedVdsIdListToRunOn ( ) { return org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDedicatedVmForVdsList ( ) ; }

Target:
protected boolean isRunAsStateless ( ) { return ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getRunAsStateless ( ) ) != null ? org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getRunAsStateless ( ) : ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) == null ) && ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isStateless ( ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getCompensationContext ( ) . snapshotEntity ( oldVmDevice ) ; getVmNetworkInterfaceDao ( ) . update ( getInterface ( ) ) ; oldVmDevice.setCustomProperties ( getInterface ( ) . getCustomProperties ( ) ) ; getDbFacade ( ) . getVmDeviceDao ( ) . update ( oldVmDevice ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getVmNicDao ( ) . update ( getInterface ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void canNotDoWithTwoPinnedHost ( ) { final org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand command = mockedCommand ( ) ; vm.setDedicatedVmForVdsList ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_PINNED_TO_MULTIPLE_HOSTS ) ; }

Target:
public void canSetNumaPinning ( ) { newNumaNodes = java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; final org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.Matchers.eq ( newNumaNodes ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage_domains getStorageDomainByName ( java.lang.String storageDomainName ) { org.ovirt.engine.core.common.businessentities.storage_domains storage = null ; for ( java.lang.Object storageDomain : getDestinationStorage ( ) . getItems ( ) ) { storage = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( storageDomain ) ) ; if ( storageDomainName.equals ( storage.getstorage_name ( ) ) ) { break ; } } return storage ; }

Target:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > getStorageDomainsByIds ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getstorage_ids ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getstorage_ids ) { for ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain : filteredStorageDomains ) { if ( storageDomainId.equals ( storageDomain.getId ( ) ) ) { domains.add ( storageDomain ) ; break ; } } } return domains ; }
Source:
private void initChildHierarchy ( ) { if ( ! ( childHierarchyInitialized ) ) { synchronized ( LOCK ) { if ( ! ( childHierarchyInitialized ) ) { childHierarchy.clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmd : getCommandsWithCallbackEnabled ( ) ) { buildCmdHierarchy ( cmd ) ; } } childHierarchyInitialized = true ; } } }

Target:
private void initChildHierarchy ( ) { if ( ! ( childHierarchyInitialized ) ) { synchronized ( LOCK ) { if ( ! ( childHierarchyInitialized ) ) { childHierarchy.clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmd : getCommands ( false ) ) { buildCmdHierarchy ( cmd ) ; } } childHierarchyInitialized = true ; } } }
Source:
private boolean isEditConsoleEnabled ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( ( ( ! ( item.getIsPool ( ) ) ) && ( ( consoleUtils.determineDefaultProtocol ( item ) ) != null ) ) && ( item.getStatus ( ) . equals ( VMStatus.Up ) ) ) { return true ; } return false ; }

Target:
private boolean isEditConsoleEnabled ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( ( ( ! ( item.getIsPool ( ) ) ) && ( ( consoleUtils.determineConnectionProtocol ( item ) ) != null ) ) && ( item.getStatus ( ) . equals ( VMStatus.Up ) ) ) { return true ; } return false ; }
Source:
private void mockGetForDisk ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > vmsMap = new java.util.HashMap < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > ( ) ; vmsMap.put ( java.lang.Boolean.TRUE , vms ) ; org.mockito.Mockito.when ( vmDAO.getForDisk ( diskImageGuid ) ) . thenReturn ( vmsMap ) ; }

Target:
private void mockCtorRelatedDaoCalls ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { mockGetForDisk ( vms ) ; mockGetVmsListForDisk ( vms ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskSnapshot ( org.ovirt.engine.core.compat.Guid diskId ) { org.ovirt.engine.core.common.businessentities.DiskImage di = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; di.setActive ( false ) ; di.setId ( diskId ) ; di.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setParentId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageStatus ( ImageStatus.OK ) ; return di ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskSnapshot ( org.ovirt.engine.core.compat.Guid diskId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage di = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; di.setActive ( false ) ; di.setId ( diskId ) ; di.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setParentId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageStatus ( ImageStatus.OK ) ; return di ; }
Source:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > parentSnapshots = mockDisksList ( 2 ) ; org.mockito.Mockito.doReturn ( parentSnapshots ) . when ( cmd ) . getSourceImages ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > parentSnapshots = mockDisksList ( 2 ) ; org.mockito.Mockito.doReturn ( parentSnapshots ) . when ( cmd ) . getSourceImages ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
private static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > mockSnapshots ( ) { org.ovirt.engine.core.compat.Guid snapshotGuid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage expectedSnapshot = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; expectedSnapshot.setImageId ( snapshotGuid ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > snapshots = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( 1 ) ; snapshots.add ( expectedSnapshot ) ; return snapshots ; }

Target:
private static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > mockSnapshots ( ) { org.ovirt.engine.core.compat.Guid snapshotGuid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage expectedSnapshot = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; expectedSnapshot.setImageId ( snapshotGuid ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > snapshots = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( 1 ) ; snapshots.add ( expectedSnapshot ) ; return snapshots ; }
Source:
private < T > T execute ( java.util.concurrent.Callable < T > callable ) { try { return callable.call ( ) ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException e ) { executeFailedMessages.add ( VdcBllErrors.CINDER_ERROR.name ( ) ) ; executeFailedMessages.add ( java.lang.String.format ( "$cinderException %1$s" , e.getMessage ( ) ) ) ; throw e ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
private < T > T execute ( java.util.concurrent.Callable < T > callable ) { try { return callable.call ( ) ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException e ) { executeFailedMessages.add ( EngineError.CINDER_ERROR.name ( ) ) ; executeFailedMessages.add ( java.lang.String.format ( "$cinderException %1$s" , e.getMessage ( ) ) ) ; throw e ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.TagsVmMap tagsVmMap ; tagsVmMap = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getTagVmByTagIdAndByVmId ( org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getTagId ( ) , org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getVmId ( ) ) ; if ( tagsVmMap == null ) { addValidationMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.TagsVmMap tagsVmMap ; tagsVmMap = tagDao.getTagVmByTagIdAndByVmId ( org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getTagId ( ) , org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getVmId ( ) ) ; if ( tagsVmMap == null ) { addValidationMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } return true ; }
Source:
protected void setGetGuestAgentQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , getListOfVmGuestAgentInterfaces ( ) ) ; } }

Target:
protected void setGetGuestAgentQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , getListOfVmGuestAgentInterfaces ( ) ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage getActiveVolumeDisk ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskList ) { return diskList.get ( ( ( diskList.size ( ) ) - 1 ) ) ; }

Target:
private void checkTrustedService ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "VmName" , getVmName ( ) ) ; if ( ( getVm ( ) . isTrustedService ( ) ) && ( ! ( getVdsGroup ( ) . supportsTrustedService ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_IMPORT_VM_FROM_TRUSTED_TO_UNTRUSTED ) ; } else if ( ( ! ( getVm ( ) . isTrustedService ( ) ) ) && ( getVdsGroup ( ) . supportsTrustedService ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_IMPORT_VM_FROM_UNTRUSTED_TO_TRUSTED ) ; } }
Source:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public static void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static void getWatchdogByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void canSetNumaPinning ( ) { newNumaNodes = java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; final org.ovirt.engine.core.bll.numa.vm.SetVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massRemoveNumaNodeByNumaNodeId ( org.mockito.Matchers.eq ( existingNumaNodeIds ) ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.Matchers.eq ( newNumaNodes ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void canSetNumaPinning ( ) { newNumaNodes = java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; final org.ovirt.engine.core.bll.numa.vm.SetVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massRemoveNumaNodeByNumaNodeId ( org.mockito.Matchers.eq ( existingNumaNodeIds ) ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.Matchers.eq ( newNumaNodes ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Nic nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Nic nic = resource.get ( ) ; org.junit.Assert.assertTrue ( nic.isSetStatistics ( ) ) ; verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }
Source:
private boolean validateAttachment ( ) { final org.ovirt.engine.core.bll.network.cluster.UpdateNetworkClusterValidator networkClusterValidator = createNetworkClusterValidator ( ) ; return ( validate ( networkClusterValidator.managementNetworkUnset ( ) ) ) && ( validateAttachment ( networkClusterValidator ) ) ; }

Target:
private boolean validateAttachment ( ) { final org.ovirt.engine.core.bll.network.cluster.UpdateNetworkClusterValidator networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.managementNetworkUnset ( ) ) ) && ( validate ( networkClusterValidator.glusterNetworkInUseAndUnset ( org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getVdsGroup ( ) ) ) ) ) && ( validateAttachment ( networkClusterValidator ) ) ; }
Source:
protected java.lang.String applySortOptions ( java.lang.String searchQuery ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( searchQuery ) ; if ( ( sortBy ) != null ) { result.append ( " SORTBY " ) . append ( sortBy ) . append ( " " ) . append ( ( sortAscending ? "ASC" : "DESC" ) ) ; } return result.toString ( ) ; }

Target:
protected java.lang.String applySortOptions ( java.lang.String searchString ) { java.lang.String result = searchString ; if ( ( sortBy ) != null ) { result += ( ( ( ( " " + ( org.ovirt.engine.core.searchbackend.SyntaxChecker.SORTBY ) ) + " " ) + ( sortBy ) ) + " " ) + ( sortAscending ? org.ovirt.engine.core.searchbackend.SyntaxChecker.SORTDIR_ASC : org.ovirt.engine.core.searchbackend.SyntaxChecker.SORTDIR_DESC ) ; } return result ; }
Source:
public void getDbGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDbGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
private void runQueryByIdParameter ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.AsIsAsyncConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( queryType , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testEjectCd ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO , VMStatus.Up ) ) ; setUpActionExpectations ( ActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO } , true , true ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO ) ; cdrom = resource.update ( cdrom ) ; org.junit.Assert.assertNull ( cdrom.getFile ( ) ) ; }

Target:
public void testEjectCd ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO , VMStatus.Up ) ) ; setUpActionExpectations ( ActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO } , true , true ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.NO_ISO ) ; cdrom = resource.update ( cdrom ) ; org.junit.jupiter.api.Assertions.assertNull ( cdrom.getFile ( ) ) ; }
Source:
public static java.lang.String parse ( java.util.List < org.ovirt.engine.api.model.CustomProperty > customProperties ) { java.lang.StringBuffer buff = new java.lang.StringBuffer ( ) ; for ( org.ovirt.engine.api.model.CustomProperty hook : customProperties ) { if ( ( hook.isSetName ( ) ) && ( hook.isSetValue ( ) ) ) { buff.append ( ( ( ( ( hook.getName ( ) ) + "=" ) + ( hook.getValue ( ) ) ) + ";" ) ) ; } } return buff.toString ( ) ; }

Target:
public static java.lang.String parse ( java.util.List < org.ovirt.engine.api.model.CustomProperty > customProperties ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.api.model.CustomProperty hook : customProperties ) { if ( ( hook.isSetName ( ) ) && ( hook.isSetValue ( ) ) ) { builder.append ( hook.getName ( ) ) . append ( "=" ) . append ( hook.getValue ( ) ) . append ( ";" ) ; } } return builder.toString ( ) ; }
Source:
private static void detachNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel bridge = networkToDetach.getVlanNic ( ) ; if ( ( bridge.getName ( ) . indexOf ( '.' ) ) > 0 ) { allNics.remove ( bridge.getEntity ( ) ) ; } networkToDetach.detach ( ) ; }

Target:
private static void detachNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics , org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach ) { if ( networkToDetach.hasVlan ( ) ) { allNics.remove ( networkToDetach.getVlanNicModel ( ) . getEntity ( ) ) ; } networkToDetach.detach ( ) ; }
Source:
public static void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
protected void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand.getParameters ( ) . getVmId ( ) ) != null ) { setVmId ( org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand.getVm ( ) . setvNumaNodeList ( org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand.getVmNumaNodeDao ( ) . getAllVmNumaNodeByVmId ( org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand.getParameters ( ) . getVmId ( ) ) ) ; } else { setVm ( org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand.getParameters ( ) . getVm ( ) ) ; } }

Target:
protected void doInit ( ) { org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand.getVmNumaNodesForValidation ( ) . addAll ( org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand.getParameters ( ) . getVmNumaNodeList ( ) ) ; }
Source:
public void setInputFieldsEnabled ( boolean enabled ) { nameEditor.setEnabled ( enabled ) ; descriptionEditor.setEnabled ( enabled ) ; isVmNetworkEditor.setEnabled ( enabled ) ; vlanTagging.setEnabled ( enabled ) ; vlanTag.setEnabled ( enabled ) ; hasMtuEditor.setEnabled ( enabled ) ; mtuEditor.setEnabled ( enabled ) ; messageLabel.setVisible ( ( ! enabled ) ) ; }

Target:
public void updateVisibility ( ) { messageLabel.setVisible ( false ) ; }
Source:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( "CreateBrickVDSParameters %s, lvName=%s, mountPoint=%s, storageDevices=%s, raidParams=%s, fsType=%s, " , super . toString ( ) , lvName , mountPoint , storageDevices , raidParams , fsType ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "lvName" , lvName ) . append ( "mountPoint" , mountPoint ) . append ( "storageDevices" , storageDevices ) . append ( "raidParams" , raidParams ) . append ( "fsType" , fsType ) ; }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.DELETE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.ENTITY , Schema.Entities.USER ) . mput ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , args.get ( "user" ) ) . mput ( Schema.SharedKeys.ADD_GROUP , context.get ( ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }
Source:
public void testUpdateWhenNoCompletedTasks ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( jobRepository , org.mockito.Mockito.times ( 2 ) ) . updateStep ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 0 ) ) . endStepJob ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }

Target:
public void testUpdateWhenNoCompletedTasks ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( jobRepository , org.mockito.Mockito.times ( 2 ) ) . updateStep ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 0 ) ) . endStepJob ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }
Source:
public void testGetCascadingResource ( ) { org.junit.Assert.assertTrue ( "getCascadingResource not reading file from resources.properties" , testTheme.getCascadingResource ( "favicon" ) . getFile ( ) . getAbsolutePath ( ) . contains ( "/01-test.brand/images/favicon.ico" ) ) ; org.junit.Assert.assertEquals ( "getCascadingResource not reading contentType from resources.properties" , "someMadeUp/contentType" , testTheme.getCascadingResource ( "favicon" ) . getContentType ( ) ) ; }

Target:
public void testGetCascadingResource ( ) { org.junit.jupiter.api.Assertions.assertTrue ( testTheme.getCascadingResource ( "favicon" ) . getFile ( ) . getAbsolutePath ( ) . contains ( "/01-test.brand/images/favicon.ico" ) , "getCascadingResource not reading file from resources.properties" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "someMadeUp/contentType" , testTheme.getCascadingResource ( "favicon" ) . getContentType ( ) , "getCascadingResource not reading contentType from resources.properties" ) ; }
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 void getIsGlusterVolumeSnapshotCliScheduleEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.Cluster getCluster ( ) { return cluster ; }

Target:
public void setUp ( ) throws java.io.IOException { storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getBaseInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > hostNics = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.UpdateNetworkValidator.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( vlan.getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface hostNic : hostNics ) { if ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( vlan , hostNic.getName ( ) ) ) { return hostNic ; } } throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.LABELED_NETWORK_INTERFACE_NOT_FOUND ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getBaseInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > hostNics = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.UpdateNetworkValidator.getDbFacade ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( vlan.getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface hostNic : hostNics ) { if ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( vlan , hostNic.getName ( ) ) ) { return hostNic ; } } throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.LABELED_NETWORK_INTERFACE_NOT_FOUND ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getDbFacade ( ) . getAuditLogDao ( ) . getAllByVMTemplateName ( org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getParameters ( ) . getName ( ) , org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateNameQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateIdQuery.getDbFacade ( ) . getAuditLogDao ( ) . getAllByVMTemplateId ( org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllAuditLogsByVMTemplateIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public void testGet ( ) { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageConnectionExtension extension = resource.get ( ) ; org.junit.Assert.assertNotNull ( extension ) ; org.junit.Assert.assertEquals ( extension.getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionResourceTest.extensionID.toString ( ) ) ; }

Target:
public void testGet ( ) { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageConnectionExtension extension = resource.get ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( extension ) ; org.junit.jupiter.api.Assertions.assertEquals ( extension.getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionResourceTest.extensionID.toString ( ) ) ; }
Source:
public 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.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void OnSaveNetworkConfig ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ( model.getProgress ( ) ) != null ) { return ; } model.StartProgress ( null ) ; setcurrentModel ( model ) ; SaveNetworkConfigInternalAction ( ) ; }

Target:
public void OnSaveNetworkConfig ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ( model.getProgress ( ) ) != null ) { return ; } model.StartProgress ( null ) ; setcurrentModel ( model ) ; new org.ovirt.engine.ui.uicommonweb.models.hosts.SaveNetworkConfigAction ( this , model ) ; }
Source:
public void canDoActionFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( "InvalidActionType" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params ) ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; params.setClusterId ( null ) ; params.setServerId ( null ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void validateFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( "InvalidActionType" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; params.setClusterId ( null ) ; params.setServerId ( null ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.DbUser addUserToThreadContext ( java.lang.String sessionId , boolean refresh ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getUser ( ) ; if ( dbUser == null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( sessionId ) ) ) { dbUser = getUser ( sessionId , refresh ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( sessionId ) ; } else { dbUser = getUser ( refresh ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setUser ( dbUser ) ; } return dbUser ; }

Target:
public void setAuthn ( java.lang.String sessionId , org.ovirt.engine.core.extensions.mgr.ExtensionProxy authn ) { setData ( sessionId , org.ovirt.engine.core.bll.session.SessionDataContainer.AUTHN_PARAMETER_NAME , authn ) ; }
Source:
public void testQuery ( ) { org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = setupQueryBySnapshotId ( existingSnapshotId ) ; org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( vm ) . when ( snapshotVmConfigurationHelper ) . getVmFromConfiguration ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; query.execute ( ) ; org.ovirt.engine.core.common.queries.QueryReturnValue returnValue = query.getQueryReturnValue ( ) ; org.junit.Assert.assertNotNull ( "Return value from query cannot be null" , returnValue ) ; org.ovirt.engine.core.common.businessentities.VM returnedVm = returnValue.getReturnValue ( ) ; org.junit.Assert.assertEquals ( vm , returnedVm ) ; }

Target:
public void testQuery ( ) { org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = setupQueryBySnapshotId ( existingSnapshotId ) ; org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( vm ) . when ( snapshotVmConfigurationHelper ) . getVmFromConfiguration ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; query.execute ( ) ; org.ovirt.engine.core.common.queries.QueryReturnValue returnValue = query.getQueryReturnValue ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( returnValue , "Return value from query cannot be null" ) ; org.ovirt.engine.core.common.businessentities.VM returnedVm = returnValue.getReturnValue ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( vm , returnedVm ) ; }