auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateActionAvailability ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.LibvirtSecretModel > secrets = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.LibvirtSecretModel > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.LibvirtSecretModel > ( ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( secrets.size ( ) ) == 1 ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( secrets.size ( ) ) > 0 ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > secrets = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList < > ( ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( secrets.size ( ) ) == 1 ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( secrets.size ( ) ) > 0 ) ) ; }
Source:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.HostNic > nics = getCollection ( ) ; org.junit.Assert.assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.HostNic > nics = getCollection ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }
Source:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDefaultTimeZone , params , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void editCheckBoxes ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalConsolePopupModel model , org.ovirt.engine.ui.userportal.widget.popup.console.EntityModelValueCheckBoxEditor < org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel > ... checkBoxes ) { for ( org.ovirt.engine.ui.userportal.widget.popup.console.EntityModelValueCheckBoxEditor < org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel > checkBox : checkBoxes ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel defaultConsole = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( model.getModel ( ) . getSelectedItem ( ) ) ) . getDefaultConsole ( ) ; checkBox.asEditor ( ) . getSubEditor ( ) . setValue ( defaultConsole ) ; } }

Target:
private void editCheckBoxes ( org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel consoleModel , org.ovirt.engine.ui.userportal.widget.popup.console.EntityModelValueCheckBoxEditor < org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel > ... checkBoxes ) { for ( org.ovirt.engine.ui.userportal.widget.popup.console.EntityModelValueCheckBoxEditor < org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel > checkBox : checkBoxes ) { checkBox.asEditor ( ) . getSubEditor ( ) . setValue ( consoleModel ) ; } }
Source:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommandTest.CLUSTER_ID , null ) ) ) ; setupMocks ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackend ( cmd , false ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . addServerHookInDb ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE_FAILED ) ; }
Source:
protected javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DiskProfile diskProfile ) { validateParameters ( diskProfile ) ; org.ovirt.engine.api.model.DiskProfile map = map ( diskProfile ) ; org.ovirt.engine.core.common.action.DiskProfileParameters parameters = new org.ovirt.engine.core.common.action.DiskProfileParameters ( map ) ; return performCreate ( VdcActionType.AddDiskProfile , parameters , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetDiskProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
protected javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DiskProfile diskProfile ) { validateParameters ( diskProfile ) ; org.ovirt.engine.api.model.DiskProfile map = map ( diskProfile ) ; org.ovirt.engine.core.common.action.DiskProfileParameters parameters = new org.ovirt.engine.core.common.action.DiskProfileParameters ( map ) ; return performCreate ( ActionType.AddDiskProfile , parameters , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetDiskProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getGlusterVolume ( ) ; if ( volume.isOnline ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_ALREADY_STARTED ) ; addCanDoActionMessageVariable ( "volumeName" , volume.getName ( ) ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getGlusterVolume ( ) ; if ( volume.isOnline ( ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_ALREADY_STARTED ) ; addCanDoActionMessageVariable ( "volumeName" , volume.getName ( ) ) ; return false ; } return true ; }
Source:
public void testGetByServerIdAndServiceType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > services = dao.getByServerIdAndServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID , org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE1_TYPE ) ; org.junit.Assert.assertNotNull ( services ) ; org.junit.Assert.assertEquals ( 1 , services.size ( ) ) ; verifyServiceOnServer1 ( services.get ( 0 ) ) ; }

Target:
public void testGetByServerIdAndServiceType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > services = dao.getByServerIdAndServiceType ( FixturesTool.GLUSTER_BRICK_SERVER1 , org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE1_TYPE ) ; org.junit.Assert.assertNotNull ( services ) ; org.junit.Assert.assertEquals ( 1 , services.size ( ) ) ; verifyServiceOnServer1 ( services.get ( 0 ) ) ; }
Source:
private void setVmTemplateIdParameter ( ) { java.util.Map < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > templateMap = org.ovirt.engine.core.bll.RemoveDiskCommand.getDbFacade ( ) . getVmTemplateDao ( ) . getAllForImage ( getDiskImage ( ) . getImageId ( ) ) ; if ( ! ( templateMap.isEmpty ( ) ) ) { setVmTemplateId ( templateMap.values ( ) . iterator ( ) . next ( ) . getId ( ) ) ; } }

Target:
private void setVmTemplateIdParameter ( ) { java.util.Map < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > templateMap = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplateDAO ( ) . getAllForImage ( getDiskImage ( ) . getImageId ( ) ) ; if ( ! ( templateMap.isEmpty ( ) ) ) { setVmTemplateId ( templateMap.values ( ) . iterator ( ) . next ( ) . getId ( ) ) ; } }
Source:
protected void handleCopyResult ( org.ovirt.engine.core.common.businessentities.DiskImage copiedDiskImage , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.VolumeCreationError ) ; } else { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( copiedDiskImage ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getTaskIdList ( ) . addAll ( result.getInternalTaskIdList ( ) ) ; newDiskImages.add ( copiedDiskImage ) ; } }

Target:
protected void handleCopyResult ( org.ovirt.engine.core.common.businessentities.DiskImage copiedDiskImage , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.VolumeCreationError ) ; } else { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( copiedDiskImage ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getTaskIdList ( ) . addAll ( result.getInternalVdsmTaskIdList ( ) ) ; newDiskImages.add ( copiedDiskImage ) ; } }
Source:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status ) { setCommandStatus ( status , true ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > getAllEventNotificationMethods ( ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) ; org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > mapper = new org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.EventNotificationMethod mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.EventNotificationMethod entity = new org.ovirt.engine.core.common.businessentities.EventNotificationMethod ( ) ; entity.setmethod_id ( rs.getInt ( "method_id" ) ) ; entity.setmethod_type ( EventNotificationMethods.EMAIL ) ; return entity ; } } ; return getCallsHandler ( ) . executeReadList ( "GetAllFromevent_notification_methods" , mapper , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > getAllEventNotificationMethods ( ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromevent_notification_methods" , org.ovirt.engine.core.dao.EventDAODbFacadeImpl.EventNotificationMethodRowMapper.instance , parameterSource ) ; }
Source:
public void testCreateAndDeleteById ( ) { org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.Label label = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( ) . name ( "test label" ) . id ( guid ) . host ( host.getId ( ) ) . build ( ) ; dao.save ( label ) ; dao.remove ( label.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.Label read = dao.get ( guid ) ; org.junit.Assert.assertNull ( read ) ; }

Target:
public void testCreateAndDeleteById ( ) { org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.Label label = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( ) . name ( "test label" ) . id ( guid ) . host ( host.getId ( ) ) . build ( ) ; dao.save ( label ) ; dao.remove ( label.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.Label read = dao.get ( guid ) ; org.junit.jupiter.api.Assertions.assertNull ( read ) ; }
Source:
private com.google.gwt.user.client.ui.IsWidget getCurrentContent ( ) { assert ( contentContainer.getWidgetCount ( ) ) <= 1 : "MainContentView holds more than one content" ; return ( contentContainer.getWidgetCount ( ) ) == 1 ? contentContainer.getWidget ( 0 ) : null ; }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetContent ) ) { setPanelContent ( contentContainer , content ) ; } else if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetOverlay ) ) { overlayContainer.clear ( ) ; if ( content == null ) { contentContainer.setVisible ( true ) ; } else { overlayContainer.add ( content ) ; contentContainer.setVisible ( false ) ; } } else { super . setInSlot ( slot , content ) ; } }
Source:
public org.ovirt.engine.sdk.decorators.CpuProfile update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; if ( correlationId != null ) { headersBuilder.add ( "Correlation-Id" , correlationId ) ; } java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.CpuProfile.class , org.ovirt.engine.sdk.decorators.CpuProfile.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.CpuProfile update ( java.lang.Boolean async ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; if ( async != null ) { urlBuilder.add ( "async" , async , UrlParameterType.MATRIX ) ; } url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.CpuProfile.class , org.ovirt.engine.sdk.decorators.CpuProfile.class , headers ) ; }
Source:
public void shouldDetectInsufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 500 ) ; assertValidationFailure ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_MEMORY_ERROR ) ; }

Target:
public void shouldDetectInsufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 500 ) ; assertValidationFailure ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_MEMORY_ERROR ) ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; if ( getIsShareable ( ) . getIsChangable ( ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; } }
Source:
private void setupMock ( ) { vdsBrokerFrontend = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.VDSBrokerFrontend.class ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontend ) . when ( getQuery ( ) ) . getBackendResourceManager ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }

Target:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setmethod_id ( rs.getInt ( "method_id" ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "subscriber_id" ) ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setmethod_id ( rs.getInt ( "method_id" ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "subscriber_id" ) ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }
Source:
private static void removeUsbControllers ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > list = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceGeneralType.CONTROLLER , VmDeviceType.USB.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : list ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( vmDevice.getId ( ) ) ; } }

Target:
public static void addImportedDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , boolean isImportAsNewEntity ) { if ( isImportAsNewEntity ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setNewIdInImportedCollections ( vmBase ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToAdd = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToUpdate = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDiskDevices ( vmBase , vmDevicesToUpdate ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedInterfaces ( vmBase , vmDevicesToUpdate ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedOtherDevices ( vmBase , vmDevicesToAdd ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.saveAll ( vmDevicesToAdd ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.updateAll ( vmDevicesToUpdate ) ; }
Source:
private void removeVmStatelessImages ( ) { if ( getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }

Target:
private void removeVmStatelessImages ( ) { if ( getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.info ( "Deleting snapshot for stateless vm '{}'" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }
Source:
public void testFetchSpecificQuotaUsageForGlobalCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( null , FixturesTool.QUOTA_SPECIFIC ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.Assert.assertEquals ( 2 , quotaClusterList.size ( ) ) ; org.junit.Assert.assertNotNull ( quotaCluster ) ; }

Target:
public void testFetchSpecificQuotaUsageForGlobalCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( null , FixturesTool.QUOTA_SPECIFIC ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , quotaClusterList.size ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( quotaCluster ) ; }
Source:
public java.util.Date getVar_datetime ( ) { return this . var_datetime ; }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtohourly_3_4.AggregationToHourly.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToHourly ) { try { int length = 0 ; this . key = readString ( dis ) ; this . value = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachment ( java.lang.String id ) { return getEntity ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment.class , VdcQueryType.GetNetworkAttachmentById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuidOr404 ( id ) ) , "NetworkAttachment" ) ; }

Target:
private org.ovirt.engine.api.model.NetworkAttachments mapCollection ( java.util.List < org.ovirt.engine.api.model.NetworkAttachment > networkAttachments ) { org.ovirt.engine.api.model.NetworkAttachments collection = new org.ovirt.engine.api.model.NetworkAttachments ( ) ; for ( org.ovirt.engine.api.model.NetworkAttachment networkAttachmentEntity : networkAttachments ) { org.ovirt.engine.api.model.NetworkAttachment networkAttachmentModel = populate ( map ( networkAttachmentEntity ) , networkAttachmentEntity ) ; collection.getNetworkAttachments ( ) . add ( addLinks ( networkAttachmentModel , getParentClass ( ) ) ) ; } return collection ; }
Source:
public static void GetDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.roles > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.roles > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
private boolean isNetworkMtuInSync ( ) { boolean ifaceValueSetToDefaultMtu = ( iface.getMtu ( ) ) == ( org.ovirt.engine.core.utils.NetworkUtils.getDefaultMtu ( ) ) ; boolean bothUsesDefaultValue = ( network.isDefaultMtu ( ) ) && ifaceValueSetToDefaultMtu ; return bothUsesDefaultValue || ( ( iface.getMtu ( ) ) == ( network.getMtu ( ) ) ) ; }

Target:
private boolean isNetworkMtuInSync ( ) { return ( iface.getMtu ( ) ) == ( org.ovirt.engine.core.utils.NetworkUtils.getHostMtuActualValue ( network ) ) ; }
Source:
public void execute ( ) { java.util.List < org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread > operations = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( _numberOfOperations ) ; i ++ ) { operations.add ( new org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations.AsyncOpThread ( i ) ) ; } if ( ( _numberOfOperations ) > 0 ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.invokeAll ( operations ) ; } }

Target:
public void execute ( ) { java.util.List < org.ovirt.engine.core.utils.SynchronizeNumberOfAsyncOperations.AsyncOpThread > operations = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( _numberOfOperations ) ; i ++ ) { operations.add ( new org.ovirt.engine.core.utils.SynchronizeNumberOfAsyncOperations.AsyncOpThread ( i ) ) ; } if ( ( _numberOfOperations ) > 0 ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.invokeAll ( operations ) ; } }
Source:
public java.lang.Object runInTransaction ( ) { try { innerTransaction = org.ovirt.engine.core.utils.TransactionSupportTest.tm.getTransaction ( ) ; } catch ( javax.transaction.SystemException e ) { e.printStackTrace ( ) ; } org.ovirt.engine.core.common.businessentities.bookmarks c = dbFacade2.getBookmarkDAO ( ) . getByName ( "MyBookmark" ) ; c.setbookmark_value ( "test2" ) ; dbFacade2.getBookmarkDAO ( ) . update ( c ) ; throw new java.lang.RuntimeException ( ) ; }

Target:
public java.lang.Object runInTransaction ( ) { try { innerTransaction = org.ovirt.engine.core.utils.TransactionSupportTest.tm.getTransaction ( ) ; } catch ( javax.transaction.SystemException e ) { e.printStackTrace ( ) ; } org.ovirt.engine.core.common.businessentities.bookmarks c = dbFacade2.getBookmarkDao ( ) . getByName ( "MyBookmark" ) ; c.setbookmark_value ( "test2" ) ; dbFacade2.getBookmarkDao ( ) . update ( c ) ; throw new java.lang.RuntimeException ( ) ; }
Source:
private boolean validateAndAddViolation ( org.ovirt.engine.core.bll.ValidationResult validationResult , java.lang.String violatingEntity ) { if ( validationResult.isValid ( ) ) { return true ; } else { addViolation ( validationResult.getMessage ( ) , violatingEntity ) ; return false ; } }

Target:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_ATTACHMENT_NOT_EXISTS ) ; }
Source:
protected boolean validateVmNetwork ( ) { boolean retVal = true ; if ( ! ( org.ovirt.engine.core.bll.storage.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) { org.ovirt.engine.core.compat.Version version = org.ovirt.engine.core.bll.storage.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) ; retVal = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , version.getValue ( ) ) ; if ( ! retVal ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; } } return retVal ; }

Target:
protected boolean validateVmNetwork ( ) { boolean retVal = true ; if ( ! ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) { org.ovirt.engine.core.compat.Version version = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) ; retVal = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , version.getValue ( ) ) ; if ( ! retVal ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; } } return retVal ; }
Source:
public void bondWithNetworkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( "net" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = createBondSlaves ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , ifaces ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; ifaces.add ( bond ) ; parameters.setInterfaces ( ifaces ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }

Target:
public void bondWithNetworkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , "net" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = createNics ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , ifaces ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; ifaces.add ( bond ) ; parameters.setInterfaces ( ifaces ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }
Source:
public void initialize ( java.util.ArrayList parameters ) { super . initialize ( parameters ) ; if ( ! ( ( parameters.get ( 3 ) ) instanceof java.lang.Boolean ) ) { throw new org.ovirt.engine.core.bll.storage.InvalidOperationException ( ) ; } _isLastMaster = ( ( java.lang.Boolean ) ( parameters.get ( 3 ) ) ) ; if ( ! ( ( parameters.get ( 4 ) ) instanceof org.ovirt.engine.core.compat.Guid ) ) { throw new org.ovirt.engine.core.bll.storage.InvalidOperationException ( ) ; } _newMasterStorageDomainId = ( ( org.ovirt.engine.core.compat.Guid ) ( parameters.get ( 4 ) ) ) ; }

Target:
public void initialize ( java.util.ArrayList parameters ) { super . initialize ( parameters ) ; if ( ! ( ( parameters.get ( 3 ) ) instanceof java.lang.Boolean ) ) { throw new java.lang.IllegalArgumentException ( ) ; } _isLastMaster = ( ( java.lang.Boolean ) ( parameters.get ( 3 ) ) ) ; if ( ! ( ( parameters.get ( 4 ) ) instanceof org.ovirt.engine.core.compat.Guid ) ) { throw new java.lang.IllegalArgumentException ( ) ; } _newMasterStorageDomainId = ( ( org.ovirt.engine.core.compat.Guid ) ( parameters.get ( 4 ) ) ) ; }
Source:
private org.ovirt.engine.core.common.action.ActionReturnValue attachToAllClusters ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid networkId ) { org.ovirt.engine.core.common.queries.QueryReturnValue queryReturnValue = runInternalQuery ( QueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = queryReturnValue.getReturnValue ( ) ; return networkHelper.attachNetworkToClusters ( networkId , clusters.stream ( ) . map ( Cluster :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.action.ActionReturnValue addNetwork ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.network.Network network , boolean attachToAllClusters ) { org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( dataCenterId , network ) ; params.setVnicProfileRequired ( false ) ; if ( attachToAllClusters ) { params.setNetworkClusterList ( networkHelper.createNetworkClusters ( getAllClusterIdsInDataCenter ( dataCenterId ) ) ) ; } return runInternalAction ( ActionType.AddNetwork , params ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { originalVfsConfigs.add ( vfsConfig ) ; nicToVfsConfig.put ( vfsConfig.getNicId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( vfsConfig ) ) ; } queryFreeBonds ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; this . existingNetworkAttachments = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ) ( returnValue2 ) ) ; queryVfsConfig ( ) ; }
Source:
public void canDoActionFailureOnMovingCinderDisk ( ) { org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters = new org.ovirt.engine.core.common.action.MoveDiskParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , srcStorageId , dstStorageId ) ; command.getParameters ( ) . setParametersList ( java.util.Collections.singletonList ( moveDiskParameters ) ) ; initCinderDisk ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE ) ; }

Target:
public void validateFailureOnMovingCinderDisk ( ) { org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters = new org.ovirt.engine.core.common.action.MoveDiskParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , srcStorageId , dstStorageId ) ; command.getParameters ( ) . setParametersList ( java.util.Collections.singletonList ( moveDiskParameters ) ) ; initCinderDisk ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE ) ; }
Source:
protected org.ovirt.engine.core.common.action.ImportVmParameters createParameters ( ) { final org.ovirt.engine.core.common.businessentities.VM v = createVmWithSnapshots ( ) ; v.setName ( "testVm" ) ; return new org.ovirt.engine.core.common.action.ImportVmParameters ( v , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.action.ImportVmParameters createParameters ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = createVmWithSnapshots ( ) ; vm.setName ( "testVm" ) ; org.ovirt.engine.core.compat.Guid vdsGroupId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; vm.setVdsGroupId ( vdsGroupId ) ; return new org.ovirt.engine.core.common.action.ImportVmParameters ( vm , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , vdsGroupId ) ; }
Source:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; parameters.getInterfaces ( ) . add ( createVlan ( ( ( bond.getName ( ) ) + "1" ) , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACE_NOT_EXISTS ) ; }

Target:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; parameters.getInterfaces ( ) . add ( createVlan ( ( ( bond.getName ( ) ) + "1" ) , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_DONT_EXIST ) ; }
Source:
private org.ovirt.engine.api.model.VM createModel ( org.ovirt.engine.api.model.Disks disks ) { org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 2 ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( GUIDS [ 1 ] . toString ( ) ) ; model.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; model.getCluster ( ) . setId ( GUIDS [ 2 ] . toString ( ) ) ; if ( disks != null ) { model.setDisks ( disks ) ; } return model ; }

Target:
private org.ovirt.engine.api.model.Vm createModel ( org.ovirt.engine.api.model.Disks disks ) { org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 2 ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( GUIDS [ 1 ] . toString ( ) ) ; model.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; model.getCluster ( ) . setId ( GUIDS [ 2 ] . toString ( ) ) ; if ( disks != null ) { model.setDisks ( disks ) ; } return model ; }
Source:
public void getUsbPolicyUsbTypeNative ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "native" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }

Target:
public void getUsbPolicyUsbTypeNative ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "native" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }
Source:
public void validateFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; createVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskValidator.isDiskInterfaceSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskVmElement.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.mockito.Mockito.when ( command.getDiskValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.Disk.class ) ) ) . thenReturn ( diskValidator ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }

Target:
protected org.ovirt.engine.core.common.action.VmDiskOperationParameterBase createParameters ( ) { return new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( diskVmElement ) ; }
Source:
private void notifyAsyncTasks ( ) { final java.util.List < org.ovirt.engine.core.compat.Guid > asyncTasks = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getDbFacade ( ) . getAsyncTaskDao ( ) . getAsyncTaskIdsByEntity ( org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ! ( asyncTasks.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogableBase.setStorageDomain ( org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getStorageDomain ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( auditLogableBase , AuditLogType.STORAGE_DOMAIN_TASKS_ERROR ) ; } }

Target:
private void notifyAsyncTasks ( ) { final java.util.List < org.ovirt.engine.core.compat.Guid > asyncTasks = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getDbFacade ( ) . getAsyncTaskDao ( ) . getAsyncTaskIdsByEntity ( org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ! ( asyncTasks.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogableBase.setStorageDomain ( org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getStorageDomain ( ) ) ; auditLogDirector.log ( auditLogableBase , AuditLogType.STORAGE_DOMAIN_TASKS_ERROR ) ; } }
Source:
private void createCluster ( ) { cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setName ( org.ovirt.engine.core.bll.AddClusterCommandTest.CLUSTER_NAME ) ; cluster.setDescription ( org.ovirt.engine.core.bll.AddClusterCommandTest.CLUSTER_DESCRIPTION ) ; cluster.setStoragePoolId ( org.ovirt.engine.core.bll.AddClusterCommandTest.DATA_CENTER_ID ) ; cluster.setCpuName ( org.ovirt.engine.core.bll.AddClusterCommandTest.CPU_NAME ) ; cluster.setMaxVdsMemoryOverCommit ( org.ovirt.engine.core.bll.AddClusterCommandTest.MAX_VDS_MEMORY_OVER_COMMIT ) ; cluster.setCountThreadsAsCores ( org.ovirt.engine.core.bll.AddClusterCommandTest.COUNT_THREADS_AS_CORES ) ; cluster.setTransparentHugepages ( org.ovirt.engine.core.bll.AddClusterCommandTest.SET_TRANSPARENT_HUGE_PAGES ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.bll.AddClusterCommandTest.SET_COMPATIBILITY_VERSION ) ; cluster.setMigrateOnError ( org.ovirt.engine.core.bll.AddClusterCommandTest.MIGRATE_ON_ERROR ) ; cluster.setArchitecture ( org.ovirt.engine.core.bll.AddClusterCommandTest.ARCHITECTURE_TYPE ) ; }

Target:
public void setUp ( ) { mockDao ( ) ; mockBackend ( ) ; }