auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void cancelRecoveryJob ( org.ovirt.engine.core.compat.Guid vdsId ) { java.lang.String jobId = org.ovirt.engine.core.vdsbroker.VdsManager.recoveringJobIdMap.remove ( vdsId ) ; if ( jobId != null ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( "Cancelling the recovery from crash timer for VDS '{}' because cachedVds started initializing" , vdsId ) ; try { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( jobId ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( "Failed deleting job '{}' at cancelRecoveryJob: {}" , jobId , e.getMessage ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Exception" , e ) ; } } }

Target:
public static void cancelRecoveryJob ( org.ovirt.engine.core.compat.Guid vdsId ) { java.lang.String jobId = org.ovirt.engine.core.vdsbroker.VdsManager.recoveringJobIdMap.remove ( vdsId ) ; if ( jobId != null ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( "Cancelling the recovery from crash timer for VDS '{}' because vds started initializing" , vdsId ) ; try { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( jobId ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( "Failed deleting job '{}' at cancelRecoveryJob: {}" , jobId , e.getMessage ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Exception" , e ) ; } } }
Source:
private void processFence ( ) { org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( getVds ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Status ) ; if ( ( getVds ( ) . getpm_enabled ( ) ) && ( executor.findProxyHost ( ) ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = executor.fence ( ) ; fenceSucceeded = returnValue.getSucceeded ( ) ; fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; vdsProxyFound = true ; } }

Target:
private void processFence ( ) { org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( getVds ( ) ) ; vdsProxyFound = new org.ovirt.engine.core.bll.FenceProxyLocator ( getVds ( ) ) . isProxyHostAvailable ( ) ; if ( ( getVds ( ) . isPmEnabled ( ) ) && ( vdsProxyFound ) ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue = executor.checkHostStatus ( ) ; fenceSucceeded = returnValue.getSucceeded ( ) ; fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; } }
Source:
public void testGetEntityNameByIdAndTypeForVmTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = vmTemplateDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.VM_TEMPLATE_ID ) ; org.junit.Assert.assertNotNull ( vmTemplate ) ; java.lang.String name = vmTemplate.getName ( ) ; org.junit.Assert.assertEquals ( name , dao.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.VM_TEMPLATE_ID , VdcObjectType.VmTemplate ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForVmTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = vmTemplateDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.VM_TEMPLATE_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( vmTemplate ) ; java.lang.String name = vmTemplate.getName ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( name , dao.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.VM_TEMPLATE_ID , VdcObjectType.VmTemplate ) ) ; }
Source:
public boolean isCpuUpdatable ( java.lang.String cpuName , org.ovirt.engine.core.compat.Version ver ) { final org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager cpuFlagsManager = org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.get ( ver ) ; org.ovirt.engine.core.common.businessentities.ServerCpu server = null ; if ( cpuFlagsManager != null ) { server = cpuFlagsManager.getServerCpuByName ( cpuName ) ; } int serverLevel = ( server != null ) ? server.getLevel ( ) : 0 ; return serverLevel != 0 ; }

Target:
public boolean isCpuUpdatable ( java.lang.String cpuName , org.ovirt.engine.core.compat.Version ver ) { final org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager cpuFlagsManager = org.ovirt.engine.core.bll.CpuFlagsManagerHandler.managersDictionary.get ( ver ) ; org.ovirt.engine.core.common.businessentities.ServerCpu server = null ; if ( cpuFlagsManager != null ) { server = cpuFlagsManager.getServerCpuByName ( cpuName ) ; } int serverLevel = ( server != null ) ? server.getLevel ( ) : 0 ; return serverLevel != 0 ; }
Source:
private boolean isLocalDataCenterEmpty ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { if ( ( ( dataCenter != null ) && ( ( dataCenter.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) && ( ( dataCenter.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) ) { return true ; } return false ; }

Target:
private boolean isLocalDataCenterEmpty ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { if ( ( ( dataCenter != null ) && ( dataCenter.isLocal ( ) ) ) && ( ( dataCenter.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) ) { return true ; } return false ; }
Source:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel.getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > items = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup : org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel.getSelectedItems ( ) ) { items.add ( vdsGroup.getId ( ) ) ; } return items.toArray ( new java.lang.Object [ ] { } ) ; } }

Target:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel.getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > items = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel.getSelectedItems ( ) ) { items.add ( cluster.getId ( ) ) ; } return items.toArray ( new java.lang.Object [ ] { } ) ; } }
Source:
public void canSetNumaPinning ( ) { newNumaNodes = java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; final org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.Matchers.eq ( newNumaNodes ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void canSetNumaPinning ( ) { newNumaNodes = java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; final org.ovirt.engine.core.bll.numa.vm.AddVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.Matchers.eq ( newNumaNodes ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getAsyncTaskFromDb ( org.ovirt.engine.core.compat.Guid asyncTaskId ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( asyncTask != null ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTask ; }

Target:
private void initChildHierarchy ( ) { if ( ! ( childHierarchyInitialized ) ) { synchronized ( LOCK ) { if ( ! ( childHierarchyInitialized ) ) { childHierarchy.clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmd : getCommandsWithCallBackEnabled ( ) ) { buildCmdHierarchy ( cmd ) ; } } childHierarchyInitialized = true ; } } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > getVolumesInCluster ( java.lang.String cluster , java.util.Collection < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumesInCurrentCluster = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity currentVolume : volumes ) { if ( currentVolume.getVdsGroupName ( ) . equals ( cluster ) ) { volumesInCurrentCluster.add ( currentVolume ) ; } } return volumesInCurrentCluster ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > getVolumesInCluster ( java.lang.String cluster , java.util.Collection < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumesInCurrentCluster = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity currentVolume : volumes ) { if ( currentVolume.getClusterName ( ) . equals ( cluster ) ) { volumesInCurrentCluster.add ( currentVolume ) ; } } return volumesInCurrentCluster ; }
Source:
public static boolean isAdminUser ( org.ovirt.engine.core.common.interfaces.IVdcUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.roles > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAllForUserAndGroups ( user.getUserId ( ) , user.getGroupIds ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.roles r : userRoles ) { if ( ( r.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debugFormat ( "LoginAdminUser: User logged to admin using role {0}" , r.getname ( ) ) ; } return true ; } } return false ; }

Target:
public static boolean isAdminUser ( org.ovirt.engine.core.common.interfaces.IVdcUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAllForUserAndGroups ( user.getUserId ( ) , user.getGroupIds ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Role r : userRoles ) { if ( ( r.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debugFormat ( "LoginAdminUser: User logged to admin using role {0}" , r.getname ( ) ) ; } return true ; } } return false ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel vmGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > networks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ) ( returnValue ) ) ; vmGuideModel.networks = networks ; vmGuideModel.AddNetworkPostData ( ) ; }

Target:
private void AddNetworkUpdateData ( ) { nics = null ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetVmNicList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel vmGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > nics = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ) ( returnValue ) ) ; vmGuideModel.nics = nics ; vmGuideModel.AddNetworkPostData ( ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
private int calculateValue ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { int res = 0 ; if ( networkCluster != null ) { if ( networkCluster.isManagement ( ) ) { res += 10 ; } if ( networkCluster.isDisplay ( ) ) { res += 2 ; } if ( networkCluster.isMigration ( ) ) { res += 1 ; } } return res ; }

Target:
private int calculateValue ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { int res = 0 ; if ( networkCluster != null ) { if ( networkCluster.isManagement ( ) ) { res += 10 ; } if ( networkCluster.isDisplay ( ) ) { res += 4 ; } if ( networkCluster.isMigration ( ) ) { res += 2 ; } if ( networkCluster.isGluster ( ) ) { res += 1 ; } } return res ; }
Source:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return returnValue == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ) ( returnValue ) ) ; }
Source:
public int countDownBricks ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { int downCount = 0 ; int upCount = 0 ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick : volume.getBricks ( ) ) { if ( ( brick.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ) { upCount ++ ; } else { downCount ++ ; } if ( ( upCount > 0 ) && ( downCount > 0 ) ) { return downCount ; } } return downCount ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( volume == null ) { return ; } org.ovirt.engine.ui.frontend.utils.GlusterVolumeUtils.VolumeStatus status = org.ovirt.engine.ui.frontend.utils.GlusterVolumeUtils.getVolumeStatus ( volume ) ; com.google.gwt.resources.client.ImageResource statusImage = getStatusImage ( status ) ; java.lang.String tooltip = getToolTip ( status ) ; com.google.gwt.safehtml.shared.SafeHtml statusImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( statusImage ) . getHTML ( ) ) ; sb.append ( applicationTemplates.statusTemplate ( statusImageHtml , tooltip ) ) ; }
Source:
public void testUpdate ( ) { existingAsyncTask.setstatus ( AsyncTaskStatusEnum.aborting ) ; existingAsyncTask.setresult ( AsyncTaskResultEnum.failure ) ; existingAsyncTask.setActionType ( ActionType.AddDisk ) ; dao.update ( existingAsyncTask ) ; org.ovirt.engine.core.common.businessentities.AsyncTask result = dao.get ( existingAsyncTask.getTaskId ( ) ) ; org.junit.Assert.assertEquals ( existingAsyncTask , result ) ; }

Target:
public void testUpdate ( ) { existingAsyncTask.setstatus ( AsyncTaskStatusEnum.aborting ) ; existingAsyncTask.setresult ( AsyncTaskResultEnum.failure ) ; existingAsyncTask.setActionType ( ActionType.AddDisk ) ; dao.update ( existingAsyncTask ) ; org.ovirt.engine.core.common.businessentities.AsyncTask result = dao.get ( existingAsyncTask.getTaskId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingAsyncTask , result ) ; }
Source:
public void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { 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.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }

Target:
public void getClusterFeaturesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void testAddIncompleteParameters ( ) { setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.setUpBasicUriExpectations ( ) ) ; try { collection.add ( new org.ovirt.engine.api.model.Tag ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Tag" , "add" , "id|name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) { setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( new org.ovirt.engine.api.model.Tag ( ) ) ) , "Tag" , "add" , "id|name" ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator validator = new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , getDeletedProvider ( ) ) ; return ( validate ( validator.providerIsSet ( ) ) ) && ( validate ( validator.providerNetworksNotUsed ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator validator = new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , getDeletedProvider ( ) ) ; return ( ( validate ( validator.providerIsSet ( ) ) ) && ( validate ( validator.providerNetworksNotUsed ( ) ) ) ) && ( validateRemoveProvider ( ) ) ; }
Source:
public void testParseSingle ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three=3" , "one=bool,two=int,three=bool" ) ; assertNotNull ( ret ) ; assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; }

Target:
public void testParseSingle ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three=3" , "one=bool,two=int,three=bool" ) ; org.junit.Assert.assertNotNull ( ret ) ; org.junit.Assert.assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getDisksList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , disk.getstorage_ids ( ) . get ( 0 ) , disk.getActualSize ( ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getDisksList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , disk.getActualSize ( ) ) ) ; } return list ; }
Source:
public void testCleanExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( "VdcUser" ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , "VdcUser" ) ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ) ; org.mockito.Mockito.verify ( dbUserDAOMcok ) . removeUserSessions ( org.mockito.Matchers.anyMap ( ) ) ; }

Target:
public void testCleanExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; org.mockito.Mockito.verify ( dbUserDAOMcok ) . removeUserSessions ( org.mockito.Matchers.anyMap ( ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; if ( shouldPerformOvfUpdate ( ) ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase parameters = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.ProcessOvfUpdateForStoragePool , parameters , null ) ; runInternalActionWithTasksContext ( VdcActionType.ProcessOvfUpdateForStorageDomain , createProcessOvfUpdateForDomainParams ( ) , null ) ; } if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.noAsyncOperations ( ) ) { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; if ( shouldPerformOvfUpdate ( ) ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase parameters = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.ProcessOvfUpdateForStoragePool , parameters , null ) ; runInternalAction ( VdcActionType.UpdateOvfStoreForStorageDomain , createUpdateOvfStoreParams ( ) , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getContext ( ) ) ; } if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.noAsyncOperations ( ) ) { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRemove" ) ) { OnRemove ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRemove" ) ) { onRemove ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }
Source:
public boolean IsDisplayTypeSupported ( org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { switch ( displayType ) { case vnc : return true ; case qxl : return ( ( clientOsType ( ) . equalsIgnoreCase ( "Windows" ) ) && ( clientBrowserType ( ) . equalsIgnoreCase ( "Explorer" ) ) ) || ( ( clientOsType ( ) . equalsIgnoreCase ( "Linux" ) ) && ( clientBrowserType ( ) . equalsIgnoreCase ( "Firefox" ) ) ) ; } return false ; }

Target:
public boolean IsDisplayTypeSupported ( org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { switch ( displayType ) { case vnc : return true ; case qxl : return ( isClientWindownsExplorer ( ) ) || ( isClientLinuxFirefox ( ) ) ; } return false ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( storage.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = null ; retVal = executeVerb ( storage ) ; buildOvfReturnValue ( retVal.getReturnValue ( ) ) ; } else { org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getQueryReturnValue ( ) . setReturnValue ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( storage.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = null ; retVal = executeVerb ( storage ) ; buildOvfReturnValue ( retVal.getReturnValue ( ) ) ; } else { org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getQueryReturnValue ( ) . setReturnValue ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ) ; } }
Source:
public void testInterfaceIsValidSlaveWhenInterfaceIsBond ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setBonded ( true ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NIC_NAME , vdsNetworkInterface.getName ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , matcher ) ; }

Target:
public void testInterfaceIsValidSlaveWhenInterfaceIsBond ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setBonded ( true ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NIC_NAME , vdsNetworkInterface.getName ( ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , matcher ) ; }
Source:
private java.lang.String getConstraint ( ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; buffer.append ( "Providers: type=" ) ; buffer.append ( ProviderType.OPENSTACK_NETWORK.name ( ) ) ; java.lang.String query = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , null , modelType , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( query ) ) { buffer.append ( " AND (" ) ; buffer.append ( query ) ; buffer.append ( ")" ) ; } return buffer.toString ( ) ; }

Target:
private java.lang.String getConstraint ( java.lang.String providerType ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; buffer.append ( "Providers: type=" ) ; buffer.append ( providerType ) ; java.lang.String query = org.ovirt.engine.api.restapi.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , null , modelType , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( query ) ) { buffer.append ( " AND (" ) ; buffer.append ( query ) ; buffer.append ( ")" ) ; } return buffer.toString ( ) ; }
Source:
public void testRemoveForcedIncomplete ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.model.Action ( ) { { } } ) ) ; }

Target:
public void testRemoveForcedIncomplete ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 ) ; setUpGetBallooningExpectations ( ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.model.Action ( ) { { } } ) ) ; }
Source:
public void testChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( jedi1 , jedi2 ) ; org.junit.Assert.assertTrue ( "Should be 1 changes" , ( ( changes.size ( ) ) == 1 ) ) ; }

Target:
public void testChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.getChangedFields ( jedi1 , jedi2 ) ; org.junit.Assert.assertTrue ( "Should be 1 changes" , ( ( changes.size ( ) ) == 1 ) ) ; }
Source:
public void testGetAllForUsersAndGroupsInvalidUserAndGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > result = dao.getAllForUserAndGroups ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) . toString ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllForUsersAndGroupsInvalidUserAndGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > result = dao.getAllForUserAndGroups ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }
Source:
protected void updateDataCenterVersion ( ) { org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; model.setDataCenterVersion ( storagePool.getCompatibilityVersion ( ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterById ( query , getEntity ( ) . getStoragePoolId ( ) ) ; }

Target:
protected void updateDataCenterVersion ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery < org.ovirt.engine.core.common.businessentities.StoragePool > query = new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { setDataCenterVersion ( storagePool.getCompatibilityVersion ( ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterById ( query , getEntity ( ) . getStoragePoolId ( ) ) ; }
Source:
protected boolean canDoAction ( ) { loadStorageDomain ( ) ; org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) ; if ( ! ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) ) { return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { loadStorageDomain ( ) ; if ( ! ( org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) ; if ( ! ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) ) { return false ; } } return true ; }
Source:
public void testRemoveAllButOne ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity newHook = getGlusterHook ( ) ; newHook.setId ( FixturesTool.NEW_HOOK_ID ) ; dao.save ( newHook ) ; java.util.List < org.ovirt.engine.core.compat.Guid > hookIds = new java.util.ArrayList < > ( ) ; hookIds.add ( FixturesTool.HOOK_ID ) ; hookIds.add ( FixturesTool.HOOK_ID2 ) ; dao.removeAll ( hookIds ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > hooks = dao.getByClusterId ( FixturesTool.GLUSTER_CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( hooks ) ; org.junit.Assert.assertEquals ( 1 , hooks.size ( ) ) ; }

Target:
public void testRemoveAllButOne ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity newHook = getGlusterHook ( ) ; newHook.setId ( FixturesTool.NEW_HOOK_ID ) ; dao.save ( newHook ) ; java.util.List < org.ovirt.engine.core.compat.Guid > hookIds = new java.util.ArrayList < > ( ) ; hookIds.add ( FixturesTool.HOOK_ID ) ; hookIds.add ( FixturesTool.HOOK_ID2 ) ; dao.removeAll ( hookIds ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > hooks = dao.getByClusterId ( FixturesTool.GLUSTER_CLUSTER_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( hooks ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , hooks.size ( ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.File model , int index ) { org.junit.Assert.assertEquals ( NAMES [ index ] , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertNotNull ( model.getStorageDomain ( ) ) ; org.junit.Assert.assertEquals ( GUIDS [ 0 ] . toString ( ) , model.getStorageDomain ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.File model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( model.getStorageDomain ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ 0 ] . toString ( ) , model.getStorageDomain ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
private void listenOnSelectedItemChanged ( org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { modelProvider.getModel ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ! ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) ) { getView ( ) . setNotSelected ( model.IsVmUp ( ) ) ; } else { getView ( ) . setSelected ( ) ; } } } ) ; }

Target:
private void listenOnSelectedItemChanged ( org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { modelProvider.getModel ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) ) { getView ( ) . setNotSelected ( model.IsVmUp ( ) ) ; } else { getView ( ) . setSelected ( ) ; } } } ) ; }
Source:
private void fixExternalEncoding ( ) throws java.io.IOException { for ( int i = 0 ; i < ( source.size ( ) ) ; i ++ ) { java.lang.String line = source.get ( i ) ; if ( line.matches ( "^ExternalEncoding = '[^']*'$" ) ) { line = "ExternalEncoding = 'UTF-8'" ; source.set ( i , line ) ; } } }

Target:
private void removeExternalEncoding ( ) throws java.io.IOException { for ( int i = 0 ; i < ( source.size ( ) ) ; i ++ ) { java.lang.String line = source.get ( i ) ; line = line.replace ( ".encode(ExternalEncoding)" , "" ) ; source.set ( i , line ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn allocateVolume ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String volUUID , java.lang.String size ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.allocate" ) . withParameter ( "volumeID" , volUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "size" , size ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }

Target:
public java.util.concurrent.FutureTask < java.util.Map < java.lang.String , java.lang.Object > > timeBoundPollConfirmConnectivity ( final long timeout , final java.util.concurrent.TimeUnit unit ) { return timeBoundPollInternal ( timeout , unit , "Host.confirmConnectivity" ) ; }
Source:
public void shouldDetectTooMuchHostNodes ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertValidationFailure ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_PREFERRED_NOT_PINNED_TO_SINGLE_NODE ) ; }

Target:
public void shouldDetectTooMuchHostNodes ( ) { vm.setvNumaNodeList ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; assertValidationFailure ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_PREFERRED_NOT_PINNED_TO_SINGLE_NODE ) ; }
Source:
protected javax.ws.rs.core.Response performNonBlockingAction ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.api.model.Action action ) { try { doNonBlockingAction ( task , params ) ; if ( action != null ) { action.setStatus ( CreationStatus.IN_PROGRESS.value ( ) ) ; return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . entity ( action ) . build ( ) ; } else { return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . build ( ) ; } } catch ( java.lang.Exception e ) { return handleError ( javax.ws.rs.core.Response.class , e , false ) ; } }

Target:
protected javax.ws.rs.core.Response performNonBlockingAction ( org.ovirt.engine.core.common.action.ActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.api.model.Action action ) { try { doNonBlockingAction ( task , params ) ; if ( action != null ) { action.setStatus ( CreationStatus.IN_PROGRESS.value ( ) ) ; return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . entity ( action ) . build ( ) ; } else { return javax.ws.rs.core.Response.status ( Response.Status.ACCEPTED ) . build ( ) ; } } catch ( java.lang.Exception e ) { return handleError ( javax.ws.rs.core.Response.class , e , false ) ; } }
Source:
public void postUpdateNumOfSockets2 ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfCPUsPerSocket ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; } } , getModel ( ) . getHash ( ) ) , version ) ; }

Target:
public void updateMaxNumOfVmCpus ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmCpus ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxCpus = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.postUpdateNumOfSockets2 ( ) ; } } ) , version ) ; }