auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void testConnectionMountOptionsValidations ( org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String mountOptions , boolean shouldSucceed ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createConnection ( storageType , mountOptions ) ; params.setStorageServerConnection ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidationResult result = command.validateMountOptions ( ) ; if ( shouldSucceed ) { org.junit.Assert.assertTrue ( result.isValid ( ) ) ; } else { org.junit.Assert.assertThat ( result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) ; } }

Target:
private void testConnectionMountOptionsValidations ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String mountOptions , boolean shouldSucceed ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createConnection ( storageType , mountOptions ) ; params.setStorageServerConnection ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidationResult result = command.validateMountOptions ( ) ; if ( shouldSucceed ) { org.junit.Assert.assertTrue ( result.isValid ( ) ) ; } else { org.junit.Assert.assertThat ( result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > searchVDSsByDb ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVdsDAO ( ) , true , new org.ovirt.engine.core.common.utils.ListUtils.Filter < org.ovirt.engine.core.common.businessentities.VDS > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data ) { for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getcpu_flags ( ) , vds.getvds_group_compatibility_version ( ) ) ) ; } return data ; } } ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > searchVDSsByDb ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVdsDao ( ) , true , new org.ovirt.engine.core.common.utils.ListUtils.Filter < org.ovirt.engine.core.common.businessentities.VDS > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data ) { for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getcpu_flags ( ) , vds.getvds_group_compatibility_version ( ) ) ) ; } return data ; } } ) ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { lvNameEditor.setLabel ( constants.logicalVolume ( ) ) ; mountPointEditor.setLabel ( constants.mountPoint ( ) ) ; sizeEditor.setLabel ( constants.lvSize ( ) ) ; raidTypeEditor.setLabel ( constants.raidType ( ) ) ; noOfPhysicalDisksEditor.setLabel ( constants.noOfPhysicalDisksInRaidVolume ( ) ) ; stripeSizeEditor.setLabel ( constants.stripeSize ( ) ) ; deviceHeader.setText ( constants.storageDevices ( ) ) ; deviceSelectionInfo.setText ( constants.getStorageDeviceSelectionInfo ( ) ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { lvNameEditor.setLabel ( constants.logicalVolume ( ) ) ; mountPointEditor.setLabel ( constants.mountPoint ( ) ) ; sizeEditor.setLabel ( constants.lvSize ( ) ) ; raidParamsLabel.setText ( constants.raidParameters ( ) ) ; raidTypeEditor.setLabel ( constants.raidType ( ) ) ; noOfPhysicalDisksEditor.setLabel ( constants.noOfPhysicalDisksInRaidVolume ( ) ) ; stripeSizeLabel.setText ( constants.stripeSize ( ) ) ; deviceHeader.setText ( constants.storageDevices ( ) ) ; }
Source:
protected void removeVmNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces = getVmNicDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMac ( iface.getMacAddress ( ) ) ; } } }

Target:
protected void removeVmNetwork ( ) { if ( ( getInterfaces ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : getInterfaces ( ) ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMac ( iface.getMacAddress ( ) ) ; } } }
Source:
public void testLogReturnLogsWhenLogLevelActiveAndExpandReturnButNullReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.ovirt.engine.core.utils.log.Log log = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.log.Log.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) , null ) ; org.mockito.Mockito.verify ( log ) . debugFormat ( org.mockito.Matchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) ) ; }

Target:
public void testLogReturnLogsWhenLogLevelActiveAndExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . debug ( org.mockito.Matchers.eq ( LoggedUtils.EXIT_LOG_RETURN_VALUE ) , new java.lang.Object [ ] { org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) } ) ; }
Source:
protected void UpdatePagingAvailability ( ) { getSearchNextPageCommand ( ) . setIsExecutionAllowed ( ( ( getSearchNextPageCommand ( ) . getIsAvailable ( ) ) && ( getNextSearchPageAllowed ( ) ) ) ) ; getSearchPreviousPageCommand ( ) . setIsExecutionAllowed ( ( ( getSearchPreviousPageCommand ( ) . getIsAvailable ( ) ) && ( getPreviousSearchPageAllowed ( ) ) ) ) ; }

Target:
protected void updatePagingAvailability ( ) { getSearchNextPageCommand ( ) . setIsExecutionAllowed ( ( ( getSearchNextPageCommand ( ) . getIsAvailable ( ) ) && ( getNextSearchPageAllowed ( ) ) ) ) ; getSearchPreviousPageCommand ( ) . setIsExecutionAllowed ( ( ( getSearchPreviousPageCommand ( ) . getIsAvailable ( ) ) && ( getPreviousSearchPageAllowed ( ) ) ) ) ; }
Source:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }

Target:
private void setUpGetBallooningExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , true ) ; } }
Source:
protected javax.ws.rs.core.Response performCreation ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { return performCreation ( task , taskParams , entityResolver , expectBlocking ( ) , suggestedParentType ) ; }

Target:
protected final < T > javax.ws.rs.core.Response performCreate ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { return performCreate ( task , taskParams , entityResolver , expectBlocking ( ) , suggestedParentType ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.vm_pools mockVMPoolsFromDAO ( org.ovirt.engine.core.compat.Guid requestedUser ) { org.ovirt.engine.core.common.businessentities.vm_pools expectedPool = new org.ovirt.engine.core.common.businessentities.vm_pools ( ) ; org.ovirt.engine.core.dao.VmPoolDAO vmDaoPoolMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmPoolDAO.class ) ; org.mockito.Mockito.when ( vmDaoPoolMock.getAllForUser ( requestedUser ) ) . thenReturn ( java.util.Collections.singletonList ( expectedPool ) ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmPoolDao ( ) ) . thenReturn ( vmDaoPoolMock ) ; return expectedPool ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmPool mockVMPoolsFromDAO ( org.ovirt.engine.core.compat.Guid requestedUser ) { org.ovirt.engine.core.common.businessentities.VmPool expectedPool = new org.ovirt.engine.core.common.businessentities.VmPool ( ) ; org.ovirt.engine.core.dao.VmPoolDAO vmDaoPoolMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmPoolDAO.class ) ; org.mockito.Mockito.when ( vmDaoPoolMock.getAllForUser ( requestedUser ) ) . thenReturn ( java.util.Collections.singletonList ( expectedPool ) ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmPoolDao ( ) ) . thenReturn ( vmDaoPoolMock ) ; return expectedPool ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ( vds.getcpu_cores ( ) ) != null ) && ( ( getVm ( ) . getnum_of_cpus ( ) ) > ( vds.getcpu_cores ( ) ) ) ) { sb.append ( "has less cores(" ) . append ( vds.getcpu_cores ( ) ) . append ( ") than " ) . append ( getVm ( ) . getnum_of_cpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ( vds.getcpu_cores ( ) ) != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > ( vds.getcpu_cores ( ) ) ) ) { sb.append ( "has less cores(" ) . append ( vds.getcpu_cores ( ) ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }
Source:
public java.lang.Boolean call ( ) throws java.lang.Exception { if ( ( _vds.isPmKdumpDetection ( ) ) && ( ! ( fenceKdumpSupported ) ) ) { _messages.post ( InstallerMessages.Severity.WARNING , "Kdump detection is not supported by host!" ) ; } _parser.cliEnvironmentSet ( KdumpEnv.ENABLE , ( ( _vds.isPmKdumpDetection ( ) ) && ( fenceKdumpSupported ) ) ) ; return true ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { if ( ( _vds.isPmKdumpDetection ( ) ) && ( ! ( fenceKdumpSupported ) ) ) { _messages.post ( InstallerMessages.Severity.INFO , "Disabling Kdump integration" ) ; } _parser.cliEnvironmentSet ( KdumpEnv.ENABLE , ( ( _vds.isPmKdumpDetection ( ) ) && ( fenceKdumpSupported ) ) ) ; return true ; }
Source:
public void testUpdate ( ) { existingDynamic.setactual_size ( ( ( existingDynamic.getactual_size ( ) ) * 10 ) ) ; dao.update ( existingDynamic ) ; org.ovirt.engine.core.common.businessentities.DiskImageDynamic result = dao.get ( existingDynamic.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingDynamic , result ) ; }

Target:
public void testUpdate ( ) { existingDynamic.setactual_size ( ( ( existingDynamic.getactual_size ( ) ) * 10 ) ) ; dao.update ( existingDynamic ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic result = dao.get ( existingDynamic.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingDynamic , result ) ; }
Source:
protected void handleAsynchrony ( org.ovirt.engine.core.common.action.ActionReturnValue result , R model ) { model.setCreationStatus ( getAsynchronousStatus ( result ) . value ( ) ) ; linkSubResource ( model , org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.CREATION_STATUS_REL , asString ( result.getVdsmTaskIdList ( ) ) ) ; }

Target:
protected void handleAsynchrony ( org.ovirt.engine.core.common.action.ActionReturnValue result , R model ) { org.ovirt.engine.api.model.CreationStatus status = getAsynchronousStatus ( result ) ; if ( status != null ) { model.setCreationStatus ( status.value ( ) ) ; } linkSubResource ( model , org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.CREATION_STATUS_REL , asString ( result.getVdsmTaskIdList ( ) ) ) ; }
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:
private void addMemoryDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage memoryDisk = org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryDiskForVm ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) , org.ovirt.engine.core.bll.HibernateVmCommand.getStorageDomain ( ) . getStorageType ( ) ) ; addDisk ( memoryDisk ) ; }
Source:
public static org.ovirt.engine.core.bll.CommandBase < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > [ ] data ( ) { return new org.ovirt.engine.core.bll.CommandBase < ? > [ ] { new org.ovirt.engine.core.bll.CreateSnapshotCommand ( new org.ovirt.engine.core.common.action.ImagesActionsParametersBase ( ) ) , new org.ovirt.engine.core.bll.AddImageFromScratchCommand ( new org.ovirt.engine.core.common.action.AddImageFromScratchParameters ( ) ) , new org.ovirt.engine.core.bll.CreateImageTemplateCommand ( new org.ovirt.engine.core.common.action.CreateImageTemplateParameters ( ) ) , new org.ovirt.engine.core.bll.CreateCloneOfTemplateCommand ( new org.ovirt.engine.core.common.action.CreateCloneOfTemplateParameters ( ) ) , new org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand ( new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( ) ) { @ java.lang.Override protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { } } } ; }

Target:
protected void initStoragePoolId ( ) { }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGlusterHookListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getDisableHookCommand ( ) ) ) { return confirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
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:
private void fireAsyncOperationCompleteEvent ( java.lang.Object target ) { org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , target ) ; }
Source:
protected void runAddAndVerify ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , boolean addMacResult , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.when ( macPoolManager.AddMac ( iface.getMacAddress ( ) ) ) . thenReturn ( addMacResult ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , false ) ; verifyAddDelegatedCorrectly ( iface , addMacVerification ) ; }

Target:
protected void runAddAndVerify ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , boolean addMacResult , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.when ( macPoolManager.addMac ( iface.getMacAddress ( ) ) ) . thenReturn ( addMacResult ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , false ) ; verifyAddDelegatedCorrectly ( iface , addMacVerification ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.ENTITY , Schema.Entities.GROUP ) . mput ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , args.get ( "group" ) ) . mput ( Schema.SharedKeys.REMOVE_GROUP , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.putUserEditKeys ( context , args ) ; if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
public void init ( org.ovirt.engine.core.common.businessentities.StorageDomain sourceStorageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > repoImages ) { this . sourceStorageDomain = sourceStorageDomain ; setRepoImages ( repoImages ) ; updateDataCenters ( ) ; }

Target:
public void init ( org.ovirt.engine.core.common.businessentities.StorageDomain sourceStorageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > repoImages ) { this . sourceStorageDomain = sourceStorageDomain ; setRepoImages ( repoImages ) ; updateDataCenters ( ) ; org.ovirt.engine.ui.uicompat.IEventListener importAsTemplateListener = new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateClusterEnabled ( ) ; } } ; getImportAsTemplate ( ) . getEntityChangedEvent ( ) . addListener ( importAsTemplateListener ) ; }
Source:
public void addNotEmptyIdConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; newPosixConnection.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY ) ; }

Target:
public void addNotEmptyIdConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; newPosixConnection.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection , null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY ) ; }
Source:
protected boolean validateVM ( org.ovirt.engine.core.bll.validator.VmValidator vmValidator ) { return ( canDoSnapshot ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) ) && ( validate ( vmValidator.vmNotSavingRestoring ( ) ) ) ; }

Target:
protected boolean validateVM ( org.ovirt.engine.core.bll.validator.VmValidator vmValidator ) { org.ovirt.engine.core.bll.validator.LiveSnapshotValidator validator = new org.ovirt.engine.core.bll.validator.LiveSnapshotValidator ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getStoragePool ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVds ( ) ) ; return ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . isDown ( ) ) || ( validate ( validator.canDoSnapshot ( ) ) ) ) && ( validate ( vmValidator.vmNotSavingRestoring ( ) ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel tagListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnVal = result.getReturnValue ( ) ; boolean success = ( returnVal != null ) && ( returnVal.getSucceeded ( ) ) ; if ( success ) { tagListModel.getSearchCommand ( ) . Execute ( ) ; } tagListModel.Cancel ( ) ; tagListModel.StopProgress ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel tagListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnVal = result.getReturnValue ( ) ; boolean success = ( returnVal != null ) && ( returnVal.getSucceeded ( ) ) ; if ( success ) { tagListModel.getSearchCommand ( ) . execute ( ) ; } tagListModel.cancel ( ) ; tagListModel.stopProgress ( ) ; }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; }

Target:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
public void testGetCdInterface ( ) throws java.lang.Exception { org.junit.Assert.assertTrue ( OsRepositoryImpl.INSTANCE.getCdInterface ( 777 , null ) . equals ( org.ovirt.engine.core.utils.OsRepositoryImplTest.CD_INTERFACE ) ) ; }

Target:
public void testGetCdInterface ( ) throws java.lang.Exception { org.junit.Assert.assertTrue ( OsRepositoryImpl.INSTANCE.getCdInterface ( 777 , null , null ) . equals ( "ide" ) ) ; org.junit.Assert.assertTrue ( OsRepositoryImpl.INSTANCE.getCdInterface ( 777 , null , ChipsetType.I440FX ) . equals ( "ide" ) ) ; org.junit.Assert.assertTrue ( OsRepositoryImpl.INSTANCE.getCdInterface ( 777 , null , ChipsetType.Q35 ) . equals ( "sata" ) ) ; }
Source:
public void testAddLabelToNicAndValidateWhenUsingValidLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; java.util.List < java.lang.Class < ? > > validationGroups = java.util.Arrays.< java.lang.Class < ? > > asList ( javax.validation.groups.Default.class , org.ovirt.engine.core.common.validation.group.UpdateEntity.class , org.ovirt.engine.core.common.validation.group.CreateEntity.class ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . addLabelToNicAndValidate ( "ok" , validationGroups ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testInterfaceIsValidSlaveWhenInterfaceIsBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setBonded ( true ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }
Source:
public void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { this . command = command ; command.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateButton ( ) ; } } ) ; updateButton ( ) ; }

Target:
public void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { this . command = command ; command.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { updateButton ( ) ; } } ) ; updateButton ( ) ; }
Source:
public void canDoActionFailsOnNullCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( null , org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommandTest.HOOK_ID ) ) ) ; setupMocks ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
public void validateSuccessFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskValidator.isDiskInterfaceSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.mockito.Mockito.when ( command.getDiskValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.Disk.class ) ) ) . thenReturn ( diskValidator ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }

Target:
public void validateFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskValidator.isDiskInterfaceSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.mockito.Mockito.when ( command.getDiskValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.Disk.class ) ) ) . thenReturn ( diskValidator ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; model.setDataCentersAndClusters ( model , java.util.Arrays.asList ( dataCenter ) , clusters , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterByArchitecture ( clusters , vm.getClusterArch ( ) ) ; model.setDataCentersAndClusters ( model , java.util.Arrays.asList ( dataCenter ) , filteredClusters , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; }
Source:
public void validateVmShareableDisk ( ) { initStorageDomain ( srcStorageId ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; }

Target:
public void validateVmShareableDisk ( ) { initStorageDomain ( srcStorageId ) ; initStorageDomain ( dstStorageId ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; }
Source:
public org.ovirt.engine.api.model.CdRom update ( org.ovirt.engine.api.model.CdRom resource ) { if ( ( org.ovirt.engine.api.common.util.QueryHelper.hasConstraint ( getUriInfo ( ) . getQueryParameters ( ) , org.ovirt.engine.api.restapi.resource.BackendCdRomResource.CURRENT_CONSTRAINT_PARAMETER ) ) || ( org.ovirt.engine.api.common.util.QueryHelper.hasMatrixParam ( getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.BackendCdRomResource.CURRENT_CONSTRAINT_PARAMETER ) ) ) { validateParameters ( resource , requiredUpdateFields ) ; performAction ( VdcActionType.ChangeDisk , new org.ovirt.engine.core.common.action.ChangeDiskCommandParameters ( getEntity ( entityResolver , true ) . getId ( ) , resource.getFile ( ) . getId ( ) ) ) ; return resource ; } else { return super . update ( resource ) ; } }

Target:
public org.ovirt.engine.api.model.CdRom update ( org.ovirt.engine.api.model.CdRom resource ) { if ( org.ovirt.engine.api.common.util.QueryHelper.hasCurrentConstraint ( getUriInfo ( ) ) ) { validateParameters ( resource , requiredUpdateFields ) ; performAction ( VdcActionType.ChangeDisk , new org.ovirt.engine.core.common.action.ChangeDiskCommandParameters ( getEntity ( entityResolver , true ) . getId ( ) , resource.getFile ( ) . getId ( ) ) ) ; return resource ; } else { return super . update ( resource ) ; } }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getDateCreatedColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractFullDateTimeColumn < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override protected java.util.Date getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getCreationDate ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getDateCreatedColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractFullDateTimeColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) { @ java.lang.Override protected java.util.Date getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getCreationDate ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
private void loadCurrentClusterManagementNetwork ( ) { final org.ovirt.engine.ui.frontend.AsyncQuery getManagementNetworkQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel clusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( model ) ) ; final org.ovirt.engine.core.common.businessentities.network.Network managementNetwork = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( returnValue ) ) ; clusterModel.getManagementNetwork ( ) . setSelectedItem ( managementNetwork ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getManagementNetwork ( getManagementNetworkQuery , getEntity ( ) . getId ( ) ) ; }

Target:
private void loadCurrentClusterManagementNetwork ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getManagementNetwork ( new org.ovirt.engine.ui.uicommonweb.models.clusters.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.businessentities.network.Network > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.businessentities.network.Network managementNetwork1 ) { getManagementNetwork ( ) . setSelectedItem ( managementNetwork1 ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void AddUserMessageByVds ( org.ovirt.engine.core.compat.Guid vdsId , java.lang.String userMessage ) { java.util.List < org.ovirt.engine.core.compat.Guid > users = new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDynamic vm : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . getAllRunningForVds ( vdsId ) ) { org.ovirt.engine.core.bll.UserMessageController.AddVmUsersToList ( users , vm.getId ( ) ) ; } AddUsersMessages ( users , userMessage ) ; }

Target:
public void AddUserMessageByVds ( org.ovirt.engine.core.compat.Guid vdsId , java.lang.String userMessage ) { java.util.List < org.ovirt.engine.core.compat.Guid > users = new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDynamic vm : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . getAllRunningForVds ( vdsId ) ) { org.ovirt.engine.core.bll.UserMessageController.AddVmUsersToList ( users , vm.getId ( ) ) ; } AddUsersMessages ( users , userMessage ) ; }
Source:
private void DataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.DataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }

Target:
private void dataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }
Source:
public void run ( ) { org.ovirt.engine.core.common.businessentities.Tags result = dao.get ( existing.getTagId ( ) ) ; org.junit.Assert.assertEquals ( existing , result ) ; }

Target:
public void testGetSameID ( ) throws java.lang.Exception { final org.ovirt.engine.core.common.businessentities.Tags existing = dao.get ( org.ovirt.engine.core.dao.MultiThreadedDaoTest.EXISTING_TAGS_IDS [ 0 ] ) ; createAndRunThreadsForRunner ( ( ) -> { org.ovirt.engine.core.common.businessentities.Tags result = dao.get ( existing.getTagId ( ) ) ; org.junit.Assert.assertEquals ( existing , result ) ; } , 100 ) ; }
Source:
public void setSearchString ( java.lang.String value , boolean checkIfNewValue ) { if ( ( ! checkIfNewValue ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( searchString , value ) ) ) ) { searchString = value ; SearchStringChanged ( ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "SearchString" ) ) ; } }

Target:
public void setLoggedInUser ( org.ovirt.engine.core.common.users.VdcUser value ) { if ( ( loggedInUser ) != value ) { loggedInUser = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "LoggedInUser" ) ) ; } }
Source:
public void testUserTagLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TAG_ID ) ; tag.setUser ( new org.ovirt.engine.api.model.User ( ) ) ; tag.getUser ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.USER_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( tag ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.USER_TAG_HREF , tag.getHref ( ) ) ; }

Target:
public void testUserTagLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TAG_ID ) ; tag.setUser ( new org.ovirt.engine.api.model.User ( ) ) ; tag.getUser ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.USER_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( tag ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.USER_TAG_HREF , tag.getHref ( ) ) ; }
Source:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveVmParameters params = new org.ovirt.engine.core.common.action.MoveVmParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } return doAction ( VdcActionType.ExportVmTemplate , params , action , PollingType.JOB ) ; }

Target:
public javax.ws.rs.core.Response export ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.common.action.MoveOrCopyParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyParameters ( guid , getStorageDomainId ( action ) ) ; if ( ( action.isSetExclusive ( ) ) && ( action.isExclusive ( ) ) ) { params.setForceOverride ( true ) ; } return doAction ( VdcActionType.ExportVmTemplate , params , action , PollingType.JOB ) ; }
Source:
public void getManagementNetworkName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ManagementNetwork , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
public void canDoActionImagesNotFound ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }