auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testNicExistsWhenNicNameIsNotNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicId ( null ) ; attachment.setNicName ( "whatever" ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) . nicExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkIpAddressWasSameAsHostnameAndChangedWhenIfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.STATIC_IP , null , null ) ; attachment.setNicName ( "nicName" ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.networkIpAddressWasSameAsHostnameAndChanged ( nics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( "%s, srcHost=%s, dstVdsId=%s, dstHost=%s, migrationMethod=%s, tunnelMigration=%s, migrationDowntime=%s, autoConverge=%s, migrateCompressed=%s" , super . toString ( ) , getSrcHost ( ) , getDstVdsId ( ) , getDstHost ( ) , getMigrationMethod ( ) , isTunnelMigration ( ) , getMigrationDowntime ( ) , getAutoConverge ( ) , getMigrateCompressed ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "srcHost" , getSrcHost ( ) ) . append ( "dstVdsId" , getDstVdsId ( ) ) . append ( "dstHost" , getDstHost ( ) ) . append ( "migrationMethod" , getMigrationMethod ( ) ) . append ( "tunnelMigration" , isTunnelMigration ( ) ) . append ( "migrationDowntime" , getMigrationDowntime ( ) ) . append ( "autoConverge" , getAutoConverge ( ) ) . append ( "migrateCompressed" , getMigrateCompressed ( ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.DiskImage object ) { return object.getDiskAlias ( ) ; }

Target:
protected void subTabLayoutPanelSelectionChanged ( java.lang.Integer selectedItem ) { if ( ( object ) != null ) { object.setActiveDetailModel ( object.getDetailModels ( ) . get ( selectedItem ) ) ; if ( selectedItem == 0 ) { generalView.setMainTabSelectedItem ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( object.getSelectedItem ( ) ) ) ) ; } } }
Source:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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 java.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.appendHtmlConstant ( ( ( ( ( "<span id=\"" + ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) ) ) + "\" style=\"vertical-align: middle;\" title=\"" ) + ( com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape ( getTitle ( value ) ) ) ) + "\">" ) ) ; sb.append ( imageHtml ) ; sb.appendHtmlConstant ( "</span>" ) ; }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , C value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.appendHtmlConstant ( ( ( ( ( "<span id=\"" + ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) ) ) + "\" style=\"vertical-align: middle;\" title=\"" ) + ( com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape ( getTitle ( value ) ) ) ) + "\">" ) ) ; sb.append ( imageHtml ) ; sb.appendHtmlConstant ( "</span>" ) ; }
Source:
public static void GetGlusterVolumeBrickDetails ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volume , java.lang.String brick ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , volume , brick , true ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void GetPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getVdsToRun ( final org.ovirt.engine.core.common.businessentities.VDSType type , final org.ovirt.engine.core.compat.Guid groupId , final org.ovirt.engine.core.common.businessentities.VDSStatus status , final int minNrOfCpus ) { return getCallsHandler ( ) . executeReadList ( "GetVdsToRun" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vds_type" , type ) . addValue ( "vds_groupid" , groupId ) . addValue ( "vds_status" , status ) . addValue ( "min_cpu_cores" , minNrOfCpus ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllOfType ( org.ovirt.engine.core.common.businessentities.VDSType type ) { return getCallsHandler ( ) . executeReadList ( "GetVdsByType" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vds_type" , type ) ) ; }
Source:
public void render ( com.google.gwt.cell.client.Cell.Context context , org.ovirt.engine.core.common.businessentities.VM value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.appendHtmlConstant ( "<div id=\"" ) ; sb.appendEscaped ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( getElementIdPrefix ( ) , getColumnId ( ) , context ) ) ; sb.appendHtmlConstant ( "\">" ) ; for ( com.google.gwt.cell.client.HasCell < org.ovirt.engine.core.common.businessentities.VM , ? > hasCell : hasCells ) { render ( context , value , sb , hasCell ) ; } sb.appendHtmlConstant ( "</div>" ) ; }

Target:
public void render ( com.google.gwt.cell.client.Cell.Context context , org.ovirt.engine.core.common.businessentities.VM value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.append ( getTemplate ( ) . id ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( getElementIdPrefix ( ) , getColumnId ( ) , context ) ) ) ; for ( com.google.gwt.cell.client.HasCell < org.ovirt.engine.core.common.businessentities.VM , ? > hasCell : hasCells ) { render ( context , value , sb , hasCell ) ; } sb.appendHtmlConstant ( "</div>" ) ; }
Source:
protected void perform ( ) { org.ovirt.engine.core.compat.Guid dumpDiskId = createMemoryDumpDisk ( ) ; org.ovirt.engine.core.compat.Guid metadataDiskId = createMemoryMetadataDisk ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage dumpDisk = getDisk ( dumpDiskId ) ; org.ovirt.engine.core.common.businessentities.DiskImage metadataDisk = getDisk ( metadataDiskId ) ; org.ovirt.engine.core.bll.HibernateVmCommand.getSnapshotDAO ( ) . updateHibernationMemory ( org.ovirt.engine.core.bll.HibernateVmCommand.getVmId ( ) , org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryStateString ( getStorageDomainId ( ) , org.ovirt.engine.core.bll.HibernateVmCommand.getStoragePoolId ( ) , dumpDisk.getId ( ) , dumpDisk.getImageId ( ) , metadataDisk.getId ( ) , metadataDisk.getImageId ( ) ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.setSucceeded ( true ) ; }

Target:
protected void perform ( ) { addMemoryDisk ( ) ; addMetadataDisk ( ) ; org.ovirt.engine.core.bll.HibernateVmCommand.setSucceeded ( true ) ; }
Source:
public void testAddNetworkToIscsiBond ( ) { dao.addNetworkToIscsiBond ( iscsiBondId , networkId ) ; java.util.List < org.ovirt.engine.core.compat.Guid > networks = dao.getNetworkIdsByIscsiBondId ( iscsiBondId ) ; junit.framework.Assert.assertEquals ( 2 , networks.size ( ) ) ; junit.framework.Assert.assertTrue ( networks.contains ( networkId ) ) ; }

Target:
public void testAddNetworkToIscsiBond ( ) { dao.addNetworkToIscsiBond ( iscsiBondId , networkId ) ; java.util.List < org.ovirt.engine.core.compat.Guid > networks = dao.getNetworkIdsByIscsiBondId ( iscsiBondId ) ; org.junit.Assert.assertEquals ( 2 , networks.size ( ) ) ; org.junit.Assert.assertTrue ( networks.contains ( networkId ) ) ; }
Source:
private void DiskInterface_SelectedItemChanged ( ) { boolean isInternal = ( ( java.lang.Boolean ) ( getIsInternal ( ) . getEntity ( ) ) ) ; org.ovirt.engine.core.common.businessentities.DiskInterface diskInterface = ( ( org.ovirt.engine.core.common.businessentities.DiskInterface ) ( getDiskInterface ( ) . getSelectedItem ( ) ) ) ; getIsSgIoUnfiltered ( ) . setIsAvailable ( ( ( ! isInternal ) && ( DiskInterface.VirtIO_SCSI.equals ( diskInterface ) ) ) ) ; }

Target:
private void DiskInterface_SelectedItemChanged ( ) { boolean isInternal = ( ( java.lang.Boolean ) ( getIsInternal ( ) . getEntity ( ) ) ) ; org.ovirt.engine.core.common.businessentities.DiskInterface diskInterface = ( ( org.ovirt.engine.core.common.businessentities.DiskInterface ) ( getDiskInterface ( ) . getSelectedItem ( ) ) ) ; getIsSgIoUnfiltered ( ) . setIsAvailable ( ( ( ! isInternal ) && ( DiskInterface.VirtIO_SCSI.equals ( diskInterface ) ) ) ) ; updateReadOnlyChangeability ( ) ; }
Source:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; if ( callback != null ) { callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; }

Target:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; if ( callback != null ) { callback.executed ( f ) ; } fireAsyncActionFailedEvent ( state ) ; }
Source:
public void releaseMacsOnCommit ( java.util.List < java.lang.String > macs ) { org.ovirt.engine.core.bll.context.CompensationContext compensationContext = this . commandContext.getCompensationContext ( ) ; org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator.UsingCompensationState.ReleaseMacsCompensationListener compensationListener = this . compensationListener ; compensationListener.macsToReleaseOnCommit.addAll ( macs ) ; compensationContext.addListener ( compensationListener ) ; }

Target:
public void releaseMacsOnCommit ( java.util.List < java.lang.String > macs ) { org.ovirt.engine.core.bll.context.CompensationContext compensationContext = this . commandContext.getCompensationContext ( ) ; org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator.UsingCompensationState.ReleaseMacsCompensationListener compensationListener = this . compensationListener ; log.debug ( "Registering macs: to be released in case of successful execution" , macs ) ; compensationListener.macsToReleaseOnCommit.addAll ( macs ) ; log.debug ( ( "Registering compensation listener {}" + compensationListener ) ) ; compensationContext.addListener ( compensationListener ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_id" ) ) ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.NGuid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setowner ( org.ovirt.engine.core.common.businessentities.StorageDomainOwnerType.forValue ( rs.getInt ( "owner" ) ) ) ; return entity ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > getAllForStoragePool ( org.ovirt.engine.core.compat.Guid storagePoolId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_id" , Guid.Empty ) . addValue ( "storage_pool_id" , storagePoolId ) ; return getCallsHandler ( ) . executeReadList ( "Getstorage_pool_iso_mapsByBystorage_pool_id" , org.ovirt.engine.core.dao.StoragePoolIsoMapDAODbFacadeImpl.StoragePoolIsoMapRowMapper.instance , parameterSource ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol resolveSelectedProtocol ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel item ) { return consoleModelsCache.resolveUserSelectedProtocol ( item ) ; }

Target:
private boolean isConsoleCommandsExecutionAllowed ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VM > list = ( ( getSelectedItem ( ) ) == null ) ? null : getSelectedItems ( ) ; if ( list == null ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VM vm : list ) { if ( consoleModelsCache.getVmConsolesForEntity ( vm ) . canConnectToConsole ( ) ) { return true ; } } return false ; }
Source:
public void validateTemplateImageIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED.toString ( ) ) ) ; }

Target:
public void validateTemplateImageIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.init ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED.toString ( ) ) ) ; }
Source:
public void testExecuteCommandFailsWithClusterIdForStop ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ) ) ; setUpMockUpForStart ( ) ; mockBackend ( false , VdcBllErrors.GlusterServiceManageFailed , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.never ( ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_STOP_FAILED ) ; }

Target:
public void testExecuteCommandFailsWithClusterIdForStop ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ) ) ; setUpMockUpForStart ( ) ; mockBackend ( false , VdcBllErrors.GlusterServicesActionFailed , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.never ( ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_STOP_FAILED ) ; }
Source:
public org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback getCallback ( ) { if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVds ( ) . getClusterSupportsGlusterService ( ) ) && ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getParameters ( ) . isStopGlusterService ( ) ) ) { return new org.ovirt.engine.core.bll.HostMaintenanceCallback ( ) ; } else { return super . getCallback ( ) ; } }

Target:
public org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback getCallback ( ) { if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVds ( ) . getClusterSupportsGlusterService ( ) ) && ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getParameters ( ) . isStopGlusterService ( ) ) ) { return org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.bll.HostMaintenanceCallback ( ) ) ; } else { return super . getCallback ( ) ; } }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView network : importModel.getNetworkProfiles ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }

Target:
public void onSelection ( com.google.gwt.event.logical.shared.SelectionEvent < java.lang.Integer > event ) { subTabLayoutPanelSelectionChanged ( event.getSelectedItem ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean hasIscsiStorage = false ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { if ( ( connection.getstorage_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ) { hasIscsiStorage = true ; break ; } } iscsiBondListModel.setIsAvailable ( hasIscsiStorage ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { boolean hasIscsiStorage = false ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : connections ) { if ( ( connection.getstorage_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI ) ) { hasIscsiStorage = true ; break ; } } iscsiBondListModel.setIsAvailable ( hasIscsiStorage ) ; }
Source:
protected javax.ws.rs.core.Response performRemove ( java.lang.String id ) { throw new java.lang.UnsupportedOperationException ( ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Quota quota ) { validateParameters ( quota , "name" ) ; org.ovirt.engine.api.model.Quota entity = map ( quota ) ; entity.setStoragePoolId ( dataCenterId ) ; return performCreate ( VdcActionType.AddQuota , new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetQuotaByQuotaId , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
private void updateHaMaintenanceAvailability ( java.util.List items ) { if ( ( items == null ) || ( ( items.size ( ) ) != 1 ) ) { setHaMaintenanceAvailability ( false ) ; return ; } org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItem ( ) ; if ( ( ( vm == null ) || ( ! ( vm.isHostedEngine ( ) ) ) ) || ( ( vm.getVdsGroupCompatibilityVersion ( ) . compareTo ( Version.v3_4 ) ) < 0 ) ) { setHaMaintenanceAvailability ( false ) ; } else { setHaMaintenanceAvailability ( true ) ; } }

Target:
private void updateHaMaintenanceAvailability ( java.util.List items ) { if ( ( items == null ) || ( ( items.size ( ) ) != 1 ) ) { setHaMaintenanceAvailability ( false ) ; return ; } org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItem ( ) ; if ( ( ( vm == null ) || ( ! ( vm.isHostedEngine ( ) ) ) ) || ( ( vm.getCompatibilityVersion ( ) . compareTo ( Version.v3_4 ) ) < 0 ) ) { setHaMaintenanceAvailability ( false ) ; } else { setHaMaintenanceAvailability ( true ) ; } }
Source:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }

Target:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; dbFacade.populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }
Source:
private void updateInterfacesWithUserConfiguration ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsForUpdate , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsByName ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicForUpdate : nicsForUpdate ) { if ( nicsByName.containsKey ( nicForUpdate.getName ( ) ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = nicsByName.get ( nicForUpdate.getName ( ) ) ; nicForUpdate.setLabels ( nic.getLabels ( ) ) ; nicForUpdate.setQosOverridden ( nic.isQosOverridden ( ) ) ; nicForUpdate.setCustomProperties ( nic.getCustomProperties ( ) ) ; } } }

Target:
private void persistTopology ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > reportedNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > userConfiguredNics ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getInterfaceDao ( ) , reportedNics , dbNics , userConfiguredNics ) ; networkInterfacesPersister.persistTopology ( ) ; }
Source:
protected void verifyResponseGlusterOnly ( javax.ws.rs.core.Response response ) { org.junit.Assert.assertEquals ( 200 , response.getStatus ( ) ) ; org.junit.Assert.assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.Api ) ) ; verifyApiGlusterOnly ( ( ( org.ovirt.engine.api.model.Api ) ( response.getEntity ( ) ) ) ) ; }

Target:
protected void verifyResponseGlusterOnly ( javax.ws.rs.core.Response response ) { org.junit.jupiter.api.Assertions.assertEquals ( 200 , response.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.Api ) ) ; verifyApiGlusterOnly ( ( ( org.ovirt.engine.api.model.Api ) ( response.getEntity ( ) ) ) ) ; }
Source:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setvds_group_compatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; }

Target:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; }
Source:
protected boolean validateVdsCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; return vdsGroup == null ? failCanDoAction ( EngineMessage.VDS_CLUSTER_IS_NOT_VALID ) : ( vdsGroup.getArchitecture ( ) ) != ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getClusterArch ( ) ) ? failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) : true ; }

Target:
protected boolean validateVdsCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; return vdsGroup == null ? failValidation ( EngineMessage.VDS_CLUSTER_IS_NOT_VALID ) : ( vdsGroup.getArchitecture ( ) ) != ( getVm ( ) . getClusterArch ( ) ) ? failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) : true ; }
Source:
public org.ovirt.engine.core.common.businessentities.VmPoolMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VmPoolMap entity = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( ) ; entity.setvm_guid ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "vm_guid" ) ) ) ; entity.setvm_pool_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "vm_pool_id" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmPoolMap getVmPoolMapByVmGuid ( org.ovirt.engine.core.compat.Guid vmId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_guid" , vmId ) ; return getCallsHandler ( ) . executeRead ( "GetVm_pool_mapByvm_guid" , org.ovirt.engine.core.dao.VmPoolDAODbFacadeImpl.VmPoolMapRowMapper.instance , parameterSource ) ; }
Source:
private boolean serverDetached ( org.ovirt.engine.core.common.businessentities.VDS server , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchedServers ) { java.util.List < java.lang.String > vdsIps = getVdsIps ( server ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo fetchedServer : fetchedServers ) { if ( ( fetchedServer.getHostnameOrIp ( ) . equals ( server.gethost_name ( ) ) ) || ( vdsIps.contains ( fetchedServer.getHostnameOrIp ( ) ) ) ) { return false ; } } return true ; }

Target:
private boolean serverDetached ( org.ovirt.engine.core.common.businessentities.VDS server , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchedServers ) { java.util.List < java.lang.String > vdsIps = getVdsIps ( server ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo fetchedServer : fetchedServers ) { if ( ( fetchedServer.getHostnameOrIp ( ) . equals ( server.getHostName ( ) ) ) || ( vdsIps.contains ( fetchedServer.getHostnameOrIp ( ) ) ) ) { return false ; } } return true ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) . setCpuProfileId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean validateSoundDevice ( ) { if ( ! ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isSoundDeviceExists ( getVm ( ) . getManagedVmDeviceMap ( ) . values ( ) ) ) ) { return true ; } if ( ! ( osRepository.isSoundDeviceEnabled ( getVm ( ) . getStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) { addCanDoActionMessageVariable ( "clusterArch" , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getArchitecture ( ) ) ; return failCanDoAction ( EngineMessage.SOUND_DEVICE_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; } return true ; }
Source:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.core.common.businessentities.IscsiBond bond = getBond ( ) ; if ( ! ( bond.getNetworkIds ( ) . contains ( guid ) ) ) { notFound ( ) ; } bond.getNetworkIds ( ) . remove ( guid ) ; return performAction ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( bond ) ) ; }

Target:
public org.ovirt.engine.api.model.Network get ( ) { org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = parent.getIscsiBond ( ) ; if ( ! ( iscsiBond.getNetworkIds ( ) . contains ( guid ) ) ) { return notFound ( ) ; } org.ovirt.engine.api.model.Network entity = getNetwork ( ) ; if ( entity == null ) { return notFound ( ) ; } return addLinks ( map ( entity ) ) ; }
Source:
public void validateVmMemoryCanRunOnVdsHighMemLowOverhead ( ) { vm.setMinAllocatedMem ( 10000 ) ; vm.setVmMemSizeMb ( 10000 ) ; vds.setGuestOverhead ( ( - 1200 ) ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCantRunOnVdsSmallHost ( ) { vds.setPhysicalMemMb ( 5000 ) ; boolean vmPassedMemoryRequirement = slaValidator.hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertFalse ( vmPassedMemoryRequirement ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcActionType getParentCommandType ( ) { org.ovirt.engine.core.common.action.VdcActionType parentCommand = org.ovirt.engine.core.common.action.VdcActionType.Unknown ; if ( parentHasCallback ( ) ) { if ( ( getTaskType ( ) ) == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ) ) { parentCommand = getParameters ( ) . getParentCommand ( ) ; } } else { parentCommand = getParameters ( ) . getParentCommand ( ) ; } return parentCommand ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParentParameters ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParameters ( ) ; if ( parentHasCallback ( ) ) { if ( ( ! ( getParameters ( ) . getShouldBeEndedByParent ( ) ) ) || ( ( getTaskType ( ) ) == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.notSupported ) ) ) { parentParameters = getParameters ( ) . getParentParameters ( ) ; } } else if ( getParameters ( ) . getShouldBeEndedByParent ( ) ) { parentParameters = getParameters ( ) . getParentParameters ( ) ; } return parentParameters ; }
Source:
void scheduleKeepAliveHeartbeat ( ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleFixedDelay ( new com.google.gwt.core.client.Scheduler.RepeatingCommand ( ) { @ java.lang.Override public boolean execute ( ) { boolean sessionInUse = ( restApiSessionId ) != null ; if ( sessionInUse && ( refreshRestApiSession ) ) { sendRequest ( createRequest ( ) , new org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.RestApiRequestCallback ( ) ) ; refreshRestApiSession = false ; } return sessionInUse ; } } , org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_HEARTBEAT_MS ) ; }

Target:
void scheduleKeepAliveHeartbeat ( ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleFixedDelay ( new com.google.gwt.core.client.Scheduler.RepeatingCommand ( ) { @ java.lang.Override public boolean execute ( ) { boolean sessionInUse = ( restApiSessionId ) != null ; if ( sessionInUse && ( refreshRestApiSession ) ) { sendRequest ( createRequest ( ) , new org.ovirt.engine.ui.common.restapi.RestApiSessionManager.RestApiRequestCallback ( ) ) ; refreshRestApiSession = false ; } return sessionInUse ; } } , org.ovirt.engine.ui.common.restapi.RestApiSessionManager.SESSION_HEARTBEAT_MS ) ; }
Source:
public void log ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { if ( ! ( logType.shouldBeLogged ( ) ) ) { return ; } updateTimeoutLogableObject ( auditLogable , logType ) ; if ( auditLogable.getLegal ( ) ) { saveToDb ( auditLogable , logType , loggerString ) ; } }

Target:
public void log ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { if ( ! ( logType.shouldBeLogged ( ) ) ) { return ; } org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator eventFloodRegulator = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator ( auditLogable , logType ) ; eventFloodRegulator.updateTimeoutLogableObject ( ) ; if ( eventFloodRegulator.isLegal ( ) ) { saveToDb ( auditLogable , logType , loggerString ) ; } }
Source:
public void testFindMappingEntryEmptyInput ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( java.util.Collections.emptyList ( ) ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.Assert.assertEquals ( 1 , ctx.getMatched ( ) . size ( ) ) ; org.junit.Assert.assertNull ( ctx.getMatched ( ) . get ( vnic ) ) ; }

Target:
public void testFindMappingEntryEmptyInput ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( java.util.Collections.emptyList ( ) ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , ctx.getMatched ( ) . size ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( ctx.getMatched ( ) . get ( vnic ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; super . testUpdate ( ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; super . testUpdate ( ) ; }
Source:
public void dump ( org.ovirt.engine.api.extensions.ExtMap map , java.lang.String indent ) { if ( map != null ) { org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "{}--- Begin PrincipalRecord ---" , indent ) ; org.ovirt.engine.exttool.aaa.AAAServiceImpl.Dump.dumpRecord ( map , java.util.Arrays.asList ( Authz.PrincipalRecord.GROUPS ) , "PrincipalRecord" , indent ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : map.get ( Authz.PrincipalRecord.GROUPS , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { org.ovirt.engine.exttool.aaa.AAAServiceImpl.Dump.GROUP_RECORD.dump ( group , ( indent + " " ) ) ; } org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "{}--- End PrincipalRecord ---" , indent ) ; } }

Target:
public void dump ( org.ovirt.engine.exttool.aaa.AAAServiceImpl module , org.ovirt.engine.api.extensions.ExtMap map , java.lang.String indent ) { if ( map != null ) { org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "{}--- Begin PrincipalRecord ---" , indent ) ; org.ovirt.engine.exttool.aaa.AAAServiceImpl.Dump.dumpRecord ( module , map , java.util.Arrays.asList ( Authz.PrincipalRecord.GROUPS ) , "PrincipalRecord" , indent ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : map.get ( Authz.PrincipalRecord.GROUPS , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { org.ovirt.engine.exttool.aaa.AAAServiceImpl.Dump.GROUP_RECORD.dump ( module , group , ( indent + " " ) ) ; } org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "{}--- End PrincipalRecord ---" , indent ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testChangeDiskProfileForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertThat ( "Same source and dest disk profile id, cannot perform test" , imageStorageDomainMap.getDiskProfileId ( ) , org.hamcrest.CoreMatchers.not ( org.hamcrest.CoreMatchers.equalTo ( FixturesTool.DISK_PROFILE_2 ) ) ) ; dao.updateDiskProfileByImageGroupIdAndStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DISK_PROFILE_2 ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertEquals ( "disk profile wasn't changed" , FixturesTool.DISK_PROFILE_2 , imageStorageDomainMap.getDiskProfileId ( ) ) ; }

Target:
public void testChangeDiskProfileForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertThat ( "Same source and dest disk profile id, cannot perform test" , imageStorageDomainMap.getDiskProfileId ( ) , org.hamcrest.CoreMatchers.not ( org.hamcrest.CoreMatchers.equalTo ( FixturesTool.DISK_PROFILE_2 ) ) ) ; dao.updateDiskProfileByImageGroupIdAndStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DISK_PROFILE_2 ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertEquals ( "disk profile wasn't changed" , FixturesTool.DISK_PROFILE_2 , imageStorageDomainMap.getDiskProfileId ( ) ) ; }
Source:
public void completeExternalProvidersNoNameTest ( ) { org.ovirt.engine.api.model.ExternalProviders providers = getExternalProviders ( 1 ) ; providers.getExternalProviders ( ) . get ( 0 ) . setName ( null ) ; try { org.ovirt.engine.api.restapi.resource.BackendExternalProviderHelper.completeExternalProviders ( resource , providers ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , Response.Status.BAD_REQUEST.getStatusCode ( ) ) ; } }

Target:
public void completeExternalProvidersNoNameTest ( ) { org.ovirt.engine.api.model.ExternalProviders providers = getExternalProviders ( 1 ) ; providers.getExternalProviders ( ) . get ( 0 ) . setName ( null ) ; try { org.ovirt.engine.api.restapi.resource.BackendExternalProviderHelper.completeExternalProviders ( resource , providers ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , Response.Status.BAD_REQUEST.getStatusCode ( ) ) ; } }
Source:
private void lazyEval ( long wait ) { try ( org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper wrapper = new org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper ( this . lock ) ) { if ( this . responseMap.isEmpty ( ) ) { try { populate ( this . response.get ( wait , java.util.concurrent.TimeUnit.SECONDS ) ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException | java.util.concurrent.TimeoutException e ) { org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap.log.debug ( "Response not arrived yet" ) ; } } } }

Target:
private void lazyEval ( long wait ) { try ( org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper wrapper = new org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper ( this . lock ) ) { if ( this . responseMap.isEmpty ( ) ) { try { populate ( this . response.get ( wait , java.util.concurrent.TimeUnit.MILLISECONDS ) ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException | java.util.concurrent.TimeoutException e ) { org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap.log.debug ( "Response not arrived yet" ) ; } } } }