auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }
Source:
public void testFetchVmDisks ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > disks = org.ovirt.engine.core.utils.OvfUtils.fetchVmDisks ( xmlDocument ) ; org.junit.Assert.assertNotNull ( "The list of disks should not be null" , disks ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , ( ! ( disks.isEmpty ( ) ) ) ) ; }

Target:
public void testFetchVmDisks ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > disks = ovfUtils.fetchVmDisks ( xmlDocument ) ; org.junit.Assert.assertNotNull ( "The list of disks should not be null" , disks ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , ( ! ( disks.isEmpty ( ) ) ) ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue runFenceAction ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { auditFenceAction ( action , agent , proxyHost ) ; org.ovirt.engine.core.common.businessentities.FenceAgent realAgent = new org.ovirt.engine.core.common.businessentities.FenceAgent ( agent ) ; realAgent.setType ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( agent.getType ( ) ) ) ; realAgent.setOptions ( getOptions ( agent ) ) ; return getBackend ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.FenceVds , new org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters ( proxyHost.getId ( ) , _vds.getId ( ) , realAgent , action , fencingPolicy ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue runFenceAction ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { auditFenceAction ( action , agent , proxyHost ) ; org.ovirt.engine.core.common.businessentities.FenceAgent realAgent = new org.ovirt.engine.core.common.businessentities.FenceAgent ( agent ) ; realAgent.setType ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( agent.getType ( ) ) ) ; realAgent.setOptions ( getOptions ( agent , proxyHost ) ) ; return getBackend ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.FenceVds , new org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters ( proxyHost.getId ( ) , _vds.getId ( ) , realAgent , action , convertFencingPolicy ( proxyHost ) ) ) ; }
Source:
private void updateProperties ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; this . consoleUserName = vm.getConsoleCurentUserName ( ) ; this . guestUserName = vm.getGuestCurentUserName ( ) ; }

Target:
private void updateProperties ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; this . consoleUserName = vm.getConsoleCurentUserName ( ) ; this . guestUserName = vm.getGuestCurentUserName ( ) ; this . clientIp = vm.getClientIp ( ) ; }
Source:
public void testUpdateImageVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; dao.updateImageVmSnapshotId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID , guid ) ; org.ovirt.engine.core.common.businessentities.storage.Image imageFromDb = dao.get ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID ) ; org.junit.Assert.assertNotNull ( imageFromDb ) ; org.junit.Assert.assertEquals ( "Image snapshot id wasn't updated properly" , guid , imageFromDb.getSnapshotId ( ) ) ; }

Target:
public void testUpdateImageVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; dao.updateImageVmSnapshotId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID , guid ) ; org.ovirt.engine.core.common.businessentities.storage.Image imageFromDb = dao.get ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( imageFromDb ) ; org.junit.jupiter.api.Assertions.assertEquals ( guid , imageFromDb.getSnapshotId ( ) , "Image snapshot id wasn't updated properly" ) ; }
Source:
public void testResolveNetworkExclusivenessValidatorEveryLegacyVersion ( ) { for ( int i = 0 ; i < 6 ; i ++ ) { final org.ovirt.engine.core.compat.Version version = new org.ovirt.engine.core.compat.Version ( 3 , i ) ; final org.ovirt.engine.core.bll.validator.network.NetworkExclusivenessValidator actual = underTest.resolveNetworkExclusivenessValidator ( java.util.Collections.singleton ( version ) ) ; org.junit.Assert.assertThat ( ( ( version.getValue ( ) ) + " supposed to return the legacy validator" ) , actual , org.hamcrest.CoreMatchers.sameInstance ( legacyNetworkExclusivenessValidator ) ) ; } }

Target:
public void testResolveNetworkExclusivenessValidatorEveryLegacyVersion ( ) { final org.ovirt.engine.core.compat.Version version = org.ovirt.engine.core.compat.Version.v3_5 ; final org.ovirt.engine.core.bll.validator.network.NetworkExclusivenessValidator actual = underTest.resolveNetworkExclusivenessValidator ( java.util.Collections.singleton ( version ) ) ; org.junit.Assert.assertThat ( ( ( version.getValue ( ) ) + " supposed to return the legacy validator" ) , actual , org.hamcrest.CoreMatchers.sameInstance ( legacyNetworkExclusivenessValidator ) ) ; }
Source:
private static boolean IsLegalStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { boolean result ; switch ( status ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : case Reboot : case Installing : case Connecting : case Kdumping : result = true ; break ; default : result = false ; break ; } return result ; }

Target:
private static boolean isLegalStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { boolean result ; switch ( status ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : case Reboot : case Installing : case Connecting : case Kdumping : result = true ; break ; default : result = false ; break ; } return result ; }
Source:
private void setBondOptions ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity , org.ovirt.engine.ui.uicommonweb.models.hosts.SetupNetworksBondModel bondDialogModel ) { java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > BondPair = bondDialogModel.getBondingOptions ( ) . getSelectedItem ( ) ; java.lang.String key = BondPair.getKey ( ) ; entity.setBondOptions ( ( "custom" . equals ( key ) ? BondPair.getValue ( ) . getEntity ( ) : key ) ) ; }

Target:
private void setBondOptions ( org.ovirt.engine.core.common.action.CreateOrUpdateBond bond , org.ovirt.engine.ui.uicommonweb.models.hosts.SetupNetworksBondModel bondDialogModel ) { java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > BondPair = bondDialogModel.getBondingOptions ( ) . getSelectedItem ( ) ; java.lang.String key = BondPair.getKey ( ) ; bond.setBondOptions ( ( "custom" . equals ( key ) ? BondPair.getValue ( ) . getEntity ( ) : key ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.ServerCpu getVdsGroupServerCpu ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { org.ovirt.engine.core.common.businessentities.ServerCpu retVal = null ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu cpu : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( model.getCPU ( ) . getItems ( ) ) ) ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( cpu.getCpuName ( ) , vdsGroup.getcpu_name ( ) ) ) { retVal = cpu ; break ; } } return retVal ; }

Target:
private org.ovirt.engine.core.common.businessentities.ServerCpu getVdsGroupServerCpu ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { org.ovirt.engine.core.common.businessentities.ServerCpu retVal = null ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu cpu : model.getCPU ( ) . getItems ( ) ) { if ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( cpu.getCpuName ( ) , vdsGroup.getcpu_name ( ) ) ) { retVal = cpu ; break ; } } return retVal ; }
Source:
public void canDoActionFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.Raid0 , null , null , java.util.Arrays.asList ( storageDevice ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }
Source:
protected boolean updateVnicForBackwardCompatibility ( org.ovirt.engine.core.common.businessentities.network.VmNic oldNic ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , oldNic , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( org.ovirt.engine.core.common.businessentities.network.VmNic oldNic ) { if ( ! ( validate ( backwardCompatibilityVnicHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , oldNic , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) ) ) ) ) { return false ; } return true ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return model.getPauseCommand ( ) ; }

Target:
public com.google.gwt.event.dom.client.HasClickHandlers addRunButton ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( ( model.getIsPool ( ) ? constants.takeVm ( ) : constants.runVm ( ) ) , resources.playIcon ( ) , resources.playDisabledIcon ( ) , style.runButtonAdditionalStyle ( ) ) ; button.setElementId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , "runButton" ) ) ; addButtonToPanel ( button ) ; updateButton ( button , command ) ; return button ; }
Source:
protected java.lang.String getProgressText ( T object ) { java.lang.Integer progressValue = org.ovirt.engine.ui.webadmin.widget.table.column.QuotaPercentColumn.getProgressValue ( object ) ; if ( ( progressValue != null ) && ( progressValue > 100 ) ) { return getaApplicationConstants ( ) . exceeded ( ) ; } if ( ( progressValue != null ) && ( progressValue < 0 ) ) { return getaApplicationConstants ( ) . unlimited ( ) ; } return progressValue != null ? progressValue + "%" : "0%" ; }

