auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void newEntity ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getStatus ( ) , getEntity ( ) . getStoragePoolId ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void newEntity ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getStatus ( ) , getEntity ( ) . getStoragePoolId ( ) , getEntity ( ) . getClusterCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
public void testRemove ( ) { assertNotNull ( dao.get ( FixturesTool.VM_NETWORK_INTERFACE ) ) ; dao.remove ( FixturesTool.VM_NETWORK_INTERFACE ) ; assertNull ( dao.get ( FixturesTool.VM_NETWORK_INTERFACE ) ) ; dao.save ( existingVmInterface ) ; assertNotNull ( dao.get ( FixturesTool.VM_NETWORK_INTERFACE ) ) ; }

Target:
public void testRemove ( ) { org.junit.Assert.assertNotNull ( dao.get ( FixturesTool.VM_NETWORK_INTERFACE ) ) ; dao.remove ( FixturesTool.VM_NETWORK_INTERFACE ) ; org.junit.Assert.assertNull ( dao.get ( FixturesTool.VM_NETWORK_INTERFACE ) ) ; dao.save ( existingVmInterface ) ; org.junit.Assert.assertNotNull ( dao.get ( FixturesTool.VM_NETWORK_INTERFACE ) ) ; }
Source:
public void storageDomainNotOperational ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase parameters = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( storageDomainId , storagePoolId ) ; parameters.setIsInternal ( true ) ; parameters.setInactive ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.DeactivateStorageDomain , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult storageDomainNotOperational ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase parameters = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( storageDomainId , storagePoolId ) ; parameters.setIsInternal ( true ) ; parameters.setInactive ( true ) ; boolean isSucceeded = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.DeactivateStorageDomain , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) . getSucceeded ( ) ; return new org.ovirt.engine.core.common.eventqueue.EventResult ( isSucceeded , org.ovirt.engine.core.common.eventqueue.EventType.DOMAINNOTOPERATIONAL ) ; }
Source:
public void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , 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 void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVdsGroup , org.ovirt.engine.core.common.action.VdsGroupOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpManagementNetworkExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVdsGroup , org.ovirt.engine.core.common.action.VdsGroupOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; final org.ovirt.engine.api.model.Cluster updatedCluster = resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; verifyModel ( updatedCluster , 0 ) ; verifyManagementNetwork ( updatedCluster ) ; }
Source:
public static void getDocumentationBaseURL ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . isBoot ( ) ) && ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) ) != null ) ) && ( ! ( Guid.Empty.equals ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) . toString ( ) , LockMessagesMatchUtil.VM_DISK_BOOT ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getSharedLocks ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) ) != null ) && ( ! ( Guid.Empty.equals ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }
Source:
protected void executeCommand ( ) { deleteSnapshot ( ) ; persistCommand ( org.ovirt.engine.core.bll.RemoveCinderSnapshotDiskCommand.getParameters ( ) . getParentCommand ( ) , true ) ; org.ovirt.engine.core.bll.RemoveCinderSnapshotDiskCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.RemoveCinderSnapshotDiskCommand.getImageId ( ) ) ; org.ovirt.engine.core.bll.RemoveCinderSnapshotDiskCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.RemoveCinderSnapshotDiskCommand.registerRollbackHandler ( new CustomTransactionCompletionListener ( ) ) ; deleteSnapshot ( ) ; persistCommand ( org.ovirt.engine.core.bll.RemoveCinderSnapshotDiskCommand.getParameters ( ) . getParentCommand ( ) , true ) ; org.ovirt.engine.core.bll.RemoveCinderSnapshotDiskCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.RemoveCinderSnapshotDiskCommand.getImageId ( ) ) ; org.ovirt.engine.core.bll.RemoveCinderSnapshotDiskCommand.setSucceeded ( true ) ; }
Source:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }

Target:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }
Source:
public static void addOrUpdateTaskInDB ( org.ovirt.engine.core.bll.SPMAsyncTask asyncTask ) { try { if ( ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.log.error ( java.lang.String.format ( "Adding/Updating task %1$s to DataBase threw an exception." , asyncTask.getTaskID ( ) ) , e ) ; } }

Target:
public static void addOrUpdateTaskInDB ( org.ovirt.engine.core.bll.SPMAsyncTask asyncTask ) { try { if ( ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) , asyncTask.getEntityType ( ) , asyncTask.getAssociatedEntities ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.log.error ( java.lang.String.format ( "Adding/Updating task %1$s to DataBase threw an exception." , asyncTask.getTaskID ( ) ) , e ) ; } }
Source:
public void testAddSupportedHostFeature ( ) { java.lang.String newFeature = "NEW_FEATURE_1" ; dao.addSupportedHostFeature ( org.ovirt.engine.core.dao.SupportedHostFeatureDaoTest.EXISTING_HOST_ID_1 , newFeature ) ; java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( org.ovirt.engine.core.dao.SupportedHostFeatureDaoTest.EXISTING_HOST_ID_1 ) ; org.junit.Assert.assertThat ( "Failed to add the feature" , featuresSupported , org.hamcrest.CoreMatchers.hasItem ( newFeature ) ) ; }

Target:
public void testAddAllSupportedHostFeature ( ) { java.util.Set < java.lang.String > newFatures = new java.util.HashSet < > ( java.util.Arrays.asList ( "NEW__FEATURE_1" , "NEW__FEATURE_2" , "NEW__FEATURE_3" ) ) ; dao.addAllSupportedHostFeature ( FixturesTool.HOST_ID , newFatures ) ; java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( FixturesTool.HOST_ID ) ; org.junit.Assert.assertTrue ( "Failed to add the feature" , featuresSupported.containsAll ( newFatures ) ) ; }
Source:
public static void GetClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testNotRemovingUsedPoolRecordIsUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( macPoolDaoMock.getDcUsageCount ( org.mockito.Matchers.eq ( macPool.getId ( ) ) ) ) . thenReturn ( 1 ) ; final org.ovirt.engine.core.bll.ValidationResult validationResult = new org.ovirt.engine.core.bll.MacPoolValidator ( macPool ) . notRemovingUsedPool ( ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_STILL_USED_MAC_POOL ) ) ; }

Target:
public void testNotRemovingUsedPoolRecordIsUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; final org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setName ( "storagePool" ) ; org.mockito.Mockito.when ( storagePoolDao.getAllDataCentersByMacPoolId ( macPool.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( storagePool ) ) ; org.junit.Assert.assertThat ( macPoolValidator.notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_STILL_USED_MAC_POOL ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( cachedPermsList ) == null ) { cachedPermsList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; org.ovirt.engine.core.compat.Guid diskId = ( image == null ) ? org.ovirt.engine.core.compat.Guid.Empty : image.getId ( ) ; cachedPermsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskId , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.CONFIGURE_DISK_STORAGE ) ) ; cachedPermsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; } return cachedPermsList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( cachedPermsList ) == null ) { cachedPermsList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ; org.ovirt.engine.core.compat.Guid diskId = ( image == null ) ? org.ovirt.engine.core.compat.Guid.Empty : image.getId ( ) ; cachedPermsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskId , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.CONFIGURE_DISK_STORAGE ) ) ; cachedPermsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; } return cachedPermsList ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void testRemove ( ) { dao.remove ( existingVds.getId ( ) ) ; statisticsDao.remove ( existingVds.getId ( ) ) ; staticDao.remove ( existingVds.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatic resultStatic = staticDao.get ( existingVds.getId ( ) ) ; org.junit.Assert.assertNull ( resultStatic ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic resultDynamic = dao.get ( existingVds.getId ( ) ) ; org.junit.Assert.assertNull ( resultDynamic ) ; }

Target:
public void testRemove ( ) { dao.remove ( existingVds.getId ( ) ) ; statisticsDao.remove ( existingVds.getId ( ) ) ; staticDao.remove ( existingVds.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatic resultStatic = staticDao.get ( existingVds.getId ( ) ) ; org.junit.Assert.assertNull ( resultStatic ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic resultDynamic = dao.get ( existingVds.getId ( ) ) ; org.junit.Assert.assertNull ( resultDynamic ) ; org.junit.Assert.assertNull ( dnsResolverConfigurationDao.get ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION ) ) ; }
Source:
public void getMaxVmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return 100 ; } return source ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getMaxVmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return 100 ; } return source ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testAddExistingBlockDomainSuccessfully ( ) { org.mockito.Mockito.when ( command.getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void testAddExistingBlockDomainSuccessfully ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDAO ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( command.getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }
Source:
public java.net.Socket createSocket ( java.net.InetAddress host , int port ) throws java.io.IOException { if ( ( ( host.toString ( ) . charAt ( 0 ) ) == '/' ) || ( org.ovirt.engineextensions.aaa.ldap.Resolver.isAddress ( host.getHostName ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( ) ; } return createSocket ( host.getHostName ( ) , port ) ; }

Target:
private boolean checkAddress ( java.net.InetAddress address ) { boolean ret = false ; ret = ( ( address.toString ( ) . charAt ( 0 ) ) == '/' ) || ( org.ovirt.engineextensions.aaa.ldap.Resolver.isAddress ( address.getHostName ( ) ) ) ; if ( ret && ( ! ( enableAddressOnly ) ) ) { throw new java.lang.IllegalArgumentException ( ) ; } return ret ; }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks = mapCollection ( getNetworks ( ) ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( dataCenterId , entity ) ; if ( network.isSetProfileRequired ( ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return performCreate ( VdcActionType.AddNetwork , parameters , new org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworksResource.AddedNetworkResolver ( ) ) ; }
Source:
public void testGetQosWhenNetworkAttachmentDoesNotHaveOverriddenQos ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = createHostNetworkQos ( ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithQos ( hostNetworkQos ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachmentWithoutOverriddenQos ( ) ; org.mockito.Mockito.when ( hostNetworkQosDao.get ( network.getQosId ( ) ) ) . thenReturn ( hostNetworkQos ) ; org.junit.Assert.assertThat ( effectiveHostNetworkQos.getQos ( networkAttachment , network ) , org.hamcrest.CoreMatchers.is ( hostNetworkQos ) ) ; org.mockito.Mockito.verify ( hostNetworkQosDao ) . get ( org.mockito.Mockito.eq ( network.getQosId ( ) ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( hostNetworkQosDao ) ; }

Target:
public void testGetQosWhenNetworkAttachmentDoesNotHaveOverriddenQos ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = createHostNetworkQos ( ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithQos ( hostNetworkQos ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachmentWithoutOverriddenQos ( ) ; org.mockito.Mockito.when ( hostNetworkQosDao.get ( network.getQosId ( ) ) ) . thenReturn ( hostNetworkQos ) ; org.junit.Assert.assertThat ( effectiveHostNetworkQos.getQos ( networkAttachment , network ) , org.hamcrest.CoreMatchers.is ( hostNetworkQos ) ) ; org.mockito.Mockito.verify ( hostNetworkQosDao ) . get ( org.mockito.Matchers.eq ( network.getQosId ( ) ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( hostNetworkQosDao ) ; }
Source:
public void testNegativeConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 1 , ( - 20 ) , ( - 10 ) , 10 ) ; org.junit.Assert.assertEquals ( 0 , span.Days ) ; org.junit.Assert.assertEquals ( 3 , span.Hours ) ; org.junit.Assert.assertEquals ( 50 , span.Minutes ) ; org.junit.Assert.assertEquals ( 10 , span.Seconds ) ; org.junit.Assert.assertEquals ( 0 , span.Milliseconds ) ; }

Target:
public void testNegativeConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 1 , ( - 20 ) , ( - 10 ) , 10 ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , span.Days ) ; org.junit.jupiter.api.Assertions.assertEquals ( 3 , span.Hours ) ; org.junit.jupiter.api.Assertions.assertEquals ( 50 , span.Minutes ) ; org.junit.jupiter.api.Assertions.assertEquals ( 10 , span.Seconds ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , span.Milliseconds ) ; }
Source:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworksModel ( ) { java.util.List < org.ovirt.engine.api.model.Network > networks = new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { org.ovirt.engine.api.model.Network net = new org.ovirt.engine.api.model.Network ( ) ; net.setId ( GUIDS [ i ] ) ; net.setname ( NAMES [ i ] ) ; networks.add ( net ) ; } return networks ; }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworksModel ( ) { java.util.List < org.ovirt.engine.api.model.Network > networks = new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ; for ( int i = 0 ; i < 3 ; i ++ ) { org.ovirt.engine.api.model.Network net = new org.ovirt.engine.api.model.Network ( ) ; net.setId ( GUIDS [ i ] ) ; net.setName ( NAMES [ i ] ) ; networks.add ( net ) ; } return networks ; }
Source:
private void doTestRemoveNotFound ( java.lang.String id ) { initResource ( resource.parent ) ; resource.id = id ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } resource.id = "1" ; }

Target:
private void doTestRemoveNotFound ( java.lang.String id ) { initResource ( resource.parent ) ; resource.id = id ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } resource.id = "1" ; }
Source:
private void vdsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void vdsExistWithHigherVersion ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setClusterCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vdsList ) ; }
Source:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void onUpgradeHost ( final org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getConfirmWindow ( ) ) ) ; if ( ( model.getProgress ( ) ) != null ) { return ; } model.startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.setConfirmWindow ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters params = new org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters ( host.getId ( ) ) ; invokeHostUpgrade ( params ) ; }

Target:
public void upgrade ( ) { final org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItem ( ) ; org.ovirt.engine.ui.uicommonweb.models.Model model = org.ovirt.engine.ui.uicommonweb.models.hosts.HostGeneralModel.createUpgradeModel ( host ) ; setWindow ( model ) ; model.initialize ( ) ; model.getCommands ( ) . add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ) ; }
Source:
protected org.ovirt.engine.api.model.GlusterBricks resolveCreatedList ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.gluster.EntityIdResolver < org.ovirt.engine.core.compat.Guid > entityResolver ) { try { org.ovirt.engine.api.model.GlusterBricks bricks = new org.ovirt.engine.api.model.GlusterBricks ( ) ; for ( org.ovirt.engine.core.compat.Guid id : ( ( java.util.List < org.ovirt.engine.core.compat.Guid > ) ( result.getActionReturnValue ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity created = entityResolver.resolve ( id ) ; bricks.getGlusterBricks ( ) . add ( addLinks ( populate ( map ( created ) , created ) ) ) ; } return bricks ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; return null ; } }

Target:
protected org.ovirt.engine.api.model.GlusterBricks resolveCreatedList ( org.ovirt.engine.core.common.action.ActionReturnValue result , org.ovirt.engine.api.restapi.resource.gluster.EntityIdResolver < org.ovirt.engine.core.compat.Guid > entityResolver ) { try { org.ovirt.engine.api.model.GlusterBricks bricks = new org.ovirt.engine.api.model.GlusterBricks ( ) ; for ( org.ovirt.engine.core.compat.Guid id : ( ( java.util.List < org.ovirt.engine.core.compat.Guid > ) ( result.getActionReturnValue ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity created = entityResolver.resolve ( id ) ; bricks.getGlusterBricks ( ) . add ( addLinks ( populate ( map ( created ) , created ) ) ) ; } return bricks ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; return null ; } }
Source:
private boolean canRemoveDiskBasedOnStorageTypeCheck ( ) { if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { return canRemoveDiskBasedOnImageStorageCheck ( ) ; } return true ; }

Target:
private boolean canRemoveDiskBasedOnStorageTypeCheck ( ) { if ( ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) || ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) ) { return canRemoveDiskBasedOnImageStorageCheck ( ) ; } return true ; }
Source:
public void testNetworksOnNicMatchMtu ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = java.util.Arrays.asList ( createNetwork ( 1 , false ) , createNetwork ( 1 , false ) ) ; java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , networks ) ; org.junit.Assert.assertThat ( createHostSetupNetworksValidator ( ) . validateMtu ( networksOnNics ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; host.setVdsGroupCompatibilityVersion ( Version.v3_5 ) ; managementNetworkUtil = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class ) ; bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }
Source:
public void testActiveDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setstatus ( StorageDomainStatus.Active ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( ( ! ( listReturned.isEmpty ( ) ) ) ) ; }

Target:
public void testActiveDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( StorageDomainStatus.Active ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( ( ! ( listReturned.isEmpty ( ) ) ) ) ; }
Source:
protected void initLoginModel ( ) { super . initLoginModel ( ) ; final org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = getLoginModel ( ) ; loginModel.getIsENGINEUser ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.Boolean isEngineUser = ( ( java.lang.Boolean ) ( loginModel.getIsENGINEUser ( ) . getEntity ( ) ) ) ; if ( isEngineUser != null ) { userRole.setEngineUser ( isEngineUser ) ; performLogin ( loginModel ) ; } } } ) ; }

Target:
protected void initLoginModel ( ) { super . initLoginModel ( ) ; final org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = getLoginModel ( ) ; loginModel.getIsENGINEUser ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean isEngineUser = ( ( java.lang.Boolean ) ( loginModel.getIsENGINEUser ( ) . getEntity ( ) ) ) ; if ( isEngineUser != null ) { userRole.setEngineUser ( isEngineUser ) ; performLogin ( loginModel ) ; } } } ) ; }
Source:
protected void moveOrCopyAllImageGroups ( ) { moveOrCopyAllImageGroups ( getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( getVm ( ) . getDiskMap ( ) . values ( ) , false , false , true ) ) ; copyAllMemoryImages ( getVm ( ) . getId ( ) ) ; }

Target:
protected void moveOrCopyAllImageGroups ( ) { moveOrCopyAllImageGroups ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) , false , false , true ) ) ; copyAllMemoryImages ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getId ( ) ) ; }
Source:
protected void executeCommand ( ) { 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 ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper helper = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper ( getParameters ( ) . getNetworkCluster ( ) ) ; helper.removeNetworkAndReassignRoles ( ) ; return null ; } } ) ; if ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval ( getPersistedNetwork ( ) , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) { removeNetworkFromHosts ( ) ; } org.ovirt.engine.core.bll.network.cluster.DetachNetworkToVdsGroupCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { 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 ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper helper = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper ( getParameters ( ) . getNetworkCluster ( ) ) ; helper.removeNetworkAndReassignRoles ( ) ; return null ; } } ) ; if ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval ( getPersistedNetwork ( ) , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToVdsGroupCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) { removeNetworkFromHosts ( ) ; } org.ovirt.engine.core.bll.network.cluster.DetachNetworkToVdsGroupCommand.setSucceeded ( true ) ; }
Source:
public void testAddIncompleteParameters2 ( ) { org.ovirt.engine.api.model.Disk model = org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.getModel ( ) ; model.setProvisionedSize ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters2" , "provisionedSize|size" ) ; } }

Target:
public void testAddLunDiskMissingType ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . setType ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "HostStorage" , "lambda$testAddLunDiskMissingType$3" , "type" ) ; }
Source:
private boolean Register ( org.ovirt.engine.core.common.businessentities.VDS vdsByUniqueId , org.ovirt.engine.core.compat.Guid vdsGroupId , boolean IsPending ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.LogVdsRegistration ) ) { log.infoFormat ( "RegisterVdsQuery::Register - Entering" ) ; } boolean returnValue = true ; if ( vdsByUniqueId == null ) { returnValue = registerNewHost ( vdsGroupId , IsPending ) ; } else { returnValue = updateExistingHost ( vdsByUniqueId , IsPending ) ; } if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.LogVdsRegistration ) ) { log.infoFormat ( "RegisterVdsQuery::Register - Leaving with value {0}" , returnValue ) ; } return returnValue ; }

Target:
private boolean Register ( org.ovirt.engine.core.common.businessentities.VDS vdsByUniqueId , org.ovirt.engine.core.compat.Guid vdsGroupId , boolean IsPending ) { boolean returnValue = true ; log.debugFormat ( "RegisterVdsQuery::Register - Entering" ) ; if ( vdsByUniqueId == null ) { returnValue = registerNewHost ( vdsGroupId , IsPending ) ; } else { returnValue = updateExistingHost ( vdsByUniqueId , IsPending ) ; } log.debugFormat ( "RegisterVdsQuery::Register - Leaving with value {0}" , returnValue ) ; return returnValue ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters params = new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( ) ; params.setFilterOutExistingHosts ( filterOutExistingHosts ) ; params.setProviderId ( providerId ) ; params.setSearchFilter ( searchFilter ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , params , aQuery ) ; }

Target:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void bothDiskImagesDontExist ( ) { org.mockito.Mockito.doReturn ( false ) . when ( baseDiskDao ) . exists ( disk1 ) ; org.mockito.Mockito.doReturn ( false ) . when ( baseDiskDao ) . exists ( disk2 ) ; org.junit.Assert.assertThat ( diskExistenceValidator.diskImagesNotExist ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST , ( ( ( "$diskIds " + ( disk1.toString ( ) ) ) + ", " ) + ( disk2.toString ( ) ) ) ) ) ; }

Target:
public void bothDiskImagesDontExist ( ) { org.mockito.Mockito.doReturn ( false ) . when ( baseDiskDao ) . exists ( disk1 ) ; org.mockito.Mockito.doReturn ( false ) . when ( baseDiskDao ) . exists ( disk2 ) ; org.junit.Assert.assertThat ( diskExistenceValidator.disksNotExist ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST , ( ( ( "$diskIds " + ( disk1.toString ( ) ) ) + ", " ) + ( disk2.toString ( ) ) ) ) ) ; }