auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStaticDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getId ( ) ) ; return duplicateVm == null ? true : failCanDoAction ( VdcBllMessages.VM_CANNOT_IMPORT_VM_EXISTS , java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; }

Target:
protected boolean validateNoDuplicateVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic duplicateVm = org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStaticDao ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getId ( ) ) ; return duplicateVm == null ? true : failCanDoAction ( EngineMessage.VM_CANNOT_IMPORT_VM_EXISTS , java.lang.String.format ( "$VmName %1$s" , duplicateVm.getName ( ) ) ) ; }
Source:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

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

Target:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 0 ) ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void getDataCenterMaxNameLength ( 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 ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

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

Target:
public void execute ( ) { final org.ovirt.engine.ui.common.widget.panel.AlertPanel alert = createAlert ( type , message ) ; attachAlert ( alert ) ; if ( autoHideMs > 0 ) { final com.google.gwt.user.client.Timer timer = new com.google.gwt.user.client.Timer ( ) { @ java.lang.Override public void run ( ) { detachAlert ( alert ) ; } } ; alert.getWidget ( ) . addCloseHandler ( new org.gwtbootstrap3.client.shared.event.AlertCloseHandler ( ) { @ java.lang.Override public void onClose ( org.gwtbootstrap3.client.shared.event.AlertCloseEvent evt ) { timer.cancel ( ) ; } } ) ; timer.schedule ( autoHideMs ) ; } }
Source:
private void setupCanImportPpcTest ( ) { setupDiskSpaceTest ( ) ; cmd.getParameters ( ) . getVm ( ) . setClusterArch ( ArchitectureType.ppc64 ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setArchitecture ( ArchitectureType.ppc64 ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; }

Target:
private void setupCanImportPpcTest ( ) { setupDiskSpaceTest ( ) ; cmd.getParameters ( ) . getVm ( ) . setClusterArch ( ArchitectureType.ppc64 ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setArchitecture ( ArchitectureType.ppc64 ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.anyMap ( ) ) ; }
Source:
protected void Refresh ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; super . SyncSearch ( VdcQueryType.GetAllAuditLogsByVMName , new org.ovirt.engine.core.common.queries.GetAllAuditLogsByVMNameParameters ( vm.getvm_name ( ) ) ) ; }

Target:
protected void refreshModel ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; super . SyncSearch ( VdcQueryType.GetAllAuditLogsByVMName , new org.ovirt.engine.core.common.queries.GetAllAuditLogsByVMNameParameters ( vm.getvm_name ( ) ) ) ; }
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 ) { optimizationForServerFormatter ( object ) ; }

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.core.common.migration.MigrationPolicy selectedPolicy = object.getMigrationPolicies ( ) . getSelectedItem ( ) ; if ( selectedPolicy != null ) { migrationPolicyDetails.setHTML ( org.ovirt.engine.ui.webadmin.section.main.view.popup.cluster.ClusterPopupView.templates.migrationPolicyDetails ( selectedPolicy.getName ( ) , selectedPolicy.getDescription ( ) ) ) ; } else { migrationPolicyDetails.setText ( "" ) ; } }
Source:
private boolean isVmInterfacesConfigured ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfacesMap ) { if ( interfacesMap.containsKey ( StringUtils.EMPTY ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; return false ; } return true ; }

Target:
private boolean isVmInterfacesConfigured ( ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface nic : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getInterfaces ( ) ) { if ( ( nic.getNetworkName ( ) ) == null ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmNicValidator.networkLinkingSupported ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; return false ; } else { return true ; } } } return true ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( IVdcQueryable quota ) { boolean quotaExceeded = false ; if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaStorage ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaStorage ) ( quota ) ) ) ; } else if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ) ( quota ) ) ) ; } if ( quotaExceeded ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.webadmin.widget.table.column.QuotaUtilizationStatusColumn.constants.quotaExceeded ( ) ) ; } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( IVdcQueryable quota ) { boolean quotaExceeded = false ; if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaStorage ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaStorage ) ( quota ) ) ) ; } else if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaCluster ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaCluster ) ( quota ) ) ) ; } if ( quotaExceeded ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.webadmin.widget.table.column.QuotaUtilizationStatusColumn.constants.quotaExceeded ( ) ) ; } return null ; }
Source:
private boolean isDomainAttachedToDifferentStoragePool ( ) { if ( ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) { for ( org.ovirt.engine.core.compat.Guid storageDomainId : org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getParameters ( ) . getStorages ( ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStorageDomainDao ( ) . get ( storageDomainId ) ; if ( ( domain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( isStorageDomainAttachedToStoragePool ( domain ) ) ) { return failCanDoAction ( VdcBllMessages.ERROR_CANNOT_ADD_STORAGE_DOMAIN_WITH_ATTACHED_DATA_DOMAIN ) ; } } } return true ; }

Target:
private boolean isDomainAttachedToDifferentStoragePool ( ) { if ( ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) { for ( org.ovirt.engine.core.compat.Guid storageDomainId : org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getParameters ( ) . getStorages ( ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStorageDomainDao ( ) . get ( storageDomainId ) ; if ( ( domain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( isStorageDomainAttachedToStoragePool ( domain ) ) ) { return failCanDoAction ( EngineMessage.ERROR_CANNOT_ADD_STORAGE_DOMAIN_WITH_ATTACHED_DATA_DOMAIN ) ; } } } return true ; }
Source:
public void setSearchStringPrefix ( java.lang.String searchStringPrefix ) { searchStringPrefixLabel.setText ( searchStringPrefix ) ; oracle.setSearchPrefix ( searchStringPrefix ) ; int searchStringInputWidth = ( org.ovirt.engine.ui.webadmin.section.main.view.SearchPanelView.SEARCH_PANEL_WIDTH ) - ( searchStringPrefixLabel.getElement ( ) . getOffsetWidth ( ) ) ; searchStringInput.getElement ( ) . getStyle ( ) . setWidth ( searchStringInputWidth , Unit.PX ) ; }

Target:
public void setSearchString ( java.lang.String searchString ) { if ( ( org.ovirt.engine.ui.uicompat.external.StringUtils.isNotEmpty ( searchString ) ) && ( searchString.trim ( ) . toUpperCase ( ) . startsWith ( searchStringPrefixLabel.getText ( ) . toUpperCase ( ) ) ) ) { searchStringInput.setText ( searchString.trim ( ) . substring ( searchStringPrefixLabel.getText ( ) . length ( ) ) ) ; } else { searchStringInput.setText ( searchString ) ; } }
Source:
public java.lang.String PriorityToString ( int value ) { int highPriority = org.ovirt.engine.ui.uicommonweb.DataProvider.GetMaxVmPriority ( ) ; int roundedPriority = org.ovirt.engine.ui.uicommonweb.DataProvider.RoundPriority ( value ) ; if ( roundedPriority == 1 ) { return "Low" ; } else if ( roundedPriority == ( ( org.ovirt.engine.ui.uicommonweb.DataProvider.GetMaxVmPriority ( ) ) / 2 ) ) { return "Medium" ; } else if ( roundedPriority == ( org.ovirt.engine.ui.uicommonweb.DataProvider.GetMaxVmPriority ( ) ) ) { return "High" ; } else { return "Unknown" ; } }

Target:
public java.lang.String PriorityToString ( int value ) { int highPriority = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaxVmPriority ( ) ; int roundedPriority = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.RoundPriority ( value ) ; if ( roundedPriority == 1 ) { return "Low" ; } else if ( roundedPriority == ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaxVmPriority ( ) ) / 2 ) ) { return "Medium" ; } else if ( roundedPriority == ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaxVmPriority ( ) ) ) { return "High" ; } else { return "Unknown" ; } }
Source:
void forceRefresh ( M model ) { if ( ( model instanceof org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) && ( ! ( model.getLastExecutedCommand ( ) . getIsCancel ( ) ) ) ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableList = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableList.getForceRefreshCommand ( ) . execute ( ) ; } }

Target:
void forceRefresh ( M model ) { if ( model instanceof org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) { org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand = model.getLastExecutedCommand ( ) ; if ( ( lastExecutedCommand != null ) && ( ! ( lastExecutedCommand.getIsCancel ( ) ) ) ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableList = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableList.forceRefresh ( ) ; } } }
Source:
public void testUpdateWithExistingNetwork ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setGetVmQueryExpectations ( 2 ) ; setGetNetworksQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( true ) ) ; assertNotNull ( nic ) ; }

Target:
public void testUpdateWithExistingNetwork ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setGetVmQueryExpectations ( 2 ) ; setGetNetworksQueryExpectations ( 2 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( true ) ) ; assertNotNull ( nic ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid getVdsIdInGroup ( ) { if ( ( ( vdsInPool ) == null ) && ( ( org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVdsGroup ( ) ) != null ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsInPoolList = org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVdsDAO ( ) . getAllForVdsGroupWithStatus ( org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVdsGroup ( ) . getId ( ) , VDSStatus.Up ) ; if ( ! ( vdsInPoolList.isEmpty ( ) ) ) { vdsInPool = vdsInPoolList.get ( 0 ) . getId ( ) ; } } return vdsInPool ; }

Target:
protected org.ovirt.engine.core.compat.Guid getVdsIdInGroup ( ) { if ( ( ( vdsInPool ) == null ) && ( ( org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVdsGroup ( ) ) != null ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsInPoolList = org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVdsDao ( ) . getAllForVdsGroupWithStatus ( org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVdsGroup ( ) . getId ( ) , VDSStatus.Up ) ; if ( ! ( vdsInPoolList.isEmpty ( ) ) ) { vdsInPool = vdsInPoolList.get ( 0 ) . getId ( ) ; } } return vdsInPool ; }
Source:
private void setUpVlanQueryExpectations ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface hostNicModel ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlans = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; vlan.setNetworkName ( "some network name" ) ; vlans.add ( vlan ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllChildVlanInterfaces , org.ovirt.engine.core.common.queries.GetAllChildVlanInterfacesQueryParameters.class , new java.lang.String [ ] { "VdsId" , "Interface" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , hostNicModel } , vlans ) ; }

Target:
private void setUpVlanQueryExpectations ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface hostNicModel ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlans = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; vlan.setNetworkName ( "some network name" ) ; vlans.add ( vlan ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllChildVlanInterfaces , org.ovirt.engine.core.common.queries.GetAllChildVlanInterfacesQueryParameters.class , new java.lang.String [ ] { "Id" , "Interface" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , hostNicModel } , vlans ) ; }
Source:
void mockGetCaCertificate ( ) { org.mockito.Mockito.doReturn ( caCertificateReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetCACertificate ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( caCertificateReturnValue ) . getSucceeded ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.CA_CERTIFICATE ) . when ( caCertificateReturnValue ) . getReturnValue ( ) ; }

Target:
void mockGetCaCertificate ( ) { org.mockito.Mockito.doReturn ( caCertificateReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( VdcQueryType.GetCACertificate ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( caCertificateReturnValue ) . getSucceeded ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.CA_CERTIFICATE ) . when ( caCertificateReturnValue ) . getReturnValue ( ) ; }
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
protected void executeVmCommand ( ) { super . executeVmCommand ( ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . setVmtGuid ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . getStaticData ( ) . setQuotaId ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getParameters ( ) . getVmStaticData ( ) . getQuotaId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStaticDao ( ) . update ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . getStaticData ( ) ) ; if ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getTaskIdList ( ) . isEmpty ( ) ) { org.ovirt.engine.core.bll.AddVmFromTemplateCommand.endSuccessfully ( ) ; } checkTrustedService ( ) ; }

Target:
protected void executeVmCommand ( ) { super . executeVmCommand ( ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . setVmtGuid ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . getStaticData ( ) . setQuotaId ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getParameters ( ) . getVmStaticData ( ) . getQuotaId ( ) ) ; vmStaticDao.update ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVm ( ) . getStaticData ( ) ) ; if ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getTaskIdList ( ) . isEmpty ( ) ) { org.ovirt.engine.core.bll.AddVmFromTemplateCommand.endSuccessfully ( ) ; } checkTrustedService ( ) ; }
Source:
public void testValidationFailsWhenVmHasDisksPluggedWithScsiReservation ( ) { org.mockito.Mockito.doReturn ( vmValidator ) . when ( command ) . getVmValidator ( ) ; org.mockito.Mockito.when ( vmValidator.isVmPluggedDiskNotUsingScsiReservation ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION ) ; }

Target:
public void testValidationFailsWhenVmHasDisksPluggedWithScsiReservation ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . logValidationFailed ( ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( command ) . getVmValidator ( ) ; org.mockito.Mockito.when ( vmValidator.isVmPluggedDiskNotUsingScsiReservation ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION ) ; }
Source:
public void setTestResultImage ( java.lang.String errorMessage ) { testResultImage.setResource ( ( errorMessage.isEmpty ( ) ? resources.logNormalImage ( ) : resources.logErrorImage ( ) ) ) ; testResultImage.setStylePrimaryName ( style.testResultImage ( ) ) ; testResultMessage.setText ( ( errorMessage.isEmpty ( ) ? constants.testSuccessMessage ( ) : errorMessage ) ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel model ) { setAgentTabVisibility ( model.getNeutronAgentModel ( ) . isPluginConfigurationAvailable ( ) . getEntity ( ) ) ; driver.edit ( model ) ; neutronAgentWidget.edit ( model.getNeutronAgentModel ( ) ) ; vmwarePropertiesWidget.edit ( model.getVmwarePropertiesModel ( ) ) ; }
Source:
public java.lang.String getThemeStyleSheet ( java.lang.String applicationName ) { return brandingProperties.getProperty ( ( applicationName + ( org.ovirt.engine.core.branding.BrandingTheme.CSS_POST_FIX ) ) ) ; }

Target:
public java.util.List < java.lang.String > getThemeStylesheets ( java.lang.String applicationName ) { java.util.List < java.lang.String > ret = null ; final java.lang.String cssFiles = brandingProperties.getProperty ( ( applicationName + ( org.ovirt.engine.core.branding.BrandingTheme.CSS_POST_FIX ) ) ) ; if ( cssFiles == null ) { org.ovirt.engine.core.branding.BrandingTheme.log.warn ( "Theme '{}' has no property defined for key '{}'" , this . getPath ( ) , ( applicationName + ( org.ovirt.engine.core.branding.BrandingTheme.CSS_POST_FIX ) ) ) ; } else { ret = java.util.Arrays.asList ( cssFiles.split ( "\\s*,\\s*" ) ) ; } return ret ; }
Source:
private boolean isVmInterfacesAttachedToVmNetworks ( final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , java.util.Set < java.lang.String > interfaceNetworkNames ) { java.util.List < java.lang.String > nonVmNetworkNames = org.ovirt.engine.core.utils.NetworkUtils.filterNonVmNetworkNames ( clusterNetworks , interfaceNetworkNames ) ; if ( ( nonVmNetworkNames.size ( ) ) > 0 ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NOT_A_VM_NETWORK ) ; addCanDoActionMessage ( java.lang.String.format ( "$networks %1$s" , org.apache.commons.lang.StringUtils.join ( nonVmNetworkNames , "," ) ) ) ; return false ; } return true ; }

Target:
protected java.util.List < org.ovirt.engine.core.compat.Guid > getVdsWhiteList ( ) { return null ; }
Source:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.volumeSnapshotCreate" ) . withOptionalParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withParameter ( "description" , description ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void updateMinAllocatedMemory ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( getModel ( ) . getCluster ( ) . getSelectedItem ( ) ) ) ; if ( cluster == null ) { return ; } double overCommitFactor = 100.0 / ( cluster.getmax_vds_memory_over_commit ( ) ) ; getModel ( ) . getMinAllocatedMemory ( ) . setEntity ( ( ( int ) ( ( ( java.lang.Integer ) ( getModel ( ) . getMemSize ( ) . getEntity ( ) ) ) * overCommitFactor ) ) ) ; }

Target:
public void updateMinAllocatedMemory ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( getModel ( ) . getSelectedCluster ( ) ) ) ; if ( cluster == null ) { return ; } double overCommitFactor = 100.0 / ( cluster.getmax_vds_memory_over_commit ( ) ) ; getModel ( ) . getMinAllocatedMemory ( ) . setEntity ( ( ( int ) ( ( ( java.lang.Integer ) ( getModel ( ) . getMemSize ( ) . getEntity ( ) ) ) * overCommitFactor ) ) ) ; }
Source:
public void updateTimeoutLogableObject ( ) { int eventFloodRate = ( ( event.isExternal ( ) ) && ( ( event.getEventFloodInSec ( ) ) == 0 ) ) ? 30 : logType.getEventFloodRate ( ) ; if ( eventFloodRate > 0 ) { setEndTime ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( eventFloodRate ) ) ; timeoutObjectId = composeObjectId ( ) ; } }

Target:
private void updateTimeoutLogableObject ( ) { int eventFloodRate = ( ( event.isExternal ( ) ) && ( ( event.getEventFloodInSec ( ) ) == 0 ) ) ? 30 : logType.getEventFloodRate ( ) ; if ( eventFloodRate > 0 ) { setEndTime ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( eventFloodRate ) ) ; timeoutObjectId = composeObjectId ( ) ; } else { timeoutObjectId = "" ; } }
Source:
public void testAddUser3 ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDomainList , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpDomains ( ) ) ; setUpAddUserExpectations ( ( ( ( "ADUSER@" + ( DOMAIN ) ) + ":: username=" ) + ( NAMES [ 0 ] ) ) ) ; org.ovirt.engine.api.model.User model = new org.ovirt.engine.api.model.User ( ) ; model.setUserName ( ( ( ( NAMES [ 0 ] ) + "@" ) + ( DOMAIN ) ) ) ; javax.ws.rs.core.Response response = collection.add ( model ) ; verifyAddUser ( response ) ; }

Target:
public void testAddUser3 ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetDomainList , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpDomains ( ) ) ; setUpAddUserExpectations ( ( ( ( "ADUSER@" + ( DOMAIN ) ) + ":: username=" ) + ( NAMES [ 0 ] ) ) ) ; org.ovirt.engine.api.model.User model = new org.ovirt.engine.api.model.User ( ) ; model.setUserName ( ( ( ( NAMES [ 0 ] ) + "@" ) + ( DOMAIN ) ) ) ; javax.ws.rs.core.Response response = collection.add ( model ) ; verifyAddUser ( response ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static java.lang.String [ ] GetADPathList ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ComputerADPaths ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) . split ( "[;]" , ( - 1 ) ) ; } return new java.lang.String [ ] { } ; }

Target:
public static java.lang.String [ ] GetADPathList ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ComputerADPaths , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) . split ( "[;]" , ( - 1 ) ) ; } return new java.lang.String [ ] { } ; }
Source:
public void testDetachFailure ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , false , false ) ; try { javax.ws.rs.core.Response response = resource.remove ( ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testDetachFailure ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , false , false ) ; try { javax.ws.rs.core.Response response = resource.remove ( ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.VDS [ ] data ( ) { org.ovirt.engine.core.common.businessentities.VDS vds1 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds2 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds2.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds3 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds3.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds3.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return new org.ovirt.engine.core.common.businessentities.VDS [ ] { vds1 , vds2 , vds3 } ; }

Target:
public static java.util.stream.Stream < org.ovirt.engine.core.common.businessentities.VDS > vdsCloned ( ) { org.ovirt.engine.core.common.businessentities.VDS vds1 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds2 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds2.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds3 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds3.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds3.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return java.util.stream.Stream.of ( vds1 , vds2 , vds3 ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue writePubKeysReturnValue = runVdsCommand ( VDSCommandType.UpdateGlusterGeoRepKeys , new org.ovirt.engine.core.common.vdscommands.gluster.UpdateGlusterGeoRepKeysVDSParameters ( getParameters ( ) . getId ( ) , getParameters ( ) . getPubKeys ( ) , getParameters ( ) . getRemoteUserName ( ) ) ) ; setSucceeded ( writePubKeysReturnValue.getSucceeded ( ) ) ; if ( ! ( writePubKeysReturnValue.getSucceeded ( ) ) ) { handleVdsError ( AuditLogType.GLUSTER_GEOREP_PUBLIC_KEY_WRITE_FAILED , writePubKeysReturnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.vdscommands.VDSReturnValue writePubKeysReturnValue = runVdsCommand ( VDSCommandType.UpdateGlusterGeoRepKeys , new org.ovirt.engine.core.common.vdscommands.gluster.UpdateGlusterGeoRepKeysVDSParameters ( getParameters ( ) . getId ( ) , getParameters ( ) . getPubKeys ( ) , getParameters ( ) . getRemoteUserName ( ) ) ) ; setSucceeded ( writePubKeysReturnValue.getSucceeded ( ) ) ; if ( ! ( writePubKeysReturnValue.getSucceeded ( ) ) ) { propagateFailure ( convertToVdcReturnValueBase ( writePubKeysReturnValue ) ) ; return ; } }
Source:
protected void SyncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getGlusterHooks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > glusterHooks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ) ( returnValue ) ) ; setItems ( glusterHooks ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getGlusterHooks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > glusterHooks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ) ( returnValue ) ) ; setItems ( glusterHooks ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.action.LabelUnlabelUiAction getLabelUnlabelUiAction ( ) { return new org.ovirt.engine.ui.uicommonweb.action.LabelUnlabelUiAction ( hostSetupNetworksParametersData.addedLabels , hostSetupNetworksParametersData.removedLabels , hostSetupNetworksParametersData.removedBonds , getEntity ( ) . getId ( ) , this ) ; }

Target:
public org.ovirt.engine.core.common.action.HostSetupNetworksParameters createHostSetupNetworksParameters ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters result = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( getEntity ( ) . getId ( ) ) ; result.setNetworkAttachments ( hostSetupNetworksParametersData.newOrModifiedNetworkAttachments ) ; result.setRemovedNetworkAttachments ( new java.util.HashSet ( org.ovirt.engine.core.common.businessentities.Entities.getIds ( hostSetupNetworksParametersData.removedNetworkAttachments ) ) ) ; result.setBonds ( hostSetupNetworksParametersData.newOrModifiedBonds ) ; result.setRemovedBonds ( new java.util.HashSet ( org.ovirt.engine.core.common.businessentities.Entities.getIds ( hostSetupNetworksParametersData.removedBonds ) ) ) ; result.setRemovedUnmanagedNetworks ( hostSetupNetworksParametersData.removedUnmanagedNetworks ) ; result.setLabels ( hostSetupNetworksParametersData.addedLabels ) ; result.setRemovedLabels ( org.ovirt.engine.core.common.businessentities.Entities.objectNames ( hostSetupNetworksParametersData.removedLabels ) ) ; return result ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeProfileInfoVDSCommand.getBroker ( ) . glusterVolumeProfileInfo ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeProfileInfoVDSCommand.getParameters ( ) . getClusterId ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeProfileInfoVDSCommand.getParameters ( ) . getVolumeName ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeProfileInfoVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( result.getGlusterVolumeProfileInfo ( ) ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeProfileInfoVDSCommand.getBroker ( ) . glusterVolumeProfileInfo ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeProfileInfoVDSCommand.getParameters ( ) . getClusterId ( ) , org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeProfileInfoVDSCommand.getParameters ( ) . getVolumeName ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeProfileInfoVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( result.getGlusterVolumeProfileInfo ( ) ) ; }
Source:
public void testFindMappingEntryEmptySourceVnicProfile ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setNetworkName ( null ) ; vnic.setVnicProfileName ( null ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( java.util.Collections.singletonList ( emptySourceMapping ) ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.Assert.assertThat ( ctx.getMatched ( ) . get ( vnic ) , org.hamcrest.Matchers.sameInstance ( emptySourceMapping ) ) ; }

Target:
public void testFindMappingEntryEmptySourceVnicProfile ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setNetworkName ( null ) ; vnic.setVnicProfileName ( null ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( java.util.Collections.singletonList ( emptySourceMapping ) ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.hamcrest.MatcherAssert.assertThat ( ctx.getMatched ( ) . get ( vnic ) , org.hamcrest.Matchers.sameInstance ( emptySourceMapping ) ) ; }