auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testAddIncompleteParametersNoName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "id|name" ) ; } }

Target:
public void testAddIncompleteParametersNoName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "id|name" ) ; } }
Source:
private void dataCenterQueryResult ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { final java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = clusterDao.getAllForStoragePool ( storagePool.getId ( ) ) ; final java.util.Set < org.ovirt.engine.core.compat.Guid > macPoolIds = clusters.stream ( ) . map ( Cluster :: getMacPoolId ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; storagePool.setMacPoolId ( ( ( macPoolIds.size ( ) ) > 1 ? null : macPoolIds.iterator ( ) . next ( ) ) ) ; }

Target:
private void dataCenterQueryResult ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { final java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = clusterDao.getAllForStoragePool ( storagePool.getId ( ) ) ; final java.util.Set < org.ovirt.engine.core.compat.Guid > macPoolIds = clusters.stream ( ) . map ( Cluster :: getMacPoolId ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; storagePool.setMacPoolId ( ( ( macPoolIds.size ( ) ) != 1 ? null : macPoolIds.iterator ( ) . next ( ) ) ) ; }
Source:
protected void configure ( ) { bind ( org.ovirt.engine.ui.common.utils.ConsoleUtils.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemMessagesTranslator.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.section.login.presenter.ConnectAutomaticallyProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.utils.ConnectAutomaticallyManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.common.utils.ConsoleManager.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
protected void configure ( ) { super . configure ( ) ; bind ( org.ovirt.engine.ui.common.utils.ConsoleUtils.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemMessagesTranslator.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.section.login.presenter.ConnectAutomaticallyProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.utils.ConnectAutomaticallyManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.common.utils.ConsoleManager.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public void testNoDiskStatsDataForDisks ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > disk = new java.util.HashMap < > ( ) ; disksStats.put ( "a" , disk ) ; disksStats.put ( "b" , disk ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksStats ( disksStats ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVds ( ) , xml , true ) ; }

Target:
public void testNoDiskStatsDataForDisks ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > disk = new java.util.HashMap < > ( ) ; disksStats.put ( "a" , disk ) ; disksStats.put ( "b" , disk ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksStats ( disksStats ) ; validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVds ( ) , xml , true ) ; }
Source:
public static boolean urandomRandomUpdateRequired ( org.ovirt.engine.core.compat.Version oldVersion , org.ovirt.engine.core.compat.Version newVersion ) { if ( java.util.Objects.equals ( oldVersion , newVersion ) ) { return false ; } if ( ( oldVersion == null ) || ( newVersion == null ) ) { return false ; } return ( newVersion.greaterOrEquals ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.FIRST_URANDOM_VERSION ) ) && ( oldVersion.less ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.FIRST_URANDOM_VERSION ) ) ; }

Target:
public static boolean urandomRandomUpdateRequired ( org.ovirt.engine.core.compat.Version oldVersion , org.ovirt.engine.core.compat.Version newVersion ) { if ( java.util.Objects.equals ( oldVersion , newVersion ) ) { return false ; } if ( ( oldVersion == null ) || ( newVersion == null ) ) { return false ; } return ( ( newVersion.greaterOrEquals ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.FIRST_URANDOM_VERSION ) ) && ( oldVersion.less ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.FIRST_URANDOM_VERSION ) ) ) || ( ( oldVersion.greaterOrEquals ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.FIRST_URANDOM_VERSION ) ) && ( newVersion.less ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.FIRST_URANDOM_VERSION ) ) ) ; }
Source:
private void importCertificate ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.ImportProviderCertificate , importCertificateParams ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { testProviderConnectivity ( ) ; } } , null , false ) ; sourceListModel.setConfirmWindow ( null ) ; }

Target:
private void importCertificate ( ) { }
Source:
public org.ovirt.engine.core.common.businessentities.storage.CinderConnectionInfo initializeConnectionForDisk ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( new java.util.concurrent.Callable < org.ovirt.engine.core.common.businessentities.storage.CinderConnectionInfo > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.storage.CinderConnectionInfo call ( ) { com.woorea.openstack.cinder.model.ConnectionForInitialize connectionForInitialize = new com.woorea.openstack.cinder.model.ConnectionForInitialize ( ) ; return proxy.initializeConnectionForVolume ( cinderDisk.getImageId ( ) . toString ( ) , connectionForInitialize ) ; } } ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.CinderConnectionInfo initializeConnectionForDisk ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( ( ) -> { com.woorea.openstack.cinder.model.ConnectionForInitialize connectionForInitialize = new com.woorea.openstack.cinder.model.ConnectionForInitialize ( ) ; return proxy.initializeConnectionForVolume ( cinderDisk.getImageId ( ) . toString ( ) , connectionForInitialize ) ; } ) ; }
Source:
private < T extends org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl > org.ovirt.engine.core.compat.Guid selectedBestHost ( T unit , org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = unit.score ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) , hosts , vm , null ) ; scores.sort ( java.util.Comparator.comparing ( Pair :: getSecond ) ) ; return scores.get ( 0 ) . getFirst ( ) ; }

Target:
protected < T extends org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl > org.ovirt.engine.core.compat.Guid selectedBestHost ( T unit , org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = unit.score ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) , hosts , vm , null ) ; scores.sort ( java.util.Comparator.comparing ( Pair :: getSecond ) ) ; return scores.get ( 0 ) . getFirst ( ) ; }
Source:
private static void setNewIdInImportedCollections ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice managedDevice : vmBase.getManagedDeviceMap ( ) . values ( ) ) { if ( ! ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.isDiskOrInterface ( managedDevice ) ) ) { managedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) ) ; } } for ( org.ovirt.engine.core.common.businessentities.VmDevice unmanagedDevice : vmBase.getUnmanagedDeviceList ( ) ) { unmanagedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) ) ; } }

Target:
private void setNewIdInImportedCollections ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice managedDevice : vmBase.getManagedDeviceMap ( ) . values ( ) ) { if ( ! ( isDiskOrInterface ( managedDevice ) ) ) { managedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) ) ; } } for ( org.ovirt.engine.core.common.businessentities.VmDevice unmanagedDevice : vmBase.getUnmanagedDeviceList ( ) ) { unmanagedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) ) ; } }
Source:
public void onAddition ( ) { org.ovirt.engine.core.compat.Guid storageDomainId = addStorageDomain ( StorageType.CINDER , StorageDomainType.Volume ) ; org.ovirt.engine.core.compat.Guid storagePoolId = provider.getAdditionalProperties ( ) . getStoragePoolId ( ) ; if ( ! ( storagePoolId.equals ( Guid.Empty ) ) ) { attachStorageDomainToDataCenter ( storageDomainId , storagePoolId ) ; } }

Target:
public void onAddition ( ) { org.ovirt.engine.core.compat.Guid storageDomainId = addStorageDomain ( StorageType.CINDER , StorageDomainType.Volume ) ; org.ovirt.engine.core.compat.Guid storagePoolId = provider.getAdditionalProperties ( ) . getStoragePoolId ( ) ; if ( ( storagePoolId != null ) && ( ! ( storagePoolId.equals ( Guid.Empty ) ) ) ) { attachStorageDomainToDataCenter ( storageDomainId , storagePoolId ) ; } }
Source:
public void testRemoveAll ( ) { org.ovirt.engine.core.common.businessentities.EngineSession result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( dao.removeAll ( ) , 2 ) ; result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.Assert.assertNull ( result ) ; org.junit.Assert.assertEquals ( dao.removeAll ( ) , 0 ) ; }

Target:
public void testRemoveAll ( ) { org.ovirt.engine.core.common.businessentities.EngineSession result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , dao.removeAll ( ) ) ; result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.Assert.assertNull ( result ) ; org.junit.Assert.assertEquals ( 0 , dao.removeAll ( ) ) ; }
Source:
public void onFailureResetInitialStatus ( ) { try { command.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException exception ) { org.mockito.Mockito.verify ( vdsBrokerFrontend ) . RunVdsCommand ( org.mockito.Mockito.eq ( VDSCommandType.SetVdsStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters.class ) ) ; return ; } org.junit.Assert.fail ( ) ; }

Target:
public void onFailureResetInitialStatus ( ) { try { command.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException exception ) { org.mockito.Mockito.verify ( vdsBrokerFrontend ) . RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.SetVdsStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters.class ) ) ; return ; } org.junit.Assert.fail ( ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( IVdcQueryable quota ) { boolean quotaExceeded = false ; if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaStorage ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaStorage ) ( quota ) ) ) ; } else if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ) ( quota ) ) ) ; } if ( quotaExceeded ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.webadmin.widget.table.column.QuotaUtilizationStatusColumn.constants.quotaExceeded ( ) ) ; } return null ; }

Target:
public java.lang.String getTooltip ( IVdcQueryable quota ) { boolean quotaExceeded = false ; if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaStorage ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaStorage ) ( quota ) ) ) ; } else if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ) ( quota ) ) ) ; } if ( quotaExceeded ) { return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaUtilizationStatusColumn.constants.quotaExceeded ( ) ; } return null ; }
Source:
public void legalTimedOut ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase t = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase ( ) ; t.setUseTimout ( true ) ; long c = java.lang.System.currentTimeMillis ( ) ; c -= 1000 ; final java.util.Date d = new java.util.Date ( c ) ; t.setEndTime ( d ) ; final java.lang.String s = "legal-timeout" ; t.setTimeoutObjectId ( s ) ; t.getLegal ( ) ; final boolean result = t.getLegal ( ) ; org.junit.Assert.assertTrue ( result ) ; }

Target:
public void legalTimedOut ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase t = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase ( ) ; t.setUseTimout ( true ) ; long c = java.lang.System.currentTimeMillis ( ) ; c -= 1000 ; t.setEndTime ( c ) ; final java.lang.String s = "legal-timeout" ; t.setTimeoutObjectId ( s ) ; t.getLegal ( ) ; final boolean result = t.getLegal ( ) ; org.junit.Assert.assertTrue ( result ) ; }
Source:
public static java.lang.String getPassFromFile ( java.lang.String passFile ) throws java.io.IOException { java.io.File f = new java.io.File ( passFile ) ; if ( ! ( f.exists ( ) ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } java.io.FileReader input = new java.io.FileReader ( passFile ) ; java.io.BufferedReader br = new java.io.BufferedReader ( input ) ; java.lang.String pass = br.readLine ( ) ; try { input.close ( ) ; br.close ( ) ; } catch ( java.lang.Exception e ) { } if ( pass == null ) { return org.apache.commons.lang.StringUtils.EMPTY ; } return pass ; }

Target:
public static java.lang.String getPassFromFile ( java.lang.String passFile ) throws java.io.IOException { java.io.File f = new java.io.File ( passFile ) ; if ( ! ( f.exists ( ) ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } java.lang.String pass ; try ( java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.FileReader ( f ) ) ) { pass = br.readLine ( ) ; } if ( pass == null ) { return org.apache.commons.lang.StringUtils.EMPTY ; } return pass ; }
Source:
public boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > messages ) { java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > validationErrors = getVmPropertiesUtils ( ) . validateVMProperties ( vm.getVdsGroupCompatibilityVersion ( ) , vm.getStaticData ( ) ) ; if ( ! ( validationErrors.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.getInstance ( ) . handleCustomPropertiesError ( validationErrors , messages ) ; return false ; } return true ; }

Target:
protected boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > messages ) { java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > validationErrors = getVmPropertiesUtils ( ) . validateVMProperties ( vm.getVdsGroupCompatibilityVersion ( ) , vm.getStaticData ( ) ) ; if ( ! ( validationErrors.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.getInstance ( ) . handleCustomPropertiesError ( validationErrors , messages ) ; return false ; } return true ; }
Source:
public static void isVirtioScsiEnabledForVm ( 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 ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isVirtioScsiEnabledForVm ( 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 ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackImageProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic = org.ovirt.engine.core.bll.provider.storage.OpenStackImageProviderProxy.getDbFacade ( ) . getStorageDomainStaticDao ( ) . get ( storageDomainId ) ; if ( storageDomainStatic != null ) { org.ovirt.engine.core.common.businessentities.Provider < ? > provider = org.ovirt.engine.core.bll.provider.storage.OpenStackImageProviderProxy.getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomainStatic.getStorage ( ) ) ) ; return org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; } return null ; }

Target:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackImageProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic = getDbFacade ( ) . getStorageDomainStaticDao ( ) . get ( storageDomainId ) ; if ( storageDomainStatic != null ) { org.ovirt.engine.core.common.businessentities.Provider < ? > provider = getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomainStatic.getStorage ( ) ) ) ; return org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; } return null ; }
Source:
public void initTable ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { this . constants = constants ; initTableColumns ( ) ; 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 ( ) ) ) ) ; } } ) ; }

Target:
public void initTable ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { this . constants = constants ; initTableColumns ( ) ; initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; org.ovirt.engine.ui.common.widget.uicommon.vm.BaseVmDiskListModelTable.getModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { disksViewRadioGroup.setDiskStorageType ( getModel ( ) . getDiskViewType ( ) . getEntity ( ) ) ; } } ) ; }
Source:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.VdsIdParametersBase parameters = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }
Source:
private void updateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( vmDynamicData ) ; } }

Target:
private void updateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getRunOnVds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( vmDynamicData ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( vmDynamicData ) ; } }
Source:
protected void mockBackendStatusChange ( T cmd , boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setReturnValue ( succeeded ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandTest.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.ovirt.engine.core.bll.gluster.GlusterHookCommandTest.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( vdsReturnValue ) ; }

Target:
protected void mockBackendStatusChange ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setReturnValue ( succeeded ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandTest.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.ovirt.engine.core.bll.gluster.GlusterHookCommandTest.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( vdsReturnValue ) ; }
Source:
private void updateBricks ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity existingVolume , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity fetchedVolume ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > fetchedBricks = fetchedVolume.getBricks ( ) ; if ( fetchedBricks == null ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.warnFormat ( ( "Bricks of volume {0} were not fetched. " + "Hence will not try to update them in engine at this point." ) , fetchedVolume.getName ( ) ) ; return ; } removeDeletedBricks ( existingVolume , fetchedBricks ) ; updateExistingAndNewBricks ( existingVolume , fetchedBricks ) ; }

Target:
private void updateBricks ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity existingVolume , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity fetchedVolume ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > fetchedBricks = fetchedVolume.getBricks ( ) ; if ( fetchedBricks == null ) { log.warnFormat ( ( "Bricks of volume {0} were not fetched. " + "Hence will not try to update them in engine at this point." ) , fetchedVolume.getName ( ) ) ; return ; } removeDeletedBricks ( existingVolume , fetchedBricks ) ; updateExistingAndNewBricks ( existingVolume , fetchedBricks ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult protocolIsNotXmlrpc ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NOT_SUPPORTED_PROTOCOL_FOR_CLUSTER_VERSION ) . when ( ( ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.XML ) == ( host.getProtocol ( ) ) ) && ( cluster.getCompatibilityVersion ( ) . greaterOrEquals ( Version.v3_6 ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult protocolIsNotXmlrpc ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NOT_SUPPORTED_PROTOCOL_FOR_CLUSTER_VERSION ) . when ( ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.XML ) == ( host.getProtocol ( ) ) ) ) ; }
Source:
private org.ovirt.engine.core.common.mode.ApplicationMode findApplicationMode ( java.lang.String sessionId ) { org.ovirt.engine.core.common.queries.GetConfigurationValueParameters parameters = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ApplicationMode , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ; parameters.setSessionId ( sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( VdcQueryType.GetConfigurationValue , parameters ) ; return org.ovirt.engine.core.common.mode.ApplicationMode.from ( ( ( java.lang.Integer ) ( result.getReturnValue ( ) ) ) ) ; }

Target:
private org.ovirt.engine.core.common.mode.ApplicationMode findApplicationMode ( java.lang.String sessionId ) { org.ovirt.engine.core.common.queries.GetConfigurationValueParameters parameters = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ApplicationMode , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ; parameters.setSessionId ( sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( VdcQueryType.GetConfigurationValue , parameters ) ; return org.ovirt.engine.core.common.mode.ApplicationMode.from ( result.getReturnValue ( ) ) ; }
Source:
private java.lang.String showSpiceConsole ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel model ) { if ( consoleUtils.canOpenSpiceConsole ( model ) ) { model.getDefaultConsoleModel ( ) . getConnectCommand ( ) . Execute ( ) ; } else if ( ! ( consoleUtils.isSpiceAvailable ( ) ) ) { return createErrorMessage ( model , "SPICE" ) ; } return null ; }

Target:
private java.lang.String showSpiceConsole ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel model ) { if ( consoleUtils.canOpenSpiceConsole ( model ) ) { model.getDefaultConsoleModel ( ) . getConnectCommand ( ) . Execute ( ) ; } return null ; }
Source:
public void testSaveInterfaceForVds ( ) { newVdsInterface.setVdsId ( org.ovirt.engine.core.dao.InterfaceDAOTest.VDS_ID ) ; dao.saveInterfaceForVds ( newVdsInterface ) ; dao.saveStatisticsForVds ( newVdsStatistics ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > result = dao.getAllInterfacesForVds ( org.ovirt.engine.core.dao.InterfaceDAOTest.VDS_ID ) ; boolean found = false ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : result ) { found |= iface.getName ( ) . equals ( newVdsInterface.getName ( ) ) ; } org.junit.Assert.assertTrue ( found ) ; }

Target:
public void testSaveInterfaceForVds ( ) { newVdsInterface.setVdsId ( org.ovirt.engine.core.dao.InterfaceDAOTest.VDS_ID ) ; dao.saveInterfaceForVds ( newVdsInterface ) ; dao.saveStatisticsForVds ( newVdsStatistics ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result = dao.getAllInterfacesForVds ( org.ovirt.engine.core.dao.InterfaceDAOTest.VDS_ID ) ; boolean found = false ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : result ) { found |= iface.getName ( ) . equals ( newVdsInterface.getName ( ) ) ; } org.junit.Assert.assertTrue ( found ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumeList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ) ( result ) ) ; int volumesUp = 0 ; int volumesDown = 0 ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity : volumeList ) { if ( ( volumeEntity.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ) { volumesUp ++ ; } else { volumesDown ++ ; } } setNoOfVolumesTotal ( volumeList.size ( ) ) ; setNoOfVolumesUp ( volumesUp ) ; setNoOfVolumesDown ( volumesDown ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumeList ) { int volumesUp = 0 ; int volumesDown = 0 ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity : volumeList ) { if ( ( volumeEntity.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ) { volumesUp ++ ; } else { volumesDown ++ ; } } setNoOfVolumesTotal ( volumeList.size ( ) ) ; setNoOfVolumesUp ( volumesUp ) ; setNoOfVolumesDown ( volumesDown ) ; }
Source:
public static org.ovirt.engine.api.model.Application map ( java.lang.String appName , org.ovirt.engine.api.model.Application template ) { org.ovirt.engine.api.model.Application model = ( template != null ) ? template : new org.ovirt.engine.api.model.Application ( ) ; model.setName ( appName ) ; model.setId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( appName.getBytes ( ) , true ) . toString ( ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Application map ( java.lang.String appName , org.ovirt.engine.api.model.Application template ) { org.ovirt.engine.api.model.Application model = ( template != null ) ? template : new org.ovirt.engine.api.model.Application ( ) ; model.setName ( appName ) ; model.setId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( appName.getBytes ( ) ) . toString ( ) ) ; return model ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.Erratum , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.HostErrataListModel > getHostErrataListProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel < java.lang.Void > > mainModelProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.HostErrataListModel > modelProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.HostErrataCountModel > countModelProvider ) { org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.Erratum , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.HostErrataListModel > result = new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.Erratum , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.HostErrataListModel > ( eventBus , defaultConfirmPopupProvider ) ; result.setMainModelProvider ( mainModelProvider ) ; result.setModelProvider ( modelProvider ) ; return result ; }

Target:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.Erratum , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.HostErrataListModel > getHostErrataListProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel < java.lang.Void > > mainModelProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.HostErrataListModel > modelProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.HostErrataCountModel > countModelProvider ) { org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.Erratum , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.HostErrataListModel > result = new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider ( eventBus , defaultConfirmPopupProvider ) ; result.setMainModelProvider ( mainModelProvider ) ; result.setModelProvider ( modelProvider ) ; return result ; }
Source:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }

Target:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }
Source:
public void Maintenance ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_domains > Cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( a.getId ( ) , getEntity ( ) . getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.DeactivateStorageDomain , pb ) ; }

Target:
public void Maintenance ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( a.getId ( ) , getEntity ( ) . getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.DeactivateStorageDomain , pb ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpManagementNetworkExpectation ( ) ; control.replay ( ) ; final org.ovirt.engine.core.common.businessentities.Cluster cluster = resource.get ( ) ; verifyModel ( cluster , 0 ) ; verifyManagementNetwork ( cluster ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpManagementNetworkExpectation ( ) ; final org.ovirt.engine.core.common.businessentities.Cluster cluster = resource.get ( ) ; verifyModel ( cluster , 0 ) ; verifyManagementNetwork ( cluster ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "dataCenter.name|id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "dataCenter.name|id" ) ; } }
Source:
public void shouldElectActiveSharedDataDomain ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = prepareSharedStorageDomainForElection ( StorageDomainStatus.Active , "shared domain name" ) ; org.mockito.Mockito.when ( hostedEngineHelper.isHostedEngineStorageDomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertEquals ( domain , cmd.electNewMaster ( ) ) ; }

Target:
public void shouldElectActiveSharedDataDomain ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = prepareSharedStorageDomainForElection ( StorageDomainStatus.Active , "shared domain name" ) ; org.junit.Assert.assertEquals ( domain , cmd.electNewMaster ( ) ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , final org.ovirt.engine.ui.uicommonweb.models.ListModel model , com.google.gwt.safehtml.shared.SafeHtml tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < org.ovirt.engine.ui.uicommonweb.models.ListModel > valueUpdater ) { delegate.onBrowserEvent ( context , parent , renderer.render ( ( ( T ) ( model.getSelectedItem ( ) ) ) ) , event , new com.google.gwt.cell.client.ValueUpdater < java.lang.String > ( ) { @ java.lang.Override public void update ( java.lang.String value ) { if ( value != null ) { model.setSelectedItem ( entityByName.get ( value ) ) ; } } } ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , final org.ovirt.engine.ui.uicommonweb.models.ListModel model , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < org.ovirt.engine.ui.uicommonweb.models.ListModel > valueUpdater ) { delegate.onBrowserEvent ( context , parent , renderer.render ( ( ( T ) ( model.getSelectedItem ( ) ) ) ) , event , new com.google.gwt.cell.client.ValueUpdater < java.lang.String > ( ) { @ java.lang.Override public void update ( java.lang.String value ) { if ( value != null ) { model.setSelectedItem ( entityByName.get ( value ) ) ; } } } ) ; }
Source:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.ResetGlusterVolumeOptionsCommand command ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( command ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( volumeDao ) . getById ( null ) ; }

Target:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.ResetGlusterVolumeOptionsCommand command ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( command ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( command ) . getUpServer ( ) ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( ! ( isVisible ( value ) ) ) { return ; } sb.appendHtmlConstant ( ( ( "<table id=\"" + id ) + "\" style=\"margin:0 auto\"><tr>" ) ) ; java.util.Iterator < com.google.gwt.cell.client.HasCell < T , ? > > iterator = hasCells.iterator ( ) ; while ( iterator.hasNext ( ) ) { render ( context , value , sb , iterator.next ( ) , id ) ; } sb.appendHtmlConstant ( "</tr></table>" ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { sb.appendHtmlConstant ( ( ( "<table id=\"" + id ) + "\" style=\"margin:0 auto\"><tr>" ) ) ; java.util.Iterator < com.google.gwt.cell.client.HasCell < T , ? > > iterator = hasCells.iterator ( ) ; while ( iterator.hasNext ( ) ) { render ( context , value , sb , iterator.next ( ) , id ) ; } sb.appendHtmlConstant ( "</tr></table>" ) ; }
Source:
public void onSuccessAudit ( ) { mockExecutor ( true ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . teardown ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 2 ) ) . log ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; }

Target:
public void onSuccessAudit ( ) { mockExecutor ( true ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . teardown ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 2 ) ) . log ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected void revertTasks ( ) { org.ovirt.engine.core.compat.Guid destImageId = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ; org.ovirt.engine.core.common.action.RemoveImageParameters p = new org.ovirt.engine.core.common.action.RemoveImageParameters ( destImageId ) ; p.setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.VM , destImageId ) ) ; p.setParentParameters ( p ) ; p.setParentCommand ( VdcActionType.RemoveImage ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = checkAndPerformRollbackUsingCommand ( VdcActionType.RemoveImage , p ) ; if ( returnValue.getSucceeded ( ) ) { startPollingAsyncTasks ( returnValue.getInternalVdsmTaskIdList ( ) ) ; } }

Target:
protected void revertTasks ( ) { org.ovirt.engine.core.compat.Guid destImageId = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ; org.ovirt.engine.core.common.action.RemoveImageParameters p = new org.ovirt.engine.core.common.action.RemoveImageParameters ( destImageId ) ; p.setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , destImageId ) ) ; p.setParentParameters ( p ) ; p.setParentCommand ( VdcActionType.RemoveImage ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = checkAndPerformRollbackUsingCommand ( VdcActionType.RemoveImage , p ) ; if ( returnValue.getSucceeded ( ) ) { startPollingAsyncTasks ( returnValue.getInternalVdsmTaskIdList ( ) ) ; } }