auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( asyncTask.getCommandId ( ) ) ; if ( ( asyncTask.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) { cmdEntity.setCommandStatus ( CommandStatus.SUCCEEDED ) ; } coco.persistCommand ( map ( asyncTask , cmdEntity ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { coco.persistCommand ( asyncTask.getRootCmdEntity ( ) ) ; coco.persistCommand ( asyncTask.getChildCmdEntity ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask ) ; return null ; }
Source:
java.util.List < com.google.gwt.dom.client.TableCellElement > getTableBodyCells ( int columnIndex ) { com.google.gwt.dom.client.TableElement tableElement = table.getElement ( ) . cast ( ) ; com.google.gwt.dom.client.TableSectionElement firstTBodyElement = tableElement.getTBodies ( ) . getItem ( 0 ) ; return firstTBodyElement != null ? getCells ( firstTBodyElement.getRows ( ) , columnIndex ) : java.util.Collections.< com.google.gwt.dom.client.TableCellElement > emptyList ( ) ; }

Target:
public void addColumnWithHtmlHeader ( com.google.gwt.user.cellview.client.Column < T , ? > column , java.lang.String headerHtml , java.lang.String width ) { table.addColumnWithHtmlHeader ( column , headerHtml , width ) ; tableHeader.addColumnWithHtmlHeader ( column , headerHtml , width ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsList = org.ovirt.engine.core.bll.GetAllVmsForUserQuery.getDbFacade ( ) . getVmDao ( ) . getAllForUser ( org.ovirt.engine.core.bll.GetAllVmsForUserQuery.getUserID ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsList ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; } org.ovirt.engine.core.bll.GetAllVmsForUserQuery.getQueryReturnValue ( ) . setReturnValue ( vmsList ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVMs ( ) { return vmDao.getAllForUser ( org.ovirt.engine.core.bll.GetAllVmsForUserQuery.getUserID ( ) ) ; }
Source:
public void canDoActionShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createShareableDiskImage ( ) ; image.setvolume_format ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , Version.v3_1 ) ; mockStoragePoolIsoMap ( ) ; runAndAssertCanDoActionSuccess ( ) ; }

Target:
public void canDoActionShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createShareableDiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , Version.v3_1 ) ; mockStoragePoolIsoMap ( ) ; runAndAssertCanDoActionSuccess ( ) ; }
Source:
protected void onEntityChanged ( ) { if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ( this ) ; } else if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ( this ) ; } else { throw new java.lang.UnsupportedOperationException ( ) ; } behavior.onEntityChanged ( ) ; }

Target:
protected void onEntityChanged ( ) { if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ( this ) ; } else if ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { behavior = new org.ovirt.engine.ui.uicommonweb.models.userportal.PoolItemBehavior ( this , poolRepresentant ) ; poolRepresentant = null ; } else { throw new java.lang.UnsupportedOperationException ( ) ; } behavior.onEntityChanged ( ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getDetailModel ( ) . getShutdownCommand ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VMStatus getRawValue ( org.ovirt.engine.core.common.businessentities.VM object ) { final org.ovirt.engine.core.common.businessentities.VDS vds = getDetailModel ( ) . getEntity ( ) ; if ( ( ( object.getStatus ( ) . equals ( VMStatus.MigratingFrom ) ) && ( vds != null ) ) && ( vds.getId ( ) . equals ( object.getMigratingToVds ( ) ) ) ) { return org.ovirt.engine.core.common.businessentities.VMStatus.MigratingTo ; } return object.getStatus ( ) ; }
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 ) { return getVerb ( op1 ) ; }

Target:
protected void executeNetworkCommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , java.lang.Object ... params ) { assert op1 instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( op1 ) ) ; assert networkToDetach.isAttached ( ) ; org.ovirt.engine.core.compat.Guid networkId = networkToDetach.getNetwork ( ) . getId ( ) ; assert networkId == null ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.detachNetworkWithoutUpdatingHostSetupNetworksParameters ( dataFromHostSetupNetworksModel.allNics , networkToDetach ) ; dataFromHostSetupNetworksModel.removedUnmanagedNetworks.add ( networkToDetach.getNetwork ( ) . getName ( ) ) ; }
Source:
private void waitBetweenPolls ( ) { while ( ( ( timestampOfEndOfPreviousInvocation ) != null ) && ( ( ( currentTimestamp ( ) ) - ( timestampOfEndOfPreviousInvocation ) ) < ( org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.POLLING_BREAK_IN_NANOS ) ) ) { try { java.lang.Thread.sleep ( org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.POLLING_BREAK ) ; } catch ( java.lang.InterruptedException e ) { } } }

