auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.Permissions , org.ovirt.engine.ui.uicommonweb.models.disks.DiskListModel , org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel > getDiskPermissionListProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.webadmin.section.main.presenter.popup.PermissionsPopupPresenterWidget > popupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.RolePermissionsRemoveConfirmationPopupPresenterWidget > removeConfirmPopupProvider ) { return new org.ovirt.engine.ui.webadmin.uicommon.model.PermissionModelProvider < org.ovirt.engine.ui.uicommonweb.models.disks.DiskListModel > ( eventBus , defaultConfirmPopupProvider , removeConfirmPopupProvider , popupProvider , org.ovirt.engine.ui.uicommonweb.models.disks.DiskListModel.class ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator createValidatorForTestingValidateQosOverridden ( org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkId ( network.getId ( ) ) ; networkAttachment.setHostNetworkQos ( new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ) ; return new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( networkAttachment ) ) . addNetworks ( network ) . build ( ) ; }

Target:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator createValidatorForTestingValidateQosOverridden ( org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkId ( network.getId ( ) ) ; networkAttachment.setHostNetworkQos ( new org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos ( ) ) ; return new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( networkAttachment ) ) . addNetworks ( network ) . build ( ) ; }
Source:
private org.ovirt.engine.core.common.mode.ApplicationMode getApplicationMode ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ApplicationMode ) ) ; org.ovirt.engine.core.common.mode.ApplicationMode appMode = null ; if ( result.getSucceeded ( ) ) { appMode = org.ovirt.engine.core.common.mode.ApplicationMode.from ( ( ( java.lang.Integer ) ( result.getReturnValue ( ) ) ) ) ; } else { appMode = org.ovirt.engine.core.common.mode.ApplicationMode.AllModes ; } return appMode ; }

Target:
private org.ovirt.engine.core.common.mode.ApplicationMode getApplicationMode ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ApplicationMode , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ) ; org.ovirt.engine.core.common.mode.ApplicationMode appMode = null ; if ( result.getSucceeded ( ) ) { appMode = org.ovirt.engine.core.common.mode.ApplicationMode.from ( ( ( java.lang.Integer ) ( result.getReturnValue ( ) ) ) ) ; } else { appMode = org.ovirt.engine.core.common.mode.ApplicationMode.AllModes ; } return appMode ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof org.ovirt.engine.core.common.businessentities.network.IpConfiguration ) ) return false ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration that = ( ( org.ovirt.engine.core.common.businessentities.network.IpConfiguration ) ( o ) ) ; return java.util.Objects.equals ( getIPv4Addresses ( ) , that.getIPv4Addresses ( ) ) ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org.ovirt.engine.core.common.businessentities.network.IpConfiguration ) ) { return false ; } org.ovirt.engine.core.common.businessentities.network.IpConfiguration other = ( ( org.ovirt.engine.core.common.businessentities.network.IpConfiguration ) ( o ) ) ; return java.util.Objects.equals ( iPv4Addresses , other.iPv4Addresses ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel diskViewType = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; disksViewRadioGroup.setDiskStorageType ( ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType ) ( diskViewType.getEntity ( ) ) ) ) ; if ( ( org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.instance ( ) . getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.disks.DiskListModel ) { onDiskViewTypeChanged ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel diskViewType = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; disksViewRadioGroup.setDiskStorageType ( ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType ) ( diskViewType.getEntity ( ) ) ) ) ; if ( ( commonModelProvider.get ( ) . getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.disks.DiskListModel ) { onDiskViewTypeChanged ( ) ; } }
Source:
public void modifiedAttachmentNotRemovedAttachmentModifiedButNotRemovedValid ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( params ) . setHost ( host ) . build ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment modifiedAttachment = createNetworkAttachment ( new org.ovirt.engine.core.common.businessentities.network.Network ( ) ) ; org.junit.Assert.assertThat ( validator.modifiedAttachmentNotRemoved ( modifiedAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateQosOverriddenInterfacesWhenAttachmentDoesNotHaveQosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( networkAttachment ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void initDiskHotpluggableInterfacesMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.diskHotpluggableInterfacesMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDiskHotpluggableInterfacesMap ) , callback ) ; }

Target:
public void initDiskHotpluggableInterfacesMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { diskHotpluggableInterfacesMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDiskHotpluggableInterfacesMap ) , callback ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK_NO_DOMAIN : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK_NO_DOMAIN ; } return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK_NO_DOMAIN : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK_NO_DOMAIN ; } else if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_DISK_INITIATED : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; } return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } }
Source:
protected void executeVmCommand ( ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; if ( retValue.getSucceeded ( ) ) { monitorV2VJob ( JobStatus.WAIT_FOR_START ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" , e ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }

Target:
protected void executeVmCommand ( ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; if ( retValue.getSucceeded ( ) ) { getVdsManager ( ) . addV2VJobInfoForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) , JobStatus.WAIT_FOR_START ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" , e ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }
Source:
public void validateFailedVMHasNotDisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void validateFailedVMHasNotDisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; }
Source:
private void addHandler ( java.lang.String prefix , io.undertow.server.HttpHandler handler ) { builder.setHandler ( io.undertow.Handlers.path ( ) . addPrefixPath ( prefix , handler ) ) ; }

Target:
public void handleRequest ( io.undertow.server.HttpServerExchange exchange ) throws java.lang.Exception { if ( ! ( exchange.getRequestHeaders ( ) . getFirst ( "Authorization" ) . equals ( ( "Bearer " + ( org.ovirt.engine.sdk4.ServerTest.TOKEN ) ) ) ) ) { exchange.setStatusCode ( 401 ) ; exchange.getResponseSender ( ) . send ( "" ) ; } else { java.lang.Thread.sleep ( delay ) ; exchange.setStatusCode ( code ) ; exchange.getResponseHeaders ( ) . put ( Headers.CONTENT_TYPE , "application/xml" ) ; exchange.getResponseSender ( ) . send ( body ) ; } }
Source:
public void save ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.VdcObjectType entityType ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "job_id" , jobId ) . addValue ( "entity_id" , entityId ) . addValue ( "entity_type" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( entityType ) ) ; getCallsHandler ( ) . executeModification ( "InsertJobSubjectEntity" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.VdcObjectType entityType ) { super . save ( new org.ovirt.engine.core.common.job.JobSubjectEntity ( jobId , entityId , entityType ) ) ; }
Source:
private void initTemplateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.TEMPLATE ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }

Target:
private void initVmDiskImage ( boolean isShareable ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.VM ) ; diskImage.setShareable ( isShareable ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }
Source:
private void readNetworkItem ( org.ovirt.engine.core.compat.backendcompat.XmlNode node ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = getNetwotkInterface ( node ) ; updateSingleNic ( node , iface ) ; vmBase.getInterfaces ( ) . add ( iface ) ; readVmDevice ( node , vmBase , iface.getId ( ) , java.lang.Boolean.TRUE ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDevice readUnmanagedVmDevice ( org.ovirt.engine.core.compat.backendcompat.XmlNode node , org.ovirt.engine.core.compat.Guid deviceId ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = readVmDevice ( node , deviceId ) ; vmBase.getUnmanagedDeviceList ( ) . add ( vmDevice ) ; return vmDevice ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterQuotaListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand.equals ( getModel ( ) . getRemoveQuotaCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
private void writeAttribute ( org.ovirt.api.metamodel.concepts.Attribute attribute ) { writer.writeStartElement ( "attribute" ) ; writeCommon ( attribute ) ; writeTypeRef ( attribute.getType ( ) ) ; writer.writeEndElement ( ) ; }

Target:
private void writeStructType ( org.ovirt.api.metamodel.concepts.StructType type ) { writer.writeStartElement ( "struct" ) ; writeCommon ( type ) ; type.attributes ( ) . forEach ( this :: writeAttribute ) ; type.links ( ) . forEach ( this :: writeStructLink ) ; writer.writeEndElement ( ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { return java.util.Collections.singletonMap ( VdcObjectType.Disk.name ( ) . toLowerCase ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getDiskAlias ( ) ) ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.Disk.name ( ) . toLowerCase ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getDiskAlias ( ) ) ; jobProperties.put ( "sourcesnapshot" , getSnapshotDescriptionById ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getVmSnapshotId ( ) ) ) ; jobProperties.put ( "destinationsnapshot" , getSnapshotDescriptionById ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDestinationDiskImage ( ) . getVmSnapshotId ( ) ) ) ; } return jobProperties ; }
Source:
public void testNicExists_WhenNicNameIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicName ( null ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) . nicExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }

Target:
public void testNicExistsWhenNicNameIsNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicName ( null ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . nicExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
private org.ovirt.engine.core.common.action.VmManagementParametersBase getUpdateVmParameters ( boolean applyCpuChangesLater ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; params.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; params.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; setRngDeviceToParams ( model , params ) ; params.setApplyChangesLater ( applyCpuChangesLater ) ; setRngDeviceToParams ( model , params ) ; return params ; }

Target:
private org.ovirt.engine.core.common.action.VmManagementParametersBase getUpdateVmParameters ( boolean applyCpuChangesLater ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; params.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; params.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; setRngDeviceToParams ( model , params ) ; params.setApplyChangesLater ( applyCpuChangesLater ) ; setGraphicsDevicesToParams ( model , params ) ; return params ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > getDiskInterfaceList ( org.ovirt.engine.core.compat.Version clusterVersion ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > diskInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.DiskInterface [ ] { org.ovirt.engine.core.common.businessentities.DiskInterface.IDE , org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO } ) ) ; boolean isVirtIOScsiEnabled = ( clusterVersion != null ) ? ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.VirtIoScsiEnabled , clusterVersion.getValue ( ) ) ) ) : true ; if ( isVirtIOScsiEnabled ) { diskInterfaces.add ( DiskInterface.VirtIO_SCSI ) ; } return diskInterfaces ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > interfaces = ( ( java.util.ArrayList < java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskInterface > interfaceTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ( ) ; for ( java.lang.String diskIfs : interfaces ) { try { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.DiskInterface.valueOf ( diskIfs ) ) ; } catch ( java.lang.IllegalArgumentException e ) { } } chainedCallback.onSuccess ( model , interfaceTypes ) ; }
Source:
public void testRemoveStoragePoolIsoMap ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , existingStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , existingStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testRemoveStoragePoolIsoMap ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getStorageId ( ) , existingStoragePoolIsoMap.getStoragePoolId ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getStorageId ( ) , existingStoragePoolIsoMap.getStoragePoolId ( ) ) ) ; org.junit.Assert.assertNull ( result ) ; }
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 ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; initCdImage ( ) ; initSoundCard ( vm.getId ( ) ) ; }

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 , dataCenters , filteredClusters , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; initCdImage ( ) ; initSoundCard ( vm.getId ( ) ) ; }
Source:
public void testRemoveAllByVolumeId ( ) { dao.removeAllByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots = dao.getAllByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertTrue ( snapshots.isEmpty ( ) ) ; }

Target:
public void testRemoveAllByVolumeId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = volumeDao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertEquals ( volume.getSnapshotsCount ( ) . intValue ( ) , 2 ) ; dao.removeAllByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > snapshots = dao.getAllByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertTrue ( snapshots.isEmpty ( ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume1 = volumeDao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; org.junit.Assert.assertEquals ( volume1.getSnapshotsCount ( ) . intValue ( ) , 0 ) ; }
Source:
private boolean addInterfaceToProcessedList ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { if ( ifaceNames.contains ( iface.getName ( ) ) ) { if ( isBond ( iface ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { violations.add ( VdcBllMessages.NETWORK_INTERFACE_NAME_ALREADY_IN_USE ) ; } return false ; } ifaceNames.add ( iface.getName ( ) ) ; return true ; }

Target:
private void addViolation ( org.ovirt.engine.core.dal.VdcBllMessages violation ) { violations.add ( violation ) ; }
Source:
protected org.ovirt.engine.core.common.errors.VdcBllErrors getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.VdcBllErrors bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.forValue ( xmlRpcStatus.mCode ) ; if ( bllErrors == null ) { log.warn ( "Unexpected return value: {}" , xmlRpcStatus ) ; bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } }

Target:
protected org.ovirt.engine.core.common.errors.EngineError getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.EngineError bllErrors = org.ovirt.engine.core.common.errors.EngineError.forValue ( xmlRpcStatus.mCode ) ; if ( bllErrors == null ) { log.warn ( "Unexpected return value: {}" , xmlRpcStatus ) ; bllErrors = org.ovirt.engine.core.common.errors.EngineError.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.EngineError.unexpected ; } }
Source:
public void testListCrashClientLocale ( ) { locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) { locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } finally { locales.clear ( ) ; } }
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.core.common.businessentities.storage_domains entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainById , org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.api.model.StorageDomain entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainById , org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }
Source:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.DiskImage snapshot ) { org.ovirt.engine.core.bll.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesForDisk = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }

Target:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.storage.DiskImage snapshot ) { org.ovirt.engine.core.bll.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesForDisk = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }
Source:
private void setIsoImages ( org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.configure.ChangeCDModel > value ) { if ( ( ( ( isoImages ) == null ) && ( value != null ) ) || ( ( ( isoImages ) != null ) && ( ! ( isoImages.equals ( value ) ) ) ) ) { isoImages = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsoImages" ) ) ; } }

Target:
private void setIsoImages ( org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.configure.ChangeCDModel > value ) { if ( ( ( ( isoImages ) == null ) && ( value != null ) ) || ( ( ( isoImages ) != null ) && ( ! ( isoImages.equals ( value ) ) ) ) ) { isoImages = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsoImages" ) ) ; } }
Source:
private void initProfileNetwork ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel model ) { model.getNetwork ( ) . setItems ( java.util.Arrays.< org.ovirt.engine.core.common.businessentities.network.Network > asList ( getEntity ( ) ) ) ; model.getNetwork ( ) . setSelectedItem ( getEntity ( ) ) ; model.getNetwork ( ) . setIsChangable ( false ) ; }

Target:
private void initProfileNetwork ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel model ) { model.getNetwork ( ) . setItems ( java.util.Arrays.< org.ovirt.engine.core.common.businessentities.network.Network > asList ( getEntity ( ) ) ) ; model.getNetwork ( ) . setSelectedItem ( getEntity ( ) ) ; model.getNetwork ( ) . setIsChangeable ( false ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( p.getUsageCpuPercent ( ) ) >= ( p.getHighUtilization ( ) ) ) && ( ( p.getCpuOverCommitTimestamp ( ) ) != null ) ) && ( ( ( new java.util.Date ( ) . getTime ( ) ) - ( p.getCpuOverCommitTimestamp ( ) . getTime ( ) ) ) >= ( ( ( p.getCpuOverCommitDurationMinutes ( ) ) * 1000 ) * 60 ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( p.getUsageCpuPercent ( ) ) >= ( p.getHighUtilization ( ) ) ) && ( ( p.getCpuOverCommitTimestamp ( ) ) != null ) ) && ( ( ( new java.util.Date ( ) . getTime ( ) ) - ( p.getCpuOverCommitTimestamp ( ) . getTime ( ) ) ) >= ( ( ( ( long ) ( p.getCpuOverCommitDurationMinutes ( ) ) ) * 1000L ) * 60L ) ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { hostVersionEditor.setLabel ( constants.hostInstallHostVersionLabel ( ) ) ; isoEditor.setLabel ( constants.hostInstallIsoLabel ( ) ) ; overrideIpTablesEditor.setLabel ( constants.hostInstallOverrideIpTablesLabel ( ) ) ; activateHostAfterInstallEditor.setLabel ( constants.activateHostAfterInstallLabel ( ) ) ; authLabel.setText ( constants.hostPopupAuthLabel ( ) ) ; userNameEditor.setLabel ( constants.hostPopupUsernameLabel ( ) ) ; publicKeyEditor.setTitle ( constants.publicKeyUsage ( ) ) ; }

Target:
void localize ( ) { hostVersionEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostInstallPopupView.constants.hostInstallHostVersionLabel ( ) ) ; isoEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostInstallPopupView.constants.hostInstallIsoLabel ( ) ) ; overrideIpTablesEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostInstallPopupView.constants.hostInstallOverrideIpTablesLabel ( ) ) ; activateHostAfterInstallEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostInstallPopupView.constants.activateHostAfterInstallLabel ( ) ) ; authLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostInstallPopupView.constants.hostPopupAuthLabel ( ) ) ; userNameEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostInstallPopupView.constants.hostPopupUsernameLabel ( ) ) ; publicKeyEditor.setTitle ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.HostInstallPopupView.constants.publicKeyUsage ( ) ) ; }
Source:
public void setUp ( ) { super . setUp ( ) ; vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( diskImageId , java.lang.Boolean.FALSE ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; }

Target:
public void setUp ( ) { super . setUp ( ) ; vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( diskImageId , java.lang.Boolean.FALSE ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGroupId ) ) . thenReturn ( diskImage ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; param.setApplyChangesLater ( applyCpuChangesLater ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = getUpdateVmParameters ( applyCpuChangesLater ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void testPrefixGet ( ) throws java.lang.Exception { java.io.File file = writeConf ( "a.b=c" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.Configuration view = config.getView ( "a" ) ; org.junit.Assert.assertNotNull ( view ) ; org.junit.Assert.assertEquals ( "c" , view.getString ( "b" ) ) ; }

Target:
public void testPrefixGet ( ) throws java.lang.Exception { java.io.File file = writeConf ( "a.b=c" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.jupiter.api.Assertions.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.Configuration view = config.getView ( "a" ) ; org.junit.jupiter.api.Assertions.assertNotNull ( view ) ; org.junit.jupiter.api.Assertions.assertEquals ( "c" , view.getString ( "b" ) ) ; }
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getClusterServerMemoryOverCommit ( 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void unmanagedNetworkNotSynced ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , "net" ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; junit.framework.Assert.assertTrue ( helper.getNetworks ( ) . isEmpty ( ) ) ; }

Target:
public void unmanagedNetworkNotSynced ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , "net" ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; org.junit.Assert.assertTrue ( helper.getNetworks ( ) . isEmpty ( ) ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
private void endCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = getVmsForDiskId ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . EndAction ( VdcActionType.RemoveImage , org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) ) ; org.ovirt.engine.core.bll.VmCommand.UpdateVmInSpm ( org.ovirt.engine.core.bll.RemoveDiskCommand.getStoragePoolId ( ) . getValue ( ) , listVms ) ; org.ovirt.engine.core.bll.RemoveDiskCommand.setSucceeded ( true ) ; }

Target:
private void endCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = getVmsForDiskId ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . EndAction ( VdcActionType.RemoveImage , org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) ) ; org.ovirt.engine.core.bll.VmCommand.updateVmInSpm ( org.ovirt.engine.core.bll.RemoveDiskCommand.getStoragePoolId ( ) . getValue ( ) , listVms ) ; org.ovirt.engine.core.bll.RemoveDiskCommand.setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.core.dao.VmDao getVmDao ( ) { return vmDaoMock ; }

Target:
public void testValidateNoVM ( ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setId ( new org.ovirt.engine.core.compat.Guid ( "a09f57b1-5739-4352-bf88-a6f834ed46db" ) ) ; params.setAction ( VmWatchdogAction.PAUSE ) ; params.setModel ( vmWatchdogType ) ; final org.ovirt.engine.core.dao.VmDao vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDao.class ) ; org.ovirt.engine.core.bll.UpdateWatchdogCommand command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateWatchdogCommand ( params , null ) ) ; org.mockito.Mockito.doReturn ( vmDaoMock ) . when ( command ) . getVmDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }