auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addISCSINonEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( newISCSIConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void addISCSINonEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void checkExecuteCommandWithNullVdsId ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; parameters.setVdsId ( null ) ; org.mockito.Mockito.doNothing ( ) . when ( storageServerConnectionDao ) . remove ( NFSConnection.getid ( ) ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.never ( ) ) . disconnectStorage ( ) ; }

Target:
public void checkExecuteCommandWithNullVdsId ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; parameters.setVdsId ( null ) ; org.mockito.Mockito.doNothing ( ) . when ( storageServerConnectionDao ) . remove ( NFSConnection.getId ( ) ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.never ( ) ) . disconnectStorage ( ) ; }
Source:
public void pmHealthCheck ( ) { if ( ! ( active ) ) { try { synchronized ( org.ovirt.engine.core.bll.pm.PmHealthCheckManager.instance ) { org.ovirt.engine.core.bll.pm.PmHealthCheckManager.log.info ( "Power Management Health Check started." ) ; active = true ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( host.isPmEnabled ( ) ) { pmHealthCheck ( host ) ; } } org.ovirt.engine.core.bll.pm.PmHealthCheckManager.log.info ( "Power Management Health Check completed." ) ; } } finally { active = false ; } } }

Target:
public void pmHealthCheck ( ) { if ( ! ( active ) ) { try { synchronized ( this ) { org.ovirt.engine.core.bll.pm.PmHealthCheckManager.log.info ( "Power Management Health Check started." ) ; active = true ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( host.isPmEnabled ( ) ) { pmHealthCheck ( host ) ; } } org.ovirt.engine.core.bll.pm.PmHealthCheckManager.log.info ( "Power Management Health Check completed." ) ; } } finally { active = false ; } } }
Source:
public void testGetDiskAttachedToVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregisteredDisk = dao.getByDiskIdAndStorageDomainId ( FixturesTool.UNREGISTERED_DISK2 , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( "Disk should exists in the UnregisteredDisks table" , ( ! ( unregisteredDisk.isEmpty ( ) ) ) ) ; org.junit.Assert.assertTrue ( "Disk should have one vm attached" , ( ( unregisteredDisk.get ( 0 ) . getVms ( ) . size ( ) ) == 1 ) ) ; }

Target:
public void testGetDiskAttachedToVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregisteredDisk = dao.getByDiskIdAndStorageDomainId ( FixturesTool.UNREGISTERED_DISK2 , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( "Disk should exists in the UnregisteredDisks table" , ( ! ( unregisteredDisk.isEmpty ( ) ) ) ) ; org.junit.Assert.assertEquals ( "Disk should have one vm attached" , 1 , unregisteredDisk.get ( 0 ) . getVms ( ) . size ( ) ) ; }
Source:
public void testSetValidatorWithOutKey ( ) { org.ovirt.engine.core.config.EngineConfigMap engineConfigMap = org.mockito.Mockito.mock ( org.ovirt.engine.core.config.EngineConfigMap.class ) ; org.mockito.Mockito.when ( engineConfigMap.getKey ( ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( engineConfigMap.getValue ( ) ) . thenReturn ( "valueToSet" ) ; org.ovirt.engine.core.config.validation.ConfigActionType setAction = org.ovirt.engine.core.config.validation.ConfigActionType.ACTION_SET ; setAction.validate ( engineConfigMap ) ; }

Target:
public void testSetValidatorWithOutKey ( ) { org.ovirt.engine.core.config.EngineConfigMap engineConfigMap = org.mockito.Mockito.mock ( org.ovirt.engine.core.config.EngineConfigMap.class ) ; org.mockito.Mockito.when ( engineConfigMap.getValue ( ) ) . thenReturn ( "valueToSet" ) ; org.ovirt.engine.core.config.validation.ConfigActionType setAction = org.ovirt.engine.core.config.validation.ConfigActionType.ACTION_SET ; setAction.validate ( engineConfigMap ) ; }
Source:
public void run ( ) { try { backend.RunAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.Logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getUserId ( ) ) ) ) ; } sh.clean ( ) ; } }

Target:
public void run ( ) { try { backend.RunAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.Logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getId ( ) ) ) ) ; } sh.clean ( ) ; } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVnicProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; control.replay ( ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVnicProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testOtherFieldsNotValidatedInImport ( ) { final org.ovirt.engine.core.common.action.ImportVmTemplateParameters parameters = createParameters ( ) ; org.junit.Assert.assertFalse ( ( ( org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions.GENERAL_DOMAIN_SIZE ) > ( string100.length ( ) ) ) ) ; parameters.setImportAsNewEntity ( true ) ; org.ovirt.engine.core.bll.exportimport.ImportVmTemplateCommand command = createImportVmTemplateCommandSpy ( parameters ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.action.ImportVmTemplateParameters > > validate = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) . validate ( parameters , command.getValidationGroups ( ) . toArray ( new java.lang.Class < ? > [ 0 ] ) ) ; org.junit.Assert.assertTrue ( validate.isEmpty ( ) ) ; }

Target:
public void testOtherFieldsNotValidatedInImport ( ) { org.junit.Assert.assertFalse ( ( ( org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions.GENERAL_DOMAIN_SIZE ) > ( string100.length ( ) ) ) ) ; command.getParameters ( ) . setImportAsNewEntity ( true ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.action.ImportVmTemplateParameters > > validate = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) . validate ( command.getParameters ( ) , command.getValidationGroups ( ) . toArray ( new java.lang.Class < ? > [ 0 ] ) ) ; org.junit.Assert.assertTrue ( validate.isEmpty ( ) ) ; }
Source:
public void testCredentialsWithNoConnectionExtension ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections conn = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.createConnectionWithCredentials ( "target1" , "userConn" , "pwdConn" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > credentials = helper.getStorageConnectionCredentialsForhost ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , conn ) ; org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.assertCredentials ( credentials , conn.getUserName ( ) , conn.getPassword ( ) ) ; }

Target:
public void testCredentialsWithNoConnectionExtension ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections conn = org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.createConnectionWithCredentials ( "target1" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > credentials = helper.getStorageConnectionCredentialsForhost ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , conn ) ; org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelperTest.assertCredentials ( credentials , conn.getUserName ( ) , conn.getPassword ( ) ) ; }
Source:
private boolean canRemoveLunDisk ( ) { if ( ( disk.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.VM ) ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : getVmsForDiskId ( ) ) { if ( ( vm.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = getVmDeviceDAO ( ) . get ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vm.getId ( ) ) ) ; if ( vmDevice.getIsPlugged ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; return false ; } } } } return true ; }

Target:
private boolean canRemoveLunDisk ( ) { if ( ( disk.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.VM ) ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : getVmsForDiskId ( ) ) { if ( ( vm.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = getVmDeviceDAO ( ) . get ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vm.getId ( ) ) ) ; if ( vmDevice.getIsPlugged ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; return false ; } } } } return true ; }
Source:
protected void executeQueryCommand ( ) { final int pageSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.JobPageSize ) ; int offset = java.lang.Math.max ( org.ovirt.engine.core.bll.GetJobsByOffsetQuery.getParameters ( ) . getOffset ( ) , 0 ) ; java.util.List < org.ovirt.engine.core.common.job.Job > jobs = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getJobDao ( ) . getJobsByOffsetAndPageSize ( ( offset * pageSize ) , pageSize ) ; org.ovirt.engine.core.bll.GetJobsByOffsetQuery.getQueryReturnValue ( ) . setReturnValue ( jobs ) ; }

Target:
protected void executeQueryCommand ( ) { final int pageSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.JobPageSize ) ; int offset = java.lang.Math.max ( org.ovirt.engine.core.bll.GetJobsByOffsetQuery.getParameters ( ) . getOffset ( ) , 0 ) ; java.util.List < org.ovirt.engine.core.common.job.Job > jobs = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getJobDao ( ) . getJobsByOffsetAndPageSize ( ( offset * pageSize ) , pageSize ) ; org.ovirt.engine.core.bll.GetJobsByOffsetQuery.getQueryReturnValue ( ) . setReturnValue ( jobs ) ; }
Source:
private void addVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStatisticsDao ( ) . save ( stats ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getCompensationContext ( ) . snapshotNewEntity ( stats ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getCompensationContext ( ) . stateChanged ( ) ; }

Target:
private void addVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( getVmId ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getVmStatisticsDao ( ) . save ( stats ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getCompensationContext ( ) . snapshotNewEntity ( stats ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getCompensationContext ( ) . stateChanged ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "IsAvailable" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ) ) { boolean value = getIsAvailable ( ) ; getPluginType ( ) . setIsAvailable ( value ) ; isPluginConfigurationAvailable ( ) . setEntity ( ( value && ( ! ( org.ovirt.engine.ui.uicommonweb.models.providers.NeutronPluginTranslator.isDisplayStringCustom ( ( ( java.lang.String ) ( getPluginType ( ) . getSelectedItem ( ) ) ) ) ) ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "IsAvailable" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ) ) { boolean value = getIsAvailable ( ) ; getPluginType ( ) . setIsAvailable ( value ) ; isPluginConfigurationAvailable ( ) . setEntity ( ( value && ( ! ( org.ovirt.engine.ui.uicommonweb.models.providers.NeutronPluginTranslator.isDisplayStringCustom ( getPluginType ( ) . getSelectedItem ( ) ) ) ) ) ) ; } }
Source:
public void testUpdateDoesntChangeExternalId ( ) { org.ovirt.engine.core.common.businessentities.DbUser userBefore = dao.get ( existingUser.getId ( ) ) ; dao.update ( userBefore ) ; org.ovirt.engine.core.common.businessentities.DbUser userAfter = dao.get ( existingUser.getId ( ) ) ; org.junit.Assert.assertTrue ( java.util.Arrays.equals ( userBefore.getExternalId ( ) , userAfter.getExternalId ( ) ) ) ; }

Target:
public void testUpdateDoesntChangeExternalId ( ) { org.ovirt.engine.core.common.businessentities.DbUser userBefore = dao.get ( existingUser.getId ( ) ) ; dao.update ( userBefore ) ; org.ovirt.engine.core.common.businessentities.DbUser userAfter = dao.get ( existingUser.getId ( ) ) ; org.junit.Assert.assertEquals ( userBefore.getExternalId ( ) , userAfter.getExternalId ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getFiltered ( java.lang.String filter ) { java.lang.String url = ( ( hostProvider.getUrl ( ) ) + ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.HOSTS_ENTRY_POINT ) ) + ( java.lang.String.format ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.SEARCH_QUERY_FORMAT , filter ) ) ; org.apache.commons.httpclient.HttpMethod method = new org.apache.commons.httpclient.methods.GetMethod ( url ) ; return runHostListMethod ( method ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getFiltered ( java.lang.String filter ) { java.lang.String url = ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.HOSTS_ENTRY_POINT ) + ( java.lang.String.format ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.SEARCH_QUERY_FORMAT , filter ) ) ; org.apache.commons.httpclient.HttpMethod method = new org.apache.commons.httpclient.methods.GetMethod ( url ) ; return runHostListMethod ( method ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { org.ovirt.engine.core.common.businessentities.Network network = getNetwork ( ) ; org.ovirt.engine.core.compat.Guid networkId = ( network == null ) ? null : network.getId ( ) ; return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( networkId , org.ovirt.engine.core.common.VdcObjectType.Network , org.ovirt.engine.core.bll.network.dc.NetworkCommon.getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = getNetwork ( ) ; org.ovirt.engine.core.compat.Guid networkId = ( network == null ) ? null : network.getId ( ) ; return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( networkId , org.ovirt.engine.core.common.VdcObjectType.Network , org.ovirt.engine.core.bll.network.dc.NetworkCommon.getActionType ( ) . getActionGroup ( ) ) ) ; }
Source:
private void VolumeType_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VolumeType volumeType = ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.VolumeType.Unassigned : ( ( org.ovirt.engine.core.common.businessentities.VolumeType ) ( getVolumeType ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = ( ( getStorageDomain ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.StorageType.UNKNOWN : ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) . getStorageType ( ) ; updateVolumeFormat ( volumeType , storageType ) ; updateShareable ( volumeType , storageType ) ; }

Target:
private void VolumeType_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VolumeType volumeType = ( ( org.ovirt.engine.core.common.businessentities.VolumeType ) ( getVolumeType ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = ( ( getStorageDomain ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.StorageType.UNKNOWN : ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) . getStorageType ( ) ; updateVolumeFormat ( volumeType , storageType ) ; updateShareable ( volumeType , storageType ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 ) ; setUpGetBallooningExpectations ( ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }
Source:
protected void postInitDisks ( ) { onDataLoad ( ) ; checkDestFormatCompatibility ( ) ; stopProgress ( ) ; getStorage ( ) . getSelectedItemChangedEvent ( ) . 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 ) { onDataLoad ( ) ; } } ) ; }

Target:
protected void postInitDisks ( ) { onDataLoad ( ) ; checkDestFormatCompatibility ( ) ; stopProgress ( ) ; getStorage ( ) . getSelectedItemChangedEvent ( ) . 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 ) { onDataLoad ( ) ; } } ) ; }
Source:
public void postUpdateNumOfSockets2 ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfCPUsPerSocket ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; } } , getModel ( ) . getHash ( ) ) , version ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = this ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; }
Source:
public void testSwitchStorageDomainType ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void testSwitchStorageDomainType ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean isBootableMarked = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; parentModel.getIsBootable ( ) . setIsChangeable ( ( ! isBootableMarked ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean isBootableMarked = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; getIsBootable ( ) . setIsChangeable ( ( ! isBootableMarked ) ) ; }
Source:
public boolean storageDomainRemoved ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . get ( storageDomain.getStorage ( ) ) ; if ( connection != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } return true ; }

Target:
public boolean storageDomainRemoved ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . get ( storageDomain.getStorage ( ) ) ; if ( connection != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getId ( ) ) ; } return true ; }
Source:
private void handleActionWithoutKey ( java.lang.String action ) { engineConfigMap.setConfigAction ( org.ovirt.engine.core.config.validation.ConfigActionType.getActionType ( action ) ) ; if ( ( getConfigAction ( ) ) == null ) { org.ovirt.engine.core.config.EngineConfigCLIParser.log.debug ( ( ( "parseAction error: Illegal first argument: '" + action ) + "' - not a legal action." ) ) ; throw new java.lang.IllegalArgumentException ( ( ( "Action verb must come first, and '" + action ) + "\' is not an action.\nPlease tell me what to do: list? get? set? get-all?" ) ) ; } }

Target:
private void handleActionWithoutKey ( java.lang.String action ) { engineConfigMap.setConfigAction ( org.ovirt.engine.core.config.validation.ConfigActionType.getActionType ( action ) ) ; if ( ( getConfigAction ( ) ) == null ) { throw new java.lang.IllegalArgumentException ( ( ( "Action verb must come first, and '" + action ) + "\' is not an action.\nPlease tell me what to do: list? get? set? get-all?" ) ) ; } }
Source:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object a : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( a ) ) ; pb.add ( new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( network.getDataCenterId ( ) . getValue ( ) , network ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RemoveNetwork , pb ) ; sourceListModel.setConfirmWindow ( null ) ; }

Target:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object a : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( a ) ) ; pb.add ( new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( network.getDataCenterId ( ) , network ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RemoveNetwork , pb ) ; sourceListModel.setConfirmWindow ( null ) ; }
Source:
private void fillDefaultScores ( java.util.List < 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 ) { for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { scores.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > ( host.getId ( ) , org.ovirt.engine.core.bll.scheduling.policyunits.HaReservationWeightPolicyUnit.DEFAULT_SCORE ) ) ; } }

Target:
private void fillDefaultScores ( java.util.List < 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 ) { for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { scores.add ( new org.ovirt.engine.core.common.utils.Pair ( host.getId ( ) , org.ovirt.engine.core.bll.scheduling.policyunits.HaReservationWeightPolicyUnit.DEFAULT_SCORE ) ) ; } }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.MigrateModel object ) { driver.edit ( object ) ; updateMessages ( object ) ; object.getPropertyChangedEvent ( ) . 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 ) { if ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) { updateMessages ( object ) ; } } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.MigrateModel object ) { driver.edit ( object ) ; updateMessages ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { updateMessages ( object ) ; } } ) ; }
Source:
public static boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }

Target:
public boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }
Source:
private org.ovirt.engine.core.common.businessentities.IscsiBond createIscsiBond ( ) { org.ovirt.engine.core.common.businessentities.IscsiBond newIscsiBond = new org.ovirt.engine.core.common.businessentities.IscsiBond ( ) ; newIscsiBond.setStoragePoolId ( getStoragePool ( ) . getId ( ) ) ; newIscsiBond.setName ( ( ( java.lang.String ) ( getName ( ) . getEntity ( ) ) ) ) ; newIscsiBond.setDescription ( ( ( java.lang.String ) ( getDescription ( ) . getEntity ( ) ) ) ) ; newIscsiBond.setNetworkIds ( getSelectedNetworks ( ) ) ; newIscsiBond.setStorageConnectionIds ( getSelectedConnections ( ) ) ; return newIscsiBond ; }

Target:
private org.ovirt.engine.core.common.businessentities.IscsiBond createIscsiBond ( ) { org.ovirt.engine.core.common.businessentities.IscsiBond newIscsiBond = new org.ovirt.engine.core.common.businessentities.IscsiBond ( ) ; newIscsiBond.setStoragePoolId ( getStoragePool ( ) . getId ( ) ) ; newIscsiBond.setName ( getName ( ) . getEntity ( ) ) ; newIscsiBond.setDescription ( getDescription ( ) . getEntity ( ) ) ; newIscsiBond.setNetworkIds ( getSelectedNetworks ( ) ) ; newIscsiBond.setStorageConnectionIds ( getSelectedConnections ( ) ) ; return newIscsiBond ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model = createIncompleteNetworkAttachment ( ) ; setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.setUpBasicUriExpectations ( ) ) ; setUpVerifyHostExpectations ( ) ; control.replay ( ) ; try { collection.add ( model ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkAttachment" , "add" , getIncompleteFields ( ) ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model = createIncompleteNetworkAttachment ( ) ; setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.setUpBasicUriExpectations ( ) ) ; setUpVerifyHostExpectations ( ) ; try { collection.add ( model ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkAttachment" , "add" , getIncompleteFields ( ) ) ; } }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RemoveGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; setUpMocksForRemove ( ) ; mockBackend ( false , EngineError.GlusterHookRemoveFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . remove ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_REMOVE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RemoveGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; setUpMocksForRemove ( ) ; mockBackend ( false , EngineError.GlusterHookRemoveFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . remove ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_REMOVE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void testDoGet_ExtraAttributes_WithoutUserInfoObject ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.doReturn ( mockApplicationModeObject ) . when ( testServlet ) . getApplicationModeObject ( org.mockito.ArgumentMatchers.nullable ( java.lang.Integer.class ) ) ; org.mockito.Mockito.doReturn ( mockPluginDefinitionsArray ) . when ( testServlet ) . getPluginDefinitionsArray ( org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData.class ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_APPLICATION_MODE , mockApplicationModeObject ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_PLUGIN_DEFS , mockPluginDefinitionsArray ) ; }

Target:
public void testDoGet_ExtraAttributes_WithoutUserInfoObject ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.doReturn ( mockApplicationModeObject ) . when ( testServlet ) . getApplicationModeObject ( org.mockito.ArgumentMatchers.nullable ( java.lang.Integer.class ) ) ; org.mockito.Mockito.doReturn ( mockPluginDefinitionsArray ) . when ( testServlet ) . getPluginDefinitionsArray ( org.mockito.ArgumentMatchers.any ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_APPLICATION_MODE , mockApplicationModeObject ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_PLUGIN_DEFS , mockPluginDefinitionsArray ) ; }
Source:
protected void removeQuotaCommandLeftOver ( ) { if ( ! ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.isInternalExecution ( ) ) ) { org.ovirt.engine.core.bll.QuotaManager.removeStorageDeltaQuotaCommand ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getQuotaId ( ) , getDisksList ( ) . get ( 0 ) . getstorage_ids ( ) . get ( 0 ) . getValue ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getCommandId ( ) ) ; } }

Target:
protected void removeQuotaCommandLeftOver ( ) { if ( ( ! ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.isInternalExecution ( ) ) ) && ( ( getDisksList ( ) . size ( ) ) > 0 ) ) { org.ovirt.engine.core.bll.QuotaManager.removeStorageDeltaQuotaCommand ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getQuotaId ( ) , getDisksList ( ) . get ( 0 ) . getstorage_ids ( ) . get ( 0 ) . getValue ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getCommandId ( ) ) ; } }
Source:
static org.ovirt.engine.api.model.Disk getModel ( int index ) { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setFormat ( DiskFormat.COW.toString ( ) ) ; model.setInterface ( DiskInterface.VirtIO.toString ( ) ) ; model.setSparse ( true ) ; model.setBootable ( false ) ; model.setShareable ( false ) ; model.setAllowSnapshot ( false ) ; model.setPropagateErrors ( true ) ; return model ; }

Target:
static org.ovirt.engine.api.model.Disk getModel ( int index ) { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setFormat ( DiskFormat.COW.toString ( ) ) ; model.setInterface ( DiskInterface.VirtIO.toString ( ) ) ; model.setSparse ( true ) ; model.setBootable ( false ) ; model.setShareable ( false ) ; model.setPropagateErrors ( true ) ; return model ; }
Source:
protected void init ( ) { super . init ( ) ; resource.getParent ( ) . backend = backend ; resource.getParent ( ) . sessionHelper = sessionHelper ; resource.getParent ( ) . mappingLocator = resource.mappingLocator ; resource.getParent ( ) . httpHeaders = httpHeaders ; resource.getParent ( ) . messageBundle = messageBundle ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; }

Target:
protected void init ( ) { super . init ( ) ; resource.getParent ( ) . backend = backend ; resource.getParent ( ) . mappingLocator = resource.mappingLocator ; resource.getParent ( ) . httpHeaders = httpHeaders ; resource.getParent ( ) . messageBundle = messageBundle ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; }
Source:
private static void copyFile ( java.lang.String srcFilePath , java.lang.String dstFilePath ) throws java.io.IOException { java.io.InputStream in = new java.io.FileInputStream ( srcFilePath ) ; java.io.OutputStream out = new java.io.FileOutputStream ( dstFilePath ) ; byte [ ] buf = new byte [ 1024 ] ; int len ; while ( ( len = in.read ( buf ) ) > 0 ) { out.write ( buf , 0 , len ) ; } in.close ( ) ; out.close ( ) ; }

Target:
private static void copyFile ( java.lang.String srcFilePath , java.lang.String dstFilePath ) throws java.io.IOException { try ( java.io.FileInputStream in = new java.io.FileInputStream ( srcFilePath ) ) { try ( java.io.FileOutputStream out = new java.io.FileOutputStream ( dstFilePath ) ) { byte [ ] buf = new byte [ 1024 ] ; int len ; while ( ( len = in.read ( buf ) ) > 0 ) { out.write ( buf , 0 , len ) ; } } } }
Source:
public java.lang.Void runInTransaction ( ) { addVmImagesAndSnapshots ( ) ; updateSnapshotsFromExport ( ) ; MoveOrCopyAllImageGroups ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVm ( ) . getStaticData ( ) ) ; org.ovirt.engine.core.bll.VmHandler.LockVm ( getVm ( ) . getId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { getParameters ( ) . setVm ( getVm ( ) ) ; setVmId ( getVm ( ) . getId ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { addVmImagesAndSnapshots ( ) ; updateSnapshotsFromExport ( ) ; MoveOrCopyAllImageGroups ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVm ( ) . getStaticData ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; org.ovirt.engine.core.bll.VmHandler.LockVm ( getVm ( ) . getId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { getParameters ( ) . setVm ( getVm ( ) ) ; setVmId ( getVm ( ) . getId ( ) ) ; } return null ; }
Source:
public void runCommand ( ) throws org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult { java.lang.String action = args.get ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_ACTION ) ; if ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ACTION_ADD.equals ( action ) ) { addDomain ( ) ; } else if ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ACTION_EDIT.equals ( action ) ) { editDomain ( ) ; } else if ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ACTION_DELETE.equals ( action ) ) { deleteDomain ( ) ; } else if ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ACTION_VALIDATE.equals ( action ) ) { validate ( ) ; } else if ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ACTION_LIST.equals ( action ) ) { getConfiguration ( ) ; } }

Target:
public void runCommand ( ) throws org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult { if ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ACTION_ADD.equals ( action ) ) { addDomain ( ) ; } else if ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ACTION_EDIT.equals ( action ) ) { editDomain ( ) ; } else if ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ACTION_DELETE.equals ( action ) ) { deleteDomain ( ) ; } else if ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ACTION_VALIDATE.equals ( action ) ) { validate ( ) ; } else if ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ACTION_LIST.equals ( action ) ) { getConfiguration ( ) ; } }
Source:
protected org.ovirt.engine.api.model.HostNIC addMasterLink ( org.ovirt.engine.api.model.HostNIC nic , java.lang.String bondName , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface i : ifaces ) { if ( i.getName ( ) . equals ( bondName ) ) { nic.getLinks ( ) . add ( masterLink ( i.getId ( ) . toString ( ) ) ) ; break ; } } return nic ; }

Target:
protected org.ovirt.engine.api.model.HostNIC addMasterLink ( org.ovirt.engine.api.model.HostNIC nic , java.lang.String bondName , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : ifaces ) { if ( i.getName ( ) . equals ( bondName ) ) { nic.getLinks ( ) . add ( masterLink ( i.getId ( ) . toString ( ) ) ) ; break ; } } return nic ; }
Source:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getValidationMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getMacPool ( ) ) ; }

Target:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getValidationMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , getMacPool ( ) ) ; }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( org.ovirt.engine.core.compat.Guid diskId , org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( diskId , vmId ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , true , false , "" , null , null ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( org.ovirt.engine.core.compat.Guid diskId , org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( diskId , vmId ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , true , false , "" , null , null , null ) ; }