Target:
private void waitBetweenPolls ( ) { while ( ( ( timestampOfEndOfPreviousInvocation ) != null ) && ( ( ( currentTimestamp ( ) ) - ( timestampOfEndOfPreviousInvocation ) ) < ( org.ovirt.engine.core.bll.network.host.HostPoller.POLLING_BREAK_IN_NANOS ) ) ) { try { java.lang.Thread.sleep ( org.ovirt.engine.core.bll.network.host.HostPoller.POLLING_BREAK ) ; } catch ( java.lang.InterruptedException e ) { } } }
Source:
public void testExecuteQuery ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSessionId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.aaa.GetUserBySessionIdQueryTest.sessionID ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( "Wrong user returned from query" , getUser ( ) , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testExecuteQuery ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSessionId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.aaa.GetUserBySessionIdQueryTest.sessionID ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( getUser ( ) , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) , "Wrong user returned from query" ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.utils.lock.EngineLock monitoringLock = org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.acquireMonitorLock ( ) ; try { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVdsId ( ) ) . refreshHost ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVds ( ) ) ; org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.setSucceeded ( true ) ; } finally { releaseMonitorLock ( monitoringLock , "Refresh host capabilities" ) ; } }

Target:
protected void executeCommand ( ) { try ( org.ovirt.engine.core.utils.lock.EngineLock monitoringLock = org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.acquireMonitorLock ( ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVdsId ( ) ) . refreshHost ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVds ( ) ) ; org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.setSucceeded ( true ) ; } org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.logMonitorLockReleased ( "Refresh host capabilities" ) ; }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM getVmEntity ( ) { org.ovirt.engine.api.restapi.resource.VM entity = control.createMock ( org.ovirt.engine.core.common.businessentities.VM.class ) ; org.easymock.EasyMock.expect ( entity.getId ( ) ) . andReturn ( GUIDS [ 0 ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getStaticData ( ) ) . andReturn ( new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ) ; org.easymock.EasyMock.expect ( entity.getDedicatedVmForVdsList ( ) ) . andReturn ( java.util.Collections.emptyList ( ) ) . anyTimes ( ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmEntity ( ) { org.ovirt.engine.api.restapi.resource.VM entity = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ 0 ] ) ; org.mockito.Mockito.when ( entity.getStaticData ( ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ) ; org.mockito.Mockito.when ( entity.getDedicatedVmForVdsList ( ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; return entity ; }
Source:
private static void getTotalCpuMemCount ( org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary cpuSummary , org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary memSummary , javax.sql.DataSource dwhDataSource ) throws java.sql.SQLException , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.dao.HostDwhDAO dao = new org.ovirt.engine.ui.frontend.server.dashboard.dao.HostDwhDAO ( dwhDataSource ) ; org.ovirt.engine.ui.frontend.server.dashboard.models.ResourcesTotal total = dao.getTotalCpuMemCount ( ) ; cpuSummary.setPhysicalTotal ( total.getCpuTotal ( ) ) ; memSummary.setPhysicalTotal ( ( ( total.getMemTotal ( ) ) / 1024 ) ) ; }

Target:
private static void getTotalCpuMemCount ( org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary cpuSummary , org.ovirt.engine.ui.frontend.server.dashboard.GlobalUtilizationResourceSummary memSummary , javax.sql.DataSource dwhDataSource ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.dao.HostDwhDao dao = new org.ovirt.engine.ui.frontend.server.dashboard.dao.HostDwhDao ( dwhDataSource ) ; org.ovirt.engine.ui.frontend.server.dashboard.models.ResourcesTotal total = dao.getTotalCpuMemCount ( ) ; cpuSummary.setPhysicalTotal ( total.getCpuTotal ( ) ) ; memSummary.setPhysicalTotal ( ( ( total.getMemTotal ( ) ) / 1024 ) ) ; }
Source:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.config.entity.ConfigKey copyOf ( org.ovirt.engine.core.config.entity.ConfigKey key , java.lang.String value , java.lang.String version ) { return new org.ovirt.engine.core.config.entity.ConfigKey ( key.getType ( ) , key.getDescription ( ) , key.getAlternateKeys ( ) , key.getKey ( ) , value , key.getValidValues ( ) . toArray ( new java.lang.String [ 0 ] ) , version , key.getValueHelper ( ) , key.isReloadable ( ) ) ; }

Target:
public org.ovirt.engine.core.config.entity.ConfigKey copyOf ( org.ovirt.engine.core.config.entity.ConfigKey key , java.lang.String value , java.lang.String version ) { return new org.ovirt.engine.core.config.entity.ConfigKey ( key.getType ( ) , key.getDescription ( ) , key.getAlternateKeys ( ) , key.getKey ( ) , value , key.getValidValues ( ) . toArray ( new java.lang.String [ 0 ] ) , version , key.getValueHelper ( ) , key.isReloadable ( ) , key.isDeprecated ( ) ) ; }
Source:
public void getIsPasswordDelegationPossible ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { final org.ovirt.engine.ui.frontend.INewAsyncCallback chainedCallback = asyncQuery.asyncCallback ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { chainedCallback.onSuccess ( model , ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsPasswordDelegationPossible , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , asyncQuery ) ; }

Target:
public void getIsPasswordDelegationPossible ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > asyncQuery ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsPasswordDelegationPossible , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , asyncQuery ) ; }
Source:
private boolean isStorageDomainValid ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType , boolean forceRefresh ) { if ( storageDomainId == null ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.error ( "Storage domain ID received from command query is null." ) ; return false ; } if ( forceRefresh ) { return refreshRepos ( storageDomainId , imageType ) ; } return true ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType , boolean forceRefresh ) { if ( ! ( isStorageDomainIdValid ( storageDomainId ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.GetIsoListError ) ; } if ( forceRefresh && ( ! ( refreshRepos ( storageDomainId , imageType ) ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.IMAGES_NOT_SUPPORTED_ERROR ) ; } return getCachedIsoListByDomainId ( storageDomainId , imageType ) ; }
Source:
public void validateMissingTemplateDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; org.ovirt.engine.core.compat.Guid templateImageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; diskImage.setImageTemplateId ( templateImageId ) ; initDiskImage ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , templateImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN.toString ( ) ) ) ; }

Target:
private void validateInvalidDestinationAndSourceDomainOfDifferentStorageSubtypes ( org.ovirt.engine.core.common.businessentities.storage.StorageType sourceType , org.ovirt.engine.core.common.businessentities.storage.StorageType destType ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; srcStorageDomain.setStorageType ( sourceType ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setStorageType ( destType ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }
Source:
public void testGuestFQDN ( ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setVmFQDN ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.VM map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; assertNotNull ( map.getGuestInfo ( ) . getFqdn ( ) ) ; assertEquals ( map.getGuestInfo ( ) . getFqdn ( ) , "localhost.localdomain" ) ; }

Target:
public void testGuestFQDN ( ) { org.ovirt.engine.api.restapi.types.VM vm = new org.ovirt.engine.api.restapi.types.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setVmFQDN ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.Vm map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertNotNull ( map.getFqdn ( ) ) ; assertEquals ( map.getFqdn ( ) , "localhost.localdomain" ) ; }
Source:
private void initUnregisteredOVFData ( org.ovirt.engine.core.common.businessentities.OvfEntityData resultOvfEntityData ) { org.mockito.Mockito.when ( unregisteredOVFDataDao.getByEntityIdAndStorageDomain ( vmId , storageDomainId ) ) . thenReturn ( resultOvfEntityData ) ; }

Target:
private void initUnregisteredOVFData ( org.ovirt.engine.core.common.businessentities.OvfEntityData resultOvfEntityData ) { java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList = new java.util.ArrayList < > ( ) ; if ( resultOvfEntityData != null ) { ovfEntityDataList.add ( resultOvfEntityData ) ; } org.mockito.Mockito.when ( unregisteredOVFDataDao.getByEntityIdAndStorageDomain ( vmId , storageDomainId ) ) . thenReturn ( ovfEntityDataList ) ; }
Source:
public static void getUserMessageOfTheDayViaPublic ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
private void endCommandActions ( ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getBackend ( ) . endAction ( getImagesActionType ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) ) ; org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.setSucceeded ( true ) ; }

Target:
private void endCommandActions ( ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getBackend ( ) . endAction ( getImagesActionType ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutLock ( ) ) ; org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.setSucceeded ( true ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > getEventNotificationMethodsById ( int method_id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "method_id" , method_id ) ; org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > mapper = new org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.EventNotificationMethod mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.EventNotificationMethod entity = new org.ovirt.engine.core.common.businessentities.EventNotificationMethod ( ) ; entity.setmethod_id ( rs.getInt ( "method_id" ) ) ; entity.setmethod_type ( EventNotificationMethods.EMAIL ) ; return entity ; } } ; return getCallsHandler ( ) . executeReadList ( "GetEventNotificationMethodById" , mapper , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > getEventNotificationMethodsById ( int method_id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "method_id" , method_id ) ; return getCallsHandler ( ) . executeReadList ( "GetEventNotificationMethodById" , org.ovirt.engine.core.dao.EventDAODbFacadeImpl.EventNotificationMethodRowMapper.instance , parameterSource ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StorageDomain getSelectedStorageDomain ( ) { if ( ( ( selectedStorageDomain ) == null ) && ( ! ( storageDomains.isEmpty ( ) ) ) ) { selectedStorageDomain = storageDomains.get ( 0 ) ; } return selectedStorageDomain ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomain getSelectedStorageDomain ( ) { if ( ( ( selectedStorageDomain ) == null ) && ( ! ( storageDomains.isEmpty ( ) ) ) ) { selectedStorageDomain = java.util.Collections.max ( storageDomains , new java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) { @ java.lang.Override public int compare ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain1 , org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain2 ) { return storageDomain1.getAvailableDiskSize ( ) . compareTo ( storageDomain2.getAvailableDiskSize ( ) ) ; } } ) ; } return selectedStorageDomain ; }
Source:
protected java.lang.String getColumnWidthKey ( com.google.gwt.user.cellview.client.Column < T , ? > column ) { if ( columnResizePersistenceEnabled ) { return ( ( ( ( org.ovirt.engine.ui.common.widget.table.ColumnResizeCellTable.GRID_COLUMN_WIDTH_PREFIX ) + "_" ) + ( getGridElementId ( ) ) ) + "_" ) + ( getColumnIndex ( column ) ) ; } return null ; }

Target:
protected java.lang.String getColumnWidthKey ( com.google.gwt.user.cellview.client.Column < T , ? > column ) { if ( columnResizePersistenceEnabled ) { return ( ( ( ( org.ovirt.engine.ui.common.widget.table.ColumnResizeCellTable.GRID_COLUMN_WIDTH_PREFIX ) + "_" ) + ( getGridElementId ( ) ) ) + "_" ) + ( determineOriginalIndex ( getColumnIndex ( column ) ) ) ; } return null ; }
Source:
private void setTestResultValue ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { java.lang.String errorMessage = org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.EMPTY_ERROR_MESSAGE ; if ( result == null ) { errorMessage = org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . testFailedUnknownErrorMsg ( ) ; } else if ( ! ( result.getSucceeded ( ) ) ) { errorMessage = ( result.getCanDoAction ( ) ) ? org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . translateEngineFault ( result.getFault ( ) ) : org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . translateExecuteFailedMessages ( result.getCanDoActionMessages ( ) ) ; } getTestResult ( ) . setEntity ( errorMessage ) ; }

Target:
private void setTestResultValue ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { java.lang.String errorMessage = org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.EMPTY_ERROR_MESSAGE ; if ( result == null ) { errorMessage = org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . testFailedUnknownErrorMsg ( ) ; } else if ( ! ( result.getSucceeded ( ) ) ) { errorMessage = ( result.isValid ( ) ) ? org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . translateEngineFault ( result.getFault ( ) ) : org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . translateExecuteFailedMessages ( result.getValidationMessages ( ) ) ; } getTestResult ( ) . setEntity ( errorMessage ) ; }
Source:
public void canRunVmDuringInit ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }

Target:
public void canRunVmDuringInit ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }
Source:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.StoragePool > aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel diskViewType = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; disksViewRadioGroup.setDiskStorageType ( ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType ) ( diskViewType.getEntity ( ) ) ) ) ; onDiskViewTypeChanged ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel diskViewType = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; disksViewRadioGroup.setDiskStorageType ( ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType ) ( diskViewType.getEntity ( ) ) ) ) ; if ( ( org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.instance ( ) . getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.disks.DiskListModel ) { onDiskViewTypeChanged ( ) ; } }
Source:
private void DiskInterface_SelectedItemChanged ( ) { boolean isLunDisk = ( getDiskStorageType ( ) . getEntity ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ; org.ovirt.engine.core.common.businessentities.DiskInterface diskInterface = getDiskInterface ( ) . getSelectedItem ( ) ; getIsSgIoUnfiltered ( ) . setIsAvailable ( ( isLunDisk && ( DiskInterface.VirtIO_SCSI.equals ( diskInterface ) ) ) ) ; getIsScsiPassthrough ( ) . setIsAvailable ( ( isLunDisk && ( DiskInterface.VirtIO_SCSI.equals ( diskInterface ) ) ) ) ; updateScsiPassthroguhChangeability ( ) ; updateReadOnlyChangeability ( ) ; updatePlugChangeability ( ) ; }

Target:
private void DiskInterface_SelectedItemChanged ( ) { boolean isLunDisk = ( getDiskStorageType ( ) . getEntity ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ; org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface = getDiskInterface ( ) . getSelectedItem ( ) ; getIsSgIoUnfiltered ( ) . setIsAvailable ( ( isLunDisk && ( DiskInterface.VirtIO_SCSI.equals ( diskInterface ) ) ) ) ; getIsScsiPassthrough ( ) . setIsAvailable ( ( isLunDisk && ( DiskInterface.VirtIO_SCSI.equals ( diskInterface ) ) ) ) ; updateScsiPassthroguhChangeability ( ) ; updateReadOnlyChangeability ( ) ; updatePlugChangeability ( ) ; }
Source:
public void testGetRelatedTableName ( ) { org.junit.Assert.assertEquals ( "EVENTS" , "audit_log" , comp.getRelatedTableName ( "EVENTS" , true ) ) ; org.junit.Assert.assertNull ( "Garbage" , comp.getRelatedTableName ( "kjfhkjdshkjfs" , true ) ) ; org.junit.Assert.assertNull ( "Null" , comp.getRelatedTableName ( null , true ) ) ; }

Target:
public void testGetRelatedTableName ( ) { org.junit.jupiter.api.Assertions.assertEquals ( "audit_log" , comp.getRelatedTableName ( "EVENTS" , true ) , "EVENTS" ) ; org.junit.jupiter.api.Assertions.assertNull ( comp.getRelatedTableName ( "kjfhkjdshkjfs" , true ) , "Garbage" ) ; org.junit.jupiter.api.Assertions.assertNull ( comp.getRelatedTableName ( null , true ) , "Null" ) ; }
Source:
public void canDoActionFailedGuestOsIsNotSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setvm_os ( VmOsType.RHEL3x64 ) ; cretaeVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED.toString ( ) ) ) ; }

Target:
public void canDoActionFailedGuestOsIsNotSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( VmOsType.RHEL3x64 ) ; cretaeVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED.toString ( ) ) ) ; }
Source:
public void postUpdateItemsAvailability ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel item , boolean isNoExportOrIsoStorageAttached ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getModel ( ) . getDataCenter ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.Model model = ( ( org.ovirt.engine.ui.uicommonweb.models.Model ) ( item ) ) ; boolean isItemSelectable = isItemSelectable ( item , dataCenter , isNoExportOrIsoStorageAttached ) ; model.setIsSelectable ( isItemSelectable ) ; onStorageModelUpdated ( item ) ; }

Target:
public void postUpdateItemsAvailability ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel item , boolean isNoExportOrIsoStorageAttached ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getModel ( ) . getDataCenter ( ) . getSelectedItem ( ) ) ) ; checkCanItemBeSelected ( item , dataCenter , isNoExportOrIsoStorageAttached ) ; }
Source:
public void addNetwork ( org.ovirt.engine.core.compat.Guid vfsConfigId , org.ovirt.engine.core.compat.Guid networkId ) { getCallsHandler ( ) . executeModification ( "InsertvfsConfigNetwork" , createNetworkParametersMapper ( vfsConfigId , networkId ) ) ; }

Target:
private void massNetworksUpdate ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.util.Set < org.ovirt.engine.core.compat.Guid > networks ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList ( networks.size ( ) ) ; for ( org.ovirt.engine.core.compat.Guid networkId : networks ) { executions.add ( createNetworkParametersMapper ( vfsConfigId , networkId ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertVfsConfigNetwork" , executions ) ; }
Source:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getVmById ( 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.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > presets = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > ) ( returnValue ) ) ; diskModel1.getPreset ( ) . setItems ( presets ) ; diskModel1.getPreset ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( presets ) ) ; diskModel1.StopProgress ( ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > presets = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > ) ( returnValue ) ) ; diskModel.getPreset ( ) . setItems ( presets ) ; diskModel.getPreset ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( presets ) ) ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolAddressDifferent ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addBonds ( bond ) ) . build ( ) ; _doTestValidateModifiedBondSlaves ( org.mockito.Mockito.spy ( validator ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addBonds ( bond ) ) . build ( ) ; doTestValidateModifiedBondSlaves ( org.mockito.Mockito.spy ( validator ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { }

Target:
private void updateAvailableOvirtNodeUpgrades ( ) { final org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItem ( ) ; if ( host == null ) { return ; } if ( ! ( host.isOvirtVintageNode ( ) ) ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getoVirtISOsList ( new org.ovirt.engine.ui.uicommonweb.models.hosts.AsyncQuery ( ) , host.getId ( ) ) ; }
Source:
public void testAddSetAndUploadIconFailure ( ) { final org.ovirt.engine.api.model.Template restModel = getRestModel ( 0 ) ; restModel.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; restModel.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( restModel ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testAddSetAndUploadIconFailure ( ) { final org.ovirt.engine.api.model.Template restModel = getRestModel ( 0 ) ; restModel.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; restModel.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( restModel ) ) , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; }
Source:
public void connect ( ) { boolean sslTarget = ( ( securePort ) == ( - 1 ) ) ? false : true ; org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.SpiceHtml5Impl.CLIENT_PAGE , config , getHost ( ) , java.lang.String.valueOf ( ( sslTarget ? securePort : port ) ) , getPassword ( ) , sslTarget ) ; invoker.invokeClient ( ) ; }

Target:
protected org.ovirt.engine.ui.common.uicommon.WebsocketProxyConfig getConfig ( ) { if ( ( config ) == null ) { config = new org.ovirt.engine.ui.common.uicommon.WebsocketProxyConfig ( ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.WebSocketProxy ) ) ) , getOptions ( ) . getHost ( ) ) ; } return config ; }
Source:
private void doTestBadAdd ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.LabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.nicId , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.LABELS [ 0 ] } , canDo , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.LabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.nicId , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.LABELS [ 0 ] } , valid , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void liveMigrateDiskBasedOnTemplate ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImageBasedOnTemplate ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getLiveMigrateVmDisksParametersList ( ) . size ( ) ) ; }

Target:
public void liveMigrateDiskBasedOnTemplate ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImageBasedOnTemplate ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.init ( ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getLiveMigrateVmDisksParametersList ( ) . size ( ) ) ; }