auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static org.ovirt.engine.core.bll.utils.VideoDeviceSettings.VideoRAMSettings selectVideoRAMSettings ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { org.ovirt.engine.core.compat.Version vmVersion = vmBase.getCustomCompatibilityVersion ( ) ; java.util.function.Supplier < org.ovirt.engine.core.compat.Version > clusterVersionSupplier = ( ) -> org.ovirt.engine.core.bll.utils.ClusterUtils.getCompatibilityVersion ( vmBase ) ; if ( org.ovirt.engine.core.common.utils.CompatibilityVersionUtils.getEffective ( vmVersion , clusterVersionSupplier ) . greaterOrEquals ( Version.v3_6 ) ) { return new org.ovirt.engine.core.bll.utils.VideoDeviceSettings.VgamemVideoRAMSettings ( ) ; } else { return new org.ovirt.engine.core.bll.utils.VideoDeviceSettings.LegacyVideoRAMSettings ( ) ; } }

Target:
private static org.ovirt.engine.core.bll.utils.VideoDeviceSettings.VideoSettings selectVideoSettings ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { org.ovirt.engine.core.compat.Version vmVersion = vmBase.getCustomCompatibilityVersion ( ) ; java.util.function.Supplier < org.ovirt.engine.core.compat.Version > clusterVersionSupplier = ( ) -> org.ovirt.engine.core.bll.utils.ClusterUtils.getCompatibilityVersion ( vmBase ) ; if ( org.ovirt.engine.core.common.utils.CompatibilityVersionUtils.getEffective ( vmVersion , clusterVersionSupplier ) . greaterOrEquals ( Version.v3_6 ) ) { return new org.ovirt.engine.core.bll.utils.VideoDeviceSettings.VgamemVideoSettings ( ) ; } else { return new org.ovirt.engine.core.bll.utils.VideoDeviceSettings.LegacyVideoSettings ( ) ; } }
Source:
public void testUpdate ( ) { final E modifiedEntity = modifyEntity ( getExistingEntity ( ) ) ; getDao ( ) . update ( modifiedEntity ) ; E result = getDao ( ) . get ( getExistingEntity ( ) . getId ( ) ) ; org.ovirt.engine.core.dao.BaseHibernateDaoTestCase.assertNotNull ( result ) ; verifyEntityModification ( result ) ; }

Target:
public void testUpdate ( ) { final E modifiedEntity = modifyEntity ( getExistingEntity ( ) ) ; getDao ( ) . update ( modifiedEntity ) ; entityManagerHolder.getEntityManager ( ) . flush ( ) ; E result = getDao ( ) . get ( getExistingEntity ( ) . getId ( ) ) ; org.ovirt.engine.core.dao.BaseHibernateDaoTestCase.assertNotNull ( result ) ; verifyEntityModification ( result ) ; }
Source:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > verfifyRunAction ( int exepectedNumOfRunActionExecutions , boolean showErrorDialog ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runAction ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , callbackCaptor.capture ( ) , org.mockito.ArgumentMatchers.eq ( showErrorDialog ) ) ; java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks = callbackCaptor.getAllValues ( ) ; return callbacks ; }

Target:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > verfifyRunAction ( int exepectedNumOfRunActionExecutions , boolean showErrorDialog ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runAction ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.ActionParametersBase.class ) , callbackCaptor.capture ( ) , org.mockito.ArgumentMatchers.eq ( showErrorDialog ) ) ; java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks = callbackCaptor.getAllValues ( ) ; return callbacks ; }
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:
public java.net.Socket createSocket ( java.net.InetAddress host , int port ) throws java.io.IOException { if ( checkAddress ( host ) ) { return socketFactory.createSocket ( host , port ) ; } else { return createSocket ( host.getHostName ( ) , port ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.LdapGroup setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.LdapGroup entity , int index ) { org.easymock.EasyMock.expect ( entity.getid ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getdomain ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.DOMAIN ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getstatus ( ) ) . andReturn ( LdapRefStatus.Active ) . anyTimes ( ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DbGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbGroup entity = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.GROUP_NAMES [ index ] ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; entity.setExternalId ( new org.ovirt.engine.core.common.utils.ExternalId ( GUIDS [ index ] . toByteArray ( ) ) ) ; return entity ; }
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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 ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId ) , aQuery ) ; }

Target:
public static void GetAllProviders ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }
Source:
public static void GetDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void IsUSBEnabledByDefault ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entity = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( ) ; entity.setimage_id ( getGuidDefaultEmpty ( rs , "image_id" ) ) ; entity.setstorage_domain_id ( getGuidDefaultEmpty ( rs , "storage_domain_id" ) ) ; entity.setQuotaId ( getGuid ( rs , "quota_id" ) ) ; entity.setDiskProfileId ( getGuid ( rs , "disk_profile_id" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entity = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( ) ; entity.setImageId ( getGuidDefaultEmpty ( rs , "image_id" ) ) ; entity.setStorageDomainId ( getGuidDefaultEmpty ( rs , "storage_domain_id" ) ) ; entity.setQuotaId ( getGuid ( rs , "quota_id" ) ) ; entity.setDiskProfileId ( getGuid ( rs , "disk_profile_id" ) ) ; return entity ; }
Source:
public void getHostById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.PARAMETER_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; try { resource.update ( getParameter ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.PARAMETER_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; try { resource.update ( getParameter ( ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; vds.setvds_name ( "server1" ) ; vds.setvds_group_id ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.CLUSTER_ID ) ; vds.setstatus ( status ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; vds.setVdsName ( "server1" ) ; vds.setVdsGroupId ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }
Source:
public void postOnNew ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValues != null ) && ( org.ovirt.engine.ui.uicommonweb.Linq.all ( returnValues , new org.ovirt.engine.ui.uicommonweb.Linq.CanDoActionSucceedPredicate ( ) ) ) ) { cancel ( ) ; } }

Target:
public void postOnNew ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValues != null ) && ( org.ovirt.engine.ui.uicommonweb.Linq.all ( returnValues , new org.ovirt.engine.ui.uicommonweb.Linq.ValidateSucceedPredicate ( ) ) ) ) { cancel ( ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { for ( int i = 0 ; i < ( result.getReturnValues ( ) . size ( ) ) ; i ++ ) { java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > resultValue = result.getReturnValues ( ) . get ( i ) . getReturnValue ( ) ; disks.get ( i ) . setPluggedToRunningVm ( ( ! ( isAllVmsDown ( resultValue ) ) ) ) ; } setDisks ( disks ) ; initStorageDomains ( ) ; }

Target:
protected abstract void onInitDisks ( ) ;
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ( getVm ( ) . getrun_on_vds ( ) ) != null ) && ( getVm ( ) . getrun_on_vds ( ) . equals ( vds.getId ( ) ) ) ) { sb.append ( "is the same host the VM is currently running on" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_TO_SAME_HOST ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( isMigrate && ( ( ( getVm ( ) . getRunOnVds ( ) ) != null ) && ( getVm ( ) . getRunOnVds ( ) . equals ( vds.getId ( ) ) ) ) ) { sb.append ( "is the same host the VM is currently running on" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_TO_SAME_HOST ; } return null ; }
Source:
public void getGlusterSwiftServerServices ( 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public static final java.util.Collection < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomainById ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StorageDomain > source , final org.ovirt.engine.core.compat.Guid id ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( source , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.StorageDomain source ) { return source.getId ( ) . equals ( id ) ; } } ) ; }

Target:
public static final java.util.Collection < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomainById ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StorageDomain > source , final org.ovirt.engine.core.compat.Guid id ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( source , new org.ovirt.engine.ui.uicommonweb.Linq.IdPredicate ( id ) ) ; }
Source:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public 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 testExecuteQueryCommand ( ) { dcNetworks.addAll ( java.util.Arrays.asList ( mockExternalNetwork , mockNonExternalNetwork ) ) ; underTest.executeQueryCommand ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > actual = underTest.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertThat ( actual , org.hamcrest.Matchers.hasSize ( 1 ) ) ; org.junit.Assert.assertTrue ( actual.contains ( mockNonExternalNetwork ) ) ; }

Target:
public void testExecuteQueryCommand ( ) { dcNetworks.addAll ( java.util.Arrays.asList ( mockExternalNetwork , mockNonExternalNetwork ) ) ; underTest.executeQueryCommand ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > actual = underTest.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNotNull ( actual ) ; org.junit.Assert.assertEquals ( 1 , actual.size ( ) ) ; org.junit.Assert.assertTrue ( actual.contains ( mockNonExternalNetwork ) ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( isFirstTaskHandler ( ) ) && ( org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK ; } break ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ! ( getParameters ( ) . getTaskGroupSuccess ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_FAILURE ; } if ( ( isFirstTaskHandler ( ) ) && ( org.ovirt.engine.core.bll.lsm.LiveMigrateDiskCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK ; } break ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_MOVED_VM_DISK_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }
Source:
public org.ovirt.engine.sdk.decorators.VMDisk update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.VMDisk.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VMDisk update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Disk.class , org.ovirt.engine.sdk.decorators.VMDisk.class , headers ) ; }
Source:
private void createNotVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = getDiskImage ( ) ; disk.setActive ( true ) ; disk.setDiskInterface ( DiskInterface.IDE ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.mockito.Mockito.when ( osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.HashSet < > ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.DISK_HOTPLUGGABLE_INTERFACES ) ) ; }

Target:
private void createNotVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = mockDiskImage ( ) ; disk.setDiskInterface ( DiskInterface.IDE ) ; }
Source:
public void failedStatusWithSpecifiedFenceAgent ( ) { mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.getFenceAgentStatus ( createFenceAgent ( 1 ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( Status.ERROR , result.getStatus ( ) ) ; org.junit.Assert.assertEquals ( PowerStatus.UNKNOWN , result.getPowerStatus ( ) ) ; }

Target:
public void failedStatusWithSpecifiedFenceAgent ( ) { mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.getFenceAgentStatus ( createFenceAgent ( 1 ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( Status.ERROR , result.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( PowerStatus.UNKNOWN , result.getPowerStatus ( ) ) ; }
Source:
public void rerun ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.setVm ( null ) ; determineMigrationFailureForAuditLog ( ) ; if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { setVdsDestinationId ( null ) ; super . rerun ( ) ; } else { decreasePendingVms ( getDestinationVds ( ) . getId ( ) ) ; _isRerun = true ; org.ovirt.engine.core.bll.MigrateVmCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.MigrateVmCommand.log ( ) ; failedToRunVm ( ) ; } }

Target:
public void reportCompleted ( ) { try { super . reportCompleted ( ) ; } finally { decreasePendingVms ( getVdsDestinationId ( ) ) ; org.ovirt.engine.core.bll.MigrateVmCommand.freeLock ( ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc createStorageDomain ( int domainType , java.lang.String sdUUID , java.lang.String domainName , java.lang.String arg , int storageType ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.createStorageDomain ( domainType , sdUUID , domainName , arg , storageType ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc vmUpdateDevice ( java.lang.String vmId , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct device ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.vmUpdateDevice ( vmId , device.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; if ( ( ( result.getReturnValue ( ) ) != null ) && ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; if ( ( ( result.getReturnValue ( ) ) != null ) && ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { onActionSucceeded ( ( ( org.ovirt.engine.core.compat.Guid ) ( result.getReturnValue ( ) . getActionReturnValue ( ) ) ) ) ; } }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( isShareableDiskEnabled ) ; }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( isShareableDiskEnabled ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( consoleTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) . visibleInAdvancedModeOnly ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( consoleTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) . visibleInAdvancedModeOnly ( ) ) . update ( templateVersionNameEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.equals ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getPath ( ) ) ) ) { getPathChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; } else if ( ( ev.equals ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getOverride ( ) ) ) ) { Override_EntityChanged ( args ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getPath ( ) ) ) ) { getPathChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; } else if ( ( ev.matchesDefinition ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getOverride ( ) ) ) ) { Override_EntityChanged ( args ) ; } }
Source:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > > aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void testConvertPiBToZiB ( ) { double pib = 15 * ( java.lang.Math.pow ( 1024 , 2 ) ) ; int zib = org.ovirt.engine.core.common.utils.SizeConverter.convert ( ( ( long ) ( pib ) ) , SizeUnit.PiB , SizeUnit.ZiB ) . intValue ( ) ; org.junit.Assert.assertEquals ( 15 , zib ) ; }

Target:
public void testConvertPiBToZiB ( ) { double pib = 15 * ( java.lang.Math.pow ( 1024 , 2 ) ) ; int zib = org.ovirt.engine.core.common.utils.SizeConverter.convert ( ( ( long ) ( pib ) ) , SizeUnit.PiB , SizeUnit.ZiB ) . intValue ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( 15 , zib ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { emailEditor.setLabel ( constants.manageEventsPopupEmailLabel ( ) ) ; titleLabel.setText ( constants.manageEventsPopupTitleLabel ( ) ) ; expandAllButton.setText ( constants.treeExpandAll ( ) ) ; collapseAllButton.setText ( constants.treeCollapseAll ( ) ) ; infoLabel.setText ( constants.manageEventsPopupInfoLabel ( ) ) ; }

Target:
void localize ( ) { emailEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.user.ManageEventsPopupView.constants.manageEventsPopupEmailLabel ( ) ) ; titleLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.user.ManageEventsPopupView.constants.manageEventsPopupTitleLabel ( ) ) ; expandAllButton.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.user.ManageEventsPopupView.constants.treeExpandAll ( ) ) ; collapseAllButton.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.user.ManageEventsPopupView.constants.treeCollapseAll ( ) ) ; infoLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.user.ManageEventsPopupView.constants.manageEventsPopupInfoLabel ( ) ) ; }
Source:
protected boolean canDoAction ( ) { return org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.canRemoveVmFromPool ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVm ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolDAO ( ) . getVmPoolMapByVmGuid ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmId ( ) ) ) == null ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL ) ; } if ( org.ovirt.engine.core.bll.RemoveVmCommand.isVmRunning ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getParameters ( ) . getVmId ( ) ) ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL ) ; } return true ; }
Source:
public javax.ws.rs.core.Response performRemove ( java.lang.String id ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( id ) ) ; org.ovirt.engine.core.common.action.RemoveVmFromImportExportParamenters params = new org.ovirt.engine.core.common.action.RemoveVmFromImportExportParamenters ( vm , storageDomainId , getDataCenterId ( storageDomainId ) ) ; return performAction ( VdcActionType.RemoveVmFromImportExport , params ) ; }

Target:
public javax.ws.rs.core.Response performRemove ( java.lang.String id ) { org.ovirt.engine.core.common.action.RemoveVmFromImportExportParamenters params = new org.ovirt.engine.core.common.action.RemoveVmFromImportExportParamenters ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( id ) , storageDomainId , getDataCenterId ( storageDomainId ) ) ; return performAction ( VdcActionType.RemoveVmFromImportExport , params ) ; }
Source:
public static void getRpmVersion ( 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getGlusterSnapshotConfig ( 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.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotConfig , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) , aQuery ) ; }
Source:
public static void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) ) ; }

Target:
public static void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) ) ; }
Source:
public void testRemoveAll ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > hookIds = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; hookIds.add ( FixturesTool.HOOK_ID ) ; hookIds.add ( FixturesTool.HOOK_ID2 ) ; dao.removeAll ( hookIds ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > hooks = dao.getByClusterId ( FixturesTool.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( hooks ) ; org.junit.Assert.assertTrue ( hooks.isEmpty ( ) ) ; }

Target:
public void testRemoveAll ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > hookIds = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; hookIds.add ( FixturesTool.HOOK_ID ) ; hookIds.add ( FixturesTool.HOOK_ID2 ) ; dao.removeAll ( hookIds ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > hooks = dao.getByClusterId ( FixturesTool.GLUSTER_CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( hooks ) ; org.junit.Assert.assertTrue ( hooks.isEmpty ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createPosixConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , java.lang.String vfsType , java.lang.String mountOptions ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setVfsType ( vfsType ) ; connectionDetails.setMountOptions ( mountOptions ) ; return connectionDetails ; }

Target:
public void addNotEmptyIdConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; newPosixConnection.setid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) . toString ( ) ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . initializeVds ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY ) ; }
Source:
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 ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
protected void removeVmRelatedEntitiesFromDb ( ) { org.ovirt.engine.core.bll.AddVmCommand.RemoveVmUsers ( ) ; org.ovirt.engine.core.bll.AddVmCommand.RemoveVmNetwork ( ) ; new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . removeSnapshots ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.AddVmCommand.RemoveVmStatic ( ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : diskInfoDestinationMap.values ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getstorage_ids ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.VolumeFormat getVolumeFormatForDomain ( ) { if ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ) ) { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ; } org.ovirt.engine.core.common.businessentities.StorageDomainStatic destDomain = org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( destDomain.getStorageType ( ) . isBlockDomain ( ) ) && ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) ) { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ; } else { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.RAW ; } }

Target:
private org.ovirt.engine.core.common.businessentities.storage.VolumeFormat getVolumeFormatForDomain ( ) { if ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ) ) { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ; } org.ovirt.engine.core.common.businessentities.StorageDomainStatic destDomain = storageDomainStaticDao.get ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( destDomain.getStorageType ( ) . isBlockDomain ( ) ) && ( ( org.ovirt.engine.core.bll.storage.disk.image.CopyImageGroupCommand.getParameters ( ) . getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) ) { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ; } else { return org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.RAW ; } }
Source:
public void testGetBrandingRootPath ( ) throws java.net.URISyntaxException { java.lang.String rootPath = ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/" ) . toURI ( ) . getPath ( ) ) + "/branding" ; org.junit.Assert.assertEquals ( "Root paths don't match" , new java.io.File ( rootPath ) , testManager.getBrandingRootPath ( ) ) ; }

Target:
public void testGetBrandingRootPath ( ) throws java.net.URISyntaxException { java.lang.String rootPath = ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/" ) . toURI ( ) . getPath ( ) ) + "/branding" ; org.junit.jupiter.api.Assertions.assertEquals ( new java.io.File ( rootPath ) , testManager.getBrandingRootPath ( ) , "Root paths don't match" ) ; }