auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetTagsExpectations ( true ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachTemplateFromTag , org.ovirt.engine.core.common.action.AttachEntityToTagParameters.class , new java.lang.String [ ] { "TagId" , "EntitiesId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateTagResourceTest.TAG_ID , asList ( org.ovirt.engine.api.restapi.resource.BackendTemplateTagResourceTest.TEMPLATE_ID ) } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetTagsExpectations ( true ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachTemplateFromTag , org.ovirt.engine.core.common.action.AttachEntityToTagParameters.class , new java.lang.String [ ] { "TagId" , "EntitiesId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateTagResourceTest.TAG_ID , asList ( org.ovirt.engine.api.restapi.resource.BackendTemplateTagResourceTest.TEMPLATE_ID ) } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void shouldHaveNotingToMigrate ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.never ( ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void shouldHaveNotingToMigrate ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.never ( ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
public boolean isProxyHostAvailable ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.FenceProxyLocator proxyHostLocator = new org.ovirt.engine.core.bll.FenceProxyLocator ( vds ) ; if ( ! ( proxyHostLocator.isProxyHostAvailable ( ) ) ) { messages.add ( VdcBllMessages.VDS_NO_VDS_PROXY_FOUND.name ( ) ) ; return false ; } else { return true ; } }

Target:
protected org.ovirt.engine.core.bll.FenceProxyLocator getProxyLocator ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return new org.ovirt.engine.core.bll.FenceProxyLocator ( vds ) ; }
Source:
private void initCommand ( org.ovirt.engine.core.common.businessentities.OvfEntityData resultOvfEntityData ) { org.ovirt.engine.core.common.action.ImportVmParameters parameters = createParametersWhenImagesExistOnTargetStorageDomain ( ) ; initUnregisteredOVFData ( resultOvfEntityData ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand < org.ovirt.engine.core.common.action.ImportVmParameters > ( parameters ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override protected org.ovirt.engine.core.dao.UnregisteredOVFDataDAO getUnregisteredOVFDataDao ( ) { return unregisteredOVFDataDao ; } public org.ovirt.engine.core.common.businessentities.VDSGroup getVdsGroup ( ) { return vdsGroup ; } } ) ; }

Target:
private void initCommand ( org.ovirt.engine.core.common.businessentities.OvfEntityData resultOvfEntityData ) { org.ovirt.engine.core.common.action.ImportVmParameters parameters = createParametersWhenImagesExistOnTargetStorageDomain ( ) ; initUnregisteredOVFData ( resultOvfEntityData ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand < org.ovirt.engine.core.common.action.ImportVmParameters > ( parameters ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override protected org.ovirt.engine.core.dao.UnregisteredOVFDataDAO getUnregisteredOVFDataDao ( ) { return unregisteredOVFDataDao ; } public org.ovirt.engine.core.common.businessentities.VDSGroup getVdsGroup ( ) { return vdsGroup ; } } ) ; mockStoragePool ( ) ; org.mockito.Mockito.doReturn ( storagePool ) . when ( cmd ) . getStoragePool ( ) ; }
Source:
public javax.net.ssl.KeyManager [ ] getKeyManagers ( ) { try ( java.io.InputStream stream = new java.io.FileInputStream ( org.ovirt.vdsm.jsonrpc.client.TestManagerProvider.KEY_STORE_FILE ) ) { java.security.KeyStore keyStore = java.security.KeyStore.getInstance ( "PKCS12" ) ; keyStore.load ( stream , org.ovirt.vdsm.jsonrpc.client.TestManagerProvider.PASSWORD.toCharArray ( ) ) ; javax.net.ssl.KeyManagerFactory kmf = javax.net.ssl.KeyManagerFactory.getInstance ( "SunX509" ) ; kmf.init ( keyStore , org.ovirt.vdsm.jsonrpc.client.TestManagerProvider.PASSWORD.toCharArray ( ) ) ; return kmf.getKeyManagers ( ) ; } catch ( java.security.NoSuchAlgorithmException | java.security.KeyStoreException | java.io.IOException | java.security.cert.CertificateException | java.security.UnrecoverableKeyException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public javax.net.ssl.KeyManager [ ] getKeyManagers ( ) { try { java.security.KeyStore keyStore = java.security.KeyStore.getInstance ( "PKCS12" ) ; keyStore.load ( this . keyStream , this . pass.toCharArray ( ) ) ; javax.net.ssl.KeyManagerFactory kmf = javax.net.ssl.KeyManagerFactory.getInstance ( "SunX509" ) ; kmf.init ( keyStore , this . pass.toCharArray ( ) ) ; return kmf.getKeyManagers ( ) ; } catch ( java.security.NoSuchAlgorithmException | java.security.KeyStoreException | java.io.IOException | java.security.cert.CertificateException | java.security.UnrecoverableKeyException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public org.ovirt.vdsm.jsonrpc.client.JsonRpcClient register ( org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client ) { final org.ovirt.vdsm.jsonrpc.client.JsonRpcClient jsonRpcClient = new org.ovirt.vdsm.jsonrpc.client.JsonRpcClient ( client ) ; client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { queue.add ( new org.ovirt.vdsm.jsonrpc.client.internal.MessageContext ( jsonRpcClient , message ) ) ; } } ) ; return jsonRpcClient ; }

Target:
public org.ovirt.vdsm.jsonrpc.client.JsonRpcClient register ( org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client ) { final org.ovirt.vdsm.jsonrpc.client.JsonRpcClient jsonRpcClient = new org.ovirt.vdsm.jsonrpc.client.JsonRpcClient ( client , this . tracker ) ; client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { queue.add ( new org.ovirt.vdsm.jsonrpc.client.internal.MessageContext ( jsonRpcClient , message ) ) ; } } ) ; return jsonRpcClient ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { switch ( org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getAction ( ) ) { case START : status = org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getBroker ( ) . glusterVolumeReplaceBrickStart ( org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getExistingBrickDir ( ) , org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getNewBrickDir ( ) ) ; break ; } org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { switch ( org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getAction ( ) ) { case START : status = org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getBroker ( ) . glusterVolumeReplaceBrickStart ( org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getExistingBrickDir ( ) , org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.getParameters ( ) . getNewBrickDir ( ) ) ; break ; } org.ovirt.engine.core.vdsbroker.gluster.ReplaceGlusterVolumeBrickVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsDhcp ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testValidateGatewayWhenGatewayIsNull ( ) { doTestValidateGateway ( null , false , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
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 getClusterServerMemoryOverCommit ( 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 ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsNone ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsNone ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
public void reportCompleted ( ) { endJobOrStepAsFailed ( ) ; }

Target:
public final void reportCompleted ( ) { try { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ; if ( ( ( executionContext != null ) && ( executionContext.isMonitored ( ) ) ) && ( ! ( executionContext.isCompleted ( ) ) ) ) { endExecutionMonitoring ( ) ; } } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
protected boolean isStorageDomainCompatibleWithDC ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.bll.storage.StoragePoolValidator spv = new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ; if ( ( storageDomain.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) { org.ovirt.engine.core.bll.ValidationResult result = spv.isGlusterSupportedInDC ( ) ; return validate ( result ) ; } if ( ( storageDomain.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) { org.ovirt.engine.core.bll.ValidationResult result = spv.isPosixSupportedInDC ( ) ; return validate ( result ) ; } return true ; }

Target:
protected boolean isStorageDomainFormatCorrectForDC ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic domainStatic , org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { if ( domainStatic.getStorageDomainType ( ) . isIsoOrImportExportDomain ( ) ) { return true ; } if ( storagePool != null ) { if ( ( org.ovirt.engine.core.common.utils.VersionStorageFormatUtil.getPreferredForVersion ( storagePool.getcompatibility_version ( ) , domainStatic.getStorageType ( ) ) . compareTo ( domainStatic.getStorageFormat ( ) ) ) < 0 ) { return false ; } } return true ; }
Source:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , getEntityList ( ) , failure ) ; } }

Target:
protected org.ovirt.engine.api.model.Network getEntity ( int index ) { org.ovirt.engine.api.model.Network entity = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.Network.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; org.mockito.Mockito.when ( entity.getDataCenterId ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendNetworksResourceTest.DATA_CENTER_ID ) ; return entity ; }
Source:
private void executeCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.bll.tasks.interfaces.CommandCallBack callBack ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = getBackendCommandObjectsHandler ( ) . runAction ( command , null ) ; if ( callBack != null ) { if ( result.getSucceeded ( ) ) { command.setCommandStatus ( CommandStatus.SUCCEEDED ) ; } callBack.setExecutionResult ( result ) ; } }

Target:
private void updateCommandStatus ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ! ( result.getCanDoAction ( ) ) ) { command.setCommandStatus ( CommandStatus.FAILED ) ; return ; } if ( CommandStatus.ACTIVE_SYNC.equals ( coco.getCommandStatus ( command.getCommandId ( ) ) ) ) { command.setCommandStatus ( ( result.getSucceeded ( ) ? org.ovirt.engine.core.compat.CommandStatus.SUCCEEDED : org.ovirt.engine.core.compat.CommandStatus.FAILED ) ) ; } }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getStorageDomainList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel userPortalListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.storage_pool [ ] { ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( result ) ) } ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel unitModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( userPortalListModel.getWindow ( ) ) ) ; unitModel.getDataCenter ( ) . setItems ( list ) ; unitModel.getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( list ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel userPortalListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StoragePool [ ] { ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( result ) ) } ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel unitModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( userPortalListModel.getWindow ( ) ) ) ; unitModel.getDataCenter ( ) . setItems ( list ) ; unitModel.getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( list ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network networkA , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachment ( networkA , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; attachment.setNicId ( nic.getId ( ) ) ; attachment.setNicName ( nic.getName ( ) ) ; return attachment ; }

Target:
public void testInvalidNetworkAttachmentIpConfiguration ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = initValidator ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = validator.getAttachmentsToConfigure ( ) . iterator ( ) . next ( ) ; java.util.Collection < java.lang.String > replacements = createReplacement ( networkAttachment ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_MISSING_IP_CONFIGURATION ; initMockNetworkAttachmentIpConfigurationValidator ( engineMessage , replacements ) ; org.junit.Assert.assertThat ( validator.validNewOrModifiedNetworkAttachments ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , replacements ) ) ; }
Source:
public static void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAuthzGroupsByUserId ( 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.AuthzGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAuthzGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void template_SelectedItemChanged ( ) { getModel ( ) . setIsDisksAvailable ( true ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; updateRngDevice ( template.getId ( ) ) ; }

Target:
public void template_SelectedItemChanged ( ) { getModel ( ) . setIsDisksAvailable ( true ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; updateRngDevice ( template.getId ( ) ) ; getModel ( ) . getCustomPropertySheet ( ) . deserialize ( template.getCustomProperties ( ) ) ; }
Source:
private void AsyncResult_Retrieved ( ) { if ( ( getItems ( ) ) != null ) { java.util.Iterator enumerator = getItems ( ) . iterator ( ) ; setIsEmpty ( ( enumerator.hasNext ( ) ? false : true ) ) ; } else { setIsEmpty ( true ) ; } }

Target:
private void asyncResult_Retrieved ( ) { if ( ( getItems ( ) ) != null ) { java.util.Iterator enumerator = getItems ( ) . iterator ( ) ; setIsEmpty ( ( enumerator.hasNext ( ) ? false : true ) ) ; } else { setIsEmpty ( true ) ; } }
Source:
int doGenerateMaxLength ( int maxNameLengt , int poolNameLength ) { int allowedLength = ( maxNameLengt - poolNameLength ) - 1 ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( "" ) ; if ( allowedLength == 0 ) { return 0 ; } for ( int i = 0 ; i < allowedLength ; i ++ ) { sb.append ( "9" ) ; } return java.lang.Integer.parseInt ( sb.toString ( ) ) ; }

Target:
int doGenerateMaxNumOfVms ( int maxNameLength , int poolNameLength ) { int numberOfDigits = ( maxNameLength - poolNameLength ) - 1 ; if ( numberOfDigits == 0 ) { return 0 ; } return getMaxNumberInNDigits ( numberOfDigits ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase removeVmImages ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalAction ( VdcActionType.RemoveAllVmImages , buildRemoveAllVmImagesParameters ( images ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; if ( vdcRetValue.getSucceeded ( ) ) { getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return vdcRetValue ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase removeVmImages ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalAction ( VdcActionType.RemoveAllVmImages , buildRemoveAllVmImagesParameters ( images ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RemoveVmCommand.getExecutionContext ( ) ) ) ; if ( vdcRetValue.getSucceeded ( ) ) { getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return vdcRetValue ; }
Source:
private java.util.Map < java.lang.String , java.lang.Class < ? > > addExceptions ( java.util.Map < java.lang.String , java.lang.Class < ? > > map ) { map.put ( "brick" , org.ovirt.engine.sdk.entities.GlusterBrick.class ) ; map.put ( "bricks" , org.ovirt.engine.sdk.entities.GlusterBricks.class ) ; map.put ( "hostnic" , org.ovirt.engine.sdk.entities.HostNIC.class ) ; map.put ( "hostnics" , org.ovirt.engine.sdk.entities.HostNics.class ) ; return map ; }

Target:
private java.util.Map < java.lang.String , java.lang.Class < ? > > addExceptions ( java.util.Map < java.lang.String , java.lang.Class < ? > > map ) { map.put ( "brick" , org.ovirt.engine.sdk.entities.GlusterBrick.class ) ; map.put ( "bricks" , org.ovirt.engine.sdk.entities.GlusterBricks.class ) ; map.put ( "hostnic" , org.ovirt.engine.sdk.entities.HostNIC.class ) ; map.put ( "hostnics" , org.ovirt.engine.sdk.entities.HostNics.class ) ; map.put ( "reporteddevice" , org.ovirt.engine.sdk.entities.Device.class ) ; return map ; }
Source:
public void testVmOvfCreationBackwardCompatilibily ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.utils.ovf.OvfManagerTest.createVM ( ) ; java.lang.String xml = manager.ExportVm ( vm , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) , Version.v3_0 ) ; org.junit.Assert.assertNotNull ( xml ) ; final org.ovirt.engine.core.common.businessentities.VM newVm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; manager.ImportVm ( xml , newVm , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.assertVm ( vm , newVm , vm.getDbGeneration ( ) ) ; }

Target:
public void testVmOvfCreationBackwardCompatilibily ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.utils.ovf.OvfManagerTest.createVM ( ) ; java.lang.String xml = manager.exportVm ( vm , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) , Version.v3_0 ) ; org.junit.Assert.assertNotNull ( xml ) ; final org.ovirt.engine.core.common.businessentities.VM newVm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; manager.importVm ( xml , newVm , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.assertVm ( vm , newVm , vm.getDbGeneration ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVmName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setdomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; org.ovirt.engine.core.utils.ovf.OvfVmWriterTest.initInterfaces ( vm ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVmName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; org.ovirt.engine.core.utils.ovf.OvfVmWriterTest.initInterfaces ( vm ) ; return vm ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( vdsId , org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ; return null ; }

Target:
public void rollback ( ) { super . rollback ( ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.bll.RestartVdsCommand.getVdsId ( ) ; org.ovirt.engine.core.bll.RestartVdsCommand.log.warnFormat ( "Restart host action failed, updating host {0} to {1}" , vdsId , VDSStatus.NonResponsive.name ( ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( vdsId , org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ; }
Source:
private void handleTaskOfCommandWithEmptyVdsmId ( final boolean isPartiallySubmittedCommand , final org.ovirt.engine.core.common.businessentities.AsyncTasks task ) { if ( isPartiallySubmittedCommand ) { if ( org.ovirt.engine.core.bll.tasks.AsyncTaskManager.hasEmptyVdsmId ( task ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; return ; } partiallyCompletedCommandTasks.put ( task.getVdsmTaskId ( ) , task ) ; return ; } org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { logAndFailTaskOfCommandWithEmptyVdsmId ( task , "Engine was restarted before all tasks of the command could be submitted to vdsm." ) ; return null ; } } ) ; }

Target:
private void handlePartiallyExecutedTaskOfCommand ( final org.ovirt.engine.core.common.businessentities.AsyncTask task ) { if ( org.ovirt.engine.core.bll.tasks.AsyncTaskManager.hasEmptyVdsmId ( task ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; return ; } partiallyCompletedCommandTasks.put ( task.getVdsmTaskId ( ) , task ) ; }
Source:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeVdsFenceAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId , org.ovirt.engine.core.common.businessentities.FenceActionType fenceAction , org.ovirt.engine.core.common.action.VdcActionType action ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vdsId , fenceAction ) ; params.setParentCommand ( VdcActionType.RestartVds ) ; params.setSessionId ( sessionId ) ; return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( action , params ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeVdsFenceAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId , org.ovirt.engine.core.common.businessentities.FenceActionType fenceAction , org.ovirt.engine.core.common.action.VdcActionType action ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vdsId , fenceAction ) ; params.setParentCommand ( VdcActionType.RestartVds ) ; params.setSessionId ( sessionId ) ; return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( action , params , getContext ( ) ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ! ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK_FINISHED_FAILURE ; } if ( ( isFirstTaskHandler ( ) ) && ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK ; } break ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getActionState ( ) ) == ( org.ovirt.engine.core.bll.CommandActionState.EXECUTE ) ) { if ( ! ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK_FINISHED_FAILURE ; } if ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getSucceeded ( ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK ; } } else if ( ( ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getActionState ( ) ) == ( org.ovirt.engine.core.bll.CommandActionState.END_SUCCESS ) ) || ( isConsiderSuccessful ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK_FINISHED_SUCCESS ; } else { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_DISK_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { org.ovirt.engine.core.common.businessentities.Network network = org.ovirt.engine.core.bll.storage.NetworkCommon.getParameters ( ) . getNetwork ( ) ; org.ovirt.engine.core.compat.Guid networkId = ( network == null ) ? null : network.getId ( ) ; return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( networkId , org.ovirt.engine.core.common.VdcObjectType.Network , org.ovirt.engine.core.bll.storage.NetworkCommon.getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { org.ovirt.engine.core.common.businessentities.Network network = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) ; org.ovirt.engine.core.compat.Guid networkId = ( network == null ) ? null : network.getId ( ) ; return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( networkId , org.ovirt.engine.core.common.VdcObjectType.Network , org.ovirt.engine.core.bll.network.dc.NetworkCommon.getActionType ( ) . getActionGroup ( ) ) ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
private void removeDiskImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , true , false , true ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { image.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; image.setStoragePoolId ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStoragePoolId ( ) ) ; } removeVmImages ( images ) ; }

Target:
private void removeDiskImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_NOT_SHAREABLE , org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_ACTIVE ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { image.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) ; image.setStoragePoolId ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getParameters ( ) . getStoragePoolId ( ) ) ; } removeVmImages ( images ) ; }
Source:
protected void expectGetLunsForVg ( java.lang.String vgId , boolean withDummyLun ) { org.ovirt.engine.core.dao.LunDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.LunDAO.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.getAllForVolumeGroup ( vgId ) ) . thenReturn ( setUpLuns ( withDummyLun ) ) ; }

Target:
protected void expectGetLunsForVg ( java.lang.String vgId , boolean withDummyLun ) { org.ovirt.engine.core.dao.LunDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.LunDao.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.getAllForVolumeGroup ( vgId ) ) . thenReturn ( setUpLuns ( withDummyLun ) ) ; }
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
public void testAddForce ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( setUpGetMatrixConstraintsExpectations ( BackendResource.FORCE_CONSTRAINT , true , "true" , uriInfo ) ) ; setUpVolumeCreationExpectations ( true ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; javax.ws.rs.core.Response response = collection.add ( createModel ( ) ) ; org.junit.Assert.assertEquals ( 201 , response.getStatus ( ) ) ; org.junit.Assert.assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.GlusterVolume ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.GlusterVolume ) ( response.getEntity ( ) ) ) , 1 ) ; }

Target:
public void testAddForce ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( setUpGetMatrixConstraintsExpectations ( BackendResource.FORCE_CONSTRAINT , true , "true" , uriInfo ) ) ; setUpVolumeCreationExpectations ( true ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; javax.ws.rs.core.Response response = collection.add ( createModel ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 201 , response.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.GlusterVolume ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.GlusterVolume ) ( response.getEntity ( ) ) ) , 1 ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( 50 ) ; builder.append ( "version: " ) ; builder.append ( getVersion ( ) ) ; builder.append ( ", configuration value: " ) ; builder.append ( getConfigValue ( ) ) ; builder.append ( ", " ) ; builder.append ( super . toString ( ) ) ; return builder.toString ( ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "version" , getVersion ( ) ) . append ( "configurationValue" , getConfigValue ( ) ) ; }
Source:
protected void expectGetLunsMap ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAO dao , java.lang.String lunId , java.lang.String cnxId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap map = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( ) ; map.setLunId ( lunId ) ; map.setstorage_server_connection ( cnxId ) ; ret.add ( map ) ; org.mockito.Mockito.when ( dao.getAll ( lunId ) ) . thenReturn ( ret ) ; }

Target:
protected void expectGetLunsMap ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDao dao , java.lang.String lunId , java.lang.String cnxId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap map = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( ) ; map.setLunId ( lunId ) ; map.setstorage_server_connection ( cnxId ) ; ret.add ( map ) ; org.mockito.Mockito.when ( dao.getAll ( lunId ) ) . thenReturn ( ret ) ; }
Source:
protected boolean shouldLiveMigrationBeUsed ( ) { org.ovirt.engine.core.common.businessentities.VM vmWithDisk = getVMByParameterDisk ( ) ; return ( ( ( vmWithDisk != null ) && ( ( vmWithDisk.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) && ( ( vmWithDisk.getrun_on_vds ( ) ) != null ) ) && ( ! ( vmWithDisk.getrun_on_vds ( ) . equals ( Guid.Empty ) ) ) ; }

Target:
protected boolean shouldLiveMigrationBeUsed ( ) { org.ovirt.engine.core.common.businessentities.VM vmWithDisk = getVMByParameterDisk ( ) ; return ( ( ( vmWithDisk != null ) && ( ( vmWithDisk.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) && ( ( vmWithDisk.getRunOnVds ( ) ) != null ) ) && ( ! ( vmWithDisk.getRunOnVds ( ) . equals ( Guid.Empty ) ) ) ; }
Source:
public void testPayloadMapToVmPaylod ( ) { org.ovirt.engine.api.model.Payload payload = new org.ovirt.engine.api.model.Payload ( ) ; payload.setType ( VmDeviceType.CDROM ) ; payload.setVolumeId ( "CD-VOL" ) ; org.ovirt.engine.core.common.businessentities.VmPayload vmPayload = org.ovirt.engine.api.restapi.types.VmMapper.map ( payload , null ) ; org.junit.Assert.assertEquals ( payload.getType ( ) . name ( ) , vmPayload.getDeviceType ( ) . name ( ) ) ; org.junit.Assert.assertEquals ( payload.getVolumeId ( ) , vmPayload.getVolumeId ( ) ) ; }

Target:
public void testPayloadMapToVmPaylod ( ) { org.ovirt.engine.api.model.Payload payload = new org.ovirt.engine.api.model.Payload ( ) ; payload.setType ( VmDeviceType.CDROM ) ; payload.setVolumeId ( "CD-VOL" ) ; org.ovirt.engine.core.common.businessentities.VmPayload vmPayload = org.ovirt.engine.api.restapi.types.VmMapper.map ( payload , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( payload.getType ( ) . name ( ) , vmPayload.getDeviceType ( ) . name ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( payload.getVolumeId ( ) , vmPayload.getVolumeId ( ) ) ; }