auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUpdateStatus ( ) { existingEntity.setStatus ( VMStatus.Down ) ; dao.updateStatus ( existingEntity.getId ( ) , existingEntity.getStatus ( ) ) ; org.ovirt.engine.core.common.businessentities.VmDynamic after = dao.get ( existingEntity.getId ( ) ) ; org.junit.Assert.assertEquals ( existingEntity , after ) ; }

Target:
public void testUpdateStatus ( ) { existingEntity.setStatus ( VMStatus.Down ) ; dao.updateStatus ( existingEntity.getId ( ) , existingEntity.getStatus ( ) ) ; org.ovirt.engine.core.common.businessentities.VmDynamic after = dao.get ( existingEntity.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingEntity , after ) ; }
Source:
protected org.ovirt.engine.core.common.AuditLogType getAuditLogForMigrationFailure ( ) { if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) { return org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE ; } if ( ( getDestinationVds ( ) ) == null ) { return org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_NO_VDS_TO_RUN_ON ; } return org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED ; }

Target:
protected org.ovirt.engine.core.common.AuditLogType getAuditLogForMigrationFailure ( ) { if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) { return org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE ; } if ( ( getDestinationVds ( ) ) == null ) { auditLogDirector.log ( this , AuditLogType.VM_MIGRATION_NO_VDS_TO_MIGRATE_TO ) ; } return org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED ; }
Source:
private static com.google.gwt.safehtml.shared.SafeHtml buildItemList ( java.util.Collection < java.lang.String > items ) { com.google.gwt.safehtml.shared.SafeHtmlBuilder itemBuilder = new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) ; for ( java.lang.String i : items ) { itemBuilder.append ( org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.TEMPLATES.listItem ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( i ) ) ) ; } return org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.TEMPLATES.unsignedList ( itemBuilder.toSafeHtml ( ) ) ; }

Target:
private static com.google.gwt.safehtml.shared.SafeHtml buildItemList ( java.util.Collection < java.lang.String > items ) { com.google.gwt.safehtml.shared.SafeHtmlBuilder itemBuilder = new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) ; for ( java.lang.String i : items ) { itemBuilder.append ( org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.templates.listItem ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( i ) ) ) ; } return org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.templates.unsignedList ( itemBuilder.toSafeHtml ( ) ) ; }
Source:
private boolean changesAreClusterCompatible ( ) { if ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) == false ) { if ( ! ( org.ovirt.engine.core.bll.validator.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }

Target:
private boolean changesAreClusterCompatible ( ) { if ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) == false ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }
Source:
public final boolean IsUpdateValid ( java.lang.Object source , java.lang.Object destination , java.lang.Enum < ? > status ) { if ( ( source.getClass ( ) ) != ( destination.getClass ( ) ) ) { return false ; } for ( java.lang.String fieldName : org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( source , destination ) ) { if ( ! ( IsFieldUpdatable ( status , fieldName , null ) ) ) { org.ovirt.engine.core.utils.ObjectIdentityChecker.log.warn ( java.lang.String.format ( "ObjectIdentityChecker.IsUpdateValid:: Not updatable field '%1$s' was updated" , fieldName ) ) ; return false ; } } return true ; }

Target:
public final boolean IsUpdateValid ( java.lang.Object source , java.lang.Object destination , java.lang.Enum < ? > status , boolean hotsetEnabled ) { if ( ( source.getClass ( ) ) != ( destination.getClass ( ) ) ) { return false ; } for ( java.lang.String fieldName : org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( source , destination ) ) { if ( ! ( IsFieldUpdatable ( status , fieldName , null , hotsetEnabled ) ) ) { org.ovirt.engine.core.utils.ObjectIdentityChecker.log.warn ( java.lang.String.format ( "ObjectIdentityChecker.IsUpdateValid:: Not updatable field '%1$s' was updated" , fieldName ) ) ; return false ; } } return true ; }
Source:
public static void GetClusterById ( 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.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters ( id ) , aQuery ) ; }

Target:
public static void GetVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vmId ) , aQuery ) ; }
Source:
private void doTestBadAddBookmark ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.Name" , "Bookmark.Value" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , valid , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddBookmark ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.AddBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.Name" , "Bookmark.Value" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , valid , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void logAlert ( org.ovirt.engine.core.common.businessentities.VDS host , java.lang.Double percents ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogable.addCustomValue ( "Percents" , percents.toString ( ) ) ; auditLogable.setVdsId ( host.getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( auditLogable , AuditLogType.VDS_ALERT_FENCE_OPERATION_SKIPPED_BROKEN_CONNECTIVITY ) ; }

Target:
private void logAlert ( org.ovirt.engine.core.common.businessentities.VDS host , java.lang.Double percents ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogable.addCustomValue ( "Percents" , percents.toString ( ) ) ; auditLogable.setVdsId ( host.getId ( ) ) ; auditLogable.setRepeatable ( true ) ; auditLogDirector.log ( auditLogable , AuditLogType.VDS_ALERT_FENCE_OPERATION_SKIPPED_BROKEN_CONNECTIVITY ) ; }
Source:
public void failWhenStartupTimeoutHasNotPassed ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( backend.getStartedAt ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.DateTime ( new java.util.Date ( ) ) ) ; boolean result = validator.isStartupTimeoutPassed ( messages ) ; org.junit.Assert.assertEquals ( 1 , messages.size ( ) ) ; org.junit.Assert.assertEquals ( "VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL" , messages.get ( 0 ) ) ; org.junit.Assert.assertFalse ( result ) ; }

Target:
public void failWhenStartupTimeoutHasNotPassed ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( backend.getStartedAt ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.DateTime ( new java.util.Date ( ) ) ) ; boolean result = validator.isStartupTimeoutPassed ( messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , messages.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL" , messages.get ( 0 ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( result ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult rs = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; rs.setSuccess ( false ) ; if ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( first , second ) ) ) { java.util.ArrayList < java.lang.String > reasons = new java.util.ArrayList < java.lang.String > ( ) ; reasons.add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cloudInitRootPasswordMatchMessage ( ) ) ; rs.setReasons ( reasons ) ; } else { rs.setSuccess ( true ) ; } return rs ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult rs = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; rs.setSuccess ( false ) ; if ( ! ( java.util.Objects.equals ( first , second ) ) ) { java.util.ArrayList < java.lang.String > reasons = new java.util.ArrayList < java.lang.String > ( ) ; reasons.add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cloudInitRootPasswordMatchMessage ( ) ) ; rs.setReasons ( reasons ) ; } else { rs.setSuccess ( true ) ; } return rs ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.Disk disk = null ; org.ovirt.engine.core.common.businessentities.storage.DiskStorageType diskStorageType = org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.forValue ( rs.getInt ( "disk_storage_type" ) ) ; switch ( diskStorageType ) { case IMAGE : disk = DiskImageRowMapper.instance.mapRow ( rs , rowNum ) ; break ; case LUN : disk = org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.LunDiskRowMapper.instance.mapRow ( rs , rowNum ) ; break ; } return disk ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.Disk disk = null ; org.ovirt.engine.core.common.businessentities.storage.DiskStorageType diskStorageType = org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.forValue ( rs.getInt ( "disk_storage_type" ) ) ; switch ( diskStorageType ) { case IMAGE : disk = DiskImageRowMapper.instance.mapRow ( rs , rowNum ) ; break ; case LUN : disk = org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.LunDiskRowMapper.instance.mapRow ( rs , rowNum ) ; break ; case CINDER : disk = CinderDiskRowMapper.instance.mapRow ( rs , rowNum ) ; break ; } return disk ; }
Source:
public void addTask ( org.ovirt.vdsmfake.task.TaskType type , long delay , java.lang.Object object ) { try { if ( org.ovirt.vdsmfake.AppConfig.getInstance ( ) . isJsonEvents ( ) ) { jsonRpcNotification.fireEvents ( type , delay , object ) ; } else { org.ovirt.vdsmfake.task.TaskProcessor.getInstance ( ) . addTask ( new org.ovirt.vdsmfake.task.TaskRequest ( type , delay , object ) ) ; } } catch ( java.lang.Exception e ) { log.error ( "wrapping task error:" , e ) ; } }

Target:
public void addTask ( org.ovirt.vdsmfake.task.TaskType type , long delay , java.lang.Object object ) { try { if ( appConfig.isJsonEvents ( ) ) { jsonRpcNotification.fireEvents ( type , delay , object ) ; } else { org.ovirt.vdsmfake.task.TaskProcessor.getInstance ( ) . addTask ( new org.ovirt.vdsmfake.task.TaskRequest ( type , delay , object ) ) ; } } catch ( java.lang.Exception e ) { log.error ( "wrapping task error:" , e ) ; } }
Source:
public static java.lang.String combine ( java.lang.String head , org.ovirt.engine.api.model.ParametersSet params ) { java.lang.String combined_params = "" ; if ( params != null ) { for ( org.ovirt.engine.api.model.Parameter entry : params.getParameters ( ) ) { combined_params += java.lang.String.format ( org.ovirt.engine.api.common.util.LinkHelper.PARAMETER_TEMPLATE , entry.getName ( ) , entry.getValue ( ) ) ; } } return head + combined_params ; }

Target:
public static java.lang.String combine ( java.lang.String head , org.ovirt.engine.api.model.ParametersSet params ) { java.lang.String combined_params = "" ; if ( params != null ) { for ( org.ovirt.engine.api.model.Parameter entry : params.getParameters ( ) ) { combined_params += java.lang.String.format ( org.ovirt.engine.api.common.util.LinkHelper.MATRIX_PARAMETER_TEMPLATE , entry.getName ( ) , entry.getValue ( ) ) ; } } return head + combined_params ; }
Source:
public static void GetProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }

Target:
org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentNotRemoved ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.core.compat.Guid networkAttachmentId = networkAttachment.getId ( ) ; if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentInRemoveList = params.getRemovedNetworkAttachments ( ) . contains ( networkAttachmentId ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_IN_BOTH_LISTS ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , networkAttachmentId.toString ( ) ) ) . when ( attachmentInRemoveList ) ; }
Source:
public void testGetVg ( ) throws java.lang.Exception { org.ovirt.engine.api.resource.StorageResource subresource = collection.getStorageSubResource ( ( ( org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.VG_ID_PREFIX ) + ( GUIDS [ org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.SINGLE_STORAGE_IDX ] . toString ( ) ) ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpQueryExpectations ( "" ) ; verifyModel ( subresource.get ( ) , org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.SINGLE_STORAGE_IDX ) ; }

Target:
public void testGetVg ( ) throws java.lang.Exception { org.ovirt.engine.api.resource.StorageResource subresource = collection.getStorageResource ( ( ( org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.VG_ID_PREFIX ) + ( GUIDS [ org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.SINGLE_STORAGE_IDX ] . toString ( ) ) ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpQueryExpectations ( "" ) ; verifyModel ( subresource.get ( ) , org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.SINGLE_STORAGE_IDX ) ; }
Source:
public void vdsIdRefVds ( ) { b.setVdsIdRef ( null ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVds ( v ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsIdRef ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }

Target:
public void vdsIdRefVds ( ) { b.setVdsIdRef ( null ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVds ( v ) ; final org.ovirt.engine.core.compat.Guid g = b.getVdsIdRef ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setVolumeId ( volumeId ) ; brick.setServerId ( serverId ) ; brick.setServerName ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.serverName ) ; brick.setBrickDirectory ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.BRICK_DIRECTORY ) ; brick.setStatus ( GlusterStatus.UP ) ; return brick ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > getBricks ( org.ovirt.engine.core.compat.Guid volumeId , int max , boolean withDuplicates ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < > ( ) ; for ( java.lang.Integer i = 0 ; i < max ; i ++ ) { bricks.add ( getBrick ( volumeId , serverId , ( "/tmp/s" + ( i.toString ( ) ) ) ) ) ; } if ( ( max > 0 ) && withDuplicates ) { bricks.add ( getBrick ( volumeId , serverId , "/tmp/s0" ) ) ; } return bricks ; }
Source:
public void isVirtioScsiEnabledForVm ( 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 ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void isVirtioScsiEnabledForVm ( 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 ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected void sendWarningForNonExportableDisks ( org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmDiskList ( new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; } } ) , entity.getId ( ) ) ; }

Target:
protected void sendWarningForNonExportableDisks ( org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; } } ) , entity.getId ( ) ) ; }
Source:
private boolean nicUsedByRemovedNetwork ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave ) { for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : params.getRemovedNetworkAttachments ( ) ) { if ( java.util.Objects.equals ( slave.getName ( ) , attachment.getNicName ( ) ) ) { return true ; } } return false ; }

