auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void fillImagesMapBasedOnTemplate ( org.ovirt.engine.core.common.businessentities.VmTemplate template , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > diskInfoDestinationMap , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > destStorages , boolean notCheckSize ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( template.getStoragePoolId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesMapBasedOnTemplate ( template , domains , diskInfoDestinationMap , destStorages , notCheckSize ) ; }

Target:
public static void fillImagesMapBasedOnTemplate ( org.ovirt.engine.core.common.businessentities.VmTemplate template , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > diskInfoDestinationMap , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > destStorages ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( template.getStoragePoolId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesMapBasedOnTemplate ( template , domains , diskInfoDestinationMap , destStorages ) ; }
Source:
public void executeSave ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateNetwork , new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getSelectedDc ( ) . getId ( ) , getNetwork ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; postSaveAction ( null , ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) ) ; } } , null ) ; }

Target:
public void executeSave ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateNetwork , new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getSelectedDc ( ) . getId ( ) , getNetwork ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result.getReturnValue ( ) ; postSaveAction ( null , ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) ) ; } } , null ) ; }
Source:
public void onSuccess ( java.lang.Object nothing , java.lang.Object returnValue ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > idToIconMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; this . cache.putAll ( idToIconMap ) ; final java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > result = this . getIcons ( iconIds ) ; callback.onSuccess ( result ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > idToIconMap = returnValue.getReturnValue ( ) ; this . cache.putAll ( idToIconMap ) ; final java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > result = this . getIcons ( iconIds ) ; callback.onSuccess ( result ) ; }
Source:
< T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < ? extends org.ovirt.engine.core.compat.NGuid > > void updateActionButtonCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command , org.ovirt.engine.ui.webadmin.plugin.api.ActionButtonInterface actionButtonInterface , java.util.List < T > selectedItems ) { boolean isEnabled = true ; isEnabled = org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.invokeAndGetResultAsBoolean ( actionButtonInterface.isEnabled ( ) , org.ovirt.engine.ui.webadmin.plugin.entity.EntityObject.arrayFrom ( selectedItems ) , null , isEnabled ) ; command.setIsExecutionAllowed ( isEnabled ) ; boolean isAccessible = true ; isAccessible = org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.invokeAndGetResultAsBoolean ( actionButtonInterface.isAccessible ( ) , org.ovirt.engine.ui.webadmin.plugin.entity.EntityObject.arrayFrom ( selectedItems ) , null , isAccessible ) ; command.setIsAvailable ( isAccessible ) ; }

Target:
public boolean isAccessible ( java.util.List < T > selectedItems ) { return org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.invokeAndGetResultAsBoolean ( actionButtonInterface.isAccessible ( ) , org.ovirt.engine.ui.webadmin.plugin.entity.EntityObject.arrayFrom ( selectedItems ) , null , true ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.Quota getQuotaByQuotaName ( java.lang.String quotaName , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "quota_name" , quotaName ) ; quotaParameterSource.addValue ( "storage_pool_id" , storagePoolId ) ; org.ovirt.engine.core.common.businessentities.Quota quotaEntity = getCallsHandler ( ) . executeRead ( "GetQuotaByQuotaName" , getQuotaFromResultSet ( ) , quotaParameterSource ) ; return quotaEntity ; }

Target:
public org.ovirt.engine.core.common.businessentities.Quota getQuotaByQuotaName ( java.lang.String quotaName , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "quota_name" , quotaName ) ; quotaParameterSource.addValue ( "storage_pool_id" , storagePoolId ) ; return getCallsHandler ( ) . executeRead ( "GetQuotaByQuotaName" , getQuotaFromResultSet ( ) , quotaParameterSource ) ; }
Source:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = addClusterCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( permissions.size ( ) , 2 ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( cluster.getStoragePoolId ( ) , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.StoragePool , permissionSubject.getObjectType ( ) ) ; }

Target:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = addClusterCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( 2 , permissions.size ( ) ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( cluster.getStoragePoolId ( ) , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.StoragePool , permissionSubject.getObjectType ( ) ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Nic model = new org.ovirt.engine.api.model.Nic ( ) ; model.setName ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Nic" , "add" , "name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Nic model = new org.ovirt.engine.api.model.Nic ( ) ; model.setName ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Nic" , "add" , "name" ) ; } }
Source:
protected void doChangeDefautlHost ( org.ovirt.engine.core.compat.NGuid hostGuid ) { if ( hostGuid != null ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( hostGuid.getValue ( ) ) ; getModel ( ) . getDefaultHost ( ) . setItems ( java.util.Arrays.asList ( vds ) ) ; } super . doChangeDefautlHost ( hostGuid ) ; }

Target:
protected void doChangeDefautlHost ( org.ovirt.engine.core.compat.Guid hostGuid ) { if ( hostGuid != null ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( hostGuid ) ; getModel ( ) . getDefaultHost ( ) . setItems ( java.util.Arrays.asList ( vds ) ) ; } super . doChangeDefautlHost ( hostGuid ) ; }
Source:
private static void interfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private static void interfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; return ! ( siblingVlanInterfaces.isEmpty ( ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.FORCE , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.FORCE , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomainForDisk ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; domain.setStorageType ( storageType ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( domain.getId ( ) ) ) ) ; org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.injectorRule.bind ( org.ovirt.engine.core.dao.StorageDomainDao.class , storageDomainDao ) ; org.mockito.Mockito.when ( storageDomainDao.get ( domain.getId ( ) ) ) . thenReturn ( domain ) ; return domain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomainForDisk ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; domain.setStorageType ( storageType ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( domain.getId ( ) ) ) ) ; org.mockito.Mockito.when ( storageDomainDao.get ( domain.getId ( ) ) ) . thenReturn ( domain ) ; return domain ; }
Source:
protected void updateMemoryBalloon ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; java.lang.Integer osType = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster != null ) && ( osType != null ) ) { updateMemoryBalloon ( cluster.getCompatibilityVersion ( ) , osType ) ; } }

Target:
protected void updateMemoryBalloon ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; java.lang.Integer osType = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster != null ) && ( osType != null ) ) { updateMemoryBalloon ( getModel ( ) . getCompatibilityVersion ( ) , osType ) ; } }
Source:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full endAction" ) ; } }

Target:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full endAction" ) ; } }
Source:
public void loadVmsFromExportDomain ( ) { clearProblem ( ) ; startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) , exportDomain.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; } } ) ) ; }

Target:
public void loadVmsFromExportDomain ( ) { clearProblem ( ) ; startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) , exportDomain.getEntity ( ) . getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; } } ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage_pool extractStoragePoolFromQuota ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool ; org.ovirt.engine.core.common.businessentities.Quota quota = org.ovirt.engine.core.bll.quota.QuotaManager.getQuotaDAO ( ) . getById ( quotaId ) ; storagePool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; if ( quota != null ) { storagePool.setId ( quota.getStoragePoolId ( ) ) ; storagePool.setQuotaEnforcementType ( quota.getQuotaEnforcementType ( ) ) ; } else { storagePool.setId ( Guid.Empty ) ; storagePool.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.DISABLED ) ; } return storagePool ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage_pool extractStoragePoolFromQuota ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool ; org.ovirt.engine.core.common.businessentities.Quota quota = getQuotaDAO ( ) . getById ( quotaId ) ; storagePool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; if ( quota != null ) { storagePool.setId ( quota.getStoragePoolId ( ) ) ; storagePool.setQuotaEnforcementType ( quota.getQuotaEnforcementType ( ) ) ; } else { storagePool.setId ( Guid.Empty ) ; storagePool.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.DISABLED ) ; } return storagePool ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbGroupDao ( ) ; newGroup = new org.ovirt.engine.core.common.businessentities.aaa.DbGroup ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setExternalId ( "0" ) ; newGroup.setDomain ( "domain" ) ; newGroup.setName ( "name" ) ; newGroup.setActive ( true ) ; newGroup.setNamespace ( "*" ) ; existingGroup = dao.get ( new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbGroupDao ( ) ; newGroup = new org.ovirt.engine.core.common.businessentities.aaa.DbGroup ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setExternalId ( "0" ) ; newGroup.setDomain ( "domain" ) ; newGroup.setName ( "name" ) ; newGroup.setNamespace ( "*" ) ; existingGroup = dao.get ( new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ) ; }
Source:
private void UpdateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.network network = ( ( org.ovirt.engine.core.common.businessentities.network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangeble = ( ( getIsStaticAddress ( ) ) && ( network != null ) ) && ( ! ( network.getId ( ) . equals ( NGuid.Empty ) ) ) ; getAddress ( ) . setIsChangable ( isChangeble ) ; getSubnet ( ) . setIsChangable ( isChangeble ) ; getGateway ( ) . setIsChangable ( isChangeble ) ; }

Target:
private void UpdateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.Network network = ( ( org.ovirt.engine.core.common.businessentities.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangeble = ( ( getIsStaticAddress ( ) ) && ( network != null ) ) && ( ! ( network.getId ( ) . equals ( NGuid.Empty ) ) ) ; getAddress ( ) . setIsChangable ( isChangeble ) ; getSubnet ( ) . setIsChangable ( isChangeble ) ; getGateway ( ) . setIsChangable ( isChangeble ) ; }
Source:
public void storageDomainName ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.storage_domains s = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; s.setstorage_name ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setStorageDomain ( s ) ; final java.lang.String n = b.getStorageDomainName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }

Target:
public void storageDomainName ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setstorage_name ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setStorageDomain ( s ) ; final java.lang.String n = b.getStorageDomainName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } final org.ovirt.engine.core.bll.MacPoolValidator validator = new org.ovirt.engine.core.bll.MacPoolValidator ( getMacPoolEntity ( ) ) ; return ( validate ( validator.defaultPoolFlagIsNotSet ( ) ) ) && ( validate ( validator.hasUniqueName ( ) ) ) ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } final org.ovirt.engine.core.bll.MacPoolValidator validator = new org.ovirt.engine.core.bll.MacPoolValidator ( getMacPoolEntity ( ) ) ; return ( validate ( validator.defaultPoolFlagIsNotSet ( ) ) ) && ( validate ( validator.hasUniqueName ( ) ) ) ; }
Source:
public void tearDown ( ) throws java.lang.Exception { org.mockito.Mockito.verify ( queryStartEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.Empty ) ; org.mockito.Mockito.verify ( queryCompleteEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.Empty ) ; org.junit.Assert.assertEquals ( "Context should be 'test'" , org.ovirt.engine.ui.frontend.Frontend.getCurrentContext ( ) , "test" ) ; }

Target:
public void tearDown ( ) throws java.lang.Exception { org.mockito.Mockito.verify ( queryStartEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.Empty ) ; org.mockito.Mockito.verify ( queryCompleteEvent , org.mockito.Mockito.atLeastOnce ( ) ) . raise ( org.ovirt.engine.ui.frontend.Frontend.class , EventArgs.Empty ) ; org.junit.Assert.assertEquals ( "Context should be 'test'" , frontend.getCurrentContext ( ) , "test" ) ; }
Source:
public static void getExternalNetworkMap ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.HashMap < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }

Target:
public void getExternalNetworkMap ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.HashMap < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmd = dbFacade.getCommandEntityDao ( ) . get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertNotNull ( cmd ) ; dbFacade.getCommandEntityDao ( ) . remove ( getExistingEntityId ( ) ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdAfterRemoval = dbFacade.getCommandEntityDao ( ) . get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertNull ( cmdAfterRemoval ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmd = dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertNotNull ( cmd ) ; dao.remove ( getExistingEntityId ( ) ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdAfterRemoval = dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertNull ( cmdAfterRemoval ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , org.ovirt.engine.core.common.utils.VmDeviceType device , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean plugged , java.lang.Boolean readOnly , java.lang.String address , java.util.Map < java.lang.String , java.lang.String > customProp ) { org.ovirt.engine.core.common.businessentities.VmDevice managedDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , type , device , specParams , plugged , readOnly , customProp ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { managedDevice.setAddress ( address ) ; } return managedDevice ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , org.ovirt.engine.core.common.utils.VmDeviceType device , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean plugged , java.lang.Boolean readOnly , java.lang.String address , java.util.Map < java.lang.String , java.lang.String > customProp ) { org.ovirt.engine.core.common.businessentities.VmDevice managedDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , type , device , specParams , plugged , readOnly , customProp , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { managedDevice.setAddress ( address ) ; } return managedDevice ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRestoreCommand ( ) ) ) { restore ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "CancelConfirm" ) ) { cancelConfirm ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRestoreCommand ( ) ) ) { restore ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } else if ( "CancelConfirm" . equals ( command.getName ( ) ) ) { cancelConfirm ( ) ; } }
Source:
public static org.ovirt.engine.api.model.Snapshot map ( java.lang.String configuration , org.ovirt.engine.api.model.ConfigurationType type , org.ovirt.engine.api.model.Snapshot snapshot ) { snapshot.setInitialization ( new org.ovirt.engine.api.model.Initialization ( ) ) ; snapshot.getInitialization ( ) . setConfiguration ( new org.ovirt.engine.api.model.Configuration ( ) ) ; snapshot.getInitialization ( ) . getConfiguration ( ) . setData ( configuration ) ; snapshot.getInitialization ( ) . getConfiguration ( ) . setType ( type.value ( ) ) ; return snapshot ; }

Target:
public static org.ovirt.engine.api.model.Snapshot map ( java.lang.String configuration , org.ovirt.engine.api.model.ConfigurationType type , org.ovirt.engine.api.model.Snapshot snapshot ) { snapshot.setInitialization ( new org.ovirt.engine.api.model.Initialization ( ) ) ; snapshot.getInitialization ( ) . setConfiguration ( new org.ovirt.engine.api.model.Configuration ( ) ) ; snapshot.getInitialization ( ) . getConfiguration ( ) . setData ( configuration ) ; snapshot.getInitialization ( ) . getConfiguration ( ) . setType ( type ) ; return snapshot ; }
Source:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setactive ( true ) ; disk.setvm_guid ( vmId ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.powermock.api.mockito.PowerMockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( true ) ; }

Target:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setactive ( true ) ; disk.setvm_guid ( vmId ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( true ) ; }
Source:
protected org.ovirt.engine.api.model.HostStorage postPopulate ( org.ovirt.engine.api.model.HostStorage from ) { from.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageType.class ) . value ( ) ) ; org.ovirt.engine.api.model.LogicalUnit unit = new org.ovirt.engine.api.model.LogicalUnit ( ) ; unit.setId ( from.getId ( ) ) ; from.getLogicalUnits ( ) . unsetLogicalUnits ( ) ; from.getLogicalUnits ( ) . getLogicalUnits ( ) . add ( unit ) ; return from ; }

Target:
protected org.ovirt.engine.api.model.HostStorage postPopulate ( org.ovirt.engine.api.model.HostStorage from ) { from.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageType.class ) ) ; org.ovirt.engine.api.model.LogicalUnit unit = new org.ovirt.engine.api.model.LogicalUnit ( ) ; unit.setId ( from.getId ( ) ) ; from.getLogicalUnits ( ) . unsetLogicalUnits ( ) ; from.getLogicalUnits ( ) . getLogicalUnits ( ) . add ( unit ) ; return from ; }
Source:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( getDisplayType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean isSpice = ( getGraphicsType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE ) ; boolean clusterSupportsSinglePci = ( Version.v3_3.compareTo ( getCompatibilityVersion ( ) ) ) <= 0 ; return ( ( isLinux && isQxl ) && isSpice ) && clusterSupportsSinglePci ; }

Target:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( getDisplayType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean isSpice = ( getGraphicsType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE ) ; return ( isLinux && isQxl ) && isSpice ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getEditConsoleCommand ( ) ) ) { editConsole ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnEditConsoleSave" ) ) { onEditConsoleSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , Model.CANCEL_COMMAND ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getEditConsoleCommand ( ) ) ) { editConsole ( ) ; } else if ( "OnEditConsoleSave" . equals ( command.getName ( ) ) ) { onEditConsoleSave ( ) ; } else if ( Model.CANCEL_COMMAND.equals ( command.getName ( ) ) ) { cancel ( ) ; } }
Source:
private void mockDiskVmElementValidatorPassDiscardValidation ( org.ovirt.engine.core.common.businessentities.storage.Disk disk , org.ovirt.engine.core.common.businessentities.storage.DiskVmElement diskVmElement , org.ovirt.engine.core.bll.ValidationResult validationResult ) { org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidator diskVmElementValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidator ( disk , diskVmElement ) ) ; org.mockito.Mockito.doReturn ( diskVmElementValidator ) . when ( multipleDiskVmElementValidator ) . createDiskVmElementValidator ( disk , diskVmElement ) ; org.mockito.Mockito.doReturn ( validationResult ) . when ( diskVmElementValidator ) . isPassDiscardSupported ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
private void mockDiskVmElementValidatorPassDiscardValidation ( org.ovirt.engine.core.common.businessentities.storage.Disk disk , org.ovirt.engine.core.common.businessentities.storage.DiskVmElement diskVmElement , org.ovirt.engine.core.bll.ValidationResult validationResult ) { org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidator diskVmElementValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidator ( disk , diskVmElement ) ) ; org.mockito.Mockito.doReturn ( diskVmElementValidator ) . when ( multipleDiskVmElementValidator ) . createDiskVmElementValidator ( disk , diskVmElement ) ; org.mockito.Mockito.doReturn ( validationResult ) . when ( diskVmElementValidator ) . isPassDiscardSupported ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel clusterNetworkListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > dcNetworks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel networkToManage = createNetworkList ( dcNetworks ) ; clusterNetworkListModel.setWindow ( networkToManage ) ; networkToManage.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . assignDetachNetworksTitle ( ) ) ; networkToManage.setHashName ( "assign_networks" ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel clusterNetworkListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > dcNetworks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel networkToManage = createNetworkList ( dcNetworks ) ; clusterNetworkListModel.setWindow ( networkToManage ) ; networkToManage.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . assignDetachNetworksTitle ( ) ) ; networkToManage.setHashName ( "assign_networks" ) ; }
Source:
public void testUpdateWhenNoTasks ( ) { tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( volumeDao , org.mockito.Mockito.times ( 0 ) ) . updateVolumeTask ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.VOL_GUIDS [ 0 ] , null ) ; org.mockito.Mockito.verify ( volumeDao , org.mockito.Mockito.times ( 0 ) ) . updateVolumeTask ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.VOL_GUIDS [ 1 ] , null ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 0 ) ) . endStepJob ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }

Target:
public void testUpdateWhenNoTasks ( ) { tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( volumeDao , org.mockito.Mockito.times ( 0 ) ) . updateVolumeTask ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.VOL_GUIDS [ 0 ] , null ) ; org.mockito.Mockito.verify ( volumeDao , org.mockito.Mockito.times ( 0 ) ) . updateVolumeTask ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.VOL_GUIDS [ 1 ] , null ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 0 ) ) . endStepJob ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( ( getParameters ( ) ) == null ) || ( ( getParameters ( ) . getQuotaId ( ) ) == null ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; return false ; } org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; if ( quota == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; return false ; } if ( getDbFacade ( ) . getQuotaDAO ( ) . isQuotaInUse ( quota ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IN_USE_BY_VM_OR_DISK ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( ( getParameters ( ) ) == null ) || ( ( getParameters ( ) . getQuotaId ( ) ) == null ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; return false ; } org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; if ( quota == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; return false ; } if ( getQuotaDAO ( ) . isQuotaInUse ( quota ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IN_USE_BY_VM_OR_DISK ) ; return false ; } return true ; }
Source:
protected org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters param = new org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters ( vmPools , testVm , VM_COUNT , DISK_SIZE ) ; param.setStorageDomainId ( firstStorageDomainId ) ; org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > ( param ) { @ java.lang.Override protected void initTemplate ( ) { } } ) ; command.postConstruct ( ) ; return command ; }

Target:
protected org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters param = new org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters ( vmPools , testVm , VM_COUNT , DISK_SIZE ) ; param.setStorageDomainId ( firstStorageDomainId ) ; org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > ( param ) { @ java.lang.Override protected void initTemplate ( ) { } } ) ; return command ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( vm == null ) { return ; } updatePropertiesFromPoolRepresentant ( vm ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { if ( returnValue != null ) { org.ovirt.engine.core.common.businessentities.VM vm = returnValue.getReturnValue ( ) ; if ( vm == null ) { return ; } updatePropertiesFromPoolRepresentant ( vm ) ; } }
Source:
protected void synchronizeNics ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > nics , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; vmInterfaceManager.removeAll ( true , vmId ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmInterface : nics ) { if ( ( vmInterface.getId ( ) ) == null ) { vmInterface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } vmInterface.setVmId ( vmId ) ; vmInterfaceManager.add ( vmInterface , compensationContext ) ; } }

Target:
protected void synchronizeNics ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > nics , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; vmInterfaceManager.removeAll ( true , vmId ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmInterface : nics ) { if ( ( vmInterface.getId ( ) ) == null ) { vmInterface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } vmInterface.setVmId ( vmId ) ; vmInterfaceManager.add ( vmInterface , compensationContext , false ) ; } }
Source:
public void testPatternBasedNameFails ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( initializeMock ( 1 , 1 ) ) ; cmd.getParameters ( ) . getVm ( ) . setName ( "aa-??bb" ) ; org.junit.Assert.assertFalse ( "Pattern-based name should not be supported for VM" , cmd.validateInputs ( ) ) ; }

Target:
public void testPatternBasedNameFails ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( initializeMock ( 1 ) ) ; cmd.getParameters ( ) . getVm ( ) . setName ( "aa-??bb" ) ; org.junit.Assert.assertFalse ( "Pattern-based name should not be supported for VM" , cmd.validateInputs ( ) ) ; }
Source:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVmId ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , true , true , getImagesList ( ) ) ; }

Target:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , true , true , getImagesList ( ) ) ; }
Source:
private org.ovirt.engine.core.common.action.FenceAgentCommandParameterBase getAddParameters ( org.ovirt.engine.api.model.Agent agent ) { org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setId ( hostId ) ; agent.setHost ( host ) ; org.ovirt.engine.core.common.action.FenceAgentCommandParameterBase params = new org.ovirt.engine.core.common.action.FenceAgentCommandParameterBase ( ) ; params.setAgent ( map ( agent , null ) ) ; return params ; }

Target:
private org.ovirt.engine.core.common.action.FenceAgentCommandParameterBase getAddParameters ( org.ovirt.engine.api.model.Agent agent ) { org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setId ( hostId.toString ( ) ) ; agent.setHost ( host ) ; org.ovirt.engine.core.common.action.FenceAgentCommandParameterBase params = new org.ovirt.engine.core.common.action.FenceAgentCommandParameterBase ( ) ; params.setAgent ( map ( agent , null ) ) ; return params ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ ( ( NAMES.length ) - 1 ) ] } , setUpStorageDomains ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ ( ( NAMES.length ) - 1 ) ] } , setUpStorageDomains ( ) , failure ) ; }
Source:
public void setup ( ) { org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap.put ( 0 , "other" ) ; org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap.put ( 1 , "rhel_x" ) ; org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap.put ( 2 , "rhel_x_y" ) ; org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap.put ( 3 , "windows_2008" ) ; org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap.put ( 4 , "windows_2008_R2" ) ; org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap.put ( 5 , "windows_2008_R2x64" ) ; completer = new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap ) ; }

Target:
public void setup ( ) { completer = new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.core.searchbackend.OsValueAutoCompleterTest.completionMap ) ; }
Source:
public org.ovirt.engine.core.compat.NGuid getStoragePoolId ( ) { if ( ( super . getStoragePoolId ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.VmCommand.getVm ( ) ; if ( vm != null ) { setStoragePoolId ( vm.getstorage_pool_id ( ) ) ; } } return super . getStoragePoolId ( ) ; }

Target:
public org.ovirt.engine.core.compat.NGuid getStoragePoolId ( ) { if ( ( super . getStoragePoolId ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.VmCommand.getVm ( ) ; if ( vm != null ) { setStoragePoolId ( vm.getStoragePoolId ( ) ) ; } } return super . getStoragePoolId ( ) ; }
Source:
protected void postSaveAction ( org.ovirt.engine.core.compat.Guid networkGuid , boolean succeeded ) { if ( succeeded ) { if ( ( ( java.lang.Boolean ) ( getIsVmNetwork ( ) . getEntity ( ) ) ) ) { performProfilesActions ( networkGuid ) ; } else { stopProgress ( ) ; cancel ( ) ; } } stopProgress ( ) ; }

Target:
protected void postSaveAction ( org.ovirt.engine.core.compat.Guid networkGuid , boolean succeeded ) { if ( succeeded ) { if ( ( ( java.lang.Boolean ) ( getIsVmNetwork ( ) . getEntity ( ) ) ) ) { performProfilesActions ( networkGuid ) ; stopProgress ( ) ; } else { stopProgress ( ) ; cancel ( ) ; } } }