auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( emptyParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getNetworkAttachments ( ) ) == null ) { parameters.setNetworkAttachments ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ( ) ) ; } parameters.getNetworkAttachments ( ) . addAll ( java.util.Arrays.asList ( networkAttachments ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( nullParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getNetworkAttachments ( ) ) == null ) { parameters.setNetworkAttachments ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ( ) ) ; } parameters.getNetworkAttachments ( ) . addAll ( java.util.Arrays.asList ( networkAttachments ) ) ; return this ; }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getDefaultSpmPriority ( 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 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }

Target:
private void setUpGetBallooningExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , true ) ; } }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.diskProfileNameLabel ( ) ) ; descriptionEditor.setLabel ( constants.diskProfileDescriptionLabel ( ) ) ; storageDomainEditor.setLabel ( constants.diskProfileStorageDomainLabel ( ) ) ; qosEditor.setLabel ( constants.diskProfileQosLabel ( ) ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.profileNameLabel ( ) ) ; descriptionEditor.setLabel ( constants.profileDescriptionLabel ( ) ) ; storageDomainEditor.setLabel ( constants.diskProfileStorageDomainLabel ( ) ) ; qosEditor.setLabel ( constants.diskProfileQosLabel ( ) ) ; }
Source:
public void testDetachFailure ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , false , false ) ; try { javax.ws.rs.core.Response response = resource.remove ( ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testDetachFailure ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , false , false ) ; try { javax.ws.rs.core.Response response = resource.remove ( ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected void expectGetConnections ( ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS.length ) ; i ++ ) { org.mockito.Mockito.when ( storageServerConnectionDao.get ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS [ i ] . toString ( ) ) ) . thenReturn ( setUpConnection ( i ) ) ; } }

Target:
private void expectGetConnections ( ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS.length ) ; i ++ ) { org.mockito.Mockito.when ( storageServerConnectionDao.get ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS [ i ] . toString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.setUpConnection ( i ) ) ; } }
Source:
protected void validateParameters ( org.ovirt.engine.api.model.DiskProfile diskProfile ) { validateParameters ( diskProfile , "name" , "storageDomain.id" ) ; java.lang.String storageId = diskProfile.getStorageDomain ( ) . getId ( ) ; getEntity ( org.ovirt.engine.core.common.businessentities.StorageDomain.class , VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( storageId ) ) , ( "storagedomain: id=" + storageId ) ) ; }

Target:
protected void validateParameters ( org.ovirt.engine.api.model.DiskProfile diskProfile ) { validateParameters ( diskProfile , "name" , "storageDomain.id" ) ; java.lang.String storageId = diskProfile.getStorageDomain ( ) . getId ( ) ; getEntity ( org.ovirt.engine.core.common.businessentities.StorageDomain.class , QueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( storageId ) ) , ( "storagedomain: id=" + storageId ) ) ; }
Source:
private void AddVdsStatisticsToDb ( ) { org.ovirt.engine.core.common.businessentities.VdsStatistics vdsStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; vdsStatistics.setId ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) . getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStatisticsDao ( ) . save ( vdsStatistics ) ; org.ovirt.engine.core.bll.hostdeploy.AddVdsCommand.getCompensationContext ( ) . snapshotNewEntity ( vdsStatistics ) ; }

Target:
private void addVdsStatisticsToDb ( ) { org.ovirt.engine.core.common.businessentities.VdsStatistics vdsStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; vdsStatistics.setId ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) . getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStatisticsDao ( ) . save ( vdsStatistics ) ; org.ovirt.engine.core.bll.hostdeploy.AddVdsCommand.getCompensationContext ( ) . snapshotNewEntity ( vdsStatistics ) ; }
Source:
private void assertHostValid ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vnics ) { validateVnics ( vnics , new java.util.ArrayList < java.lang.String > ( ) ) ; org.junit.Assert.assertEquals ( expectedVnicToVfMap , vfScheduler.getVnicToVfMap ( vmId , hostId ) ) ; }

Target:
private void validateVnicToVfMap ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > vnicToVfMap = vfScheduler.getVnicToVfMap ( vmId , hostId ) ; vnicToVfMap = ( vnicToVfMap == null ) ? new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.lang.String > ( ) : vnicToVfMap ; org.junit.Assert.assertEquals ( expectedVnicToVfMap , vnicToVfMap ) ; }
Source:
public void doPolling ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.common.businessentities.V2VJobInfo job = getV2VJobInfo ( ) ; if ( job == null ) { getCommand ( cmdId ) . setCommandStatus ( CommandStatus.FAILED ) ; return ; } switch ( job.getStatus ( ) ) { case STARTING : case COPYING_DISK : break ; case DONE : getCommand ( cmdId ) . setCommandStatus ( CommandStatus.SUCCEEDED ) ; break ; case ERROR : case ABORTED : getCommand ( cmdId ) . setCommandStatus ( CommandStatus.FAILED ) ; break ; case UNKNOWN : case INITIALIZE : } }

Target:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL ) ; } if ( ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) ) == null ) && ( ! ( selectProxyHost ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL ) ; } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage_domains initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setstorage_pool_id ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }
Source:
private boolean isNetworkDeviceFree ( org.ovirt.engine.core.common.businessentities.HostDevice networkDevice ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vfNic = getNicByPciDevice ( networkDevice ) ; return ( ( ( vfNic != null ) && ( ! ( isNetworkAttached ( vfNic ) ) ) ) && ( ! ( isVlanDeviceAttached ( vfNic ) ) ) ) && ( ! ( vfNic.isPartOfBond ( ) ) ) ; }

Target:
private boolean isNetworkDeviceFree ( org.ovirt.engine.core.common.businessentities.HostDevice pciDevice ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vfNic = getNicByPciDevice ( pciDevice ) ; return ( ( ( vfNic != null ) && ( ! ( isNetworkAttached ( vfNic ) ) ) ) && ( ! ( isVlanDeviceAttached ( vfNic ) ) ) ) && ( ! ( vfNic.isPartOfBond ( ) ) ) ; }
Source:
public boolean matches ( java.lang.Object argument ) { if ( ! ( argument instanceof java.util.ArrayList ) ) { return false ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > optionsToAdd = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > ) ( argument ) ) ; existingReplVol.setOption ( optionsToAdd.get ( 0 ) ) ; return ( ( optionsToAdd.size ( ) ) == 1 ) && ( optionsToAdd.get ( 0 ) . getKey ( ) . equals ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.OPTION_AUTH_REJECT ) ) ; }

Target:
public boolean matches ( java.lang.Object argument ) { if ( ! ( argument instanceof java.util.Collection ) ) { return false ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Collection < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > optionsToAdd = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > ) ( argument ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option = optionsToAdd.iterator ( ) . next ( ) ; existingReplVol.setOption ( option ) ; return ( ( optionsToAdd.size ( ) ) == 1 ) && ( option.getKey ( ) . equals ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.OPTION_AUTH_REJECT ) ) ; }
Source:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; setVmBasicDiskListModel ( new org.ovirt.engine.ui.uicommonweb.models.userportal.VmBasicDiskListModel ( ) ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( getVmBasicDiskListModel ( ) ) ; setDetailModels ( list ) ; setActiveDetailModel ( getVmBasicDiskListModel ( ) ) ; }

Target:
private void setDetailList ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( getVmBasicDiskListModel ( ) ) ; setDetailModels ( list ) ; setActiveDetailModel ( getVmBasicDiskListModel ( ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( ( lastExecutedCommand == ( getModel ( ) . getNewCommand ( ) ) ) || ( lastExecutedCommand == ( getModel ( ) . getEditCommand ( ) ) ) ) { return profilePopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
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:
public void isSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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 ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static java.util.Map < java.lang.String , java.lang.Object > getSessionData ( javax.servlet.ServletContext ctx , java.lang.String token ) { return ( ( java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > ) ( ctx.getAttribute ( org.ovirt.engine.core.sso.utils.SSOUtils.SSO_SESSIONS ) ) ) . get ( token ) ; }

Target:
public static java.lang.String encrypt ( javax.servlet.ServletContext ctx , java.lang.String clientId , java.lang.String rawText ) throws java.lang.Exception { org.ovirt.engine.core.sso.utils.ClientInfo clientInfo = org.ovirt.engine.core.sso.utils.SSOUtils.getSsoContext ( ctx ) . getClienInfo ( clientId ) ; try ( java.io.InputStream in = new java.io.FileInputStream ( clientInfo.getCertificateLocation ( ) ) ) { return org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecrypt.encrypt ( "AES/OFB/PKCS5Padding" , 256 , java.security.cert.CertificateFactory.getInstance ( "X.509" ) . generateCertificate ( in ) , 100 , rawText.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; } }
Source:
public void nameInUse ( ) { org.mockito.Mockito.when ( oldHost.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.ArgumentMatchers.any ( java.lang.String.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }

Target:
public void nameInUse ( ) { org.mockito.Mockito.when ( oldHost.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }
Source:
public void StorageEventOnTimer ( org.ovirt.engine.core.common.businessentities.storage_pool storagePool , boolean _isSpmStartCalled ) { try { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . IsStoragePoolMasterUp ( _storagePoolId ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolUpEvent ( storagePool , _isSpmStartCalled ) ; } } catch ( java.lang.RuntimeException exp ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.error ( "Error in StoragePoolUpEvent - " , exp ) ; } }

Target:
public void run ( ) { try { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . isStoragePoolMasterUp ( _storagePoolId ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolUpEvent ( storagePool , _isSpmStartCalled ) ; } } catch ( java.lang.RuntimeException exp ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.error ( "Error in StoragePoolUpEvent - " , exp ) ; } }
Source:
public void setUp ( ) { key = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ; value = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ; map = new java.util.HashMap < java.lang.Integer , java.util.List < java.lang.Integer > > ( ) ; }

Target:
public void setUp ( ) { key = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ; value = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ; map = new java.util.HashMap < java.lang.Integer , java.util.List < java.lang.Integer > > ( ) ; mapOfSets = new java.util.HashMap < java.lang.Integer , java.util.Set < java.lang.Integer > > ( ) ; }
Source:
public static void GetUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private void mockConfig ( ) { mcr.mockConfigValue ( ConfigValues.PredefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.UserDefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.InitStorageSparseSizeInGB , 1 ) ; mcr.mockConfigValue ( ConfigValues.VirtIoScsiEnabled , Version.v3_3 , true ) ; mcr.mockConfigValue ( ConfigValues.ValidNumOfMonitors , java.util.Arrays.asList ( "1,2,4" . split ( "," ) ) ) ; mcr.mockConfigValue ( ConfigValues.IsMigrationSupported , Version.v3_3 , org.ovirt.engine.core.bll.AddVmCommandTest.migrationMap ) ; mcr.mockConfigValue ( ConfigValues.MaxIoThreadsPerVm , 127 ) ; }

Target:
private void mockConfig ( ) { mcr.mockConfigValue ( ConfigValues.ValidNumOfMonitors , java.util.Arrays.asList ( "1,2,4" . split ( "," ) ) ) ; mcr.mockConfigValue ( ConfigValues.IsMigrationSupported , Version.v4_0 , org.ovirt.engine.core.bll.AddVmCommandTest.migrationMap ) ; mcr.mockConfigValue ( ConfigValues.MaxIoThreadsPerVm , 127 ) ; }
Source:
public static 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetDataCenterMaxNameLength ( 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 ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . setSsoToken ( user.getEngineSessionId ( ) ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { commonModelProvider.get ( ) . updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }

Target:
public void onPluginsReady ( ) { pluginsReady = true ; }
Source:
public void refuseSoundDeviceOnPPC ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddPpcTest ( ) ; cmd.getParameters ( ) . setSoundDeviceEnabled ( true ) ; org.mockito.Mockito.when ( osRepository.isSoundDeviceEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.SOUND_DEVICE_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; }

Target:
public void refuseSoundDeviceOnPPC ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddPpcTest ( ) ; cmd.getParameters ( ) . setSoundDeviceEnabled ( true ) ; org.mockito.Mockito.when ( osRepository.isSoundDeviceEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.SOUND_DEVICE_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol resolveSelectedProtocol ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel item ) { if ( ( ( item == null ) || ( ( item.getVM ( ) ) == null ) ) || ( ( item.getVM ( ) . getId ( ) ) == null ) ) { return null ; } org.ovirt.engine.core.compat.Guid vmId = item.getVM ( ) . getId ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel selectedConsoleModel = resolveSelectedConsoleModel ( vmId ) ; return selectedConsoleModel == null ? null : org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol.getProtocolByModel ( selectedConsoleModel.getClass ( ) ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol resolveUserSelectedProtocol ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel item ) { if ( ( ( item == null ) || ( ( item.getVM ( ) ) == null ) ) || ( ( item.getVM ( ) . getId ( ) ) == null ) ) { return null ; } org.ovirt.engine.core.compat.Guid vmId = item.getVM ( ) . getId ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel selectedConsoleModel = resolveUserSelectedConsoleModel ( vmId ) ; return selectedConsoleModel == null ? null : org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol.getProtocolByModel ( selectedConsoleModel.getClass ( ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForDataCenter ( ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = dbFacade.getStoragePoolDAO ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_POOL_ID ) ; org.junit.Assert.assertNotNull ( storagePool ) ; java.lang.String name = storagePool.getname ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_POOL_ID , VdcObjectType.StoragePool ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForDataCenter ( ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = dbFacade.getStoragePoolDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_POOL_ID ) ; org.junit.Assert.assertNotNull ( storagePool ) ; java.lang.String name = storagePool.getname ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_POOL_ID , VdcObjectType.StoragePool ) ) ) ; }
Source:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.bll.context.CommandContext cmdContext , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) , cmdContext ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParentParameters ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParameters ( ) ; if ( parentHasCallback ( ) ) { if ( ( ! ( getParameters ( ) . getShouldBeEndedByParent ( ) ) ) || ( ( getTaskType ( ) ) == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ) ) ) { parentParameters = getParameters ( ) . getParentParameters ( ) ; } } else if ( getParameters ( ) . getShouldBeEndedByParent ( ) ) { parentParameters = getParameters ( ) . getParentParameters ( ) ; } return parentParameters ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVdsStatisticsDao ( ) ; staticDao = dbFacade.getVdsStaticDao ( ) ; dynamicDao = dbFacade.getVdsDynamicDao ( ) ; existingVds = staticDao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.setHostName ( "farkle.redhat.com" ) ; newStaticVds.setVdsGroupId ( existingVds.getVdsGroupId ( ) ) ; newStaticVds.setProtocol ( VdsProtocol.STOMP ) ; newStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVdsStatisticsDao ( ) ; staticDao = dbFacade.getVdsStaticDao ( ) ; dynamicDao = dbFacade.getVdsDynamicDao ( ) ; existingVds = staticDao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.setHostName ( "farkle.redhat.com" ) ; newStaticVds.setClusterId ( existingVds.getClusterId ( ) ) ; newStaticVds.setProtocol ( VdsProtocol.STOMP ) ; newStatistics = new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ; }
Source:
public static synchronized java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmOsType type : org.ovirt.engine.core.common.businessentities.VmOsType.values ( ) ) { if ( type.isWindows ( ) ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes.add ( type ) ; } } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }

Target:
public static synchronized java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > getWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmOsType type : org.ovirt.engine.core.common.businessentities.VmOsType.values ( ) ) { if ( type.isWindows ( ) ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes.add ( type ) ; } } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }
Source:
protected boolean validateCreateImage ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( VdcActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getContext ( ) . clone ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }

Target:
protected boolean validateCreateImage ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( VdcActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getContext ( ) . clone ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }
Source:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes ) { getNetworkQoS ( ) . setItems ( networkQoSes ) ; defaultQos = org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( networkQoSes , defaultQosId ) ; getNetworkQoS ( ) . setSelectedItem ( defaultQos ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes ) { getNetworkQoS ( ) . setItems ( networkQoSes ) ; defaultQos = networkQoSes.stream ( ) . filter ( new org.ovirt.engine.ui.uicommonweb.Linq.IdPredicate < > ( defaultQosId ) ) . findFirst ( ) . orElse ( NetworkQoSModel.EMPTY_QOS ) ; getNetworkQoS ( ) . setSelectedItem ( defaultQos ) ; }
Source:
private void updateController ( ) { this . controller = modelProvider.getModel ( ) ; org.ovirt.engine.ui.uicommonweb.models.GridTimer modelTimer = getModelTimer ( ) ; modelTimer.setRefreshRate ( readRefreshRate ( ) ) ; modelTimer.addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.String > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { onRefresh ( event.getValue ( ) ) ; } } ) ; }

Target:
private void updateController ( ) { this . controller = modelProvider.getModel ( ) ; updateTimer ( ) ; }
Source:
protected void endWithFailure ( ) { setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . endAction ( VdcActionType.RunVm , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getCompensationContext ( ) ) ) . getSucceeded ( ) ) ; if ( ! ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getSucceeded ( ) ) ) { log.warn ( "AttachUserToVmFromPoolAndRunCommand::EndWitFailure: endAction of RunVm Failed" ) ; } detachUserFromVmFromPool ( ) ; }

Target:
protected void endWithFailure ( ) { setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . endAction ( VdcActionType.RunVm , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.cloneContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) . getSucceeded ( ) ) ; if ( ! ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getSucceeded ( ) ) ) { log.warn ( "AttachUserToVmFromPoolAndRunCommand::EndWitFailure: endAction of RunVm Failed" ) ; } detachUserFromVmFromPool ( ) ; }
Source:
public void testCanDoFailOnAddFloatingDiskWithPlugSet ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( true ) ; initializeCommand ( null , parameters ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.CANNOT_ADD_FLOATING_DISK_WITH_PLUG_VM_SET ) ; }

Target:
public void testValidateFailOnAddFloatingDiskWithPlugSet ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( true ) ; initializeCommand ( null , parameters ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.CANNOT_ADD_FLOATING_DISK_WITH_PLUG_VM_SET ) ; }
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.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; vm.setSingleQxlPci ( false ) ; vm.setClusterArch ( ArchitectureType.x86_64 ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.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.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; vm.setSingleQxlPci ( false ) ; vm.setClusterArch ( ArchitectureType.x86_64 ) ; vm.setVmOs ( org.ovirt.engine.core.utils.ovf.OvfManagerTest.EXISTING_OS_ID ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.initInterfaces ( vm ) ; return vm ; }
Source:
private void updateDestinitationImageId ( ) { org.ovirt.engine.core.common.businessentities.Image oldLeaf = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . get ( enclosingCommand.getParameters ( ) . getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > allImages = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( oldLeaf.getDiskId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : allImages ) { if ( image.getImage ( ) . isActive ( ) ) { enclosingCommand.getParameters ( ) . setDestinationImageId ( image.getImageId ( ) ) ; break ; } } }

Target:
private void updateDestinationImageId ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters ) { org.ovirt.engine.core.common.businessentities.Image oldLeaf = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . get ( parameters.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > allImages = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( oldLeaf.getDiskId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : allImages ) { if ( image.getImage ( ) . isActive ( ) ) { parameters.setDestinationImageId ( image.getImageId ( ) ) ; break ; } } }
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 ( 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 ( storageServerConnectionLunMapDao.getAll ( lunId ) ) . thenReturn ( ret ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByStoragePoolId , org.ovirt.engine.core.common.queries.StorageDomainAndPoolQueryParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworksResourceTest.DATA_CENTER_ID } , getEntityList ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworksResourceTest.DATA_CENTER_ID } , getEntityList ( ) , failure ) ; control.replay ( ) ; }
Source:
public void validateFailsOnPassDiscardSupport ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcSd = initStorageDomain ( srcStorageId ) ; srcSd.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstSd = initStorageDomain ( dstStorageId ) ; dstSd.setStatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.when ( diskVmElementValidator.isPassDiscardSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ; }

Target:
public void validateFailsOnPassDiscardSupport ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcSd = initStorageDomain ( srcStorageId ) ; srcSd.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstSd = initStorageDomain ( dstStorageId ) ; dstSd.setStatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.when ( diskVmElementValidator.isPassDiscardSupported ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ; }