auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void log ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.updateTimeoutLogableObject ( auditLogable , logType ) ; if ( auditLogable.getLegal ( ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.saveToDb ( auditLogable , logType , loggerString ) ; } }

Target:
public void log ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { if ( ! ( logType.shouldBeLogged ( ) ) ) { return ; } updateTimeoutLogableObject ( auditLogable , logType ) ; if ( auditLogable.getLegal ( ) ) { saveToDb ( auditLogable , logType , loggerString ) ; } }
Source:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; cmd.poolPerDc = macPoolPerDc ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( super . canDoAction ( ) ) && ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.checkStoragePool ( ) ) ) && ( CheckStoragePoolStatus ( StoragePoolStatus.Uninitialized ) ) ) && ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.InitializeVds ( ) ) ) && ( checkStorageDomainsInPool ( ) ) ; return returnValue ; }

Target:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( super . canDoAction ( ) ) && ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.checkStoragePool ( ) ) ) && ( CheckStoragePoolStatus ( StoragePoolStatus.Uninitialized ) ) ) && ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.initializeVds ( ) ) ) && ( checkStorageDomainsInPool ( ) ) ; return returnValue ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.GetVmByVmIdQuery.getDbFacade ( ) . getVmDAO ( ) . get ( org.ovirt.engine.core.bll.GetVmByVmIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetVmByVmIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmByVmIdQuery.getParameters ( ) . isFiltered ( ) ) ; if ( vm != null ) { updateVMDetails ( vm ) ; org.ovirt.engine.core.bll.GetVmByVmIdQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.GetVmByVmIdQuery.getDbFacade ( ) . getVmDao ( ) . get ( org.ovirt.engine.core.bll.GetVmByVmIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetVmByVmIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmByVmIdQuery.getParameters ( ) . isFiltered ( ) ) ; if ( vm != null ) { updateVMDetails ( vm ) ; org.ovirt.engine.core.bll.GetVmByVmIdQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; } }
Source:
private void lockImageInDb ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( diskImage.getImage ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; diskImage.setImageStatus ( ImageStatus.LOCKED ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImageId ( ) , ImageStatus.LOCKED ) ; return null ; } } ) ; }

Target:
private void lockImageInDb ( ) { final org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getOldDisk ( ) ) ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( diskImage.getImage ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; diskImage.setImageStatus ( ImageStatus.LOCKED ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImageId ( ) , ImageStatus.LOCKED ) ; return null ; } } ) ; }
Source:
public void listen ( ) throws java.io.IOException { java.nio.channels.ServerSocketChannel serverSocketChannel = java.nio.channels.ServerSocketChannel.open ( ) ; serverSocketChannel.configureBlocking ( false ) ; serverSocketChannel.register ( this . selector , java.nio.channels.SelectionKey.OP_ACCEPT , new java.util.concurrent.ConcurrentLinkedDeque < > ( ) ) ; serverSocketChannel.bind ( new java.net.InetSocketAddress ( this . host , this . port ) ) ; setDaemon ( true ) ; start ( ) ; }

Target:
public void listen ( ) throws java.io.IOException { java.nio.channels.ServerSocketChannel serverSocketChannel = java.nio.channels.ServerSocketChannel.open ( ) ; serverSocketChannel.configureBlocking ( false ) ; serverSocketChannel.register ( this . selector , java.nio.channels.SelectionKey.OP_ACCEPT , new java.util.concurrent.ConcurrentLinkedDeque < > ( ) ) ; serverSocketChannel.bind ( new java.net.InetSocketAddress ( this . host , 0 ) ) ; this . port = serverSocketChannel.socket ( ) . getLocalPort ( ) ; setDaemon ( true ) ; start ( ) ; }
Source:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldDetectHostWihtoutNumaSupport ( ) { vdsNumaNodes = new java.util.ArrayList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ; assertValidationFailure ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.validateNumaCompatibility ( vm , vm.getvNumaNodeList ( ) , vdsNumaNodes ) , EngineMessage.HOST_NUMA_NOT_SUPPORTED ) ; }
Source:
public void validateInitrdAndKernelImageWithOneCharacter ( ) throws java.lang.Exception { java.lang.String initrd = "i" ; java.lang.String kernelImage = "k" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , kernelImage ) ; org.junit.Assert.assertEquals ( vm.getinitrd_url ( ) , "i" ) ; org.junit.Assert.assertEquals ( vm.getkernel_url ( ) , "k" ) ; }

Target:
public void validateInitrdAndKernelImageWithOneCharacter ( ) throws java.lang.Exception { java.lang.String initrd = "i" ; java.lang.String kernelImage = "k" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , kernelImage ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , "i" ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , "k" ) ; }
Source:
public org.ovirt.engine.core.dao.VmDAO getVmDAO ( ) { final org.ovirt.engine.core.dao.VmDAO v = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDAO.class ) ; org.mockito.Mockito.when ( v.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VM ( ) ) ; org.mockito.Mockito.when ( v.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; return v ; }

Target:
public org.ovirt.engine.core.dao.VmDao getVmDao ( ) { final org.ovirt.engine.core.dao.VmDao v = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDao.class ) ; org.mockito.Mockito.when ( v.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VM ( ) ) ; org.mockito.Mockito.when ( v.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; return v ; }
Source:
public void testAddGroup ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ( ( "ADGROUP@" + ( DOMAIN ) ) + ": name=*" ) , SearchType.AdGroup , getAdGroup ( 0 ) ) ; setUpCreationExpectations ( VdcActionType.AddUser , org.ovirt.engine.core.common.action.AddUserParameters.class , new java.lang.String [ ] { "AdGroup.id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true , null , VdcQueryType.GetAdGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.Group model = new org.ovirt.engine.api.model.Group ( ) ; model.setName ( NAMES [ 0 ] ) ; javax.ws.rs.core.Response response = collection.add ( model ) ; assertEquals ( 201 , response.getStatus ( ) ) ; assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.Group ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.Group ) ( response.getEntity ( ) ) ) , 0 ) ; }

Target:
public void testAddGroupWithoutDirectoryName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Group model = new org.ovirt.engine.api.model.Group ( ) ; model.setName ( NAMES [ 0 ] ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testIsBlockDomain ( ) { org.junit.Assert.assertTrue ( StorageType.FCP.isBlockDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.ISCSI.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.NFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.LOCALFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.POSIXFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.GLUSTERFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.GLANCE.isBlockDomain ( ) ) ; }

Target:
public void testIsBlockDomain ( ) { org.junit.Assert.assertTrue ( StorageType.FCP.isBlockDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.ISCSI.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.NFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.LOCALFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.POSIXFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.GLUSTERFS.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.GLANCE.isBlockDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.CINDER.isBlockDomain ( ) ) ; }
Source:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Storage ) ) ) { org.ovirt.engine.core.common.businessentities.storage_domains storage = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_domains > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePredicate ( storage.getId ( ) ) ) ) ; } }

Target:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Storage ) ) ) { org.ovirt.engine.core.common.businessentities.storage_domains storage = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_domains > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePredicate ( storage.getId ( ) ) ) ) ; } }
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.datacenters.qos.DataCenterCpuQosListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( ( lastExecutedCommand.equals ( getModel ( ) . getNewCommand ( ) ) ) || ( lastExecutedCommand.equals ( getModel ( ) . getEditCommand ( ) ) ) ) { return cpuQosPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.common.uicommon.model.MainModelProvider < org.ovirt.engine.core.common.businessentities.AuditLog , org.ovirt.engine.ui.uicommonweb.models.events.EventListModel < java.lang.Void > > modelProvider , org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.eventMainTabPlace ) ; return new org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ( menuTabDetails.getPrimaryTitle ( ) , 0 , null , menuTabDetails.getPrimaryPriority ( ) , modelProvider , menuTabDetails.getIcon ( ) ) ; }

Target:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.eventMainTabPlace ) ; return new org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ( menuTabDetails.getSecondaryTitle ( ) , menuTabDetails.getPrimaryTitle ( ) , menuTabDetails.getSecondaryPriority ( ) , menuTabDetails.getPrimaryPriority ( ) , menuTabDetails.getIcon ( ) ) ; }
Source:
protected boolean validate ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.VmLogonCommand.getVm ( ) ; if ( vm == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; return false ; } if ( ! ( org.ovirt.engine.core.bll.VmLogonCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.VmLogonCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.VmLogonCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } return true ; }
Source:
public void networksUsedByATemplate ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; networksUsedTest ( net , false , true , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.junit.matchers.JUnitMatchers.containsString ( net.getName ( ) ) ) ) ) ) ; }

Target:
public void networksUsedByAVmMultipleNetworks ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = mockNetwork ( ) ; networksUsedTest ( false , true , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED_MULTIPLE_TIMES ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net.getName ( ) ) ) ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net2.getName ( ) ) ) ) ) ) ; }
Source:
private void updateSizeInDb ( ) { org.ovirt.engine.core.compat.Guid diskImage = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getBaseImage ( ) . getImageId ( ) ; long sizeInBytes = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getTopImage ( ) . getSize ( ) ; org.ovirt.engine.core.bll.MergeExtendCommand.getDbFacade ( ) . getImageDao ( ) . updateImageSize ( diskImage , sizeInBytes ) ; org.ovirt.engine.core.bll.MergeExtendCommand.log.info ( "Updated size of image to {}" , diskImage , sizeInBytes ) ; }

Target:
private void updateSizeInDb ( ) { org.ovirt.engine.core.compat.Guid diskImage = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getBaseImage ( ) . getImageId ( ) ; long sizeInBytes = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getTopImage ( ) . getSize ( ) ; log.info ( "Updating size of image to {}" , diskImage , sizeInBytes ) ; org.ovirt.engine.core.bll.MergeExtendCommand.getDbFacade ( ) . getImageDao ( ) . updateImageSize ( diskImage , sizeInBytes ) ; }
Source:
private static void InsertPassHistoryRecord ( java.lang.Integer id , org.ovirt.engine.api.extensions.ExtMap input , java.sql.Connection conn ) throws java.sql.SQLException { new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Template ( Sql.ModificationTypes.INSERT , "user_password_history" ) . setInteger ( "user_id" , id ) . setString ( "password" , input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserKeys.OLD_PASSWORD , java.lang.String.class ) ) . setTimestamp ( "changed" , new java.util.Date ( ) . getTime ( ) ) . asSql ( ) ) . execute ( conn , false ) ; }

Target:
private static void InsertPassHistoryRecord ( java.lang.Integer id , org.ovirt.engine.api.extensions.ExtMap input , java.sql.Connection conn ) throws java.sql.SQLException { new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Template ( Sql.ModificationTypes.INSERT , "user_password_history" ) . setInteger ( "user_id" , id ) . setString ( "password" , input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserKeys.OLD_PASSWORD , java.lang.String.class ) ) . setTimestamp ( "changed" , java.lang.System.currentTimeMillis ( ) ) . asSql ( ) ) . execute ( conn , false ) ; }
Source:
public void run ( ) { try { waitForTasksToBeCleared ( ) ; executeDeactivateCommnad ( false ) ; } catch ( java.lang.Exception e ) { setSucceeded ( false ) ; log.error ( "Error when attempting to deactivate storage domain {}" , getStorageDomainId ( ) , e ) ; compensate ( ) ; } }

Target:
public void run ( ) { try { waitForTasksToBeCleared ( ) ; executeDeactivateCommnad ( false ) ; ctx.resetCompensation ( ) ; } catch ( java.lang.Exception e ) { setSucceeded ( false ) ; log.errorFormat ( "Error when attempting to deactivate storage domain {0}" , getStorageDomainId ( ) , e ) ; compensate ( ) ; } }
Source:
public void getMaxVmsInPool ( 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 ( ) : 1000 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVmsInPool , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getConfigurationValueBoolean ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.queries.ConfigurationValues configVal ) { 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( configVal , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public boolean checkVmHostDeviceAvailability ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.compat.Guid vdsId ) { return ( ! ( org.ovirt.engine.core.bll.hostdev.HostDeviceManager.supportsHostDevicePassthrough ( vm ) ) ) || ( hostDeviceDao.checkVmHostDeviceAvailability ( vm.getId ( ) , vdsId ) ) ; }

Target:
public boolean checkVmHostDeviceAvailability ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.compat.Guid vdsId ) { if ( ! ( hostDeviceDao.checkVmHostDeviceAvailability ( vm.getId ( ) , vdsId ) ) ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > devices = backend.runInternalQuery ( VdcQueryType.GetExtendedVmHostDevicesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vm.getId ( ) ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.HostDevice device : devices ) { if ( ! ( networkDeviceHelper.isDeviceNetworkFree ( device ) ) ) { return false ; } } return true ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( getId ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getGlusterServerUuid ( ) ) == null ? 0 : getGlusterServerUuid ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getKnownAddresses ( ) ) == null ? 0 : getKnownAddresses ( ) . hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ( obj ) ) ; return ( ( java.util.Objects.equals ( serverId , entity.serverId ) ) && ( java.util.Objects.equals ( glusterServerUuid , entity.glusterServerUuid ) ) ) && ( java.util.Objects.equals ( knownAddresses , entity.knownAddresses ) ) ; }
Source:
protected static org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.NGuid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private static org.ovirt.engine.core.bll.validator.RunVmValidator getRunVmValidator ( ) { return org.ovirt.engine.core.bll.VmPoolCommandBase.runVmValidator ; }
Source:
public void customValue ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , v ) ; }

Target:
public void addCustomValueDoesNotHandleNullKeys ( ) { final java.lang.String key = null ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , v ) ; }
Source:
private static boolean isHandleSequentialQueries ( final org.ovirt.engine.ui.frontend.Frontend.QueryWrapper queryWrapper ) { return ( ( queryWrapper.getQueryType ( ) ) == ( org.ovirt.engine.core.common.queries.VdcQueryType.Search ) ) && ( ( queryWrapper.getParameters ( ) ) instanceof org.ovirt.engine.core.common.queries.SearchParameters ) ; }

Target:
public void onSuccess ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Frontend: sucessfully executed runAction, determining result!" ) ; handleActionResult ( actionType , parameters , result , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog ) ; }
Source:
public void testGetAllForVolumeGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > result = dao.getAllForVolumeGroup ( existingEntity.getVolumeGroupId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : result ) { org.junit.Assert.assertEquals ( existingEntity.getVolumeGroupId ( ) , lun.getVolumeGroupId ( ) ) ; } }

Target:
public void testGetAllForVolumeGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > result = dao.getAllForVolumeGroup ( existingEntity.getVolumeGroupId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : result ) { org.junit.jupiter.api.Assertions.assertEquals ( existingEntity.getVolumeGroupId ( ) , lun.getVolumeGroupId ( ) ) ; } }
Source:
public static int parseIntegerToInt ( java.lang.String value ) { java.math.BigInteger result = javax.xml.bind.DatatypeConverter.parseInteger ( value ) ; if ( ( result.longValue ( ) ) > ( java.lang.Integer.MAX_VALUE ) ) { throw new org.ovirt.engine.api.utils.InvalidValueException ( ( ( ( "Value " + value ) + " greater than maximum " ) + ( java.lang.Integer.MAX_VALUE ) ) ) ; } return result.intValue ( ) ; }

Target:
public static int parseUnsignedShort ( java.lang.String value ) { java.math.BigInteger result = javax.xml.bind.DatatypeConverter.parseInteger ( value ) ; if ( ( result.compareTo ( org.ovirt.engine.api.utils.IntegerParser.MAX_UNSIGNED_SHORT ) ) > 0 ) { throw new org.ovirt.engine.api.utils.InvalidValueException ( ( ( ( "Value " + value ) + " is greater than maximum unsigned short " ) + ( org.ovirt.engine.api.utils.IntegerParser.MAX_UNSIGNED_SHORT ) ) ) ; } return result.intValue ( ) ; }
Source:
private void setupVdsDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > expectedVds = java.util.Collections.singletonList ( vds ) ; org.ovirt.engine.core.dao.VdsDAO vdsDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVds ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVdsDao ( ) ) . thenReturn ( vdsDaoMock ) ; }

Target:
private void setupVdsDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > expectedVds = java.util.Collections.singletonList ( vds ) ; org.mockito.Mockito.when ( vdsDAOMocked.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVds ) ; }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; if ( hasSelection ( ) ) { clearSelection ( ) ; } else { updateLayout ( ) ; } org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getView ( ) . getTable ( ) . resetScrollPosition ( ) ; org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getView ( ) . getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; if ( hasSelection ( ) ) { clearSelection ( ) ; } else { org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.setSubTabPanelVisible ( false ) ; } org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getView ( ) . getTable ( ) . resetScrollPosition ( ) ; org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getView ( ) . getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; }
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 getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { org.ovirt.engine.core.common.businessentities.network.VmNic nic = org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) ; org.ovirt.engine.core.common.errors.EngineMessage failMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_MAC_ADDRESS_IN_USE ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( failMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( failMessage , nic.getMacAddress ( ) ) ) . when ( new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) . tooManyPluggedInterfaceWithSameMac ( nic , org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getMacPool ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { org.ovirt.engine.core.common.businessentities.network.VmNic nic = org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) ; java.util.Optional < org.ovirt.engine.core.common.businessentities.VM > optionalVm = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) . getVmWithSameMacIfDuplicateIsNotAllowed ( nic , org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getMacPool ( ) ) ; if ( optionalVm.isPresent ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_MAC_ADDRESS_IN_USE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( MacAddressValidator.VAR_MAC_ADDRESS , nic.getMacAddress ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( MacAddressValidator.VAR_VM_NAME , optionalVm.get ( ) . getName ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void processOnVmStop ( final java.util.Collection < org.ovirt.engine.core.compat.Guid > vmIds ) { if ( vmIds.isEmpty ( ) ) { return ; } org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( vmId ) ) ; } } } ) ; }

Target:
public void processOnVmStop ( final java.util.Collection < org.ovirt.engine.core.compat.Guid > vmIds , final org.ovirt.engine.core.compat.Guid hostId ) { if ( vmIds.isEmpty ( ) ) { return ; } org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( vmId , true ) ) ; } org.ovirt.engine.core.bll.hostdev.HostDeviceManager hostDeviceManager = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.hostdev.HostDeviceManager.class ) ; hostDeviceManager.refreshHostIfAnyVmHasHostDevices ( vmIds , hostId ) ; } } ) ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { java.util.Map < java.lang.String , java.lang.Object > map = new java.util.HashMap < > ( ) ; map.put ( "code" , EngineError.Done.getValue ( ) ) ; map.put ( "message" , "done" ) ; status = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( java.util.Collections.< java.lang.String , java.lang.Object > singletonMap ( "status" , map ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.AllocateVolumeVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { java.util.Map < java.lang.String , java.lang.Object > map = new java.util.HashMap < > ( ) ; map.put ( "code" , EngineError.Done.getValue ( ) ) ; map.put ( "message" , "done" ) ; status = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( java.util.Collections.< java.lang.String , java.lang.Object > singletonMap ( "status" , map ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.AllocateVolumeVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
private boolean containsDefaultCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDAO ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommand.getStoragePool ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.getId ( ) . equals ( VDSGroup.DEFAULT_VDS_GROUP_ID ) ) { return true ; } } return false ; }

Target:
protected org.ovirt.engine.core.common.interfaces.VDSBrokerFrontend getResourceManager ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
private void testUpdateManagementNetworkChange ( boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { org.mockito.Mockito.when ( networkCluster.getClusterId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ) . thenReturn ( ( emptyCluster ? java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > emptyList ( ) : java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > singletonList ( null ) ) ) ; org.junit.Assert.assertThat ( validator.managementNetworkChange ( ) , expectedResult ) ; }

Target:
private void testUpdateManagementNetworkChange ( boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { org.mockito.Mockito.when ( networkCluster.getClusterId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ) . thenReturn ( ( emptyCluster ? java.util.Collections.emptyList ( ) : java.util.Collections.singletonList ( null ) ) ) ; org.junit.Assert.assertThat ( validator.managementNetworkChange ( ) , expectedResult ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain mockStorageDomain ( org.ovirt.engine.core.compat.Guid storageId , org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.compat.Version version ) { return mockStorageDomain ( storageId , 6 , 4 , storageType , version ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResourceTest.TEMPLATE_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResourceTest.TEMPLATE_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.core.common.queries.VdsIdParametersBase parameters = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.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.GetAllVmsWithNumaByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkQosValidator validator = new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( getNetworkQoS ( ) ) ; return ( ( ( validateParameters ( ) ) && ( validate ( validator.nameNotTakenInDc ( ) ) ) ) && ( validate ( validator.allValuesPresent ( ) ) ) ) && ( validate ( validator.peakConsistentWithAverage ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.dao.network.NetworkQoSDao getQosDao ( ) { return getDbFacade ( ) . getNetworkQosDao ( ) ; }
Source:
public void shouldDetectInvalidHostOsIdentifier ( ) { newHost1.setHostOs ( "which OS am I?" ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isUpgradePossible ( java.util.Arrays.asList ( newHost1 , newHost2 ) , java.util.Arrays.asList ( validVM ) ) , org.hamcrest.Matchers.not ( org.hamcrest.CoreMatchers.equalTo ( ValidationResult.VALID ) ) ) ; }

Target:
public void shouldDetectUpgradePossible ( ) { org.assertj.core.api.Assertions.assertThat ( validator.isUpgradePossible ( java.util.Arrays.asList ( newHost1 , newHost2 ) , java.util.Arrays.asList ( validVM ) ) ) . isEqualTo ( ValidationResult.VALID ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.NewVmModelBehavior ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ; behavior.postInitTemplate ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterTemplatesByArchitecture ( templates , dataCenterWithCluster.getCluster ( ) . getArchitecture ( ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object nothing , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValue ) ) ; this . postInitTemplate ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterTemplatesByArchitecture ( templates , dataCenterWithCluster.getCluster ( ) . getArchitecture ( ) ) ) ; }
Source:
private boolean changesAreClusterCompatible ( ) { if ( ! ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToClusterInternalCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }

Target:
private boolean vdsGroupExists ( ) { if ( ! ( vdsGroupInDb ( ) ) ) { addCanDoActionMessage ( EngineMessage.VDS_CLUSTER_IS_NOT_VALID ) ; return false ; } return true ; }