Target:
protected java.lang.String getProgressText ( T object ) { java.lang.Integer progressValue = org.ovirt.engine.ui.webadmin.widget.table.column.AbstractQuotaPercentColumn.getProgressValue ( object ) ; if ( ( progressValue != null ) && ( progressValue > 100 ) ) { return getaApplicationConstants ( ) . exceeded ( ) ; } if ( ( progressValue != null ) && ( progressValue < 0 ) ) { return getaApplicationConstants ( ) . unlimited ( ) ; } return progressValue != null ? progressValue + "%" : "0%" ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.RepoImage getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.storage.RepoImage image = control.createMock ( org.ovirt.engine.core.common.businessentities.storage.RepoImage.class ) ; org.easymock.EasyMock.expect ( image.getRepoImageId ( ) ) . andReturn ( GUIDS [ index ] . toString ( ) ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( image.getRepoImageName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return image ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.RepoImage getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.storage.RepoImage image = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.storage.RepoImage.class ) ; org.mockito.Mockito.when ( image.getRepoImageId ( ) ) . thenReturn ( GUIDS [ index ] . toString ( ) ) ; org.mockito.Mockito.when ( image.getRepoImageName ( ) ) . thenReturn ( NAMES [ index ] ) ; return image ; }
Source:
protected void setUpGetPayloadExpectations ( int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmPayload getPayloadModel ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; payload.setType ( VmDeviceType.CDROM ) ; payload.setContent ( org.ovirt.engine.api.restapi.resource.BackendVmResourceTest.PAYLOAD_COMTENT ) ; payload.setContent ( new java.lang.String ( org.apache.commons.codec.binary.Base64.decodeBase64 ( payload.getContent ( ) ) ) ) ; return payload ; }
Source:
public static void GetDataCentersWithPermittedActionOnClusters ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDataCentersWithPermittedActionOnClusters , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public static void GetPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }
Source:
public void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addLabels ( org.ovirt.engine.core.common.businessentities.network.NicLabel ... nicLabels ) { if ( emptyParameters ( nicLabels ) ) { return this ; } if ( ( parameters.getLabels ( ) ) == null ) { parameters.setLabels ( new java.util.HashSet < org.ovirt.engine.core.common.businessentities.network.NicLabel > ( ) ) ; } parameters.getLabels ( ) . addAll ( java.util.Arrays.asList ( nicLabels ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addLabels ( org.ovirt.engine.core.common.businessentities.network.NicLabel ... nicLabels ) { if ( nullParameters ( nicLabels ) ) { return this ; } if ( ( parameters.getLabels ( ) ) == null ) { parameters.setLabels ( new java.util.HashSet < > ( ) ) ; } parameters.getLabels ( ) . addAll ( java.util.Arrays.asList ( nicLabels ) ) ; return this ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Integer > event ) { int newInterval = event.getValue ( ) ; if ( timer.isActive ( ) ) { if ( newInterval != ( timer.getRefreshRate ( ) ) ) { timer.stop ( ) ; timer.setRefreshRate ( newInterval ) ; timer.start ( ) ; } } else { timer.setRefreshRate ( newInterval ) ; } }

Target:
public void onGridTimerStateChange ( org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent event ) { int newInterval = event.getRefreshRate ( ) ; if ( timer.isActive ( ) ) { if ( newInterval != ( timer.getRefreshRate ( ) ) ) { timer.stop ( ) ; timer.setRefreshRate ( newInterval ) ; timer.start ( ) ; } } else { timer.setRefreshRate ( newInterval ) ; } }
Source:
public static boolean CanAttachVmTo ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > message ) { boolean returnValue = true ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStaticDAO ( ) . get ( vmId ) ; if ( vmStatic == null ) { message.add ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND.toString ( ) ) ; returnValue = false ; } if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . getVmPoolMapByVmGuid ( vmId ) ) != null ) { returnValue = false ; message.add ( VdcBllMessages.USER_CANNOT_ATTACH_TO_VM_IN_POOL.toString ( ) ) ; } return returnValue ; }

Target:
public static boolean CanAttachVmTo ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > message ) { boolean returnValue = true ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStaticDao ( ) . get ( vmId ) ; if ( vmStatic == null ) { message.add ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND.toString ( ) ) ; returnValue = false ; } if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolMapByVmGuid ( vmId ) ) != null ) { returnValue = false ; message.add ( VdcBllMessages.USER_CANNOT_ATTACH_TO_VM_IN_POOL.toString ( ) ) ; } return returnValue ; }
Source:
protected void writeAdditionalJsData ( javax.servlet.http.HttpServletRequest request , java.io.PrintWriter writer ) { super . writeAdditionalJsData ( request , writer ) ; java.lang.Integer applicationMode = getApplicationMode ( request ) ; if ( applicationMode != null ) { java.util.Map < java.lang.String , java.lang.String > appModeData = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; appModeData.put ( "value" , java.lang.String.valueOf ( applicationMode ) ) ; writeJsObject ( writer , "applicationMode" , appModeData ) ; } }

Target:
protected void writeAdditionalJsData ( javax.servlet.http.HttpServletRequest request , java.io.PrintWriter writer ) { super . writeAdditionalJsData ( request , writer ) ; writeApplicationMode ( request , writer ) ; writePluginDefinitions ( writer ) ; }
Source:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.ClusterDaoTest.NUMBER_OF_GROUPS_FOR_PRIVELEGED_USER , result.size ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) , existingCluster ) ; }

Target:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.ClusterDaoTest.NUMBER_OF_GROUPS_FOR_PRIVELEGED_USER , result.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( result.iterator ( ) . next ( ) , existingCluster ) ; }
Source:
public static void GetVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.GetVmsRunningOnOrMigratingToVdsParameters ( id ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public static void IsBackendAvailable ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( true ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > GetNicTypeList ( org.ovirt.engine.core.common.businessentities.VmOsType osType , boolean hasDualmode ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.values ( ) ) ) ; list.remove ( VmInterfaceType.rtl8139_pv ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( osType ) ) { if ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP ) ) && hasDualmode ) { list.add ( VmInterfaceType.rtl8139_pv ) ; } } return list ; }
Source:
protected boolean validate ( ) { if ( ( ! ( super . validate ( ) ) ) || ( ! ( org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.checkStorageDomain ( ) ) ) ) { return false ; } oldDomain = org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomain ( ) . setLastTimeUsedAsMaster ( oldDomain.getLastTimeUsedAsMaster ( ) ) ; return validateStoragePropertiesUpdate ( ) ; }

Target:
protected boolean validate ( ) { if ( ( ! ( super . validate ( ) ) ) || ( ! ( org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.checkStorageDomain ( ) ) ) ) { return false ; } oldDomain = storageDomainStaticDao.get ( org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand.getStorageDomain ( ) . setLastTimeUsedAsMaster ( oldDomain.getLastTimeUsedAsMaster ( ) ) ; return validateStoragePropertiesUpdate ( ) ; }
Source:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) . getUserId ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) , org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCurrentUser ( ) . getUserId ( ) ) ) ) ) { return false ; } return true ; }
Source:
private boolean initVirtResources ( ) { if ( InitializeStorage ( ) ) { processFence ( ) ; processStoragePoolStatus ( ) ; } else { java.util.Map < java.lang.String , java.lang.String > customLogValues = java.util.Collections.singletonMap ( "StoragePoolName" , getStoragePoolName ( ) ) ; setNonOperational ( NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE , customLogValues ) ; return false ; } return true ; }

Target:
private boolean initVirtResources ( ) { if ( InitializeStorage ( ) ) { processFence ( ) ; processStoragePoolStatus ( ) ; runUpdateMomPolicy ( getVdsGroup ( ) , getVds ( ) ) ; } else { java.util.Map < java.lang.String , java.lang.String > customLogValues = java.util.Collections.singletonMap ( "StoragePoolName" , getStoragePoolName ( ) ) ; setNonOperational ( NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE , customLogValues ) ; return false ; } return true ; }
Source:
public java.lang.String setValue ( java.lang.String value ) throws java.security.GeneralSecurityException { java.lang.String returnedValue = null ; java.lang.String password = null ; try { password = extractPasswordValue ( value ) ; if ( org.apache.commons.lang.StringUtils.isBlank ( password ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } returnedValue = encrypt ( password ) ; } catch ( java.lang.Throwable e ) { java.lang.String msg = "Failed to encrypt the current value" ; org.apache.log4j.Logger.getLogger ( org.ovirt.engine.core.config.EngineConfig.class ) . debug ( msg , e ) ; throw new java.security.GeneralSecurityException ( msg ) ; } return returnedValue ; }

Target:
public java.lang.String setValue ( java.lang.String value ) throws java.security.GeneralSecurityException { java.lang.String returnedValue = null ; java.lang.String password = null ; try { password = extractPasswordValue ( value ) ; if ( org.apache.commons.lang.StringUtils.isBlank ( password ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } returnedValue = encrypt ( password ) ; } catch ( java.lang.Throwable e ) { java.lang.String msg = "Failed to encrypt the current value" ; org.ovirt.engine.core.config.entity.helper.PasswordValueHelper.log.error ( msg , e ) ; throw new java.security.GeneralSecurityException ( msg ) ; } return returnedValue ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getGlusterVolume ( ) ; if ( volume.isOnline ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_UP ) ; addCanDoActionMessage ( java.lang.String.format ( "$volumeName %1$s" , volume.getName ( ) ) ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getGlusterVolume ( ) ; if ( volume.isOnline ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_UP ) ; addCanDoActionMessageVariable ( "volumeName" , volume.getName ( ) ) ; return false ; } return true ; }
Source:
public void addTag ( org.ovirt.engine.core.common.businessentities.Tags tag ) { if ( tagsMapByID.containsKey ( tag.getparent_id ( ) ) ) { org.ovirt.engine.core.common.businessentities.Tags parent = tagsMapByID.get ( tag.getparent_id ( ) ) ; parent.getChildren ( ) . add ( tag ) ; addTagToHash ( tag ) ; addTagToHash ( parent ) ; } else { org.ovirt.engine.core.bll.TagsDirector.log.error ( "Trying to add tag '{}', parent doesn't exist in Data Structure - '{}'" , tag.gettag_name ( ) , tag.getparent_id ( ) ) ; } }

Target:
public void addTag ( org.ovirt.engine.core.common.businessentities.Tags tag ) { if ( tagsMapByID.containsKey ( tag.getParentId ( ) ) ) { org.ovirt.engine.core.common.businessentities.Tags parent = tagsMapByID.get ( tag.getParentId ( ) ) ; parent.getChildren ( ) . add ( tag ) ; addTagToHash ( tag ) ; addTagToHash ( parent ) ; } else { org.ovirt.engine.core.bll.TagsDirector.log.error ( "Trying to add tag '{}', parent doesn't exist in Data Structure - '{}'" , tag.getTagName ( ) , tag.getParentId ( ) ) ; } }
Source:
protected org.ovirt.engine.core.bll.CommandBase < ? > constructCommand ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , boolean runAsInternal , org.ovirt.engine.core.bll.context.CommandContext context ) { org.ovirt.engine.core.bll.job.ExecutionHandler.evaluateCorrelationId ( parameters ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( actionType , parameters ) ; command.setInternalExecution ( runAsInternal ) ; command.setContext ( context ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , actionType , runAsInternal ) ; return command ; }

Target:
public void addChildCommandInfo ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.action.VdcActionType vdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters ) { childCommandInfoMap.put ( id , new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > ( vdcActionType , parameters ) ) ; }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void endActionOnDisks ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.VmCommand.getParameters ( ) . getImagesParameters ( ) ) { if ( overrideChildCommandSuccess ( ) ) { p.setTaskGroupSuccess ( org.ovirt.engine.core.bll.VmCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ; } org.ovirt.engine.core.bll.VmCommand.getBackend ( ) . EndAction ( ( ( p.getCommandType ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ? getChildActionType ( ) : p.getCommandType ( ) ) , p ) ; } }

Target:
protected void endActionOnDisks ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParametersForChildCommand ( ) ) { if ( overrideChildCommandSuccess ( ) ) { p.setTaskGroupSuccess ( org.ovirt.engine.core.bll.VmCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ; } org.ovirt.engine.core.bll.VmCommand.getBackend ( ) . EndAction ( ( ( p.getCommandType ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ? getChildActionType ( ) : p.getCommandType ( ) ) , p ) ; } }
Source:
private org.ovirt.engine.core.bll.adbroker.UserAuthenticationResult handleDirectorySearcherException ( java.lang.Exception ex ) { org.ovirt.engine.core.bll.adbroker.UserAuthenticationResult authResult = null ; org.ovirt.engine.core.common.errors.VdcBllMessages errorMsg = org.ovirt.engine.core.common.errors.VdcBllMessages.USER_FAILED_TO_AUTHENTICATE ; if ( ex instanceof org.ovirt.engine.core.bll.adbroker.AuthenticationResultException ) { org.ovirt.engine.core.bll.adbroker.AuthenticationResultException authResultException = ( ( org.ovirt.engine.core.bll.adbroker.AuthenticationResultException ) ( ex ) ) ; org.ovirt.engine.core.utils.kerberos.AuthenticationResult result = authResultException.getResult ( ) ; if ( result == null ) { result = org.ovirt.engine.core.utils.kerberos.AuthenticationResult.OTHER ; } errorMsg = org.ovirt.engine.core.common.errors.VdcBllMessages.valueOf ( result.getVdcBllMessage ( ) ) ; org.ovirt.engine.core.bll.adbroker.LdapAuthenticateUserCommand.log.error ( result.getDetailedMessage ( ) ) ; } authResult = new org.ovirt.engine.core.bll.adbroker.UserAuthenticationResult ( errorMsg ) ; return authResult ; }

Target:
private void handleDirectorySearcherException ( java.lang.Exception ex ) { org.ovirt.engine.core.bll.adbroker.UserAuthenticationResult authResult = null ; org.ovirt.engine.api.extensions.AAAExtensionException aaaException = null ; if ( ex instanceof org.ovirt.engine.core.bll.adbroker.AuthenticationResultException ) { org.ovirt.engine.core.bll.adbroker.AuthenticationResultException authResultException = ( ( org.ovirt.engine.core.bll.adbroker.AuthenticationResultException ) ( ex ) ) ; org.ovirt.engine.core.utils.kerberos.AuthenticationResult result = authResultException.getResult ( ) ; if ( result == null ) { result = org.ovirt.engine.core.utils.kerberos.AuthenticationResult.OTHER ; } org.ovirt.engine.core.bll.adbroker.LdapAuthenticateUserCommand.log.error ( result.getDetailedMessage ( ) ) ; throw new org.ovirt.engine.api.extensions.AAAExtensionException ( authResultToExceptionMap.get ( result ) , "" ) ; } }
Source:
public void canDoActionFailsWithClusterDoesNotSupportGluster ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( false ) ) . when ( vdsGroupDao ) . get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; }

Target:
public void validateFailsWithClusterDoesNotSupportGluster ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( false ) ) . when ( vdsGroupDao ) . get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; }
Source:
private void setUpDiskValidations ( ) { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskImagesValidator ) . diskImagesNotLocked ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskImagesValidator ) . diskImagesNotIllegal ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyList ( ) ) ; }

Target:
private void setUpDiskValidations ( ) { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskImagesValidator ) . diskImagesNotLocked ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskImagesValidator ) . diskImagesNotIllegal ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForAllDisks ( org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) ) ; }
Source:
public void testValidate ( ) { org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter ( ) ; assertTrue ( "1" , comp.validateFieldValue ( "SIZE" , "1" ) ) ; assertTrue ( "123" , comp.validateFieldValue ( "SIZE" , "123" ) ) ; assertFalse ( "JarJar" , comp.validateFieldValue ( "SIZE" , "JarJar" ) ) ; }

Target:
public void testValidate ( ) { org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter ( ) ; org.junit.Assert.assertTrue ( "1" , comp.validateFieldValue ( "SIZE" , "1" ) ) ; org.junit.Assert.assertTrue ( "123" , comp.validateFieldValue ( "SIZE" , "123" ) ) ; org.junit.Assert.assertFalse ( "JarJar" , comp.validateFieldValue ( "SIZE" , "JarJar" ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkAttachmentDao ( ) ; networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNicId ( FixturesTool.VDS_NETWORK_INTERFACE ) ; networkAttachment.setProperties ( new java.util.HashMap < > ( ) ) ; networkAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; networkAttachment.setNetworkId ( FixturesTool.NETWORK_ENGINE ) ; networkAttachment.setIpConfiguration ( createIpConfiguration ( Ipv4BootProtocol.DHCP , Ipv4BootProtocol.NONE ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkAttachmentDao ( ) ; networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNicId ( FixturesTool.VDS_NETWORK_INTERFACE ) ; networkAttachment.setProperties ( new java.util.HashMap < > ( ) ) ; networkAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; networkAttachment.setNetworkId ( FixturesTool.NETWORK_ENGINE ) ; networkAttachment.setIpConfiguration ( createIpConfiguration ( Ipv4BootProtocol.DHCP , Ipv6BootProtocol.AUTOCONF ) ) ; }
Source:
public void getHostListByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( ) ; org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAO2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAO2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO2 ) . when ( cmd ) . getStoragePoolDAO ( ) ; cpuExists ( ) ; cpuManufacturersMatch ( ) ; canDoActionFailedWithReason ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }

Target:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( ) ; org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAO2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAO2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO2 ) . when ( cmd ) . getStoragePoolDAO ( ) ; setupCpu ( ) ; canDoActionFailedWithReason ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }