auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static 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 static void getDefaultSpmPriority ( 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 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public static void GetTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static 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.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void testMoveById ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true , null , null , true ) ) ; verifyActionResponse ( resource.move ( setUpParams ( false ) ) , ( "disks/" + ( org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID ) ) , false ) ; }

Target:
public void testMoveById ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetDiskAndSnapshotsByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.MoveDisk , org.ovirt.engine.core.common.action.MoveDiskParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true , null , null , true ) ) ; verifyActionResponse ( resource.move ( setUpParams ( false ) ) , ( "disks/" + ( org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID ) ) , false ) ; }
Source:
private static org.ovirt.engine.core.compat.Version GetApplicationVersion ( final java.lang.String part , final java.lang.String appName ) { try { return new org.ovirt.engine.core.compat.RpmVersion ( part , org.ovirt.engine.core.bll.VmHandler.getAppName ( part , appName ) , true ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.VmHandler.log.debugFormat ( "Failed to create rpm version object, part: {0} appName: {1}, error: {2}" , part , appName , e.toString ( ) ) ; return null ; } }

Target:
private static org.ovirt.engine.core.compat.Version getApplicationVersion ( final java.lang.String part , final java.lang.String appName ) { try { return new org.ovirt.engine.core.compat.RpmVersion ( part , org.ovirt.engine.core.bll.VmHandler.getAppName ( part , appName ) , true ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.VmHandler.log.debugFormat ( "Failed to create rpm version object, part: {0} appName: {1}, error: {2}" , part , appName , e.toString ( ) ) ; return null ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { numaSupport ( ) ; }

Target:
public void setSelectedItem ( java.lang.Integer value ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . osNameExists ( value ) ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = ( dataCenterWithCluster == null ) ? null : dataCenterWithCluster.getCluster ( ) ; if ( cluster == null ) { return ; } super . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultOs ( cluster.getArchitecture ( ) ) ) ; } else { super . setSelectedItem ( value ) ; } }
Source:
public void testGetLunsToUpdateInDbSameLunIdDiffPvId ( ) { org.ovirt.engine.core.compat.Guid lunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.Map < org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > lunsToUpdateInDb = getLunsToUpdateInDb ( lunId , lunId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > existingLunsToUpdateInDb = lunsToUpdateInDb.get ( command.updateLunsHandler ) ; org.junit.Assert.assertEquals ( java.util.Collections.singleton ( command.updateLunsHandler ) , lunsToUpdateInDb.keySet ( ) ) ; assertLunIdInList ( existingLunsToUpdateInDb , lunId ) ; }

Target:
public void testGetLunsToUpdateInDbSameLunIdDiffPvId ( ) { org.ovirt.engine.core.compat.Guid lunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.Map < org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > lunsToUpdateInDb = getLunsToUpdateInDb ( lunId , lunId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > existingLunsToUpdateInDb = lunsToUpdateInDb.get ( command.updateLunsHandler ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.util.Collections.singleton ( command.updateLunsHandler ) , lunsToUpdateInDb.keySet ( ) ) ; assertLunIdInList ( existingLunsToUpdateInDb , lunId ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getDbFacade ( ) . getVmDao ( ) . getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( vm.getStaticData ( ) , true ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { vmHandler.updateDisksFromDb ( vm ) ; vmHandler.updateVmInitFromDB ( vm.getStaticData ( ) , true ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }
Source:
protected void updateLinkChangability ( ) { boolean isNullProfileSelected = ( getProfile ( ) . getSelectedItem ( ) ) == null ; if ( isNullProfileSelected ) { getLinked ( ) . setIsChangable ( false ) ; return ; } if ( ! ( hotUpdateSupported ) ) { getLinked ( ) . setIsChangable ( false ) ; return ; } getLinked ( ) . setIsChangable ( true ) ; }

Target:
protected void updateLinkChangability ( ) { boolean isNullProfileSelected = ( getProfile ( ) . getSelectedItem ( ) ) == null ; if ( isNullProfileSelected ) { getLinked ( ) . setIsChangeable ( false ) ; return ; } if ( ! ( hotUpdateSupported ) ) { getLinked ( ) . setIsChangeable ( false ) ; return ; } getLinked ( ) . setIsChangeable ( true ) ; }
Source:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getGlusterVolumeOptionInfoList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeOptionsInfo , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters params = new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( ) ; params.setFilterOutExistingHosts ( filterOutExistingHosts ) ; params.setProviderId ( providerId ) ; params.setSearchFilter ( searchFilter ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , params , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public org.ovirt.engine.sdk.decorators.HostNIC update ( java.lang.Boolean async ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; if ( async != null ) { urlBuilder.add ( "async" , async , UrlParameterType.MATRIX ) ; } url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.HostNIC.class , org.ovirt.engine.sdk.decorators.HostNIC.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.HostHostNic update ( java.lang.Boolean async ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; if ( async != null ) { urlBuilder.add ( "async" , async , UrlParameterType.MATRIX ) ; } url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.HostNic.class , org.ovirt.engine.sdk.decorators.HostHostNic.class , headers ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isCompatibleWithOs ( ) { java.util.List < java.lang.String > networkDevices = getOsRepository ( ) . getNetworkDevices ( osId , version ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > interfaceTypes = new java.util.ArrayList < > ( ) ; for ( java.lang.String networkDevice : networkDevices ) { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.valueOf ( networkDevice ) ) ; } return ! ( interfaceTypes.contains ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.forValue ( nic.getType ( ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_INTERFACE_TYPE_IS_NOT_SUPPORTED_BY_OS ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isCompatibleWithOs ( ) { java.util.List < java.lang.String > networkDevices = getOsRepository ( ) . getNetworkDevices ( osId , version ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > interfaceTypes = new java.util.ArrayList < > ( ) ; for ( java.lang.String networkDevice : networkDevices ) { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.valueOf ( networkDevice ) ) ; } return ! ( interfaceTypes.contains ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.forValue ( nic.getType ( ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_INTERFACE_TYPE_IS_NOT_SUPPORTED_BY_OS ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmNextRunConfiguration ( 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.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void cantDowngradeIfMixedTypesNotSupported ( ) { storagePoolVersion35 ( ) ; cmd.getStoragePool ( ) . setCompatibilityVersion ( Version.v3_3 ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sdISCI = createStorageDomain ( StorageFormatType.V3 , StorageType.ISCSI ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sdNFS = createStorageDomain ( StorageFormatType.V3 , StorageType.NFS ) ; setAttachedDomains ( sdISCI , sdNFS ) ; canDoActionFailed ( EngineMessage.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; }

Target:
public void cantDowngradeIfMixedTypesNotSupported ( ) { storagePoolVersion35 ( ) ; cmd.getStoragePool ( ) . setCompatibilityVersion ( Version.v3_3 ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sdISCI = createStorageDomain ( StorageFormatType.V3 , StorageType.ISCSI ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sdNFS = createStorageDomain ( StorageFormatType.V3 , StorageType.NFS ) ; setAttachedDomains ( sdISCI , sdNFS ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkVmListModel > getNetworkVmModelProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector ) { return new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkVmListModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel.class , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkVmListModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.networks.NetworkVmListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
private org.ovirt.engine.core.common.action.ImagesContainterParametersBase buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.DiskImage snapshotCinderDisk ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase createParams = new org.ovirt.engine.core.common.action.ImagesContainterParametersBase ( snapshotCinderDisk.getImageId ( ) ) ; createParams.setDestinationImageId ( snapshotCinderDisk.getImageId ( ) ) ; createParams.setStorageDomainId ( snapshotCinderDisk.getStorageIds ( ) . get ( 0 ) ) ; createParams.setParentHasTasks ( isContainImages ( ) ) ; return withRootCommandInfo ( createParams , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getActionType ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks ) { org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters ( ) ; createParams.setCinderDisks ( cinderDisks ) ; createParams.setParentHasTasks ( isContainImages ( ) ) ; createParams.setParentCommand ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getActionType ( ) ) ; createParams.setParentParameters ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getParameters ( ) ) ; return createParams ; }
Source:
void sendRequest ( com.google.gwt.http.client.RequestBuilder requestBuilder , org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.RestApiCallback callback ) { try { requestBuilder.sendRequest ( null , callback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { } }

Target:
com.google.gwt.http.client.RequestBuilder createRequest ( java.lang.String engineAuthToken ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , restApiSessionTimeout ) ; java.lang.String preferValue = "persistent-auth, csrf-protection" ; if ( engineAuthToken != null ) { preferValue += ", new-auth" ; builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.ENGINE_AUTH_TOKEN_HEADER , engineAuthToken ) ; } builder.setHeader ( "Prefer" , preferValue ) ; java.lang.String sessionId = getSessionId ( ) ; if ( sessionId != null ) { builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_HEADER , sessionId ) ; } return builder ; }
Source:
public boolean isLink ( java.lang.Object object ) { for ( java.lang.reflect.Method m : object.getClass ( ) . getMethods ( ) ) { java.lang.System.out.println ( m.getName ( ) ) ; if ( m.getName ( ) . contains ( "href" ) ) { return true ; } } return false ; }

Target:
public boolean isLink ( java.lang.Object object ) { if ( object instanceof org.ovirt.engine.sdk.types.Identified ) { return ( ( ( org.ovirt.engine.sdk.types.Identified ) ( object ) ) . href ( ) ) != null ; } return false ; }
Source:
protected void mockInterfaceList ( ) { java.util.ArrayList < java.lang.String > diskInterfaces = new java.util.ArrayList < > ( java.util.Arrays.asList ( new java.lang.String [ ] { "IDE" , "VirtIO" , "VirtIO_SCSI" } ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getDiskInterfaces ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( diskInterfaces ) ; }

Target:
protected void mockInterfaceList ( ) { java.util.ArrayList < java.lang.String > diskInterfaces = new java.util.ArrayList < > ( java.util.Arrays.asList ( new java.lang.String [ ] { "IDE" , "VirtIO" , "VirtIO_SCSI" } ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( diskInterfaces ) ; }
Source:
public java.util.List getSupportedENGINEsList ( ) { java.util.List resultList = lst ( ) ; resultList.add ( "3.0" ) ; resultList.add ( "3.1" ) ; resultList.add ( "3.2" ) ; resultList.add ( "3.3" ) ; resultList.add ( "3.4" ) ; resultList.add ( "3.5" ) ; resultList.add ( "3.6" ) ; return resultList ; }

Target:
public java.util.List getSupportedENGINEsList ( ) { java.util.List resultList = lst ( ) ; resultList.add ( "3.0" ) ; resultList.add ( "3.1" ) ; resultList.add ( "3.2" ) ; resultList.add ( "3.3" ) ; resultList.add ( "3.4" ) ; resultList.add ( "3.5" ) ; resultList.add ( "3.6" ) ; resultList.add ( "4.0" ) ; return resultList ; }
Source:
protected void init ( T parameters ) { super . init ( parameters ) ; setVmTemplateId ( parameters.getContainerId ( ) ) ; parameters.setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.VmTemplate , org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ) ; imageToDestinationDomainMap = org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getParameters ( ) . getImageToDestinationDomainMap ( ) ; imageFromSourceDomainMap = new java.util.HashMap < > ( ) ; }

Target:
protected void init ( T parameters ) { super . init ( parameters ) ; setVmTemplateId ( parameters.getContainerId ( ) ) ; parameters.setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.VmTemplate , org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ) ; imageToDestinationDomainMap = org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getParameters ( ) . getImageToDestinationDomainMap ( ) ; imageFromSourceDomainMap = new java.util.HashMap < > ( ) ; }
Source:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getConnection ( ) . getId ( ) ; org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getStorageServerConnectionDao ( ) . remove ( connectionId ) ; log.info ( "Removing connection '{}' from database " , connectionId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) ) ) { log.info ( "No vdsId passed - hosts will not be disconnected." ) ; } else { org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; } org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getConnection ( ) . getId ( ) ; storageServerConnectionDao.remove ( connectionId ) ; log.info ( "Removing connection '{}' from database " , connectionId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) ) ) { log.info ( "No vdsId passed - hosts will not be disconnected." ) ; } else { org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; } org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , networkDao , provider ) ) ; org.mockito.Mockito.when ( networkDao.getAllForProvider ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( networks ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , networkDao , clusterDao , provider ) ) ; org.mockito.Mockito.when ( networkDao.getAllForProvider ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( networks ) ; org.mockito.Mockito.when ( clusterDao.getAllClustersByDefaultNetworkProviderId ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( clusters ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void testCanDoSuccessOnAddFloatingDiskWithPlugUnset ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( false ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public final void initialize ( ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { if ( initialized ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.error ( "Trying to initialize multiple times." ) ; return ; } final java.util.List < org.ovirt.engine.core.common.businessentities.MacPool > macPools = getMacPoolDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : macPools ) { initializeMacPool ( macPool ) ; } initialized = true ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.info ( "successfully initialized" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.error ( "not initialized." ) ; throw e ; } }

Target:
public final void initialize ( ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { if ( initialized ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.error ( "Trying to initialize multiple times." ) ; return ; } final java.util.List < org.ovirt.engine.core.common.businessentities.MacPool > macPools = getMacPoolDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : macPools ) { initializeMacPool ( macPool ) ; } initialized = true ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.info ( "Successfully initialized" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.error ( "Error initializing: {}" , e.getMessage ( ) ) ; throw e ; } }
Source:
public void vmNotHavingPassthroughVnicsValid ( ) { vmNotHavingPassthroughVnicsCommon ( vm.getId ( ) , 0 , 2 ) ; assertThatVmNotHavingPassthroughVnics ( true ) ; }

Target:
public void setUp ( ) { vm = createVm ( ) ; validator = new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) ) . thenReturn ( vmNetworkInterfaceDao ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVnicProfileDao ( ) ) . thenReturn ( vnicProfileDao ) ; }
Source:
protected void openDocumentation ( T model ) { java.lang.String helpTag = model.getHelpTag ( ) . name ; java.lang.String documentationPath = org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.getPath ( helpTag ) ; java.lang.String documentationLibURL = model.getConfigurator ( ) . getDocumentationLibURL ( ) ; org.ovirt.engine.ui.common.utils.WebUtils.openUrlInNewWindow ( "_blank" , ( documentationLibURL + documentationPath ) , WebUtils.OPTION_SCROLLBARS ) ; }

Target:
protected void openDocumentation ( T model ) { java.lang.String helpTag = model.getHelpTag ( ) . name ; java.lang.String documentationPath = org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager.getPath ( helpTag ) ; java.lang.String documentationLibURL = model.getConfigurator ( ) . getDocumentationLibURL ( ) ; org.ovirt.engine.ui.common.utils.WebUtils.openUrlInNewWindow ( "_blank" , ( documentationLibURL + documentationPath ) , WebUtils.OPTION_SCROLLBARS ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Network > getAll ( ) { java.util.Map < java.lang.String , java.lang.Object > dbResults = dialect.createJdbcCallForQuery ( jdbcTemplate ) . withProcedureName ( "GetAllFromnetwork" ) . returningResultSet ( "RETURN_VALUE" , org.ovirt.engine.core.dao.NetworkDAODbFacadeImpl.NetworkRowMapper.instance ) . execute ( getCustomMapSqlParameterSource ( ) ) ; return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Network > ) ( dbResults.get ( "RETURN_VALUE" ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Network > getAll ( org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return getCallsHandler ( ) . executeReadList ( "GetAllFromnetwork" , org.ovirt.engine.core.dao.NetworkDAODbFacadeImpl.NetworkRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ) ; }
Source:
private void initVmDiskImage ( boolean isShareable ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.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 ) ; }

Target:
private void initTemplateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.TEMPLATE ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }
Source:
public void glusterServiceNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.GLUSTER_NOT_SUPPORTED , "compatibilityVersion" , null ) ) ; }

Target:
public void glusterServiceNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.GLUSTER_NOT_SUPPORTED , "compatibilityVersion" , null ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVdsGroup , org.ovirt.engine.core.common.action.VdsGroupOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpManagementNetworkExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVdsGroup , org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; final org.ovirt.engine.api.model.Cluster updatedCluster = resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; verifyModel ( updatedCluster , 0 ) ; verifyManagementNetwork ( updatedCluster ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmParameters parameters = new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return runInternalActionWithTasksContext ( VdcActionType.AddVmFromScratch , parameters ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmParameters parameters = new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic ) ; parameters.setDiskInfoList ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) ) ; parameters.setStorageDomainId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return runInternalActionWithTasksContext ( VdcActionType.AddVmFromScratch , parameters ) ; }
Source:
protected void listenOnConsoleModelChangeEvent ( com.google.gwt.event.shared.EventBus eventBus , final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { eventBus.addHandler ( org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.getType ( ) , new org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.ConsoleModelChangedHandler ( ) { @ java.lang.Override public void onConsoleModelChanged ( org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent event ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupConsole ( modelProvider ) ; } } ) ; }

Target:
private void listenOnConsoleClientResourcesAnchor ( ) { registerHandler ( getView ( ) . getConsoleClientResourcesAnchor ( ) . addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gwt.user.client.Window.open ( dynamicMessages.consoleClientResourcesUrl ( ) , "_blank" , null ) ; } } ) ) ; }
Source:
public void diskPluggedToVmsCheckSnapshotsFail ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vmsInfo = prepareForCheckingIfDiskPluggedToVmsThatAreNotDown ( ) ; vmsInfo.get ( 1 ) . getFirst ( ) . setStatus ( VMStatus.Up ) ; vmsInfo.get ( 1 ) . getSecond ( ) . setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskPluggedToVmsThatAreNotDown ( true , vmsInfo ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) ; }

Target:
public void testDiskAttachedToAnyNonDownVM ( ) { org.junit.Assert.assertThat ( validator.isDiskPluggedToAnyNonDownVm ( false ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void onFailureTryNextAgent ( ) { mockExecutor ( agent1 , false ) ; mockExecutor ( agent2 , true ) ; mockCheckStatus ( "on" ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getSucceeded ( ) ) ; }

Target:
public void onFailureAlertShown ( ) { mockExecutor ( false ) ; try { command.executeCommand ( ) ; org.junit.Assert.fail ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException ex ) { org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 3 ) ) . log ( org.mockito.Matchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; } }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendedVmDynamic ( org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct ) ; adjustDisplayIp ( vmDynamic.getGraphicsInfos ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > arg0 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > arg1 ) { int compareValue = arg0.getSecond ( ) . getVdsGroupName ( ) . compareTo ( arg1.getSecond ( ) . getVdsGroupName ( ) ) ; if ( compareValue != 0 ) { return compareValue ; } return arg0.getSecond ( ) . getName ( ) . compareTo ( arg1.getSecond ( ) . getName ( ) ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > arg0 , org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > arg1 ) { int compareValue = arg0.getSecond ( ) . getClusterName ( ) . compareTo ( arg1.getSecond ( ) . getClusterName ( ) ) ; if ( compareValue != 0 ) { return compareValue ; } return arg0.getSecond ( ) . getName ( ) . compareTo ( arg1.getSecond ( ) . getName ( ) ) ; }
Source:
public void testRemoveQuota ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = dao.getById ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ; org.junit.Assert.assertNotNull ( quota ) ; dao.remove ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ; org.junit.Assert.assertEquals ( null , dao.getById ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ) ; org.junit.Assert.assertEquals ( 0 , dao.getQuotaClusterByQuotaGuid ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) . size ( ) ) ; org.junit.Assert.assertEquals ( 0 , dao.getQuotaStorageByQuotaGuid ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) . size ( ) ) ; }

Target:
public void testRemoveQuota ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = dao.getById ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ; org.junit.Assert.assertNotNull ( quota ) ; dao.remove ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ; org.junit.Assert.assertNull ( dao.getById ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ) ; org.junit.Assert.assertEquals ( 0 , dao.getQuotaClusterByQuotaGuid ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) . size ( ) ) ; org.junit.Assert.assertEquals ( 0 , dao.getQuotaStorageByQuotaGuid ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) . size ( ) ) ; }
Source:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.VDS server ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters nonOpParams = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( server.getId ( ) , org.ovirt.engine.core.common.businessentities.NonOperationalReason.GLUSTER_COMMAND_FAILED ) ; nonOpParams.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , nonOpParams , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.VDS server ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters nonOpParams = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( server.getId ( ) , org.ovirt.engine.core.common.businessentities.NonOperationalReason.GLUSTER_COMMAND_FAILED , java.util.Collections.singletonMap ( GlusterConstants.COMMAND , "gluster peer probe" ) ) ; nonOpParams.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , nonOpParams , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
private void mockOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository mockOsRepository = control.createMock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.easymock.EasyMock.expect ( mockOsRepository.getUniqueOsNames ( ) ) . andReturn ( new java.util.HashMap < java.lang.Integer , java.lang.String > ( ) ) . anyTimes ( ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , mockOsRepository ) ; }

Target:
private void mockOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository mockOsRepository = control.createMock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.easymock.EasyMock.expect ( mockOsRepository.getUniqueOsNames ( ) ) . andReturn ( new java.util.HashMap < java.lang.Integer , java.lang.String > ( ) ) . anyTimes ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , mockOsRepository ) ; }