Target:
private boolean slaveUsedMultipleTimesInDifferentBonds ( java.lang.String potentiallyDuplicateSlaveName ) { int count = 0 ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : params.getBonds ( ) ) { for ( java.lang.String slaveName : bond.getSlaves ( ) ) { if ( slaveName.equals ( potentiallyDuplicateSlaveName ) ) { count ++ ; } } } return count >= 2 ; }
Source:
private void writeStructMembers ( javax.xml.stream.XMLStreamWriter writer , org.ovirt.api.metamodel.concepts.StructType type ) throws javax.xml.stream.XMLStreamException { writer.writeStartElement ( org.ovirt.api.metamodel.tool.SchemaGenerator.XS_URI , "sequence" ) ; for ( org.ovirt.api.metamodel.concepts.Attribute attribute : type.getDeclaredAttributes ( ) ) { writeStructMember ( writer , type , attribute.getType ( ) , attribute.getName ( ) ) ; } for ( org.ovirt.api.metamodel.concepts.Link link : type.getDeclaredLinks ( ) ) { writeStructMember ( writer , type , link.getType ( ) , link.getName ( ) ) ; } writer.writeEndElement ( ) ; }

Target:
private void writeStructMembers ( org.ovirt.api.metamodel.tool.XmlWriter writer , org.ovirt.api.metamodel.concepts.StructType type ) { writer.writeStartElement ( org.ovirt.api.metamodel.tool.SchemaGenerator.XS_URI , "sequence" ) ; for ( org.ovirt.api.metamodel.concepts.Attribute attribute : type.getDeclaredAttributes ( ) ) { writeStructMember ( writer , type , attribute.getType ( ) , attribute.getName ( ) ) ; } for ( org.ovirt.api.metamodel.concepts.Link link : type.getDeclaredLinks ( ) ) { writeStructMember ( writer , type , link.getType ( ) , link.getName ( ) ) ; } writer.writeEndElement ( ) ; }
Source:
public void getISCSIStorageTypeForLun ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; connections.add ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( "Some LUN connection" , "id" , "iqn" , "password" , org.ovirt.engine.core.common.businessentities.storage.StorageType.ISCSI , "Username" , "port" , "portal" ) ) ; lun.setLunConnections ( connections ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageType = command.getLUNStorageType ( lun ) ; org.junit.Assert.assertEquals ( "Lun disk should be of ISCSI storage type since it has one connection with ISCSI storage type" , StorageType.ISCSI , storageType ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; mockVMDao ( vm ) ; return vm ; }
Source:
public void shouldDetectSuspendedVM ( ) { invalidVM.setStatus ( VMStatus.Suspended ) ; org.assertj.core.api.Assertions.assertThat ( validator.isVmReadyForUpgrade ( invalidVM ) ) . contains ( UPGRADE_ERROR.VM_SUSPENDED ) ; }

Target:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( UpgradeError.VM_NUMA_PINNED ) ; }
Source:
private static void removeUsbControllers ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > list = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceType.CONTROLLER.getName ( ) , VmDeviceType.USB.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : list ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( vmDevice.getId ( ) ) ; } }

Target:
private static void removeUsbControllers ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > list = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceGeneralType.CONTROLLER , VmDeviceType.USB.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : list ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( vmDevice.getId ( ) ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.ActionGroup map ( org.ovirt.engine.api.model.PermitType entity , org.ovirt.engine.core.common.businessentities.ActionGroup template ) { final org.ovirt.engine.core.common.businessentities.ActionGroup result = entity.getActionGroup ( ) ; if ( result == null ) { org.ovirt.engine.api.restapi.types.PermitMapper.log.error ( new org.ovirt.engine.api.restapi.utils.MappingException ( ( ( ( "Missing mapping " + entity ) + " --> " ) + ( org.ovirt.engine.core.common.businessentities.ActionGroup.class . getName ( ) ) ) ) ) ; } return result ; }

Target:
public static org.ovirt.engine.core.common.businessentities.ActionGroup map ( org.ovirt.engine.api.model.PermitType entity , org.ovirt.engine.core.common.businessentities.ActionGroup template ) { final org.ovirt.engine.core.common.businessentities.ActionGroup result = entity.getActionGroup ( ) ; if ( result == null ) { org.ovirt.engine.api.restapi.types.PermitMapper.log.error ( "Missing mapping '{}' --> '{}'" , entity , org.ovirt.engine.core.common.businessentities.ActionGroup.class . getName ( ) ) ; } return result ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { onExternalProviderChanged ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( result ) ; } }
Source:
public void testListWithEveryonePermissions ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetEntityExpectations ( QueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getUserByIdx ( 1 ) , true ) ; setUpQueryExpectations ( "" , null , org.ovirt.engine.api.restapi.resource.EVERYONE ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }

Target:
public void testListWithEveryonePermissions ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetEntityExpectations ( QueryType.GetAnyDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getUserByIdx ( 1 ) , true ) ; setUpQueryExpectations ( "" , null , org.ovirt.engine.api.restapi.resource.EVERYONE ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( ( object.getVdsGroupName ( ) ) == null ) || ( ( object.getVdsGroupName ( ) . length ( ) ) == 0 ) ) { return constants.ultQuotaForAllClustersQuotaPopup ( ) ; } return object.getVdsGroupName ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( ( object.getVdsGroupName ( ) ) == null ) || ( ( object.getVdsGroupName ( ) . length ( ) ) == 0 ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.QuotaPopupView.constants.ultQuotaForAllClustersQuotaPopup ( ) ; } return object.getVdsGroupName ( ) ; }
Source:
public void hasNoStorageDomains ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void hasMultipleClustersForLocalDC ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) , new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) ; org.mockito.Mockito.when ( clusterDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( clusters ) ; cmd.getStoragePool ( ) . setIsLocal ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.CLUSTER_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE ) ; }
Source:
public void testVmNotDuringInitialization ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , true , null ) ; }

Target:
public void testVmNotDuringInitialization ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , true , null ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( ) ; if ( source != null ) { java.lang.String [ ] array = ( ( java.lang.String ) ( source ) ) . split ( "[,]" , ( - 1 ) ) ; for ( java.lang.String item : array ) { list.add ( item ) ; } } return list ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < java.lang.String > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.String [ ] array = ( ( java.lang.String ) ( source ) ) . split ( "[,]" , ( - 1 ) ) ; for ( java.lang.String item : array ) { list.add ( item ) ; } } return list ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.lang.StringBuilder configBuilder = new java.lang.StringBuilder ( ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) ) ; writeOVirtSection ( configBuilder , getOptions ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , configBuilder.toString ( ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , returnValue.< java.lang.String > getReturnValue ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createISCSIConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , java.lang.String iqn , java.lang.String user , java.lang.String password ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( connection , type ) ; connectionDetails.setiqn ( iqn ) ; connectionDetails.setuser_name ( user ) ; connectionDetails.setpassword ( password ) ; return connectionDetails ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createISCSIConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , java.lang.String iqn , java.lang.String port , java.lang.String user , java.lang.String password ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( connection , type ) ; connectionDetails.setiqn ( iqn ) ; connectionDetails.setport ( port ) ; connectionDetails.setuser_name ( user ) ; connectionDetails.setpassword ( password ) ; return connectionDetails ; }
Source:
private void clusterHasGlusterVolumes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = new java.util.ArrayList < > ( ) ; volumes.add ( new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ) ; org.mockito.Mockito.when ( glusterVolumeDao.getByClusterId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( volumes ) ; }

Target:
private void clusterHasGlusterVolumes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = new java.util.ArrayList < > ( ) ; volumes.add ( new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ) ; org.mockito.Mockito.when ( glusterVolumeDao.getByClusterId ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( volumes ) ; }
Source:
public static void updateSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId , boolean smartcardEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; if ( ! smartcardEnabled ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : vmDevices ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } else if ( vmDevices.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSmartcardDevice ( vmId ) ; } }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > getSmartcardDevices ( org.ovirt.engine.core.compat.Guid vmId ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepConfigReset" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "key" , configKey ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepConfigReset" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "optionName" , configKey ) . withOptionalParameter ( "remoteUserName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void lunsMismatchListSize ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromVgInfo = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromDb = java.util.Collections.emptyList ( ) ; boolean isMismatch = command.isLunsInfoMismatch ( lunsFromVgInfo , lunsFromDb ) ; org.junit.Assert.assertTrue ( isMismatch ) ; }

Target:
public void lunsWithSameIdMismatch ( ) { org.ovirt.engine.core.dao.LunDao lunDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.LunDao.class ) ; org.mockito.Mockito.doReturn ( lunDao ) . when ( command ) . getLunDao ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs luns = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; org.mockito.Mockito.doReturn ( luns ) . when ( lunDao ) . get ( org.mockito.Matchers.anyString ( ) ) ; command.updateLunsInDb ( java.util.Collections.singletonList ( luns ) ) ; org.mockito.Mockito.verify ( lunDao , org.mockito.Mockito.times ( 1 ) ) . update ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ; }
Source:
public void setUp ( ) { org.powermock.api.mockito.PowerMockito.mockStatic ( org.ovirt.engine.core.common.config.Config.class ) ; org.powermock.api.mockito.PowerMockito.when ( org.ovirt.engine.core.common.config.Config.GetValue ( ConfigValues.HotPlugSupportedOsList ) ) . thenReturn ( "Windows2008,Windows2008x64,Windows2008R2x64,RHEL5,RHEL5x64,RHEL6,RHEL6x64" ) ; org.powermock.api.mockito.PowerMockito.when ( org.ovirt.engine.core.common.config.Config.GetValue ( ConfigValues.HotPlugEnabled , "3.1" ) ) . thenReturn ( true ) ; org.powermock.api.mockito.PowerMockito.mockStatic ( org.ovirt.engine.core.bll.VmHandler.class ) ; org.mockito.MockitoAnnotations.initMocks ( this ) ; }

Target:
public void initializeCommand ( ) { command = org.mockito.Mockito.spy ( createCommand ( ) ) ; mockVds ( ) ; org.mockito.Mockito.when ( command.getActionType ( ) ) . thenReturn ( getCommandActionType ( ) ) ; org.mockito.Mockito.doReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAO.class ) ) . when ( command ) . getVmNetworkInterfaceDAO ( ) ; }
Source:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > domainStaticEntries = getDbFacade ( ) . getStorageDomainStaticDao ( ) . getAllByStorage ( provider.getId ( ) . toString ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic domainStaticEntry : domainStaticEntries ) { getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( domainStaticEntry.getId ( ) ) ; getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( domainStaticEntry.getId ( ) ) ; } }

Target:
public long getImageVirtualSize ( java.lang.String id ) { com.woorea.openstack.glance.model.Image glanceImage = getClient ( ) . images ( ) . show ( id ) . execute ( ) ; return getImageVirtualSize ( glanceImage ) ; }
Source:
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 ) ; }

Target:
public static 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 ) ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }