auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ; return org.powermock.api.mockito.PowerMockito.spy ( command ) ; }

Target:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaCommandLeftOver ( ) ; mockVmRunHandler ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockVmPropertiesUtils ( ) ; mockBackend ( ) ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel , org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel > getPoolVmListProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector ) { return new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel , org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel.class , org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel , org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel > getPoolVmListProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector , final com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.RemoveConfirmationPopupPresenterWidget > removeConfirmPopupProvider ) { return new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel , org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel.class , org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel.class ) { @ java.lang.Override public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getDetachCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } } } ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addNetworkInterfaceDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , boolean plugged ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , VmDeviceGeneralType.INTERFACE , VmDeviceType.BRIDGE , java.util.Collections.< java.lang.String , java.lang.Object > emptyMap ( ) , plugged , false , null ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addNetworkInterfaceDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , boolean plugged , boolean hostDev ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , VmDeviceGeneralType.INTERFACE , ( hostDev ? org.ovirt.engine.core.common.utils.VmDeviceType.HOST_DEVICE : org.ovirt.engine.core.common.utils.VmDeviceType.BRIDGE ) , java.util.Collections.< java.lang.String , java.lang.Object > emptyMap ( ) , plugged , false , null , false ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllRoles , org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpRoles ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllRoles , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpRoles ( ) , failure ) ; control.replay ( ) ; }
Source:
protected javax.ws.rs.core.Response doAdd ( org.ovirt.engine.api.model.Snapshot snapshot , boolean block ) { validateParameters ( snapshot , "description" ) ; org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters snapshotParams = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( parentId , snapshot.getDescription ( ) ) ; if ( snapshot.isSetPersistMemorystate ( ) ) { snapshotParams.setSaveMemory ( snapshot.isPersistMemorystate ( ) ) ; } return performCreate ( VdcActionType.CreateAllSnapshotsFromVm , snapshotParams , new org.ovirt.engine.api.restapi.resource.BackendSnapshotsResource.SnapshotIdResolver ( ) , block ) ; }

Target:
protected javax.ws.rs.core.Response doAdd ( org.ovirt.engine.api.model.Snapshot snapshot , boolean block ) { validateParameters ( snapshot , "description" ) ; org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters snapshotParams = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( parentId , snapshot.getDescription ( ) ) ; if ( snapshot.isSetPersistMemorystate ( ) ) { snapshotParams.setSaveMemory ( snapshot.isPersistMemorystate ( ) ) ; } if ( snapshot.isSetDisks ( ) ) { snapshotParams.setDisks ( mapDisks ( snapshot.getDisks ( ) ) ) ; } return performCreate ( VdcActionType.CreateAllSnapshotsFromVm , snapshotParams , new org.ovirt.engine.api.restapi.resource.BackendSnapshotsResource.SnapshotIdResolver ( ) , block ) ; }
Source:
private static java.util.HashMap < java.lang.String , java.lang.Object > getNewMonitorSpecParams ( ) { java.util.HashMap < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; specParams.put ( "vram" , VmDeviceCommonUtils.HIGH_VIDEO_MEM ) ; return specParams ; }

Target:
private static java.util.HashMap < java.lang.String , java.lang.Object > getNewMonitorSpecParams ( org.ovirt.engine.core.common.businessentities.DisplayType displayType , int numOfMonitors ) { java.util.HashMap < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; specParams.put ( "vram" , java.lang.String.valueOf ( VmDeviceCommonUtils.HIGH_VIDEO_MEM ) ) ; if ( displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) { specParams.put ( "heads" , numOfMonitors ) ; } return specParams ; }
Source:
public static void getGlusterHooks ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
public void testIncompleteExport ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { control.replay ( ) ; resource.doExport ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "doExport" , "storageDomain.id|name" ) ; } }

Target:
public void testIncompleteExport ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { control.replay ( ) ; resource.export ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "export" , "storageDomain.id|name" ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections populateBasicConnectionDetails ( org.ovirt.engine.core.compat.Guid id , java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connectionDetails.setid ( id.toString ( ) ) ; connectionDetails.setconnection ( connection ) ; connectionDetails.setstorage_type ( type ) ; return connectionDetails ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections populateBasicConnectionDetails ( org.ovirt.engine.core.compat.Guid id , java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connectionDetails.setid ( id.toString ( ) ) ; connectionDetails.setconnection ( connection ) ; connectionDetails.setstorage_type ( type ) ; return connectionDetails ; }
Source:
private void validateRngRequiredSource ( ) { org.ovirt.engine.core.compat.Version clusterVersion = getVersion ( ) . getSelectedItem ( ) ; boolean rngSupportedForCluster = isRngSupportedForClusterVersion ( clusterVersion ) ; getRngRandomSourceRequired ( ) . setIsValid ( ( rngSupportedForCluster || ( ! ( getRngRandomSourceRequired ( ) . getEntity ( ) ) ) ) ) ; getRngHwrngSourceRequired ( ) . setIsValid ( ( rngSupportedForCluster || ( ! ( getRngHwrngSourceRequired ( ) . getEntity ( ) ) ) ) ) ; }

Target:
private void migrationPoliciesChanged ( ) { boolean hasMigrationPolicy = ( ( getMigrationPolicies ( ) . getSelectedItem ( ) ) != null ) && ( ! ( NoMigrationPolicy.ID.equals ( getMigrationPolicies ( ) . getSelectedItem ( ) . getId ( ) ) ) ) ; org.ovirt.engine.ui.uicompat.UIConstants constants = org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) ; getAutoConverge ( ) . setIsChangeable ( ( ! hasMigrationPolicy ) , constants.availableOnlyWithNoMigrationPolicy ( ) ) ; getMigrateCompressed ( ) . setIsChangeable ( ( ! hasMigrationPolicy ) , constants.availableOnlyWithNoMigrationPolicy ( ) ) ; }
Source:
protected void endWithFailure ( ) { setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . endAction ( VdcActionType.RunVm , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getCompensationContext ( ) ) ) . getSucceeded ( ) ) ; if ( ! ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getSucceeded ( ) ) ) { log.warn ( "AttachUserToVmFromPoolAndRunCommand::EndWitFailure: EndAction of RunVm Failed" ) ; } detachUserFromVmFromPool ( ) ; }

Target:
protected void endWithFailure ( ) { setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . endAction ( VdcActionType.RunVm , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getCompensationContext ( ) ) ) . getSucceeded ( ) ) ; if ( ! ( org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getSucceeded ( ) ) ) { log.warn ( "AttachUserToVmFromPoolAndRunCommand::EndWitFailure: endAction of RunVm Failed" ) ; } detachUserFromVmFromPool ( ) ; }
Source:
public static void GetStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void initTable ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { this . constants = constants ; initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; org.ovirt.engine.ui.common.widget.uicommon.vm.BaseVmDiskListModelTable.getModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { disksViewRadioGroup.setDiskStorageType ( ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType ) ( getModel ( ) . getDiskViewType ( ) . getEntity ( ) ) ) ) ; } } ) ; }

Target:
public void initTable ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { this . constants = constants ; initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; org.ovirt.engine.ui.common.widget.uicommon.vm.BaseVmDiskListModelTable.getModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { disksViewRadioGroup.setDiskStorageType ( ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType ) ( getModel ( ) . getDiskViewType ( ) . getEntity ( ) ) ) ) ; } } ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > operation , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runQuery: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { callback.getDel ( ) . onSuccess ( null ) ; } } finally { fireAsyncQueryFailedEvent ( callback.getModel ( ) ) ; } }

Target:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > operation , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runQuery: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { callback.getAsyncCallback ( ) . onSuccess ( null ) ; } } finally { fireAsyncQueryFailedEvent ( callback.getModel ( ) ) ; } }
Source:
private static boolean isBaseInterfaceDown ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces ) { if ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) ) { return ( iface.getStatistics ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } java.lang.String baseIfaceName = iface.getBaseInterface ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface tmpIface : interfaces ) { if ( tmpIface.getName ( ) . equals ( baseIfaceName ) ) { return ( tmpIface.getStatistics ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } } return false ; }

Target:
private static boolean isBaseInterfaceDown ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces ) { if ( ! ( org.ovirt.engine.core.common.utils.NetworkCommonUtils.isVlan ( iface ) ) ) { return ( iface.getStatistics ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } java.lang.String baseIfaceName = iface.getBaseInterface ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface tmpIface : interfaces ) { if ( tmpIface.getName ( ) . equals ( baseIfaceName ) ) { return ( tmpIface.getStatistics ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } } return false ; }
Source:
public void testSetStatusForRequiredNetworkAbsentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; testSetStatusForRequiredNetwork ( createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID1 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME2 ) ; org.mockito.Mockito.verify ( networkClusterDao ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.NON_OPERATIONAL ) ) ; }

Target:
public void testSetStatusForRequiredNetworkAbsentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; org.mockito.Mockito.when ( vdsStaticDao.checkIfExistsHostThatMissesNetworkInCluster ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 , VDSStatus.Up ) ) . thenReturn ( true ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , java.util.Collections.singletonList ( createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID1 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) ) ) ; org.mockito.Mockito.verify ( networkClusterDao ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.NON_OPERATIONAL ) ) ; }
Source:
public void initUserAndGroupData ( ) { if ( ( dbUser ) == null ) { dbUser = org.ovirt.engine.core.bll.PermissionsCommandBase.getDbUserDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } if ( ( ( dbUser ) == null ) && ( ( dbGroup ) == null ) ) { dbGroup = org.ovirt.engine.core.bll.PermissionsCommandBase.getAdGroupDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } }

Target:
public void initUserAndGroupData ( ) { if ( ( dbUser ) == null ) { dbUser = org.ovirt.engine.core.bll.PermissionsCommandBase.getDbUserDao ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } if ( ( ( dbUser ) == null ) && ( ( dbGroup ) == null ) ) { dbGroup = org.ovirt.engine.core.bll.PermissionsCommandBase.getAdGroupDao ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } }
Source:
public boolean fetch ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue getStats = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.GetAllVmStats , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vdsManager.getCopyVds ( ) ) ) ; if ( getStats.getSucceeded ( ) ) { vdsmVms = ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > ) ( getStats.getReturnValue ( ) ) ) ; onFetchVms ( ) ; return true ; } else { onError ( ) ; return false ; } }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue poll ( ) { return getResourceManager ( ) . runVdsCommand ( VDSCommandType.GetAllVmStats , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vdsManager.getCopyVds ( ) ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( glusterVolume.getVolumeType ( ) . isDistributedType ( ) ) ) || ( ( glusterVolume.getBricks ( ) . size ( ) ) == 1 ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_BRICKS_ARE_NOT_DISTRIBUTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } boolean isVolumeDistributed = glusterVolume.getVolumeType ( ) . isDistributedType ( ) ; if ( ! isVolumeDistributed ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NOT_DISTRIBUTED ) ; } else if ( ( glusterVolume.getBricks ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_DISTRIBUTED_AND_HAS_SINGLE_BRICK ) ; } return true ; }
Source:
public static 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.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.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void getMaxSpmPriority ( 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 ( ) , 10 ) ; }
Source:
protected void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; if ( org.ovirt.engine.core.bll.RunVmCommandBase.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "Decreasing vds {0} pending vcpu count by {1} and vmem size by {2} (Vm: {3})" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; } }

Target:
private void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "Decreasing vds {0} pending vcpu count by {1} and vmem size by {2} (Vm: {3})" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; }
Source:
protected java.util.Set < org.ovirt.engine.core.utils.MockConfigDescriptor < java.lang.Object > > getExtraConfigDescriptors ( ) { return new java.util.HashSet ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.OvirtInitialSupportedIsoVersion , "2.5.5:5.8" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.OvirtIsoPrefix , "^ovirt-node-iso-([0-9].*)\\.iso$:^rhevh-([0-9].*)\\.iso$" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.OvirtNodeOS , "^ovirt.*$:^rhev.*$" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.DataDir , "/usr/share/engine" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.oVirtISOsRepositoryPath , "/usr/share/ovirt-node-iso:/usr/share/rhev-hypervisor" ) ) ) ; }

Target:
public static java.util.stream.Stream < org.ovirt.engine.core.utils.MockConfigDescriptor < ? > > mockConfiguration ( ) { return java.util.stream.Stream.concat ( org.ovirt.engine.core.bll.AbstractQueryTest.mockConfiguration ( ) , java.util.stream.Stream.of ( org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.OvirtInitialSupportedIsoVersion , "2.5.5:5.8" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.OvirtIsoPrefix , "^ovirt-node-iso-([0-9].*)\\.iso$:^rhevh-([0-9].*)\\.iso$" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.OvirtNodeOS , "^ovirt.*$:^rhev.*$" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.DataDir , "/usr/share/engine" ) , org.ovirt.engine.core.utils.MockConfigDescriptor.of ( ConfigValues.oVirtISOsRepositoryPath , "/usr/share/ovirt-node-iso:/usr/share/rhev-hypervisor" ) ) ) ; }
Source:
private void resetTabsValidity ( ) { setIsGeneralTabValid ( true ) ; setIsSystemTabValid ( true ) ; setIsFirstRunTabValid ( true ) ; setIsDisplayTabValid ( true ) ; setIsHostTabValid ( true ) ; setIsAllocationTabValid ( true ) ; setIsBootSequenceTabValid ( true ) ; setRngTabValid ( true ) ; setIsCustomPropertiesTabValid ( true ) ; getValid ( ) . setEntity ( true ) ; }

Target:
private void resetTabsValidity ( ) { setValidTab ( TabName.HOST_TAB , true ) ; setIsCustomPropertiesTabAvailable ( true ) ; setValidTab ( TabName.TAB_RNG , true ) ; setValidTab ( TabName.CUSTOM_PROPERTIES_TAB , true ) ; setValidTab ( TabName.BOOT_OPTIONS_TAB , true ) ; setValidTab ( TabName.RESOURCE_ALLOCATION_TAB , true ) ; setValidTab ( TabName.CONSOLE_TAB , true ) ; setValidTab ( TabName.INITIAL_RUN_TAB , true ) ; setValidTab ( TabName.GENERAL_TAB , true ) ; getValid ( ) . setEntity ( true ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.VDSGroupHostsAndVMs ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VDSGroupHostsAndVMs other = ( ( org.ovirt.engine.core.common.businessentities.VDSGroupHostsAndVMs ) ( obj ) ) ; return ( ( ( hosts ) == ( other.hosts ) ) && ( java.util.Objects.equals ( vdsGroupId , other.vdsGroupId ) ) ) && ( ( vms ) == ( other.vms ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.ClusterHostsAndVMs ) ) { return false ; } org.ovirt.engine.core.common.businessentities.ClusterHostsAndVMs other = ( ( org.ovirt.engine.core.common.businessentities.ClusterHostsAndVMs ) ( obj ) ) ; return ( ( ( hosts ) == ( other.hosts ) ) && ( java.util.Objects.equals ( clusterId , other.clusterId ) ) ) && ( ( vms ) == ( other.vms ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; }

Target:
public static void GetUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName , java.lang.Integer maxCount ) { org.ovirt.engine.core.common.queries.SearchParameters searchParameters = new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Host: cluster = " + clusterName ) + " and status = up" ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; if ( maxCount != null ) { searchParameters.setMaxCount ( maxCount ) ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParameters , aQuery ) ; }
Source:
private void updateMemoryBalloonDevice ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } boolean isBalloonEnabled = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isBalloonEnabled ( osType , cluster.getCompatibilityVersion ( ) ) ; getMemoryBalloonDeviceEnabled ( ) . setIsChangable ( isBalloonEnabled ) ; if ( getBehavior ( ) . basedOnCustomInstanceType ( ) ) { getMemoryBalloonDeviceEnabled ( ) . setEntity ( isBalloonEnabled ) ; } }

Target:
private void updateMemoryBalloonDevice ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } boolean isBalloonEnabled = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isBalloonEnabled ( osType , cluster.getCompatibilityVersion ( ) ) ; getMemoryBalloonDeviceEnabled ( ) . setIsChangeable ( isBalloonEnabled ) ; if ( getBehavior ( ) . basedOnCustomInstanceType ( ) ) { getMemoryBalloonDeviceEnabled ( ) . setEntity ( isBalloonEnabled ) ; } }
Source:
private boolean validateNetworkExclusiveOnNic ( java.lang.String nicName , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > networksOnIface ) { if ( ( networksOnIface.size ( ) ) <= 1 ) { return true ; } org.apache.commons.collections.bag.HashBag networkTypes = new org.apache.commons.collections.bag.HashBag ( networksOnIface ) ; if ( ( ( networkTypes.contains ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.VM ) ) && ( ( networkTypes.size ( ) ) > 1 ) ) || ( ( networkTypes.contains ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.NON_VM ) ) && ( ( networkTypes.getCount ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.NON_VM ) ) > 1 ) ) ) { return false ; } return true ; }

Target:
private boolean validateNetworkExclusiveOnNic ( java.lang.String nicName , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > networksOnIface ) { if ( ( networksOnIface.size ( ) ) <= 1 ) { return true ; } org.apache.commons.collections.Bag networkTypes = new org.apache.commons.collections.bag.HashBag ( networksOnIface ) ; if ( ( networkTypes.contains ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.VM ) ) || ( ( networkTypes.contains ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.NON_VM ) ) && ( ( networkTypes.getCount ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType.NON_VM ) ) > 1 ) ) ) { return false ; } return true ; }
Source:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" } : new java.lang.String [ ] { "templates" , "vms" , "files" } ; }

Target:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" } : new java.lang.String [ ] { "templates" , "vms" , "files" } ; }
Source:
public void testListCrash ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } }

Target:
public void testListCrash ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } }
Source:
public void UpdataMaxVmsInPool ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaxVmsInPool ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.setMaxVmsInPool ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; behavior.UpdateMaxNumOfVmCpus ( ) ; } } ) ) ; }

Target:
public void updataMaxVmsInPool ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxVmsInPool ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.setMaxVmsInPool ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; behavior.updateMaxNumOfVmCpus ( ) ; } } ) ) ; }
Source:
protected org.ovirt.engine.api.model.VM getEntity ( int index ) { return org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.api.model.VM.class ) , control.createMock ( org.ovirt.engine.core.common.businessentities.VmStatistics.class ) , index ) ; }

Target:
protected void setUpGetGraphicsExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } }
Source:
void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef , java.util.List selectedItems ) { item.setVisible ( ( ( buttonDef.isAccessible ( selectedItems ) ) && ( buttonDef.isVisible ( selectedItems ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( selectedItems ) ) ; item.setTitle ( ( ( buttonDef.getButtonToolTip ( ) ) != null ? buttonDef.getButtonToolTip ( ) : null ) ) ; }

Target:
void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef , java.util.List selectedItems ) { item.setVisible ( ( ( buttonDef.isAccessible ( selectedItems ) ) && ( buttonDef.isVisible ( selectedItems ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( selectedItems ) ) ; if ( ( buttonDef.getButtonToolTip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( buttonDef.getButtonToolTip ( ) ) , item.getElement ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.gluster.RefreshGeoRepSessionsCommand.getParameters ( ) . getVolumeId ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.gluster.RefreshGeoRepSessionsCommand.getGlusterVolume ( ) ) == null ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID ) ; return false ; } return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.gluster.RefreshGeoRepSessionsCommand.getParameters ( ) . getVolumeId ( ) ) == null ) || ( ( org.ovirt.engine.core.bll.gluster.RefreshGeoRepSessionsCommand.getGlusterVolume ( ) ) == null ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID ) ; return false ; } return super . canDoAction ( ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure , org.ovirt.engine.core.compat.Guid adElementId ) { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpPermissionsWithAdElementId ( adElementId ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure , org.ovirt.engine.core.compat.Guid adElementId ) { org.junit.jupiter.api.Assertions.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpPermissionsWithAdElementId ( adElementId ) , failure ) ; }
Source:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public static void getClusterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public java.lang.String getMessage ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { java.lang.String message = getVerb ( op1 ) ; return isUnary ( ) ? message : ( message + " " ) + ( getNoun ( op2 ) ) ; }

Target:
public java.lang.String getMessage ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 ) { java.lang.String message = getVerb ( op1 ) ; if ( ! ( isUnary ( ) ) ) { message += ' ' + ( getNoun ( op2 ) ) ; } return message ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testInvalidNumberOfMonitors ( ) { prepareVmToPassCanDoAction ( ) ; vmStatic.setNumOfMonitors ( 99 ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid number of monitors." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_NUM_OF_MONITORS ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newGroup = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_0 ) ; vmStatic.setClusterId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( command ) . getClusterDao ( ) ; org.junit.Assert.assertFalse ( "validate should have failed with can't change cluster." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }