auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void updateConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { super . updateConsoleModel ( item ) ; if ( ( ( item.getEntity ( ) ) != null ) && ( ( item.getDefaultConsole ( ) ) != null ) ) { item.getDefaultConsole ( ) . setForceVmStatusUp ( true ) ; } }

Target:
protected void updateConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { super . updateConsoleModel ( item ) ; if ( ( ( item.getEntity ( ) ) != null ) && ( ( item.getDefaultConsoleModel ( ) ) != null ) ) { item.getDefaultConsoleModel ( ) . setForceVmStatusUp ( true ) ; } }
Source:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public void testExecuteQueryCommand ( ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( storageDoaminId ) ; org.ovirt.engine.core.bll.GetAllDiskSnapshotsByStorageDomainIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = query.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertEquals ( "There should be two images returned" , diskImages.size ( ) , 2 ) ; org.junit.Assert.assertEquals ( "DiskImage should contain the VmSnapshotDescription" , diskImages.get ( 0 ) . getVmSnapshotDescription ( ) , snapshotDescription ) ; }

Target:
public void testExecuteQueryCommand ( ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( storageDoaminId ) ; org.ovirt.engine.core.bll.GetAllDiskSnapshotsByStorageDomainIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = query.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertEquals ( "There should be two images returned" , diskImages.size ( ) , 2 ) ; org.junit.Assert.assertEquals ( "DiskImage should contain the VmSnapshotDescription" , diskImages.get ( 0 ) . getVmSnapshotDescription ( ) , org.ovirt.engine.core.bll.GetAllDiskSnapshotsByStorageDomainIdQueryTest.snapshotDescription ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { return ( ( ( object.getVirtualCpuUsage ( ) ) == null ? "0" : object.getVirtualCpuUsage ( ) . toString ( ) ) + ( constants.outOfQuota ( ) ) ) + ( ( object.getVirtualCpu ( ) ) == ( - 1 ) ? constants.unlimitedQuota ( ) : object.getVirtualCpu ( ) . toString ( ) ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( object.getVirtualCpu ( ) ) == null ) { return "" ; } else if ( object.getVirtualCpu ( ) . equals ( QuotaVdsGroup.UNLIMITED_VCPU ) ) { return messages.unlimitedVcpuConsumption ( object.getVirtualCpuUsage ( ) ) ; } else { return messages.limitedVcpuConsumption ( object.getVirtualCpuUsage ( ) , object.getVirtualCpu ( ) ) ; } }
Source:
public void testPoolSpiceProxy ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; entity.setVmPoolSpiceProxy ( org.ovirt.engine.api.restapi.types.VmMapperTest.POOL_SPICE_PROXY ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.POOL_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }

Target:
public void testPoolSpiceProxy ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; entity.setVmPoolSpiceProxy ( org.ovirt.engine.api.restapi.types.VmMapperTest.POOL_SPICE_PROXY ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.POOL_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }
Source:
public void setSubTabPanelVisible ( boolean subTabPanelVisible ) { if ( ( this . subTabPanelVisible ) != subTabPanelVisible ) { splitPanel.clear ( ) ; if ( subTabPanelVisible ) { splitPanel.addSouth ( subTabPanelContainer , org.ovirt.engine.ui.webadmin.section.main.view.MainContentView.subTabPanelHeight ) ; splitPanel.add ( mainTabPanelContainer ) ; } else { splitPanel.add ( mainTabPanelContainer ) ; } this . subTabPanelVisible = subTabPanelVisible ; } }

Target:
public void setSubTabPanelVisible ( boolean subTabPanelVisible ) { if ( ( this . subTabPanelVisible ) != subTabPanelVisible ) { splitPanel.clear ( ) ; if ( subTabPanelVisible ) { int subTabHeight = ( splitPanel.getOffsetHeight ( ) ) / 2 ; if ( subTabHeight > ( org.ovirt.engine.ui.webadmin.section.main.view.MainContentView.subTabPanelMaxHeight ) ) { subTabHeight = org.ovirt.engine.ui.webadmin.section.main.view.MainContentView.subTabPanelMaxHeight ; } splitPanel.addSouth ( subTabPanelContainer , subTabHeight ) ; splitPanel.add ( mainTabPanelContainer ) ; } else { splitPanel.add ( mainTabPanelContainer ) ; } this . subTabPanelVisible = subTabPanelVisible ; } }
Source:
private void mockDaos ( ) { org.mockito.Mockito.doReturn ( clusterDao ) . when ( hookSyncJob ) . getClusterDao ( ) ; org.mockito.Mockito.doReturn ( hooksDao ) . when ( hookSyncJob ) . getHooksDao ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = new java.util.ArrayList < > ( ) ; clusters.add ( createCluster ( 0 ) ) ; clusters.add ( createCluster ( 1 ) ) ; org.mockito.Mockito.doReturn ( clusters ) . when ( clusterDao ) . getAll ( ) ; }

Target:
private void mockDaos ( ) { org.mockito.Mockito.doReturn ( clusterDao ) . when ( hookSyncJob ) . getClusterDao ( ) ; org.mockito.Mockito.doReturn ( hooksDao ) . when ( hookSyncJob ) . getHooksDao ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = new java.util.ArrayList < > ( ) ; clusters.add ( createCluster ( 0 ) ) ; clusters.add ( createCluster ( 1 ) ) ; org.mockito.Mockito.doReturn ( clusters ) . when ( clusterDao ) . getAll ( ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { newDR ( ) ; } else if ( command.getName ( ) . equalsIgnoreCase ( "onNewDR" ) ) { onNewDR ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { newDR ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { editDR ( ) ; } else if ( command.getName ( ) . equalsIgnoreCase ( "OnSave" ) ) { onSave ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }
Source:
public static org.ovirt.engine.core.common.action.VdcReturnValueBase canDoAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.bll.job.ExecutionContext executionContext , boolean isInternal ) { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.tasks.CommandHelper.buildCommand ( actionType , parameters , executionContext , CommandStatus.NOT_STARTED ) ; command.setInternalExecution ( isInternal ) ; return command.canDoActionOnly ( ) ; }

Target:
public static org.ovirt.engine.core.common.action.VdcReturnValueBase canDoAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.bll.job.ExecutionContext executionContext , boolean isInternal ) { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.tasks.CommandHelper.buildCommand ( actionType , parameters , executionContext , CommandStatus.NOT_STARTED ) ; command.setInternalExecution ( isInternal ) ; return command.validateOnly ( ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult notChangingManagementNetworkName ( ) { java.lang.String managementNetwork = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ; return ( getOldNetwork ( ) . getName ( ) . equals ( managementNetwork ) ) && ( ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkName ( ) . equals ( managementNetwork ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public java.lang.String getEntityNewName ( ) { return org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getParameters ( ) . getNetwork ( ) . getName ( ) ; }
Source:
private boolean executePlugOrUnplug ( org.ovirt.engine.core.common.action.PlugAction action ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = runVdsCommand ( action.getvNicVdsCommandType ( ) , new org.ovirt.engine.core.common.vdscommands.VmNicDeviceVDSParameters ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getVdsId ( ) , org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getVm ( ) , org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) , vmDevice ) ) ; return vdsReturnValue.getSucceeded ( ) ; }

Target:
private boolean executePlugOrUnplug ( org.ovirt.engine.core.common.action.PlugAction action ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = runVdsCommand ( action.getvNicVdsCommandType ( ) , new org.ovirt.engine.core.common.vdscommands.VmNicDeviceVDSParameters ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getVdsId ( ) , org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getVm ( ) , org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) , vmDevice ) ) ; updateVmDeviceWithDataReturnedFromHost ( vdsReturnValue ) ; return vdsReturnValue.getSucceeded ( ) ; }
Source:
public static void assertNoDuplicateKeys ( java.io.File file ) throws java.io.IOException { org.ovirt.engine.core.utils.NoDuplicateProperties props = new org.ovirt.engine.core.utils.NoDuplicateProperties ( ) ; try ( java.io.InputStream is = new java.io.FileInputStream ( file ) ) { props.load ( is ) ; } catch ( org.ovirt.engine.core.utils.DuplicatePropertyException exception ) { org.junit.Assert.fail ( ( ( ( "Check for duplicate keys in " + ( file.getAbsolutePath ( ) ) ) + " failed: " ) + ( exception.getMessage ( ) ) ) ) ; } }

Target:
public void testDuplicateKeys ( ) throws java.io.IOException { org.ovirt.engine.core.utils.NoDuplicateProperties props = new org.ovirt.engine.core.utils.NoDuplicateProperties ( ) ; try ( java.io.InputStream is = new java.io.FileInputStream ( file ) ) { props.load ( is ) ; } catch ( org.ovirt.engine.core.utils.DuplicatePropertyException exception ) { org.junit.Assert.fail ( ( ( ( "Check for duplicate keys in " + ( file.getAbsolutePath ( ) ) ) + " failed: " ) + ( exception.getMessage ( ) ) ) ) ; } }
Source:
public void canDoActionFailsForGlusterServerWhenNoUpServer ( ) throws java.lang.Exception { setupGlusterMock ( true , null , false ) ; org.junit.Assert.assertFalse ( commandMock.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_NO_GLUSTER_HOST_TO_PEER_PROBE.toString ( ) ) ) ; }

Target:
public void canDoActionFailsForGlusterServerWhenNoUpServer ( ) throws java.lang.Exception { setupGlusterMock ( true , null , false ) ; org.junit.Assert.assertFalse ( commandMock.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_NO_GLUSTER_HOST_TO_PEER_PROBE.toString ( ) ) ) ; }
Source:
public void testNetworkNotAttachedToHost ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.mockito.Mockito.when ( networkDaoMock.get ( network.getId ( ) ) ) . thenReturn ( network ) ; org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( org.mockito.Matchers.eq ( network.getId ( ) ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( network.getId ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkNotAttachedToHost ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.mockito.Mockito.when ( networkDaoMock.get ( network.getId ( ) ) ) . thenReturn ( network ) ; org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( org.mockito.ArgumentMatchers.eq ( network.getId ( ) ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( network.getId ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected int getNeededDiskSize ( org.ovirt.engine.core.compat.Guid storageDomainId ) { int result = 0 ; for ( org.ovirt.engine.core.common.businessentities.DiskImage img : getDiskImagesFromConfiguration ( ) ) { if ( ( img.getImageStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { if ( img.getStorageIds ( ) . get ( 0 ) . equals ( storageDomainId ) ) { result = result + ( ( int ) ( java.lang.Math.ceil ( img.getActualSize ( ) ) ) ) ; } } } return result ; }

Target:
protected boolean validateFreeSpace ( org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > snapshots = getAllImageSnapshots ( diskImage ) ; diskImage.getSnapshots ( ) . addAll ( snapshots ) ; } return validate ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) ) ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( log ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) , context ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }
Source:
public static void getAAAProfilesListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateManagementParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; javax.ws.rs.core.Response response = resource.remove ( ) ; verifyRemove ( response ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateManagementParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; javax.ws.rs.core.Response response = resource.remove ( ) ; verifyRemove ( response ) ; }
Source:
protected void setGetGuestAgentQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , getListOfVmGuestAgentInterfaces ( ) ) ; } }

Target:
protected void setGetGuestAgentQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( QueryType.GetVmGuestAgentInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , getListOfVmGuestAgentInterfaces ( ) ) ; } }
Source:
public void testAllDomainsHaveSpaceForNewDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnappableVmDisks ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
public static org.ovirt.engine.api.extensions.ExtMap fetchPrincipalRecord ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , org.ovirt.engine.api.extensions.ExtMap authRecord ) { org.ovirt.engine.api.extensions.ExtMap ret = null ; org.ovirt.engine.api.extensions.ExtMap output = extension.invoke ( new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Base.InvokeKeys.COMMAND , Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD ) . mput ( Authn.InvokeKeys.AUTH_RECORD , authRecord ) ) ; if ( ( output.< java.lang.Integer > get ( Authz.InvokeKeys.STATUS ) ) == ( Authz.Status.SUCCESS ) ) { ret = output.< org.ovirt.engine.api.extensions.ExtMap > get ( Authz.InvokeKeys.PRINCIPAL_RECORD ) ; } return ret ; }

Target:
public static org.ovirt.engine.api.extensions.ExtMap fetchPrincipalRecord ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , org.ovirt.engine.api.extensions.ExtMap authRecord ) { return org.ovirt.engine.core.aaa.AuthzUtils.fetchPrincipalRecordImpl ( extension , Authn.InvokeKeys.AUTH_RECORD , authRecord ) ; }
Source:
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 ) { java.lang.String propName = args.propertyName ; if ( ! ( "IsPowerManagementTabSelected" . equals ( propName ) ) ) { return ; } if ( model.getIsPowerManagementTabSelected ( ) ) { getView ( ) . showPowerManagement ( ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( ( ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostPopupView ) ( getView ( ) ) ) . rbProvisionedHost.getValue ( ) ) { model.getIsDiscoveredHosts ( ) . setEntity ( false ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getParameters ( ) . getHookId ( ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED ) ; return false ; } if ( ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getGlusterHooksDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getParameters ( ) . getHookId ( ) ) ) == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getParameters ( ) . getHookId ( ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED ) ; return false ; } if ( ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getGlusterHooksDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandBase.getParameters ( ) . getHookId ( ) ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST ) ; return false ; } return true ; }
Source:
public void getExternalProviderHostGroupList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalHostGroup > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostGroupsFromExternalProvider , params , aQuery ) ; }

Target:
public void getExternalProviderDiscoveredHostList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }
Source:
public void testNotExternalNetworkSucceedsForNonExternalNetwork ( ) { org.mockito.Mockito.when ( network.isExternal ( ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( validator.notExternalNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotManagementNetworkNegative ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) . thenReturn ( false ) ; org.hamcrest.MatcherAssert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void updateGraphicsInfos ( ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) , VmDeviceGeneralType.GRAPHICS ) ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getGraphicsInfos ( ) . put ( org.ovirt.engine.core.common.businessentities.GraphicsType.fromString ( vmDevice.getDevice ( ) ) , new org.ovirt.engine.core.common.businessentities.GraphicsInfo ( ) ) ; } }

Target:
protected void updateGraphicsAndDisplayInfos ( ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) , VmDeviceGeneralType.GRAPHICS ) ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getGraphicsInfos ( ) . put ( org.ovirt.engine.core.common.businessentities.GraphicsType.fromString ( vmDevice.getDevice ( ) ) , new org.ovirt.engine.core.common.businessentities.GraphicsInfo ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { loadStorageDomain ( ) ; if ( ! ( org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.isInternalExecution ( ) ) ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) ; if ( ! ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) ) { return false ; } } return true ; }

Target:
protected boolean canDoAction ( ) { loadStorageDomain ( ) ; if ( ! ( org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) ; if ( ! ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) ) { return false ; } } return true ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( org.ovirt.engine.core.bll.network.host.UpdateNetworkAttachmentCommand.getParameters ( ) . getVdsId ( ) ) ; params.getNetworkAttachments ( ) . add ( org.ovirt.engine.core.bll.network.host.UpdateNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.HostSetupNetworks , params ) ; propagateFailure ( returnValue ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( org.ovirt.engine.core.bll.network.host.UpdateNetworkAttachmentCommand.getParameters ( ) . getVdsId ( ) ) ; params.getNetworkAttachments ( ) . add ( org.ovirt.engine.core.bll.network.host.UpdateNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; org.ovirt.engine.core.common.action.ActionReturnValue returnValue = runInternalAction ( ActionType.HostSetupNetworks , params ) ; propagateFailure ( returnValue ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; }
Source:
protected void executeCommand ( ) { if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = runInternalActionWithTasksContext ( VdcActionType.RemoveImage , buildRemoveImageParameters ( getDiskImage ( ) ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { incrementVmsGeneration ( ) ; org.ovirt.engine.core.bll.RemoveDiskCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; org.ovirt.engine.core.bll.RemoveDiskCommand.setSucceeded ( true ) ; } } else { removeLunDisk ( ) ; } }

Target:
protected void executeCommand ( ) { if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = runInternalActionWithTasksContext ( VdcActionType.RemoveImage , buildRemoveImageParameters ( getDiskImage ( ) ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { incrementVmsGeneration ( ) ; org.ovirt.engine.core.bll.RemoveDiskCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; org.ovirt.engine.core.bll.RemoveDiskCommand.setSucceeded ( true ) ; } } else { removeLunDisk ( ) ; } }
Source:
public boolean isLegal ( ) { if ( useTimeout ) { java.lang.String keyForCheck = ( "" . equals ( timeoutObjectId ) ) ? logType.toString ( ) : timeoutObjectId ; synchronized ( keyForCheck.intern ( ) ) { if ( ! ( org.ovirt.engine.core.dal.utils.CacheManager.getTimeoutBaseCache ( ) . containsKey ( keyForCheck ) ) ) { org.ovirt.engine.core.dal.utils.CacheManager.getTimeoutBaseCache ( ) . put ( keyForCheck , keyForCheck , endTime , java.util.concurrent.TimeUnit.MILLISECONDS ) ; return true ; } } return false ; } return true ; }

Target:
public boolean isLegal ( ) { if ( useTimeout ) { java.lang.String key = ( "" . equals ( timeoutObjectId ) ) ? logType.toString ( ) : timeoutObjectId ; java.lang.String oldValue = org.ovirt.engine.core.dal.utils.CacheManager.getTimeoutBaseCache ( ) . putIfAbsent ( key , key , endTime , java.util.concurrent.TimeUnit.MILLISECONDS ) ; return oldValue == null ; } return true ; }
Source:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator createHostSetupNetworksValidator ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { return createHostSetupNetworksValidator ( networks , new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedBonds ( org.ovirt.engine.core.compat.Guid ... ids ) { if ( nullParameters ( ids ) ) { return this ; } if ( ( parameters.getRemovedBonds ( ) ) == null ) { parameters.setRemovedBonds ( new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ) ; } parameters.getRemovedBonds ( ) . addAll ( java.util.Arrays.asList ( ids ) ) ; return this ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > cpuList = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.ServerCpu > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) ) ; return cpuList ; } return null ; }

Target:
public java.util.List < T > convert ( java.lang.Object source ) { java.util.List < T > list = super . convert ( source ) ; java.util.Collections.sort ( list , comparator ) ; return list ; }
Source:
private void SleepOnReboot ( final org.ovirt.engine.core.common.businessentities.VDSStatus status ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ServerRebootTimeout ) ; log.info ( "Waiting seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , status ) ) ; }

Target:
private void sleepOnReboot ( final org.ovirt.engine.core.common.businessentities.VDSStatus status ) { int sleepTimeInSec = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ServerRebootTimeout ) ; log.info ( "Waiting seconds, for server to finish reboot process." , sleepTimeInSec ) ; org.ovirt.engine.core.utils.ThreadUtils.sleep ( ( sleepTimeInSec * 1000 ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.VdsCommand.getVdsId ( ) , status ) ) ; }
Source:
public void executeCommandWhenFailed ( ) { setUpMocksForRemove ( ) ; mockBackend ( false , EngineError.GlusterHookRemoveFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . remove ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_REMOVE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setUpMocksForRemove ( ) ; mockBackend ( false , EngineError.GlusterHookRemoveFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . remove ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_REMOVE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
private java.lang.String supportedVersionsToString ( java.util.Set < org.ovirt.engine.core.compat.Version > versionSet ) { if ( versionSet == null ) { return null ; } java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; boolean first = true ; for ( org.ovirt.engine.core.compat.Version version : versionSet ) { if ( first ) { first = false ; } else { sb.append ( "," ) ; } sb.append ( version.toString ( ) ) ; } return sb.toString ( ) ; }

Target:
public java.util.HashSet < org.ovirt.engine.core.compat.Version > getSupportedEngineVersionsSet ( ) { if ( ( supportedEngineVersionsSet ) == null ) { supportedEngineVersionsSet = parseSupportedVersions ( getSupportedEngines ( ) ) ; } return supportedEngineVersionsSet ; }
Source:
public void testExecuteQueryCommand ( ) { getQuery ( ) . executeQueryCommand ( ) ; java.util.Map < java.lang.String , java.lang.String > serverFingerprintMap = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertNotNull ( serverFingerprintMap ) ; org.junit.Assert.assertEquals ( EXPECTED_MAP , serverFingerprintMap ) ; }

Target:
public void testQueryFailsIfPeerExists ( ) { mockQueryParameters ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER , org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.PASSWORD ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . getByHostName ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.SERVER_NAME1 ) ; try { getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.fail ( "Query didn't fail when one or more peers already exist(s)!" ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( VdcBllMessages.SERVER_ALREADY_EXISTS_IN_ANOTHER_CLUSTER.toString ( ) , e.getMessage ( ) ) ; } }
Source:
private void auditFenceAction ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.bll.FenceExecutor.log.info ( "Executing <{}> Power Management command: Proxy Host:{}, Target Host:{}, Agent:{}, Fencing policy:{}" , action , getNameOrId ( proxyHost ) , getNameOrId ( _vds ) , agent , fencingPolicy ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = getAuditParams ( action , agent , proxyHost ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.FENCE_USING_AGENT_AND_PROXY_HOST ) ; }

Target:
private void auditFenceAction ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { org.ovirt.engine.core.bll.FenceExecutor.log.info ( "Executing <{}> Power Management command: Proxy Host:{}, Target Host:{}, Agent:{}, Fencing policy:{}" , action , getNameOrId ( proxyHost ) , getNameOrId ( _vds ) , agent , fencingPolicy ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = getAuditParams ( action , agent , proxyHost ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.FENCE_OPERATION_USING_AGENT_AND_PROXY_STARTED ) ; }
Source:
private void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.LabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.nicId , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.LABELS [ 0 ] } , valid , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.LabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.nicId , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.LABELS [ 0 ] } , valid , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void tJDBCOutput_6_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.configurationsync_3_2.ConfigurationSync.TalendException { end_Hash.put ( "tJDBCOutput_6" , java.lang.System.currentTimeMillis ( ) ) ; tJDBCInput_6_onSubJobError ( exception , errorComponent , globalMap ) ; }

Target:
public void tJDBCOutput_6_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.configurationsync_3_2.ConfigurationSync.TalendException { end_Hash.put ( "tJDBCOutput_6" , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tJDBCInput_6_onSubJobError ( exception , errorComponent , globalMap ) ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryGroup findGroupById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , java.lang.String namespace , final java.lang.String id , final boolean resolveGroups , final boolean resolveGroupsRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > groups = org.ovirt.engine.core.aaa.AuthzUtils.findGroupsByIds ( extension , namespace , java.util.Arrays.asList ( id ) , resolveGroups , resolveGroupsRecursive ) ; if ( groups.isEmpty ( ) ) { return null ; } return groups.get ( 0 ) ; }

Target:
public static java.util.List < org.ovirt.engine.api.extensions.ExtMap > findGroupRecordsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.api.extensions.ExtMap > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryGroupRecords ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.GROUP ) , groupsResolving , groupsResolvingRecursive ) ) ; } return results ; }
Source:
private void initializeMacPool ( org.ovirt.engine.core.common.businessentities.MacPool macPool ) { java.util.List < java.lang.String > macsForMacPool = getMacPoolDao ( ) . getAllMacsForMacPool ( macPool.getId ( ) ) ; final org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy pool = createPoolWithoutLocking ( macPool ) ; for ( java.lang.String mac : macsForMacPool ) { pool.forceAddMac ( mac ) ; } }

Target:
private void initializeMacPool ( org.ovirt.engine.core.common.businessentities.MacPool macPool ) { java.util.List < java.lang.String > macsForMacPool = macPoolDao.getAllMacsForMacPool ( macPool.getId ( ) ) ; final org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy pool = createPoolWithoutLocking ( macPool ) ; for ( java.lang.String mac : macsForMacPool ) { pool.forceAddMac ( mac ) ; } }
Source:
public void canRemoveBrickIfSomeBricksAreDown ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 4 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricksToRemove = new java.util.ArrayList < > ( ) ; bricksToRemove.add ( volumeEntity.getBricks ( ) . get ( 1 ) ) ; volumeEntity.getBricks ( ) . get ( 0 ) . setStatus ( GlusterStatus.DOWN ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( bricksToRemove , volumeEntity , 1 , false ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ONE_OR_MORE_BRICKS_ARE_DOWN ) ) ; }

Target:
public void canRemoveBrickIfSomeBricksAreDown ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 4 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricksToRemove = new java.util.ArrayList < > ( ) ; bricksToRemove.add ( volumeEntity.getBricks ( ) . get ( 1 ) ) ; volumeEntity.getBricks ( ) . get ( 0 ) . setStatus ( GlusterStatus.DOWN ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( bricksToRemove , volumeEntity , 1 , false ) ; org.hamcrest.MatcherAssert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ONE_OR_MORE_BRICKS_ARE_DOWN ) ) ; }
Source:
public void checkName ( ) { java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.utils.ValidNameValidatorTest.ValidNameContainer > > result = validator.validate ( new org.ovirt.engine.core.common.utils.ValidNameValidatorTest.ValidNameContainer ( name ) ) ; org.junit.Assert.assertEquals ( expectedResult , result.isEmpty ( ) ) ; }

Target:
public void checkName ( ) { org.ovirt.engine.core.common.utils.ValidNameValidatorTest.ValidNameContainer container = new org.ovirt.engine.core.common.utils.ValidNameValidatorTest.ValidNameContainer ( name ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.utils.ValidNameValidatorTest.ValidNameContainer > > result = validator.validate ( container ) ; org.junit.Assert.assertEquals ( ( "Failed to validate name: " + ( container.getName ( ) ) ) , expectedResult , result.isEmpty ( ) ) ; }
Source:
protected void setUpGetEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetTemplateInterfacesByTemplateId , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , asList ( getInterface ( 0 , null ) ) , failure ) ; } }

Target:
protected void setUpGetEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetTemplateInterfacesByTemplateId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , asList ( getInterface ( 0 , null ) ) , failure ) ; } }