auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void createUpStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; pool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; }

Target:
private void createUpStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; pool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( pool ) ; }
Source:
public static java.util.List < java.lang.String > runAndAssertSetActionMessageParameters ( java.lang.String assertionMessage , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.errors.VdcBllMessages ... messages ) { command.setActionMessageParameters ( ) ; for ( org.ovirt.engine.core.common.errors.VdcBllMessages message : messages ) { org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( assertionMessage , command , message ) ; } return command.getReturnValue ( ) . getCanDoActionMessages ( ) ; }

Target:
public static java.util.List < java.lang.String > runAndAssertSetActionMessageParameters ( java.lang.String assertionMessage , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.errors.EngineMessage ... messages ) { command.setActionMessageParameters ( ) ; for ( org.ovirt.engine.core.common.errors.EngineMessage message : messages ) { org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( assertionMessage , command , message ) ; } return command.getReturnValue ( ) . getCanDoActionMessages ( ) ; }
Source:
public java.lang.Object call ( ) throws java.lang.Exception { java.lang.String minimal = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.BootstrapMinimalVdsmVersion ) ; if ( ( minimal.trim ( ) . length ( ) ) == 0 ) { _parser.cliNoop ( ) ; } else { _parser.cliEnvironmentSet ( VdsmEnv.VDSM_MINIMUM_VERSION , minimal ) ; } return null ; }

Target:
public java.lang.Object call ( ) throws java.lang.Exception { java.lang.String minimal = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.BootstrapMinimalVdsmVersion ) ; if ( ( minimal.trim ( ) . length ( ) ) == 0 ) { _parser.cliNoop ( ) ; } else { _parser.cliEnvironmentSet ( VdsmEnv.VDSM_MINIMUM_VERSION , minimal ) ; } return null ; }
Source:
public void testList ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmApplicationsResourceTest.VM_ID } , getVm ( ) ) ; control.replay ( ) ; verifyApplications ( resource.list ( ) ) ; }

Target:
public void testList ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmApplicationsResourceTest.VM_ID } , getVm ( ) ) ; verifyApplications ( resource.list ( ) ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.network.Network n ) { return ( ( n.getname ( ) . trim ( ) . toLowerCase ( ) . equals ( getNetworkName ( ) . trim ( ) . toLowerCase ( ) ) ) && ( ! ( n.getId ( ) . equals ( getNetwork ( ) . getId ( ) ) ) ) ) && ( getNetwork ( ) . getDataCenterId ( ) . equals ( n.getDataCenterId ( ) ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.network.Network n ) { return ( ( n.getName ( ) . trim ( ) . toLowerCase ( ) . equals ( getNetworkName ( ) . trim ( ) . toLowerCase ( ) ) ) && ( ! ( n.getId ( ) . equals ( getNetwork ( ) . getId ( ) ) ) ) ) && ( getNetwork ( ) . getDataCenterId ( ) . equals ( n.getDataCenterId ( ) ) ) ; }
Source:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > verfifyRunAction ( int exepectedNumOfRunActionExecutions , boolean showErrorDialog ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runAction ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.ActionParametersBase.class ) , callbackCaptor.capture ( ) , org.mockito.ArgumentMatchers.eq ( showErrorDialog ) ) ; java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks = callbackCaptor.getAllValues ( ) ; return callbacks ; }

Target:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > verfifyRunAction ( int exepectedNumOfRunActionExecutions , boolean showErrorDialog ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runAction ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.ArgumentMatchers.any ( ) , callbackCaptor.capture ( ) , org.mockito.ArgumentMatchers.eq ( showErrorDialog ) ) ; java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks = callbackCaptor.getAllValues ( ) ; return callbacks ; }
Source:
private java.lang.Boolean getAutoConverge ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.autoConvergence ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) { if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getAutoConverge ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getAutoConverge ( ) ; } if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . getAutoConverge ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . getAutoConverge ( ) ; } return org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DefaultAutoConvergence ) ; } return null ; }

Target:
private java.lang.Boolean getAutoConverge ( ) { if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getAutoConverge ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getAutoConverge ( ) ; } if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . getAutoConverge ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . getAutoConverge ( ) ; } return org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DefaultAutoConvergence ) ; }
Source:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public void testUpdateAll ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic existingVm2 = dao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ) ; existingVm.setStatus ( VMStatus.Down ) ; existingVm2.setVmIp ( "111" ) ; dao.updateAll ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmDynamic [ ] { existingVm , existingVm2 } ) ) ; org.junit.Assert.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }

Target:
public void testUpdateAll ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic existingVm2 = dao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ) ; existingVm.setStatus ( VMStatus.Down ) ; existingVm2.setVmIp ( "111" ) ; dao.updateAll ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmDynamic [ ] { existingVm , existingVm2 } ) ) ; org.junit.Assert.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }
Source:
private void doTestBadAddNic ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setGetTemplateQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmTemplateInterface , org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { PARENT_ID } , canDo , success ) ) ; org.ovirt.engine.api.model.NIC model = getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddNic ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmTemplateInterface , org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { PARENT_ID } , canDo , success ) ) ; org.ovirt.engine.api.model.NIC model = getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VmInit buildCloudInitParameters ( org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model ) { if ( ( ( java.lang.Boolean ) ( model.getIsSysprepEnabled ( ) . getEntity ( ) ) ) || ( ( java.lang.Boolean ) ( model.getIsCloudInitEnabled ( ) . getEntity ( ) ) ) ) { return buildModelSpecificParameters ( model.getIsWindowsOS ( ) , ( ( java.lang.String ) ( model.getSysPrepSelectedDomainName ( ) . getEntity ( ) ) ) ) ; } else { return null ; } }

Target:
public org.ovirt.engine.core.common.businessentities.VmInit buildCloudInitParameters ( org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model ) { if ( ( ( java.lang.Boolean ) ( model.getIsSysprepEnabled ( ) . getEntity ( ) ) ) || ( ( java.lang.Boolean ) ( model.getIsCloudInitEnabled ( ) . getEntity ( ) ) ) ) { return buildModelSpecificParameters ( model.getIsWindowsOS ( ) ) ; } else { return null ; } }
Source:
private void mockStoragePool ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( command.getParameters ( ) . getStoragePoolId ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; }

Target:
private void mockStoragePool ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( command.getParameters ( ) . getStoragePoolId ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( pool ) ; }
Source:
public void setupMocks ( ) { org.mockito.Mockito.when ( clusterDao.get ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getCluster ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( cmd ) . getClusterDao ( ) ; org.mockito.Mockito.when ( cmd.getSyncJobInstance ( ) ) . thenReturn ( hookSyncJob ) ; }

Target:
public void setupMocks ( ) { org.mockito.Mockito.when ( clusterDao.get ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getCluster ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( cmd ) . getClusterDao ( ) ; org.mockito.Mockito.doReturn ( hookSyncJob ) . when ( cmd ) . getSyncJobInstance ( ) ; }
Source:
private void endDefaultOperations ( ) { endUnlockOps ( ) ; if ( isTemplateVersion ( ) ) { java.lang.String jobId = getSchedulUtil ( ) . scheduleAOneTimeJob ( this , "updateVmVersion" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , 0 , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.core.bll.AddVmTemplateCommand.updateVmsJobIdMap.put ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getBaseTemplateId ( ) , jobId ) ; } }

Target:
private void endDefaultOperations ( ) { endUnlockOps ( ) ; if ( isTemplateVersion ( ) ) { org.ovirt.engine.core.bll.AddVmTemplateCommand.updateVmsJobIdMap.put ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getBaseTemplateId ( ) , null ) ; java.lang.String jobId = getSchedulUtil ( ) . scheduleAOneTimeJob ( this , "updateVmVersion" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , 0 , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.core.bll.AddVmTemplateCommand.updateVmsJobIdMap.put ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getBaseTemplateId ( ) , jobId ) ; } }
Source:
protected java.lang.String imageName ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel value ) { if ( value == null ) { return defaultImageName ( value ) ; } if ( value.isPool ( ) ) { return "poolVmIcon" ; } else if ( value.getIsServer ( ) ) { return "serverVmIcon" ; } return "desktopVmIcon" ; }

Target:
protected java.lang.String imageName ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel value ) { if ( value == null ) { return defaultImageName ( null ) ; } if ( value.isPool ( ) ) { return "poolVmIcon" ; } else if ( value.getIsServer ( ) ) { return "serverVmIcon" ; } return "desktopVmIcon" ; }
Source:
public void addNFSEmptyConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; parameters.setStoragePoolId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . initializeVds ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_CONNECTION ) ; }

Target:
public void addNFSEmptyConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_CONNECTION ) ; }
Source:
protected void executeCommand ( ) { if ( org.ovirt.engine.core.bll.CreateSnapshotCommand.canCreateSnapshot ( ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = performImageVdsmOperation ( ) ; if ( ( vdsReturnValue != null ) && ( vdsReturnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { processOldImageFromDb ( ) ; addDiskImageToDb ( newDiskImage , getCompensationContext ( ) ) ; setActionReturnValue ( newDiskImage ) ; setSucceeded ( true ) ; return null ; } } ) ; } } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = performImageVdsmOperation ( ) ; if ( ( vdsReturnValue != null ) && ( vdsReturnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { processOldImageFromDb ( ) ; addDiskImageToDb ( newDiskImage , getCompensationContext ( ) ) ; setActionReturnValue ( newDiskImage ) ; setSucceeded ( true ) ; return null ; } } ) ; } }
Source:
public void template_SelectedItemChanged ( ) { super . template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; if ( template == null ) { return ; } setupWindowModelFrom ( template , template.getStoragePoolId ( ) . getValue ( ) ) ; updateHostPinning ( template.getMigrationSupport ( ) ) ; doChangeDefautlHost ( template.getDedicatedVmForVds ( ) ) ; }

Target:
public void template_SelectedItemChanged ( ) { super . template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; if ( template == null ) { return ; } setupWindowModelFrom ( template , template.getStoragePoolId ( ) ) ; updateHostPinning ( template.getMigrationSupport ( ) ) ; doChangeDefautlHost ( template.getDedicatedVmForVds ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.NIC populate ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.Network network = findNetwork ( model ) ; model.getNetwork ( ) . setId ( network.getId ( ) . toString ( ) ) ; model.getNetwork ( ) . setName ( null ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.NIC populate ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.Network network = findNetwork ( model ) ; if ( network != null ) { model.getNetwork ( ) . setId ( network.getId ( ) . toString ( ) ) ; model.getNetwork ( ) . setName ( null ) ; } return model ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , 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 ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static java.lang.String CreateImageFile ( org.ovirt.engine.core.common.businessentities.DiskImage image ) { java.lang.String retVal = "" ; if ( ( image.getimage_group_id ( ) ) != null ) { retVal += image.getimage_group_id ( ) . getValue ( ) . toString ( ) ; } else { retVal += org.ovirt.engine.core.compat.Guid.Empty ; } retVal += "/" + ( image.getImageId ( ) . toString ( ) ) ; return retVal ; }

Target:
public static java.lang.String CreateImageFile ( org.ovirt.engine.core.common.businessentities.DiskImage image ) { java.lang.String retVal = "" ; if ( ( image.getId ( ) ) != null ) { retVal += image.getId ( ) . toString ( ) ; } else { retVal += org.ovirt.engine.core.compat.Guid.Empty ; } retVal += "/" + ( image.getImageId ( ) . toString ( ) ) ; return retVal ; }
Source:
protected boolean validateCreateImage ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.canDoAction ( VdcActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getContext ( ) . clone ( ) . getExecutionContext ( ) , true ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }

Target:
protected boolean validateCreateImage ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( VdcActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getContext ( ) . clone ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }
Source:
protected org.ovirt.engine.api.model.HostNic postPopulate ( org.ovirt.engine.api.model.HostNic model ) { org.ovirt.engine.api.model.HostNic hostNIC = super . postPopulate ( model ) ; org.ovirt.engine.api.model.Qos qos = hostNIC.getQos ( ) ; qos.setType ( QosType.HOSTNETWORK.name ( ) ) ; qos.setName ( null ) ; qos.setDataCenter ( null ) ; return hostNIC ; }

Target:
protected org.ovirt.engine.api.model.HostNic postPopulate ( org.ovirt.engine.api.model.HostNic model ) { org.ovirt.engine.api.model.HostNic hostNIC = super . postPopulate ( model ) ; org.ovirt.engine.api.model.Qos qos = hostNIC.getQos ( ) ; qos.setType ( QosType.HOSTNETWORK ) ; qos.setName ( null ) ; qos.setDataCenter ( null ) ; return hostNIC ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > perms = setUpPermissions ( ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , perms , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > perms = setUpPermissions ( ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , perms , failure ) ; control.replay ( ) ; }
Source:
public void getVdsWithVdsId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , v.getId ( ) ) ; }

Target:
public void getVdsWithVdsId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , v.getId ( ) ) ; }
Source:
private void addCollectionAction ( java.lang.String rel , java.lang.String [ ] periods , int i , java.lang.String period , org.ovirt.engine.sdk.codegen.holders.ResourceHolder resourceHolder , org.ovirt.engine.sdk.entities.DetailedLink detailedLink ) { java.lang.String methodName = getActionMethodName ( period , periods [ ( i - 3 ) ] ) ; if ( ! ( resourceHolder.hasMethod ( period ) ) ) { java.lang.String docParams = org.ovirt.engine.sdk.codegen.documentation.DocsGen.generate ( detailedLink ) ; resourceHolder.addMethod ( period , this . resourceActionMethodTemplate.getTemplate ( methodName , rel , docParams ) ) ; } }

Target:
private void addCollectionAction ( java.lang.String rel , java.lang.String [ ] periods , int i , java.lang.String period , org.ovirt.engine.sdk.codegen.holders.ResourceHolder resourceHolder , org.ovirt.engine.sdk.entities.DetailedLink detailedLink ) { java.lang.String methodName = getActionMethodName ( period , periods [ ( i - 3 ) ] ) ; if ( ! ( resourceHolder.hasMethod ( period ) ) ) { java.lang.String docParams = org.ovirt.engine.sdk.codegen.documentation.DocsGen.generate ( detailedLink ) ; resourceHolder.addMethod ( period , this . resourceActionMethodTemplate.getTemplate ( methodName , rel , docParams , detailedLink ) ) ; } }
Source:
private void initGeneralForm ( ) { org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > modelProvider = new org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > ( ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel getModel ( ) { return getTemplateGeneralModel ( ) ; } @ java.lang.Override public void onSubTabSelected ( ) { } @ java.lang.Override public void onSubTabDeselected ( ) { } } ; generalView = new org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportTemplateGeneralSubTabView ( modelProvider , constants ) ; }

Target:
private void initGeneralForm ( ) { org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > modelProvider = new org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > ( ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel getModel ( ) { return getTemplateGeneralModel ( ) ; } @ java.lang.Override public void onSubTabSelected ( ) { } @ java.lang.Override public void onSubTabDeselected ( ) { } } ; generalView = new org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportTemplateGeneralSubTabView ( modelProvider ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getRevertVDSParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( getEnclosingCommand ( ) . getParameters ( ) . getStoragePoolId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getTargetStorageDomainId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . get ( getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ) . isWipeAfterDelete ( ) , getEnclosingCommand ( ) . getParameters ( ) . getForceDelete ( ) , null ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getRevertVDSParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( getEnclosingCommand ( ) . getParameters ( ) . getStoragePoolId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getTargetStorageDomainId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . get ( getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ) . isWipeAfterDelete ( ) , getEnclosingCommand ( ) . getParameters ( ) . getForceDelete ( ) ) ; }
Source:
private void setBar ( com.google.gwt.user.client.ui.FlowPanel percentageBar , com.google.gwt.user.client.ui.Label percentageLabel , java.lang.Integer value , int fakeValue , java.lang.String style ) { if ( value != null ) { java.lang.String percentage = value + "%" ; java.lang.String fakePercentage = fakeValue + "%" ; percentageLabel.setText ( ( value < ( org.ovirt.engine.ui.userportal.widget.DoublePercentageProgressBar.MINIMUM_SIZE_TO_SHOW_TEXT ) ? "" : percentage ) ) ; percentageLabel.setStyleName ( style ) ; percentageBar.setWidth ( fakePercentage ) ; percentageBar.setVisible ( ( value != 0 ) ) ; percentageBar.setTitle ( percentage ) ; } }

Target:
private void setBar ( com.google.gwt.user.client.ui.FlowPanel percentageBar , com.google.gwt.user.client.ui.Label percentageLabel , java.lang.Integer value , int fakeValue , java.lang.String style ) { if ( value != null ) { java.lang.String percentage = value + "%" ; java.lang.String fakePercentage = fakeValue + "%" ; percentageLabel.setText ( ( value < ( org.ovirt.engine.ui.userportal.widget.DoublePercentageProgressBar.MINIMUM_SIZE_TO_SHOW_TEXT ) ? "" : percentage ) ) ; percentageLabel.setStyleName ( style ) ; percentageBar.setWidth ( fakePercentage ) ; percentageBar.setVisible ( ( value != 0 ) ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getMigratableVmsRunningOnVds ( final org.ovirt.engine.core.dao.VmDao vmDao , final org.ovirt.engine.core.compat.Guid hostId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsFromDB = vmDao.getAllRunningForVds ( hostId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( vmsFromDB , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.VM > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.VM v ) { return ( ( v.getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) && ( ( v.getDedicatedVmForVdsList ( ) . contains ( hostId ) ) == false ) ; } } ) ; return vms ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getMigratableVmsRunningOnVds ( final org.ovirt.engine.core.dao.VmDao vmDao , final org.ovirt.engine.core.compat.Guid hostId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsFromDB = vmDao.getAllRunningForVds ( hostId ) ; return org.ovirt.engine.core.utils.linq.LinqUtils.filter ( vmsFromDB , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.VM > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.VM v ) { return ( v.getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ; } } ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { newNetwork ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , EditNetworkModel.APPLY_COMMAND_NAME ) ) { apply ( ) ; } }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { newNetwork ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } }
Source:
public org.ovirt.engine.api.model.Hooks list ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > > hooksMap = getEntity ( java.util.HashMap.class , VdcQueryType.GetVdsHooksById , new org.ovirt.engine.core.common.queries.GetVdsHooksByIdParameters ( asGuid ( hostId ) ) , null ) ; return mapCollection ( hooksMap ) ; }

Target:
public org.ovirt.engine.api.model.Hooks list ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > > hooksMap = getEntity ( java.util.HashMap.class , VdcQueryType.GetVdsHooksById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( hostId ) ) , null ) ; return mapCollection ( hooksMap ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > spyVmCommand ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > spyVmCommand ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ) . when ( command ) . getVdsGroup ( ) ; return vm ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice.Source > mapRngSources ( org.ovirt.engine.api.model.RngSources model , java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice.Source > template ) { if ( ( model.getRngSources ( ) ) != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice.Source > result = new java.util.ArrayList < > ( ) ; for ( java.lang.String sourceString : model.getRngSources ( ) ) { try { org.ovirt.engine.api.model.RngSource source = org.ovirt.engine.api.model.RngSource.fromValue ( sourceString ) ; result.add ( org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( source , null ) ) ; } catch ( java.lang.IllegalArgumentException iae ) { } } return result ; } return null ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice.Source > mapRngSources ( java.util.List < java.lang.String > model ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice.Source > result = new java.util.ArrayList < > ( ( model != null ? model.size ( ) : 0 ) ) ; if ( model != null ) { for ( java.lang.String sourceString : model ) { try { org.ovirt.engine.api.model.RngSource source = org.ovirt.engine.api.model.RngSource.fromValue ( sourceString ) ; result.add ( org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( source , null ) ) ; } catch ( java.lang.IllegalArgumentException iae ) { } } } return result ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel moveDiskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImages = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; moveDiskModel.onInitAllDisks ( diskImages ) ; moveDiskModel.onInitDisks ( ) ; }

Target:
public void onSuccess ( java.util.List diskImages ) { onInitAllDisks ( diskImages ) ; onInitDisks ( ) ; }
Source:
public void delay ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "try to wait for te engine update the host memory and cpu stats" ) ; try { long t = java.lang.Math.max ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( vdsId ) . getLastUpdateElapsed ( ) , java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( org.ovirt.engine.core.common.config.ConfigValues.VdsRefreshRate ) ) ) ; t = java.lang.Math.max ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ThrottlerMaxWaitForVdsUpdateInMillis ) , t ) ; getBlockingQueue ( vdsId ) . poll ( t , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } catch ( java.lang.InterruptedException e ) { } }

Target:
public void delay ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "try to wait for te engine update the host memory and cpu stats" ) ; try { long t = java.lang.Math.max ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( vdsId ) . getLastUpdateElapsed ( ) , java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( org.ovirt.engine.core.common.config.ConfigValues.VdsRefreshRate ) ) ) ; t = java.lang.Math.max ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ThrottlerMaxWaitForVdsUpdateInMillis ) , t ) ; getBlockingQueue ( vdsId ) . poll ( t , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } catch ( java.lang.InterruptedException e ) { } }
Source:
public void activateItemsUpdate ( ) { disableItemsUpdate ( ) ; model.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 ) { updateItems ( ) ; } } ) ; updateItems ( ) ; }

Target:
public void activateItemsUpdate ( ) { disableItemsUpdate ( ) ; model.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 ) { updateItems ( ) ; } } ) ; updateItems ( ) ; }
Source:
private static void addAddress ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.util.Map < java.lang.String , java.lang.String > addressMap = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( vmDevice.getAddress ( ) ) ; if ( ! ( addressMap.isEmpty ( ) ) ) { struct.put ( VdsProperties.Address , addressMap ) ; } }

Target:
static void addAddress ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.util.Map < java.lang.String , java.lang.String > addressMap = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( vmDevice.getAddress ( ) ) ; if ( ! ( addressMap.isEmpty ( ) ) ) { struct.put ( VdsProperties.Address , addressMap ) ; } }
Source:
protected void startSubStep ( ) { asyncTaskStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( this . getExecutionContext ( ) , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , getStepType ( ) , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( getStepType ( ) , getStepMessageMap ( JobExecutionStatus.STARTED ) ) ) ; }

Target:
protected void startSubStep ( ) { asyncTaskStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( this . getExecutionContext ( ) , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , getStepType ( ) , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( getStepType ( ) , getStepMessageMap ( JobExecutionStatus.STARTED , null ) ) ) ; }
Source:
public void endWithFailure ( ) { for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : enclosingCommand.getParameters ( ) . getParametersList ( ) ) { updateDestinationImageId ( parameters ) ; } endCreateAllSnapshots ( ) ; unlockAllDiskSnapshots ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( enclosingCommand.getExecutionContext ( ) , false ) ; enclosingCommand.setExecutionContext ( null ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void endWithFailure ( ) { for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : enclosingCommand.getParameters ( ) . getParametersList ( ) ) { updateDestinationImageId ( parameters ) ; } endCreateAllSnapshots ( ) ; unlockAllDiskSnapshots ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( enclosingCommand.getExecutionContext ( ) , false ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , host ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
public void init ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { if ( qos == null ) { qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; } getOutAverageLinkshare ( ) . setEntity ( org.ovirt.engine.ui.uicompat.external.StringUtils.render ( qos.getOutAverageLinkshare ( ) ) ) ; getOutAverageUpperlimit ( ) . setEntity ( org.ovirt.engine.ui.uicompat.external.StringUtils.render ( qos.getOutAverageUpperlimit ( ) ) ) ; getOutAverageRealtime ( ) . setEntity ( org.ovirt.engine.ui.uicompat.external.StringUtils.render ( qos.getOutAverageRealtime ( ) ) ) ; }

Target:
public void init ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { if ( qos == null ) { qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; } getOutAverageLinkshare ( ) . setEntity ( render ( qos.getOutAverageLinkshare ( ) ) ) ; getOutAverageUpperlimit ( ) . setEntity ( render ( qos.getOutAverageUpperlimit ( ) ) ) ; getOutAverageRealtime ( ) . setEntity ( render ( qos.getOutAverageRealtime ( ) ) ) ; }
Source:
public void PostOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; Cancel ( ) ; if ( model.getIsNew ( ) ) { setGuideContext ( returnValue.getActionReturnValue ( ) ) ; UpdateActionAvailability ( ) ; getGuideCommand ( ) . Execute ( ) ; } }

Target:
public void PostOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; Cancel ( ) ; if ( ( ( model.getIsNew ( ) ) && ( returnValue != null ) ) && ( returnValue.getSucceeded ( ) ) ) { setGuideContext ( returnValue.getActionReturnValue ( ) ) ; UpdateActionAvailability ( ) ; getGuideCommand ( ) . Execute ( ) ; } }
Source:
public void migrationNotSupported ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }

Target:
public void migrationNotSupported ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }