auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.api.metamodel.tool.JavaTypeReference getListReference ( org.ovirt.api.metamodel.concepts.ListType type ) { org.ovirt.api.metamodel.concepts.Type elementType = type.getElementType ( ) ; org.ovirt.api.metamodel.tool.JavaTypeReference reference = getTypeReference ( elementType ) ; reference.addImport ( java.util.List.class ) ; reference.setText ( ( ( "List<" + ( reference.getText ( ) ) ) + ">" ) ) ; return reference ; }

Target:
private org.ovirt.api.metamodel.tool.JavaTypeReference getListReference ( org.ovirt.api.metamodel.concepts.ListType type ) { org.ovirt.api.metamodel.concepts.Type elementType = type.getElementType ( ) ; org.ovirt.api.metamodel.tool.JavaTypeReference reference = getTypeReference ( elementType , true ) ; reference.addImport ( java.util.List.class ) ; reference.setText ( ( ( "List<" + ( reference.getText ( ) ) ) + ">" ) ) ; return reference ; }
Source:
public org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper clone ( ) throws java.lang.CloneNotSupportedException { org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper cloneWrapper = new org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper ( getAuditLogable ( ) , canDoActionMessages ) ; if ( ( getParameters ( ) ) != null ) { cloneWrapper.setParameters ( new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ) ; for ( org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter parameter : getParameters ( ) ) { cloneWrapper.getParameters ( ) . add ( parameter.clone ( ) ) ; } } return cloneWrapper ; }

Target:
public org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper clone ( ) throws java.lang.CloneNotSupportedException { super . clone ( ) ; org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper cloneWrapper = new org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper ( getAuditLogable ( ) , canDoActionMessages ) ; if ( ( getParameters ( ) ) != null ) { cloneWrapper.setParameters ( new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ) ; for ( org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter parameter : getParameters ( ) ) { cloneWrapper.getParameters ( ) . add ( parameter.clone ( ) ) ; } } return cloneWrapper ; }
Source:
public void shouldNotMigrateVmOnClusterTwoWhileInUpgradeMode ( ) { cluster2.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 0 ) ) . migrateVM ( org.mockito.ArgumentMatchers.eq ( vm2 ) ) ; }

Target:
public void shouldNotMigrateVmOnClusterTwoWhileInUpgradeMode ( ) { cluster2.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 0 ) ) . migrateVM ( org.mockito.ArgumentMatchers.eq ( vm2 ) ) ; }
Source:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , getTaskType ( ) , commandStatus ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } } }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , commandStatus ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } } }
Source:
protected static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { org.ovirt.engine.core.bll.memory.MemoryStorageHandler.updateDisksStorage ( currDomain , disksList ) ; if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( org.ovirt.engine.core.bll.memory.MemoryStorageHandler.validateSpaceRequirements ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { updateDisksStorage ( currDomain , disksList ) ; if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( validateSpaceRequirements ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }
Source:
public org.ovirt.engine.api.model.InstanceType update ( org.ovirt.engine.api.model.InstanceType incoming ) { org.ovirt.engine.api.model.InstanceType instanceType = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetInstanceType , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , VdcActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendInstanceTypeResource.UpdateParametersProvider ( ) ) ; if ( instanceType != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , instanceType ) ; } return instanceType ; }

Target:
public org.ovirt.engine.api.model.InstanceType update ( org.ovirt.engine.api.model.InstanceType incoming ) { org.ovirt.engine.api.model.InstanceType instanceType = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetInstanceType , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , VdcActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendInstanceTypeResource.UpdateParametersProvider ( ) ) ; if ( instanceType != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , instanceType ) ; } return instanceType ; }
Source:
private void selectAsSPM ( ) { org.ovirt.engine.core.common.action.ForceSelectSPMParameters params = new org.ovirt.engine.core.common.action.ForceSelectSPMParameters ( ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) . getStoragePoolId ( ) , ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) . getId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.ForceSelectSPM , params ) ; }

Target:
private void selectAsSPM ( ) { org.ovirt.engine.core.common.action.ForceSelectSPMParameters params = new org.ovirt.engine.core.common.action.ForceSelectSPMParameters ( ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) . getId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.ForceSelectSPM , params ) ; }
Source:
private java.lang.String generateInfoFileData ( java.util.Date updateDate ) { java.util.Map < java.lang.String , java.lang.Object > data = new java.util.HashMap < > ( ) ; data.put ( OvfInfoFileConstants.LastUpdated , updateDate.toString ( ) ) ; data.put ( OvfInfoFileConstants.Domains , java.util.Arrays.asList ( org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; return buildJson ( data ) ; }

Target:
private java.lang.String generateInfoFileData ( ) { java.util.Map < java.lang.String , java.lang.Object > data = new java.util.HashMap < > ( ) ; data.put ( OvfInfoFileConstants.LastUpdated , updateDate.toString ( ) ) ; data.put ( OvfInfoFileConstants.Domains , java.util.Arrays.asList ( org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; return buildJson ( data , true ) ; }
Source:
static void verifyParent ( org.ovirt.engine.api.model.Tag model , java.lang.String parentId ) { assertNotNull ( model.getParent ( ) ) ; assertNotNull ( model.getParent ( ) . getTag ( ) ) ; assertEquals ( parentId , model.getParent ( ) . getTag ( ) . getId ( ) ) ; }

Target:
static void verifyParent ( org.ovirt.engine.api.model.Tag model , java.lang.String parentId ) { assertNotNull ( model.getParent ( ) ) ; assertEquals ( parentId , model.getParent ( ) . getId ( ) ) ; }
Source:
public void hostAttachedToLocalStorageWithoutDataCenter ( ) { org.mockito.Mockito.when ( storagePoolDao.getForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.validateSingleHostAttachedToLocalStorage ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostAttachedToLocalStorageWithoutDataCenter ( ) { org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.validateSingleHostAttachedToLocalStorage ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public org.ovirt.engine.core.compat.Guid getStorageDomainId ( ) { if ( ( cachedStorageDomainId ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskDummiesForMemSize = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.HibernateVmCommand.getStoragePoolId ( ) , diskDummiesForMemSize ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }

Target:
public org.ovirt.engine.core.compat.Guid getStorageDomainId ( ) { if ( ( cachedStorageDomainId ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskDummiesForMemSize = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( org.ovirt.engine.core.bll.HibernateVmCommand.getStoragePoolId ( ) , diskDummiesForMemSize ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }
Source:
public static org.ovirt.engine.core.bll.CommandBase < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > [ ] data ( ) { return new org.ovirt.engine.core.bll.CommandBase < ? > [ ] { new org.ovirt.engine.core.bll.CreateSnapshotCommand ( new org.ovirt.engine.core.common.action.ImagesActionsParametersBase ( ) ) , new org.ovirt.engine.core.bll.AddImageFromScratchCommand ( new org.ovirt.engine.core.common.action.AddImageFromScratchParameters ( ) ) , new org.ovirt.engine.core.bll.CreateImageTemplateCommand ( new org.ovirt.engine.core.common.action.CreateImageTemplateParameters ( ) ) , new org.ovirt.engine.core.bll.CreateCloneOfTemplateCommand ( new org.ovirt.engine.core.common.action.CreateCloneOfTemplateParameters ( ) ) , new org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand ( new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( ) ) { @ java.lang.Override protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { } } } ; }

Target:
protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { }
Source:
private void createProfiles ( ) throws org.ovirt.engine.core.extensions.mgr.ConfigurationException { for ( org.ovirt.engine.core.extensions.mgr.ExtensionProxy authnExtension : org.ovirt.engine.core.extensions.mgr.ExtensionsManager.getInstance ( ) . getProvidedExtensions ( org.ovirt.engine.core.aaa.AuthenticationProfileRepository.AUTHN_SERVICE ) ) { registerProfile ( new org.ovirt.engine.core.aaa.AuthenticationProfile ( new org.ovirt.engine.core.aaa.AuthenticatorProxy ( authnExtension ) , new org.ovirt.engine.core.aaa.DirectoryProxy ( org.ovirt.engine.core.extensions.mgr.ExtensionsManager.getInstance ( ) . getExtensionByName ( authnExtension.getContext ( ) . < java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) . getProperty ( org.ovirt.engine.core.aaa.AuthenticationProfileRepository.AUTHN_AUTHZ_PLUGIN ) ) ) ) ) ; } }

Target:
private void createProfiles ( ) throws org.ovirt.engine.core.extensions.mgr.ConfigurationException { for ( org.ovirt.engine.core.extensions.mgr.ExtensionProxy authnExtension : org.ovirt.engine.core.extensions.mgr.ExtensionsManager.getInstance ( ) . getProvidedExtensions ( org.ovirt.engine.core.aaa.AuthenticationProfileRepository.AUTHN_SERVICE ) ) { registerProfile ( new org.ovirt.engine.core.aaa.AuthenticationProfile ( authnExtension , org.ovirt.engine.core.extensions.mgr.ExtensionsManager.getInstance ( ) . getExtensionByName ( authnExtension.getContext ( ) . < java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) . getProperty ( org.ovirt.engine.core.aaa.AuthenticationProfileRepository.AUTHN_AUTHZ_PLUGIN ) ) ) ) ; } }
Source:
public void testCompareTo ( ) { org.ovirt.engine.core.compat.Guid guid1 = new org.ovirt.engine.core.compat.Guid ( "5b411bc1-c220-4421-9abd-cfa484aecb6e" ) ; org.ovirt.engine.core.compat.Guid guid2 = new org.ovirt.engine.core.compat.Guid ( "5b411bc1-c220-4421-9abd-cfa484aecb6f" ) ; org.junit.Assert.assertTrue ( ( ( guid1.compareTo ( guid2 ) ) < 0 ) ) ; org.junit.Assert.assertTrue ( ( ( guid1.compareTo ( guid1 ) ) == 0 ) ) ; org.junit.Assert.assertTrue ( ( ( guid2.compareTo ( guid1 ) ) > 0 ) ) ; }

Target:
public void testCompareTo ( ) { org.ovirt.engine.core.compat.Guid guid1 = new org.ovirt.engine.core.compat.Guid ( "5b411bc1-c220-4421-9abd-cfa484aecb6e" ) ; org.ovirt.engine.core.compat.Guid guid2 = new org.ovirt.engine.core.compat.Guid ( "5b411bc1-c220-4421-9abd-cfa484aecb6f" ) ; org.junit.Assert.assertTrue ( ( ( guid1.compareTo ( guid2 ) ) < 0 ) ) ; org.junit.Assert.assertEquals ( 0 , guid1.compareTo ( guid1 ) ) ; org.junit.Assert.assertTrue ( ( ( guid2.compareTo ( guid1 ) ) > 0 ) ) ; }
Source:
public static void isVirtioScsiEnabledForVm ( 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 ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isVirtioScsiEnabledForVm ( 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 ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void mockPassDiscardSupportedForDestSd ( org.ovirt.engine.core.bll.ValidationResult validationResult , org.ovirt.engine.core.common.businessentities.storage.ImageOperation imageOperation ) { command.getParameters ( ) . setOperation ( imageOperation ) ; org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator multipleDiskVmElementValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator.class ) ; org.mockito.Mockito.doReturn ( multipleDiskVmElementValidator ) . when ( command ) . createMultipleDiskVmElementValidator ( ) ; org.mockito.Mockito.when ( multipleDiskVmElementValidator.isPassDiscardSupportedForDestSd ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( validationResult ) ; }

Target:
private void mockPassDiscardSupportedForDestSd ( org.ovirt.engine.core.bll.ValidationResult validationResult , org.ovirt.engine.core.common.businessentities.storage.ImageOperation imageOperation ) { command.getParameters ( ) . setOperation ( imageOperation ) ; org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator multipleDiskVmElementValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator.class ) ; org.mockito.Mockito.doReturn ( multipleDiskVmElementValidator ) . when ( command ) . createMultipleDiskVmElementValidator ( ) ; org.mockito.Mockito.when ( multipleDiskVmElementValidator.isPassDiscardSupportedForDestSd ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( validationResult ) ; }
Source:
public void setmessage ( java.lang.String value ) { final java.lang.String INCOMPLETE_SIGN = "..." ; int maxAuditLogMessageLength = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxAuditLogMessageLength ) ; if ( ( value.length ( ) ) > maxAuditLogMessageLength ) { value = ( value.substring ( 0 , ( maxAuditLogMessageLength - ( ( INCOMPLETE_SIGN.length ( ) ) + 1 ) ) ) ) + INCOMPLETE_SIGN ; } this . message = value ; }

Target:
public void setmessage ( java.lang.String value ) { this . message = value ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.Iterator < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > iterator = model.getItems ( ) . iterator ( ) ; if ( iterator.hasNext ( ) ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagModel root = model.cloneTagModel ( iterator.next ( ) ) ; updateDataProvider ( java.util.Arrays.asList ( root ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( model.getItems ( ) ) == null ) { return ; } java.util.Iterator < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > iterator = model.getItems ( ) . iterator ( ) ; if ( iterator.hasNext ( ) ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagModel root = model.cloneTagModel ( iterator.next ( ) ) ; updateDataProvider ( java.util.Arrays.asList ( root ) ) ; } }
Source:
private void setUpMocksForAdd ( boolean hookFound , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { setupMocks ( hookFound , hook ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getServer ( org.ovirt.engine.core.bll.gluster.AddGlusterHookCommandTest.SERVER_ID , "gfs1" , org.ovirt.engine.core.bll.gluster.CLUSTER_ID , status ) ) ; }

Target:
private void setUpMocksForAdd ( boolean hookFound , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { setupMocks ( hookFound , hook ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( getServer ( org.ovirt.engine.core.bll.gluster.AddGlusterHookCommandTest.SERVER_ID , "gfs1" , org.ovirt.engine.core.bll.gluster.CLUSTER_ID , status ) ) ; }
Source:
public void testValidateSessionTrue ( ) { javax.servlet.http.HttpSession httpSession = new org.ovirt.engine.api.common.security.auth.ChallengerTest.TestHttpSession ( org.ovirt.engine.api.common.security.auth.ChallengerTest.sessionId , false ) ; org.mockito.Mockito.doReturn ( httpSession ) . when ( challenger ) . getCurrentSession ( org.mockito.Matchers.anyBoolean ( ) ) ; challenger.setValidator ( new org.ovirt.engine.api.common.security.auth.ChallengerTest.ConstValidator ( true , org.ovirt.engine.api.common.security.auth.ChallengerTest.sessionId ) ) ; org.jboss.resteasy.core.ResourceMethod resource = control.createMock ( org.jboss.resteasy.core.ResourceMethod.class ) ; org.jboss.resteasy.core.ServerResponse response = challenger.preProcess ( setUpRequestExpectations ( null , true , false ) , resource ) ; assertNull ( response ) ; control.verify ( ) ; }

Target:
public void testValidateSessionTrue ( ) { javax.servlet.http.HttpSession httpSession = new org.ovirt.engine.api.common.security.auth.ChallengerTest.TestHttpSession ( org.ovirt.engine.api.common.security.auth.ChallengerTest.sessionId , false ) ; org.mockito.Mockito.doReturn ( httpSession ) . when ( challenger ) . getCurrentSession ( org.mockito.Matchers.anyBoolean ( ) ) ; challenger.setValidator ( new org.ovirt.engine.api.common.security.auth.ChallengerTest.ConstValidator ( true , org.ovirt.engine.api.common.security.auth.ChallengerTest.sessionId ) ) ; org.jboss.resteasy.core.ResourceMethod resource = control.createMock ( org.jboss.resteasy.core.ResourceMethod.class ) ; org.jboss.resteasy.core.ServerResponse response = challenger.preProcess ( setUpRequestExpectations ( null , true , true ) , resource ) ; assertNull ( response ) ; control.verify ( ) ; }
Source:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.GlusterVolumeRemoveBricksCommand command ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( command ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getSingleBrickVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getMultiBrickVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( cmd ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getSingleBrickVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getMultiBrickVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; }
Source:
public void migrateVM ( java.util.List < org.ovirt.engine.core.compat.Guid > initialHosts , org.ovirt.engine.core.compat.Guid vmToMigrate ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate ) ; parameters.setInitialHosts ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( initialHosts ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.MigrateVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
public void migrateVM ( java.util.List < org.ovirt.engine.core.compat.Guid > initialHosts , org.ovirt.engine.core.compat.Guid vmToMigrate ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate ) ; parameters.setInitialHosts ( new java.util.ArrayList ( initialHosts ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.MigrateVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; if ( status != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( getStorageDomainStatus ( ) ) ; } if ( ! valid ) { if ( status == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; } addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }

Target:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; if ( status != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( status ) ; } if ( ! valid ) { if ( status == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; } addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }
Source:
private void addInterfaceDeviceToDb ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addNetworkInterfaceDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) . isPlugged ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDevice ) ; }

Target:
private void addInterfaceDeviceToDb ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addNetworkInterfaceDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . isPlugged ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDevice ) ; }
Source:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity newHook = getGlusterHook ( ) ; newHook.setId ( FixturesTool.NEW_HOOK_ID ) ; dao.save ( newHook ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = dao.getById ( newHook.getId ( ) ) ; org.junit.Assert.assertTrue ( newHook.equals ( hook ) ) ; }

Target:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity newHook = getGlusterHook ( ) ; newHook.setId ( FixturesTool.NEW_HOOK_ID ) ; dao.save ( newHook ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = dao.getById ( newHook.getId ( ) ) ; org.junit.Assert.assertEquals ( newHook , hook ) ; }
Source:
public void testValidateVmMigrating ( ) { prepareForVmValidatorTests ( ) ; 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.MigratingTo ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP ) ; }

Target:
public void testValidateVmMigrating ( ) { prepareForVmValidatorTests ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; cmd.getVm ( ) . setStatus ( VMStatus.MigratingTo ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP ) ; }
Source:
private java.util.Set < java.lang.String > getRemovedBondsUsedByNetworks ( org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Bond > removedBonds ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = getAttachmentsToConfigure ( removedBonds ) ; java.util.Set < java.lang.String > requiredNicsNames = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : attachmentsToConfigure ) { requiredNicsNames.add ( attachment.getNicName ( ) ) ; } return requiredNicsNames ; }

Target:
private java.util.Set < java.lang.String > getRemovedBondsUsedByNetworks ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = getAttachmentsToConfigure ( ) ; java.util.Set < java.lang.String > requiredNicsNames = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : attachmentsToConfigure ) { requiredNicsNames.add ( attachment.getNicName ( ) ) ; } return requiredNicsNames ; }
Source:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DEFAULT_QUOTA_GENERAL , FixturesTool.DISK_PROFILE_1 ) ; dao.save ( entry ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY ) ; org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( ( ( entries.size ( ) ) == 1 ) ) ; org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entryFromDb = entries.get ( 0 ) ; org.junit.Assert.assertEquals ( entry , entryFromDb ) ; }

Target:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DEFAULT_QUOTA_GENERAL , FixturesTool.DISK_PROFILE_1 ) ; dao.save ( entry ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY ) ; org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertEquals ( 1 , entries.size ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entryFromDb = entries.get ( 0 ) ; org.junit.Assert.assertEquals ( entry , entryFromDb ) ; }
Source:
protected void executeVmCommand ( ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; if ( retValue.getSucceeded ( ) ) { getVdsManager ( ) . addV2VJobInfoForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) , JobStatus.WAIT_FOR_START ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" , e ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue runVdsCommand ( ) { return runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; }
Source:
public void clusterWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }

Target:
public void clusterWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }
Source:
private void createUpStoragePool ( ) { org.ovirt.engine.core.common.businessentities.storage_pool pool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; pool.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; pool.setstatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; }

Target:
private void createUpStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; pool.setstatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; }
Source:
private org.ovirt.engine.core.bll.network.macpool.MacPool getMacPoolWithoutLocking ( org.ovirt.engine.core.compat.Guid macPoolId , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { final org.ovirt.engine.core.bll.network.macpool.MacPool poolById = macPools.get ( macPoolId ) ; if ( poolById == null ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.INEXISTENT_POOL_EXCEPTION_MESSAGE ) ; } return decoratedMacPoolFactory.createDecoratedPool ( macPoolId , poolById , decorators ) ; }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacPool getMacPoolWithoutLocking ( org.ovirt.engine.core.compat.Guid macPoolId , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { final org.ovirt.engine.core.bll.network.macpool.MacPool poolById = macPools.get ( macPoolId ) ; if ( poolById == null ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.INEXISTENT_POOL_EXCEPTION_MESSAGE ) ; } return decoratedMacPoolFactory.createDecoratedPool ( poolById , decorators ) ; }
Source:
public void testMemoryMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setPhysicalMemMb ( 4000 ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; assertNotNull ( host.getMemory ( ) ) ; assertEquals ( new java.lang.Long ( host.getMemory ( ) ) , new java.lang.Long ( 4194304000L ) ) ; }

Target:
public void testMemoryMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setPhysicalMemMb ( 4000 ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; assertNotNull ( host.getMemory ( ) ) ; assertEquals ( java.lang.Long.valueOf ( host.getMemory ( ) ) , java.lang.Long.valueOf ( 4194304000L ) ) ; }
Source:
public void setup ( ) { org.mockito.Mockito.doReturn ( "host1" ) . when ( fencedHost ) . getHostName ( ) ; executor = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.pm.HostFenceActionExecutor ( fencedHost , new org.ovirt.engine.core.common.businessentities.FencingPolicy ( ) ) ) ; org.mockito.Mockito.doReturn ( agentExecutor1 ) . doReturn ( agentExecutor2 ) . when ( executor ) . createFenceActionExecutor ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }

Target:
public void setup ( ) { executor = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.pm.HostFenceActionExecutor ( fencedHost , new org.ovirt.engine.core.common.businessentities.FencingPolicy ( ) ) ) ; org.mockito.Mockito.doReturn ( agentExecutor1 ) . doReturn ( agentExecutor2 ) . when ( executor ) . createFenceActionExecutor ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }
Source:
private void initManualWidgets ( ) { usageTypeEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) ) ; uuidEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxOnlyEditor ( ) ; uuidEditorWithInfo = new org.ovirt.engine.ui.common.widget.EntityModelWidgetWithInfo ( new org.ovirt.engine.ui.common.widget.label.EnableableFormLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.provider.ProviderSecretPopupView.constants.idLibvirtSecret ( ) ) , uuidEditor ) ; uuidEditorWithInfo.setExplanation ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( org.ovirt.engine.ui.webadmin.section.main.view.popup.provider.ProviderSecretPopupView.constants.idLibvirtSecretHint ( ) ) ) ; }

Target:
private void initManualWidgets ( ) { usageTypeEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) ) ; uuidEditor = new org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxOnlyEditor ( ) ; uuidEditorWithInfo = new org.ovirt.engine.ui.common.widget.EntityModelWidgetWithInfo ( new org.ovirt.engine.ui.common.widget.label.EnableableFormLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.provider.ProviderSecretPopupView.constants.idLibvirtSecret ( ) ) , uuidEditor ) ; uuidEditorWithInfo.setExplanation ( org.ovirt.engine.ui.webadmin.section.main.view.popup.provider.ProviderSecretPopupView.constants.idLibvirtSecretHint ( ) ) ; }
Source:
private void mockVmDevice ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { org.mockito.Mockito.when ( vmDeviceDao.getVmDeviceByVmIdAndType ( vm.getId ( ) , vmDevice.getType ( ) ) ) . thenReturn ( java.util.Arrays.asList ( vmDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.init ( ) ; }

Target:
private void mockVmDevice ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { org.mockito.Mockito.when ( vmDeviceDao.getVmDeviceByVmIdAndType ( vm.getId ( ) , vmDevice.getType ( ) ) ) . thenReturn ( java.util.Arrays.asList ( vmDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }
Source:
public void checkRemoveNFSConnectionNoDomain ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; org.mockito.Mockito.when ( storageServerConnectionDao.get ( NFSConnection.getid ( ) ) ) . thenReturn ( NFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( NFSConnection.getid ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void checkRemoveNFSConnectionNoDomain ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; org.mockito.Mockito.when ( storageServerConnectionDao.get ( NFSConnection.getId ( ) ) ) . thenReturn ( NFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( NFSConnection.getId ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleListModel roleListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleListModel ) ( model ) ) ; roleListModel.publicAttachedActions = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; roleListModel.setAttachedActionGroups ( publicAttachedActions ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleListModel roleListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleListModel ) ( model ) ) ; roleListModel.publicAttachedActions = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; roleListModel.setAttachedActionGroups ( publicAttachedActions ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue response = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( response.getSucceeded ( ) ) { model.applyData ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( response.getReturnValue ( ) ) ) , false , prevSelected ) ; model.setGetLUNsFailure ( "" ) ; } else { model.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue response ) { if ( response.getSucceeded ( ) ) { model.applyData ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( response.getReturnValue ( ) ) ) , false , prevSelected ) ; model.setGetLUNsFailure ( "" ) ; } else { model.setGetLUNsFailure ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . couldNotRetrieveLUNsLunsFailure ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback callback = command.getCallback ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( org.ovirt.engine.core.bll.tasks.CommandExecutor.log ) . runAction ( command , ( cmdContext != null ? cmdContext.getExecutionContext ( ) : null ) ) ; updateCommand ( command , result ) ; return result ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( org.ovirt.engine.core.bll.tasks.CommandExecutor.log ) . runAction ( command , ( cmdContext != null ? cmdContext.getExecutionContext ( ) : null ) ) ; updateCommand ( command , result ) ; return result ; }
Source:
public java.lang.Void runInTransaction ( ) { try { stepDao.save ( step ) ; jobDao.updateJobLastUpdateTime ( step.getJobId ( ) , new java.util.Date ( ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.JobRepositoryImpl.log.errorFormat ( "Failed to save step {0}, {1}." , step.getId ( ) , step.getStepName ( ) , e ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { try { jobDao.updateJobLastUpdateTime ( step.getJobId ( ) , new java.util.Date ( ) ) ; stepDao.save ( step ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.JobRepositoryImpl.log.errorFormat ( "Failed to save step {0}, {1}." , step.getId ( ) , step.getStepName ( ) , e ) ; } return null ; }
Source:
protected org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters getActionParameters ( org.ovirt.engine.api.model.Network network , org.ovirt.engine.core.common.businessentities.network entity ) { if ( namedDataCenter ( network ) ) { entity.setstorage_pool_id ( getDataCenterId ( network ) ) ; } return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getstorage_pool_id ( ) . getValue ( ) , entity ) ; }

Target:
protected org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters getActionParameters ( org.ovirt.engine.api.model.Network network , org.ovirt.engine.api.model.Network entity ) { if ( namedDataCenter ( network ) ) { entity.setstorage_pool_id ( getDataCenterId ( network ) ) ; } return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getstorage_pool_id ( ) . getValue ( ) , entity ) ; }