auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void updateStorageTypeForDisk ( org.ovirt.engine.api.model.Disk disk ) { org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( disk ) ; if ( storageDomainId != null ) { org.ovirt.engine.api.model.StorageDomain storageDomain = getStorageDomainById ( storageDomainId ) ; if ( storageDomain != null ) { disk.setStorageType ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( storageDomain.getStorageDomainType ( ) ) ) ; } } }

Target:
public org.ovirt.engine.api.restapi.resource.BackendDiskAttachmentsResource getAttachmentsResource ( ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendDiskAttachmentsResource ( vmId ) ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { try { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunPublicQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { org.ovirt.engine.ui.frontend.Frontend.raiseQueryCompleteEvent ( queryTypeList , context ) ; } }

Target:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; if ( callback != null ) { callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } }
Source:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > > aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void setObjectName ( java.lang.Object object , java.lang.String name , boolean isSuffix ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( object ) ) ; if ( isSuffix ) { vm.setVmName ( ( ( vm.getVmName ( ) ) + name ) ) ; } else { vm.setVmName ( name ) ; } }

Target:
protected void setObjectName ( java.lang.Object object , java.lang.String name , boolean isSuffix ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) ; if ( isSuffix ) { vm.setName ( ( ( vm.getName ( ) ) + name ) ) ; } else { vm.setName ( name ) ; } }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testDeleteAllUnusedIcons ( ) { reinitializeDatabase ( ) ; prepareDao ( ) . removeAllUnusedIcons ( ) ; final org.ovirt.engine.core.common.businessentities.VmIcon unusedIcon = prepareDao ( ) . get ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ; org.junit.Assert.assertNull ( unusedIcon ) ; final org.ovirt.engine.core.common.businessentities.VmIcon usedIcon = prepareDao ( ) . get ( org.ovirt.engine.core.dao.VmIconDaoTest.OTHER_SMALL_ICON_ID ) ; org.junit.Assert.assertNotNull ( usedIcon ) ; reinitializeDatabase ( ) ; }

Target:
public void testDeleteAllUnusedIcons ( ) { reinitializeDatabase ( ) ; prepareDao ( ) . removeAllUnusedIcons ( ) ; final org.ovirt.engine.core.common.businessentities.VmIcon unusedIcon = prepareDao ( ) . get ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ; org.junit.Assert.assertNull ( unusedIcon ) ; final org.ovirt.engine.core.common.businessentities.VmIcon usedIcon = prepareDao ( ) . get ( FixturesTool.SMALL_ICON_ID ) ; org.junit.Assert.assertNotNull ( usedIcon ) ; reinitializeDatabase ( ) ; }
Source:
public void testUnmappedModelValue ( ) { for ( org.ovirt.engine.api.model.BootProtocol value : java.util.EnumSet.complementOf ( java.util.EnumSet.of ( BootProtocol.AUTOCONF ) ) ) { org.junit.Assert.assertThat ( java.lang.String.format ( "%s.%s is not mapped" , org.ovirt.engine.api.model.BootProtocol.class . getName ( ) , value ) , org.ovirt.engine.api.restapi.types.Ipv4BootProtocolMapper.map ( value ) , org.hamcrest.Matchers.notNullValue ( ) ) ; } }

Target:
public void testUnmappedModelValue ( ) { for ( org.ovirt.engine.api.model.BootProtocol value : java.util.EnumSet.complementOf ( java.util.EnumSet.of ( BootProtocol.AUTOCONF ) ) ) { org.hamcrest.MatcherAssert.assertThat ( java.lang.String.format ( "%s.%s is not mapped" , org.ovirt.engine.api.model.BootProtocol.class . getName ( ) , value ) , org.ovirt.engine.api.restapi.types.Ipv4BootProtocolMapper.map ( value ) , org.hamcrest.Matchers.notNullValue ( ) ) ; } }
Source:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int duplicateEventsIntrvalValue = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getDuplicateEventsIntervalValue ( ) ; if ( duplicateEventsIntrvalValue > 0 ) { auditLogable.setEndTime ( org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddSeconds ( logType.getDuplicateEventsIntervalValue ( ) ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.ComposeObjectId ( auditLogable , logType ) ) ; } }

Target:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int duplicateEventsIntrvalValue = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getDuplicateEventsIntervalValue ( ) ; if ( duplicateEventsIntrvalValue > 0 ) { auditLogable.setEndTime ( org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddSeconds ( logType.getDuplicateEventsIntervalValue ( ) ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }
Source:
public java.lang.String getCustomToolTip ( ) { if ( ( ! ( getModel ( ) . getIsCloneVmSupported ( ) ) ) && ( ( getModel ( ) . getEntity ( ) ) != null ) ) { org.ovirt.engine.core.common.queries.CommandVersionsInfo commandVersionsInfo = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetCommandVersionsInfo ( VdcActionType.AddVmFromSnapshot ) ; java.lang.String minimalClusterVersion = ( commandVersionsInfo != null ) ? commandVersionsInfo.getClusterVersion ( ) . toString ( 2 ) : "" ; return messages.cloneVmNotSupported ( minimalClusterVersion ) ; } else { return this . getTitle ( ) ; } }

Target:
public java.lang.String getCustomToolTip ( ) { if ( ( ! ( getModel ( ) . getIsCloneVmSupported ( ) ) ) && ( ( getModel ( ) . getEntity ( ) ) != null ) ) { org.ovirt.engine.core.common.queries.CommandVersionsInfo commandVersionsInfo = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getCommandVersionsInfo ( VdcActionType.AddVmFromSnapshot ) ; java.lang.String minimalClusterVersion = ( commandVersionsInfo != null ) ? commandVersionsInfo.getClusterVersion ( ) . toString ( 2 ) : "" ; return messages.cloneVmNotSupported ( minimalClusterVersion ) ; } else { return this . getTitle ( ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDS makeTestVds ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.common.businessentities.VDS newVdsData = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; newVdsData.setHostName ( "BUZZ" ) ; newVdsData.setVdsName ( "BAR" ) ; newVdsData.setClusterCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "1.2.3" ) ) ; newVdsData.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newVdsData.setId ( vdsId ) ; return newVdsData ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS createOldHost ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.common.businessentities.VDS oldHost = host.clone ( ) ; oldHost.setVdsName ( "FOO" ) ; return oldHost ; }
Source:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) || ( ! ( checkDerivedDisksFromDiskNotExist ( diskImage ) ) ) ) { return false ; } return true ; }

Target:
private boolean checkDerivedVmFromTemplateExists ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { java.util.List < java.lang.String > vmNames = getNamesOfDerivedVmsFromTemplate ( diskImage ) ; if ( ! ( vmNames.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM ) ; addCanDoActionMessageVariable ( "vmsList" , org.apache.commons.lang.StringUtils.join ( vmNames , "," ) ) ; return false ; } return true ; }
Source:
public void tAggregateRow_8_AGGIN_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.aggregationtodaily_3_6.AggregationToDaily.TalendException { end_Hash.put ( "tAggregateRow_8_AGGIN" , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tJDBCInput_10_onSubJobError ( exception , errorComponent , globalMap ) ; }

Target:
public void tAggregateRow_8_AGGOUT_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.aggregationtodaily_3_6.AggregationToDaily.TalendException { tAggregateRow_8_AGGIN_error ( exception , errorComponent , globalMap ) ; }
Source:
private void initializeCache ( ) { if ( ! ( cacheInitialized ) ) { synchronized ( LOCK ) { if ( ! ( cacheInitialized ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity : cmdEntities ) { commandMap.put ( cmdEntity.getId ( ) , cmdEntity ) ; } cacheInitialized = true ; } } } }

Target:
private void initializeCache ( ) { if ( ! ( cacheInitialized ) ) { synchronized ( LOCK ) { if ( ! ( cacheInitialized ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = commandEntityDao.getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity : cmdEntities ) { commandMap.put ( cmdEntity.getId ( ) , cmdEntity ) ; } cacheInitialized = true ; } } } }
Source:
public void setup ( ) { vdsGroup1 = createVdsGroup ( ) ; vdsGroup2 = createVdsGroup ( ) ; org.mockito.Mockito.when ( vdsGroupDao.getAll ( ) ) . thenReturn ( java.util.Arrays.asList ( vdsGroup1 , vdsGroup2 ) ) ; org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.eq ( vdsGroup1 ) ) ) . thenReturn ( vm1 ) ; org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.eq ( vdsGroup2 ) ) ) . thenReturn ( vm2 ) ; arem.wakeup ( ) ; }

Target:
public void setup ( ) { vdsGroup1 = createVdsGroup ( ) ; vdsGroup2 = createVdsGroup ( ) ; org.mockito.Mockito.when ( vdsGroupDao.getWithoutMigratingVms ( ) ) . thenReturn ( java.util.Arrays.asList ( vdsGroup1 , vdsGroup2 ) ) ; org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.eq ( vdsGroup1 ) ) ) . thenReturn ( vm1 ) ; org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.eq ( vdsGroup2 ) ) ) . thenReturn ( vm2 ) ; arem.wakeup ( ) ; }
Source:
public void getUsbPolicyUsbTypeLegacy ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "legacy" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicySetDisabled ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( false ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.DISABLED ) ; }
Source:
private void updateMemoryBalloonDevice ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } boolean isBalloonEnabled = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isBalloonEnabled ( osType , cluster.getcompatibility_version ( ) ) ; getMemoryBalloonDeviceEnabled ( ) . setIsChangable ( isBalloonEnabled ) ; if ( getBehavior ( ) . basedOnCustomInstanceType ( ) ) { getMemoryBalloonDeviceEnabled ( ) . setEntity ( isBalloonEnabled ) ; } }

Target:
private void updateMemoryBalloonDevice ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } boolean isBalloonEnabled = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isBalloonEnabled ( osType , cluster.getCompatibilityVersion ( ) ) ; getMemoryBalloonDeviceEnabled ( ) . setIsChangable ( isBalloonEnabled ) ; if ( getBehavior ( ) . basedOnCustomInstanceType ( ) ) { getMemoryBalloonDeviceEnabled ( ) . setEntity ( isBalloonEnabled ) ; } }
Source:
protected boolean acquireLockInternal ( ) { final boolean acquireLock = super . acquireLockInternal ( ) ; if ( ( ( ! acquireLock ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isAutoStartup ( ) ) ) { org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmToRun ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmId ( ) ) ; } return acquireLock ; }

Target:
protected org.ovirt.engine.core.compat.Guid getPredefinedVdsIdToRunOn ( ) { return org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigSet ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String configValue ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepConfigSet ( volumeName , slaveHost , slaveVolumeName , configKey , configValue ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigSet ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String configValue , java.lang.String userName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepConfigSet ( volumeName , slaveHost , slaveVolumeName , configKey , configValue , userName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
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 ) { boolean authenticationRequired = requiresAuthentication.getEntity ( ) ; getUsername ( ) . setIsChangable ( authenticationRequired ) ; getPassword ( ) . setIsChangable ( authenticationRequired ) ; getTenantName ( ) . setIsChangable ( authenticationRequired ) ; getAuthUrl ( ) . setIsChangable ( authenticationRequired ) ; }

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 ) { boolean authenticationRequired = requiresAuthentication.getEntity ( ) ; getUsername ( ) . setIsChangeable ( authenticationRequired ) ; getPassword ( ) . setIsChangeable ( authenticationRequired ) ; getTenantName ( ) . setIsChangeable ( authenticationRequired ) ; getAuthUrl ( ) . setIsChangeable ( authenticationRequired ) ; }
Source:
protected void verifyAddDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.verify ( macPoolManager , addMacVerification ) . AddMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceDAO ) . save ( iface ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . save ( iface.getStatistics ( ) ) ; }

Target:
protected void verifyAddDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.verify ( macPoolManager , addMacVerification ) . addMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceDAO ) . save ( iface ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . save ( iface.getStatistics ( ) ) ; }
Source:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterDesktopMemoryOverCommit ( 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 ) ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage.VolumeClassification deleteVolumeUnknownType ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.businessentities.storage.VolumeClassification cinderVolumeType = cinderDisk.getVolumeClassification ( ) ; if ( cinderVolumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Volume ) ) { deleteVolume ( cinderDisk ) ; } else if ( cinderVolumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Snapshot ) ) { deleteSnapshot ( cinderDisk.getImageId ( ) ) ; } else { org.ovirt.engine.core.bll.storage.CinderBroker.log.error ( "Error, could not determine Cinder entity with id from Cinder provider." , cinderDisk.getDiskAlias ( ) , cinderDisk.getImageId ( ) ) ; } return cinderVolumeType ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.VolumeClassification deleteVolumeByClassificationType ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.businessentities.storage.VolumeClassification cinderVolumeType = cinderDisk.getVolumeClassification ( ) ; if ( cinderVolumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Volume ) ) { deleteVolume ( cinderDisk ) ; } else if ( cinderVolumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Snapshot ) ) { deleteSnapshot ( cinderDisk.getImageId ( ) ) ; } else { org.ovirt.engine.core.bll.storage.CinderBroker.log.error ( "Error, could not determine Cinder entity with id from Cinder provider." , cinderDisk.getDiskAlias ( ) , cinderDisk.getImageId ( ) ) ; } return cinderVolumeType ; }
Source:
protected void connect ( ) { if ( ( ( getEntity ( ) ) == null ) || ( ( getEntity ( ) . getRunOnVds ( ) ) == null ) ) { return ; } getLogger ( ) . debug ( "VNC console info..." ) ; org.ovirt.engine.ui.uicommonweb.UICommand setVmTicketCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "setVmCommand" , new org.ovirt.engine.ui.uicommonweb.BaseCommandTarget ( ) { @ java.lang.Override public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { setVmTicket ( ) ; } } ) ; executeCommandWithConsoleSafenessWarning ( setVmTicketCommand ) ; }

Target:
protected void connect ( ) { if ( ( ( getEntity ( ) ) == null ) || ( ( getEntity ( ) . getRunOnVds ( ) ) == null ) ) { return ; } getLogger ( ) . debug ( "VNC console info..." ) ; org.ovirt.engine.ui.uicommonweb.UICommand invokeConsoleCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "invokeConsoleCommand" , new org.ovirt.engine.ui.uicommonweb.BaseCommandTarget ( ) { @ java.lang.Override public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { invokeConsole ( ) ; } } ) ; executeCommandWithConsoleSafenessWarning ( invokeConsoleCommand ) ; }
Source:
private void initVmDiskImage ( boolean isShareable ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.VM ) ; diskImage.setShareable ( isShareable ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }

Target:
public void validateImageNotFound ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }
Source:
protected void EntityChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent notifier = ( ( org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ( ( oldValue instanceof org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ? oldValue : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . removeListener ( this ) ; } notifier = ( ( org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ( ( newValue instanceof org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ? newValue : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . addListener ( this ) ; } }

Target:
protected void entityChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent notifier = ( ( org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ( ( oldValue instanceof org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ? oldValue : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . removeListener ( this ) ; } notifier = ( ( org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ( ( newValue instanceof org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ? newValue : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . addListener ( this ) ; } }
Source:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response deactivate ( org.ovirt.engine.api.model.Action action ) { return doAction ( VdcActionType.MaintenanceNumberOfVdss , new org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters ( asList ( guid ) , false , ( action.isSetReason ( ) ? action.getReason ( ) : null ) ) , action ) ; }

Target:
public javax.ws.rs.core.Response deactivate ( org.ovirt.engine.api.model.Action action ) { boolean stopGlusterService = org.ovirt.engine.api.common.util.QueryHelper.getBooleanMatrixParameter ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostResource.STOP_GLUSTER_SERVICE , true , false ) ; return doAction ( VdcActionType.MaintenanceNumberOfVdss , new org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters ( asList ( guid ) , false , ( action.isSetReason ( ) ? action.getReason ( ) : null ) , stopGlusterService ) , action ) ; }
Source:
public static org.ovirt.engine.core.bll.context.CommandContext createInternalJobContext ( org.ovirt.engine.core.utils.lock.EngineLock lock ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; executionContext.setJobRequired ( true ) ; executionContext.setMonitored ( true ) ; return new org.ovirt.engine.core.bll.context.CommandContext ( new org.ovirt.engine.core.bll.context.EngineContext ( ) ) . withExecutionContext ( executionContext ) . withLock ( lock ) . withoutCompensationContext ( ) ; }

Target:
private static org.ovirt.engine.core.bll.job.ExecutionContext createMonitoredExecutionContext ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; executionContext.setJobRequired ( true ) ; executionContext.setMonitored ( true ) ; return executionContext ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getGlusterServerHook ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity entity , org.ovirt.engine.core.compat.Guid hostId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterServerHook = getCallsHandler ( ) . executeRead ( "GetGlusterServerHook" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterServerHookRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , entity.getId ( ) ) . addValue ( "host_id" , hostId ) ) ; if ( glusterServerHook != null ) { entity.setChecksum ( glusterServerHook.getChecksum ( ) ) ; entity.setStatus ( glusterServerHook.getStatus ( ) ) ; } return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook getGlusterServerHook ( org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook = getCallsHandler ( ) . executeRead ( "GetGlusterServerHook" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterServerHookRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , hookId ) . addValue ( "server_id" , serverId ) ) ; return serverHook ; }
Source:
public void canDoActionFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters param = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( ) ; param.setForce ( false ) ; param.setVolumeId ( startedVolumeId ) ; param.setGeoRepSessionId ( geoRepSessionId ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.PauseGlusterVolumeGeoRepSessionCommand ( param ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.PASSIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void validateFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters param = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( ) ; param.setForce ( false ) ; param.setVolumeId ( startedVolumeId ) ; param.setGeoRepSessionId ( geoRepSessionId ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.PauseGlusterVolumeGeoRepSessionCommand ( param ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.PASSIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void onSaveNetworkConfig ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ( model.getProgress ( ) ) != null ) { return ; } model.startProgress ( null ) ; setcurrentModel ( model ) ; new org.ovirt.engine.ui.uicommonweb.models.hosts.SaveNetworkConfigAction ( this , model , getEntity ( ) ) . execute ( ) ; }

Target:
public void setupNetworks ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel setupNetworksWindowModel = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel ( this , getEntity ( ) ) ; setWindow ( setupNetworksWindowModel ) ; }
Source:
public void testList ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsHooksById2 , org.ovirt.engine.core.common.queries.GetVdsHooksByIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; assertNotNull ( hooks.getHooks ( ) ) ; assertEquals ( hooks.getHooks ( ) . size ( ) , 4 ) ; }

Target:
public void testList ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsHooksById2 , org.ovirt.engine.core.common.queries.GetVdsHooksByIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; assertNotNull ( hooks.getHooks ( ) ) ; assertEquals ( hooks.getHooks ( ) . size ( ) , 4 ) ; }
Source:
private void setupVmNetworkInterfaceDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > expectedVmNetworkInterface = java.util.Collections.singletonList ( vmNetworkInterface ) ; org.ovirt.engine.core.dao.VmNetworkInterfaceDAO vmNetworkInterfaceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAO.class ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVmNetworkInterface ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmNetworkInterfaceDao ( ) ) . thenReturn ( vmNetworkInterfaceDaoMock ) ; }

Target:
public void testExecuteQueryCommand ( ) { setupVmDao ( java.util.Collections.singletonList ( vm ) ) ; setupVmNetworkInterfaceDao ( java.util.Collections.singletonList ( vmNetworkInterface ) ) ; expectAndTestForVmAndInterface ( ) ; }
Source:
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.StorageDomain > allStorageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > isoStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : allStorageDomains ) { if ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { isoStorageDomains.add ( storageDomain ) ; } } return isoStorageDomains ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; }

Target:
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.StorageDomain > allStorageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > isoStorageDomains = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : allStorageDomains ) { if ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { isoStorageDomains.add ( storageDomain ) ; } } return isoStorageDomains ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getPermissionDao ( ) ; new_permissions = new org.ovirt.engine.core.common.businessentities.Permissions ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.STORAGE_POOL_ID , org.ovirt.engine.core.common.VdcObjectType.StoragePool ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getPermissionDao ( ) ; new_permissions = new org.ovirt.engine.core.common.businessentities.Permissions ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.STORAGE_POOL_ID , org.ovirt.engine.core.common.VdcObjectType.StoragePool ) ; org.ovirt.engine.core.dao.EngineSessionDAO engineDao = dbFacade.getEngineSessionDao ( ) ; unprivilegedUserSession = engineDao.getBySessionId ( org.ovirt.engine.core.dao.UNPRIVILEGED_USER_ENGINE_SESSION_ID ) ; privilegedUserSession = engineDao.getBySessionId ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ENGINE_SESSION_ID ) ; }
Source:
public org.ovirt.engine.api.model.StorageDomains list ( ) { org.ovirt.engine.api.model.StorageDomains storageDomains = new org.ovirt.engine.api.model.StorageDomains ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains entity : getBackendCollection ( org.ovirt.engine.core.common.businessentities.storage_domains.class , VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) ) ) { storageDomains.getStorageDomains ( ) . add ( addLinks ( map ( entity ) ) ) ; } return storageDomains ; }

Target:
public org.ovirt.engine.api.model.StorageDomains list ( ) { org.ovirt.engine.api.model.StorageDomains storageDomains = new org.ovirt.engine.api.model.StorageDomains ( ) ; for ( org.ovirt.engine.api.model.StorageDomain entity : getBackendCollection ( org.ovirt.engine.api.model.StorageDomain.class , VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) ) ) { storageDomains.getStorageDomains ( ) . add ( addLinks ( map ( entity ) ) ) ; } return storageDomains ; }
Source:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; log.error ( "Failed extending disk. ID: {}" , getDiskId ( ) ) ; updateAuditLog ( AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE , getCommand ( ) . getNewDiskSizeInGB ( ) ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.ILLEGAL ) ; log.error ( "Failed extending disk. ID: {}" , getDiskId ( ) ) ; updateAuditLog ( AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE , getCommand ( ) . getNewDiskSizeInGB ( ) ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }
Source:
public void customPropertiesNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }

Target:
public void customPropertiesNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }